@jant/core 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/bin/lib/site-snapshot.js +10 -0
  2. package/dist/{app-CKQ9PqAr.js → app-CbOZ2Irh.js} +7988 -5166
  3. package/dist/client/.vite/manifest.json +47 -47
  4. package/dist/client/_assets/chunks/{create-editor-BQkrw8Ax.js → create-editor-hWapNE40.js} +25 -25
  5. package/dist/client/_assets/chunks/footnote-rail-9zwl6jtV.js +2 -0
  6. package/dist/client/_assets/chunks/{settings-paths-B0bNUaih.js → settings-paths-BBVT8zKj.js} +1 -1
  7. package/dist/client/_assets/chunks/{slug-format-CYmQE5ln.js → slug-format-BuCPjSrB.js} +1 -1
  8. package/dist/client/_assets/chunks/sortable-list-DJXwkaOv.js +2 -0
  9. package/dist/client/_assets/chunks/types-DrYFqJH2.js +1 -0
  10. package/dist/client/_assets/chunks/unsafe-svg-CUrgo4Xg.js +1 -0
  11. package/dist/client/_assets/{client-Dp46QSht.js → client-BO8GOFfT.js} +12 -12
  12. package/dist/client/_assets/client-D8Rrsd73.css +2 -0
  13. package/dist/client/_assets/{client-auth-CG55rWb5.js → client-auth-CsUGM718.js} +1 -1
  14. package/dist/client/_assets/client-author-QPm1whbO.css +2 -0
  15. package/dist/client/_assets/client-compose-BB4U7Wz0.js +2004 -0
  16. package/dist/client/_assets/{client-manage-DnYdQAhf.js → client-manage-CI9-eh-8.js} +1 -1
  17. package/dist/client/_assets/{client-settings-CHgsIqXJ.js → client-settings-BnGPuqwc.js} +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/node.js +3 -2
  20. package/package.json +1 -1
  21. package/src/app.tsx +9 -0
  22. package/src/client/components/compose-types.ts +1 -0
  23. package/src/client/components/jant-compose-dialog.ts +1 -0
  24. package/src/client/components/jant-compose-editor.ts +30 -0
  25. package/src/client/components/jant-compose-fullscreen.ts +1 -0
  26. package/src/client/compose-bridge.ts +61 -1
  27. package/src/client/feed-video-player.ts +6 -0
  28. package/src/client/tiptap/bubble-menu.ts +25 -2
  29. package/src/client/tiptap/create-editor.ts +2 -0
  30. package/src/client/tiptap/extensions.ts +4 -0
  31. package/src/client/video-processor.ts +106 -52
  32. package/src/client/view-confirm.ts +108 -0
  33. package/src/client.ts +1 -0
  34. package/src/db/migrations/0035_brainy_next_avengers.sql +9 -0
  35. package/src/db/migrations/0036_gorgeous_smasher.sql +7 -0
  36. package/src/db/migrations/meta/0035_snapshot.json +2877 -0
  37. package/src/db/migrations/meta/0036_snapshot.json +2924 -0
  38. package/src/db/migrations/meta/_journal.json +14 -0
  39. package/src/db/migrations/pg/0033_cute_magdalene.sql +10 -0
  40. package/src/db/migrations/pg/0034_material_agent_brand.sql +8 -0
  41. package/src/db/migrations/pg/meta/0033_snapshot.json +3719 -0
  42. package/src/db/migrations/pg/meta/0034_snapshot.json +3766 -0
  43. package/src/db/migrations/pg/meta/_journal.json +14 -0
  44. package/src/db/pg/schema.ts +40 -0
  45. package/src/db/schema.ts +61 -0
  46. package/src/i18n/locales/public/en.po +5 -0
  47. package/src/i18n/locales/public/en.ts +1 -1
  48. package/src/i18n/locales/public/zh-Hans.po +5 -0
  49. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  50. package/src/i18n/locales/public/zh-Hant.po +5 -0
  51. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  52. package/src/i18n/locales/settings/en.po +149 -0
  53. package/src/i18n/locales/settings/en.ts +1 -1
  54. package/src/i18n/locales/settings/zh-Hans.po +149 -0
  55. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  56. package/src/i18n/locales/settings/zh-Hant.po +149 -0
  57. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  58. package/src/lib/env.ts +20 -0
  59. package/src/lib/github-app-state.ts +1 -1
  60. package/src/lib/github-app.ts +183 -1
  61. package/src/lib/markdown-manager.ts +129 -1
  62. package/src/lib/post-meta.ts +13 -3
  63. package/src/lib/referrer-aliases.ts +311 -0
  64. package/src/lib/render.tsx +10 -0
  65. package/src/lib/resolve-config.ts +14 -0
  66. package/src/lib/summary.ts +152 -54
  67. package/src/lib/tiptap-render.ts +1 -0
  68. package/src/lib/upload.ts +21 -1
  69. package/src/lib/video-playback.ts +55 -0
  70. package/src/lib/view-buffer.ts +201 -0
  71. package/src/lib/view-counting.ts +539 -0
  72. package/src/lib/view-token.ts +177 -0
  73. package/src/lib/view.ts +13 -1
  74. package/src/middleware/view-counter.ts +140 -0
  75. package/src/node/runtime.ts +4 -0
  76. package/src/preset.css +31 -14
  77. package/src/routes/api/media.ts +21 -3
  78. package/src/routes/dash/settings.tsx +433 -168
  79. package/src/routes/pages/archive.tsx +1 -0
  80. package/src/routes/pages/collection.tsx +6 -0
  81. package/src/routes/pages/collections.tsx +1 -0
  82. package/src/routes/pages/featured.tsx +1 -0
  83. package/src/routes/pages/home.tsx +1 -0
  84. package/src/routes/pages/page.tsx +3 -0
  85. package/src/routes/pages/smart-collection.tsx +2 -0
  86. package/src/routes/pages/subscribe.tsx +1 -0
  87. package/src/routes/view-confirm.ts +63 -0
  88. package/src/services/export-theme/assets/client-site.js +1 -1
  89. package/src/services/export-theme/styles/main.css +39 -21
  90. package/src/services/export.ts +2 -0
  91. package/src/services/index.ts +17 -0
  92. package/src/services/mcp.ts +31 -1
  93. package/src/services/media.ts +63 -0
  94. package/src/services/stats.ts +1130 -0
  95. package/src/styles/components-author.css +177 -0
  96. package/src/styles/components.css +11 -3
  97. package/src/styles/tokens.css +65 -30
  98. package/src/styles/ui.css +56 -13
  99. package/src/types/app-context.ts +9 -0
  100. package/src/types/bindings.ts +5 -0
  101. package/src/types/config.ts +54 -0
  102. package/src/types/views.ts +6 -0
  103. package/src/ui/compose/ComposeDialog.tsx +6 -0
  104. package/src/ui/dash/settings/SettingsRootContent.tsx +24 -6
  105. package/src/ui/dash/settings/StatsContent.tsx +855 -0
  106. package/src/ui/font-themes.ts +39 -6
  107. package/src/ui/layouts/BaseLayout.tsx +4 -2
  108. package/src/ui/layouts/SiteLayout.tsx +8 -3
  109. package/src/ui/shared/MediaGallery.tsx +19 -3
  110. package/dist/client/_assets/chunks/footnote-rail-B08scyhW.js +0 -2
  111. package/dist/client/_assets/chunks/sortable-list-t11Ma1Ek.js +0 -2
  112. package/dist/client/_assets/chunks/types-D5iF3H1a.js +0 -1
  113. package/dist/client/_assets/chunks/unsafe-svg-DZl-yjas.js +0 -1
  114. package/dist/client/_assets/client-B0-s9sqx.css +0 -2
  115. package/dist/client/_assets/client-author-CGVvrNZ8.css +0 -2
  116. package/dist/client/_assets/client-compose-DkUTuavR.js +0 -2004
@@ -33,12 +33,20 @@ export interface FontTheme {
33
33
  description: MessageDescriptor;
34
34
  }
35
35
 
36
+ /*
37
+ * Serif stacks lead on the system face with real weights, then the vendored
38
+ * Noto Serif (loaded by the profile stylesheet) and its installed siblings,
39
+ * and only then SimSun / PMingLiU. Those two ship one weight: a heading set
40
+ * in them is synthetic bold, smeared at every size, which is what every
41
+ * Windows reader of a serif-headed site used to get because they sat ahead
42
+ * of the face the site ships.
43
+ */
36
44
  const HANS_CJK_SERIF_FALLBACK =
37
- '"Songti SC", STSong, SimSun, "Noto Serif SC", "Noto Serif CJK SC", "Songti TC", PMingLiU, MingLiU, "Noto Serif TC", "Noto Serif CJK TC"';
45
+ '"Songti SC", "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, "Songti TC", "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", PMingLiU, MingLiU';
38
46
  const HANS_CJK_SANS_FALLBACK =
39
47
  '"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "PingFang TC", "Hiragino Sans CNS", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC"';
40
48
  const HANT_CJK_SERIF_FALLBACK =
41
- '"Songti TC", PMingLiU, MingLiU, "Noto Serif TC", "Noto Serif CJK TC", "Songti SC", STSong, SimSun, "Noto Serif SC", "Noto Serif CJK SC"';
49
+ '"Songti TC", "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", PMingLiU, MingLiU, "Songti SC", "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun';
42
50
  const HANT_CJK_SANS_FALLBACK =
43
51
  '"PingFang TC", "Hiragino Sans CNS", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC"';
44
52
  const JP_CJK_SERIF_FALLBACK =
@@ -148,18 +156,33 @@ export function resolveCjkFontProfile(
148
156
  return language ? getCjkFontFromLanguageTag(language) : undefined;
149
157
  }
150
158
 
159
+ /*
160
+ * Reading rhythm for a CJK page. Han, kana and hangul glyphs fill the em box
161
+ * where Latin lowercase sits at the x-height, so the Latin leadings in
162
+ * tokens.css pack CJK lines visibly tighter: 1.7 reads as 1.5 does in Latin.
163
+ * The surfaces Chinese readers hold up as well set — sspai, WeChat articles —
164
+ * run 1.75 to 1.8, and a multi-line Chinese title at 1.2 has its rows touching.
165
+ */
166
+ const CJK_READING_RHYTHM = {
167
+ "--type-body-leading": "1.75",
168
+ "--type-heading-leading": "1.3",
169
+ };
170
+
151
171
  /**
152
- * Build serif and sans fallback variables for the resolved language profile.
172
+ * Build the CSS variables a page in a CJK language needs: the serif and sans
173
+ * fallback stacks for its script, and the reading rhythm its glyphs call for.
153
174
  *
154
175
  * Empty for a language with no profile: `tokens.css` already carries a real
155
- * script-neutral stack in both variables, so there is nothing to override.
176
+ * script-neutral stack in both variables and the Latin leadings, so there is
177
+ * nothing to override. `BaseLayout` writes these on `:root` ahead of the theme
178
+ * style, so a font theme or custom CSS that sets a leading still wins.
156
179
  *
157
180
  * @param language - BCP 47 content language tag
158
181
  * @returns CSS variables consumed by every font theme, empty when the token
159
182
  * defaults already apply
160
183
  * @example
161
184
  * getCjkFontCssVariables("zh-Hans")
162
- * // => { "--font-cjk-serif-fallback": '"Songti SC", ...', ... }
185
+ * // => { "--font-cjk-serif-fallback": '"Songti SC", ...', ..., "--type-body-leading": "1.8", ... }
163
186
  */
164
187
  export function getCjkFontCssVariables(
165
188
  language?: string,
@@ -169,21 +192,25 @@ export function getCjkFontCssVariables(
169
192
  return {
170
193
  "--font-cjk-serif-fallback": HANS_CJK_SERIF_FALLBACK,
171
194
  "--font-cjk-sans-fallback": HANS_CJK_SANS_FALLBACK,
195
+ ...CJK_READING_RHYTHM,
172
196
  };
173
197
  case "zh-Hant":
174
198
  return {
175
199
  "--font-cjk-serif-fallback": HANT_CJK_SERIF_FALLBACK,
176
200
  "--font-cjk-sans-fallback": HANT_CJK_SANS_FALLBACK,
201
+ ...CJK_READING_RHYTHM,
177
202
  };
178
203
  case "ja":
179
204
  return {
180
205
  "--font-cjk-serif-fallback": JP_CJK_SERIF_FALLBACK,
181
206
  "--font-cjk-sans-fallback": JP_CJK_SANS_FALLBACK,
207
+ ...CJK_READING_RHYTHM,
182
208
  };
183
209
  case "ko":
184
210
  return {
185
211
  "--font-cjk-serif-fallback": KO_CJK_SERIF_FALLBACK,
186
212
  "--font-cjk-sans-fallback": KO_CJK_SANS_FALLBACK,
213
+ ...CJK_READING_RHYTHM,
187
214
  };
188
215
  default:
189
216
  return {};
@@ -227,7 +254,13 @@ export const BUILTIN_FONT_THEMES: FontTheme[] = [
227
254
  },
228
255
  headingFontFamily: TUFTE_SERIF,
229
256
  bodyFontFamily: TUFTE_SERIF,
230
- cssVariables: {},
257
+ cssVariables: {
258
+ // Tufte CSS sets its headings in the regular weight and lets size and
259
+ // space carry the hierarchy; the semibold default would hand it
260
+ // Palatino Bold.
261
+ "--type-heading-weight": "var(--fw-regular)",
262
+ "--type-display-weight": "var(--fw-regular)",
263
+ },
231
264
  description: {
232
265
  id: "Palatino-based old-style serif matching Tufte CSS proportions",
233
266
  message: "Palatino-based old-style serif matching Tufte CSS proportions",
@@ -587,10 +587,12 @@ export const BaseLayout: FC<PropsWithChildren<BaseLayoutProps>> = ({
587
587
  <link rel="stylesheet" href={authorStylesheetPath} />
588
588
  )}
589
589
  {/* Critical inline style: prevent mobile nav jitter by applying
590
- responsive header layout before external CSS/JS loads */}
590
+ responsive header layout before external CSS/JS loads. The nav
591
+ tiers query the header's width, as in ui.css, so the container
592
+ is declared here too. */}
591
593
  <style
592
594
  dangerouslySetInnerHTML={{
593
- __html: `.site-header-search-link,.site-header-hamburger,.site-header-more-responsive-only,.site-header-more-link-responsive,.site-header-more-divider-responsive{display:none!important}@media(max-width:1200px){.site-header-search-form{display:none!important}.site-header-search-link{display:inline-flex!important}}@media(max-width:960px){.site-header-link-collapse-lg{display:none!important}.site-header-more-responsive-only.site-header-more-tier-lg{display:inline-flex!important}.site-header-more-link-show-lg{display:flex!important}.site-header-more-divider-show-lg{display:block!important}}@media(max-width:780px){.site-header-link-collapse-md{display:none!important}.site-header-more-responsive-only.site-header-more-tier-md{display:inline-flex!important}.site-header-more-link-show-md{display:flex!important}.site-header-more-divider-show-md{display:block!important}}@media(max-width:580px){.site-header-link-collapse-sm{display:none!important}.site-header-more-responsive-only.site-header-more-tier-sm{display:inline-flex!important}.site-header-more-link-show-sm{display:flex!important}.site-header-more-divider-show-sm{display:block!important}}@media(max-width:480px){.site-header-nav,.site-header-more{display:none!important}.site-header-search-slot{display:flex!important}.site-header-hamburger{display:flex!important}.site-header-right{margin-left:.35rem}}`,
595
+ __html: `.site-header{container:site-header/inline-size}.site-header-search-link,.site-header-hamburger,.site-header-more-responsive-only,.site-header-more-link-responsive,.site-header-more-divider-responsive{display:none!important}@media(max-width:1200px){.site-header-search-form{display:none!important}.site-header-search-link{display:inline-flex!important}}@container site-header (width<802px){.site-header-link-collapse-lg{display:none!important}.site-header-more-responsive-only.site-header-more-tier-lg{display:inline-flex!important}.site-header-more-link-show-lg{display:flex!important}.site-header-more-divider-show-lg{display:block!important}}@container site-header (width<652px){.site-header-link-collapse-md{display:none!important}.site-header-more-responsive-only.site-header-more-tier-md{display:inline-flex!important}.site-header-more-link-show-md{display:flex!important}.site-header-more-divider-show-md{display:block!important}}@container site-header (width<522px){.site-header-link-collapse-sm{display:none!important}.site-header-more-responsive-only.site-header-more-tier-sm{display:inline-flex!important}.site-header-more-link-show-sm{display:flex!important}.site-header-more-divider-show-sm{display:block!important}}@media(max-width:480px){.site-header-nav,.site-header-more{display:none!important}.site-header-search-slot{display:flex!important}.site-header-hamburger{display:flex!important}.site-header-right{margin-left:.35rem}}`,
594
596
  }}
595
597
  />
596
598
  {/* Emitted before the theme style so a font theme that names its own
@@ -634,6 +634,7 @@ export const SiteLayout: FC<PropsWithChildren<SiteLayoutProps>> = ({
634
634
  siteFooterHtml,
635
635
  showHomeBranding = false,
636
636
  sidebar,
637
+ wideFrame = false,
637
638
  uploadMaxFileSize,
638
639
  showComposeDialog = true,
639
640
  showHeader = true,
@@ -666,9 +667,13 @@ export const SiteLayout: FC<PropsWithChildren<SiteLayoutProps>> = ({
666
667
  .join(" ");
667
668
  // The page, not the content, keeps room for the button: the footer and the
668
669
  // Jant credit come after the content, and they must end above it too.
669
- const pageClass = showMobileComposeFab
670
- ? "site-page site-page-mobile-compose-enabled"
671
- : "site-page";
670
+ const pageClass = [
671
+ "site-page",
672
+ showMobileComposeFab ? "site-page-mobile-compose-enabled" : "",
673
+ wideFrame ? "site-page-wide" : "",
674
+ ]
675
+ .filter(Boolean)
676
+ .join(" ");
672
677
 
673
678
  return (
674
679
  <div class={pageClass}>
@@ -21,7 +21,10 @@
21
21
  import type { FC } from "hono/jsx";
22
22
  import type { MediaView } from "../../types.js";
23
23
  import { getMediaCategory } from "../../lib/upload.js";
24
- import { shouldUseShortVideoExperience } from "../../lib/video-playback.js";
24
+ import {
25
+ getPosterFrameUrl,
26
+ shouldUseShortVideoExperience,
27
+ } from "../../lib/video-playback.js";
25
28
  import {
26
29
  blurhashToDataUrl,
27
30
  getBlurhashDecodeSize,
@@ -455,6 +458,14 @@ export const MediaGallery: FC<MediaGalleryProps> = ({
455
458
  ? undefined
456
459
  : `${Math.round(Math.max(160, rowHeight * ratio))}px`;
457
460
  const posterSrc = item.posterUrl || placeholder;
461
+ /* A clip stored without a poster (an API upload that sent
462
+ none) would show an empty box: these `<video>`s only ever
463
+ paint their poster. Without one, the browser reads the
464
+ file's metadata and draws the poster frame itself — at
465
+ once for a long clip, and for a short one when the feed
466
+ player hands it its source near the viewport. */
467
+ const drawsOwnFrame = !item.posterUrl;
468
+ const videoPreload = drawsOwnFrame ? "metadata" : "none";
458
469
  /* `video.u-photo` resolves to `poster`, which is the still
459
470
  the timeline already shows. Only a real poster qualifies:
460
471
  the blurhash fallback is a data URL, and publishing one as
@@ -505,7 +516,7 @@ export const MediaGallery: FC<MediaGalleryProps> = ({
505
516
  class="u-video media-visual-frame media-video-link"
506
517
  >
507
518
  <video
508
- preload="none"
519
+ preload={videoPreload}
509
520
  muted
510
521
  playsinline
511
522
  loop
@@ -569,10 +580,15 @@ export const MediaGallery: FC<MediaGalleryProps> = ({
569
580
  }
570
581
  >
571
582
  <video
572
- preload="none"
583
+ preload={videoPreload}
573
584
  muted
574
585
  playsinline
575
586
  poster={posterSrc}
587
+ src={
588
+ drawsOwnFrame
589
+ ? getPosterFrameUrl(item.url, item.durationSeconds)
590
+ : undefined
591
+ }
576
592
  width={item.width}
577
593
  height={item.height}
578
594
  style={videoStyle}
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/client-compose-DkUTuavR.js","_assets/chunks/runtime-paths-y0_gHowM.js","_assets/chunks/lit-Bw_voPoW.js","_assets/chunks/unsafe-html-CWos3v6N.js","_assets/chunks/preload-helper-Czpn1I53.js","_assets/chunks/unsafe-svg-DZl-yjas.js","_assets/chunks/types-D5iF3H1a.js","_assets/chunks/slug-format-CYmQE5ln.js","_assets/chunks/sortable-list-t11Ma1Ek.js","_assets/chunks/create-editor-BQkrw8Ax.js","_assets/client-settings-CHgsIqXJ.js","_assets/chunks/jant-locale-picker-2L4rkDaz.js","_assets/chunks/confirm-CMe01lne.js","_assets/client-manage-DnYdQAhf.js","_assets/chunks/site-header-nav-DzXsFk05.js","_assets/chunks/settings-paths-B0bNUaih.js","_assets/client-share-C59mOLJ1.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Czpn1I53.js";var t=null,n=0,r=!1,i=null,a=null,o=0;function s(e){return!isFinite(e)||e<0?`0:00`:`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`}function c(e){return e.querySelector(`audio.media-audio-el`)}function l(e){return e.querySelector(`[data-audio-range]`)}function u(e){return e.querySelector(`[data-audio-waveform]`)}function d(e,t){let n=`${(t*100).toFixed(1)}%`;e.style.background=`linear-gradient(to right, var(--site-text-primary) ${n}, transparent ${n})`}var f=new WeakMap,p=new WeakSet;async function ee(e,t){let n=await(await fetch(e)).arrayBuffer(),r=new AudioContext;try{let e=(await r.decodeAudioData(n)).getChannelData(0),i=Math.max(1,Math.floor(e.length/t)),a=Array(t);for(let n=0;n<t;n++){let t=0,r=n*i,o=Math.min(r+i,e.length);for(let n=r;n<o;n++){let r=Math.abs(e[n]);r>t&&(t=r)}a[n]=t}let o=0;for(let e of a)e>o&&(o=e);if(o>0)for(let e=0;e<t;e++)a[e]/=o;return a}finally{await r.close()}}function m(e=document){let t=e.querySelectorAll(`[data-audio-peaks]`),n=[];for(let e of t){let t=e.dataset.audioPeaks;if(!t)continue;let r=e.closest(`.media-audio-card`);if(r&&!f.has(r))try{let e=JSON.parse(t);if(!Array.isArray(e))continue;f.set(r,e),r.classList.add(`has-waveform`),n.push(r)}catch{}}n.length>0&&requestAnimationFrame(()=>{for(let e of n)g(e,0)})}async function h(e){if(f.has(e)||p.has(e))return;p.add(e);let t=e.querySelector(`audio.media-audio-el source`),n=u(e);if(!t?.src||!n)return;let r=n.getBoundingClientRect().width,i=Math.max(20,Math.floor(r/3));try{let n=await ee(t.src,i);f.set(e,n),e.classList.add(`has-waveform`);let r=c(e),a=r?.duration??0;g(e,r&&isFinite(a)&&a>0?r.currentTime/a:0)}catch{}}function g(e,t){let n=f.get(e),r=u(e);if(!n||!r)return;let i=window.devicePixelRatio||1,a=r.getBoundingClientRect(),o=Math.round(a.width*i),s=Math.round(a.height*i);if(o===0||s===0)return;(r.width!==o||r.height!==s)&&(r.width=o,r.height=s);let c=r.getContext(`2d`);if(!c)return;c.clearRect(0,0,o,s);let l=n.length,d=o/l,p=Math.max(1,Math.round(d*.6)),ee=Math.round(2*i),m=s*.85,h=getComputedStyle(r).getPropertyValue(`--site-text-primary`).trim()||`#000`;for(let e=0;e<l;e++){let r=Math.round(e*d+(d-p)/2),a=Math.max(ee,Math.round(n[e]*m)),o=Math.round((s-a)/2);c.globalAlpha=(e+.5)/l<=t?.9:.2,c.fillStyle=h;let u=Math.min(p/2,i);c.beginPath(),c.roundRect(r,o,p,a,u),c.fill()}c.globalAlpha=1}function te(e,t){let{currentTime:n,duration:i}=t,a=isFinite(i)&&i>0,o=a?n/i:0;if(!r){let t=l(e);t&&a&&(t.value=String(Math.round(o*1e3)),d(t,o)),f.has(e)&&g(e,o);let r=e.querySelector(`[data-audio-time]`);r&&(r.textContent=a?`${s(n)} / ${s(i)}`:s(n))}}function _(){if(!t)return;let e=c(t);e&&!e.paused&&(te(t,e),n=requestAnimationFrame(_))}function v(){if(t){let e=c(t);e&&!e.paused&&e.pause(),t.classList.remove(`is-playing`),t=null}cancelAnimationFrame(n)}async function ne(e){let r=c(e);if(r){if(t&&t!==e&&v(),r.paused){t=e,e.classList.add(`is-playing`);try{await r.play()}catch{e.classList.remove(`is-playing`),t=null;return}n=requestAnimationFrame(_),h(e)}else r.pause(),e.classList.remove(`is-playing`),cancelAnimationFrame(n),t=null}}function re(e){let t=e.closest(`.media-audio-card`);if(!t)return;let n=c(t);if(!n)return;let r=Number(e.value)/1e3,i=n.duration;isFinite(i)&&i>0&&(n.currentTime=r*i)}function y(e,t){let n=e.getBoundingClientRect();o=Math.max(0,Math.min(1,(t.clientX-n.left)/n.width));let r=e.closest(`.media-audio-card`);if(!r)return;g(r,o);let i=c(r),a=r.querySelector(`[data-audio-time]`);if(i&&a){let e=i.duration;isFinite(e)&&e>0&&(a.textContent=`${s(o*e)} / ${s(e)}`)}}async function ie(e){let r=e.closest(`.media-audio-card`);if(!r)return;let i=c(r);if(i){if(i.paused){t&&t!==r&&v(),t=r,r.classList.add(`is-playing`);try{await i.play()}catch{r.classList.remove(`is-playing`),t=null;return}let e=i.duration;isFinite(e)&&e>0&&(i.currentTime=o*e),n=requestAnimationFrame(_),h(r)}else{let e=i.duration;isFinite(e)&&e>0&&(i.currentTime=o*e)}}}document.addEventListener(`pointerdown`,e=>{let t=e.target;t.matches(`[data-audio-range]`)?(r=!0,i=t):t.matches(`[data-audio-waveform]`)&&(r=!0,a=t,y(t,e))},!0),document.addEventListener(`pointermove`,e=>{r&&a&&y(a,e)},!0),document.addEventListener(`pointerup`,()=>{r&&(i?(re(i),i=null):a&&=(ie(a),null)),r=!1},!0),document.addEventListener(`pointercancel`,()=>{i=null,a=null,r=!1},!0),document.addEventListener(`click`,e=>{let t=e.target.closest(`[data-audio-play]`);if(!t)return;e.preventDefault();let n=t.closest(`.media-audio-card`);n&&ne(n)}),document.addEventListener(`input`,e=>{let t=e.target;if(!t.matches(`[data-audio-range]`))return;let n=t.closest(`.media-audio-card`);if(!n)return;let r=c(n);if(!r)return;let i=Number(t.value)/1e3;d(t,i);let a=r.duration,o=n.querySelector(`[data-audio-time]`);o&&isFinite(a)&&a>0&&(o.textContent=`${s(i*a)} / ${s(a)}`)},!0),document.addEventListener(`ended`,e=>{let r=e.target;if(!r.closest)return;let i=r.closest(`.media-audio-card`);if(!i)return;i.classList.remove(`is-playing`),cancelAnimationFrame(n),t=null;let a=l(i);a&&(a.value=`0`,d(a,0)),f.has(i)&&g(i,0);let o=i.querySelector(`[data-audio-time]`);o&&(o.textContent=`0:00`)},!0),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>m()):m();var ae=`jant:media-lightbox-toggle`,oe=`jant:media-video-playback-intent`,b=new Set;function x(e){let t=e?.trim();return!!t&&b.has(t)}function S(e,t){let n=e?.trim();n&&(t?b.add(n):b.delete(n),document.dispatchEvent(new CustomEvent(oe,{detail:{mediaId:n,paused:t}})))}var se=`75% 0px`,C=.6,w=.25,ce=160,T=new Set,le=new WeakMap,ue=new WeakSet,E=null,D=null,O=null,k=!1,A=null,j=null,M=null;function de(e){return e.length===0?null:[...e].sort((e,t)=>t.visibleArea===e.visibleArea?e.centerDistance===t.centerDistance?t.intersectionRatio-e.intersectionRatio:e.centerDistance-t.centerDistance:t.visibleArea-e.visibleArea)[0]??null}function fe(){return{x:(globalThis.innerWidth||document.documentElement.clientWidth||0)/2,y:(globalThis.innerHeight||document.documentElement.clientHeight||0)/2}}function N(e){return le.get(e)}function pe(e){return x(e)}function P(e){return pe(e.dataset.feedVideoId)}function me(e){return e.closest(`.media-video-wrap`)?.querySelector(`[data-feed-video-mute-toggle]`)??null}function F(e){let t=me(e);if(!t)return;let n=O!==e||e.muted;t.dataset.muted=n?`true`:`false`,t.setAttribute(`aria-label`,n?`Play with sound`:`Mute video`)}function he(){for(let e of T)F(e)}function ge(e){if(ue.has(e))return;let t=e.dataset.videoSrc;t&&(e.getAttribute(`src`)!==t&&(e.src=t),e.load(),ue.add(e))}function I(e){e?.pause()}function _e(e){if(P(e)){I(e);return}ge(e),e.muted=O!==e,e.playsInline=!0,e.loop=!0,F(e),e.play().catch(()=>{})}function ve(){for(let e of T)e.isConnected||(j?.unobserve(e),M?.unobserve(e),T.delete(e),e===E&&(E=null),e===D&&(D=null),e===O&&(O=null))}function ye(){if(A=null,ve(),document.hidden||k){I(E);return}let e=[];for(let t of T){let n=N(t);n&&(P(t)||n.intersectionRatio<C||e.push({video:t,...n}))}let t=null;if(D?.isConnected&&!P(D)){let e=N(D);e&&e.intersectionRatio>w?t=D:(!e||e.intersectionRatio<=w)&&(D=null)}else D&&P(D)&&(D=null);if(t||=de(e)?.video??null,!t){let e=E?N(E):void 0;if(E&&!P(E)&&e&&e.intersectionRatio>w)return;I(E),E=null;return}t!==E&&(I(E),E=t),_e(t);for(let e of T)e!==t&&(I(e),F(e))}function L(){A!==null&&globalThis.clearTimeout(A),A=globalThis.setTimeout(ye,ce)}function be(e){let t=fe();for(let n of e){let e=n.target,r=n.boundingClientRect,i=r.left+r.width/2,a=r.top+r.height/2,o=n.intersectionRect.width*n.intersectionRect.height,s=Math.hypot(i-t.x,a-t.y);le.set(e,{intersectionRatio:n.intersectionRatio,visibleArea:o,centerDistance:s})}L()}function xe(e){for(let t of e)t.isIntersecting&&ge(t.target)}function Se(){j&&M||globalThis.IntersectionObserver!==void 0&&(j=new globalThis.IntersectionObserver(be,{threshold:[0,w,C,1]}),M=new globalThis.IntersectionObserver(xe,{rootMargin:se,threshold:0}))}function Ce(e){T.has(e)||(Se(),j&&M&&(T.add(e),j.observe(e),M.observe(e),me(e)?.addEventListener(`click`,we),F(e)))}function we(e){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.closest(`.media-video-wrap`)?.querySelector(`[data-feed-short-video]`);if(!t)return;let n=t.dataset.feedVideoId?.trim();n&&S(n,!1),D=t,O!==t||t.muted?(O&&O!==t&&(O.muted=!0),O=t,E!==t&&(I(E),E=t),_e(t)):(O=null,t.muted=!0,F(t)),he(),L()}function R(e=document){let t=e.querySelectorAll(`[data-feed-short-video]`);for(let e of t)Ce(e);L()}document.addEventListener(ae,e=>{k=e.detail?.open===!0,k&&I(E),L()}),document.addEventListener(oe,e=>{let t=e.detail,n=t?.mediaId?.trim();if(n&&typeof t.paused==`boolean`){for(let e of T)e.dataset.feedVideoId?.trim()===n&&t.paused&&(I(e),E===e&&(E=null),D===e&&(D=null));L()}}),document.addEventListener(`visibilitychange`,()=>{document.hidden&&I(E),L()}),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>R(),{once:!0}):queueMicrotask(()=>R());function Te(e){if(!(!Number.isFinite(e)||!e||e<=0))return Math.ceil(e)}function Ee(e){if(!e.mimeType?.startsWith(`video/`)||!Number.isFinite(e.durationSeconds)||!e.durationSeconds||e.durationSeconds<=0||e.durationSeconds>15)return!1;let t=e.size;return!(typeof t==`number`&&t>12582912)}function z(e){let t;return()=>t??=e().then(()=>void 0,e=>{throw t=void 0,e})}var B=z(()=>e(()=>import(`../client-compose-DkUTuavR.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),De=z(()=>e(()=>import(`../client-settings-CHgsIqXJ.js`),__vite__mapDeps([10,1,11,2,12,6,9]))),Oe=z(()=>e(()=>import(`../client-manage-DnYdQAhf.js`),__vite__mapDeps([13,1,2,3,14,12,6,7,15,4,8,9]))),ke=z(()=>e(()=>import(`../client-share-C59mOLJ1.js`),__vite__mapDeps([16,2,3]))),Ae=[{selector:`.compose-page`,load:B},{selector:[`jant-settings-general`,`jant-settings-language`,`jant-settings-avatar`,`jant-config-editor`,`jant-repo-picker`].join(`, `),load:De},{selector:[`jant-nav-manager`,`jant-collections-manager`,`[data-collection-page-actions]`,`[data-smart-collection-page-actions]`,`[data-custom-url-actions]`].join(`, `),load:Oe}];function je(){let e=new Set(Ae),t=new globalThis.MutationObserver(n);function n(){for(let t of e)document.querySelector(t.selector)&&(e.delete(t),t.load());e.size===0&&t.disconnect()}n(),e.size>0&&t.observe(document.body,{childList:!0,subtree:!0})}var Me=8;function Ne(e,t){let n=Number.parseFloat(e);return Number.isFinite(n)?n:t}function Pe(e){return Ne(getComputedStyle(e).getPropertyValue(`--site-thread-context-max-height`).trim(),240)}function Fe(e){if(e.dataset.threadContextToggleBound===`1`)return;e.dataset.threadContextToggleBound=`1`;let t=e.previousElementSibling;if(!(t instanceof HTMLElement)||t.dataset.threadContext===void 0)return;let n=e.querySelector(`.thread-context-toggle-label`),r=e.dataset.labelMore??`Show more`,i=e.dataset.labelLess??`Show less`,a=!1,o=t=>{e.setAttribute(`aria-expanded`,t?`true`:`false`),n&&(n.textContent=t?i:r)},s=()=>Array.from(t.querySelectorAll(`img`)).every(e=>e.complete),c=()=>{if(a)return;let n=Pe(t),r=t.scrollHeight>n+Me;t.dataset.collapsed===void 0&&(t.dataset.collapsed=``),r?(e.hidden=!1,o(!1)):s()&&(e.hidden=!0)};if(c(),t.querySelectorAll(`img`).forEach(e=>{e.complete||(e.addEventListener(`load`,c,{once:!0}),e.addEventListener(`error`,c,{once:!0}))}),`ResizeObserver`in globalThis){let e=0;new globalThis.ResizeObserver(()=>{cancelAnimationFrame(e),e=requestAnimationFrame(c)}).observe(t)}let l=()=>{let e=!1,n=r=>{e||r&&r.propertyName!==`max-height`||(e=!0,t.removeEventListener(`transitionend`,n),t.dataset.collapsed===void 0&&(t.style.maxHeight=``))};t.addEventListener(`transitionend`,n),window.setTimeout(n,600)};e.addEventListener(`click`,()=>{a=!0,t.dataset.collapsed===void 0?(t.style.maxHeight=`${t.scrollHeight}px`,t.offsetHeight,requestAnimationFrame(()=>{t.dataset.collapsed=``,t.style.maxHeight=``}),o(!1)):(t.style.maxHeight=`${t.scrollHeight}px`,t.offsetHeight,delete t.dataset.collapsed,o(!0)),l()})}function V(e=document){e.querySelectorAll(`[data-thread-context-toggle]`).forEach(Fe)}function Ie(e){let t=e.closest(`.thread-group-detail`);return t?t.querySelector(`.thread-detail-item`)===e:!1}function Le(){return globalThis.location.hash===`#continue`}function Re(e=document){let t=e.querySelector(`[data-post-current]`);if(!(t instanceof HTMLElement))return;let n=Le();if(globalThis.location.hash&&!n)return;let r=n?`auto`:`smooth`,i=Ie(t);requestAnimationFrame(()=>{(!i||n)&&t.scrollIntoView({behavior:r,block:`start`})})}document.addEventListener(`DOMContentLoaded`,()=>{V(document),Re(document)});var H=[`[data-post-view] .post-detail [data-post-body].post-detail-body`,`[data-timeline-item] article[data-post] > [data-post-body].prose`].join(`, `),ze=`[data-post-view], [data-timeline-item]`,Be=`--jant-footnote-rail-enabled`,U=12,Ve=160,He=.5,W=.5,G=new Map,K=!1;function q(e,t){return Number.isFinite(e)?e:t}function Ue(e,t){let n=Math.max(0,q(t,U)),r=[],i=0;for(let[t,a]of e.entries()){let e=Math.max(0,q(a.anchorTop,0)),o=Math.max(0,q(a.blockSize,0)),s=t===0?e:Math.max(e,i+n);r.push(s),i=s+o}return{offsets:r,blockSize:i}}function We(e){if(!e.startsWith(`#`)||e.length===1)return null;try{return decodeURIComponent(e.slice(1))}catch{return e.slice(1)}}function Ge(e,t){return(e.getAttribute(`role`)??``).split(/\s+/).includes(t)}function Ke(e){let t=Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.classList.contains(`footnote-endnotes`)&&Ge(e,`doc-endnotes`));if(t.length!==1)return null;let n=t[0];if(!n)return null;let r=Array.from(n.children).filter(e=>e instanceof globalThis.HTMLOListElement&&e.classList.contains(`footnote-list`));if(r.length!==1)return null;let i=r[0];if(!i)return null;let a=Array.from(i.children).filter(e=>e instanceof globalThis.HTMLLIElement&&e.classList.contains(`footnote`));if(a.length===0||a.length!==i.children.length)return null;let o=new Map;for(let e of a){if(!e.id||o.has(e.id)||document.getElementById(e.id)!==e)return null;o.set(e.id,e)}let s=new Map;for(let t of e.querySelectorAll(`a[role~="doc-noteref"][href^="#"]`)){let e=We(t.getAttribute(`href`)??``);e&&o.has(e)&&!s.has(e)&&s.set(e,t)}let c=[];for(let e of a){let t=s.get(e.id);if(!t)return null;c.push({reference:t,note:e})}return{section:n,list:i,pairs:c}}function qe(e){return q((Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize)?.inlineSize??e.contentRect.width,0)}function J(e){return`${Math.round(e*1e3)/1e3}px`}function Y(e){e.body.classList.remove(`footnote-rail-measuring`,`footnote-rail-ready`),e.body.style.removeProperty(`min-block-size`),e.list.style.removeProperty(`--footnote-rail-block-size`);for(let{note:t}of e.pairs)t.style.removeProperty(`--footnote-rail-y`),t.style.removeProperty(`--footnote-rail-number`)}function Je(e){let t=e.list.start;for(let{note:n}of e.pairs)n.hasAttribute(`value`)&&(t=n.value),n.style.setProperty(`--footnote-rail-number`,`"${t}"`),t+=1}function Ye(e){let t=Number.parseFloat(getComputedStyle(e).rowGap);return Number.isFinite(t)?t:U}function Xe(e,t){return Math.max(0,t-e)<=Math.max(Ve,e*He)+W}function Ze(e){if(e.correctedInitialHash)return;e.correctedInitialHash=!0;let t=We(globalThis.location.hash);if(!t)return;let n=e.pairs.find(({note:e})=>e.id===t)?.note;n&&requestAnimationFrame(()=>{e.body.classList.contains(`footnote-rail-ready`)&&n.scrollIntoView({behavior:`auto`,block:`nearest`})})}function Qe(e){return!K&&getComputedStyle(e).getPropertyValue(Be).trim()===`1`}function $e(e){if(!e.body.isConnected){Z(e);return}if(!Qe(e.body)){Y(e);return}Y(e),e.body.classList.add(`footnote-rail-measuring`),Je(e);let t=e.body.getBoundingClientRect(),n=Math.max(0,t.height),r=e.pairs.map(({reference:e,note:n})=>({anchorTop:e.getBoundingClientRect().top-t.top,blockSize:n.getBoundingClientRect().height}));if(r.some(({blockSize:e})=>e<=W)){Y(e);return}let i=Ue(r,Ye(e.list));if(!Xe(n,i.blockSize)){Y(e);return}for(let[t,{note:n}]of e.pairs.entries())n.style.setProperty(`--footnote-rail-y`,J(i.offsets[t]??0));e.list.style.setProperty(`--footnote-rail-block-size`,J(i.blockSize)),e.body.style.setProperty(`min-block-size`,J(Math.max(n,i.blockSize))),e.body.classList.remove(`footnote-rail-measuring`),e.body.classList.add(`footnote-rail-ready`),Ze(e)}function X(e){e.rafId===0&&(e.rafId=requestAnimationFrame(()=>{e.rafId=0,$e(e)}))}function Z(e){e.rafId!==0&&cancelAnimationFrame(e.rafId),e.observer.disconnect(),e.abortController.abort(),Y(e),G.delete(e.body)}function et(e,t){return e.section===t.section&&e.list===t.list&&e.pairs.length===t.pairs.length&&e.pairs.every((e,n)=>e.note===t.pairs[n]?.note&&e.reference===t.pairs[n]?.reference)}function tt(e,t){if(!(`ResizeObserver`in globalThis))return null;let n=e.closest(ze);if(!n)return null;let r=new AbortController,i=new globalThis.ResizeObserver(t=>{let r=G.get(e);if(!r)return;let i=!1;for(let e of t)if(e.target===n){let t=qe(e);(r.containerInlineSize===null||Math.abs(r.containerInlineSize-t)>W)&&(r.containerInlineSize=t,i=!0)}else i=!0;i&&X(r)}),a={body:e,container:n,...t,observer:i,abortController:r,rafId:0,containerInlineSize:null,correctedInitialHash:!1};i.observe(n);for(let n of e.children)n!==t.section&&i.observe(n);for(let t of e.querySelectorAll(`img`))t.complete||(t.addEventListener(`load`,()=>X(a),{once:!0,signal:r.signal}),t.addEventListener(`error`,()=>X(a),{once:!0,signal:r.signal}));return G.set(e,a),X(a),a}function nt(e){let t=[];return e instanceof globalThis.Element&&e.matches(H)&&t.push(e),t.push(...e.querySelectorAll(H)),t}function Q(e=document){for(let e of G.values())e.body.isConnected||Z(e);for(let t of nt(e)){let e=Ke(t),n=G.get(t);if(!e){n&&Z(n);continue}if(n&&et(n,e)){X(n);continue}n&&Z(n),tt(t,e)}}function $(){for(let e of G.values())X(e)}globalThis.addEventListener(`beforeprint`,()=>{K=!0;for(let e of G.values())Y(e)}),globalThis.addEventListener(`afterprint`,()=>{K=!1,$()}),document.fonts&&(document.fonts.ready.then($),document.fonts.addEventListener(`loadingdone`,$)),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>Q(document),{once:!0}):Q(document);export{je as a,R as c,S as d,m as f,ke as i,ae as l,V as n,Te as o,B as r,Ee as s,Q as t,x as u};
@@ -1,2 +0,0 @@
1
- import{d as e,f as t}from"./runtime-paths-y0_gHowM.js";import{a as n,r}from"./lit-Bw_voPoW.js";import{a as i,i as a,r as o}from"./unsafe-html-CWos3v6N.js";import{C as s,S as c,b as l,v as u,x as d,y as f}from"./create-editor-BQkrw8Ax.js";var{I:p}=n,m=e=>e,h=()=>document.createComment(``),g=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new p(r.insertBefore(h(),i),r.insertBefore(h(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=m(e).nextSibling;m(r).insertBefore(e,i),e=t}}}return n},_=(e,t,n=e)=>(e._$AI(t,n),e),ee={},v=(e,t=ee)=>e._$AH=t,te=e=>e._$AH,y=e=>{e._$AR(),e._$AA.remove()},b=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},ne=o(class extends a{constructor(e){if(super(e),e.type!==i.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,i]){let a=te(e),{values:o,keys:s}=this.dt(t,n,i);if(!Array.isArray(a))return this.ut=s,o;let c=this.ut??=[],l=[],u,d,f=0,p=a.length-1,m=0,h=o.length-1;for(;f<=p&&m<=h;)if(a[f]===null)f++;else if(a[p]===null)p--;else if(c[f]===s[m])l[m]=_(a[f],o[m]),f++,m++;else if(c[p]===s[h])l[h]=_(a[p],o[h]),p--,h--;else if(c[f]===s[h])l[h]=_(a[f],o[h]),g(e,l[h+1],a[f]),f++,h--;else if(c[p]===s[m])l[m]=_(a[p],o[m]),g(e,a[f],a[p]),p--,m++;else if(u===void 0&&(u=b(s,m,h),d=b(c,f,p)),u.has(c[f])){if(u.has(c[p])){let t=d.get(s[m]),n=t===void 0?null:a[t];if(n===null){let t=g(e,a[f]);_(t,o[m]),l[m]=t}else l[m]=_(n,o[m]),g(e,a[f],n),a[t]=null;m++}else y(a[p]),p--}else y(a[f]),f++;for(;m<=h;){let t=g(e,l[h+1]);_(t,o[m]),l[m++]=t}for(;f<=p;){let e=a[f++];e!==null&&y(e)}return this.ut=s,v(e,l),r}});function x(e){return typeof e==`string`?e:``}function S(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function C(e){let n=l(t(e.src));if(!n)return``;let r=` sandbox="${l(e.sandbox)}"`,i=e.allow?` allow="${l(e.allow)}"`:``;return`<iframe src="${n}"${` title="${l(e.providerName)} embed"`}${r}${i} loading="lazy" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>`}function re(e){let t=e.orientation===`portrait`?`portrait`:e.orientation===`square`?`square`:e.orientation===`auto`?`auto`:`landscape`,n=[];e.heightPx&&e.heightPx>0&&n.push(`--tiptap-embed-height:${Math.round(e.heightPx)}px`);let r=n.length>0?` style="${l(n.join(`;`))}"`:``;return` data-orientation="${l(t)}"${r}`}function w(e,n){let r=C(e);if(!r)return``;let i=l(t(e.url||e.src)),a=l(e.providerName),o=i?`<a class="tiptap-embed-fallback" href="${i}" target="_blank" rel="noopener noreferrer">${a} →</a>`:``,s=l(e.provider),c=n?.trim()?`<figcaption>${l(n.trim())}</figcaption>`:``;return`<figure class="tiptap-embed-figure" data-provider="${s}"${re(e)}><div class="tiptap-embed-frame">${r}</div>`+o+c+`</figure>`}function ie(e){let n=e??{},r=x(n.url),i=x(n.src),a=null;if(i){let e=t(i);e&&(a={provider:x(n.provider)||`iframe`,providerName:x(n.providerName)||`Embed`,src:e,url:r||e,orientation:x(n.orientation)||`landscape`,heightPx:S(n.heightPx)??void 0,sandbox:x(n.sandbox)||`allow-scripts allow-same-origin allow-popups`,allow:x(n.allow)||void 0,cspFrameSrc:[],cspScriptSrc:[]})}if(!a&&r&&(a=f(r)),!a){if(!r)return``;let e=l(t(r));return e?`<p class="tiptap-embed-fallback"><a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a></p>`:``}return w(a,x(n.caption))}function T(e,t){let n=e?.[t];return typeof n==`string`?n:``}function E(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:null}function ae(e){switch(e.type){case`text`:return l(e.text??``);case`hardBreak`:return`
2
- `;default:return(e.content??[]).map(ae).join(``)}}function oe(e,t,n){let r=E(t.attrs,`colspan`),i=E(t.attrs,`rowspan`);return`<${e}${r!==null&&r!==1?` colspan="${r}"`:``}${i!==null&&i!==1?` rowspan="${i}"`:``}>${n.renderChildren(t.content)}</${e}>`}var se=14695981039346656037n,ce=1099511628211n,le=18446744073709551615n;function ue(e){let t=(e??``).trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``);if(!t)return``;let n=se;for(let e=0;e<t.length;e+=1)n^=BigInt(t.charCodeAt(e)),n=n*ce&le;return n.toString(36).padStart(13,`0`)}function de(e,t){if(e.type===`footnoteReference`){t(e);return}for(let n of e.content??[])de(n,t)}function fe(e,t){let n=new Map,r=(e.content??[]).filter(e=>e.type!==`footnoteDefinition`);for(let t of e.content??[]){if(t.type!==`footnoteDefinition`)continue;let e=d(T(t.attrs,`label`));e&&!n.has(e)&&n.set(e,t)}let i=ue(t.namespace),a=i?`${i}-`:``,o=new Map,c=[],l=new WeakMap;for(let e of r)de(e,e=>{let t=s(T(e.attrs,`label`))||`footnote`,r=d(t),i=o.get(r);if(!i){let e=o.size+1;i={definitionId:`fn-${a}${e}`,number:e,label:t,definition:n.get(r)??null,references:[]},o.set(r,i),c.push(i)}let u=i.references.length+1,f={definitionId:i.definitionId,referenceId:`fnref-${a}${i.number}-${u}`,number:i.number,occurrence:u,label:i.label,hasDefinition:i.definition!==null};i.references.push(f),l.set(e,f)});return{groups:c,referencesByNode:l}}function pe(e,t){let n=t.footnotes.referencesByNode.get(e),r=s(T(e.attrs,`label`))||`footnote`,i=n?.label??r,a=n?.number??i;return n?.hasDefinition?`<sup class="footnote-ref"><a id="${l(n.referenceId)}" href="#${l(n.definitionId)}" role="doc-noteref">${n.number}</a></sup>`:`<sup class="footnote-ref">${l(String(a))}</sup>`}function me(e,t,n){if(!e.definition)return``;let r=e.definition.content??[],i=e.references.map(t=>{let n=e.references.length>1?String(t.occurrence):``;return`<a href="#${l(t.referenceId)}" class="footnote-backref" role="doc-backlink">↩︎${n}</a>`}).join(` `),a=`<span class="footnote-backlinks">${i}</span>`,o=r.at(-1),s;if(o?.type===`paragraph`){let e=r.slice(0,-1),n=t.renderChildren(o.content),i=n?` `:``;s=t.renderChildren(e)+`<p>${n}${i}${a}</p>`}else s=t.renderChildren(r)+`<p class="footnote-backlinks">${i}</p>`;let c=n?` value="${e.number}"`:``;return`<li id="${l(e.definitionId)}" class="footnote"${c}>`+s+`</li>`}function he(e){let t=e.footnotes.groups.filter(e=>e.definition!==null);if(t.length===0)return``;let n=t[0]?.number??1,r=n,i=t.map(t=>{let n=t.number!==r;return r=t.number+1,me(t,e,n)}).join(``);return`<section class="footnote-endnotes" role="doc-endnotes"><ol class="footnote-list"${n===1?``:` start="${n}"`}>${i}</ol></section>`}function ge(e,t){return(e.content??[]).filter(e=>e.type!==`footnoteDefinition`).map(e=>t.renderNode(e)).join(``)+he(t)}var _e={bold:e=>`<strong>${e}</strong>`,italic:e=>`<em>${e}</em>`,strike:e=>`<s>${e}</s>`,code:e=>`<code>${e}</code>`,link:(t,n)=>{let r=l(e(T(n.attrs,`href`))),i=T(n.attrs,`target`);return`<a href="${r}"${i?` target="${l(i)}"`:``}${i?` rel="noopener noreferrer"`:``}>${t}</a>`}},ve={doc:(e,t)=>ge(e,t),paragraph:(e,t)=>`<p>${t.renderChildren(e.content)}</p>`,heading:(e,t)=>{let n=Math.min(Math.max(E(e.attrs,`level`)??1,1),6);return`<h${n}>${t.renderChildren(e.content)}</h${n}>`},text:(e,t)=>t.renderText(e.text??``,e.marks),bulletList:(e,t)=>`<ul>${t.renderChildren(e.content)}</ul>`,orderedList:(e,t)=>{let n=E(e.attrs,`start`);return`<ol${n!==null&&n!==1?` start="${n}"`:``}>${t.renderChildren(e.content)}</ol>`},listItem:(e,t)=>`<li>${t.renderChildren(e.content)}</li>`,blockquote:(e,t)=>`<blockquote>${t.renderChildren(e.content)}</blockquote>`,codeBlock:e=>{let t=T(e.attrs,`language`);return`<pre><code${t?` class="language-${l(t)}"`:``}>${ae(e)}</code></pre>`},table:(e,t)=>`<table>${t.renderChildren(e.content)}</table>`,tableRow:(e,t)=>`<tr>${t.renderChildren(e.content)}</tr>`,tableCell:(e,t)=>oe(`td`,e,t),tableHeader:(e,t)=>oe(`th`,e,t),horizontalRule:()=>`<hr>`,hardBreak:()=>`<br>`,image:e=>u(e.attrs??{}),embed:e=>ie(e.attrs),htmlBlock:e=>{let t=T(e.attrs,`html`);return t?`<div class="tiptap-html-block">${t}</div>`:``},moreBreak:()=>`<!--more-->`,footnoteReference:(e,t)=>pe(e,t),footnoteDefinition:()=>``};function ye(e,t=[]){let n=l(e);for(let e of t){let t=_e[e.type];t&&(n=t(n,e))}return n}function be(e,t){return e.content?t.renderChildren(e.content):``}function xe(e){let t={footnotes:e,renderChildren(e=[]){return e.map(e=>t.renderNode(e)).join(``)},renderNode(e){return(ve[e.type]??be)(e,t)},renderText:ye};return t}function Se(e,t={}){if(e.type!==`doc`)return``;let n=c(e);return xe(fe(n,t)).renderNode(n)}var Ce=new Set([`doc`,`paragraph`,`heading`,`codeBlock`,`bulletList`,`orderedList`,`listItem`,`blockquote`,`table`,`tableRow`,`tableCell`,`tableHeader`,`footnoteDefinition`,`text`,`hardBreak`]);function we(e,t={}){let n;try{n=JSON.parse(e)}catch{return null}if(n.type!==`doc`||!n.content)return null;let r=t.includeLinkHrefs===!0;function i(e){if(!Ce.has(e.type))return``;if(e.type===`text`){let t=e.text??``;if(!r||!e.marks||e.marks.length===0)return t;let n=[];for(let t of e.marks){if(t.type!==`link`)continue;let e=t.attrs?.href;typeof e==`string`&&e.trim()&&n.push(e)}return n.length>0?`${t} ${n.join(` `)}`:t}return e.type===`hardBreak`?` `:e.content?e.content.map(i).join(` `):``}let a=[];for(let e of n.content){let t=i(e).trim();t&&a.push(t)}return a.length>0?a.join(` `):null}var Te={site:`sit`,siteDomain:`sdm`,post:`pst`,translationGroup:`tgr`,media:`med`,uploadSession:`upl`,collection:`col`,smartCollection:`smc`,path:`pth`,collectionDirectoryItem:`cdi`,navItem:`nav`,apiToken:`api`,user:`usr`,session:`ses`,account:`acc`,verification:`vrf`,telegramBinding:`tgb`,telegramBindingCode:`tgc`,telegramMediaGroupItem:`tmg`,storagePurge:`spg`};Te.user,Te.session,Te.account,Te.verification;var Ee=/^(?:[a-z](?:[a-z_]{0,61}[a-z])?)?$/,De=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/;function Oe(e,t){let n=e.lastIndexOf(`_`);if(n===0)return!1;let r=n===-1?``:e.slice(0,n);return t!==void 0&&r!==t?!1:Ee.test(r)&&De.test(e.slice(n+1))}function ke(e,t,n){return(t=Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(null,arguments)}function Ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ae(Object(n),!0).forEach(function(t){ke(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ae(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function je(e,t){if(e==null)return{};var n,r,i=Me(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Me(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ne(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pe(e){var t=Ne(e,`string`);return typeof t==`symbol`?t:t+``}function Fe(e){"@babel/helpers - typeof";return Fe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Fe(e)}var Ie=`1.15.7`;function k(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var A=k(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Le=k(/Edge/i),Re=k(/firefox/i),ze=k(/safari/i)&&!k(/chrome/i)&&!k(/android/i),Be=k(/iP(ad|od|hone)/i),Ve=k(/chrome/i)&&k(/android/i),He={capture:!1,passive:!1};function j(e,t,n){e.addEventListener(t,n,!A&&He)}function M(e,t,n){e.removeEventListener(t,n,!A&&He)}function Ue(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function We(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function N(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&Ue(e,t):Ue(e,t))||r&&e===n)return e;if(e===n)break}while(e=We(e))}return null}var Ge=/\s+/g;function P(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(Ge,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(Ge,` `))}function F(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function Ke(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=F(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function qe(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function I(){return document.scrollingElement||document.documentElement}function L(e,t,n,r,i){if(e.getBoundingClientRect||e===window){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==I()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!A))do if(i&&i.getBoundingClientRect&&(F(i,`transform`)!==`none`||n&&F(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(F(i,`border-top-width`)),s-=f.left+parseInt(F(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=Ke(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function Je(e,t,n){for(var r=z(e,!0),i=L(e)[t];r;){var a=L(r)[n],o=void 0;if(o=n===`top`||n===`left`?i>=a:i<=a,!o)return r;if(r===I())break;r=z(r,!1)}return!1}function Ye(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==Q.ghost&&(r||o[a]!==Q.dragged)&&N(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function Xe(e,t){for(var n=e.lastElementChild;n&&(n===Q.ghost||F(n,`display`)===`none`||t&&!Ue(n,t));)n=n.previousElementSibling;return n||null}function R(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==Q.clone&&(!t||Ue(e,t))&&n++;return n}function Ze(e){var t=0,n=0,r=I();if(e)do{var i=Ke(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function Qe(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function z(e,t){if(!e||!e.getBoundingClientRect)return I();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=F(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return I();if(r||t)return n;r=!0}}while(n=n.parentNode);return I()}function $e(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function et(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var tt;function nt(e,t){return function(){if(!tt){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),tt=setTimeout(function(){tt=void 0},t)}}}function rt(){clearTimeout(tt),tt=void 0}function it(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function at(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function ot(e,t,n){var r={};return Array.from(e.children).forEach(function(i){if(N(i,t.draggable,e,!1)&&!i.animated&&i!==n){var a=L(i);r.left=Math.min(r.left??1/0,a.left),r.top=Math.min(r.top??1/0,a.top),r.right=Math.max(r.right??-1/0,a.right),r.bottom=Math.max(r.bottom??-1/0,a.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var B=`Sortable`+new Date().getTime();function st(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(F(t,`display`)!==`none`&&t!==Q.ghost){e.push({target:t,rect:L(t)});var n=O({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=Ke(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(Qe(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=L(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=Ke(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&et(c,s)&&!et(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=lt(u,c,l,r.options)),et(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){F(e,`transition`,``),F(e,`transform`,``);var i=Ke(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,F(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=ct(e),F(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),F(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){F(e,`transition`,``),F(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function ct(e){return e.offsetWidth}function lt(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}var ut=[],dt={initializeByDefault:!0},ft={mount:function(e){for(var t in dt)dt.hasOwnProperty(t)&&!(t in e)&&(e[t]=dt[t]);ut.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),ut.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;ut.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](O({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](O({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in ut.forEach(function(r){var i=r.pluginName;if(e.options[i]||r.initializeByDefault){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,D(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return ut.forEach(function(r){typeof r.eventProperties==`function`&&D(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return ut.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function pt(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[B],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!A&&!Le?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var ee=O(O({},m),ft.getEventProperties(r,t));for(var v in ee)h[v]=ee[v];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}var mt=[`evt`],V=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=je(n,mt);ft.pluginEvent.bind(Q)(e,t,O({dragEl:U,parentEl:W,ghostEl:G,rootEl:K,nextEl:ht,lastDownEl:gt,cloneEl:q,cloneHidden:_t,dragStarted:At,putSortable:Y,activeSortable:Q.active,originalEvent:r,oldIndex:vt,oldDraggableIndex:yt,newIndex:J,newDraggableIndex:bt,hideGhostForTarget:Jt,unhideGhostForTarget:Yt,cloneNowHidden:function(){_t=!0},cloneNowShown:function(){_t=!1},dispatchSortableEvent:function(e){H({sortable:t,name:e,originalEvent:r})}},i))};function H(e){pt(O({putSortable:Y,cloneEl:q,targetEl:U,rootEl:K,oldIndex:vt,oldDraggableIndex:yt,newIndex:J,newDraggableIndex:bt},e))}var U,W,G,K,ht,gt,q,_t,vt,J,yt,bt,xt,Y,St=!1,Ct=!1,wt=[],Tt,X,Et,Dt,Ot,kt,At,jt,Mt,Nt=!1,Pt=!1,Ft,Z,It=[],Lt=!1,Rt=[],zt=typeof document<`u`,Bt=Be,Vt=Le||A?`cssFloat`:`float`,Ht=zt&&!Ve&&!Be&&`draggable`in document.createElement(`div`),Ut=function(){if(zt){if(A)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),Wt=function(e,t){var n=F(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ye(e,0,t),a=Ye(e,1,t),o=i&&F(i),s=a&&F(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+L(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+L(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[Vt]===`none`||a&&n[Vt]===`none`&&c+l>r)?`vertical`:`horizontal`},Gt=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},Kt=function(e,t){var n;return wt.some(function(r){var i=r[B].options.emptyInsertThreshold;if(i&&!Xe(r)){var a=L(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},qt=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||Fe(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Jt=function(){!Ut&&G&&F(G,`display`,`none`)},Yt=function(){!Ut&&G&&F(G,`display`,``)};zt&&!Ve&&document.addEventListener(`click`,function(e){if(Ct)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ct=!1,!1},!0);var Xt=function(e){if(U){e=e.touches?e.touches[0]:e;var t=Kt(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[B]._onDragOver(n)}}},Zt=function(e){U&&U.parentNode[B]._isOutsideThisEl(e.target)};function Q(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=D({},t),e[B]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Wt(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Q.supportPointer!==!1&&`PointerEvent`in window&&(!ze||Be),emptyInsertThreshold:5};for(var r in ft.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in qt(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&Ht,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?j(e,`pointerdown`,this._onTapStart):(j(e,`mousedown`,this._onTapStart),j(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(j(e,`dragover`,this),j(e,`dragenter`,this)),wt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),D(this,st())}Q.prototype={constructor:Q,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(jt=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,U):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(cn(n),!U&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&ze&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=N(s,r.draggable,n,!1),!(s&&s.animated)&&gt!==s)){if(vt=R(s),yt=R(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){H({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),V(`filter`,t,{evt:e}),i&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=N(c,r.trim(),n,!1),r)return H({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),V(`filter`,t,{evt:e}),!0}),l)){i&&e.preventDefault();return}(!r.handle||N(c,r.handle,n,!1))&&this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!U&&n.parentNode===i){var c=L(n);if(K=i,U=n,W=U.parentNode,ht=U.nextSibling,gt=n,xt=a.group,Q.dragged=U,Tt={target:U,clientX:(t||e).clientX,clientY:(t||e).clientY},Ot=Tt.clientX-c.left,kt=Tt.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,U.style[`will-change`]=`all`,s=function(){if(V(`delayEnded`,r,{evt:e}),Q.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Re&&r.nativeDraggable&&(U.draggable=!0),r._triggerDragStart(e,t),H({sortable:r,name:`choose`,originalEvent:e}),P(U,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){qe(U,e.trim(),en)}),j(o,`dragover`,Xt),j(o,`mousemove`,Xt),j(o,`touchmove`,Xt),a.supportPointer?(j(o,`pointerup`,r._onDrop),!this.nativeDraggable&&j(o,`pointercancel`,r._onDrop)):(j(o,`mouseup`,r._onDrop),j(o,`touchend`,r._onDrop),j(o,`touchcancel`,r._onDrop)),Re&&this.nativeDraggable&&(this.options.touchStartThreshold=4,U.draggable=!0),V(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Le||A))){if(Q.eventCanceled){this._onDrop();return}a.supportPointer?(j(o,`pointerup`,r._disableDelayedDrag),j(o,`pointercancel`,r._disableDelayedDrag)):(j(o,`mouseup`,r._disableDelayedDrag),j(o,`touchend`,r._disableDelayedDrag),j(o,`touchcancel`,r._disableDelayedDrag)),j(o,`mousemove`,r._delayedDragTouchMoveHandler),j(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&j(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){U&&en(U),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;M(e,`mouseup`,this._disableDelayedDrag),M(e,`touchend`,this._disableDelayedDrag),M(e,`touchcancel`,this._disableDelayedDrag),M(e,`pointerup`,this._disableDelayedDrag),M(e,`pointercancel`,this._disableDelayedDrag),M(e,`mousemove`,this._delayedDragTouchMoveHandler),M(e,`touchmove`,this._delayedDragTouchMoveHandler),M(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?j(document,`pointermove`,this._onTouchMove):t?j(document,`touchmove`,this._onTouchMove):j(document,`mousemove`,this._onTouchMove):(j(U,`dragend`,this),j(K,`dragstart`,this._onDragStart));try{document.selection?ln(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(St=!1,K&&U){V(`dragStarted`,this,{evt:t}),this.nativeDraggable&&j(document,`dragover`,Zt);var n=this.options;!e&&P(U,n.dragClass,!1),P(U,n.ghostClass,!0),Q.active=this,e&&this._appendGhost(),H({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,Jt();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(U.parentNode[B]._isOutsideThisEl(e),t)do{if(t[B]){var n=void 0;if(n=t[B]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=We(t));Yt()}},_onTouchMove:function(e){if(Tt){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=G&&Ke(G,!0),o=G&&a&&a.a,s=G&&a&&a.d,c=Bt&&Z&&Ze(Z),l=(i.clientX-Tt.clientX+r.x)/(o||1)+(c?c[0]-It[0]:0)/(o||1),u=(i.clientY-Tt.clientY+r.y)/(s||1)+(c?c[1]-It[1]:0)/(s||1);if(!Q.active&&!St){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(G){a?(a.e+=l-(Et||0),a.f+=u-(Dt||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;F(G,`webkitTransform`,d),F(G,`mozTransform`,d),F(G,`msTransform`,d),F(G,`transform`,d),Et=l,Dt=u,X=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!G){var e=this.options.fallbackOnBody?document.body:K,t=L(U,!0,Bt,!0,e),n=this.options;if(Bt){for(Z=e;F(Z,`position`)===`static`&&F(Z,`transform`)===`none`&&Z!==document;)Z=Z.parentNode;Z!==document.body&&Z!==document.documentElement?(Z===document&&(Z=I()),t.top+=Z.scrollTop,t.left+=Z.scrollLeft):Z=I(),It=Ze(Z)}G=U.cloneNode(!0),P(G,n.ghostClass,!1),P(G,n.fallbackClass,!0),P(G,n.dragClass,!0),F(G,`transition`,``),F(G,`transform`,``),F(G,`box-sizing`,`border-box`),F(G,`margin`,0),F(G,`top`,t.top),F(G,`left`,t.left),F(G,`width`,t.width),F(G,`height`,t.height),F(G,`opacity`,`0.8`),F(G,`position`,Bt?`absolute`:`fixed`),F(G,`zIndex`,`100000`),F(G,`pointerEvents`,`none`),Q.ghost=G,e.appendChild(G),F(G,`transform-origin`,Ot/parseInt(G.style.width)*100+`% `+kt/parseInt(G.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(V(`dragStart`,this,{evt:e}),Q.eventCanceled){this._onDrop();return}V(`setupClone`,this),Q.eventCanceled||(q=at(U),q.removeAttribute(`id`),q.draggable=!1,q.style[`will-change`]=``,this._hideClone(),P(q,this.options.chosenClass,!1),Q.clone=q),n.cloneId=ln(function(){V(`clone`,n),!Q.eventCanceled&&(n.options.removeCloneOnHide||K.insertBefore(q,U),n._hideClone(),H({sortable:n,name:`clone`}))}),!t&&P(U,i.dragClass,!0),t?(Ct=!0,n._loopId=setInterval(n._emulateDragOver,50)):(M(document,`mouseup`,n._onDrop),M(document,`touchend`,n._onDrop),M(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,U)),j(document,`drop`,n),F(U,`transform`,`translateZ(0)`)),St=!0,n._dragStartId=ln(n._dragStarted.bind(n,t,e)),j(document,`selectstart`,n),At=!0,window.getSelection().removeAllRanges(),ze&&F(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=Q.active,l=xt===s,u=o.sort,d=Y||c,f,p=this,m=!1;if(Lt)return;function h(o,s){V(o,p,O({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return $t(K,t,U,r,n,L(n),e,i)},changed:ee},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(P(U,Y?Y.options.ghostClass:c.options.ghostClass,!1),P(U,o.ghostClass,!0)),Y!==p&&p!==Q.active?Y=p:p===Q.active&&Y&&(Y=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===U&&!U.animated||n===t&&!n.animated)&&(jt=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(U.parentNode[B]._isOutsideThisEl(e.target),!r&&Xt(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function ee(){J=R(U),bt=R(U,o.draggable),H({sortable:p,name:`change`,toEl:t,newIndex:J,newDraggableIndex:bt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=N(n,o.draggable,t,!0),h(`dragOver`),Q.eventCanceled)return m;if(U.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(Ct=!1,c&&!o.disabled&&(l?u||(a=W!==K):Y===this||(this.lastPutMode=xt.checkPull(this,c,U,e))&&s.checkPut(this,c,U,e))){if(f=this._getDirection(e,n)===`vertical`,r=L(U),h(`dragOverValid`),Q.eventCanceled)return m;if(a)return W=K,g(),this._hideClone(),h(`revert`),Q.eventCanceled||(ht?K.insertBefore(U,ht):K.appendChild(U)),_(!0);var v=Xe(t,o.draggable);if(!v||rn(e,f,this)&&!v.animated){if(v===U)return _(!1);if(v&&t===e.target&&(n=v),n&&(i=L(n)),$t(K,t,U,r,n,i,e,!!n)!==!1)return g(),v&&v.nextSibling?t.insertBefore(U,v.nextSibling):t.appendChild(U),W=t,ee(),_(!0)}else if(v&&nn(e,f,this)){var te=Ye(t,0,o,!0);if(te===U)return _(!1);if(n=te,i=L(n),$t(K,t,U,r,n,i,e,!1)!==!1)return g(),t.insertBefore(U,te),W=t,ee(),_(!0)}else if(n.parentNode===t){i=L(n);var y=0,b,ne=U.parentNode!==t,x=!Gt(U.animated&&U.toRect||r,n.animated&&n.toRect||i,f),S=f?`top`:`left`,C=Je(n,`top`,`top`)||Je(U,`top`,`top`),re=C?C.scrollTop:void 0;jt!==n&&(b=i[S],Nt=!1,Pt=!x&&o.invertSwap||ne),y=an(e,n,i,f,x?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,Pt,jt===n);var w;if(y!==0){var ie=R(U);do ie-=y,w=W.children[ie];while(w&&(F(w,`display`)===`none`||w===G))}if(y===0||w===n)return _(!1);jt=n,Mt=y;var T=n.nextElementSibling,E=!1;E=y===1;var ae=$t(K,t,U,r,n,i,e,E);if(ae!==!1)return(ae===1||ae===-1)&&(E=ae===1),Lt=!0,setTimeout(tn,30),g(),E&&!T?t.appendChild(U):n.parentNode.insertBefore(U,E?T:n),C&&it(C,0,re-C.scrollTop),W=U.parentNode,b!==void 0&&!Pt&&(Ft=Math.abs(b-L(n)[S])),ee(),_(!0)}if(t.contains(U))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){M(document,`mousemove`,this._onTouchMove),M(document,`touchmove`,this._onTouchMove),M(document,`pointermove`,this._onTouchMove),M(document,`dragover`,Xt),M(document,`mousemove`,Xt),M(document,`touchmove`,Xt)},_offUpEvents:function(){var e=this.el.ownerDocument;M(e,`mouseup`,this._onDrop),M(e,`touchend`,this._onDrop),M(e,`pointerup`,this._onDrop),M(e,`pointercancel`,this._onDrop),M(e,`touchcancel`,this._onDrop),M(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(J=R(U),bt=R(U,n.draggable),V(`drop`,this,{evt:e}),W=U&&U.parentNode,J=R(U),bt=R(U,n.draggable),Q.eventCanceled){this._nulling();return}St=!1,Pt=!1,Nt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),un(this.cloneId),un(this._dragStartId),this.nativeDraggable&&(M(document,`drop`,this),M(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ze&&F(document.body,`user-select`,``),F(U,`transform`,``),e&&(At&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),G&&G.parentNode&&G.parentNode.removeChild(G),(K===W||Y&&Y.lastPutMode!==`clone`)&&q&&q.parentNode&&q.parentNode.removeChild(q),U&&(this.nativeDraggable&&M(U,`dragend`,this),en(U),U.style[`will-change`]=``,At&&!St&&P(U,Y?Y.options.ghostClass:this.options.ghostClass,!1),P(U,this.options.chosenClass,!1),H({sortable:this,name:`unchoose`,toEl:W,newIndex:null,newDraggableIndex:null,originalEvent:e}),K===W?J!==vt&&J>=0&&(H({sortable:this,name:`update`,toEl:W,originalEvent:e}),H({sortable:this,name:`sort`,toEl:W,originalEvent:e})):(J>=0&&(H({rootEl:W,name:`add`,toEl:W,fromEl:K,originalEvent:e}),H({sortable:this,name:`remove`,toEl:W,originalEvent:e}),H({rootEl:W,name:`sort`,toEl:W,fromEl:K,originalEvent:e}),H({sortable:this,name:`sort`,toEl:W,originalEvent:e})),Y&&Y.save()),Q.active&&((J==null||J===-1)&&(J=vt,bt=yt),H({sortable:this,name:`end`,toEl:W,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){V(`nulling`,this),K=U=W=G=ht=q=gt=_t=Tt=X=At=J=bt=vt=yt=jt=Mt=Y=xt=Q.dragged=Q.ghost=Q.clone=Q.active=null;var e=this.el;Rt.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Rt.length=Et=Dt=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:U&&(this._onDragOver(e),Qt(e));break;case`selectstart`:e.preventDefault()}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],N(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||sn(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];N(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return N(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=ft.modifyOption(this,e,t);n[e]=r===void 0?t:r,e===`group`&&qt(n)},destroy:function(){V(`destroy`,this);var e=this.el;e[B]=null,M(e,`mousedown`,this._onTapStart),M(e,`touchstart`,this._onTapStart),M(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(M(e,`dragover`,this),M(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),wt.splice(wt.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!_t){if(V(`hideClone`,this),Q.eventCanceled)return;F(q,`display`,`none`),this.options.removeCloneOnHide&&q.parentNode&&q.parentNode.removeChild(q),_t=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(_t){if(V(`showClone`,this),Q.eventCanceled)return;U.parentNode==K&&!this.options.group.revertClone?K.insertBefore(q,U):ht?K.insertBefore(q,ht):K.appendChild(q),this.options.group.revertClone&&this.animate(U,q),F(q,`display`,``),_t=!1}}};function Qt(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function $t(e,t,n,r,i,a,o,s){var c,l=e[B],u=l.options.onMove,d;return window.CustomEvent&&!A&&!Le?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||L(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function en(e){e.draggable=!1}function tn(){Lt=!1}function nn(e,t,n){var r=L(Ye(n.el,0,n.options,!0)),i=ot(n.el,n.options,G),a=10;return t?e.clientX<i.left-a||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-a||e.clientY<r.bottom&&e.clientX<r.left}function rn(e,t,n){var r=L(Xe(n.el,n.options.draggable)),i=ot(n.el,n.options,G),a=10;return t?e.clientX>i.right+a||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+a||e.clientX>r.right&&e.clientY>r.top}function an(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&Ft<l*i){if(!Nt&&(Mt===1?c>u+l*a/2:c<d-l*a/2)&&(Nt=!0),Nt)f=!0;else if(Mt===1?c<u+Ft:c>d-Ft)return-Mt}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return on(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function on(e){return R(U)<R(e)?1:-1}function sn(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function cn(e){Rt.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&Rt.push(r)}}function ln(e){return setTimeout(e,0)}function un(e){return clearTimeout(e)}zt&&j(document,`touchmove`,function(e){(Q.active||St)&&e.cancelable&&e.preventDefault()}),Q.utils={on:j,off:M,css:F,find:qe,is:function(e,t){return!!N(e,t,e,!1)},extend:$e,throttle:nt,closest:N,toggleClass:P,clone:at,index:R,nextTick:ln,cancelNextTick:un,detectDirection:Wt,getChild:Ye,expando:B},Q.get=function(e){return e[B]},Q.mount=function(){var e=[...arguments];e[0].constructor===Array&&(e=e[0]),e.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(Q.utils=O(O({},Q.utils),e.utils)),ft.mount(e)})},Q.create=function(e,t){return new Q(e,t)},Q.version=Ie;var $=[],dn,fn,pn=!1,mn,hn,gn,_n;function vn(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?j(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?j(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?j(document,`touchmove`,this._handleFallbackAutoScroll):j(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?M(document,`dragover`,this._handleAutoScroll):(M(document,`pointermove`,this._handleFallbackAutoScroll),M(document,`touchmove`,this._handleFallbackAutoScroll),M(document,`mousemove`,this._handleFallbackAutoScroll)),bn(),yn(),rt()},nulling:function(){gn=fn=dn=pn=_n=mn=hn=null,$.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(gn=e,t||this.options.forceAutoScrollFallback||Le||A||ze){xn(e,this.options,a,t);var o=z(a,!0);pn&&(!_n||r!==mn||i!==hn)&&(_n&&bn(),_n=setInterval(function(){var a=z(document.elementFromPoint(r,i),!0);a!==o&&(o=a,yn()),xn(e,n.options,a,t)},10),mn=r,hn=i)}else{if(!this.options.bubbleScroll||z(a,!0)===I()){yn();return}xn(e,this.options,z(a,!1),!1)}}},D(e,{pluginName:`scroll`,initializeByDefault:!0})}function yn(){$.forEach(function(e){clearInterval(e.pid)}),$=[]}function bn(){clearInterval(_n)}var xn=nt(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=I(),l=!1,u;fn!==n&&(fn=n,yn(),dn=t.scroll,u=t.scrollFn,dn===!0&&(dn=z(n,!0)));var d=0,f=dn;do{var p=f,m=L(p),h=m.top,g=m.bottom,_=m.left,ee=m.right,v=m.width,te=m.height,y=void 0,b=void 0,ne=p.scrollWidth,x=p.scrollHeight,S=F(p),C=p.scrollLeft,re=p.scrollTop;p===c?(y=v<ne&&(S.overflowX===`auto`||S.overflowX===`scroll`||S.overflowX===`visible`),b=te<x&&(S.overflowY===`auto`||S.overflowY===`scroll`||S.overflowY===`visible`)):(y=v<ne&&(S.overflowX===`auto`||S.overflowX===`scroll`),b=te<x&&(S.overflowY===`auto`||S.overflowY===`scroll`));var w=y&&(Math.abs(ee-i)<=o&&C+v<ne)-(Math.abs(_-i)<=o&&!!C),ie=b&&(Math.abs(g-a)<=o&&re+te<x)-(Math.abs(h-a)<=o&&!!re);if(!$[d])for(var T=0;T<=d;T++)$[T]||($[T]={});($[d].vx!=w||$[d].vy!=ie||$[d].el!==p)&&($[d].el=p,$[d].vx=w,$[d].vy=ie,clearInterval($[d].pid),(w!=0||ie!=0)&&(l=!0,$[d].pid=setInterval(function(){r&&this.layer===0&&Q.active._onTouchMove(gn);var t=$[this.layer].vy?$[this.layer].vy*s:0,n=$[this.layer].vx?$[this.layer].vx*s:0;(typeof u!=`function`||u.call(Q.dragged.parentNode[B],n,t,e,gn,$[this.layer].el)===`continue`)&&it($[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=z(f,!1)));pn=l}},30),Sn=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}};function Cn(){}Cn.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Ye(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Sn},D(Cn,{pluginName:`revertOnSpill`});function wn(){}wn.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Sn},D(wn,{pluginName:`removeOnSpill`}),Q.mount(new vn),Q.mount(wn,Cn);var Tn={animation:180,bubbleScroll:!1,delay:150,delayOnTouchOnly:!0,fallbackTolerance:4,forceAutoScrollFallback:!0,scrollSensitivity:56,scrollSpeed:18};function En(e,t,n){return[...e.querySelectorAll(t)].map(e=>e.dataset[n]).filter(e=>e!==void 0)}function Dn(e){return e.item.nextSibling}function On(e,t,n=null){let{item:r,oldIndex:i,newIndex:a}=t;if(i==null||a==null||i===a)return;if(r.parentNode?.removeChild(r),n){e.insertBefore(r,n);return}let o=e.children;i>=o.length?e.appendChild(r):e.insertBefore(r,o[i]??null)}function kn(e,t){if(t){e.dataset.dragging=`true`;return}delete e.dataset.dragging}function An(e,t){let n=t==null?void 0:e[t];if(!n)return{movedId:void 0,movedIndex:-1,afterId:null,beforeId:null};let r=e.indexOf(n);return{movedId:n,movedIndex:r,afterId:r>0?e[r-1]:null,beforeId:r>=0&&r<e.length-1?e[r+1]:null}}export{On as a,Te as c,Se as d,ne as f,Tn as i,Oe as l,An as n,kn as o,En as r,Q as s,Dn as t,we as u};
@@ -1 +0,0 @@
1
- function e(e){return typeof e==`object`&&!!e}function t(t,n){if(!e(t))return;let r=t[n];return typeof r==`string`?r:void 0}function n(t,n){if(!e(t))return;let r=t[n];return typeof r==`boolean`?r:void 0}function r(t,n){if(!e(t))return;let r=t[n];return typeof r==`number`?r:void 0}async function i(t){let n=await t.text();if(!n.trim())return{};try{let t=JSON.parse(n);return e(t)?t:{}}catch{throw Error(`Expected JSON (HTTP ${t.status}) but got: ${c(n.trim(),200)}`)}}async function a(e,t){let n;try{n=await e.text()}catch{return t}return s(n,t)}function o(e,t){return s(e,t)}function s(n,r){let i=n.trim();if(!i)return r;try{let n=JSON.parse(i);if(e(n)){let e=t(n,`error`);if(e)return e}}catch{}return c(i,200)}function c(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function l(e,t){let n=d(e);return n?n===t?0:n.startsWith(t)?1:n.split(/[\s\-_.:/]+/).filter(Boolean).some(e=>e.startsWith(t))?2:n.includes(t)?3:null:null}function u(e,t){let n=null;for(let r of e){let e=l(r,t);if(e===0)return 0;e!==null&&(n===null||e<n)&&(n=e)}return n}function d(e){if(!e)return``;let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t+=r>=65281&&r<=65374?String.fromCharCode(r-65248):r===12288?` `:e[n]}return t.trim().toLowerCase()}var f=[`note`,`link`,`quote`],p=[`public`,`featured`,`latest_hidden`];[...p];var m=1971,h=9999,g=[`newest`,`oldest`,`rating_desc`],_=[`rss`,`subscribe`];function v(e){return _.includes(e??``)}({1:{version:1,systemKeys:[`featured`,`collections`,`archive`,`rss`,`settings`]},2:{version:2,systemKeys:[`featured`,`archive`,`collections`,`rss`,`settings`]},3:{version:3,systemKeys:[`featured`,`archive`,`collections`,`subscribe`,`settings`]}})[3];var y=1e3,b=5e3,x=[`image`,`video`,`audio`,`text`,`document`],S={SITE_NAME:{defaultValue:`Jant`,envOnly:!1,envKeys:[`SITE_NAME`],editor:{type:`string`,maxLength:120},configEditorLink:{type:`string`,settingsPath:`/settings/general`,display:`value`,resettable:!0}},SITE_DESCRIPTION:{defaultValue:``,envOnly:!1,envKeys:[`SITE_DESCRIPTION`],editor:{type:`string`,maxLength:y},configEditorLink:{type:`string`,settingsPath:`/settings/general`,display:`configured`,resettable:!0}},SITE_LANGUAGE:{defaultValue:`en`,envOnly:!1,envKeys:[`SITE_LANGUAGE`],editor:{type:`enum`,optionsSource:`contentLanguage`}},DASHBOARD_LANGUAGE:{defaultValue:``,envOnly:!1,envKeys:[`DASHBOARD_LANGUAGE`],editor:{type:`enum`,options:[``,`en`,`zh-Hans`,`zh-Hant`]}},MULTILINGUAL_ENABLED:{defaultValue:`false`,envOnly:!1,configEditorLink:{type:`boolean`,settingsPath:`/settings/language`,display:`value`}},ADDITIONAL_LANGUAGES:{defaultValue:``,envOnly:!1,configEditorLink:{type:`string`,settingsPath:`/settings/language`,display:`configured`}},MAIN_RSS_FEED:{defaultValue:`featured`,envOnly:!1,envKeys:[`MAIN_RSS_FEED`],editor:{type:`enum`,options:[`featured`,`latest`]}},ARCHIVE_DEFAULT_LAYOUT:{defaultValue:`list`,envOnly:!1,envKeys:[`ARCHIVE_DEFAULT_LAYOUT`],editor:{type:`enum`,options:[`list`,`grid`]}},DEFAULT_THEME:{defaultValue:`tufte`,envOnly:!0,envKeys:[`DEFAULT_THEME`]},DEFAULT_FONT_THEME:{defaultValue:`classic`,envOnly:!0,envKeys:[`DEFAULT_FONT_THEME`]},SITE_ORIGIN:{defaultValue:``,envOnly:!0,envKeys:[`SITE_ORIGIN`]},SITE_PATH_PREFIX:{defaultValue:``,envOnly:!0,envKeys:[`SITE_PATH_PREFIX`]},AUTH_SECRET:{defaultValue:``,envOnly:!0,envKeys:[`AUTH_SECRET`]},R2_PUBLIC_URL:{defaultValue:``,envOnly:!0,envKeys:[`R2_PUBLIC_URL`]},IMAGE_TRANSFORM_URL:{defaultValue:``,envOnly:!0,envKeys:[`IMAGE_TRANSFORM_URL`]},DEMO_EMAIL:{defaultValue:``,envOnly:!0,envKeys:[`DEMO_EMAIL`]},DEMO_PASSWORD:{defaultValue:``,envOnly:!0,envKeys:[`DEMO_PASSWORD`]},DEMO_MODE:{defaultValue:`false`,envOnly:!0,envKeys:[`DEMO_MODE`]},PAGE_SIZE:{defaultValue:`25`,envOnly:!1,envKeys:[`PAGE_SIZE`],editor:{type:`number`,min:1,max:100,step:1}},SEARCH_PAGE_SIZE:{defaultValue:``,envOnly:!1,fallbackKey:`PAGE_SIZE`,envKeys:[`SEARCH_PAGE_SIZE`],editor:{type:`number`,min:1,max:100,step:1}},ARCHIVE_PAGE_SIZE:{defaultValue:``,envOnly:!1,fallbackKey:`PAGE_SIZE`,envKeys:[`ARCHIVE_PAGE_SIZE`],editor:{type:`number`,min:1,max:100,step:1}},STORAGE_DRIVER:{defaultValue:`r2`,envOnly:!0,envKeys:[`STORAGE_DRIVER`]},S3_ENDPOINT:{defaultValue:``,envOnly:!0,envKeys:[`S3_ENDPOINT`]},S3_BUCKET:{defaultValue:``,envOnly:!0,envKeys:[`S3_BUCKET`]},S3_ACCESS_KEY_ID:{defaultValue:``,envOnly:!0,envKeys:[`S3_ACCESS_KEY_ID`]},S3_SECRET_ACCESS_KEY:{defaultValue:``,envOnly:!0,envKeys:[`S3_SECRET_ACCESS_KEY`]},S3_REGION:{defaultValue:`auto`,envOnly:!0,envKeys:[`S3_REGION`]},S3_PUBLIC_URL:{defaultValue:``,envOnly:!0,envKeys:[`S3_PUBLIC_URL`]},ASSET_BASE_URL:{defaultValue:``,envOnly:!0,envKeys:[`ASSET_BASE_URL`]},UPLOAD_MAX_FILE_SIZE_MB:{defaultValue:`1024`,envOnly:!0,envKeys:[`UPLOAD_MAX_FILE_SIZE_MB`]},SUMMARY_MAX_PARAGRAPHS:{defaultValue:`5`,envOnly:!1,envKeys:[`SUMMARY_MAX_PARAGRAPHS`],editor:{type:`number`,min:1,max:50,step:1}},SUMMARY_MAX_CHARS:{defaultValue:`500`,envOnly:!1,envKeys:[`SUMMARY_MAX_CHARS`],editor:{type:`number`,min:1,max:1500,step:1}},SLUG_ID_LENGTH:{defaultValue:`5`,envOnly:!0,envKeys:[`SLUG_ID_LENGTH`]},RSS_FEED_LIMIT:{defaultValue:`50`,envOnly:!1,envKeys:[`RSS_FEED_LIMIT`],editor:{type:`number`,min:1,max:200,step:1}},RSS_PUBLISH_DELAY_SECONDS:{defaultValue:`300`,envOnly:!1,envKeys:[`RSS_PUBLISH_DELAY_SECONDS`],editor:{type:`number`,min:0,max:7200,step:1}},THEME:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/color-theme`,display:`value`,fallbackKey:`DEFAULT_THEME`,resettable:!0}},CUSTOM_CSS:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/custom-css`,display:`configured`}},CUSTOM_HEAD_HTML:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/code-injection`,display:`configured`}},CUSTOM_BODY_END_HTML:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/code-injection`,display:`configured`}},SITE_AVATAR:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/avatar`,display:`configured`}},SHOW_HEADER_AVATAR:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`boolean`,settingsPath:`/settings/avatar`,display:`value`,fallbackValue:`false`,resettable:!0}},SITE_FAVICON_ICO:{defaultValue:``,envOnly:!1,internal:!0},SITE_FAVICON_APPLE_TOUCH:{defaultValue:``,envOnly:!1,internal:!0},SITE_FAVICON_VERSION:{defaultValue:``,envOnly:!1,internal:!0},FONT_THEME:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/font-theme`,display:`value`,fallbackKey:`DEFAULT_FONT_THEME`,resettable:!0}},THEME_MODE:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/color-theme`,display:`value`,fallbackValue:`auto`,resettable:!0}},TIME_ZONE:{defaultValue:`UTC`,envOnly:!1,envKeys:[`TIME_ZONE`],editor:{type:`enum`,optionsSource:`timeZone`}},SITE_FOOTER:{defaultValue:``,envOnly:!1,envKeys:[`SITE_FOOTER`],editor:{type:`string`,maxLength:b},configEditorLink:{type:`string`,settingsPath:`/settings/general`,display:`configured`,resettable:!0}},SHOW_JANT_BRANDING_ON_HOME:{defaultValue:`false`,envOnly:!1,envKeys:[`SHOW_JANT_BRANDING_ON_HOME`],editor:{type:`boolean`}},NOINDEX:{defaultValue:`false`,envOnly:!1,envKeys:[`NOINDEX`],editor:{type:`boolean`}},PUBLIC_API_ENABLED:{defaultValue:`true`,envOnly:!1,envKeys:[`PUBLIC_API_ENABLED`],editor:{type:`boolean`}},RSS_FEEDS_ENABLED:{defaultValue:`true`,envOnly:!1,envKeys:[`RSS_FEEDS_ENABLED`],editor:{type:`boolean`}},DISCOVER:{defaultValue:``,envOnly:!1,envKeys:[`DISCOVER`]},DISCOVER_ANNOUNCE_STATE:{defaultValue:``,envOnly:!1,internal:!0},DISCOVERY_COMPOSE_OPEN_SHORTCUT_AT:{defaultValue:``,envOnly:!1,internal:!0},DISCOVERY_SLASH_COMMAND_AT:{defaultValue:``,envOnly:!1,internal:!0},ONBOARDING_STATUS:{defaultValue:`pending`,envOnly:!1,internal:!0},PASSWORD_RESET_TOKEN:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_ENABLED:{defaultValue:`false`,envOnly:!1,internal:!0,configEditorLink:{type:`boolean`,settingsPath:`/settings/github-sync`,display:`value`}},GITHUB_SYNC_REPO:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/github-sync`,display:`configured`}},GITHUB_SYNC_TOKEN:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_WEBHOOK_SECRET:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_WEBHOOK_ID:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_LAST_PUSH_SHA:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_LAST_PUSH_AT:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_PENDING:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_PENDING_AT:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_DIRTY:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_LAST_ERROR:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_SYNC_AUTH_MODE:{defaultValue:`pat`,envOnly:!1,internal:!0},GITHUB_SYNC_APP_INSTALLATION_ID:{defaultValue:``,envOnly:!1,internal:!0},GITHUB_APP_ID:{defaultValue:``,envOnly:!0,envKeys:[`GITHUB_APP_ID`]},GITHUB_APP_PRIVATE_KEY:{defaultValue:``,envOnly:!0,envKeys:[`GITHUB_APP_PRIVATE_KEY`]},GITHUB_APP_SLUG:{defaultValue:``,envOnly:!0,envKeys:[`GITHUB_APP_SLUG`]},GITHUB_APP_WEBHOOK_SECRET:{defaultValue:``,envOnly:!0,envKeys:[`GITHUB_APP_WEBHOOK_SECRET`]},TELEGRAM_BOT_TOKENS:{defaultValue:``,envOnly:!0,envKeys:[`TELEGRAM_BOT_TOKENS`]},TELEGRAM_WEBHOOK_SECRET:{defaultValue:``,envOnly:!0,envKeys:[`TELEGRAM_WEBHOOK_SECRET`]},TELEGRAM_BOT_TOKEN:{defaultValue:``,envOnly:!1,internal:!0},TELEGRAM_BOT_ID:{defaultValue:``,envOnly:!1,internal:!0},TELEGRAM_BOT_USERNAME:{defaultValue:``,envOnly:!1,internal:!0,configEditorLink:{type:`string`,settingsPath:`/settings/telegram`,display:`configured`}},TELEGRAM_BOT_WEBHOOK_SECRET:{defaultValue:``,envOnly:!1,internal:!0}};export{i as _,h as a,v as c,n as d,r as f,o as g,a as h,f as i,u as l,e as m,g as n,x as o,t as p,m as r,p as s,S as t,d as u};
@@ -1 +0,0 @@
1
- import{c as e,f as t,n,r,t as i}from"./footnote-rail-B08scyhW.js";import{u as a}from"./lit-Bw_voPoW.js";import{r as o,t as s}from"./unsafe-html-CWos3v6N.js";import{l as c,u as l}from"./types-D5iF3H1a.js";function u(r){n(r),e(r),t(r),i(r)}function d(){return document.querySelector(`jant-compose-dialog`)}async function f(){let e=d();return e?(await r(),e):null}function p(){let e=d();if(!e)return null;if(e.labels)return e.labels;let t=e.getAttribute(`labels`);if(!t)return null;try{return JSON.parse(t)}catch{return null}}function m(){return document.querySelector(`[data-collection-mode][data-collection-id]`)?.dataset.collectionId||void 0}function h(e=document){if(e===document){let e=document.querySelector(`.thread-group-detail article[data-post]:hover`);if(e)return e}return e.querySelector(`[data-post-current] article[data-post]`)||e.querySelector(`[data-post-view] article[data-post]`)||(e===document?document.querySelector(`article[data-post]:hover`):null)}function g(e){let t=e.querySelector(`.thread-group-detail`);if(!t)return null;let n=t.querySelectorAll(`.thread-detail-item article[data-post]`);return n.length>0?n.item(n.length-1):null}function _(e=document){let t=g(e);if(t)return t;if(e===document){let e=document.querySelector(`.thread-group-detail article[data-post]:hover`);if(e)return e}return h(e)}function v(e){let t=e.closest(`[data-post-view]`)?.dataset.postViewId;if(t)return{kind:`post-view`,id:t};let n=e.closest(`[data-timeline-item]`),r=n?.dataset.threadRootId??e.dataset.threadRootId??e.dataset.postId;if(n&&r)return{kind:`timeline-item`,id:r};let i=e.dataset.postId;return i?{kind:`post-card`,id:i}:null}function y(e){let t=e.cloneNode(!0);t.querySelector(`[data-post-meta]`)?.remove(),t.querySelector(`.post-status-badges`)?.remove();let n=e.querySelector(`time.dt-published`);return{contentHtml:t.innerHTML,dateText:n?.textContent?.trim()??``}}async function b(e){await(await f())?.openNew(e)}async function x(e){await(await f())?.openEdit(e)}async function S(e){await(await f())?.openDraft(e)}async function C(e){let t=e.dataset.postId;if(!t)return;let n=await f();if(!n)return;let r=e.dataset.threadDraftTailId;if(r){a(`Picking up the unfinished draft at the end of this thread.`),await n.openEdit(r);return}let i=e.dataset.threadRootId??t;await n.openReply(t,y(e),i,v(e)??void 0)}async function w(e){let t=await fetch(e,{headers:{Accept:`text/html`}});return t.ok?t.text():null}async function T(e){try{let t=document.querySelector(`[data-timeline-item][data-thread-root-id="${e}"]`)?.querySelector(`[data-timeline-item-content]`);if(!t)return!1;let n=await w(`/_/timeline-item/${encodeURIComponent(e)}`);return n?(t.innerHTML=n,u(t),!0):!1}catch{return!1}}async function E(e){try{let t=document.querySelector(`article[data-post-id="${e}"]`)?.closest(`[data-timeline-item]`),n=await w(`/_/post-card/${encodeURIComponent(e)}`);if(!n)return!1;if(t){let e=t.querySelector(`[data-timeline-item-content]`);return e?(e.innerHTML=n,u(e),!0):!1}let r=document.querySelector(`article[data-post-id="${e}"]`);if(!r)return!1;r.outerHTML=n;let i=document.querySelector(`article[data-post-id="${e}"]`);return i&&u(i),!0}catch{return!1}}async function D(e){try{let t=document.querySelector(`[data-post-view][data-post-view-id="${e}"]`);if(!t)return!1;let n=await w(`/_/post-view/${encodeURIComponent(e)}`);if(!n)return!1;t.outerHTML=n;let r=document.querySelector(`[data-post-view][data-post-view-id="${e}"]`);return r&&u(r),!0}catch{return!1}}async function O(e){let t=v(e);return t?t.kind===`timeline-item`?T(t.id):t.kind===`post-view`?D(t.id):E(t.id):!1}function k(e,t){return c([e.title,e.slug],t)}function A(e,t){if(e.length===0)return[];let n=new Set(t),r=[],i=[];for(let t of e)n.has(t.id)?r.push(t.id):i.push(t.id);return[...r,...i]}function j(e,t){if(e.length===0||t.length===0)return[...e];let n=new Map(e.map(e=>[e.id,e])),r=[],i=new Set;for(let e of t){let t=n.get(e);t&&!i.has(e)&&(r.push(t),i.add(e))}for(let t of e)i.has(t.id)||r.push(t);return r}function M(e,t){let n=l(t);return n?e.map((e,t)=>({item:e,index:t,rank:k(e,n)})).filter(e=>e.rank!==null).sort((e,t)=>e.rank-t.rank||e.index-t.index).map(e=>e.item):[...e]}var N=class extends s{};N.directiveName=`unsafeSVG`,N.resultType=2;var P=o(N);export{C as _,O as a,T as c,d,h as f,b as g,x as h,A as i,f as l,S as m,j as n,E as o,_ as p,M as r,D as s,P as t,m as u,p as v};