@jungherz-de/notionkit-elements 1.5.1 โ 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/components/nk-ai-input-row.js +1 -1
- package/dist/components/nk-ai-msg.js +1 -1
- package/dist/components/nk-ai-thread.js +1 -1
- package/dist/components/nk-app.js +1 -1
- package/dist/components/nk-avatar-group.js +1 -1
- package/dist/components/nk-banner.js +1 -1
- package/dist/components/nk-block-host.js +1 -1
- package/dist/components/nk-board-view.js +1 -1
- package/dist/components/nk-breadcrumb.js +1 -1
- package/dist/components/nk-btn.js +1 -1
- package/dist/components/nk-callout.js +1 -1
- package/dist/components/nk-check.js +1 -1
- package/dist/components/nk-cmdk.js +1 -1
- package/dist/components/nk-code.js +1 -1
- package/dist/components/nk-comment.js +1 -1
- package/dist/components/nk-comments.js +1 -1
- package/dist/components/nk-danger-zone.js +16 -7
- package/dist/components/nk-database.js +1 -1
- package/dist/components/nk-divider.js +1 -1
- package/dist/components/nk-emoji-picker.js +1 -1
- package/dist/components/nk-empty.js +16 -5
- package/dist/components/nk-field.js +1 -1
- package/dist/components/nk-fields.js +1 -1
- package/dist/components/nk-filter-bar.js +1 -1
- package/dist/components/nk-heading.js +1 -1
- package/dist/components/nk-input.js +1 -1
- package/dist/components/nk-kbd.js +1 -1
- package/dist/components/nk-member-list.js +1 -1
- package/dist/components/nk-member-row.js +1 -1
- package/dist/components/nk-mention.js +1 -1
- package/dist/components/nk-menu-item.js +1 -1
- package/dist/components/nk-menu.js +1 -1
- package/dist/components/nk-modal.js +1 -1
- package/dist/components/nk-model-card.js +10 -5
- package/dist/components/nk-page-actions.js +1 -1
- package/dist/components/nk-page-cover.js +1 -1
- package/dist/components/nk-page-title.js +1 -1
- package/dist/components/nk-page.js +1 -1
- package/dist/components/nk-pop.js +1 -1
- package/dist/components/nk-profile-row.js +1 -1
- package/dist/components/nk-progress.js +1 -1
- package/dist/components/nk-quote.js +1 -1
- package/dist/components/nk-radio.js +1 -1
- package/dist/components/nk-section-label.js +1 -1
- package/dist/components/nk-segmented.js +1 -1
- package/dist/components/nk-select.js +1 -1
- package/dist/components/nk-settings-pane.js +8 -3
- package/dist/components/nk-settings-user.js +1 -1
- package/dist/components/nk-sidebar.js +1 -1
- package/dist/components/nk-skeleton.js +1 -1
- package/dist/components/nk-slider.js +1 -1
- package/dist/components/nk-stat.js +1 -1
- package/dist/components/nk-stats.js +1 -1
- package/dist/components/nk-switch.js +1 -1
- package/dist/components/nk-synced.js +1 -1
- package/dist/components/nk-tab-bar-item.js +1 -1
- package/dist/components/nk-tab-bar.js +1 -1
- package/dist/components/nk-tab.js +1 -1
- package/dist/components/nk-table-view.js +1 -1
- package/dist/components/nk-tabs.js +1 -1
- package/dist/components/nk-tag.js +1 -1
- package/dist/components/nk-template-btn.js +1 -1
- package/dist/components/nk-textarea.js +1 -1
- package/dist/components/nk-theme-toggle.js +1 -1
- package/dist/components/nk-toast.js +19 -1
- package/dist/components/nk-todo.js +1 -1
- package/dist/components/nk-toggle.js +1 -1
- package/dist/components/nk-topbar.js +1 -1
- package/dist/components/nk-tree-item.js +1 -1
- package/dist/components/nk-tree.js +1 -1
- package/dist/components/nk-workspace-switcher.js +1 -1
- package/dist/components/shared/base-C3eJwHKA.js +366 -0
- package/dist/notionkit-elements.esm.js +86 -19
- package/dist/notionkit-elements.js +86 -19
- package/dist/notionkit-elements.min.js +1 -1
- package/package.json +3 -3
- package/src/base.js +19 -0
- package/src/components/overlays/nk-settings-pane.js +7 -2
- package/src/components/overlays/nk-toast.js +18 -0
- package/src/components/page/nk-danger-zone.js +15 -6
- package/src/components/page/nk-empty.js +15 -4
- package/src/components/page/nk-model-card.js +9 -4
- package/dist/components/shared/base-BPIvRI6K.js +0 -347
|
@@ -1 +1 @@
|
|
|
1
|
-
var NotionKitElements=function(t){"use strict";const e=':root{color-scheme:light;--nk-bg:#ffffff;--nk-bg-sidebar:#f9f8f7;--nk-bg-hover:rgba(55,53,47,0.06);--nk-bg-active:rgba(55,53,47,0.08);--nk-bg-callout:#f0efed;--nk-bg-code:#f7f6f3;--nk-bg-card:#ffffff;--nk-bg-input:rgba(242,241,238,0.6);--nk-text:#2c2c2b;--nk-text-secondary:#7d7a75;--nk-text-tertiary:#91918e;--nk-text-sidebar:#5f5e5b;--nk-border:rgba(28,19,1,0.11);--nk-border-strong:rgba(27,21,0,0.19);--nk-accent:#2383e2;--nk-on-accent:#ffffff;--nk-danger:#cd3c3a;--nk-tag-gray-bg:#e3e2e0;--nk-tag-gray-text:#32302c;--nk-tag-brown-bg:#eee0da;--nk-tag-brown-text:#442a1e;--nk-tag-orange-bg:#fadec9;--nk-tag-orange-text:#49290e;--nk-tag-yellow-bg:#fdecc8;--nk-tag-yellow-text:#402c1b;--nk-tag-green-bg:#dbeddb;--nk-tag-green-text:#1c3829;--nk-tag-blue-bg:#d3e5ef;--nk-tag-blue-text:#183347;--nk-tag-purple-bg:#e8deee;--nk-tag-purple-text:#412454;--nk-tag-pink-bg:#f5e0e9;--nk-tag-pink-text:#4c2337;--nk-tag-red-bg:#ffe2dd;--nk-tag-red-text:#5d1715;--nk-tint-gray:#f1f1ef;--nk-color-gray:#787774;--nk-tint-brown:#f4eeee;--nk-color-brown:#9f6b53;--nk-tint-orange:#fbecdd;--nk-color-orange:#d9730d;--nk-tint-yellow:#fbf3db;--nk-color-yellow:#cb912f;--nk-tint-green:#edf3ec;--nk-color-green:#448361;--nk-tint-blue:#e7f3f8;--nk-color-blue:#337ea9;--nk-tint-purple:#f8f3fc;--nk-color-purple:#9065b0;--nk-tint-pink:#fcf1f6;--nk-color-pink:#c14c8a;--nk-tint-red:#fdebec;--nk-color-red:#cd3c3a;--nk-decor-purple:#9065b0;--nk-decor-blue:#529cca;--nk-decor-orange:#d9730d;--nk-scrim:rgba(15,15,15,0.6);--nk-scrim-soft:rgba(15,15,15,0.5);--nk-sidebar-width:260px;--nk-tab-bar-height:58px;--nk-radius:6px;--nk-font:ui-sans-serif,-apple-system,"Segoe UI",Inter,Helvetica,Arial,sans-serif;--nk-font-mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;--nk-shadow-menu:rgba(15,15,15,0.05) 0px 0px 0px 1px,rgba(15,15,15,0.1) 0px 3px 6px,rgba(15,15,15,0.2) 0px 9px 24px;--nk-shadow-card:0 1px 2px rgba(0,0,0,0.04);--nk-shadow-btn:inset 0 0 0 1px rgba(15,15,15,0.1),0 1px 2px rgba(15,15,15,0.1);--nk-shadow-knob:0 1px 2px rgba(0,0,0,0.2);--nk-shadow-segment:0 1px 2px rgba(0,0,0,0.08)}[data-theme=dark]{color-scheme:dark;--nk-bg:#191919;--nk-bg-sidebar:#202020;--nk-bg-hover:rgba(255,255,255,0.055);--nk-bg-active:rgba(255,255,255,0.08);--nk-bg-callout:#252525;--nk-bg-code:#202020;--nk-bg-card:#202020;--nk-bg-input:rgba(255,255,255,0.055);--nk-text:rgba(255,255,255,0.81);--nk-text-secondary:rgba(255,255,255,0.46);--nk-text-tertiary:rgba(255,255,255,0.32);--nk-text-sidebar:rgba(255,255,255,0.62);--nk-border:rgba(255,255,255,0.094);--nk-border-strong:rgba(255,255,255,0.16);--nk-accent:#529CCA;--nk-danger:#df5452;--nk-tag-gray-bg:#373737;--nk-tag-gray-text:rgba(255,255,255,0.85);--nk-tag-brown-bg:#603b2c;--nk-tag-brown-text:rgba(255,255,255,0.85);--nk-tag-orange-bg:#854c1d;--nk-tag-orange-text:rgba(255,255,255,0.85);--nk-tag-yellow-bg:#89632a;--nk-tag-yellow-text:rgba(255,255,255,0.85);--nk-tag-green-bg:#2b593f;--nk-tag-green-text:rgba(255,255,255,0.85);--nk-tag-blue-bg:#28456c;--nk-tag-blue-text:rgba(255,255,255,0.85);--nk-tag-purple-bg:#492f64;--nk-tag-purple-text:rgba(255,255,255,0.85);--nk-tag-pink-bg:#69314c;--nk-tag-pink-text:rgba(255,255,255,0.85);--nk-tag-red-bg:#6e3630;--nk-tag-red-text:rgba(255,255,255,0.85);--nk-tint-gray:#252525;--nk-color-gray:#9b9b9b;--nk-tint-brown:#2e2724;--nk-color-brown:#ba856f;--nk-tint-orange:#36291f;--nk-color-orange:#c77d48;--nk-tint-yellow:#372e20;--nk-color-yellow:#ca8f3d;--nk-tint-green:#242b26;--nk-color-green:#529e72;--nk-tint-blue:#1f282d;--nk-color-blue:#5e87c9;--nk-tint-purple:#2a2430;--nk-color-purple:#9d68d3;--nk-tint-pink:#2e2328;--nk-color-pink:#d15796;--nk-tint-red:#332523;--nk-color-red:#df5452;--nk-shadow-menu:rgba(15,15,15,0.2) 0px 0px 0px 1px,rgba(15,15,15,0.4) 0px 3px 6px,rgba(15,15,15,0.6) 0px 9px 24px;--nk-shadow-card:none;--nk-shadow-btn:inset 0 0 0 1px rgba(255,255,255,0.1),0 1px 2px rgba(0,0,0,0.3)}',n="[class*=nk-],[class*=nk-] *,[class*=nk-] ::after,[class*=nk-] ::before,[class*=nk-]::after,[class*=nk-]::before{box-sizing:border-box}[class*=nk-] :where(h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd,pre,ul,ol,li){margin:0;padding:0}[class*=nk-] :where(ul,ol){list-style:none}:where(button,input,select,textarea)[class*=nk-],[class*=nk-] :where(button,input,select,textarea,option,optgroup,fieldset,legend){margin:0;padding:0}",i='.nk-body{margin:0;min-height:100vh;min-height:100dvh;font-family:var(--nk-font);font-size:14px;background:var(--nk-bg);color:var(--nk-text);-webkit-font-smoothing:auto;transition:background .25s,color .25s}.nk-app{display:flex;height:100vh;height:100dvh;overflow:hidden}.nk-sidebar{width:calc(var(--nk-sidebar-width) + env(safe-area-inset-left,0px));min-width:calc(var(--nk-sidebar-width) + env(safe-area-inset-left,0px));padding-left:env(safe-area-inset-left,0);background:var(--nk-bg-sidebar);display:flex;flex-direction:column;border-right:1px solid var(--nk-border);transition:background .25s}.nk-workspace{display:flex;align-items:center;gap:8px;padding:10px 12px;margin:6px 8px 2px;border-radius:var(--nk-radius);cursor:pointer;font-weight:500;user-select:none}.nk-workspace:hover{background:var(--nk-bg-hover)}.nk-workspace .avatar,.nk-workspace ::slotted(.avatar),.nk-workspace ::slotted([slot=avatar]){width:22px;height:22px;border-radius:4px;background:linear-gradient(135deg,var(--nk-decor-purple),var(--nk-decor-blue));color:var(--nk-on-accent);font-size:11px;font-weight:600;display:flex;align-items:center;justify-content:center}.nk-workspace .chev{margin-left:auto;color:var(--nk-text-tertiary);font-size:11px}.nk-sidebar-scroll{flex:1;overflow-y:auto;padding:4px 8px 16px}.nk-sidebar-scroll::-webkit-scrollbar{width:8px}.nk-sidebar-scroll::-webkit-scrollbar-thumb{background:var(--nk-border-strong);border-radius:4px}.nk-section-label{font-size:12px;font-weight:500;letter-spacing:.01em;color:var(--nk-text-tertiary);padding:14px 10px 4px;display:flex;justify-content:space-between;align-items:center}.nk-section-label .plus{cursor:pointer;border-radius:4px;padding:0 4px;font-size:13px;opacity:0;transition:opacity .15s}.nk-section-label:hover .plus{opacity:1}.nk-section-label .plus:hover{background:var(--nk-bg-hover)}.nk-sidebar-footer{padding:8px;border-top:1px solid var(--nk-border);color:var(--nk-text-sidebar);font-size:14px}.nk-sidebar-footer .nk-tree-item{min-height:26px}.nk-main{flex:1;display:flex;flex-direction:column;min-width:0}.nk-topbar{height:44px;display:flex;align-items:center;padding:0 max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px));gap:8px;flex-shrink:0}.nk-breadcrumb{display:flex;align-items:center;gap:4px;font-size:14px}.nk-breadcrumb .crumb,.nk-breadcrumb ::slotted(.crumb){padding:2px 6px;border-radius:4px;cursor:pointer;color:var(--nk-text-sidebar);display:flex;align-items:center;gap:5px}.nk-breadcrumb .crumb:hover{background:var(--nk-bg-hover)}a.crumb{text-decoration:none}.nk-breadcrumb .crumb.current,.nk-breadcrumb ::slotted(.crumb.current){color:var(--nk-text)}.nk-breadcrumb .sep{color:var(--nk-text-tertiary);font-size:12px}.nk-topbar-actions{margin-left:auto;display:flex;align-items:center;gap:4px}.nk-topbar-btn{padding:4px 8px;border-radius:var(--nk-radius);cursor:pointer;color:var(--nk-text-sidebar);font-size:14px;user-select:none;border:none;background:0 0;font-family:inherit}.nk-topbar-btn:hover{background:var(--nk-bg-hover)}.nk-topbar-btn ::slotted(svg),.nk-topbar-btn svg{width:16px;height:16px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.nk-share-btn{font-size:14px;padding:4px 8px}.nk-theme-toggle{font-size:15px;width:30px;height:28px;padding:0}.nk-tab-bar{display:none;flex:none;align-items:stretch;gap:2px;position:sticky;bottom:0;z-index:30;box-sizing:border-box;height:calc(var(--nk-tab-bar-height) - 6px + max(6px,env(safe-area-inset-bottom,0px)));padding:6px max(4px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) max(4px,env(safe-area-inset-left,0px));background:var(--nk-bg-sidebar);border-top:1px solid var(--nk-border)}.nk-tab-bar.always{display:flex}.nk-tab-bar.fixed{position:fixed;left:0;right:0;bottom:0}.nk-tab-bar-spacer{display:none;flex:none;height:calc(var(--nk-tab-bar-height) - 6px + max(6px,env(safe-area-inset-bottom,0px)))}.nk-tab-bar.always.fixed+.nk-tab-bar-spacer{display:block}.nk-tab-bar.floating{position:fixed;left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px));bottom:calc(12px + env(safe-area-inset-bottom,0px));height:var(--nk-tab-bar-height);padding:6px;border:1px solid var(--nk-border);border-radius:16px;box-shadow:var(--nk-shadow-menu)}.nk-tab-bar-item{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:4px 2px;border:none;border-radius:var(--nk-radius);background:0 0;font-family:inherit;font-size:10.5px;line-height:1.2;color:var(--nk-text-secondary);text-decoration:none;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}.nk-tab-bar-item:hover{color:var(--nk-text);background:var(--nk-bg-hover)}.nk-tab-bar-item.active{color:var(--nk-accent)}.nk-tab-bar-item:disabled{opacity:.5;cursor:not-allowed}.nk-tab-bar-item .icon,.nk-tab-bar-item ::slotted([slot=icon]){font-size:20px;line-height:1}.nk-tab-bar-item .label,.nk-tab-bar-item ::slotted(.label){max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nk-tree-item{display:flex;align-items:center;gap:6px;padding:3px 8px 3px 10px;border-radius:var(--nk-radius);cursor:pointer;user-select:none;color:var(--nk-text-sidebar);position:relative;min-height:28px}.nk-tree-item:hover{background:var(--nk-bg-hover)}.nk-tree-item.active{background:var(--nk-bg-active);color:var(--nk-text);font-weight:500}.nk-tree-item.compact{min-height:26px}.nk-tree-item .icon,.nk-tree-item ::slotted(.icon),.nk-tree-item ::slotted([slot=icon]){font-size:15px;width:20px;text-align:center;flex-shrink:0}.nk-tree-item .label,.nk-tree-item ::slotted(.label){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nk-tree-item .actions{margin-left:auto;display:none;gap:2px;color:var(--nk-text-tertiary)}.nk-tree-item:hover .actions{display:flex}.nk-tree-item .actions span{padding:0 3px;border-radius:3px;font-size:12px}.nk-tree-item .actions span:hover{background:var(--nk-bg-active)}.nk-tree-children{margin-left:14px;border-left:1px solid var(--nk-border);padding-left:4px;overflow:hidden}.nk-tree-children.collapsed{display:none}.nk-toggle-arrow{width:16px;height:16px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-size:9px;color:var(--nk-text-tertiary);border-radius:3px;transition:transform .15s}.nk-toggle-arrow.open{transform:rotate(90deg)}.nk-kbd-hint{margin-left:auto;display:flex;gap:3px;align-items:center}.nk-kbd{font-family:inherit;font-size:10.5px;background:var(--nk-bg-callout);border:1px solid var(--nk-border-strong);border-bottom-width:2px;border-radius:4px;padding:0 4px}.nk-page-scroll{flex:1;overflow-y:auto}.nk-page-scroll::-webkit-scrollbar{width:10px}.nk-page-scroll::-webkit-scrollbar-thumb{background:var(--nk-border-strong);border-radius:5px;border:2px solid var(--nk-bg)}.nk-cover{height:200px;background:radial-gradient(ellipse at 20% 40%,color-mix(in srgb,var(--nk-decor-purple) 35%,transparent),transparent 55%),radial-gradient(ellipse at 80% 20%,color-mix(in srgb,var(--nk-decor-blue) 35%,transparent),transparent 55%),radial-gradient(ellipse at 60% 90%,color-mix(in srgb,var(--nk-decor-orange) 25%,transparent),transparent 55%),var(--nk-bg-callout)}.nk-page{max-width:760px;margin:0 auto;padding:24px max(64px,env(safe-area-inset-right,0px)) 120px max(64px,env(safe-area-inset-left,0px));font-size:16px;line-height:1.5}.nk-cover+.nk-page,.nk-page.covered{padding-top:0}.nk-page ::slotted(.nk-page-icon),.nk-page ::slotted([slot=icon]),.nk-page-icon{font-size:64px;line-height:1;margin-top:0;cursor:pointer;user-select:none;display:inline-block}.nk-cover+.nk-page .nk-page-icon,.nk-cover+.nk-page ::slotted(.nk-page-icon),.nk-cover+.nk-page ::slotted([slot=icon]),.nk-page.covered .nk-page-icon,.nk-page.covered ::slotted(.nk-page-icon),.nk-page.covered ::slotted([slot=icon]){margin-top:-42px}.nk-page-title{font-size:40px;font-weight:700;line-height:1.2;margin:8px 0 4px;outline:0;letter-spacing:0}.nk-page-meta{color:var(--nk-text-tertiary);font-size:13px;margin-bottom:24px;display:flex;gap:16px}.nk-page p.lead{font-size:16px;line-height:1.6;color:var(--nk-text-secondary);margin-bottom:20px}.nk-page ::slotted(p.lead){font-size:16px;line-height:1.6;color:var(--nk-text-secondary);margin-bottom:20px!important}.nk-heading{font-size:24px;font-weight:600;line-height:1.3;margin:32px 0 10px;display:flex;align-items:center;gap:8px}.nk-callout{display:flex;gap:10px;align-items:flex-start;background:var(--nk-bg-callout);border-radius:var(--nk-radius);padding:16px 16px 16px 12px;margin:16px 0;line-height:1.5}.nk-callout .c-icon,.nk-callout ::slotted(.c-icon),.nk-callout ::slotted([slot=icon]){font-size:17px}.nk-todo{display:flex;align-items:flex-start;gap:8px;padding:4px 0}.nk-todo input[type=checkbox]{appearance:none;width:16px;height:16px;margin-top:3px;border:1.4px solid var(--nk-border-strong);border-radius:2px;cursor:pointer;flex-shrink:0;position:relative;background:var(--nk-bg)}.nk-todo input[type=checkbox]:checked{background:var(--nk-accent);border-color:var(--nk-accent)}.nk-todo input[type=checkbox]:checked::after{content:"โ";color:var(--nk-on-accent);font-size:11px;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.nk-todo input:checked+span{text-decoration:line-through;color:var(--nk-text-tertiary)}.nk-todo input:disabled{opacity:.5;cursor:not-allowed}.nk-toggle{margin:6px 0}.nk-toggle summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:6px;padding:4px 6px;border-radius:var(--nk-radius);font-weight:500;user-select:none}.nk-toggle summary::-webkit-details-marker{display:none}.nk-toggle summary:hover{background:var(--nk-bg-hover)}.nk-toggle summary::before{content:"โธ";color:var(--nk-text-tertiary);font-size:11px;transition:transform .15s;display:inline-block}.nk-toggle[open] summary::before{transform:rotate(90deg)}.nk-toggle .toggle-body,.nk-toggle ::slotted(.toggle-body){padding:4px 0 8px 26px;color:var(--nk-text-secondary);line-height:1.55}.nk-divider{border:none;border-top:1px solid var(--nk-border);margin:24px 0}.nk-quote{border-left:3px solid var(--nk-text);padding:2px 0 2px 14px;margin:16px 0;color:var(--nk-text-secondary);line-height:1.5}.nk-quote .q-cite{display:block;margin-top:6px;font-size:12.5px;color:var(--nk-text-tertiary)}.nk-mention{display:inline-flex;align-items:center;gap:4px;padding:0 4px;border-radius:4px;font-weight:500;cursor:pointer;white-space:nowrap}.nk-mention:hover{background:var(--nk-bg-hover)}.nk-mention.person{color:var(--nk-text)}.nk-mention.person .mini-avatar,.nk-mention.person ::slotted(.mini-avatar),.nk-mention.person ::slotted([slot=avatar]){width:16px;height:16px;border-radius:50%;color:var(--nk-on-accent);font-size:8.5px;font-weight:600;display:inline-flex;align-items:center;justify-content:center}.nk-mention.page{color:var(--nk-text-secondary);text-decoration:underline;text-decoration-color:var(--nk-border-strong);text-underline-offset:2px}.nk-mention.date{color:var(--nk-color-orange)}.nk-inline-code{font-family:var(--nk-font-mono);font-size:85%;color:var(--nk-danger);background:color-mix(in srgb,var(--nk-danger) 8%,transparent);border-radius:4px;padding:1px 5px}.nk-code{background:var(--nk-bg-code);border:1px solid var(--nk-border);border-radius:var(--nk-radius);padding:20px 24px;font-family:var(--nk-font-mono);font-size:13px;line-height:1.6;margin:14px 0;overflow-x:auto;color:var(--nk-text-secondary);white-space:pre;position:relative}.nk-code .lang{position:absolute;top:6px;right:10px;font-size:11px;color:var(--nk-text-tertiary);font-family:var(--nk-font)}.nk-code .tag,.nk-code ::slotted(.tag){color:var(--nk-accent)}.nk-code .attr,.nk-code ::slotted(.attr){color:var(--nk-color-orange)}.nk-database{margin:12px 0 8px}.nk-db-tabs{display:flex;gap:2px;align-items:center;padding:0 0 6px;margin-bottom:0;font-size:14px}.nk-db-tab{padding:4px 8px;cursor:pointer;color:var(--nk-text-secondary);border-radius:var(--nk-radius);user-select:none;line-height:20px;display:flex;align-items:center;gap:6px}.nk-db-tab:hover{color:var(--nk-text);background:var(--nk-bg-hover)}.nk-db-tab.active{color:var(--nk-text);background:var(--nk-bg-active);font-weight:500}.nk-db-tab .badge,.nk-db-tab ::slotted(.badge){background:var(--nk-bg-callout);border-radius:8px;font-size:11px;padding:0 6px;color:var(--nk-text-tertiary)}.nk-table-wrap{overflow-x:auto}.nk-table{width:100%;border-collapse:collapse;font-size:14px}.nk-table th{text-align:left;font-weight:400;color:var(--nk-text-secondary);height:36px;padding:0 8px;border-bottom:1px solid var(--nk-border);border-right:1px solid var(--nk-border);font-size:14px;white-space:nowrap;user-select:none;cursor:pointer}.nk-table th:hover{background:var(--nk-bg-hover)}.nk-table th .th-icon,.nk-table th ::slotted(.th-icon){margin-right:6px;font-size:13px;color:var(--nk-text-tertiary)}.nk-table td{height:36px;padding:6px 8px;line-height:1.5;border-bottom:1px solid var(--nk-border);border-right:1px solid var(--nk-border);white-space:nowrap;vertical-align:middle}.nk-table td:last-child,.nk-table th:last-child{border-right:none}.nk-table td.wrap,.nk-table.wrap td{white-space:normal;vertical-align:top}.nk-table tbody tr:hover{background:var(--nk-bg-hover)}.nk-table .row-title{display:flex;align-items:center;gap:7px;font-weight:500;cursor:pointer}.nk-table .row-title:hover{text-decoration:underline;text-decoration-color:var(--nk-text-tertiary)}.nk-table .date-cell{color:var(--nk-text-secondary)}.nk-table .person-cell{display:flex;align-items:center;gap:6px;color:var(--nk-text-secondary)}.nk-table .person-cell .mini-avatar,.nk-table .person-cell ::slotted(.mini-avatar){width:20px;height:20px;border-radius:50%;font-size:10px;color:var(--nk-on-accent);display:inline-flex;align-items:center;justify-content:center;font-weight:600}.nk-new-row,.nk-table .new-row{color:var(--nk-text-tertiary);cursor:pointer;padding:8px;display:flex;align-items:center;gap:7px;font-size:14px}.nk-new-row:hover,.nk-table .new-row:hover{background:var(--nk-bg-hover)}.nk-tag{display:inline-flex;align-items:center;max-width:100%;height:20px;padding:0 6px;border-radius:3px;font-size:14px;font-weight:400;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;background:var(--nk-tag-gray-bg);color:var(--nk-tag-gray-text)}.nk-tag.gray{background:var(--nk-tag-gray-bg);color:var(--nk-tag-gray-text)}.nk-tag.brown{background:var(--nk-tag-brown-bg);color:var(--nk-tag-brown-text)}.nk-tag.orange{background:var(--nk-tag-orange-bg);color:var(--nk-tag-orange-text)}.nk-tag.yellow{background:var(--nk-tag-yellow-bg);color:var(--nk-tag-yellow-text)}.nk-tag.green{background:var(--nk-tag-green-bg);color:var(--nk-tag-green-text)}.nk-tag.blue{background:var(--nk-tag-blue-bg);color:var(--nk-tag-blue-text)}.nk-tag.purple{background:var(--nk-tag-purple-bg);color:var(--nk-tag-purple-text)}.nk-tag.pink{background:var(--nk-tag-pink-bg);color:var(--nk-tag-pink-text)}.nk-tag.red{background:var(--nk-tag-red-bg);color:var(--nk-tag-red-text)}.nk-progress{width:110px;height:6px;border-radius:3px;background:var(--nk-tint-blue);overflow:hidden;display:inline-block}.nk-progress>i{display:block;height:100%;background:var(--nk-color-blue);border-radius:3px}.nk-progress-label{font-size:12px;color:var(--nk-text-tertiary);margin-left:7px}.nk-board{display:none;gap:12px;padding:14px 2px;overflow-x:auto}.nk-board.active{display:flex}.nk-board-col{min-width:220px;width:220px;flex-shrink:0}.nk-board-col-header{display:flex;align-items:center;gap:7px;margin-bottom:8px;font-size:13.5px;font-weight:500}.nk-board-col-header .count{color:var(--nk-text-tertiary);font-weight:400}.nk-card{background:var(--nk-bg-card);border:1px solid var(--nk-border);border-radius:8px;padding:10px 12px;margin-bottom:8px;cursor:grab;box-shadow:var(--nk-shadow-card);transition:border-color .15s}.nk-card:hover{border-color:var(--nk-border-strong)}.nk-card .card-title,.nk-card ::slotted(.card-title){font-weight:500;margin-bottom:7px;display:flex;gap:6px;align-items:center}.nk-card .card-meta,.nk-card ::slotted(.card-meta){display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:12px;color:var(--nk-text-secondary)}.nk-field{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:9px 0}.nk-field .f-label,.nk-field ::slotted(.f-label),.nk-field ::slotted([slot=label]){font-size:14px}.nk-field .f-desc,.nk-field ::slotted(.f-desc),.nk-field ::slotted([slot=desc]){font-size:12px;color:var(--nk-text-secondary);margin-top:2px;line-height:1.45}.nk-field .f-control,.nk-field ::slotted(.f-control){flex-shrink:0}.nk-field.stacked,.nk-fields>.nk-field{flex-direction:column;align-items:stretch;gap:6px;min-width:0}.nk-field.stacked .f-control,.nk-field.stacked .nk-input,.nk-field.stacked .nk-select,.nk-field.stacked .nk-textarea,.nk-fields>.nk-field .f-control,.nk-fields>.nk-field .nk-input,.nk-fields>.nk-field .nk-select,.nk-fields>.nk-field .nk-textarea{width:100%;min-width:0}.nk-field.compact,.nk-fields>.nk-field{padding:0;gap:4px;min-width:0}.nk-field.compact .f-label,.nk-field.compact ::slotted([slot=label]),.nk-fields>.nk-field .f-label,.nk-fields>.nk-field ::slotted([slot=label]){font-size:12px;color:var(--nk-text-tertiary)}.nk-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px 12px;padding:9px 0}.nk-fields>.nk-field{min-width:0}.nk-input,.nk-select,.nk-textarea{font-family:inherit;font-size:14px;line-height:20px;color:var(--nk-text);background:var(--nk-bg-input);border:1px solid var(--nk-border);border-radius:var(--nk-radius);padding:5px 10px;outline:0;transition:border-color .15s,box-shadow .15s;min-width:210px}.nk-input:hover,.nk-select:hover,.nk-textarea:hover{border-color:var(--nk-border-strong)}.nk-input:focus,.nk-select:focus,.nk-textarea:focus{border-color:color-mix(in srgb,var(--nk-accent) 60%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--nk-accent) 30%,transparent)}.nk-input::placeholder,.nk-textarea::placeholder{color:var(--nk-text-tertiary)}.nk-input.wide,.nk-select.wide,.nk-textarea.wide{width:100%;min-width:0}.nk-select.compact{min-width:120px}.nk-textarea{resize:vertical;min-height:70px;line-height:1.5}.nk-select{appearance:none;cursor:pointer;padding-right:26px;background-image:linear-gradient(45deg,transparent 50%,var(--nk-text-tertiary) 50%),linear-gradient(135deg,var(--nk-text-tertiary) 50%,transparent 50%);background-position:calc(100% - 14px) 55%,calc(100% - 10px) 55%;background-size:4px 4px;background-repeat:no-repeat}.nk-btn{font-family:inherit;font-size:14px;line-height:20px;font-weight:500;border-radius:var(--nk-radius);cursor:pointer;padding:3px 12px;border:1px solid transparent;transition:background .15s,border-color .15s,box-shadow .15s,opacity .15s;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.nk-btn ::slotted(svg),.nk-btn svg{width:15px;height:15px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.nk-btn.primary{background:var(--nk-accent);color:var(--nk-on-accent)}.nk-btn.primary:hover{opacity:.88}.nk-btn.secondary{background:var(--nk-bg-card);color:var(--nk-text);box-shadow:var(--nk-shadow-btn)}.nk-btn.secondary:hover{background:color-mix(in srgb,var(--nk-bg-card),var(--nk-text) 6%)}.nk-btn.danger{background:var(--nk-bg-card);color:var(--nk-danger);box-shadow:var(--nk-shadow-btn)}.nk-btn.danger:hover{background:color-mix(in srgb,var(--nk-danger) 8%,var(--nk-bg-card))}.nk-btn.danger-solid{background:var(--nk-danger);color:var(--nk-on-accent)}.nk-btn.danger-solid:hover{opacity:.88}.nk-btn.small{padding:1px 8px;font-size:13px;line-height:20px}a.nk-btn{text-decoration:none}.nk-btn:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.nk-switch{position:relative;width:34px;height:20px;flex-shrink:0;appearance:none;border:none;cursor:pointer;border-radius:20px;background:var(--nk-border-strong);transition:background .2s}.nk-switch::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--nk-on-accent);transition:transform .2s;box-shadow:var(--nk-shadow-knob)}.nk-switch:checked,.nk-switch[aria-checked=true]{background:var(--nk-accent)}.nk-switch:checked::after,.nk-switch[aria-checked=true]::after{transform:translateX(14px)}.nk-switch:disabled{opacity:.5;cursor:not-allowed}.nk-switch-label{display:inline-flex;align-items:center;gap:8px;font-size:14px;cursor:pointer}.nk-switch-label:has(.nk-switch:disabled){cursor:not-allowed;color:var(--nk-text-tertiary)}.nk-check{display:flex;align-items:center;gap:8px;padding:4px 0;font-size:14px;cursor:pointer}.nk-check input{appearance:none;width:16px;height:16px;flex-shrink:0;border:1.4px solid var(--nk-border-strong);border-radius:3px;cursor:pointer;position:relative;background:var(--nk-bg)}.nk-check input[type=radio]{border-radius:50%}.nk-check input:checked{background:var(--nk-accent);border-color:var(--nk-accent)}.nk-check input:checked::after{content:"โ";color:var(--nk-on-accent);font-size:10.5px;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.nk-check input[type=radio]:checked::after{content:"โ";font-size:7px}.nk-check input:disabled{opacity:.5;cursor:not-allowed}.nk-check input:disabled+*{opacity:.6}.nk-slider{width:210px;accent-color:var(--nk-accent);cursor:pointer}.nk-slider-value{font-size:12.5px;color:var(--nk-text-tertiary);margin-top:3px}.nk-profile-row{display:flex;align-items:center;gap:14px;padding:8px 0}.nk-profile-row .big-avatar,.nk-profile-row ::slotted(.big-avatar),.nk-profile-row ::slotted([slot=avatar]){width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,var(--nk-decor-purple),var(--nk-decor-blue));color:var(--nk-on-accent);font-size:20px;font-weight:600;display:flex;align-items:center;justify-content:center}.nk-model-card{border:1px solid var(--nk-border-strong);border-radius:8px;padding:12px 14px;margin-bottom:10px;cursor:pointer;display:flex;align-items:flex-start;gap:11px;transition:border-color .15s,background .15s}.nk-model-card:hover{background:var(--nk-bg-hover)}.nk-model-card.selected{border-color:var(--nk-accent);background:color-mix(in srgb,var(--nk-accent) 6%,transparent)}.nk-model-card .m-radio{width:15px;height:15px;border-radius:50%;flex-shrink:0;margin-top:2px;border:1.4px solid var(--nk-border-strong);position:relative}.nk-model-card.selected .m-radio{border-color:var(--nk-accent)}.nk-model-card.selected .m-radio::after{content:"";position:absolute;inset:3px;border-radius:50%;background:var(--nk-accent)}.nk-model-card .m-name,.nk-model-card ::slotted(.m-name),.nk-model-card ::slotted([slot=title]){font-weight:500;font-size:14px;display:flex;align-items:center;gap:7px}.nk-model-card .m-desc,.nk-model-card ::slotted(.m-desc),.nk-model-card ::slotted([slot=desc]){font-size:12px;color:var(--nk-text-secondary);margin-top:2px;line-height:1.45}.nk-danger-zone{border:1px solid color-mix(in srgb,var(--nk-danger) 40%,transparent);border-radius:8px;padding:14px 16px;margin-top:26px}.nk-danger-zone .dz-title{color:var(--nk-danger);font-weight:600;font-size:13px;margin-bottom:8px}.nk-member-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--nk-border)}.nk-member-list ::slotted(.nk-member-row:last-child),.nk-member-list>.nk-member-row:last-child,.nk-member-row.last{border-bottom:none}.nk-member-row .mini-avatar,.nk-member-row ::slotted(.mini-avatar),.nk-member-row ::slotted([slot=avatar]){width:28px;height:28px;border-radius:50%;color:var(--nk-on-accent);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;flex-shrink:0}.nk-member-row .m-mail{font-size:12px;color:var(--nk-text-secondary)}.nk-member-row .nk-select{min-width:120px;margin-left:auto}.nk-member-row ::slotted([slot=role]){margin-left:auto}.nk-modal-backdrop{position:fixed;inset:0;background:var(--nk-scrim);padding:env(safe-area-inset-top,0) env(safe-area-inset-right,0) env(safe-area-inset-bottom,0) env(safe-area-inset-left,0);display:flex;align-items:center;justify-content:center;z-index:100;opacity:0;pointer-events:none;transition:opacity .2s}.nk-modal-backdrop.open{opacity:1;pointer-events:auto}.nk-modal{width:min(1150px,92vw);height:min(715px,86vh);max-width:100%;max-height:100%;background:var(--nk-bg);border-radius:10px;box-shadow:var(--nk-shadow-menu);display:flex;overflow:hidden;transform:scale(.98) translateY(6px);transition:transform .2s}.nk-modal-backdrop.open .nk-modal{transform:scale(1) translateY(0)}.nk-settings-nav{width:240px;min-width:240px;background:var(--nk-bg-sidebar);border-right:1px solid var(--nk-border);padding:10px 8px;overflow-y:auto;flex-shrink:0}.nk-settings-user{display:flex;align-items:center;gap:9px;padding:6px 10px 12px;margin-bottom:4px}.nk-settings-user .avatar,.nk-settings-user ::slotted(.avatar),.nk-settings-user ::slotted([slot=avatar]){width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--nk-decor-purple),var(--nk-decor-blue));color:var(--nk-on-accent);font-weight:600;font-size:13px;display:flex;align-items:center;justify-content:center}.nk-settings-user .name{font-weight:500;font-size:14px}.nk-settings-user .mail{font-size:12px;color:var(--nk-text-secondary)}.nk-settings-nav .nk-tree-item{min-height:28px}.nk-settings-nav .nk-tree-item.active{background:var(--nk-bg-active);color:var(--nk-text);font-weight:500}.nk-settings-content{flex:1;overflow-y:auto;padding:36px 60px 80px;min-width:0}.nk-settings-content::-webkit-scrollbar{width:10px}.nk-settings-content::-webkit-scrollbar-thumb{background:var(--nk-border-strong);border-radius:5px;border:2px solid var(--nk-bg)}.nk-settings-pane{display:none;max-width:800px}.nk-settings-pane.active{display:block}.nk-settings-pane>h2{font-size:22px;font-weight:600;line-height:1.3;margin-bottom:20px}.nk-settings-pane>h3{font-size:16px;font-weight:500;padding-bottom:8px;border-bottom:1px solid var(--nk-border);margin:30px 0 12px}.nk-settings-pane ::slotted(h2){font-size:22px;font-weight:600;line-height:1.3;padding:0!important;margin:0 0 20px!important}.nk-settings-pane ::slotted(h3){font-size:16px;font-weight:500;border:0;border-bottom:1px solid var(--nk-border);padding:0 0 8px!important;margin:30px 0 12px!important}.nk-pop{background:var(--nk-bg);border-radius:10px;box-shadow:var(--nk-shadow-menu);padding:10px;width:296px}.nk-emoji-search{width:100%;font-family:inherit;font-size:14px;color:var(--nk-text);background:var(--nk-bg-input);border:1px solid var(--nk-border);border-radius:var(--nk-radius);padding:6px 10px;outline:0;margin-bottom:8px}.nk-emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:2px}.nk-emoji-grid ::slotted(span),.nk-emoji-grid span{font-size:18px;text-align:center;padding:4px 0;border-radius:5px;cursor:pointer;user-select:none}.nk-emoji-grid span:hover{background:var(--nk-bg-hover)}.nk-emoji-cats{display:flex;gap:2px;margin-top:8px;padding-top:8px;border-top:1px solid var(--nk-border)}.nk-emoji-cats span{font-size:14px;padding:3px 7px;border-radius:5px;cursor:pointer;color:var(--nk-text-tertiary);filter:grayscale(1);opacity:.6}.nk-emoji-cats span.active,.nk-emoji-cats span:hover{filter:none;opacity:1;background:var(--nk-bg-hover)}.nk-menu{padding:5px;width:230px}.nk-menu-item{display:flex;align-items:center;gap:9px;padding:4px 8px;min-height:28px;border-radius:5px;cursor:pointer;font-size:14px;user-select:none}.nk-menu-item:hover{background:var(--nk-bg-hover)}.nk-menu-item .m-icon,.nk-menu-item ::slotted(.m-icon),.nk-menu-item ::slotted([slot=icon]){width:17px;text-align:center;font-size:14px}.nk-menu-item .m-shortcut,.nk-menu-item ::slotted(.m-shortcut){margin-left:auto;font-size:12px;color:var(--nk-text-tertiary)}.nk-menu-item.danger{color:var(--nk-danger)}.nk-menu-sep{border-top:1px solid var(--nk-border);margin:5px 4px}.nk-menu-label{font-size:12px;color:var(--nk-text-tertiary);padding:5px 8px 2px}.nk-cmdk-backdrop{position:fixed;inset:0;background:var(--nk-scrim-soft);display:flex;justify-content:center;align-items:flex-start;padding:max(14vh,env(safe-area-inset-top,0px)) env(safe-area-inset-right,0) env(safe-area-inset-bottom,0) env(safe-area-inset-left,0);z-index:110;opacity:0;pointer-events:none;transition:opacity .18s}.nk-cmdk-backdrop.open{opacity:1;pointer-events:auto}.nk-cmdk{max-width:100%;width:min(560px,92vw);background:var(--nk-bg);border-radius:12px;box-shadow:var(--nk-shadow-menu);overflow:hidden;transform:scale(.98);transition:transform .18s}.nk-cmdk-backdrop.open .nk-cmdk{transform:scale(1)}.nk-cmdk-input-row{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--nk-border)}.nk-cmdk-input-row input{flex:1;border:none;outline:0;background:0 0;font-family:inherit;font-size:16px;color:var(--nk-text)}.nk-cmdk-input-row input::placeholder{color:var(--nk-text-tertiary)}.nk-cmdk-list{max-height:320px;overflow-y:auto;padding:6px}.nk-cmdk-group{font-size:12px;color:var(--nk-text-tertiary);padding:8px 10px 3px}.nk-cmdk-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:6px;cursor:pointer;font-size:14px;user-select:none}.nk-cmdk-item.selected{background:var(--nk-bg-active)}.nk-cmdk-item .m-icon,.nk-cmdk-item ::slotted(.m-icon),.nk-cmdk-item ::slotted([slot=icon]){width:17px;text-align:center;font-size:14px}.nk-cmdk-item .m-shortcut,.nk-cmdk-item ::slotted(.m-shortcut){margin-left:auto;font-size:12px;color:var(--nk-text-tertiary)}.nk-cmdk-empty{padding:30px;text-align:center;color:var(--nk-text-tertiary);font-size:13.5px}.nk-cmdk-footer{display:flex;gap:14px;padding:8px 16px;border-top:1px solid var(--nk-border);font-size:11.5px;color:var(--nk-text-tertiary)}.nk-toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%) translateY(80px);background:var(--nk-text);color:var(--nk-bg);padding:8px 16px;border-radius:8px;font-size:14px;opacity:0;transition:.3s;pointer-events:none;box-shadow:var(--nk-shadow-menu);display:flex;gap:8px;align-items:center}.nk-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}.nk-gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));gap:20px 32px;margin:12px 0}.nk-g-item>h4{font-size:12px;font-weight:500;color:var(--nk-text-tertiary);text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px}.nk-g-item ::slotted(h4){font-size:12px;font-weight:500;color:var(--nk-text-tertiary);text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px!important}.nk-tabs{display:flex;gap:2px;border-bottom:1px solid var(--nk-border);font-size:14px}.nk-tab{padding:7px 11px;cursor:pointer;color:var(--nk-text-secondary);border-bottom:2px solid transparent;margin-bottom:-1px;user-select:none}.nk-tab:hover{color:var(--nk-text)}.nk-tab.active{color:var(--nk-text);border-bottom-color:var(--nk-text);font-weight:500}.nk-tab-panel{padding:12px 2px;color:var(--nk-text-secondary);line-height:1.55;font-size:14px}.nk-template-btn{display:flex;align-items:center;gap:8px;width:100%;font-family:inherit;font-size:14px;color:var(--nk-text-secondary);background:var(--nk-bg-callout);border:none;border-radius:var(--nk-radius);padding:8px 12px;cursor:pointer;margin-bottom:6px;text-align:left}.nk-template-btn:hover{background:var(--nk-bg-hover)}.nk-stats{display:flex;gap:10px}.nk-stat{flex:1;border:1px solid var(--nk-border);border-radius:8px;padding:12px 14px}.nk-stat .s-label,.nk-stat ::slotted(.s-label),.nk-stat ::slotted([slot=label]){font-size:12px;color:var(--nk-text-secondary);margin-bottom:4px}.nk-stat .s-value,.nk-stat ::slotted(.s-value),.nk-stat ::slotted([slot=value]){font-size:22px;font-weight:600;letter-spacing:-.01em}.nk-stat .s-delta,.nk-stat ::slotted(.s-delta),.nk-stat ::slotted([slot=delta]){font-size:12px;margin-top:3px}.nk-stat .s-delta.up,.nk-stat ::slotted(.s-delta.up),.nk-stat ::slotted([slot=delta].up){color:var(--nk-color-green)}.nk-stat .s-delta.down,.nk-stat ::slotted(.s-delta.down),.nk-stat ::slotted([slot=delta].down){color:var(--nk-danger)}.nk-synced{border:1.5px solid color-mix(in srgb,var(--nk-danger) 55%,transparent);border-radius:8px;padding:12px 14px;position:relative;margin:8px 0}.nk-synced .synced-badge{position:absolute;top:-9px;right:10px;font-size:11px;background:var(--nk-danger);color:var(--nk-on-accent);border-radius:8px;padding:1px 8px}.nk-segmented{display:inline-flex;background:var(--nk-bg-callout);border-radius:7px;padding:2px}.nk-segmented button{font-family:inherit;font-size:14px;border:none;background:0 0;color:var(--nk-text-secondary);padding:4px 12px;border-radius:5px;cursor:pointer}.nk-segmented ::slotted(button){font-family:inherit;font-size:14px;border:none;background:0 0;color:var(--nk-text-secondary);padding:4px 12px!important;border-radius:5px;cursor:pointer}.nk-segmented ::slotted(button.active),.nk-segmented button.active{background:var(--nk-bg);color:var(--nk-text);font-weight:500;box-shadow:var(--nk-shadow-segment)}.nk-segmented.wrap{flex-wrap:wrap}.nk-segmented.scroll{max-width:100%;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}.nk-segmented.scroll::-webkit-scrollbar{display:none}.nk-segmented.scroll ::slotted(button),.nk-segmented.scroll button{flex-shrink:0;white-space:nowrap}.nk-banner{display:flex;align-items:center;gap:10px;font-size:14px;border-radius:8px;padding:10px 14px;margin-bottom:8px;color:var(--nk-text)}.nk-banner.info{background:var(--nk-tint-blue)}.nk-banner.success{background:var(--nk-tint-green)}.nk-banner.warning{background:var(--nk-tint-yellow)}.nk-banner.danger{background:var(--nk-tint-red)}.nk-banner .b-action,.nk-banner ::slotted(.b-action),.nk-banner ::slotted([slot=action]){margin-left:auto;font-weight:500;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.nk-avatar-group{display:flex}.nk-avatar-group .mini-avatar,.nk-avatar-group ::slotted(.mini-avatar){width:26px;height:26px;border-radius:50%;color:var(--nk-on-accent);font-size:10.5px;font-weight:600;border:2px solid var(--nk-bg);display:flex;align-items:center;justify-content:center;margin-left:-7px}.nk-avatar-group .mini-avatar:first-child,.nk-avatar-group ::slotted(.mini-avatar:first-child){margin-left:0}.nk-avatar-group .more,.nk-avatar-group ::slotted(.more){background:var(--nk-bg-callout);color:var(--nk-text-secondary)}.nk-skeleton{border-radius:5px;margin-bottom:10px;background:linear-gradient(90deg,var(--nk-bg-callout) 25%,var(--nk-bg-hover) 50%,var(--nk-bg-callout) 75%);background-size:200% 100%;animation:1.6s infinite nk-shimmer}@keyframes nk-shimmer{to{background-position:-200% 0}}.nk-empty{text-align:center;padding:36px 20px;border:1.5px dashed var(--nk-border-strong);border-radius:10px;color:var(--nk-text-tertiary)}.nk-empty .e-icon,.nk-empty ::slotted(.e-icon),.nk-empty ::slotted([slot=icon]){font-size:30px;margin-bottom:8px}.nk-empty .e-title,.nk-empty ::slotted(.e-title),.nk-empty ::slotted([slot=title]){font-weight:500;color:var(--nk-text-secondary);margin-bottom:3px;font-size:14px}.nk-empty .e-desc,.nk-empty ::slotted(.e-desc),.nk-empty ::slotted([slot=desc]){font-size:13px;margin-bottom:12px}.nk-comments{border-left:1px solid var(--nk-border);padding:4px 0 4px 18px;margin:8px 0 8px 8px}.nk-comment{display:flex;gap:9px;margin-bottom:14px}.nk-comment .mini-avatar,.nk-comment ::slotted(.mini-avatar),.nk-comment ::slotted([slot=avatar]){width:24px;height:24px;border-radius:50%;color:var(--nk-on-accent);flex-shrink:0;font-size:10px;font-weight:600;display:flex;align-items:center;justify-content:center}.nk-comment .c-head,.nk-comment ::slotted(.c-head){font-size:12px;color:var(--nk-text-tertiary);margin-bottom:2px}.nk-comment .c-head b{color:var(--nk-text);font-weight:600}.nk-comment .c-body,.nk-comment ::slotted(.c-body){font-size:14px;line-height:1.5}.nk-comment-input{display:flex;gap:8px;align-items:center;margin-top:4px}.nk-comment-input input{min-width:0;flex:1}.nk-ai-thread{display:flex;flex-direction:column;gap:14px}.nk-ai-msg{display:flex;gap:9px}.nk-ai-msg .mini-avatar,.nk-ai-msg ::slotted(.mini-avatar),.nk-ai-msg ::slotted([slot=avatar]){width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;background:var(--nk-bg-callout)}.nk-ai-msg.user .mini-avatar,.nk-ai-msg.user ::slotted(.mini-avatar),.nk-ai-msg.user ::slotted([slot=avatar]){background:linear-gradient(135deg,var(--nk-decor-purple),var(--nk-decor-blue));color:var(--nk-on-accent);font-size:9.5px;font-weight:600}.nk-ai-msg .a-body,.nk-ai-msg ::slotted(.a-body){font-size:14px;line-height:1.55;padding-top:2px}.nk-ai-msg .a-name,.nk-ai-msg ::slotted(.a-name){font-size:12px;font-weight:600;margin-bottom:2px}.nk-ai-msg .a-name span{color:var(--nk-text-tertiary);font-weight:400}.nk-ai-actions{display:flex;gap:4px;margin-top:6px}.nk-ai-actions button{font-family:inherit;font-size:12px;color:var(--nk-text-secondary);background:0 0;border:1px solid var(--nk-border);border-radius:5px;padding:2px 8px;cursor:pointer}.nk-ai-actions ::slotted(button){font-family:inherit;font-size:12px;color:var(--nk-text-secondary);background:0 0;border:1px solid var(--nk-border);border-radius:5px;padding:2px 8px!important;cursor:pointer}.nk-ai-actions ::slotted(button:hover),.nk-ai-actions button:hover{background:var(--nk-bg-hover);color:var(--nk-text)}.nk-ai-input-row{display:flex;align-items:center;gap:8px;margin-top:14px;border:1px solid var(--nk-border-strong);border-radius:10px;padding:8px 12px}.nk-ai-input-row:focus-within{border-color:var(--nk-accent)}.nk-ai-input-row input{flex:1;border:none;outline:0;background:0 0;font-family:inherit;font-size:14px;color:var(--nk-text);min-width:0}.nk-ai-input-row input::placeholder{color:var(--nk-text-tertiary)}.nk-ai-send{border:none;background:var(--nk-accent);color:var(--nk-on-accent);border-radius:6px;width:26px;height:26px;cursor:pointer;font-size:13px;flex-shrink:0}.nk-block-host{position:relative;border-radius:var(--nk-radius);margin:8px 0;padding:2px 0 2px 2px;transition:background .15s,box-shadow .15s}.nk-block-host:hover{background:var(--nk-bg-hover)}.nk-block-host:focus-within{background:0 0;box-shadow:0 0 0 2px color-mix(in srgb,var(--nk-accent) 25%,transparent)}.nk-block-host.nk-drop-target{box-shadow:0 -2px 0 0 var(--nk-accent);background:0 0}.nk-block-host .nk-block-handle,.nk-block-host ::slotted(.nk-block-handle){position:absolute;left:-26px;top:4px;width:18px;height:20px;border-radius:4px;display:flex;align-items:center;justify-content:center;color:var(--nk-text-tertiary);font-size:13px;cursor:grab;opacity:0;transition:opacity .15s;user-select:none}.nk-block-host:hover .nk-block-handle{opacity:1}.nk-block-host .nk-block-actions{position:absolute;display:flex;gap:1px;z-index:2;opacity:0;transition:opacity .15s;pointer-events:none}.nk-block-host .nk-block-actions.show{opacity:1;pointer-events:auto}.nk-block-host .nk-block-actions ::slotted(button),.nk-block-host .nk-block-actions button{width:20px;height:22px;padding:0;border:none;border-radius:4px;background:0 0;color:var(--nk-text-tertiary);font-family:inherit;font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}.nk-block-host .nk-block-actions button:hover{background:var(--nk-bg-hover);color:var(--nk-text)}.nk-block-host .nk-block-actions .drag{cursor:grab}.nk-block-host .nk-block-actions .drag:active{cursor:grabbing}.nk-block-host .ProseMirror{outline:0;font-family:var(--nk-font);font-size:14px;line-height:1.6;color:var(--nk-text);min-height:60px;padding:4px 2px}.nk-block-host .ProseMirror>*+*{margin-top:6px}.nk-block-host .ProseMirror h1{font-size:30px;font-weight:600;letter-spacing:-.01em;margin:24px 0 6px}.nk-block-host .ProseMirror h2{font-size:22px;font-weight:600;margin:20px 0 6px}.nk-block-host .ProseMirror h3{font-size:17px;font-weight:600;margin:16px 0 4px}.nk-block-host .ProseMirror p{margin:0}.nk-block-host .ProseMirror ol,.nk-block-host .ProseMirror ul{padding-left:24px;margin:4px 0}.nk-block-host .ProseMirror ul{list-style:disc}.nk-block-host .ProseMirror ol{list-style:decimal}.nk-block-host .ProseMirror li{margin:2px 0}.nk-block-host .ProseMirror li::marker{color:var(--nk-text-tertiary)}.nk-block-host .ProseMirror ul[data-type=taskList]{list-style:none;padding-left:2px}.nk-block-host .ProseMirror ul[data-type=taskList] li{display:flex;gap:8px;align-items:flex-start}.nk-block-host .ProseMirror ul[data-type=taskList] li>label{flex-shrink:0;margin-top:3px;user-select:none}.nk-block-host .ProseMirror ul[data-type=taskList] li>div{flex:1;min-width:0}.nk-block-host .ProseMirror ul[data-type=taskList] input[type=checkbox]{appearance:none;width:16px;height:16px;margin:0;border:1.4px solid var(--nk-border-strong);border-radius:2px;cursor:pointer;position:relative;background:var(--nk-bg);display:block}.nk-block-host .ProseMirror ul[data-type=taskList] input[type=checkbox]:checked{background:var(--nk-accent);border-color:var(--nk-accent)}.nk-block-host .ProseMirror ul[data-type=taskList] input[type=checkbox]:checked::after{content:"โ";color:var(--nk-on-accent);font-size:11px;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.nk-block-host .ProseMirror li[data-checked=true]>div{text-decoration:line-through;color:var(--nk-text-tertiary)}.nk-block-host .ProseMirror-gapcursor::after{border-top-color:var(--nk-text)}.nk-block-host .ProseMirror .ProseMirror-selectednode{background:color-mix(in srgb,var(--nk-accent) 8%,transparent)}.nk-block-host .ProseMirror blockquote{border-left:3px solid var(--nk-text);padding:2px 0 2px 14px;margin:12px 0;color:var(--nk-text-secondary)}.nk-block-host .ProseMirror code{font-family:var(--nk-font-mono);font-size:85%;color:var(--nk-danger);background:color-mix(in srgb,var(--nk-danger) 8%,transparent);border-radius:4px;padding:1px 5px}.nk-block-host .ProseMirror pre{background:var(--nk-bg-code);border:1px solid var(--nk-border);border-radius:var(--nk-radius);padding:16px 20px;margin:12px 0;font-family:var(--nk-font-mono);font-size:13px;line-height:1.6;color:var(--nk-text-secondary);overflow-x:auto}.nk-block-host .ProseMirror pre code{background:0 0;color:inherit;padding:0;font-size:inherit}.nk-block-host .ProseMirror hr{border:none;border-top:1px solid var(--nk-border);margin:20px 0}.nk-block-host .ProseMirror a{color:var(--nk-accent);text-decoration:underline;text-underline-offset:2px}.nk-block-host .ProseMirror-selectednode{box-shadow:0 0 0 2px color-mix(in srgb,var(--nk-accent) 35%,transparent);border-radius:3px}.nk-block-host .ProseMirror ::selection{background:color-mix(in srgb,var(--nk-accent) 25%,transparent)}.nk-block-host .ProseMirror .is-empty::before,.nk-block-host .ProseMirror p.is-editor-empty:first-child::before{content:attr(data-placeholder);color:var(--nk-text-tertiary);float:left;height:0;pointer-events:none}.nk-block-host .bn-container{font-family:var(--nk-font);color:var(--nk-text);background:0 0}.nk-block-host .bn-editor{padding:4px 2px}.nk-block-host .bn-block-content{font-size:14px;line-height:1.6}.nk-block-host .bn-side-menu{color:var(--nk-text-tertiary)}.nk-block-host .bn-drag-handle{border-radius:4px}.nk-block-host .bn-drag-handle:hover{background:var(--nk-bg-hover)}.nk-block-host .novel-editor{font-family:var(--nk-font);color:var(--nk-text)}.nk-block-host .novel-prose{max-width:none}.nk-block-host .bn-suggestion-menu,.nk-block-host .tippy-box,.nk-slash-menu{background:var(--nk-bg);border-radius:10px;box-shadow:var(--nk-shadow-menu);padding:6px;width:280px;max-height:320px;overflow-y:auto;font-family:var(--nk-font);font-size:14px;color:var(--nk-text)}.nk-slash-menu-label{font-size:12px;color:var(--nk-text-tertiary);padding:6px 9px 2px}.nk-slash-item{display:flex;align-items:center;gap:10px;padding:6px 9px;border-radius:5px;cursor:pointer;user-select:none}.nk-slash-item.selected,.nk-slash-item:hover{background:var(--nk-bg-hover)}.nk-slash-item .m-icon,.nk-slash-item ::slotted(.m-icon){width:28px;height:28px;flex-shrink:0;border-radius:4px;background:var(--nk-bg-callout);border:1px solid var(--nk-border);display:flex;align-items:center;justify-content:center;font-size:15px}.nk-slash-item .m-desc{font-size:12px;color:var(--nk-text-tertiary)}.nk-bubble-menu{display:flex;align-items:center;gap:2px;background:var(--nk-bg);border-radius:8px;box-shadow:var(--nk-shadow-menu);padding:4px}.nk-bubble-menu button{font-family:inherit;font-size:13px;border:none;background:0 0;color:var(--nk-text-secondary);padding:4px 8px;border-radius:5px;cursor:pointer}.nk-bubble-menu ::slotted(button){font-family:inherit;font-size:13px;border:none;background:0 0;color:var(--nk-text-secondary);padding:4px 8px!important;border-radius:5px;cursor:pointer}.nk-bubble-menu ::slotted(button:hover),.nk-bubble-menu button:hover{background:var(--nk-bg-hover);color:var(--nk-text)}.nk-bubble-menu ::slotted(button.active),.nk-bubble-menu button.active{color:var(--nk-accent)}@media (max-width:860px){.nk-sidebar{display:none}.nk-tab-bar{display:flex}.nk-tab-bar.fixed+.nk-tab-bar-spacer{display:block}.nk-page{padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px));padding-bottom:80px}.nk-settings-nav{width:60px;min-width:60px}.nk-settings-nav .label,.nk-settings-nav .nk-section-label,.nk-settings-user .u-text{display:none}.nk-settings-content{padding:24px}.nk-cmdk-backdrop{padding-top:max(6vh,env(safe-area-inset-top,0px))}.nk-cmdk{width:min(560px,96vw)}.nk-stats{flex-wrap:wrap}}@media (prefers-reduced-motion:reduce){.nk-skeleton{animation:none;background:var(--nk-bg-callout)}[class*=nk-],[class*=nk-]::after,[class*=nk-]::before{animation-duration:NaNs!important;animation-iteration-count:1!important;transition-duration:NaNs!important;scroll-behavior:auto!important}}\n/*# sourceMappingURL=notionkit.min.css.map */',s=n+i,r=n+e+i;(new CSSStyleSheet).replaceSync(r);(new CSSStyleSheet).replaceSync(e);const o=new CSSStyleSheet;o.replaceSync(s);const a="__nkDefaultTokensInjected";!function(){if("undefined"==typeof document)return;if(globalThis[a])return;globalThis[a]=!0;const t=new CSSStyleSheet;t.replaceSync(`@layer notionkit-defaults { ${e} }`),document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}();const l=new Set;function h(){return document.documentElement.getAttribute("data-theme")||"light"}"undefined"!=typeof window&&"undefined"!=typeof MutationObserver&&new MutationObserver(function(){const t=h();for(const e of l)e._syncTheme(t)}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const d=new Map;function c(t){let e=d.get(t);return e||(e=new CSSStyleSheet,e.replaceSync(`\n :host { display: ${t}; }\n :host([hidden]) { display: none; }\n .nk-wrapper { display: contents; }\n `),d.set(t,e)),e}class p extends HTMLElement{static get display(){return"contents"}static get hostStyles(){return null}static get observesLightDom(){return!1}static get lightDomObserverInit(){return{childList:!0,subtree:!0,characterData:!0,attributes:!0}}static get slotAssignment(){return"named"}static get observedAttributes(){return[]}constructor(){super(),this._initialized=!1,this._shadow=this.attachShadow({mode:"open",slotAssignment:this.constructor.slotAssignment});const t=[o,c(this.constructor.display)],e=this.constructor.hostStyles;e&&t.push(e),this._shadow.adoptedStyleSheets=t}connectedCallback(){this._initialized?this._wrapper.setAttribute("data-theme",h()):(this._upgradeOwnProperties(),this._initialized=!0,this._wrapper=document.createElement("div"),this._wrapper.className="nk-wrapper",this._wrapper.setAttribute("data-theme",h()),this._shadow.appendChild(this._wrapper),this.render()),this.setupEvents(),l.add(this),this.constructor.observesLightDom&&(this._lightDomObserver??=new MutationObserver(t=>this.projectLightDom(t)),this._lightDomObserver.observe(this,this.constructor.lightDomObserverInit)),"manual"===this.constructor.slotAssignment&&(this.assignSlots(),this._slotObserver??=new MutationObserver(()=>this.assignSlots()),this._slotObserver.observe(this,{childList:!0}))}disconnectedCallback(){l.delete(this),this._lightDomObserver?.disconnect(),this._slotObserver?.disconnect(),this.teardownEvents()}attributeChangedCallback(t,e,n){this._initialized&&e!==n&&this.onAttributeChanged(t,e,n)}_syncTheme(t){this._wrapper?.setAttribute("data-theme",t)}_upgradeOwnProperties(){for(const t of Object.keys(this)){if(t.startsWith("_"))continue;let e,n=Object.getPrototypeOf(this);for(;n&&n!==HTMLElement.prototype&&!(e=Object.getOwnPropertyDescriptor(n,t));)n=Object.getPrototypeOf(n);if(!e?.set)continue;const i=this[t];delete this[t],this[t]=i}}render(){}setupEvents(){}teardownEvents(){}onAttributeChanged(t,e,n){}projectLightDom(){}assignSlots(){}refresh(){this.projectLightDom(),"manual"===this.constructor.slotAssignment&&this.assignSlots()}getBoolAttr(t){return this.hasAttribute(t)}setBoolAttr(t,e){e?this.setAttribute(t,""):this.removeAttribute(t)}createElement(t,e=[],n={}){const i=document.createElement(t);e.length&&i.classList.add(...e);for(const[t,e]of Object.entries(n))null!=e&&!1!==e&&i.setAttribute(t,!0===e?"":e);return i}emit(t,e=null){return this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,cancelable:!0,detail:e}))}}class u extends p{static formAssociated=!0;constructor(){super(),this._internals=this.attachInternals()}get form(){return this._internals.form}get validationMessage(){return this._internals.validationMessage}get validity(){return this._internals.validity}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}connectedCallback(){const t=!this._initialized;super.connectedCallback(),t&&this._formDisabled&&this.onFormDisabled(!0)}formResetCallback(){this.resetValue()}formStateRestoreCallback(t,e){this.restoreValue(t,e)}formDisabledCallback(t){this._formDisabled=t,this._initialized&&this.onFormDisabled(t)}resetValue(){}restoreValue(t,e){}onFormDisabled(t){}setFormValue(t,e){this._internals.setFormValue(t,e)}setValidity(t,e,n){this._internals.setValidity(t,e,n)}syncValidityFrom(t){t&&(t.validity.valid?this._internals.setValidity({}):this._internals.setValidity(t.validity,t.validationMessage,t))}}const b=["primary","secondary","danger","danger-solid","topbar","share"];class g extends p{static get observedAttributes(){return["variant","small","disabled","type","href","title","aria-label"]}render(){this._build()}_build(){const t=this.getAttribute("href"),e=t?this.createElement("a",[],{href:t}):this.createElement("button",[],{type:this.getAttribute("type")||"button"});e.className=this._computeClasses().join(" "),e.appendChild(document.createElement("slot")),this._applyState(e),this._btn?(this._btn.removeEventListener("click",this._onClick),this._btn.replaceWith(e)):this._wrapper.appendChild(e),this._btn=e,this._onClick&&e.addEventListener("click",this._onClick)}_applyState(t){const e=this.getBoolAttr("disabled");"BUTTON"===t.tagName?t.disabled=e:t.setAttribute("aria-disabled",e?"true":"false");const n=this.getAttribute("title");n?t.setAttribute("title",n):t.removeAttribute("title");const i=this.getAttribute("aria-label");i?t.setAttribute("aria-label",i):t.removeAttribute("aria-label")}setupEvents(){this._onClick=t=>{if(this.getBoolAttr("disabled"))return t.preventDefault(),void t.stopPropagation();const e=this.getAttribute("type");if("submit"===e||"reset"===e){const t=this.closest("form");t&&("submit"===e?t.requestSubmit():t.reset())}},this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}onAttributeChanged(t){if(this._btn)switch(t){case"href":this._build();break;case"variant":case"small":this._btn.className=this._computeClasses().join(" ");break;case"type":"BUTTON"===this._btn.tagName&&this._btn.setAttribute("type",this.getAttribute("type")||"button");break;default:this._applyState(this._btn)}}_computeClasses(){const t=this.getAttribute("variant");if("topbar"===t)return["nk-topbar-btn"];if("share"===t)return["nk-topbar-btn","nk-share-btn"];const e=["nk-btn"];return b.includes(t)&&e.push(t),this.getBoolAttr("small")&&e.push("small"),e}focus(t){this._btn?.focus(t)}click(){this._btn?.click()}get variant(){return this.getAttribute("variant")}set variant(t){t?this.setAttribute("variant",t):this.removeAttribute("variant")}get small(){return this.getBoolAttr("small")}set small(t){this.setBoolAttr("small",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get type(){return this.getAttribute("type")||"button"}set type(t){this.setAttribute("type",t)}get href(){return this.getAttribute("href")}set href(t){t?this.setAttribute("href",t):this.removeAttribute("href")}}customElements.define("nk-btn",g);const m=["type","placeholder","name","min","max","step","autocomplete","pattern","maxlength","minlength","inputmode","list","aria-label"],k=["required","disabled","readonly"];class _ extends u{static get observedAttributes(){return["value","wide",...m,...k]}render(){this._input=this.createElement("input",["nk-input"]);for(const t of m)this._forward(t);for(const t of k)this._forward(t);this._input.value=this.getAttribute("value")??"",this._defaultValue=this._input.value,this._syncWide(),this._wrapper.appendChild(this._input),this._syncFormValue()}_forward(t){if(k.includes(t))return void(this._input["readonly"===t?"readOnly":t]=this.getBoolAttr(t)||"disabled"===t&&!!this._formDisabled);const e=this.getAttribute(t);null===e?this._input.removeAttribute(t):this._input.setAttribute(t,e)}_syncWide(){this._input.classList.toggle("wide",this.getBoolAttr("wide"))}setupEvents(){this._onInput=()=>{this._syncFormValue(),this.emit("nk-input",{value:this._input.value,name:this.name})},this._onChange=()=>{this._syncFormValue(),this.emit("nk-change",{value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("input",this._onInput),this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(this._input)return"value"===t?(this._input.value=this.getAttribute("value")??"",void this._syncFormValue()):void("wide"!==t?(this._forward(t),this._syncFormValue()):this._syncWide())}_syncFormValue(){this.setFormValue(this._input.value),this.syncValidityFrom(this._input)}resetValue(){this._input.value=this.getAttribute("value")??"",this._syncFormValue()}restoreValue(t){"string"==typeof t&&(this._input.value=t,this._syncFormValue())}onFormDisabled(t){this._input.disabled=t||this.getBoolAttr("disabled")}focus(t){this._input?.focus(t)}blur(){this._input?.blur()}select(){this._input?.select()}get value(){return this._input?.value??this.getAttribute("value")??""}set value(t){this._input?(this._input.value=t??"",this._syncFormValue()):this.setAttribute("value",t??"")}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("type")||"text"}set type(t){this.setAttribute("type",t)}get placeholder(){return this.getAttribute("placeholder")}set placeholder(t){this.setAttribute("placeholder",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get required(){return this.getBoolAttr("required")}set required(t){this.setBoolAttr("required",t)}get readonly(){return this.getBoolAttr("readonly")}set readonly(t){this.setBoolAttr("readonly",t)}get wide(){return this.getBoolAttr("wide")}set wide(t){this.setBoolAttr("wide",t)}}customElements.define("nk-input",_);const v=["placeholder","name","rows","maxlength","minlength","autocomplete","aria-label"],x=["required","disabled","readonly"];class f extends u{static get observedAttributes(){return["value","wide",...v,...x]}render(){this._input=this.createElement("textarea",["nk-textarea"]);for(const t of[...v,...x])this._forward(t);this._input.value=this.getAttribute("value")??this.textContent.trim(),this._syncWide(),this._wrapper.appendChild(this._input),this._syncFormValue()}_forward(t){if(x.includes(t))return void(this._input["readonly"===t?"readOnly":t]=this.getBoolAttr(t)||"disabled"===t&&!!this._formDisabled);const e=this.getAttribute(t);null===e?this._input.removeAttribute(t):this._input.setAttribute(t,e)}_syncWide(){this._input.classList.toggle("wide",this.getBoolAttr("wide"))}setupEvents(){this._onInput=()=>{this._syncFormValue(),this.emit("nk-input",{value:this._input.value,name:this.name})},this._onChange=()=>{this._syncFormValue(),this.emit("nk-change",{value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("input",this._onInput),this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(this._input)return"value"===t?(this._input.value=this.getAttribute("value")??"",void this._syncFormValue()):void("wide"!==t?(this._forward(t),this._syncFormValue()):this._syncWide())}_syncFormValue(){this.setFormValue(this._input.value),this.syncValidityFrom(this._input)}resetValue(){this._input.value=this.getAttribute("value")??this.textContent.trim(),this._syncFormValue()}restoreValue(t){"string"==typeof t&&(this._input.value=t,this._syncFormValue())}onFormDisabled(t){this._input.disabled=t||this.getBoolAttr("disabled")}focus(t){this._input?.focus(t)}blur(){this._input?.blur()}get value(){return this._input?.value??this.getAttribute("value")??""}set value(t){this._input?(this._input.value=t??"",this._syncFormValue()):this.setAttribute("value",t??"")}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get required(){return this.getBoolAttr("required")}set required(t){this.setBoolAttr("required",t)}get wide(){return this.getBoolAttr("wide")}set wide(t){this.setBoolAttr("wide",t)}}customElements.define("nk-textarea",f);class y extends u{static get observedAttributes(){return["value","name","disabled","required","compact","wide","aria-label"]}static get observesLightDom(){return!0}render(){this._select=this.createElement("select",["nk-select"]),this._forwardAll(),this._wrapper.appendChild(this._select),this._defaultValue=this.getAttribute("value"),this.projectLightDom(),requestAnimationFrame(()=>this.projectLightDom())}_forwardAll(){const t=this.getAttribute("name");t?this._select.setAttribute("name",t):this._select.removeAttribute("name");const e=this.getAttribute("aria-label");e?this._select.setAttribute("aria-label",e):this._select.removeAttribute("aria-label"),this._select.disabled=this.getBoolAttr("disabled")||!!this._formDisabled,this._select.required=this.getBoolAttr("required"),this._select.classList.toggle("compact",this.getBoolAttr("compact")),this._select.classList.toggle("wide",this.getBoolAttr("wide"))}projectLightDom(){if(!this._select)return;const t=[...this.children].filter(t=>t.matches("option, optgroup")),e=t.map(t=>t.outerHTML).join("");if(e===this._optionSignature)return;this._optionSignature=e;const n=this._select.selectedIndex>=0?this._select.value:null;this._select.innerHTML="";for(const e of t)this._select.appendChild(e.cloneNode(!0));this._applyValue(n)||this._applyValue(this.getAttribute("value")),this._syncFormValue()}_applyValue(t){return null!==t&&(!![...this._select.options].some(e=>e.value===t)&&(this._select.value=t,!0))}setupEvents(){this._onChange=()=>{this._syncFormValue(),this.emit("nk-change",{value:this._select.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._select.addEventListener("change",this._onChange)}teardownEvents(){this._select?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(this._select){if("value"===t)return this._applyValue(this.getAttribute("value")),void this._syncFormValue();this._forwardAll(),this._syncFormValue()}}_syncFormValue(){this.setFormValue(this._select.value),this.syncValidityFrom(this._select)}resetValue(){this._applyValue(this._defaultValue)||(this._select.selectedIndex=0),this._syncFormValue()}restoreValue(t){"string"==typeof t&&(this._applyValue(t),this._syncFormValue())}onFormDisabled(t){this._select.disabled=t||this.getBoolAttr("disabled")}focus(t){this._select?.focus(t)}get value(){return this._select?.value??""}set value(t){this._select?(this._select.value=t,this._syncFormValue()):this.setAttribute("value",t)}get selectedIndex(){return this._select?.selectedIndex??-1}get options(){return this._select?.options??[]}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get required(){return this.getBoolAttr("required")}set required(t){this.setBoolAttr("required",t)}get compact(){return this.getBoolAttr("compact")}set compact(t){this.setBoolAttr("compact",t)}get wide(){return this.getBoolAttr("wide")}set wide(t){this.setBoolAttr("wide",t)}}customElements.define("nk-select",y);class w extends u{static get observedAttributes(){return["checked","disabled","name","value","label","text"]}render(){this._row=this.createElement("label",["nk-switch-label"]),this._btn=this.createElement("button",["nk-switch"],{type:"button",role:"switch"}),this._text=document.createElement("span"),this._slot=document.createElement("slot"),this._textNode=document.createTextNode(""),this._slot.appendChild(this._textNode),this._text.appendChild(this._slot),this._row.append(this._btn,this._text),this._defaultChecked=this.getBoolAttr("checked"),this._apply(),this._syncText(),this._wrapper.appendChild(this._row),this._syncFormValue()}_apply(){this._btn.setAttribute("aria-checked",this.getBoolAttr("checked")?"true":"false"),this._btn.disabled=this.getBoolAttr("disabled")||!!this._formDisabled;const t=this.getAttribute("label");t?this._btn.setAttribute("aria-label",t):this._btn.removeAttribute("aria-label")}_syncText(){this._textNode.data=this.getAttribute("text")??"";const t=!(!this.getAttribute("text")&&!this._slot.assignedNodes().some(t=>t.nodeType===Node.ELEMENT_NODE||t.data.trim()));this._text.hidden=!t,this._row.style.display=t?"":"contents"}setupEvents(){this._onClick=()=>this.toggle(),this._onSlot=()=>this._syncText(),this._btn.addEventListener("click",this._onClick),this._slot.addEventListener("slotchange",this._onSlot),this._syncText()}teardownEvents(){this._btn?.removeEventListener("click",this._onClick),this._slot?.removeEventListener("slotchange",this._onSlot)}toggle(){this.getBoolAttr("disabled")||this._formDisabled||(this.checked=!this.checked,this.emit("nk-change",{checked:this.checked,value:this.getAttribute("value")||"on",name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0})))}onAttributeChanged(t){this._btn&&("text"!==t?(this._apply(),this._syncFormValue()):this._syncText())}_syncFormValue(){const t=this.getAttribute("value")||"on";this.setFormValue(this.getBoolAttr("checked")?t:null,this.getBoolAttr("checked")?"checked":"unchecked")}resetValue(){this.setBoolAttr("checked",this._defaultChecked)}restoreValue(t){"checked"!==t&&"unchecked"!==t||this.setBoolAttr("checked","checked"===t)}onFormDisabled(t){this._formDisabled=t,this._apply()}focus(t){this._btn?.focus(t)}get checked(){return this.getBoolAttr("checked")}set checked(t){this.setBoolAttr("checked",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}get text(){return this.getAttribute("text")}set text(t){null==t?this.removeAttribute("text"):this.setAttribute("text",t)}}customElements.define("nk-switch",w);class A extends u{static get observedAttributes(){return["checked","disabled","name","value","text","indeterminate","required"]}render(){const t=this.createElement("label",["nk-check"]);this._input=this.createElement("input",[],{type:"checkbox"});const e=document.createElement("slot");this._text=document.createTextNode(""),e.appendChild(this._text),this._apply(),this._defaultChecked=this.getBoolAttr("checked"),t.appendChild(this._input),t.appendChild(e),this._wrapper.appendChild(t),this._syncFormValue()}_apply(){this._input.checked=this.getBoolAttr("checked"),this._input.indeterminate=this.getBoolAttr("indeterminate"),this._input.disabled=this.getBoolAttr("disabled")||!!this._formDisabled,this._input.required=this.getBoolAttr("required");const t=this.getAttribute("name");t?this._input.setAttribute("name",t):this._input.removeAttribute("name"),this._input.value=this.getAttribute("value")||"on",this._text&&(this._text.data=this.getAttribute("text")??"")}setupEvents(){this._onChange=()=>{this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this.removeAttribute("indeterminate"),this._syncing=!1,this._syncFormValue(),this.emit("nk-change",{checked:this._input.checked,value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(){!this._syncing&&this._input&&(this._apply(),this._syncFormValue())}_syncFormValue(){this.setFormValue(this._input.checked?this._input.value:null,this._input.checked?"checked":"unchecked"),this.syncValidityFrom(this._input)}resetValue(){this.setBoolAttr("checked",this._defaultChecked)}restoreValue(t){"checked"!==t&&"unchecked"!==t||this.setBoolAttr("checked","checked"===t)}onFormDisabled(t){this._formDisabled=t,this._apply()}focus(t){this._input?.focus(t)}get checked(){return this._input?.checked??this.getBoolAttr("checked")}set checked(t){this.setBoolAttr("checked",t)}get indeterminate(){return this.getBoolAttr("indeterminate")}set indeterminate(t){this.setBoolAttr("indeterminate",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get text(){return this.getAttribute("text")}set text(t){null==t?this.removeAttribute("text"):this.setAttribute("text",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}}customElements.define("nk-check",A);const E={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1};function C(t){return(void 0!==t.form?t.form:t.closest("form"))??null}function L(t){const e=t.filter(t=>!t.disabled);if(!e.length)return;const n=e.find(t=>t.checked)||e[0];for(const e of t)e._input&&(e._input.tabIndex=e===n?0:-1)}class B extends u{static get observedAttributes(){return["checked","disabled","name","value","text","required"]}render(){const t=this.createElement("label",["nk-check"]);this._input=this.createElement("input",[],{type:"radio"});const e=document.createElement("slot");this._text=document.createTextNode(""),e.appendChild(this._text),this._apply(),this._defaultChecked=this.getBoolAttr("checked"),t.appendChild(this._input),t.appendChild(e),this._wrapper.appendChild(t),this._syncFormValue(),this._input.checked&&this._uncheckPeers(),L(this._group())}_apply(){this._input.checked=this.getBoolAttr("checked"),this._input.disabled=this.getBoolAttr("disabled")||!!this._formDisabled,this._input.required=this.getBoolAttr("required");const t=this.getAttribute("name");t?this._input.setAttribute("name",t):this._input.removeAttribute("name"),this._input.value=this.getAttribute("value")||"",this._text&&(this._text.data=this.getAttribute("text")??"")}setupEvents(){this._onChange=()=>this._applyChange(),this._onKeyDown=t=>{const e=E[t.key];if(!e||t.ctrlKey||t.metaKey||t.altKey)return;const n=this._group().filter(t=>!t.disabled);if(n.length<2)return;t.preventDefault();const i=n[(n.indexOf(this)+e+n.length)%n.length];i._input.focus(),i._input.checked=!0,i._applyChange()},this._input.addEventListener("change",this._onChange),this._input.addEventListener("keydown",this._onKeyDown),L(this._group())}teardownEvents(){this._input?.removeEventListener("change",this._onChange),this._input?.removeEventListener("keydown",this._onKeyDown)}_applyChange(){this._input.checked&&this._uncheckPeers(),this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this._syncing=!1,this._syncFormValue(),L(this._group()),this.emit("nk-change",{checked:this._input.checked,value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))}_group(){const t=this.getAttribute("name"),e=this.getRootNode();if(!t||"function"!=typeof e?.querySelectorAll)return[this];const n=C(this);return[...e.querySelectorAll("nk-radio")].filter(e=>e.getAttribute("name")===t&&C(e)===n)}_uncheckPeers(){for(const t of this._group())t!==this&&t.checked&&(t.checked=!1)}onAttributeChanged(t){!this._syncing&&this._input&&(this._apply(),"checked"===t&&this._input.checked&&this._uncheckPeers(),this._syncFormValue(),L(this._group()))}_syncFormValue(){const t=this.getAttribute("value")||"";this.setFormValue(this._input.checked?t:null,this._input.checked?"checked":"unchecked"),this.syncValidityFrom(this._input)}resetValue(){this._input.checked=this._defaultChecked,this.setBoolAttr("checked",this._defaultChecked),this._syncFormValue(),L(this._group())}restoreValue(t){"checked"===t&&(this.checked=!0)}onFormDisabled(t){this._formDisabled=t,this._apply(),L(this._group())}focus(t){this._input?.focus(t)}get checked(){return this._input?.checked??this.getBoolAttr("checked")}set checked(t){this._input&&(this._input.checked=t),t&&this._uncheckPeers(),this.setBoolAttr("checked",t),this._input&&(this._syncFormValue(),L(this._group()))}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get text(){return this.getAttribute("text")}set text(t){null==t?this.removeAttribute("text"):this.setAttribute("text",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}customElements.define("nk-radio",B);const S=["name","min","max","step","aria-label"];class N extends u{static get observedAttributes(){return["value","disabled","show-value","unit",...S]}render(){this._input=this.createElement("input",["nk-slider"],{type:"range"}),this._out=this.createElement("div",["nk-slider-value"]),this._apply(),this._input.value=this.getAttribute("value")??this._input.value,this._defaultValue=this._input.value,this._wrapper.appendChild(this._input),this._wrapper.appendChild(this._out),this._syncOut(),this._syncFormValue()}_apply(){for(const t of S){const e=this.getAttribute(t);null===e?this._input.removeAttribute(t):this._input.setAttribute(t,e)}this._input.disabled=this.getBoolAttr("disabled")||!!this._formDisabled,this._out.style.display=this.getBoolAttr("show-value")?"":"none"}_syncOut(){this._out.textContent=`${this._input.value}${this.getAttribute("unit")||""}`}setupEvents(){this._onInput=()=>{this._syncOut(),this._syncFormValue(),this.emit("nk-input",{value:Number(this._input.value),name:this.name})},this._onChange=()=>{this._syncFormValue(),this.emit("nk-change",{value:Number(this._input.value),name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("input",this._onInput),this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){this._input&&("value"===t?this._input.value=this.getAttribute("value")??"":this._apply(),this._syncOut(),this._syncFormValue())}_syncFormValue(){this.setFormValue(this._input.value)}resetValue(){this._input.value=this._defaultValue,this._syncOut(),this._syncFormValue()}restoreValue(t){"string"==typeof t&&(this._input.value=t,this._syncOut(),this._syncFormValue())}onFormDisabled(t){this._formDisabled=t,this._apply()}focus(t){this._input?.focus(t)}get value(){return Number(this._input?.value??this.getAttribute("value"))}set value(t){this._input?(this._input.value=t,this._syncOut(),this._syncFormValue()):this.setAttribute("value",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get showValue(){return this.getBoolAttr("show-value")}set showValue(t){this.setBoolAttr("show-value",t)}}customElements.define("nk-slider",N);const z=["nk-input","nk-textarea","nk-select"];class D extends p{static get observedAttributes(){return["label","desc","stacked","compact"]}render(){this._field=this.createElement("div",["nk-field"]);const t=document.createElement("div");this._label=this.createElement("div",["f-label"]);const e=this.createElement("slot",[],{name:"label"});e.appendChild(this._label),this._desc=this.createElement("div",["f-desc"]);const n=this.createElement("slot",[],{name:"desc"});n.appendChild(this._desc),t.appendChild(e),t.appendChild(n);const i=this.createElement("div",["f-control"]);this._slot=document.createElement("slot"),i.appendChild(this._slot),this._field.appendChild(t),this._field.appendChild(i),this._wrapper.appendChild(this._field),this._widened=new Set,this._sync()}setupEvents(){this._onSlot=()=>this._syncWide(),this._slot.addEventListener("slotchange",this._onSlot),this._sync()}teardownEvents(){this._slot?.removeEventListener("slotchange",this._onSlot)}onAttributeChanged(){this._sync()}get stacked(){return this.getBoolAttr("stacked")||!!this.closest("nk-fields")}set stacked(t){this.setBoolAttr("stacked",t)}get compact(){return this.getBoolAttr("compact")||!!this.closest("nk-fields")}set compact(t){this.setBoolAttr("compact",t)}_sync(){if(!this._label)return;this._label.textContent=this.getAttribute("label")||"";const t=this.getAttribute("desc");this._desc.textContent=t||"",this._desc.style.display=t?"":"none",this._field.classList.toggle("stacked",this.stacked),this._field.classList.toggle("compact",this.compact),this._syncWide()}_syncWide(){if(!this._slot)return;const t=this.stacked;for(const e of this._slot.assignedElements())z.includes(e.localName)&&(t&&!e.hasAttribute("wide")?(e.setAttribute("wide",""),this._widened.add(e)):!t&&this._widened.has(e)&&(e.removeAttribute("wide"),this._widened.delete(e)))}get label(){return this.getAttribute("label")}set label(t){this.setAttribute("label",t)}get desc(){return this.getAttribute("desc")}set desc(t){null==t?this.removeAttribute("desc"):this.setAttribute("desc",t)}}customElements.define("nk-field",D);class V extends p{render(){const t=this.createElement("div",["nk-fields"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-fields",V);const T=["gray","brown","orange","yellow","green","blue","purple","pink","red"];class F extends p{static get observedAttributes(){return["color"]}render(){this._tag=this.createElement("span",this._computeClasses()),this._tag.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._tag)}onAttributeChanged(){this._tag&&(this._tag.className=this._computeClasses().join(" "))}_computeClasses(){const t=["nk-tag"],e=this.getAttribute("color");return T.includes(e)&&t.push(e),t}get color(){return this.getAttribute("color")}set color(t){t?this.setAttribute("color",t):this.removeAttribute("color")}}customElements.define("nk-tag",F);class M extends p{static get observedAttributes(){return["value","max","label"]}render(){this._bar=this.createElement("span",["nk-progress"],{role:"progressbar"}),this._fill=document.createElement("i"),this._bar.appendChild(this._fill),this._label=this.createElement("span",["nk-progress-label"]),this._wrapper.appendChild(this._bar),this._wrapper.appendChild(this._label),this._sync()}onAttributeChanged(){this._sync()}_sync(){if(!this._bar)return;const t=Number(this.getAttribute("max"))||100,e=Math.min(t,Math.max(0,Number(this.getAttribute("value"))||0));this._fill.style.width=e/t*100+"%",this._bar.setAttribute("aria-valuenow",e),this._bar.setAttribute("aria-valuemin",0),this._bar.setAttribute("aria-valuemax",t);const n=this.getAttribute("label");this._label.textContent=n??"",this._label.style.display=null===n?"none":""}get value(){return Number(this.getAttribute("value"))||0}set value(t){this.setAttribute("value",t)}get max(){return Number(this.getAttribute("max"))||100}set max(t){this.setAttribute("max",t)}get label(){return this.getAttribute("label")}set label(t){null==t?this.removeAttribute("label"):this.setAttribute("label",t)}}customElements.define("nk-progress",M);class j extends p{static get observedAttributes(){return["icon"]}render(){this._box=this.createElement("div",["nk-callout"]),this._icon=this.createElement("span",["c-icon"]);const t=this.createElement("slot",[],{name:"icon"});t.appendChild(this._icon);const e=document.createElement("div");e.appendChild(document.createElement("slot")),this._box.appendChild(t),this._box.appendChild(e),this._wrapper.appendChild(this._box),this._syncIcon()}onAttributeChanged(){this._syncIcon()}_syncIcon(){this._icon&&(this._icon.textContent=this.getAttribute("icon")||"๐ก")}get icon(){return this.getAttribute("icon")}set icon(t){null==t?this.removeAttribute("icon"):this.setAttribute("icon",t)}}customElements.define("nk-callout",j);class I extends p{render(){this._wrapper.appendChild(this.createElement("hr",["nk-divider"]))}}customElements.define("nk-divider",I);class K extends p{static get observedAttributes(){return["level"]}render(){this._build()}_build(){const t=Math.min(4,Math.max(1,Number(this.getAttribute("level"))||2)),e=this.createElement(`h${t}`,["nk-heading"]);e.appendChild(document.createElement("slot")),this._heading?this._heading.replaceWith(e):this._wrapper.appendChild(e),this._heading=e}onAttributeChanged(){this._build()}get level(){return Number(this.getAttribute("level"))||2}set level(t){this.setAttribute("level",t)}}customElements.define("nk-heading",K);class q extends p{static get observedAttributes(){return["label","open"]}render(){this._details=this.createElement("details",["nk-toggle"]);const t=document.createElement("summary");this._label=document.createElement("span");const e=this.createElement("slot",[],{name:"label"});e.appendChild(this._label),t.appendChild(e);const n=this.createElement("div",["toggle-body"]);n.appendChild(document.createElement("slot")),this._details.appendChild(t),this._details.appendChild(n),this._details.open=this.getBoolAttr("open"),this._wrapper.appendChild(this._details),this._sync()}setupEvents(){this._onToggle=()=>{this._syncing=!0,this.setBoolAttr("open",this._details.open),this._syncing=!1,this.emit("nk-toggle",{open:this._details.open})},this._details.addEventListener("toggle",this._onToggle)}teardownEvents(){this._details?.removeEventListener("toggle",this._onToggle)}onAttributeChanged(t){this._details&&("open"!==t?this._sync():this._syncing||(this._details.open=this.getBoolAttr("open")))}_sync(){this._label.textContent=this.getAttribute("label")||""}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get label(){return this.getAttribute("label")}set label(t){this.setAttribute("label",t)}}customElements.define("nk-toggle",q);class O extends u{static get observedAttributes(){return["checked","disabled","name","value"]}render(){const t=this.createElement("label",["nk-todo"]);this._input=this.createElement("input",[],{type:"checkbox"}),this._apply(),this._defaultChecked=this.getBoolAttr("checked");const e=document.createElement("span");e.appendChild(document.createElement("slot")),t.appendChild(this._input),t.appendChild(e),this._wrapper.appendChild(t),this._syncFormValue()}_apply(){this._input.checked=this.getBoolAttr("checked"),this._input.disabled=this.getBoolAttr("disabled")||!!this._formDisabled;const t=this.getAttribute("name");t?this._input.setAttribute("name",t):this._input.removeAttribute("name"),this._input.value=this.getAttribute("value")||"on"}setupEvents(){this._onChange=()=>{this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this._syncing=!1,this._syncFormValue(),this.emit("nk-change",{checked:this._input.checked,value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(){!this._syncing&&this._input&&(this._apply(),this._syncFormValue())}_syncFormValue(){this.setFormValue(this._input.checked?this._input.value:null,this._input.checked?"checked":"unchecked")}resetValue(){this.setBoolAttr("checked",this._defaultChecked)}restoreValue(t){"checked"!==t&&"unchecked"!==t||this.setBoolAttr("checked","checked"===t)}onFormDisabled(t){this._formDisabled=t,this._apply()}get checked(){return this._input?.checked??this.getBoolAttr("checked")}set checked(t){this.setBoolAttr("checked",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}}customElements.define("nk-todo",O);class P extends p{render(){const t=this.createElement("kbd",["nk-kbd"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-kbd",P);class $ extends p{static get observedAttributes(){return["lang","highlight"]}static get observesLightDom(){return!0}render(){this._box=this.createElement("div",["nk-code"]),this._lang=this.createElement("span",["lang"]),this._slot=document.createElement("slot"),this._pre=this.createElement("span",["hl"]),this._box.appendChild(this._lang),this._box.appendChild(this._slot),this._box.appendChild(this._pre),this._wrapper.appendChild(this._box),this._sync(),this.projectLightDom()}onAttributeChanged(){this._sync(),this.projectLightDom()}_sync(){if(!this._lang)return;const t=this.getAttribute("lang");this._lang.textContent=t||"",this._lang.style.display=t?"":"none"}projectLightDom(){if(!this._pre)return;const t=this.hasAttribute("highlight");if(this._slot.style.display=t?"none":"",this._pre.style.display=t?"":"none",!t)return;const e=this.textContent.replace(/^\n/,"");var n;e!==this._lastText&&(this._lastText=e,this._pre.innerHTML=(n=e,n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")).replace(/<(\/?)([a-zA-Z][\w-]*)([^&]*?)(\/?)>/g,(t,e,n,i,s)=>`<${e}<span class="tag">${n}</span>${i.replace(/([\w-]+)(=)("[^"]*"|'[^']*')?/g,(t,e,n,i)=>`<span class="attr">${e}</span>${n}${i??""}`)}${s}>`))}get lang(){return this.getAttribute("lang")}set lang(t){null==t?this.removeAttribute("lang"):this.setAttribute("lang",t)}}customElements.define("nk-code",$);class R extends p{static get observedAttributes(){return["cite"]}render(){this._quote=this.createElement("blockquote",["nk-quote"]),this._quote.appendChild(document.createElement("slot")),this._cite=this.createElement("cite",["q-cite"]),this._quote.appendChild(this._cite),this._wrapper.appendChild(this._quote),this._sync()}onAttributeChanged(){this._sync()}_sync(){if(!this._cite)return;const t=this.getAttribute("cite");this._cite.textContent=t||"",this._cite.style.display=t?"":"none"}get cite(){return this.getAttribute("cite")}set cite(t){null==t?this.removeAttribute("cite"):this.setAttribute("cite",t)}}customElements.define("nk-quote",R);class U extends p{render(){const t=this.createElement("div",["nk-app"]);t.appendChild(this.createElement("slot",[],{name:"sidebar"}));const e=this.createElement("main",["nk-main"]);e.appendChild(document.createElement("slot")),t.appendChild(e),this._wrapper.appendChild(t)}}customElements.define("nk-app",U);const W=new CSSStyleSheet;W.replaceSync("\n .nk-sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 59; background: var(--nk-scrim-soft); }\n @media (max-width: 860px) {\n .nk-sidebar {\n position: fixed; inset: 0 auto 0 0; z-index: 60;\n transform: translateX(-100%);\n transition: background .25s ease, transform .24s cubic-bezier(.2, .8, .25, 1), display .24s;\n transition-behavior: allow-discrete;\n }\n :host([open]) .nk-sidebar { display: flex; transform: none; }\n @starting-style { :host([open]) .nk-sidebar { transform: translateX(-100%); } }\n .nk-sidebar-backdrop {\n opacity: 0;\n transition: opacity .24s ease, display .24s;\n transition-behavior: allow-discrete;\n }\n :host([open]) .nk-sidebar-backdrop { display: block; opacity: 1; }\n @starting-style { :host([open]) .nk-sidebar-backdrop { opacity: 0; } }\n }\n @media (prefers-reduced-motion: reduce) { .nk-sidebar, .nk-sidebar-backdrop { transition: none; } }\n");class H extends p{static get hostStyles(){return W}static get observedAttributes(){return["open"]}render(){this._backdrop=this.createElement("div",["nk-sidebar-backdrop"]),this._aside=this.createElement("aside",["nk-sidebar"]),this._aside.appendChild(this.createElement("slot",[],{name:"workspace"}));const t=this.createElement("div",["nk-sidebar-scroll"]);t.appendChild(document.createElement("slot")),this._aside.appendChild(t),this._footer=this.createElement("div",["nk-sidebar-footer"]),this._footerSlot=this.createElement("slot",[],{name:"footer"}),this._footer.appendChild(this._footerSlot),this._aside.appendChild(this._footer),this._wrapper.appendChild(this._backdrop),this._wrapper.appendChild(this._aside),this._syncFooter()}_syncFooter(){const t=this._footerSlot.assignedElements();this._footer.style.display=t.length?"":"none";for(const e of t)"nk-tree-item"===e.localName&&e.setAttribute("compact","")}setupEvents(){this._onSlot=()=>this._syncFooter(),this._onBackdrop=()=>this.close(),this._onKey=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&this.close()},this._footerSlot.addEventListener("slotchange",this._onSlot),this._backdrop.addEventListener("click",this._onBackdrop),document.addEventListener("keydown",this._onKey)}teardownEvents(){this._footerSlot?.removeEventListener("slotchange",this._onSlot),this._backdrop?.removeEventListener("click",this._onBackdrop),document.removeEventListener("keydown",this._onKey)}onAttributeChanged(t){"open"===t&&this.emit("nk-toggle",{open:this.getBoolAttr("open")})}show(){this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}}customElements.define("nk-sidebar",H);const G=new CSSStyleSheet;G.replaceSync("\n .nk-ws-anchor { position: relative; }\n .nk-ws-menu { display: none; position: absolute; left: 8px; top: calc(100% - 2px); z-index: 50; }\n :host([open]) .nk-ws-menu { display: block; }\n");class Q extends p{static get hostStyles(){return G}static get observedAttributes(){return["name","avatar","open"]}render(){this._row=this.createElement("div",["nk-workspace"],{role:"button",tabindex:"0","aria-haspopup":"menu"}),this._avatar=this.createElement("div",["avatar"]);const t=this.createElement("slot",[],{name:"avatar"});t.appendChild(this._avatar),this._name=document.createElement("span");const e=this.createElement("span",["chev"]);e.textContent="โ",this._row.append(t,this._name,e),this._menu=this.createElement("div",["nk-ws-menu"]),this._menu.appendChild(this.createElement("slot",[],{name:"menu"}));const n=this.createElement("div",["nk-ws-anchor"]);n.append(this._row,this._menu),this._wrapper.appendChild(n),this._sync()}_sync(){const t=this.getAttribute("name")||"";this._name.textContent=t,this._avatar.textContent=this.getAttribute("avatar")||t.trim().charAt(0).toUpperCase(),this._row.setAttribute("aria-expanded",this.getBoolAttr("open")?"true":"false")}setupEvents(){this._onClick=()=>this.toggle(),this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.toggle())},this._onDocClick=t=>{this.getBoolAttr("open")&&!t.composedPath().includes(this)&&this.close()},this._onDocKey=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&this.close()},this._onMenuSelect=()=>this.close(),this._row.addEventListener("click",this._onClick),this._row.addEventListener("keydown",this._onKey),this._menu.addEventListener("nk-select",this._onMenuSelect),document.addEventListener("click",this._onDocClick),document.addEventListener("keydown",this._onDocKey)}teardownEvents(){this._row?.removeEventListener("click",this._onClick),this._row?.removeEventListener("keydown",this._onKey),this._menu?.removeEventListener("nk-select",this._onMenuSelect),document.removeEventListener("click",this._onDocClick),document.removeEventListener("keydown",this._onDocKey)}onAttributeChanged(t){this._sync(),"open"===t&&this.emit("nk-toggle",{open:this.getBoolAttr("open")})}show(){this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}}customElements.define("nk-workspace-switcher",Q);class X extends p{static get observedAttributes(){return["label","addable"]}render(){this._box=this.createElement("div",["nk-section-label"]),this._text=document.createElement("span"),this._text.appendChild(document.createElement("slot")),this._plus=this.createElement("span",["plus"],{role:"button",title:"+"}),this._plus.textContent="๏ผ",this._box.append(this._text,this._plus),this._wrapper.appendChild(this._box),this._sync()}_sync(){const t=this.getAttribute("label");null!==t&&(this._text.textContent=t),this._plus.style.display=this.getBoolAttr("addable")?"":"none"}setupEvents(){this._onPlus=t=>{t.stopPropagation(),this.emit("nk-action",{action:"add"})},this._plus.addEventListener("click",this._onPlus)}teardownEvents(){this._plus?.removeEventListener("click",this._onPlus)}onAttributeChanged(){this._sync()}get addable(){return this.getBoolAttr("addable")}set addable(t){this.setBoolAttr("addable",t)}}customElements.define("nk-section-label",X);const Y=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]);class Z extends p{static get observedAttributes(){return["manual"]}render(){const t=this.createElement("div",[],{role:"tree"});t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this._box=t}setActive(t){if(!this.getBoolAttr("manual")){for(const e of this.querySelectorAll("nk-tree-item[active]"))e!==t&&e.removeAttribute("active");t.setAttribute("active",""),this._syncTabIndex(t)}}setupEvents(){this._onKey=t=>{if(!Y.has(t.key)||t.ctrlKey||t.metaKey||t.altKey)return;const e=t.target.closest?.("nk-tree-item");if(!e)return;const n=this.visibleItems(),i=n.indexOf(e);if(i<0)return;let s=null;switch(t.key){case"ArrowDown":s=n[i+1];break;case"ArrowUp":s=n[i-1];break;case"Home":s=n[0];break;case"End":s=n[n.length-1];break;case"ArrowRight":e.hasChildren&&!e.open?e.open=!0:e.hasChildren&&(s=e.querySelector("nk-tree-item"));break;case"ArrowLeft":e.hasChildren&&e.open?e.open=!1:s=e.parentElement?.closest("nk-tree-item")}t.preventDefault(),s&&(this._syncTabIndex(s),s.focus())},this._onSlot=()=>this._syncTabIndex(),this.addEventListener("keydown",this._onKey),this._box.querySelector("slot").addEventListener("slotchange",this._onSlot),this._syncTabIndex()}teardownEvents(){this.removeEventListener("keydown",this._onKey),this._box?.querySelector("slot").removeEventListener("slotchange",this._onSlot)}visibleItems(){return[...this.querySelectorAll("nk-tree-item")].filter(t=>{for(let e=t.parentElement?.closest("nk-tree-item");e&&this.contains(e);e=e.parentElement?.closest("nk-tree-item"))if(!e.open)return!1;return!0})}requestSync(){this._syncQueued||(this._syncQueued=!0,queueMicrotask(()=>{this._syncQueued=!1,this._syncTabIndex()}))}_syncTabIndex(t){const e=[...this.querySelectorAll("nk-tree-item")];if(!e.length)return;const n=this.visibleItems(),i=t||n.find(t=>t.active)||n[0];for(const t of e)t.setTabbable?.(t===i)}set data(t){this._data=t;const e=t=>t.map(t=>{const n=document.createElement("nk-tree-item");return t.icon&&n.setAttribute("icon",t.icon),null!=t.value&&n.setAttribute("value",t.value),t.href&&n.setAttribute("href",t.href),t.open&&n.setAttribute("open",""),t.active&&n.setAttribute("active",""),n.append(document.createTextNode(t.label??""),...e(t.children||[])),n});for(const t of this.querySelectorAll(":scope > nk-tree-item"))t.remove();this.append(...e(t||[]))}get data(){return this._data}get activeItem(){return this.querySelector("nk-tree-item[active]")}get value(){return this.activeItem?.value??null}}customElements.define("nk-tree",Z);class J extends p{static get slotAssignment(){return"manual"}static get observedAttributes(){return["label","icon","value","href","active","open","compact","no-actions"]}render(){this._row=this.createElement("div",["nk-tree-item"],{role:"treeitem",tabindex:"-1"}),this._arrow=this.createElement("span",["nk-toggle-arrow"],{"aria-hidden":"true"}),this._arrow.textContent="โธ",this._iconSlot=this.createElement("slot",[],{name:"icon"}),this._icon=this.createElement("span",["icon"]),this._iconSlot.appendChild(this._icon),this._label=this.createElement("span",["label"]),this._labelSlot=this.createElement("slot",[],{name:"label"}),this._labelText=document.createTextNode(""),this._labelSlot.appendChild(this._labelText),this._label.appendChild(this._labelSlot),this._actions=this.createElement("span",["actions"]);for(const[t,e,n]of[["add","๏ผ","Add"],["more","โฏ","More"]]){const i=this.createElement("span",[],{"data-action":t,role:"button",title:n});i.textContent=e,this._actions.appendChild(i)}this._endSlot=this.createElement("slot",[],{name:"end"}),this._row.append(this._arrow,this._iconSlot,this._label,this._actions,this._endSlot),this._children=this.createElement("div",["nk-tree-children"],{role:"group"}),this._childSlot=this.createElement("slot",[],{name:"children"}),this._children.appendChild(this._childSlot),this._wrapper.append(this._row,this._children),this._sync(),this.closest("nk-tree")?.requestSync?.()}assignSlots(){if(!this._row)return;const t=[],e=[],n=[],i=[];for(const s of this.childNodes)if(s.nodeType===Node.ELEMENT_NODE){const r=s.getAttribute("slot");"icon"===r?t.push(s):"end"===r?e.push(s):"nk-tree-item"===s.localName?n.push(s):i.push(s)}else s.nodeType===Node.TEXT_NODE&&s.data.trim()&&i.push(s);this._iconSlot.assign(...t),this._endSlot.assign(...e),this._childSlot.assign(...n),this._labelSlot.assign(...this.hasAttribute("label")?[]:i),this._hasChildren=n.length>0,this._hasEnd=e.length>0,this._sync()}_sync(){const t=this.getBoolAttr("active"),e=this.getBoolAttr("open");this._row.classList.toggle("active",t),this._row.classList.toggle("compact",this.getBoolAttr("compact")),this._row.setAttribute("aria-selected",t?"true":"false"),this._arrow.classList.toggle("open",e),this._arrow.style.display=this._hasChildren?"":"none",this._hasChildren?this._row.setAttribute("aria-expanded",e?"true":"false"):this._row.removeAttribute("aria-expanded"),this._children.classList.toggle("collapsed",!e||!this._hasChildren),this._icon.textContent=this.getAttribute("icon")||"",this._icon.style.display=this.getAttribute("icon")?"":"none",this._labelText.data=this.getAttribute("label")||"";const n=!this.getBoolAttr("no-actions")&&!this._hasEnd;n&&!this._actions.isConnected&&this._row.insertBefore(this._actions,this._endSlot),!n&&this._actions.isConnected&&this._actions.remove();const i=this.getAttribute("href");i?this._row.setAttribute("data-href",i):this._row.removeAttribute("data-href")}setupEvents(){this._onRowClick=t=>{const e=t.target.closest?.("[data-action]");return e?(t.stopPropagation(),void this.emit("nk-action",{action:e.dataset.action,value:this.value,label:this.label})):t.target===this._arrow||this._arrow.contains(t.target)?(t.stopPropagation(),void this.toggle()):void this.select()},this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.select())},this._row.addEventListener("click",this._onRowClick),this._row.addEventListener("keydown",this._onKey)}teardownEvents(){this._row?.removeEventListener("click",this._onRowClick),this._row?.removeEventListener("keydown",this._onKey)}onAttributeChanged(t){"label"===t?this.assignSlots():this._sync(),"open"===t&&this.emit("nk-toggle",{open:this.getBoolAttr("open"),value:this.value})}select(){if(!this.emit("nk-select",{value:this.value,label:this.label,href:this.getAttribute("href"),item:this}))return;const t=this.closest("nk-tree");t?t.setActive(this):this.setBoolAttr("active",!0),this.getAttribute("href")&&location.assign(this.getAttribute("href"))}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}focus(t){this._row?.focus(t)}setTabbable(t){this._row&&(this._row.tabIndex=t?0:-1)}get tabbable(){return 0===this._row?.tabIndex}get hasChildren(){return!!this._hasChildren}get label(){return this.getAttribute("label")??this._labelSlot?.assignedNodes().map(t=>t.textContent).join("").trim()??""}set label(t){this.setAttribute("label",t)}get value(){return this.getAttribute("value")??this.label}set value(t){this.setAttribute("value",t)}get icon(){return this.getAttribute("icon")}set icon(t){null==t?this.removeAttribute("icon"):this.setAttribute("icon",t)}get active(){return this.getBoolAttr("active")}set active(t){this.setBoolAttr("active",t)}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get compact(){return this.getBoolAttr("compact")}set compact(t){this.setBoolAttr("compact",t)}}customElements.define("nk-tree-item",J);class tt extends p{render(){const t=this.createElement("div",["nk-topbar"]);t.appendChild(document.createElement("slot"));const e=this.createElement("div",["nk-topbar-actions"]);e.appendChild(this.createElement("slot",[],{name:"actions"})),t.appendChild(e),this._wrapper.appendChild(t)}}customElements.define("nk-topbar",tt);class et extends p{static get observedAttributes(){return["separator"]}static get observesLightDom(){return!0}render(){this._nav=this.createElement("nav",["nk-breadcrumb"],{"aria-label":"Breadcrumb"}),this._wrapper.appendChild(this._nav),this.projectLightDom()}projectLightDom(){if(!this._nav)return;const t=[...this.children],e=this.getAttribute("separator")??"/",n=t.map(t=>t.outerHTML).join("")+e;if(n===this._signature)return;this._signature=n,this._nav.innerHTML="";const i=t.some(t=>t.hasAttribute("current")||t.classList.contains("current"));t.forEach((n,s)=>{if(s>0){const t=this.createElement("span",["sep"],{"aria-hidden":"true"});t.textContent=e,this._nav.appendChild(t)}const r=n.cloneNode(!0);r.removeAttribute("slot"),r.classList.add("crumb");const o=i?n.hasAttribute("current")||n.classList.contains("current"):s===t.length-1;r.classList.toggle("current",o),o&&r.setAttribute("aria-current","page"),r.dataset.index=s,this._nav.appendChild(r)})}setupEvents(){this._onClick=t=>{const e=t.target.closest(".crumb");if(!e)return;t.preventDefault();const n=Number(e.dataset.index),i=this.children[n];this.emit("nk-select",{index:n,label:e.textContent.trim(),href:i?.getAttribute("href")??null,value:i?.dataset.value??i?.getAttribute("href")??e.textContent.trim(),current:e.classList.contains("current")})&&i?.click()},this._nav.addEventListener("click",this._onClick)}teardownEvents(){this._nav?.removeEventListener("click",this._onClick)}onAttributeChanged(){this.projectLightDom()}get separator(){return this.getAttribute("separator")??"/"}set separator(t){this.setAttribute("separator",t)}}customElements.define("nk-breadcrumb",et);class nt extends p{static get observedAttributes(){return["storage-key","title"]}render(){this._btn=this.createElement("button",["nk-topbar-btn","nk-theme-toggle"],{type:"button"}),this._btn.title=this.getAttribute("title")||"Toggle light / dark",this._wrapper.appendChild(this._btn);const t=document.documentElement;let e=null;try{e=localStorage.getItem(this.storageKey)}catch{}"light"===e||"dark"===e?t.setAttribute("data-theme",e):t.hasAttribute("data-theme")||t.setAttribute("data-theme",matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),this._syncGlyph()}_syncGlyph(){this._btn&&(this._btn.textContent="dark"===h()?"โ๏ธ":"๐")}_syncTheme(t){super._syncTheme(t),this._syncGlyph()}setupEvents(){this._onClick=()=>this.apply("dark"===h()?"light":"dark"),this._onMessage=t=>{const e=t.data?.nkTheme;"light"!==e&&"dark"!==e||this.apply(e)},this._btn.addEventListener("click",this._onClick),window.addEventListener("message",this._onMessage)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick),window.removeEventListener("message",this._onMessage)}onAttributeChanged(t){"title"===t&&this._btn&&(this._btn.title=this.getAttribute("title")||"Toggle light / dark")}apply(t){document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem(this.storageKey,t)}catch{}this._syncGlyph(),this.emit("nk-change",{value:t})}get storageKey(){return this.getAttribute("storage-key")||"nk-theme"}get value(){return h()}set value(t){this.apply(t)}}customElements.define("nk-theme-toggle",nt);class it extends p{static get observedAttributes(){return["value","always","fixed","floating","label"]}render(){this._bar=this.createElement("nav",["nk-tab-bar"]),this._slot=document.createElement("slot"),this._bar.appendChild(this._slot),this._spacer=this.createElement("div",["nk-tab-bar-spacer"]),this._wrapper.append(this._bar,this._spacer),this._syncBar(),this._sync()}get items(){return[...this.querySelectorAll(":scope > nk-tab-bar-item")]}_valueOf(t){return t.getAttribute("value")??t.getAttribute("label")??t.textContent.trim()}_syncBar(){this._bar.classList.toggle("always",this.getBoolAttr("always")),this._bar.classList.toggle("fixed",this.getBoolAttr("fixed")),this._bar.classList.toggle("floating",this.getBoolAttr("floating"));const t=this.getAttribute("label");t?this._bar.setAttribute("aria-label",t):this._bar.removeAttribute("aria-label")}_sync(){const t=this.items.filter(t=>!t.hasAttribute("drawer"));if(!t.length)return;let e=this.getAttribute("value");if(null===e||!t.some(t=>this._valueOf(t)===e)){const n=t.find(t=>t.hasAttribute("active"))||t[0];e=this._valueOf(n)}for(const n of t)this._valueOf(n)===e?n.setAttribute("active",""):n.removeAttribute("active");this._value=e}setupEvents(){this._onSlot=()=>this._sync(),this._slot.addEventListener("slotchange",this._onSlot),this._sync()}teardownEvents(){this._slot?.removeEventListener("slotchange",this._onSlot)}onAttributeChanged(t){if("value"!==t)return void this._syncBar();const e=this._value;this._sync(),this._value!==e&&this.emit("nk-change",{value:this._value})}get value(){return this._value??this.getAttribute("value")}set value(t){this.setAttribute("value",t)}get always(){return this.getBoolAttr("always")}set always(t){this.setBoolAttr("always",t)}get fixed(){return this.getBoolAttr("fixed")}set fixed(t){this.setBoolAttr("fixed",t)}get floating(){return this.getBoolAttr("floating")}set floating(t){this.setBoolAttr("floating",t)}}customElements.define("nk-tab-bar",it);class st extends p{static get observedAttributes(){return["icon","label","value","href","active","disabled","drawer"]}render(){this._btn=this.createElement("button",["nk-tab-bar-item"],{type:"button"}),this._iconSlot=this.createElement("slot",[],{name:"icon"}),this._icon=this.createElement("span",["icon"],{"aria-hidden":"true"}),this._iconSlot.appendChild(this._icon),this._label=this.createElement("span",["label"]),this._labelSlot=document.createElement("slot"),this._labelText=document.createTextNode(""),this._labelSlot.appendChild(this._labelText),this._label.appendChild(this._labelSlot),this._btn.append(this._iconSlot,this._label),this._wrapper.appendChild(this._btn),this._sync()}_sync(){this._icon.textContent=this.getAttribute("icon")??"",this._labelText.data=this.getAttribute("label")??"";const t=this.getBoolAttr("active");this._btn.classList.toggle("active",t),t?this._btn.setAttribute("aria-current","page"):this._btn.removeAttribute("aria-current"),this._btn.disabled=this.getBoolAttr("disabled");const e=this.getAttribute("href");e?this._btn.setAttribute("data-href",e):this._btn.removeAttribute("data-href")}setupEvents(){this._onClick=()=>this.select(),this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}select(){if(this.getBoolAttr("disabled"))return;const t=this.getAttribute("href");if(!this.emit("nk-select",{value:this.value,label:this.label,href:t,item:this,drawer:this.getBoolAttr("drawer")}))return;if(this.getBoolAttr("drawer")){const t=this.closest("nk-app")?.querySelector("nk-sidebar")??document.querySelector("nk-sidebar");return void t?.toggle?.()}const e=this.closest("nk-tab-bar");e?e.value=this.value:this.setBoolAttr("active",!0),t&&location.assign(t)}onAttributeChanged(){this._sync()}focus(t){this._btn?.focus(t)}get value(){return this.getAttribute("value")??this.label}set value(t){this.setAttribute("value",t)}get label(){return this.getAttribute("label")??this.textContent.trim()}set label(t){this.setAttribute("label",t)}get active(){return this.getBoolAttr("active")}set active(t){this.setBoolAttr("active",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get drawer(){return this.getBoolAttr("drawer")}set drawer(t){this.setBoolAttr("drawer",t)}}customElements.define("nk-tab-bar-item",st);class rt extends p{static get observedAttributes(){return["icon","cover","narrow"]}render(){this._page=this.createElement("div",["nk-page"]),this._icon=this.createElement("div",["nk-page-icon"],{role:"button",title:"Change icon"});const t=this.createElement("slot",[],{name:"icon"});t.appendChild(this._icon),this._page.appendChild(t),this._page.appendChild(document.createElement("slot")),this._cover=this.createElement("div",["nk-cover"]),this._coverSlot=this.createElement("slot",[],{name:"cover"}),this._coverSlot.appendChild(this._cover),this._build()}_build(){if(this._wrapper.replaceChildren(),this.getBoolAttr("narrow"))this._wrapper.append(this._coverSlot,this._page);else{const t=this.createElement("div",["nk-page-scroll"]);t.append(this._coverSlot,this._page),this._wrapper.appendChild(t)}this._sync()}_sync(){const t=this.getAttribute("icon");this._icon.textContent=t||"",this._icon.style.display=t?"":"none",this._cover.style.display=this.getBoolAttr("cover")?"":"none";const e=this._coverSlot.assignedNodes().some(t=>t.nodeType===Node.ELEMENT_NODE||t.data.trim());this._page.classList.toggle("covered",this.getBoolAttr("cover")||e)}setupEvents(){this._onIcon=()=>this.emit("nk-action",{action:"icon",value:this.getAttribute("icon")}),this._onCover=()=>this._sync(),this._icon.addEventListener("click",this._onIcon),this._coverSlot.addEventListener("slotchange",this._onCover),this._sync()}teardownEvents(){this._icon?.removeEventListener("click",this._onIcon),this._coverSlot?.removeEventListener("slotchange",this._onCover)}onAttributeChanged(t){"narrow"===t?this._build():this._sync()}get icon(){return this.getAttribute("icon")}set icon(t){null==t?this.removeAttribute("icon"):this.setAttribute("icon",t)}get cover(){return this.getBoolAttr("cover")}set cover(t){this.setBoolAttr("cover",t)}}customElements.define("nk-page",rt);class ot extends p{static get observedAttributes(){return["src"]}render(){this._cover=this.createElement("div",["nk-cover"]),this._wrapper.appendChild(this._cover),this._sync()}_sync(){const t=this.getAttribute("src");t?(this._cover.style.backgroundImage=`url("${t}")`,this._cover.style.backgroundSize="cover",this._cover.style.backgroundPosition="center"):(this._cover.style.backgroundImage="",this._cover.style.backgroundSize="",this._cover.style.backgroundPosition="")}onAttributeChanged(){this._sync()}get src(){return this.getAttribute("src")}set src(t){null==t?this.removeAttribute("src"):this.setAttribute("src",t)}}customElements.define("nk-page-cover",ot);class at extends p{static get observedAttributes(){return["editable","placeholder","value"]}static get observesLightDom(){return!0}render(){this._h1=this.createElement("h1",["nk-page-title"]),this._slot=document.createElement("slot"),this._h1.appendChild(this._slot),this._wrapper.appendChild(this._h1),this._sync()}_sync(){if(this.getBoolAttr("editable")){this._slot.isConnected&&this._slot.remove(),this._h1.setAttribute("contenteditable","plaintext-only"),this._h1.setAttribute("spellcheck","false"),this._h1.setAttribute("role","textbox"),this._h1.setAttribute("aria-label","Title");const t=this.getAttribute("value")??this.textContent.trim();this._h1.textContent!==t&&document.activeElement!==this&&(this._h1.textContent=t),this._h1.setAttribute("data-placeholder",this.getAttribute("placeholder")||"")}else this._h1.removeAttribute("contenteditable"),this._h1.removeAttribute("role"),this.hasAttribute("value")?(this._slot.isConnected&&this._slot.remove(),this._h1.textContent=this.getAttribute("value")):this._slot.isConnected||(this._h1.textContent="",this._h1.appendChild(this._slot))}projectLightDom(){this._h1&&!this.hasAttribute("value")&&this._sync()}setupEvents(){this._committed=this.value,this._onKey=t=>{"Enter"===t.key&&(t.preventDefault(),this._h1.blur())},this._onBlur=()=>this._commit(),this._h1.addEventListener("keydown",this._onKey),this._h1.addEventListener("blur",this._onBlur)}teardownEvents(){this._h1?.removeEventListener("keydown",this._onKey),this._h1?.removeEventListener("blur",this._onBlur)}_commit(){const t=this._h1.textContent.trim();t!==this._committed&&(this._committed=t,this.emit("nk-change",{value:t}))}onAttributeChanged(){this._sync()}get value(){return this.getBoolAttr("editable")?this._h1?.textContent.trim()??"":this.getAttribute("value")??this.textContent.trim()}set value(t){this.setAttribute("value",t)}get editable(){return this.getBoolAttr("editable")}set editable(t){this.setBoolAttr("editable",t)}focus(t){this._h1?.focus(t)}}customElements.define("nk-page-title",at);class lt extends p{render(){const t=this.createElement("div",["nk-page-meta"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-page-actions",lt);class ht extends p{static get observedAttributes(){return["handle","drop-target"]}render(){this._box=this.createElement("div",["nk-block-host"]),this._handle=this.createElement("span",["nk-block-handle"],{"aria-hidden":"true"}),this._handle.textContent="โ ฟ",this._box.appendChild(this._handle),this._box.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._box),this._sync()}_sync(){this._handle.style.display=this.getBoolAttr("handle")?"":"none",this._box.classList.toggle("nk-drop-target",this.getBoolAttr("drop-target"))}onAttributeChanged(){this._sync()}get handle(){return this.getBoolAttr("handle")}set handle(t){this.setBoolAttr("handle",t)}get dropTarget(){return this.getBoolAttr("drop-target")}set dropTarget(t){this.setBoolAttr("drop-target",t)}}customElements.define("nk-block-host",ht);const dt=["info","success","warning","danger"];class ct extends p{static get observedAttributes(){return["variant"]}render(){this._box=this.createElement("div",this._classes(),{role:"status"}),this._box.appendChild(document.createElement("slot")),this._box.appendChild(this.createElement("slot",[],{name:"action"})),this._wrapper.appendChild(this._box)}_classes(){const t=this.getAttribute("variant");return["nk-banner",...dt.includes(t)?[t]:[]]}onAttributeChanged(){this._box&&(this._box.className=this._classes().join(" "))}get variant(){return this.getAttribute("variant")}set variant(t){t?this.setAttribute("variant",t):this.removeAttribute("variant")}}customElements.define("nk-banner",ct);class pt extends p{static get observedAttributes(){return["icon","title","desc"]}render(){const t=this.createElement("div",["nk-empty"]);this._parts={};for(const[e,n]of[["icon","e-icon"],["title","e-title"],["desc","e-desc"]]){const i=this.createElement("div",[n]),s=this.createElement("slot",[],{name:e});s.appendChild(i),t.appendChild(s),this._parts[e]=i}t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this._sync()}_sync(){for(const[t,e]of Object.entries(this._parts)){const n=this.getAttribute(t);e.textContent=n||"",e.style.display=n?"":"none"}}onAttributeChanged(){this._sync()}}customElements.define("nk-empty",pt);class ut extends p{static get observedAttributes(){return["lines","height","width","widths"]}render(){this._build()}_build(){this._wrapper.replaceChildren();const t=Math.max(1,Number(this.getAttribute("lines"))||1),e=this.getAttribute("height")||"13",n=(this.getAttribute("widths")||"").split(",").map(t=>t.trim()).filter(Boolean),i=this.getAttribute("width");for(let s=0;s<t;s++){const t=this.createElement("div",["nk-skeleton"],{"aria-hidden":"true"});t.style.height=/^\d+(\.\d+)?$/.test(e)?`${e}px`:e;const r=n[s]??i;r&&(t.style.width=r),this._wrapper.appendChild(t)}}onAttributeChanged(){this._build()}}customElements.define("nk-skeleton",ut);class bt extends p{static get observedAttributes(){return["badge"]}render(){const t=this.createElement("div",["nk-synced"]);this._badge=this.createElement("span",["synced-badge"]),t.appendChild(this._badge),t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this._sync()}_sync(){this._badge.textContent=this.getAttribute("badge")??"โณ synced"}onAttributeChanged(){this._sync()}get badge(){return this.getAttribute("badge")}set badge(t){this.setAttribute("badge",t)}}customElements.define("nk-synced",bt);const gt={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};class mt extends p{static get observedAttributes(){return["value"]}render(){this._strip=this.createElement("div",["nk-tabs"],{role:"tablist"}),this._tabSlot=document.createElement("slot"),this._strip.appendChild(this._tabSlot),this._panelSlot=this.createElement("slot",[],{name:"panel"}),this._wrapper.append(this._strip,this._panelSlot),this._sync()}get tabs(){return[...this.querySelectorAll(":scope > nk-tab")]}get panels(){return[...this.querySelectorAll(':scope > [slot="panel"]')]}_sync(){const t=this.tabs;if(!t.length)return;let e=this.getAttribute("value");if(null===e||!t.some(t=>t.getAttribute("value")===e||null===t.getAttribute("value")&&t.textContent.trim()===e)){const n=t.find(t=>t.hasAttribute("active"))||t[0];e=n.getAttribute("value")??n.textContent.trim()}for(const n of t){(n.getAttribute("value")??n.textContent.trim())===e?n.setAttribute("active",""):n.removeAttribute("active")}for(const t of this.panels)t.hidden=t.dataset.tab!==e;this._value=e}setupEvents(){this._onSlot=()=>this._sync(),this._onKey=t=>{const e=gt[t.key];if(!e)return;const n=this.tabs.filter(t=>!t.hasAttribute("disabled")),i=n.indexOf(t.target.closest?.("nk-tab"));if(i<0||n.length<2)return;t.preventDefault();const s=n[(i+e+n.length)%n.length];s.select(),s.focus()},this._tabSlot.addEventListener("slotchange",this._onSlot),this._panelSlot.addEventListener("slotchange",this._onSlot),this.addEventListener("keydown",this._onKey),this._sync()}teardownEvents(){this._tabSlot?.removeEventListener("slotchange",this._onSlot),this._panelSlot?.removeEventListener("slotchange",this._onSlot),this.removeEventListener("keydown",this._onKey)}onAttributeChanged(){const t=this._value;this._sync(),this._value!==t&&this.emit("nk-change",{value:this._value})}get value(){return this._value??this.getAttribute("value")}set value(t){this.setAttribute("value",t)}}customElements.define("nk-tabs",mt);class kt extends p{static get observedAttributes(){return["active","value","disabled"]}render(){this._tab=this.createElement("span",["nk-tab"],{role:"tab"}),this._tab.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._tab),this._sync()}_sync(){const t=this.getBoolAttr("active");this._tab.classList.toggle("active",t),this._tab.setAttribute("aria-selected",t?"true":"false"),this._tab.tabIndex=t?0:-1,this._tab.setAttribute("aria-disabled",this.getBoolAttr("disabled")?"true":"false")}setupEvents(){this._onClick=()=>this.select(),this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.select())},this._tab.addEventListener("click",this._onClick),this._tab.addEventListener("keydown",this._onKey)}teardownEvents(){this._tab?.removeEventListener("click",this._onClick),this._tab?.removeEventListener("keydown",this._onKey)}select(){if(this.getBoolAttr("disabled"))return;if(!this.emit("nk-select",{value:this.value,label:this.textContent.trim(),item:this}))return;const t=this.closest("nk-tabs");t?t.value=this.value:this.setBoolAttr("active",!0)}onAttributeChanged(){this._sync()}focus(t){this._tab?.focus(t)}get value(){return this.getAttribute("value")??this.textContent.trim()}set value(t){this.setAttribute("value",t)}get active(){return this.getBoolAttr("active")}set active(t){this.setBoolAttr("active",t)}}customElements.define("nk-tab",kt);const _t={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};class vt extends u{static get observedAttributes(){return["value","name","disabled","scroll","wrap"]}render(){this._box=this.createElement("div",["nk-segmented"],{role:"radiogroup"}),this._slot=document.createElement("slot"),this._box.appendChild(this._slot),this._wrapper.appendChild(this._box),this._syncBox(),this._sync()}_syncBox(){this._box.classList.toggle("scroll",this.getBoolAttr("scroll")),this._box.classList.toggle("wrap",this.getBoolAttr("wrap"))}get buttons(){return this._slot?.assignedElements().filter(t=>"button"===t.localName)??[]}_valueOf(t){return t.getAttribute("value")??t.textContent.trim()}_sync(){const t=this.buttons;if(!t.length)return;let e=this.getAttribute("value");null!==e&&t.some(t=>this._valueOf(t)===e)||(e=this._valueOf(t.find(t=>t.classList.contains("active"))||t[0])),void 0===this._defaultValue&&(this._defaultValue=e);const n=this.getBoolAttr("disabled")||!!this._formDisabled;for(const i of t){const t=this._valueOf(i)===e;i.type="button",i.setAttribute("role","radio"),i.setAttribute("aria-checked",t?"true":"false"),i.classList.toggle("active",t),i.tabIndex=t?0:-1,i.disabled=n}this._value=e,this.setFormValue(e)}setupEvents(){this._onSlot=()=>this._sync(),this._onClick=t=>{const e=t.target.closest?.("button");e&&this.buttons.includes(e)&&!e.disabled&&this._choose(this._valueOf(e))},this._onKey=t=>{const e=_t[t.key];if(!e)return;const n=this.buttons,i=n.indexOf(t.target.closest?.("button"));if(i<0||n.length<2)return;t.preventDefault();const s=n[(i+e+n.length)%n.length];this._choose(this._valueOf(s)),s.focus()},this._slot.addEventListener("slotchange",this._onSlot),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKey),this._sync()}teardownEvents(){this._slot?.removeEventListener("slotchange",this._onSlot),this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKey)}_choose(t){t!==this._value&&(this._syncing=!0,this.setAttribute("value",t),this._syncing=!1,this._sync(),this.emit("nk-change",{value:t,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0})))}onAttributeChanged(t){"scroll"!==t&&"wrap"!==t?this._syncing||this._sync():this._syncBox()}resetValue(){void 0!==this._defaultValue&&this.setAttribute("value",this._defaultValue)}onFormDisabled(t){this._formDisabled=t,this._sync()}get value(){return this._value??this.getAttribute("value")}set value(t){this.setAttribute("value",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get scroll(){return this.getBoolAttr("scroll")}set scroll(t){this.setBoolAttr("scroll",t)}get wrap(){return this.getBoolAttr("wrap")}set wrap(t){this.setBoolAttr("wrap",t)}}customElements.define("nk-segmented",vt);class xt extends p{render(){const t=this.createElement("div",["nk-stats"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-stats",xt);class ft extends p{static get observedAttributes(){return["label","value","delta","trend"]}render(){const t=this.createElement("div",["nk-stat"]);this._parts={};for(const[e,n]of[["label","s-label"],["value","s-value"],["delta","s-delta"]]){const i=this.createElement("div",[n]),s=this.createElement("slot",[],{name:e});s.appendChild(i),t.appendChild(s),this._parts[e]=i}this._wrapper.appendChild(t),this._sync()}_sync(){for(const[t,e]of Object.entries(this._parts)){const n=this.getAttribute(t);e.textContent=n??"",e.style.display=null===n?"none":""}const t=this.getAttribute("trend");this._parts.delta.className="s-delta"+("up"===t||"down"===t?` ${t}`:"")}onAttributeChanged(){this._sync()}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}}customElements.define("nk-stat",ft);class yt extends p{static get observedAttributes(){return["more"]}render(){const t=this.createElement("div",["nk-avatar-group"]);t.appendChild(document.createElement("slot")),this._more=this.createElement("span",["mini-avatar","more"]),t.appendChild(this._more),this._wrapper.appendChild(t),this._sync()}_sync(){const t=this.getAttribute("more");this._more.textContent=t||"",this._more.style.display=t?"":"none"}onAttributeChanged(){this._sync()}get more(){return this.getAttribute("more")}set more(t){null==t?this.removeAttribute("more"):this.setAttribute("more",t)}}customElements.define("nk-avatar-group",yt);const wt=["person","page","date"];class At extends p{static get observedAttributes(){return["type"]}render(){this._box=this.createElement("span",this._classes()),this._box.appendChild(this.createElement("slot",[],{name:"avatar"})),this._box.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._box)}_classes(){const t=this.getAttribute("type");return["nk-mention",...wt.includes(t)?[t]:[]]}onAttributeChanged(){this._box&&(this._box.className=this._classes().join(" "))}get type(){return this.getAttribute("type")}set type(t){t?this.setAttribute("type",t):this.removeAttribute("type")}}customElements.define("nk-mention",At);class Et extends p{static get observedAttributes(){return["icon","value","disabled"]}render(){this._btn=this.createElement("button",["nk-template-btn"],{type:"button"});const t=document.createElement("span");this._icon=document.createElement("span"),this._space=document.createTextNode(" "),t.append(this._icon,this._space,document.createElement("slot")),this._btn.appendChild(t),this._wrapper.appendChild(this._btn),this._sync()}_sync(){const t=this.getAttribute("icon");this._icon.textContent=t||"",this._space.data=t?" ":"",this._btn.disabled=this.getBoolAttr("disabled")}setupEvents(){this._onClick=()=>this.emit("nk-select",{value:this.value,label:this.textContent.trim()}),this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}onAttributeChanged(){this._sync()}focus(t){this._btn?.focus(t)}get value(){return this.getAttribute("value")??this.textContent.trim()}set value(t){this.setAttribute("value",t)}}customElements.define("nk-template-btn",Et);class Ct extends u{static get observedAttributes(){return["name","value","title","desc","selected","disabled"]}render(){this._card=this.createElement("div",["nk-model-card"],{role:"radio",tabindex:"0"}),this._card.appendChild(this.createElement("div",["m-radio"]));const t=document.createElement("div");this._name=this.createElement("div",["m-name"]);const e=this.createElement("slot",[],{name:"title"});e.appendChild(this._name),this._desc=this.createElement("div",["m-desc"]);const n=this.createElement("slot",[],{name:"desc"});n.appendChild(this._desc),t.append(e,n),this._card.appendChild(t),this._wrapper.appendChild(this._card),this._defaultSelected=this.getBoolAttr("selected"),this._sync(),this.getBoolAttr("selected")&&this._unselectPeers()}_sync(){const t=this.getBoolAttr("selected");this._card.classList.toggle("selected",t),this._card.setAttribute("aria-checked",t?"true":"false"),this._card.setAttribute("aria-disabled",this.getBoolAttr("disabled")?"true":"false"),this._name.textContent=this.getAttribute("title")||"";const e=this.getAttribute("desc");this._desc.textContent=e||"",this._desc.style.display=e?"":"none",this.setFormValue(t?this.getAttribute("value")||"on":null,t?"selected":"unselected")}_group(){const t=this.getAttribute("name"),e=this.getRootNode();return t&&"function"==typeof e?.querySelectorAll?[...e.querySelectorAll("nk-model-card")].filter(e=>e.getAttribute("name")===t):[this]}_unselectPeers(){for(const t of this._group())t!==this&&t.hasAttribute("selected")&&t.removeAttribute("selected")}setupEvents(){this._onClick=()=>this.select(),this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.select())},this._card.addEventListener("click",this._onClick),this._card.addEventListener("keydown",this._onKey)}teardownEvents(){this._card?.removeEventListener("click",this._onClick),this._card?.removeEventListener("keydown",this._onKey)}select(){this.getBoolAttr("disabled")||this.getBoolAttr("selected")||(this.setBoolAttr("selected",!0),this.emit("nk-change",{value:this.value,name:this.name,checked:!0}),this.emit("nk-select",{value:this.value,label:this.getAttribute("title")}),this.dispatchEvent(new Event("change",{bubbles:!0})))}onAttributeChanged(t){this._sync(),"selected"===t&&this.getBoolAttr("selected")&&this._unselectPeers()}resetValue(){this.setBoolAttr("selected",this._defaultSelected)}focus(t){this._card?.focus(t)}get selected(){return this.getBoolAttr("selected")}set selected(t){this.setBoolAttr("selected",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}}customElements.define("nk-model-card",Ct);class Lt extends p{static get observedAttributes(){return["avatar"]}render(){const t=this.createElement("div",["nk-profile-row"]);this._avatar=this.createElement("div",["big-avatar"]);const e=this.createElement("slot",[],{name:"avatar"});e.appendChild(this._avatar),t.appendChild(e),t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this._sync()}_sync(){this._avatar.textContent=this.getAttribute("avatar")||""}onAttributeChanged(){this._sync()}}customElements.define("nk-profile-row",Lt);class Bt extends p{static get observedAttributes(){return["title"]}render(){const t=this.createElement("div",["nk-danger-zone"]);this._title=this.createElement("div",["dz-title"]),t.appendChild(this._title),t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this._sync()}_sync(){const t=this.getAttribute("title");this._title.textContent=t||"",this._title.style.display=t?"":"none"}onAttributeChanged(){this._sync()}}customElements.define("nk-danger-zone",Bt);class St extends p{render(){const t=this.createElement("div",["nk-member-list"]);this._slot=document.createElement("slot"),t.appendChild(this._slot),this._wrapper.appendChild(t),this._mark()}_mark(){const t=this._slot.assignedElements().filter(t=>"nk-member-row"===t.localName);t.forEach((e,n)=>{n===t.length-1?e.setAttribute("last",""):e.removeAttribute("last")})}setupEvents(){this._onSlot=()=>this._mark(),this._slot.addEventListener("slotchange",this._onSlot),this._mark()}teardownEvents(){this._slot?.removeEventListener("slotchange",this._onSlot)}}customElements.define("nk-member-list",St);class Nt extends p{static get observedAttributes(){return["name","mail","avatar","color","last"]}render(){this._row=this.createElement("div",["nk-member-row"]),this._avatar=this.createElement("span",["mini-avatar"]);const t=this.createElement("slot",[],{name:"avatar"});t.appendChild(this._avatar);const e=document.createElement("div");this._name=document.createTextNode(""),this._mail=this.createElement("div",["m-mail"]),e.append(this._name,this._mail);const n=document.createElement("div");n.style.marginLeft="auto",n.appendChild(this.createElement("slot",[],{name:"role"})),this._row.append(t,e,n,document.createElement("slot")),this._wrapper.appendChild(this._row),this._sync()}_sync(){this._name.data=this.getAttribute("name")||"";const t=this.getAttribute("mail");this._mail.textContent=t||"",this._mail.style.display=t?"":"none";const e=this.getAttribute("avatar");this._avatar.textContent=e||(this.getAttribute("name")||"").split(/\s+/).map(t=>t[0]).join("").slice(0,2).toUpperCase(),this._avatar.style.background=this.getAttribute("color")||"var(--nk-text-tertiary)",this._row.classList.toggle("last",this.getBoolAttr("last"))}onAttributeChanged(){this._sync()}}customElements.define("nk-member-row",Nt);let zt=0,Dt="";function Vt(){0===zt++&&(Dt=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function Tt(){zt>0&&0===--zt&&(document.documentElement.style.overflow=Dt)}function Ft(t){const e=[];let n=t;for(;n&&n!==document.body;){const t=(n.parentNode,ShadowRoot,n.parentNode);if(!t)break;for(const i of t.children)i===n||i.inert||/^(SCRIPT|STYLE|LINK|TEMPLATE)$/.test(i.tagName)||(i.inert=!0,e.push(i));n=t instanceof ShadowRoot?t.host:t}return()=>{for(const t of e)t.inert=!1}}class Mt extends p{static get observedAttributes(){return["open","pane"]}render(){this._backdrop=this.createElement("div",["nk-modal-backdrop"]),this._backdrop.inert=!0,this._box=this.createElement("div",["nk-modal"],{role:"dialog","aria-modal":"true",tabindex:"-1"}),this._nav=this.createElement("nav",["nk-settings-nav"],{"aria-label":"Settings"}),this._nav.appendChild(this.createElement("slot",[],{name:"user"})),this._rows=document.createElement("div"),this._nav.appendChild(this._rows),this._nav.appendChild(this.createElement("slot",[],{name:"nav"})),this._content=this.createElement("div",["nk-settings-content"]),this._slot=document.createElement("slot"),this._content.appendChild(this._slot),this._box.append(this._nav,this._content),this._backdrop.appendChild(this._box),this._wrapper.appendChild(this._backdrop),this._syncOpen(),this.requestNav()}get panes(){return[...this.querySelectorAll(":scope > nk-settings-pane")]}requestNav(){this._navQueued||(this._navQueued=!0,queueMicrotask(()=>{this._navQueued=!1,this._buildNav()}))}_buildNav(){if(!this._rows)return;const t=this.panes.filter(t=>t.getAttribute("label"));this._rows.replaceChildren(),this._nav.style.display=t.length||this.querySelector(':scope > [slot="nav"], :scope > [slot="user"]')?"":"none";let e=null;for(const n of t){const t=n.getAttribute("group");if(t&&t!==e){const n=this.createElement("div",["nk-section-label"]);n.textContent=t,this._rows.appendChild(n),e=t}const i=this.createElement("div",["nk-tree-item"],{role:"tab",tabindex:"0","data-pane":n.name}),s=this.createElement("span",["icon"]);s.textContent=n.getAttribute("icon")||"";const r=this.createElement("span",["label"]);r.textContent=n.getAttribute("label"),i.append(s,r),this._rows.appendChild(i)}this._syncActive()}_syncActive(){const t=this.panes;let e=this.getAttribute("pane");t.some(t=>t.name===e)||(e=(t.find(t=>t.hasAttribute("active"))||t[0])?.name??null);for(const t of this._rows.querySelectorAll("[data-pane]")){const n=t.dataset.pane===e;t.classList.toggle("active",n),t.setAttribute("aria-selected",n?"true":"false")}for(const n of t)n.active=n.name===e;this._current=e}_syncOpen(){const t=this.getBoolAttr("open");if(this._backdrop.classList.toggle("open",t),this._backdrop.inert=!t,t!==this._wasOpen)if(this._wasOpen=t,t)this._returnFocus=document.activeElement,Vt(),this._undoInert=Ft(this),requestAnimationFrame(()=>{const t=this._rows.querySelector(".nk-tree-item.active")||function(t){const e=t=>{for(const n of t.querySelectorAll("*")){if(n.matches('a[href], button:not([disabled]), input:not([disabled]):not([type=hidden]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"], [contenteditable="plaintext-only"]')&&n.getClientRects().length)return n;if(n.shadowRoot){const t=e(n.shadowRoot);if(t)return t}}return null};return e(t)}(this)||this._box;t.focus({preventScroll:!0})});else{Tt(),this._undoInert?.(),this._undoInert=null;const t=this._returnFocus;t&&"function"==typeof t.focus&&t.isConnected&&t.focus({preventScroll:!0}),this._returnFocus=null}}setupEvents(){this._onBackdrop=t=>{t.target===this._backdrop&&this.close()},this._onKey=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&(t.stopPropagation(),this.close())},this._onNavClick=t=>{const e=t.target.closest("[data-pane]");e&&(e.focus(),this.pane=e.dataset.pane)},this._onNavKey=t=>{const e=t.target.closest?.("[data-pane]");if(!e)return;if("Enter"===t.key||" "===t.key)return t.preventDefault(),void(this.pane=e.dataset.pane);const n={ArrowDown:1,ArrowUp:-1}[t.key];if(!n)return;const i=[...this._rows.querySelectorAll("[data-pane]")],s=i[(i.indexOf(e)+n+i.length)%i.length];t.preventDefault(),s.focus(),this.pane=s.dataset.pane},this._onSlot=()=>this.requestNav(),this._backdrop.addEventListener("click",this._onBackdrop),document.addEventListener("keydown",this._onKey),this._rows.addEventListener("click",this._onNavClick),this._rows.addEventListener("keydown",this._onNavKey),this._slot.addEventListener("slotchange",this._onSlot)}teardownEvents(){this._backdrop?.removeEventListener("click",this._onBackdrop),document.removeEventListener("keydown",this._onKey),this._rows?.removeEventListener("click",this._onNavClick),this._rows?.removeEventListener("keydown",this._onNavKey),this._slot?.removeEventListener("slotchange",this._onSlot),this._wasOpen&&(Tt(),this._undoInert?.(),this._undoInert=null,this._wasOpen=!1)}onAttributeChanged(t){if("open"===t)this._syncOpen(),this.emit("nk-toggle",{open:this.getBoolAttr("open")});else if("pane"===t){const t=this._current;this._syncActive(),this._current!==t&&this.emit("nk-select",{value:this._current,label:this.panes.find(t=>t.name===this._current)?.getAttribute("label")??this._current})}}show(t){t&&this.setAttribute("pane",t),this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get pane(){return this._current??this.getAttribute("pane")}set pane(t){this.setAttribute("pane",t)}}customElements.define("nk-modal",Mt);class jt extends p{static get observedAttributes(){return["name","label","icon","group","title","active"]}render(){this._section=this.createElement("section",["nk-settings-pane"],{role:"tabpanel"}),this._h2=document.createElement("h2"),this._section.appendChild(this._h2),this._section.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._section),this._sync()}_sync(){const t=this.getAttribute("title");this._h2.textContent=t||"",this._h2.style.display=t?"":"none",this._section.classList.toggle("active",this.getBoolAttr("active")),this._section.setAttribute("aria-label",this.getAttribute("label")||t||this.getAttribute("name")||"")}onAttributeChanged(t){this._sync(),["label","icon","group","name"].includes(t)&&this.closest("nk-modal")?.requestNav?.()}get name(){return this.getAttribute("name")??this.getAttribute("label")??""}get active(){return this.getBoolAttr("active")}set active(t){this.setBoolAttr("active",t)}}customElements.define("nk-settings-pane",jt);class It extends p{static get observedAttributes(){return["name","mail","avatar"]}render(){const t=this.createElement("div",["nk-settings-user"]);this._avatar=this.createElement("div",["avatar"]);const e=this.createElement("slot",[],{name:"avatar"});e.appendChild(this._avatar);const n=this.createElement("div",["u-text"]);this._name=this.createElement("div",["name"]),this._mail=this.createElement("div",["mail"]),n.append(this._name,this._mail),t.append(e,n),this._wrapper.appendChild(t),this._sync()}_sync(){const t=this.getAttribute("name")||"";this._name.textContent=t;const e=this.getAttribute("mail");this._mail.textContent=e||"",this._mail.style.display=e?"":"none",this._avatar.textContent=this.getAttribute("avatar")||t.split(/\s+/).map(t=>t[0]).join("").slice(0,2).toUpperCase()}onAttributeChanged(){this._sync()}}function Kt(t,e){const n=t.trim().toLowerCase();if(!n)return 1;const i=e.toLowerCase();let s=0,r=0,o=0;for(let t=0;t<n.length;t++){const e=i.indexOf(n[t],s);if(e<0)return 0;o=e===s?o+1:0,r+=1+2*o+(0===e||/[\s\-_/.]/.test(i[e-1])?3:0)-Math.min(3,.25*(e-s)),s=e+1}return i.startsWith(n)&&(r+=10),Math.max(.01,r/(1+i.length/40))}customElements.define("nk-settings-user",It);class qt extends p{static get observedAttributes(){return["open","hotkey","placeholder"]}render(){this._backdrop=this.createElement("div",["nk-cmdk-backdrop"]),this._backdrop.inert=!0,this._box=this.createElement("div",["nk-cmdk"],{role:"dialog","aria-modal":"true","aria-label":"Command palette"});const t=this.createElement("div",["nk-cmdk-input-row"]),e=document.createElement("span");e.style.fontSize="15px",e.textContent="๐",this._input=this.createElement("input",[],{type:"text",autocomplete:"off",role:"combobox","aria-expanded":"true","aria-autocomplete":"list"});const n=this.createElement("kbd",["nk-kbd"]);n.textContent="esc",t.append(e,this._input,n),this._list=this.createElement("div",["nk-cmdk-list"],{role:"listbox",id:"list"}),this._input.setAttribute("aria-controls","list"),this._footer=this.createElement("div",["nk-cmdk-footer"]);const i=this.createElement("slot",[],{name:"footer"});i.innerHTML='<span><kbd class="nk-kbd">โ</kbd><kbd class="nk-kbd">โ</kbd> navigate</span><span><kbd class="nk-kbd">โต</kbd> open</span><span><kbd class="nk-kbd">โ</kbd><kbd class="nk-kbd">K</kbd> toggle</span>',this._footer.appendChild(i),this._box.append(t,this._list,this._footer),this._backdrop.appendChild(this._box),this._wrapper.appendChild(this._backdrop),this._commands=[],this._index=0,this._syncAttrs(),this._renderList(),this._syncOpen()}_syncAttrs(){this._input.placeholder=this.getAttribute("placeholder")||"Search or type a command โฆ"}results(){const t=this._input?.value??"",e=[];for(const n of this._commands){const i=(n.items||[]).map(e=>({item:e,group:n.group,score:Kt(t,`${e.label} ${e.keywords||""}`)})).filter(t=>t.score>0);i.sort((t,e)=>e.score-t.score),e.push(...i)}return e}_renderList(){if(!this._list)return;const t=this.results();if(this._index=Math.min(this._index,Math.max(0,t.length-1)),this._list.replaceChildren(),!t.length){const t=this.createElement("div",["nk-cmdk-empty"]);return t.textContent=`No results for โ${this._input.value}โ`,this._list.appendChild(t),void this._input.removeAttribute("aria-activedescendant")}let e=null;t.forEach((t,n)=>{if(t.group&&t.group!==e){const n=this.createElement("div",["nk-cmdk-group"]);n.textContent=t.group,this._list.appendChild(n),e=t.group}const i=this.createElement("div",["nk-cmdk-item"],{role:"option",id:`opt-${n}`,"data-index":n});i.classList.toggle("selected",n===this._index),i.setAttribute("aria-selected",n===this._index?"true":"false");const s=this.createElement("span",["m-icon"]);s.textContent=t.item.icon||"";const r=document.createElement("span");if(r.textContent=t.item.label,i.append(s,r),t.item.shortcut){const e=this.createElement("span",["m-shortcut"]);e.textContent=t.item.shortcut,i.appendChild(e)}this._list.appendChild(i)}),this._input.setAttribute("aria-activedescendant",`opt-${this._index}`)}_move(t){const e=this.results().length;if(e){this._index=(this._index+t+e)%e;for(const t of this._list.querySelectorAll(".nk-cmdk-item")){const e=Number(t.dataset.index)===this._index;t.classList.toggle("selected",e),t.setAttribute("aria-selected",e?"true":"false"),e&&t.scrollIntoView({block:"nearest"})}this._input.setAttribute("aria-activedescendant",`opt-${this._index}`)}}pick(t=this._index){const e=this.results()[t];if(!e)return;const n=this._input.value;this.close();this.emit("nk-command",{id:e.item.id??e.item.label,item:e.item,query:n})&&"function"==typeof e.item.action&&e.item.action(e.item)}_matchesHotkey(t){const e=(this.getAttribute("hotkey")||"mod+k").toLowerCase().split("+"),n=e.pop(),i=!e.includes("mod")||(t.metaKey||t.ctrlKey),s=e.includes("shift")?t.shiftKey:!t.shiftKey,r=e.includes("alt")?t.altKey:!t.altKey;return i&&s&&r&&t.key.toLowerCase()===n}_syncOpen(){const t=this.getBoolAttr("open");if(this._backdrop.classList.toggle("open",t),this._backdrop.inert=!t,t!==this._wasOpen)if(this._wasOpen=t,t)this._returnFocus=document.activeElement,this._input.value="",this._index=0,this._renderList(),Vt(),this._undoInert=Ft(this),requestAnimationFrame(()=>this._input.focus({preventScroll:!0}));else{Tt(),this._undoInert?.(),this._undoInert=null;const t=this._returnFocus;t&&"function"==typeof t.focus&&t.isConnected&&t.focus({preventScroll:!0}),this._returnFocus=null}}setupEvents(){this._onDocKey=t=>{if(this._matchesHotkey(t))return t.preventDefault(),void this.toggle();"Escape"===t.key&&this.getBoolAttr("open")&&(t.stopPropagation(),this.close())},this._onInput=()=>{this._index=0,this._renderList()},this._onInputKey=t=>{"ArrowDown"===t.key?(t.preventDefault(),this._move(1)):"ArrowUp"===t.key?(t.preventDefault(),this._move(-1)):"Enter"===t.key&&(t.preventDefault(),this.pick())},this._onListClick=t=>{const e=t.target.closest(".nk-cmdk-item");e&&this.pick(Number(e.dataset.index))},this._onListMove=t=>{const e=t.target.closest(".nk-cmdk-item");e&&Number(e.dataset.index)!==this._index&&(this._index=Number(e.dataset.index),this._move(0))},this._onListDown=t=>t.preventDefault(),this._onBackdrop=t=>{t.target===this._backdrop&&this.close()},document.addEventListener("keydown",this._onDocKey),this._input.addEventListener("input",this._onInput),this._input.addEventListener("keydown",this._onInputKey),this._list.addEventListener("click",this._onListClick),this._list.addEventListener("mousemove",this._onListMove),this._list.addEventListener("mousedown",this._onListDown),this._backdrop.addEventListener("click",this._onBackdrop)}teardownEvents(){document.removeEventListener("keydown",this._onDocKey),this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("keydown",this._onInputKey),this._list?.removeEventListener("click",this._onListClick),this._list?.removeEventListener("mousemove",this._onListMove),this._list?.removeEventListener("mousedown",this._onListDown),this._backdrop?.removeEventListener("click",this._onBackdrop),this._wasOpen&&(Tt(),this._undoInert?.(),this._undoInert=null,this._wasOpen=!1)}onAttributeChanged(t){"open"===t?(this._syncOpen(),this.emit("nk-toggle",{open:this.getBoolAttr("open")})):this._syncAttrs()}show(){this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get commands(){return this._commands}set commands(t){this._commands=Array.isArray(t)?t:[],this._index=0,this._renderList()}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get query(){return this._input?.value??""}set query(t){this._input&&(this._input.value=t,this._index=0,this._renderList())}}customElements.define("nk-cmdk",qt);class Ot extends p{render(){this._box=this.createElement("div",["nk-pop","nk-menu"],{role:"menu"}),this._box.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._box)}get items(){return[...this.querySelectorAll(":scope > nk-menu-item")].filter(t=>t.selectable)}setupEvents(){this._onKey=t=>{const e={ArrowDown:1,ArrowUp:-1}[t.key],n=t.target.closest?.("nk-menu-item"),i=this.items;if(i.length)if(e){t.preventDefault();const s=i.indexOf(n);i[(s+e+i.length)%i.length].focus()}else"Enter"!==t.key&&" "!==t.key||!n||(t.preventDefault(),n.select())},this.addEventListener("keydown",this._onKey)}teardownEvents(){this.removeEventListener("keydown",this._onKey)}focusFirst(){this.items[0]?.focus()}}customElements.define("nk-menu",Ot);class Pt extends p{static get observedAttributes(){return["icon","shortcut","danger","value","type","disabled"]}render(){this._build()}_build(){const t=this.getAttribute("type");let e;if("separator"===t)e=this.createElement("div",["nk-menu-sep"],{role:"separator"});else if("label"===t)e=this.createElement("div",["nk-menu-label"]),e.appendChild(document.createElement("slot"));else{e=this.createElement("div",["nk-menu-item"],{role:"menuitem",tabindex:"-1"}),this._icon=this.createElement("span",["m-icon"]);const t=this.createElement("slot",[],{name:"icon"});t.appendChild(this._icon),this._shortcut=this.createElement("span",["m-shortcut"]),e.append(t,document.createElement("slot"),this._shortcut)}this._el?(this._el.removeEventListener("click",this._onClick),this._el.replaceWith(e)):this._wrapper.appendChild(e),this._el=e,this._onClick&&e.addEventListener("click",this._onClick),this._sync()}_sync(){if(!this._el.classList.contains("nk-menu-item"))return;const t=this.getAttribute("icon");this._icon.textContent=t||"",this._icon.style.display=t?"":"none";const e=this.getAttribute("shortcut");this._shortcut.textContent=e||"",this._shortcut.style.display=e?"":"none",this._el.classList.toggle("danger",this.getBoolAttr("danger")),this._el.setAttribute("aria-disabled",this.getBoolAttr("disabled")?"true":"false")}setupEvents(){this._onClick=()=>this.select(),this._el.addEventListener("click",this._onClick)}teardownEvents(){this._el?.removeEventListener("click",this._onClick)}select(){this._el.classList.contains("nk-menu-item")&&!this.getBoolAttr("disabled")&&this.emit("nk-select",{value:this.value,label:this.textContent.trim(),item:this})}onAttributeChanged(t){"type"===t?this._build():this._sync()}focus(t){this._el?.focus(t)}get selectable(){return this._el?.classList.contains("nk-menu-item")&&!this.getBoolAttr("disabled")}get value(){return this.getAttribute("value")??this.textContent.trim()}set value(t){this.setAttribute("value",t)}}customElements.define("nk-menu-item",Pt);const $t=new CSSStyleSheet;$t.replaceSync('\n .nk-pop-anchor { position: relative; display: inline-block; }\n .nk-pop-float { display: none; position: absolute; z-index: 50; top: 100%; left: 0; margin-top: 4px; }\n :host([open]) .nk-pop-float { display: block; }\n :host([placement="bottom-end"]) .nk-pop-float { left: auto; right: 0; }\n :host([placement="top-start"]) .nk-pop-float { top: auto; bottom: 100%; margin: 0 0 4px; }\n :host([placement="top-end"]) .nk-pop-float { top: auto; bottom: 100%; left: auto; right: 0; margin: 0 0 4px; }\n');const Rt=new Set(["nk-menu","nk-emoji-picker"]);class Ut extends p{static get hostStyles(){return $t}static get observedAttributes(){return["open","placement","bare"]}render(){const t=this.createElement("div",["nk-pop-anchor"]);this._triggerSlot=this.createElement("slot",[],{name:"trigger"}),this._float=this.createElement("div",["nk-pop-float"]),this._surface=this.createElement("div",["nk-pop"]),this._slot=document.createElement("slot"),this._surface.appendChild(this._slot),this._float.appendChild(this._surface),t.append(this._triggerSlot,this._float),this._wrapper.appendChild(t),this._syncSurface()}_syncSurface(){const t=this.getBoolAttr("bare")||this._slot.assignedElements().some(t=>Rt.has(t.localName));this._surface.className=t?"":"nk-pop"}setupEvents(){this._onTrigger=t=>{t.composedPath().some(t=>t instanceof Element&&"trigger"===t.getAttribute?.("slot"))&&(t.stopPropagation(),this.toggle())},this._onDocClick=t=>{this.getBoolAttr("open")&&!t.composedPath().includes(this)&&this.close()},this._onKey=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&this.close()},this._onSelect=t=>{t.target!==this&&this.close()},this._onSlot=()=>this._syncSurface(),this.addEventListener("click",this._onTrigger),document.addEventListener("click",this._onDocClick),document.addEventListener("keydown",this._onKey),this._float.addEventListener("nk-select",this._onSelect),this._slot.addEventListener("slotchange",this._onSlot)}teardownEvents(){this.removeEventListener("click",this._onTrigger),document.removeEventListener("click",this._onDocClick),document.removeEventListener("keydown",this._onKey),this._float?.removeEventListener("nk-select",this._onSelect),this._slot?.removeEventListener("slotchange",this._onSlot)}onAttributeChanged(t){if("bare"===t&&this._syncSurface(),"open"===t){const t=this.getBoolAttr("open");for(const e of this._triggerSlot.assignedElements())e.setAttribute("aria-expanded",t?"true":"false");this.emit("nk-toggle",{open:t})}}show(){this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get placement(){return this.getAttribute("placement")||"bottom-start"}set placement(t){this.setAttribute("placement",t)}}customElements.define("nk-pop",Ut);const Wt=(t,e,n)=>n.map(([n,i])=>({char:n,name:i,cat:t,icon:e})),Ht=[{id:"smileys",icon:"๐"},{id:"people",icon:"๐"},{id:"nature",icon:"๐ฟ"},{id:"food",icon:"โ"},{id:"activity",icon:"๐ฏ"},{id:"travel",icon:"๐"},{id:"objects",icon:"๐ก"},{id:"symbols",icon:"โ
"}],Gt=[...Wt("smileys","๐",[["๐","grinning"],["๐","smile blush"],["๐","joy laugh"],["๐","slight smile"],["๐","wink"],["๐","heart eyes love"],["๐ค","thinking"],["๐","cool sunglasses"],["๐ฅณ","party"],["๐ด","sleep"],["๐คฏ","mind blown"],["๐
","sweat smile"],["๐","upside down"],["๐","angel halo"],["๐ค","hug"],["๐ข","cry sad"]]),...Wt("people","๐",[["๐","wave hello"],["๐","thumbs up"],["๐","thumbs down"],["๐","pray thanks"],["๐","clap"],["๐ค","handshake deal"],["๐ช","strong"],["๐","eyes look"],["๐ง ","brain knowledge"],["โค๏ธ","heart love"],["๐ค","person user"],["๐ฅ","people team members"],["๐งโ๐ป","developer"],["๐","raise hand"],["โ๏ธ","writing"],["๐ซถ","heart hands"]]),...Wt("nature","๐ฟ",[["๐ฟ","leaf herb"],["๐ฑ","seedling"],["๐ณ","tree"],["๐ธ","blossom flower"],["๐","sun"],["๐","moon night"],["โญ","star"],["๐ฅ","fire hot"],["๐","rainbow"],["๐","wave water"],["๐","clover luck"],["๐","bee"],["๐ฆ","butterfly"],["๐ข","turtle"],["๐","earth globe"],["โ๏ธ","snow"]]),...Wt("food","โ",[["โ","coffee"],["๐ต","tea"],["๐","apple"],["๐","pizza"],["๐ฐ","cake"],["๐ช","cookie"],["๐ฅ","croissant"],["๐","burger"],["๐","noodles"],["๐บ","beer"],["๐ท","wine"],["๐ฅ","salad"],["๐ซ","chocolate"],["๐","strawberry"],["๐ฅ","avocado"],["๐ฉ","donut"]]),...Wt("activity","๐ฏ",[["๐ฏ","target goal"],["๐","trophy win"],["๐","tada celebration"],["๐จ","art palette design"],["๐๏ธ","microphone podcast voice"],["๐ฌ","clapper movie"],["๐ฎ","game"],["โฝ","football"],["๐","run"],["๐ง","yoga calm"],["๐ต","music"],["๐ฒ","dice"],["๐","finish flag"],["๐","graduation learn"],["๐งฉ","puzzle piece"],["๐","repeat retro"]]),...Wt("travel","๐",[["๐","rocket launch"],["โ๏ธ","plane travel"],["๐","car"],["๐ฒ","bike"],["๐ ","house home"],["๐ข","office building"],["๐บ๏ธ","map"],["๐งญ","compass"],["โฐ๏ธ","mountain"],["๐๏ธ","beach"],["๐","station"],["๐ฐ๏ธ","satellite"],["๐","city"],["๐๏ธ","camping"],["โต","sailboat"],["๐ซ","departure"]]),...Wt("objects","๐ก",[["๐ก","idea bulb"],["๐","chart bar"],["๐","chart up"],["๐
","calendar date"],["๐","page document"],["๐","folder"],["๐๏ธ","card box database"],["๐","pin"],["๐","search"],["๐ ๏ธ","tools"],["โ๏ธ","gear settings"],["๐","bell notification"],["๐","gem diamond"],["๐","memo notes"],["๐","paperclip files"],["๐","lock secure"],["๐ฌ","speech comment"],["๐ค","export outbox"],["๐ฅ","inbox"],["๐๏ธ","trash bin"],["๐ฅ๏ธ","desktop"],["๐ฑ","phone"],["๐ป","laptop"],["๐งพ","receipt"]]),...Wt("symbols","โ
",[["โ
","check done"],["โจ","sparkles ai magic"],["โ","cross no"],["โ ๏ธ","warning"],["โน๏ธ","info"],["โ","question"],["โ","plus add"],["โก๏ธ","arrow right"],["๐ด","red circle"],["๐ข","green circle"],["๐ก","yellow circle"],["๐ต","blue circle"],["โณ","hourglass wait"],["โป๏ธ","recycle"],["๐","new"],["๐ฏ","hundred"]])];class Qt extends p{static get observedAttributes(){return["placeholder","value"]}render(){this._box=this.createElement("div",["nk-pop"]),this._search=this.createElement("input",["nk-emoji-search"],{type:"search",autocomplete:"off","aria-label":"Search emoji"}),this._grid=this.createElement("div",["nk-emoji-grid"],{role:"listbox"}),this._cats=this.createElement("div",["nk-emoji-cats"],{role:"tablist"}),this._box.append(this._search,this._grid,this._cats),this._wrapper.appendChild(this._box),this._emojis=Gt,this._cat=Ht[0].id,this._renderCats(),this._renderGrid(),this._syncAttrs()}_syncAttrs(){this._search.placeholder=this.getAttribute("placeholder")||"Searchโฆ"}_renderCats(){this._cats.replaceChildren();const t=this._categories();for(const e of t){const t=this.createElement("span",[],{role:"tab","data-cat":e.id,title:e.id});t.textContent=e.icon,t.classList.toggle("active",e.id===this._cat),this._cats.appendChild(t)}this._cats.style.display=t.length>1?"":"none"}_categories(){if(this._catList)return this._catList;const t=new Map;for(const e of this._emojis)e.cat&&!t.has(e.cat)&&t.set(e.cat,{id:e.cat,icon:e.icon||Ht.find(t=>t.id===e.cat)?.icon||e.char});return[...t.values()]}_renderGrid(){const t=this._search.value.trim().toLowerCase(),e=t?this._emojis.filter(e=>(e.name||"").toLowerCase().includes(t)||e.char===t):this._emojis.filter(t=>!t.cat||t.cat===this._cat);this._grid.replaceChildren();for(const t of e.slice(0,64)){const e=this.createElement("span",[],{role:"option",title:t.name||"","data-emoji":t.char});e.textContent=t.char,this._grid.appendChild(e)}for(const e of this._cats.children)e.classList.toggle("active",!t&&e.dataset.cat===this._cat)}setupEvents(){this._onInput=()=>this._renderGrid(),this._onGrid=t=>{const e=t.target.closest("[data-emoji]");e&&this.select(e.dataset.emoji)},this._onCats=t=>{const e=t.target.closest("[data-cat]");e&&(this._cat=e.dataset.cat,this._search.value="",this._renderGrid())},this._onKey=t=>{if("Enter"===t.key){const t=this._grid.querySelector("[data-emoji]");t&&this.select(t.dataset.emoji)}},this._search.addEventListener("input",this._onInput),this._search.addEventListener("keydown",this._onKey),this._grid.addEventListener("click",this._onGrid),this._cats.addEventListener("click",this._onCats)}teardownEvents(){this._search?.removeEventListener("input",this._onInput),this._search?.removeEventListener("keydown",this._onKey),this._grid?.removeEventListener("click",this._onGrid),this._cats?.removeEventListener("click",this._onCats)}select(t){this.setAttribute("value",t),this.emit("nk-select",{emoji:t,value:t})}onAttributeChanged(){this._syncAttrs()}focus(t){this._search?.focus(t)}get categories(){return this._categories()}set categories(t){this._catList=Array.isArray(t)&&t.length?t:null,this._cat=this._categories()[0]?.id,this._renderCats(),this._renderGrid()}get emojis(){return this._emojis}set emojis(t){this._emojis=Array.isArray(t)?t:Gt,this._cat=this._categories()[0]?.id,this._renderCats(),this._renderGrid()}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}}customElements.define("nk-emoji-picker",Qt);class Xt extends p{static get observedAttributes(){return["open","duration","icon"]}render(){this._box=this.createElement("div",["nk-toast"],{role:"status","aria-live":"polite"}),this._icon=document.createElement("span"),this._msg=document.createElement("span"),this._box.append(this._icon,this._msg,document.createElement("slot")),this._wrapper.appendChild(this._box),this._sync()}_sync(){this._box.classList.toggle("show",this.getBoolAttr("open"));const t=this.getAttribute("icon")??"โ";this._icon.textContent=t,this._icon.style.display=t?"":"none"}show(t,{duration:e}={}){void 0!==t&&(this._msg.textContent=t),clearTimeout(this._timer),this.setBoolAttr("open",!0);const n=e??Number(this.getAttribute("duration"))??2200;n>0&&(this._timer=setTimeout(()=>this.close(),n||2200))}close(){clearTimeout(this._timer),this.setBoolAttr("open",!1)}onAttributeChanged(t){this._sync(),"open"===t&&this.emit("nk-toggle",{open:this.getBoolAttr("open")})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._timer)}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get message(){return this._msg?.textContent??""}set message(t){this._msg&&(this._msg.textContent=t)}}customElements.define("nk-toast",Xt);class Yt extends p{static get observedAttributes(){return["view","add-view"]}render(){this._box=this.createElement("div",["nk-database"]),this._tabs=this.createElement("div",["nk-db-tabs"],{role:"tablist"}),this._slot=document.createElement("slot"),this._box.append(this._tabs,this._slot),this._wrapper.appendChild(this._box),this._columns=[],this._rows=[],this._sync()}get views(){return this._slot?.assignedElements().filter(t=>/^nk-[a-z]+-view$/.test(t.localName))??[]}_sync(){if(!this._tabs)return;const t=this.views;let e=this.getAttribute("view");t.some(t=>t.name===e)||(e=t[0]?.name??null),this._tabs.replaceChildren();for(const n of t){const t=this.createElement("span",["nk-db-tab"],{role:"tab","data-view":n.name,tabindex:"0"});t.classList.toggle("active",n.name===e),t.setAttribute("aria-selected",n.name===e?"true":"false"),t.append(document.createTextNode(n.getAttribute("label")||n.name));const i=n.hasAttribute("count")?String(this._rows.length):n.getAttribute("badge");if(i){const e=this.createElement("span",["badge"]);e.textContent=i,t.appendChild(e)}this._tabs.appendChild(t),n.hidden=n.name!==e,n.setData?.(this._columns,this._rows)}if(this.getBoolAttr("add-view")){const t=this.createElement("span",["nk-db-tab"],{role:"button","data-add":"",tabindex:"0"});t.style.color="var(--nk-text-tertiary)",t.textContent="๏ผ",this._tabs.appendChild(t)}this._tabs.style.display=t.length?"":"none",this._current=e}requestSync(){this._syncQueued||(this._syncQueued=!0,queueMicrotask(()=>{this._syncQueued=!1,this._sync()}))}setupEvents(){this._onClick=t=>{const e=t.target.closest("[data-view]");e?this.view=e.dataset.view:t.target.closest("[data-add]")&&this.emit("nk-action",{action:"add-view"})},this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||!t.target.closest("[data-view],[data-add]")||(t.preventDefault(),t.target.click())},this._onSlot=()=>this._sync(),this._tabs.addEventListener("click",this._onClick),this._tabs.addEventListener("keydown",this._onKey),this._slot.addEventListener("slotchange",this._onSlot),this._sync()}teardownEvents(){this._tabs?.removeEventListener("click",this._onClick),this._tabs?.removeEventListener("keydown",this._onKey),this._slot?.removeEventListener("slotchange",this._onSlot)}onAttributeChanged(t){const e=this._current;this._sync(),"view"===t&&this._current!==e&&this.emit("nk-view-change",{view:this._current})}get columns(){return this._columns}set columns(t){this._columns=Array.isArray(t)?t:[],this._sync()}get rows(){return this._rows}set rows(t){this._rows=Array.isArray(t)?t:[],this._sync()}get view(){return this._current??this.getAttribute("view")}set view(t){this.setAttribute("view",t)}refresh(){this._sync()}}customElements.define("nk-database",Yt);const Zt=(t,e,n)=>{const i=document.createElement(t);return e&&(i.className=e),null!=n&&(i.textContent=n),i},Jt=["gray","brown","orange","yellow","green","blue","purple","pink","red"];function te(t,e){const n=function(t,e){const n=t.options||[];return n.find(t=>t.value===e)||n.find(t=>t.label===e)||null}(t,e),i=n?.color&&Jt.includes(n.color)?n.color:"gray";return Zt("span",`nk-tag ${i}`,n?.label??String(e))}function ee(t,e,n={}){const i=t.type||"text";if(null==e||""===e)return"checkbox"===i?ne(t,!1,n):"progress"===i?ie(0):Zt("span","person"===i?"person-cell":null,"text"===i&&t.title?"":"โ");switch(i){case"select":return te(t,e);case"multi-select":{const n=Zt("span");n.style.display="inline-flex",n.style.gap="4px",n.style.flexWrap="wrap";for(const i of Array.isArray(e)?e:String(e).split(",").map(t=>t.trim()).filter(Boolean))n.appendChild(te(t,i));return n}case"date":return Zt("span","date-cell",String(e));case"person":{const t=Zt("span","person-cell"),n="string"==typeof e?{name:e}:e,i=Zt("span","mini-avatar",n.initials||n.avatar||(n.name||"").split(/\s+/).map(t=>t[0]).join("").slice(0,2).toUpperCase());return i.style.background=n.color||"var(--nk-text-tertiary)",t.append(i,document.createTextNode(" "+(n.name||""))),t}case"checkbox":return ne(t,!!e,n);case"url":{const t=Zt("a",null,String(e).replace(/^https?:\/\//,""));return t.href=String(e),t.target="_blank",t.rel="noopener",t}case"number":return Zt("span",null,"number"==typeof e?e.toLocaleString():String(e));case"progress":return ie(Number(e)||0);default:if(t.title){const t=Zt("span","row-title");return n.icon&&t.append(document.createTextNode(n.icon+" ")),t.append(document.createTextNode(String(e))),t}return Zt("span",null,String(e))}}function ne(t,e,n){const i=Zt("label","nk-check"),s=Zt("input");return s.type="checkbox",s.checked=e,s.dataset.key=t.key,null!=n.id&&(s.dataset.rowId=n.id),i.appendChild(s),i}function ie(t){const e=document.createDocumentFragment(),n=Zt("span","nk-progress"),i=Zt("i");return i.style.width=`${Math.max(0,Math.min(100,t))}%`,n.appendChild(i),e.append(n,Zt("span","nk-progress-label",`${Math.round(t)}%`)),e}function se(t,e=1){const n=t.type||"text";return(i,s)=>{let r=i[t.key],o=s[t.key];return"person"===n&&(r=r?.name??r??"",o=o?.name??o??""),"number"===n||"progress"===n||"checkbox"===n?((Number(r)||0)-(Number(o)||0))*e:String(r??"").localeCompare(String(o??""),void 0,{numeric:!0})*e}}class re extends p{static get observedAttributes(){return["name","label","badge","count","new-row","new-row-label","sortable","sort-key","sort-dir","wrap"]}render(){this._wrap=this.createElement("div",["nk-table-wrap"]),this._table=this.createElement("table",["nk-table"]),this._thead=document.createElement("thead"),this._tbody=document.createElement("tbody"),this._table.append(this._thead,this._tbody),this._newRow=this.createElement("div",["nk-new-row"],{role:"button",tabindex:"0"}),this._wrap.append(this._table,this._newRow),this._wrapper.appendChild(this._wrap),this._columns??=[],this._rows??=[],this._render(),this.closest("nk-database")?.requestSync?.()}_sortedRows(){const t=this.getAttribute("sort-key"),e=this._columns.find(e=>e.key===t);return e?[...this._rows].sort(se(e,"desc"===this.getAttribute("sort-dir")?-1:1)):this._rows}_render(){if(!this._thead)return;this._table.classList.toggle("wrap",this.getBoolAttr("wrap"));const t=document.createElement("tr");for(const e of this._columns){const n=this.createElement("th",[],{"data-key":e.key,scope:"col"});if(e.icon){const t=this.createElement("span",["th-icon"]);t.textContent=e.icon,n.appendChild(t)}n.appendChild(document.createTextNode(e.label??e.key)),e.key===this.getAttribute("sort-key")&&n.appendChild(document.createTextNode("desc"===this.getAttribute("sort-dir")?" โ":" โ")),e.width&&(n.style.width=e.width),t.appendChild(n)}this._thead.replaceChildren(t),this._tbody.replaceChildren();for(const t of this._sortedRows()){const e=this.createElement("tr",[],{"data-id":t.id??""});for(const n of this._columns){const i=document.createElement("td");i.appendChild(ee(n,t[n.key],t)),e.appendChild(i)}this._tbody.appendChild(e)}this._newRow.textContent=this.getAttribute("new-row-label")||"๏ผ New page",this._newRow.style.display=this.getBoolAttr("new-row")?"":"none"}setupEvents(){this._onClick=t=>{if(this._newRow.contains(t.target))return void this.emit("nk-action",{action:"new-row"});const e=t.target.closest("th[data-key]");if(e){const t=e.dataset.key,n=this.getAttribute("sort-key")===t&&"desc"!==this.getAttribute("sort-dir")?"desc":"asc";return void(this.emit("nk-action",{action:"sort",key:t,value:n})&&this.getBoolAttr("sortable")&&(this.setAttribute("sort-key",t),this.setAttribute("sort-dir",n)))}if(t.target.closest("input[type=checkbox], a"))return;const n=t.target.closest("tr[data-id]");if(n){const t=this._rowById(n.dataset.id);this.emit("nk-select",{row:t,id:t?.id,value:t?.id})}},this._onChange=t=>{const e=t.target;if("checkbox"!==e.type)return;const n=this._rowById(e.dataset.rowId);n&&(n[e.dataset.key]=e.checked),this.emit("nk-change",{row:n,key:e.dataset.key,value:e.checked})},this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||t.target!==this._newRow||(t.preventDefault(),this.emit("nk-action",{action:"new-row"}))},this._wrap.addEventListener("click",this._onClick),this._wrap.addEventListener("change",this._onChange),this._wrap.addEventListener("keydown",this._onKey)}teardownEvents(){this._wrap?.removeEventListener("click",this._onClick),this._wrap?.removeEventListener("change",this._onChange),this._wrap?.removeEventListener("keydown",this._onKey)}_rowById(t){return this._rows.find(e=>String(e.id)===String(t))}onAttributeChanged(){this._render()}get name(){return this.getAttribute("name")||"table"}get columns(){return this._columns}set columns(t){this._columns=Array.isArray(t)?t:[],this._render()}get rows(){return this._rows}set rows(t){this._rows=Array.isArray(t)?t:[],this._render()}set data({columns:t,rows:e}){this.setData(t,e)}setData(t,e){this._columns=t||[],this._rows=e||[],this._render()}refresh(){this._render()}}customElements.define("nk-table-view",re);class oe extends p{static get observedAttributes(){return["name","label","badge","count","group-by","title-key","meta-keys","new-row"]}render(){this._board=this.createElement("div",["nk-board","active"]),this._wrapper.appendChild(this._board),this._columns??=[],this._rows??=[],this._render(),this.closest("nk-database")?.requestSync?.()}_groupColumn(){const t=this.getAttribute("group-by");return this._columns.find(e=>e.key===t)||this._columns.find(t=>"select"===t.type)||null}_titleColumn(){const t=this.getAttribute("title-key");return this._columns.find(e=>e.key===t)||this._columns.find(t=>t.title)||this._columns[0]||null}_metaColumns(){const t=(this.getAttribute("meta-keys")||"").split(",").map(t=>t.trim()).filter(Boolean);return t.length?t.map(t=>this._columns.find(e=>e.key===t)).filter(Boolean):this._columns.filter(t=>"date"===t.type||"progress"===t.type)}_render(){if(!this._board)return;this._board.replaceChildren();const t=this._groupColumn(),e=this._titleColumn();if(!t)return;const n=t.options?.length?t.options:[...new Set(this._rows.map(e=>e[t.key]))].map(t=>({value:t,label:String(t)}));for(const i of n){const n=this.createElement("div",["nk-board-col"],{"data-value":i.value}),s=this.createElement("div",["nk-board-col-header"]),r=this._rows.filter(e=>e[t.key]===i.value||e[t.key]===i.label),o=this.createElement("span",["count"]);o.textContent=String(r.length),s.append(te(t,i.value),o),n.appendChild(s);for(const t of r){const i=this.createElement("div",["nk-card"],{draggable:"true","data-id":t.id??"",tabindex:"0"}),s=this.createElement("div",["card-title"]);s.textContent=`${t.icon?t.icon+" ":""}${e?t[e.key]??"":""}`;const r=this.createElement("div",["card-meta"]);for(const e of this._metaColumns()){const n=t[e.key];if(null==n||""===n)continue;const i=document.createElement("span");"progress"===e.type?i.textContent=`โฐ ${n}%`:"date"===e.type?i.textContent=`๐
${n}`:i.appendChild(ee(e,n,t)),r.appendChild(i)}i.append(s,r),n.appendChild(i)}if(this.getBoolAttr("new-row")){const t=this.createElement("div",["nk-new-row"],{role:"button",tabindex:"0","data-add":i.value});t.style.padding="6px 10px",t.textContent="๏ผ",n.appendChild(t)}this._board.appendChild(n)}}setupEvents(){this._onClick=t=>{const e=t.target.closest("[data-add]");if(e)return void this.emit("nk-action",{action:"new-row",value:e.dataset.add});const n=t.target.closest(".nk-card");if(n){const t=this._rowById(n.dataset.id);this.emit("nk-select",{row:t,id:t?.id,value:t?.id})}},this._onDragStart=t=>{const e=t.target.closest?.(".nk-card");if(e){this._dragId=e.dataset.id,t.dataTransfer.effectAllowed="move";try{t.dataTransfer.setData("text/plain",e.dataset.id)}catch{}}},this._onDragOver=t=>{null!=this._dragId&&t.target.closest(".nk-board-col")&&(t.preventDefault(),t.dataTransfer.dropEffect="move")},this._onDrop=t=>{const e=t.target.closest(".nk-board-col");e&&null!=this._dragId&&(t.preventDefault(),this.move(this._dragId,e.dataset.value),this._dragId=null)},this._board.addEventListener("click",this._onClick),this._board.addEventListener("dragstart",this._onDragStart),this._board.addEventListener("dragover",this._onDragOver),this._board.addEventListener("drop",this._onDrop)}teardownEvents(){this._board?.removeEventListener("click",this._onClick),this._board?.removeEventListener("dragstart",this._onDragStart),this._board?.removeEventListener("dragover",this._onDragOver),this._board?.removeEventListener("drop",this._onDrop)}move(t,e){const n=this._rowById(t),i=this._groupColumn();n&&i&&n[i.key]!==e&&(n[i.key]=e,this._render(),this.emit("nk-change",{row:n,key:i.key,value:e}))}_rowById(t){return this._rows.find(e=>String(e.id)===String(t))}onAttributeChanged(){this._render()}get name(){return this.getAttribute("name")||"board"}get columns(){return this._columns}set columns(t){this._columns=Array.isArray(t)?t:[],this._render()}get rows(){return this._rows}set rows(t){this._rows=Array.isArray(t)?t:[],this._render()}set data({columns:t,rows:e}){this.setData(t,e)}setData(t,e){this._columns=t||[],this._rows=e||[],this._render()}refresh(){this._render()}}customElements.define("nk-board-view",oe);class ae extends p{static get observedAttributes(){return["search","placeholder","no-filter","no-sort","value"]}render(){this._bar=document.createElement("div"),this._bar.style.cssText="display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:8px 0",this._filterBtn=this.createElement("button",["nk-btn","secondary","small"],{type:"button","data-action":"filter"}),this._filterBtn.textContent="โฒ Filter",this._sortBtn=this.createElement("button",["nk-btn","secondary","small"],{type:"button","data-action":"sort"}),this._sortBtn.textContent="โ Sort",this._chips=document.createElement("span"),this._chips.style.cssText="display:inline-flex;gap:4px;flex-wrap:wrap",this._input=this.createElement("input",["nk-input"],{type:"search",autocomplete:"off"}),this._input.style.marginLeft="auto",this._bar.append(this._filterBtn,this._sortBtn,this._chips,document.createElement("slot"),this._input),this._wrapper.appendChild(this._bar),this._filters=[],this._sync()}_sync(){this._filterBtn.style.display=this.getBoolAttr("no-filter")?"none":"",this._sortBtn.style.display=this.getBoolAttr("no-sort")?"none":"",this._input.style.display=this.getBoolAttr("search")?"":"none",this._input.placeholder=this.getAttribute("placeholder")||"Search โฆ",this.hasAttribute("value")&&this._input.value!==this.getAttribute("value")&&(this._input.value=this.getAttribute("value")),this._chips.replaceChildren(),this._filters.forEach((t,e)=>{const n=this.createElement("span",["nk-tag",t.color||"blue"],{"data-index":e});n.style.cursor="pointer",n.textContent=`${t.label??`${t.key}: ${t.value}`} ร`,n.title="Remove filter",this._chips.appendChild(n)})}setupEvents(){this._onClick=t=>{const e=t.target.closest("[data-action]");if(e)return void this.emit("nk-action",{action:e.dataset.action});const n=t.target.closest("[data-index]");n&&(this._filters.splice(Number(n.dataset.index),1),this._sync(),this._emitChange())},this._onInput=()=>{clearTimeout(this._debounce),this._debounce=setTimeout(()=>this._emitChange(),150)},this._bar.addEventListener("click",this._onClick),this._input.addEventListener("input",this._onInput)}teardownEvents(){this._bar?.removeEventListener("click",this._onClick),this._input?.removeEventListener("input",this._onInput),clearTimeout(this._debounce)}_emitChange(){this.emit("nk-change",{filters:[...this._filters],search:this._input.value})}onAttributeChanged(){this._sync()}get filters(){return this._filters}set filters(t){this._filters=Array.isArray(t)?t:[],this._sync()}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t??"")}apply(t){const e=this.value.trim().toLowerCase();return t.filter(t=>this._filters.every(e=>t[e.key]===e.value)&&(!e||Object.values(t).some(t=>String("object"==typeof t&&t?t.name??"":t??"").toLowerCase().includes(e))))}}customElements.define("nk-filter-bar",ae);class le extends p{static get observedAttributes(){return["placeholder","send-label","no-input","disabled"]}render(){const t=this.createElement("div",["nk-comments"]);t.appendChild(document.createElement("slot")),this._row=this.createElement("div",["nk-comment-input"]),this._input=this.createElement("input",["nk-input"],{type:"text","aria-label":"Comment"}),this._btn=this.createElement("button",["nk-btn","primary","small"],{type:"button"}),this._row.append(this._input,this._btn),t.appendChild(this._row),this._wrapper.appendChild(t),this._sync()}_sync(){this._input.placeholder=this.getAttribute("placeholder")||"Comment โฆ",this._btn.textContent=this.getAttribute("send-label")||"Send",this._row.style.display=this.getBoolAttr("no-input")?"none":"",this._input.disabled=this._btn.disabled=this.getBoolAttr("disabled")}setupEvents(){this._onSend=()=>this.submit(),this._onKey=t=>{"Enter"===t.key&&(t.preventDefault(),this.submit())},this._btn.addEventListener("click",this._onSend),this._input.addEventListener("keydown",this._onKey)}teardownEvents(){this._btn?.removeEventListener("click",this._onSend),this._input?.removeEventListener("keydown",this._onKey)}submit(){const t=this._input.value.trim();if(!t)return;this.emit("nk-submit",{text:t})&&(this._input.value="")}onAttributeChanged(){this._sync()}focus(t){this._input?.focus(t)}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t??"")}}customElements.define("nk-comments",le);class he extends p{static get observedAttributes(){return["author","time","avatar","color"]}render(){const t=this.createElement("div",["nk-comment"]);this._avatar=this.createElement("span",["mini-avatar"]);const e=this.createElement("slot",[],{name:"avatar"});e.appendChild(this._avatar);const n=document.createElement("div");this._head=this.createElement("div",["c-head"]),this._author=document.createElement("b"),this._time=document.createTextNode(""),this._head.append(this._author,this.createElement("slot",[],{name:"head"}),this._time);const i=this.createElement("div",["c-body"]);i.appendChild(document.createElement("slot")),n.append(this._head,i),t.append(e,n),this._wrapper.appendChild(t),this._sync()}_sync(){const t=this.getAttribute("author")||"";this._author.textContent=t;const e=this.getAttribute("time");this._time.data=e?` ยท ${e}`:"",this._avatar.textContent=this.getAttribute("avatar")||t.split(/\s+/).map(t=>t[0]).join("").slice(0,2).toUpperCase(),this._avatar.style.background=this.getAttribute("color")||"var(--nk-text-tertiary)"}onAttributeChanged(){this._sync()}}customElements.define("nk-comment",he);class de extends p{render(){const t=this.createElement("div",["nk-ai-thread"],{role:"log","aria-live":"polite"});t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-ai-thread",de);class ce extends p{static get observedAttributes(){return["role","name","badge","avatar","color"]}render(){this._box=this.createElement("div",["nk-ai-msg"]),this._avatar=this.createElement("span",["mini-avatar"]);const t=this.createElement("slot",[],{name:"avatar"});t.appendChild(this._avatar);const e=this.createElement("div",["a-body"]);this._name=this.createElement("div",["a-name"]),this._nameText=document.createTextNode(""),this._badge=document.createElement("span"),this._name.append(this._nameText,this._badge),this._actions=this.createElement("div",["nk-ai-actions"]),this._actionSlot=this.createElement("slot",[],{name:"actions"}),this._actions.appendChild(this._actionSlot),e.append(this._name,document.createElement("slot"),this._actions),this._box.append(t,e),this._wrapper.appendChild(this._box),this._sync()}_sync(){const t="user"===this.getAttribute("role");this._box.classList.toggle("user",t);const e=this.getAttribute("name");this._nameText.data=e||"";const n=this.getAttribute("badge");this._badge.textContent=n?` ${n}`:"",this._name.style.display=e?"":"none",this._avatar.textContent=this.getAttribute("avatar")||(t?(e||"U").slice(0,2).toUpperCase():"โจ");const i=this.getAttribute("color");this._avatar.style.background=i||"",this._actions.style.display=this._actionSlot.assignedElements().length?"":"none"}setupEvents(){this._onSlot=()=>this._sync(),this._onClick=t=>{const e=t.target.closest?.("button");e&&this._actionSlot.assignedElements().includes(e)&&this.emit("nk-action",{action:e.value||e.textContent.trim(),value:e.value||e.textContent.trim()})},this._actionSlot.addEventListener("slotchange",this._onSlot),this.addEventListener("click",this._onClick),this._sync()}teardownEvents(){this._actionSlot?.removeEventListener("slotchange",this._onSlot),this.removeEventListener("click",this._onClick)}onAttributeChanged(){this._sync()}}customElements.define("nk-ai-msg",ce);class pe extends p{static get observedAttributes(){return["placeholder","value","disabled","icon"]}render(){this._row=this.createElement("div",["nk-ai-input-row"]),this._icon=document.createElement("span"),this._icon.style.fontSize="14px",this._input=this.createElement("input",[],{type:"text","aria-label":"Message"}),this._btn=this.createElement("button",["nk-ai-send"],{type:"button","aria-label":"Send"}),this._btn.textContent="โ",this._row.append(this._icon,this._input,this._btn),this._wrapper.appendChild(this._row),this._sync()}_sync(){this._input.placeholder=this.getAttribute("placeholder")||"Ask something โฆ",this.hasAttribute("value")&&this._input.value!==this.getAttribute("value")&&(this._input.value=this.getAttribute("value")),this._input.disabled=this._btn.disabled=this.getBoolAttr("disabled");const t=this.getAttribute("icon")??"โจ";this._icon.textContent=t,this._icon.style.display=t?"":"none"}setupEvents(){this._onSend=()=>this.submit(),this._onKey=t=>{"Enter"===t.key&&(t.preventDefault(),this.submit())},this._btn.addEventListener("click",this._onSend),this._input.addEventListener("keydown",this._onKey)}teardownEvents(){this._btn?.removeEventListener("click",this._onSend),this._input?.removeEventListener("keydown",this._onKey)}submit(){const t=this._input.value.trim();if(!t||this.getBoolAttr("disabled"))return;this.emit("nk-submit",{text:t})&&(this._input.value="")}onAttributeChanged(){this._sync()}focus(t){this._input?.focus(t)}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t??"")}}return customElements.define("nk-ai-input-row",pe),t.NkAiInputRow=pe,t.NkAiMsg=ce,t.NkAiThread=de,t.NkApp=U,t.NkAvatarGroup=yt,t.NkBanner=ct,t.NkBlockHost=ht,t.NkBoardView=oe,t.NkBreadcrumb=et,t.NkBtn=g,t.NkCallout=j,t.NkCheck=A,t.NkCmdk=qt,t.NkCode=$,t.NkComment=he,t.NkComments=le,t.NkDangerZone=Bt,t.NkDatabase=Yt,t.NkDivider=I,t.NkElement=p,t.NkEmojiPicker=Qt,t.NkEmpty=pt,t.NkField=D,t.NkFields=V,t.NkFilterBar=ae,t.NkFormElement=u,t.NkHeading=K,t.NkInput=_,t.NkKbd=P,t.NkMemberList=St,t.NkMemberRow=Nt,t.NkMention=At,t.NkMenu=Ot,t.NkMenuItem=Pt,t.NkModal=Mt,t.NkModelCard=Ct,t.NkPage=rt,t.NkPageActions=lt,t.NkPageCover=ot,t.NkPageTitle=at,t.NkPop=Ut,t.NkProfileRow=Lt,t.NkProgress=M,t.NkQuote=R,t.NkRadio=B,t.NkSectionLabel=X,t.NkSegmented=vt,t.NkSelect=y,t.NkSettingsPane=jt,t.NkSettingsUser=It,t.NkSidebar=H,t.NkSkeleton=ut,t.NkSlider=N,t.NkStat=ft,t.NkStats=xt,t.NkSwitch=w,t.NkSynced=bt,t.NkTab=kt,t.NkTabBar=it,t.NkTabBarItem=st,t.NkTableView=re,t.NkTabs=mt,t.NkTag=F,t.NkTemplateBtn=Et,t.NkTextarea=f,t.NkThemeToggle=nt,t.NkToast=Xt,t.NkTodo=O,t.NkToggle=q,t.NkTopbar=tt,t.NkTree=Z,t.NkTreeItem=J,t.NkWorkspaceSwitcher=Q,t.compareBy=se,t.renderPropertyCell=ee,t.tagFor=te,t}({});
|
|
1
|
+
var NotionKitElements=function(t){"use strict";const e=':root{color-scheme:light;--nk-bg:#ffffff;--nk-bg-sidebar:#f9f8f7;--nk-bg-hover:rgba(55,53,47,0.06);--nk-bg-active:rgba(55,53,47,0.08);--nk-bg-callout:#f0efed;--nk-bg-code:#f7f6f3;--nk-bg-card:#ffffff;--nk-bg-input:rgba(242,241,238,0.6);--nk-text:#2c2c2b;--nk-text-secondary:#7d7a75;--nk-text-tertiary:#91918e;--nk-text-sidebar:#5f5e5b;--nk-border:rgba(28,19,1,0.11);--nk-border-strong:rgba(27,21,0,0.19);--nk-accent:#2383e2;--nk-on-accent:#ffffff;--nk-danger:#cd3c3a;--nk-tag-gray-bg:#e3e2e0;--nk-tag-gray-text:#32302c;--nk-tag-brown-bg:#eee0da;--nk-tag-brown-text:#442a1e;--nk-tag-orange-bg:#fadec9;--nk-tag-orange-text:#49290e;--nk-tag-yellow-bg:#fdecc8;--nk-tag-yellow-text:#402c1b;--nk-tag-green-bg:#dbeddb;--nk-tag-green-text:#1c3829;--nk-tag-blue-bg:#d3e5ef;--nk-tag-blue-text:#183347;--nk-tag-purple-bg:#e8deee;--nk-tag-purple-text:#412454;--nk-tag-pink-bg:#f5e0e9;--nk-tag-pink-text:#4c2337;--nk-tag-red-bg:#ffe2dd;--nk-tag-red-text:#5d1715;--nk-tint-gray:#f1f1ef;--nk-color-gray:#787774;--nk-tint-brown:#f4eeee;--nk-color-brown:#9f6b53;--nk-tint-orange:#fbecdd;--nk-color-orange:#d9730d;--nk-tint-yellow:#fbf3db;--nk-color-yellow:#cb912f;--nk-tint-green:#edf3ec;--nk-color-green:#448361;--nk-tint-blue:#e7f3f8;--nk-color-blue:#337ea9;--nk-tint-purple:#f8f3fc;--nk-color-purple:#9065b0;--nk-tint-pink:#fcf1f6;--nk-color-pink:#c14c8a;--nk-tint-red:#fdebec;--nk-color-red:#cd3c3a;--nk-decor-purple:#9065b0;--nk-decor-blue:#529cca;--nk-decor-orange:#d9730d;--nk-scrim:rgba(15,15,15,0.6);--nk-scrim-soft:rgba(15,15,15,0.5);--nk-sidebar-width:260px;--nk-tab-bar-height:58px;--nk-radius:6px;--nk-font:ui-sans-serif,-apple-system,"Segoe UI",Inter,Helvetica,Arial,sans-serif;--nk-font-mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;--nk-shadow-menu:rgba(15,15,15,0.05) 0px 0px 0px 1px,rgba(15,15,15,0.1) 0px 3px 6px,rgba(15,15,15,0.2) 0px 9px 24px;--nk-shadow-card:0 1px 2px rgba(0,0,0,0.04);--nk-shadow-btn:inset 0 0 0 1px rgba(15,15,15,0.1),0 1px 2px rgba(15,15,15,0.1);--nk-shadow-knob:0 1px 2px rgba(0,0,0,0.2);--nk-shadow-segment:0 1px 2px rgba(0,0,0,0.08)}[data-theme=dark]{color-scheme:dark;--nk-bg:#191919;--nk-bg-sidebar:#202020;--nk-bg-hover:rgba(255,255,255,0.055);--nk-bg-active:rgba(255,255,255,0.08);--nk-bg-callout:#252525;--nk-bg-code:#202020;--nk-bg-card:#202020;--nk-bg-input:rgba(255,255,255,0.055);--nk-text:rgba(255,255,255,0.81);--nk-text-secondary:rgba(255,255,255,0.46);--nk-text-tertiary:rgba(255,255,255,0.32);--nk-text-sidebar:rgba(255,255,255,0.62);--nk-border:rgba(255,255,255,0.094);--nk-border-strong:rgba(255,255,255,0.16);--nk-accent:#529CCA;--nk-danger:#df5452;--nk-tag-gray-bg:#373737;--nk-tag-gray-text:rgba(255,255,255,0.85);--nk-tag-brown-bg:#603b2c;--nk-tag-brown-text:rgba(255,255,255,0.85);--nk-tag-orange-bg:#854c1d;--nk-tag-orange-text:rgba(255,255,255,0.85);--nk-tag-yellow-bg:#89632a;--nk-tag-yellow-text:rgba(255,255,255,0.85);--nk-tag-green-bg:#2b593f;--nk-tag-green-text:rgba(255,255,255,0.85);--nk-tag-blue-bg:#28456c;--nk-tag-blue-text:rgba(255,255,255,0.85);--nk-tag-purple-bg:#492f64;--nk-tag-purple-text:rgba(255,255,255,0.85);--nk-tag-pink-bg:#69314c;--nk-tag-pink-text:rgba(255,255,255,0.85);--nk-tag-red-bg:#6e3630;--nk-tag-red-text:rgba(255,255,255,0.85);--nk-tint-gray:#252525;--nk-color-gray:#9b9b9b;--nk-tint-brown:#2e2724;--nk-color-brown:#ba856f;--nk-tint-orange:#36291f;--nk-color-orange:#c77d48;--nk-tint-yellow:#372e20;--nk-color-yellow:#ca8f3d;--nk-tint-green:#242b26;--nk-color-green:#529e72;--nk-tint-blue:#1f282d;--nk-color-blue:#5e87c9;--nk-tint-purple:#2a2430;--nk-color-purple:#9d68d3;--nk-tint-pink:#2e2328;--nk-color-pink:#d15796;--nk-tint-red:#332523;--nk-color-red:#df5452;--nk-shadow-menu:rgba(15,15,15,0.2) 0px 0px 0px 1px,rgba(15,15,15,0.4) 0px 3px 6px,rgba(15,15,15,0.6) 0px 9px 24px;--nk-shadow-card:none;--nk-shadow-btn:inset 0 0 0 1px rgba(255,255,255,0.1),0 1px 2px rgba(0,0,0,0.3)}',n="[class*=nk-],[class*=nk-] *,[class*=nk-] ::after,[class*=nk-] ::before,[class*=nk-]::after,[class*=nk-]::before{box-sizing:border-box}[class*=nk-] :where(h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd,pre,ul,ol,li){margin:0;padding:0}[class*=nk-] :where(ul,ol){list-style:none}:where(button,input,select,textarea)[class*=nk-],[class*=nk-] :where(button,input,select,textarea,option,optgroup,fieldset,legend){margin:0;padding:0}[class*=nk-][hidden]:not([hidden=until-found i]){display:none!important}::slotted([hidden]:not([hidden=until-found i])){display:none!important}",i='.nk-body{margin:0;min-height:100vh;min-height:100dvh;font-family:var(--nk-font);font-size:14px;background:var(--nk-bg);color:var(--nk-text);-webkit-font-smoothing:auto;transition:background .25s,color .25s}.nk-app{display:flex;height:100vh;height:100dvh;overflow:hidden}.nk-sidebar{width:calc(var(--nk-sidebar-width) + env(safe-area-inset-left,0px));min-width:calc(var(--nk-sidebar-width) + env(safe-area-inset-left,0px));padding-left:env(safe-area-inset-left,0);background:var(--nk-bg-sidebar);display:flex;flex-direction:column;border-right:1px solid var(--nk-border);transition:background .25s}.nk-workspace{display:flex;align-items:center;gap:8px;padding:10px 12px;margin:6px 8px 2px;border-radius:var(--nk-radius);cursor:pointer;font-weight:500;user-select:none}.nk-workspace:hover{background:var(--nk-bg-hover)}.nk-workspace .avatar,.nk-workspace ::slotted(.avatar),.nk-workspace ::slotted([slot=avatar]){width:22px;height:22px;border-radius:4px;background:linear-gradient(135deg,var(--nk-decor-purple),var(--nk-decor-blue));color:var(--nk-on-accent);font-size:11px;font-weight:600;display:flex;align-items:center;justify-content:center}.nk-workspace .chev{margin-left:auto;color:var(--nk-text-tertiary);font-size:11px}.nk-sidebar-scroll{flex:1;overflow-y:auto;padding:4px 8px 16px}.nk-sidebar-scroll::-webkit-scrollbar{width:8px}.nk-sidebar-scroll::-webkit-scrollbar-thumb{background:var(--nk-border-strong);border-radius:4px}.nk-section-label{font-size:12px;font-weight:500;letter-spacing:.01em;color:var(--nk-text-tertiary);padding:14px 10px 4px;display:flex;justify-content:space-between;align-items:center}.nk-section-label .plus{cursor:pointer;border-radius:4px;padding:0 4px;font-size:13px;opacity:0;transition:opacity .15s}.nk-section-label:hover .plus{opacity:1}.nk-section-label .plus:hover{background:var(--nk-bg-hover)}.nk-sidebar-footer{padding:8px;border-top:1px solid var(--nk-border);color:var(--nk-text-sidebar);font-size:14px}.nk-sidebar-footer .nk-tree-item{min-height:26px}.nk-main{flex:1;display:flex;flex-direction:column;min-width:0}.nk-topbar{height:44px;display:flex;align-items:center;padding:0 max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px));gap:8px;flex-shrink:0}.nk-breadcrumb{display:flex;align-items:center;gap:4px;font-size:14px}.nk-breadcrumb .crumb,.nk-breadcrumb ::slotted(.crumb){padding:2px 6px;border-radius:4px;cursor:pointer;color:var(--nk-text-sidebar);display:flex;align-items:center;gap:5px}.nk-breadcrumb .crumb:hover{background:var(--nk-bg-hover)}a.crumb{text-decoration:none}.nk-breadcrumb .crumb.current,.nk-breadcrumb ::slotted(.crumb.current){color:var(--nk-text)}.nk-breadcrumb .sep{color:var(--nk-text-tertiary);font-size:12px}.nk-topbar-actions{margin-left:auto;display:flex;align-items:center;gap:4px}.nk-topbar-btn{padding:4px 8px;border-radius:var(--nk-radius);cursor:pointer;color:var(--nk-text-sidebar);font-size:14px;user-select:none;border:none;background:0 0;font-family:inherit}.nk-topbar-btn:hover{background:var(--nk-bg-hover)}.nk-topbar-btn ::slotted(svg),.nk-topbar-btn svg{width:16px;height:16px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.nk-share-btn{font-size:14px;padding:4px 8px}.nk-topbar-actions ::slotted(.nk-topbar-meta),.nk-topbar-meta{padding:4px 8px;font-size:12px;color:var(--nk-text-tertiary);white-space:nowrap}.nk-theme-toggle{font-size:15px;width:30px;height:28px;padding:0}.nk-tab-bar{display:none;flex:none;align-items:stretch;gap:2px;position:sticky;bottom:0;z-index:30;box-sizing:border-box;height:calc(var(--nk-tab-bar-height) - 6px + max(6px,env(safe-area-inset-bottom,0px)));padding:6px max(4px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) max(4px,env(safe-area-inset-left,0px));background:var(--nk-bg-sidebar);border-top:1px solid var(--nk-border)}.nk-tab-bar.always{display:flex}.nk-tab-bar.fixed{position:fixed;left:0;right:0;bottom:0}.nk-tab-bar-spacer{display:none;flex:none;height:calc(var(--nk-tab-bar-height) - 6px + max(6px,env(safe-area-inset-bottom,0px)))}.nk-tab-bar.always.fixed+.nk-tab-bar-spacer{display:block}.nk-tab-bar.floating{position:fixed;left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px));bottom:calc(12px + env(safe-area-inset-bottom,0px));height:var(--nk-tab-bar-height);padding:6px;border:1px solid var(--nk-border);border-radius:16px;box-shadow:var(--nk-shadow-menu)}.nk-tab-bar-item{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:4px 2px;border:none;border-radius:var(--nk-radius);background:0 0;font-family:inherit;font-size:10.5px;line-height:1.2;color:var(--nk-text-secondary);text-decoration:none;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}.nk-tab-bar-item:hover{color:var(--nk-text);background:var(--nk-bg-hover)}.nk-tab-bar-item.active{color:var(--nk-accent)}.nk-tab-bar-item:disabled{opacity:.5;cursor:not-allowed}.nk-tab-bar-item .icon,.nk-tab-bar-item ::slotted([slot=icon]){font-size:20px;line-height:1}.nk-tab-bar-item .label,.nk-tab-bar-item ::slotted(.label){max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nk-tree-item{display:flex;align-items:center;gap:6px;padding:3px 8px 3px 10px;border-radius:var(--nk-radius);cursor:pointer;user-select:none;color:var(--nk-text-sidebar);position:relative;min-height:28px}.nk-tree-item:hover{background:var(--nk-bg-hover)}.nk-tree-item.active{background:var(--nk-bg-active);color:var(--nk-text);font-weight:500}.nk-tree-item.compact{min-height:26px}.nk-tree-item .icon,.nk-tree-item ::slotted(.icon),.nk-tree-item ::slotted([slot=icon]){font-size:15px;width:20px;text-align:center;flex-shrink:0}.nk-tree-item .label,.nk-tree-item ::slotted(.label){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nk-tree-item .actions{margin-left:auto;display:none;gap:2px;color:var(--nk-text-tertiary)}.nk-tree-item:hover .actions{display:flex}.nk-tree-item .actions span{padding:0 3px;border-radius:3px;font-size:12px}.nk-tree-item .actions span:hover{background:var(--nk-bg-active)}.nk-tree-children{margin-left:14px;border-left:1px solid var(--nk-border);padding-left:4px;overflow:hidden}.nk-tree-children.collapsed{display:none}.nk-toggle-arrow{width:16px;height:16px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-size:9px;color:var(--nk-text-tertiary);border-radius:3px;transition:transform .15s}.nk-toggle-arrow.open{transform:rotate(90deg)}.nk-kbd-hint{margin-left:auto;display:flex;gap:3px;align-items:center}.nk-kbd{font-family:inherit;font-size:10.5px;background:var(--nk-bg-callout);border:1px solid var(--nk-border-strong);border-bottom-width:2px;border-radius:4px;padding:0 4px}.nk-page-scroll{flex:1;overflow-y:auto}.nk-page-scroll::-webkit-scrollbar{width:10px}.nk-page-scroll::-webkit-scrollbar-thumb{background:var(--nk-border-strong);border-radius:5px;border:2px solid var(--nk-bg)}.nk-cover{height:200px;background:radial-gradient(ellipse at 20% 40%,color-mix(in srgb,var(--nk-decor-purple) 35%,transparent),transparent 55%),radial-gradient(ellipse at 80% 20%,color-mix(in srgb,var(--nk-decor-blue) 35%,transparent),transparent 55%),radial-gradient(ellipse at 60% 90%,color-mix(in srgb,var(--nk-decor-orange) 25%,transparent),transparent 55%),var(--nk-bg-callout)}.nk-page{max-width:760px;margin:0 auto;padding:24px max(64px,env(safe-area-inset-right,0px)) 120px max(64px,env(safe-area-inset-left,0px));font-size:16px;line-height:1.5}.nk-cover+.nk-page,.nk-page.covered{padding-top:0}.nk-page ::slotted(.nk-page-icon),.nk-page ::slotted([slot=icon]),.nk-page-icon{font-size:64px;line-height:1;margin-top:0;cursor:pointer;user-select:none;display:inline-block}.nk-cover+.nk-page .nk-page-icon,.nk-cover+.nk-page ::slotted(.nk-page-icon),.nk-cover+.nk-page ::slotted([slot=icon]),.nk-page.covered .nk-page-icon,.nk-page.covered ::slotted(.nk-page-icon),.nk-page.covered ::slotted([slot=icon]){margin-top:-42px}.nk-page-title{font-size:40px;font-weight:700;line-height:1.2;margin:8px 0 4px;outline:0;letter-spacing:0}.nk-page-meta{color:var(--nk-text-tertiary);font-size:13px;margin-bottom:24px;display:flex;gap:16px}.nk-page p.lead{font-size:16px;line-height:1.6;color:var(--nk-text-secondary);margin-bottom:20px}.nk-page ::slotted(p.lead){font-size:16px;line-height:1.6;color:var(--nk-text-secondary);margin-bottom:20px!important}.nk-heading{font-size:24px;font-weight:600;line-height:1.3;margin:32px 0 10px;display:flex;align-items:center;gap:8px}.nk-callout{display:flex;gap:10px;align-items:flex-start;background:var(--nk-bg-callout);border-radius:var(--nk-radius);padding:16px 16px 16px 12px;margin:16px 0;line-height:1.5}.nk-callout .c-icon,.nk-callout ::slotted(.c-icon),.nk-callout ::slotted([slot=icon]){font-size:17px}.nk-todo{display:flex;align-items:flex-start;gap:8px;padding:4px 0}.nk-todo input[type=checkbox]{appearance:none;width:16px;height:16px;margin-top:3px;border:1.4px solid var(--nk-border-strong);border-radius:2px;cursor:pointer;flex-shrink:0;position:relative;background:var(--nk-bg)}.nk-todo input[type=checkbox]:checked{background:var(--nk-accent);border-color:var(--nk-accent)}.nk-todo input[type=checkbox]:checked::after{content:"โ";color:var(--nk-on-accent);font-size:11px;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.nk-todo input:checked+span{text-decoration:line-through;color:var(--nk-text-tertiary)}.nk-todo input:disabled{opacity:.5;cursor:not-allowed}.nk-toggle{margin:6px 0}.nk-toggle summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:6px;padding:4px 6px;border-radius:var(--nk-radius);font-weight:500;user-select:none}.nk-toggle summary::-webkit-details-marker{display:none}.nk-toggle summary:hover{background:var(--nk-bg-hover)}.nk-toggle summary::before{content:"โธ";color:var(--nk-text-tertiary);font-size:11px;transition:transform .15s;display:inline-block}.nk-toggle[open] summary::before{transform:rotate(90deg)}.nk-toggle .toggle-body,.nk-toggle ::slotted(.toggle-body){padding:4px 0 8px 26px;color:var(--nk-text-secondary);line-height:1.55}.nk-divider{border:none;border-top:1px solid var(--nk-border);margin:24px 0}.nk-quote{border-left:3px solid var(--nk-text);padding:2px 0 2px 14px;margin:16px 0;color:var(--nk-text-secondary);line-height:1.5}.nk-quote .q-cite{display:block;margin-top:6px;font-size:12.5px;color:var(--nk-text-tertiary)}.nk-mention{display:inline-flex;align-items:center;gap:4px;padding:0 4px;border-radius:4px;font-weight:500;cursor:pointer;white-space:nowrap}.nk-mention:hover{background:var(--nk-bg-hover)}.nk-mention.person{color:var(--nk-text)}.nk-mention.person .mini-avatar,.nk-mention.person ::slotted(.mini-avatar),.nk-mention.person ::slotted([slot=avatar]){width:16px;height:16px;border-radius:50%;color:var(--nk-on-accent);font-size:8.5px;font-weight:600;display:inline-flex;align-items:center;justify-content:center}.nk-mention.page{color:var(--nk-text-secondary);text-decoration:underline;text-decoration-color:var(--nk-border-strong);text-underline-offset:2px}.nk-mention.date{color:var(--nk-color-orange)}.nk-inline-code{font-family:var(--nk-font-mono);font-size:85%;color:var(--nk-danger);background:color-mix(in srgb,var(--nk-danger) 8%,transparent);border-radius:4px;padding:1px 5px}.nk-code{background:var(--nk-bg-code);border:1px solid var(--nk-border);border-radius:var(--nk-radius);padding:20px 24px;font-family:var(--nk-font-mono);font-size:13px;line-height:1.6;margin:14px 0;overflow-x:auto;color:var(--nk-text-secondary);white-space:pre;position:relative}.nk-code .lang{position:absolute;top:6px;right:10px;font-size:11px;color:var(--nk-text-tertiary);font-family:var(--nk-font)}.nk-code .tag,.nk-code ::slotted(.tag){color:var(--nk-accent)}.nk-code .attr,.nk-code ::slotted(.attr){color:var(--nk-color-orange)}.nk-database{margin:12px 0 8px}.nk-db-tabs{display:flex;gap:2px;align-items:center;padding:0 0 6px;margin-bottom:0;font-size:14px}.nk-db-tab{padding:4px 8px;cursor:pointer;color:var(--nk-text-secondary);border-radius:var(--nk-radius);user-select:none;line-height:20px;display:flex;align-items:center;gap:6px}.nk-db-tab:hover{color:var(--nk-text);background:var(--nk-bg-hover)}.nk-db-tab.active{color:var(--nk-text);background:var(--nk-bg-active);font-weight:500}.nk-db-tab .badge,.nk-db-tab ::slotted(.badge){background:var(--nk-bg-callout);border-radius:8px;font-size:11px;padding:0 6px;color:var(--nk-text-tertiary)}.nk-table-wrap{overflow-x:auto}.nk-table{width:100%;border-collapse:collapse;font-size:14px}.nk-table th{text-align:left;font-weight:400;color:var(--nk-text-secondary);height:36px;padding:0 8px;border-bottom:1px solid var(--nk-border);border-right:1px solid var(--nk-border);font-size:14px;white-space:nowrap;user-select:none;cursor:pointer}.nk-table th:hover{background:var(--nk-bg-hover)}.nk-table th .th-icon,.nk-table th ::slotted(.th-icon){margin-right:6px;font-size:13px;color:var(--nk-text-tertiary)}.nk-table td{height:36px;padding:6px 8px;line-height:1.5;border-bottom:1px solid var(--nk-border);border-right:1px solid var(--nk-border);white-space:nowrap;vertical-align:middle}.nk-table td:last-child,.nk-table th:last-child{border-right:none}.nk-table td.wrap,.nk-table.wrap td{white-space:normal;vertical-align:top}.nk-table tbody tr:hover{background:var(--nk-bg-hover)}.nk-table .row-title{display:flex;align-items:center;gap:7px;font-weight:500;cursor:pointer}.nk-table .row-title:hover{text-decoration:underline;text-decoration-color:var(--nk-text-tertiary)}.nk-table .date-cell{color:var(--nk-text-secondary)}.nk-table .person-cell{display:flex;align-items:center;gap:6px;color:var(--nk-text-secondary)}.nk-table .person-cell .mini-avatar,.nk-table .person-cell ::slotted(.mini-avatar){width:20px;height:20px;border-radius:50%;font-size:10px;color:var(--nk-on-accent);display:inline-flex;align-items:center;justify-content:center;font-weight:600}.nk-new-row,.nk-table .new-row{color:var(--nk-text-tertiary);cursor:pointer;padding:8px;display:flex;align-items:center;gap:7px;font-size:14px}.nk-new-row:hover,.nk-table .new-row:hover{background:var(--nk-bg-hover)}.nk-tag{display:inline-flex;align-items:center;max-width:100%;height:20px;padding:0 6px;border-radius:3px;font-size:14px;font-weight:400;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;background:var(--nk-tag-gray-bg);color:var(--nk-tag-gray-text)}.nk-tag.gray{background:var(--nk-tag-gray-bg);color:var(--nk-tag-gray-text)}.nk-tag.brown{background:var(--nk-tag-brown-bg);color:var(--nk-tag-brown-text)}.nk-tag.orange{background:var(--nk-tag-orange-bg);color:var(--nk-tag-orange-text)}.nk-tag.yellow{background:var(--nk-tag-yellow-bg);color:var(--nk-tag-yellow-text)}.nk-tag.green{background:var(--nk-tag-green-bg);color:var(--nk-tag-green-text)}.nk-tag.blue{background:var(--nk-tag-blue-bg);color:var(--nk-tag-blue-text)}.nk-tag.purple{background:var(--nk-tag-purple-bg);color:var(--nk-tag-purple-text)}.nk-tag.pink{background:var(--nk-tag-pink-bg);color:var(--nk-tag-pink-text)}.nk-tag.red{background:var(--nk-tag-red-bg);color:var(--nk-tag-red-text)}.nk-progress{width:110px;height:6px;border-radius:3px;background:var(--nk-tint-blue);overflow:hidden;display:inline-block}.nk-progress>i{display:block;height:100%;background:var(--nk-color-blue);border-radius:3px}.nk-progress-label{font-size:12px;color:var(--nk-text-tertiary);margin-left:7px}.nk-board{display:none;gap:12px;padding:14px 2px;overflow-x:auto}.nk-board.active{display:flex}.nk-board-col{min-width:220px;width:220px;flex-shrink:0}.nk-board-col-header{display:flex;align-items:center;gap:7px;margin-bottom:8px;font-size:13.5px;font-weight:500}.nk-board-col-header .count{color:var(--nk-text-tertiary);font-weight:400}.nk-card{background:var(--nk-bg-card);border:1px solid var(--nk-border);border-radius:8px;padding:10px 12px;margin-bottom:8px;cursor:grab;box-shadow:var(--nk-shadow-card);transition:border-color .15s}.nk-card:hover{border-color:var(--nk-border-strong)}.nk-card .card-title,.nk-card ::slotted(.card-title){font-weight:500;margin-bottom:7px;display:flex;gap:6px;align-items:center}.nk-card .card-meta,.nk-card ::slotted(.card-meta){display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:12px;color:var(--nk-text-secondary)}.nk-field{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:9px 0}.nk-field .f-label,.nk-field ::slotted(.f-label),.nk-field ::slotted([slot=label]){font-size:14px}.nk-field .f-desc,.nk-field ::slotted(.f-desc),.nk-field ::slotted([slot=desc]){font-size:12px;color:var(--nk-text-secondary);margin-top:2px;line-height:1.45}.nk-field .f-control,.nk-field ::slotted(.f-control){flex-shrink:0}.nk-field.stacked,.nk-fields>.nk-field{flex-direction:column;align-items:stretch;gap:6px;min-width:0}.nk-field.stacked .f-control,.nk-field.stacked .nk-input,.nk-field.stacked .nk-select,.nk-field.stacked .nk-textarea,.nk-fields>.nk-field .f-control,.nk-fields>.nk-field .nk-input,.nk-fields>.nk-field .nk-select,.nk-fields>.nk-field .nk-textarea{width:100%;min-width:0}.nk-field.compact,.nk-fields>.nk-field{padding:0;gap:4px;min-width:0}.nk-field.compact .f-label,.nk-field.compact ::slotted([slot=label]),.nk-fields>.nk-field .f-label,.nk-fields>.nk-field ::slotted([slot=label]){font-size:12px;color:var(--nk-text-tertiary)}.nk-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px 12px;padding:9px 0}.nk-fields>.nk-field{min-width:0}.nk-input,.nk-select,.nk-textarea{font-family:inherit;font-size:14px;line-height:20px;color:var(--nk-text);background:var(--nk-bg-input);border:1px solid var(--nk-border);border-radius:var(--nk-radius);padding:5px 10px;outline:0;transition:border-color .15s,box-shadow .15s;min-width:210px}.nk-input:hover,.nk-select:hover,.nk-textarea:hover{border-color:var(--nk-border-strong)}.nk-input:focus,.nk-select:focus,.nk-textarea:focus{border-color:color-mix(in srgb,var(--nk-accent) 60%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--nk-accent) 30%,transparent)}.nk-input::placeholder,.nk-textarea::placeholder{color:var(--nk-text-tertiary)}.nk-input.wide,.nk-select.wide,.nk-textarea.wide{width:100%;min-width:0}.nk-input[type=date],.nk-input[type=datetime-local],.nk-input[type=month],.nk-input[type=time]{appearance:none}.nk-input::-webkit-date-and-time-value{text-align:start;min-height:1lh}.nk-select.compact{min-width:120px}.nk-textarea{resize:vertical;min-height:70px;line-height:1.5}.nk-select{appearance:none;cursor:pointer;padding-right:26px;background-image:linear-gradient(45deg,transparent 50%,var(--nk-text-tertiary) 50%),linear-gradient(135deg,var(--nk-text-tertiary) 50%,transparent 50%);background-position:calc(100% - 14px) 55%,calc(100% - 10px) 55%;background-size:4px 4px;background-repeat:no-repeat}.nk-btn{font-family:inherit;font-size:14px;line-height:20px;font-weight:500;border-radius:var(--nk-radius);cursor:pointer;padding:3px 12px;border:1px solid transparent;transition:background .15s,border-color .15s,box-shadow .15s,opacity .15s;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.nk-btn ::slotted(svg),.nk-btn svg{width:15px;height:15px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.nk-btn.primary{background:var(--nk-accent);color:var(--nk-on-accent)}.nk-btn.primary:hover{opacity:.88}.nk-btn.secondary{background:var(--nk-bg-card);color:var(--nk-text);box-shadow:var(--nk-shadow-btn)}.nk-btn.secondary:hover{background:color-mix(in srgb,var(--nk-bg-card),var(--nk-text) 6%)}.nk-btn.danger{background:var(--nk-bg-card);color:var(--nk-danger);box-shadow:var(--nk-shadow-btn)}.nk-btn.danger:hover{background:color-mix(in srgb,var(--nk-danger) 8%,var(--nk-bg-card))}.nk-btn.danger-solid{background:var(--nk-danger);color:var(--nk-on-accent)}.nk-btn.danger-solid:hover{opacity:.88}.nk-btn.small{padding:1px 8px;font-size:13px;line-height:20px}a.nk-btn{text-decoration:none}.nk-btn:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.nk-switch{position:relative;width:34px;height:20px;flex-shrink:0;appearance:none;border:none;cursor:pointer;border-radius:20px;background:var(--nk-border-strong);transition:background .2s}.nk-switch::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--nk-on-accent);transition:transform .2s;box-shadow:var(--nk-shadow-knob)}.nk-switch:checked,.nk-switch[aria-checked=true]{background:var(--nk-accent)}.nk-switch:checked::after,.nk-switch[aria-checked=true]::after{transform:translateX(14px)}.nk-switch:disabled{opacity:.5;cursor:not-allowed}.nk-switch-label{display:inline-flex;align-items:flex-start;gap:8px;font-size:14px;cursor:pointer}.nk-switch-label>.nk-switch{font-size:inherit;line-height:inherit;margin-top:max(0px,calc((1lh - 20px)/ 2))}.nk-switch-label>span{padding-top:max(0px,calc((20px - 1lh)/ 2))}.nk-switch-label:has(.nk-switch:disabled){cursor:not-allowed;color:var(--nk-text-tertiary)}.nk-check{display:flex;align-items:flex-start;gap:8px;padding:4px 0;font-size:14px;cursor:pointer}.nk-check input{appearance:none;width:16px;height:16px;flex-shrink:0;border:1.4px solid var(--nk-border-strong);border-radius:3px;cursor:pointer;position:relative;background:var(--nk-bg);font-size:inherit;line-height:inherit;margin-top:max(0px,calc((1lh - 16px)/ 2))}.nk-check input[type=radio]{border-radius:50%}.nk-check input:checked{background:var(--nk-accent);border-color:var(--nk-accent)}.nk-check input:checked::after{content:"โ";color:var(--nk-on-accent);font-size:10.5px;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.nk-check input[type=radio]:checked::after{content:"โ";font-size:7px}.nk-check input:disabled{opacity:.5;cursor:not-allowed}.nk-check input:disabled+*{opacity:.6}.nk-slider{width:210px;accent-color:var(--nk-accent);cursor:pointer}.nk-slider-value{font-size:12.5px;color:var(--nk-text-tertiary);margin-top:3px}.nk-profile-row{display:flex;align-items:center;gap:14px;padding:8px 0}.nk-profile-row .big-avatar,.nk-profile-row ::slotted(.big-avatar),.nk-profile-row ::slotted([slot=avatar]){width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,var(--nk-decor-purple),var(--nk-decor-blue));color:var(--nk-on-accent);font-size:20px;font-weight:600;display:flex;align-items:center;justify-content:center}.nk-model-card{border:1px solid var(--nk-border-strong);border-radius:8px;padding:12px 14px;margin-bottom:10px;cursor:pointer;display:flex;align-items:flex-start;gap:11px;transition:border-color .15s,background .15s}.nk-model-card:hover{background:var(--nk-bg-hover)}.nk-model-card.selected{border-color:var(--nk-accent);background:color-mix(in srgb,var(--nk-accent) 6%,transparent)}.nk-model-card .m-radio{width:15px;height:15px;border-radius:50%;flex-shrink:0;margin-top:2px;border:1.4px solid var(--nk-border-strong);position:relative}.nk-model-card.selected .m-radio{border-color:var(--nk-accent)}.nk-model-card.selected .m-radio::after{content:"";position:absolute;inset:3px;border-radius:50%;background:var(--nk-accent)}.nk-model-card .m-name,.nk-model-card ::slotted(.m-name),.nk-model-card ::slotted([slot=title]){font-weight:500;font-size:14px;display:flex;align-items:center;gap:7px}.nk-model-card .m-desc,.nk-model-card ::slotted(.m-desc),.nk-model-card ::slotted([slot=desc]){font-size:12px;color:var(--nk-text-secondary);margin-top:2px;line-height:1.45}.nk-danger-zone{border:1px solid color-mix(in srgb,var(--nk-danger) 40%,transparent);border-radius:8px;padding:14px 16px;margin-top:26px}.nk-danger-zone .dz-title{color:var(--nk-danger);font-weight:600;font-size:13px;margin-bottom:8px}.nk-member-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--nk-border)}.nk-member-list ::slotted(.nk-member-row:last-child),.nk-member-list>.nk-member-row:last-child,.nk-member-row.last{border-bottom:none}.nk-member-row .mini-avatar,.nk-member-row ::slotted(.mini-avatar),.nk-member-row ::slotted([slot=avatar]){width:28px;height:28px;border-radius:50%;color:var(--nk-on-accent);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;flex-shrink:0}.nk-member-row>:has(> .m-mail){min-width:0}.nk-member-row .m-mail{font-size:12px;color:var(--nk-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nk-member-row .nk-select{min-width:120px;margin-left:auto}.nk-member-row ::slotted([slot=role]){margin-left:auto}.nk-modal-backdrop{position:fixed;inset:0;background:var(--nk-scrim);padding:env(safe-area-inset-top,0) env(safe-area-inset-right,0) env(safe-area-inset-bottom,0) env(safe-area-inset-left,0);display:flex;align-items:center;justify-content:center;z-index:100;opacity:0;pointer-events:none;transition:opacity .2s}.nk-modal-backdrop.open{opacity:1;pointer-events:auto}.nk-modal{width:min(1150px,92vw);height:min(715px,86vh);max-width:100%;max-height:100%;background:var(--nk-bg);border-radius:10px;box-shadow:var(--nk-shadow-menu);display:flex;overflow:hidden;transform:scale(.98) translateY(6px);transition:transform .2s}.nk-modal-backdrop.open .nk-modal{transform:scale(1) translateY(0)}.nk-settings-nav{width:240px;min-width:240px;background:var(--nk-bg-sidebar);border-right:1px solid var(--nk-border);padding:10px 8px;overflow-y:auto;flex-shrink:0}.nk-settings-user{display:flex;align-items:center;gap:9px;padding:6px 10px 12px;margin-bottom:4px}.nk-settings-user .avatar,.nk-settings-user ::slotted(.avatar),.nk-settings-user ::slotted([slot=avatar]){width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--nk-decor-purple),var(--nk-decor-blue));color:var(--nk-on-accent);font-weight:600;font-size:13px;display:flex;align-items:center;justify-content:center}.nk-settings-user .name{font-weight:500;font-size:14px}.nk-settings-user .mail{font-size:12px;color:var(--nk-text-secondary)}.nk-settings-nav .nk-tree-item{min-height:28px}.nk-settings-nav .nk-tree-item.active{background:var(--nk-bg-active);color:var(--nk-text);font-weight:500}.nk-settings-content{flex:1;overflow-y:auto;padding:36px 60px 80px;min-width:0}.nk-settings-content::-webkit-scrollbar{width:10px}.nk-settings-content::-webkit-scrollbar-thumb{background:var(--nk-border-strong);border-radius:5px;border:2px solid var(--nk-bg)}.nk-settings-pane{display:none;max-width:800px}.nk-settings-pane.active{display:block}.nk-settings-pane>h2{font-size:22px;font-weight:600;line-height:1.3;margin-bottom:20px}.nk-settings-pane>h3{font-size:16px;font-weight:500;padding-bottom:8px;border-bottom:1px solid var(--nk-border);margin:30px 0 12px}.nk-settings-pane ::slotted(h2){font-size:22px;font-weight:600;line-height:1.3;padding:0!important;margin:0 0 20px!important}.nk-settings-pane ::slotted(h3){font-size:16px;font-weight:500;border:0;border-bottom:1px solid var(--nk-border);padding:0 0 8px!important;margin:30px 0 12px!important}.nk-pop{background:var(--nk-bg);border-radius:10px;box-shadow:var(--nk-shadow-menu);padding:10px;width:296px}.nk-emoji-search{width:100%;font-family:inherit;font-size:14px;color:var(--nk-text);background:var(--nk-bg-input);border:1px solid var(--nk-border);border-radius:var(--nk-radius);padding:6px 10px;outline:0;margin-bottom:8px}.nk-emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:2px}.nk-emoji-grid ::slotted(span),.nk-emoji-grid span{font-size:18px;text-align:center;padding:4px 0;border-radius:5px;cursor:pointer;user-select:none}.nk-emoji-grid span:hover{background:var(--nk-bg-hover)}.nk-emoji-cats{display:flex;gap:2px;margin-top:8px;padding-top:8px;border-top:1px solid var(--nk-border)}.nk-emoji-cats span{font-size:14px;padding:3px 7px;border-radius:5px;cursor:pointer;color:var(--nk-text-tertiary);filter:grayscale(1);opacity:.6}.nk-emoji-cats span.active,.nk-emoji-cats span:hover{filter:none;opacity:1;background:var(--nk-bg-hover)}.nk-menu{padding:5px;width:230px}.nk-menu-item{display:flex;align-items:center;gap:9px;padding:4px 8px;min-height:28px;border-radius:5px;cursor:pointer;font-size:14px;user-select:none}.nk-menu-item:hover{background:var(--nk-bg-hover)}.nk-menu-item .m-icon,.nk-menu-item ::slotted(.m-icon),.nk-menu-item ::slotted([slot=icon]){width:17px;text-align:center;font-size:14px}.nk-menu-item .m-shortcut,.nk-menu-item ::slotted(.m-shortcut){margin-left:auto;font-size:12px;color:var(--nk-text-tertiary)}.nk-menu-item.danger{color:var(--nk-danger)}.nk-menu-sep{border-top:1px solid var(--nk-border);margin:5px 4px}.nk-menu-label{font-size:12px;color:var(--nk-text-tertiary);padding:5px 8px 2px}.nk-cmdk-backdrop{position:fixed;inset:0;background:var(--nk-scrim-soft);display:flex;justify-content:center;align-items:flex-start;padding:max(14vh,env(safe-area-inset-top,0px)) env(safe-area-inset-right,0) env(safe-area-inset-bottom,0) env(safe-area-inset-left,0);z-index:110;opacity:0;pointer-events:none;transition:opacity .18s}.nk-cmdk-backdrop.open{opacity:1;pointer-events:auto}.nk-cmdk{max-width:100%;width:min(560px,92vw);background:var(--nk-bg);border-radius:12px;box-shadow:var(--nk-shadow-menu);overflow:hidden;transform:scale(.98);transition:transform .18s}.nk-cmdk-backdrop.open .nk-cmdk{transform:scale(1)}.nk-cmdk-input-row{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--nk-border)}.nk-cmdk-input-row input{flex:1;border:none;outline:0;background:0 0;font-family:inherit;font-size:16px;color:var(--nk-text)}.nk-cmdk-input-row input::placeholder{color:var(--nk-text-tertiary)}.nk-cmdk-list{max-height:320px;overflow-y:auto;padding:6px}.nk-cmdk-group{font-size:12px;color:var(--nk-text-tertiary);padding:8px 10px 3px}.nk-cmdk-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:6px;cursor:pointer;font-size:14px;user-select:none}.nk-cmdk-item.selected{background:var(--nk-bg-active)}.nk-cmdk-item .m-icon,.nk-cmdk-item ::slotted(.m-icon),.nk-cmdk-item ::slotted([slot=icon]){width:17px;text-align:center;font-size:14px}.nk-cmdk-item .m-shortcut,.nk-cmdk-item ::slotted(.m-shortcut){margin-left:auto;font-size:12px;color:var(--nk-text-tertiary)}.nk-cmdk-empty{padding:30px;text-align:center;color:var(--nk-text-tertiary);font-size:13.5px}.nk-cmdk-footer{display:flex;gap:14px;padding:8px 16px;border-top:1px solid var(--nk-border);font-size:11.5px;color:var(--nk-text-tertiary)}.nk-toast{position:fixed;bottom:max(20px,calc(env(safe-area-inset-bottom,0px) + 12px));left:50%;transform:translateX(-50%) translateY(80px);z-index:120;width:max-content;max-width:calc(100% - 32px);background:var(--nk-text);color:var(--nk-bg);padding:8px 16px;border-radius:8px;font-size:14px;opacity:0;transition:.3s;pointer-events:none;box-shadow:var(--nk-shadow-menu);display:flex;gap:8px;align-items:center}.nk-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}.nk-gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));gap:20px 32px;margin:12px 0}.nk-g-item>h4{font-size:12px;font-weight:500;color:var(--nk-text-tertiary);text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px}.nk-g-item ::slotted(h4){font-size:12px;font-weight:500;color:var(--nk-text-tertiary);text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px!important}.nk-tabs{display:flex;gap:2px;border-bottom:1px solid var(--nk-border);font-size:14px}.nk-tab{padding:7px 11px;cursor:pointer;color:var(--nk-text-secondary);border-bottom:2px solid transparent;margin-bottom:-1px;user-select:none}.nk-tab:hover{color:var(--nk-text)}.nk-tab.active{color:var(--nk-text);border-bottom-color:var(--nk-text);font-weight:500}.nk-tab-panel{padding:12px 2px;color:var(--nk-text-secondary);line-height:1.55;font-size:14px}.nk-template-btn{display:flex;align-items:center;gap:8px;width:100%;font-family:inherit;font-size:14px;color:var(--nk-text-secondary);background:var(--nk-bg-callout);border:none;border-radius:var(--nk-radius);padding:8px 12px;cursor:pointer;margin-bottom:6px;text-align:left}.nk-template-btn:hover{background:var(--nk-bg-hover)}.nk-stats{display:flex;gap:10px}.nk-stat{flex:1;border:1px solid var(--nk-border);border-radius:8px;padding:12px 14px}.nk-stat .s-label,.nk-stat ::slotted(.s-label),.nk-stat ::slotted([slot=label]){font-size:12px;color:var(--nk-text-secondary);margin-bottom:4px}.nk-stat .s-value,.nk-stat ::slotted(.s-value),.nk-stat ::slotted([slot=value]){font-size:22px;font-weight:600;letter-spacing:-.01em}.nk-stat .s-delta,.nk-stat ::slotted(.s-delta),.nk-stat ::slotted([slot=delta]){font-size:12px;margin-top:3px}.nk-stat .s-delta.up,.nk-stat ::slotted(.s-delta.up),.nk-stat ::slotted([slot=delta].up){color:var(--nk-color-green)}.nk-stat .s-delta.down,.nk-stat ::slotted(.s-delta.down),.nk-stat ::slotted([slot=delta].down){color:var(--nk-danger)}.nk-synced{border:1.5px solid color-mix(in srgb,var(--nk-danger) 55%,transparent);border-radius:8px;padding:12px 14px;position:relative;margin:8px 0}.nk-synced .synced-badge{position:absolute;top:-9px;right:10px;font-size:11px;background:var(--nk-danger);color:var(--nk-on-accent);border-radius:8px;padding:1px 8px}.nk-segmented{display:inline-flex;background:var(--nk-bg-callout);border-radius:7px;padding:2px}.nk-segmented button{font-family:inherit;font-size:14px;border:none;background:0 0;color:var(--nk-text-secondary);padding:4px 12px;border-radius:5px;cursor:pointer}.nk-segmented ::slotted(button){font-family:inherit;font-size:14px;border:none;background:0 0;color:var(--nk-text-secondary);padding:4px 12px!important;border-radius:5px;cursor:pointer}.nk-segmented ::slotted(button.active),.nk-segmented button.active{background:var(--nk-bg);color:var(--nk-text);font-weight:500;box-shadow:var(--nk-shadow-segment)}.nk-segmented.wrap{flex-wrap:wrap}.nk-segmented.scroll{max-width:100%;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}.nk-segmented.scroll::-webkit-scrollbar{display:none}.nk-segmented.scroll ::slotted(button),.nk-segmented.scroll button{flex-shrink:0;white-space:nowrap}.nk-banner{display:flex;align-items:center;gap:10px;font-size:14px;border-radius:8px;padding:10px 14px;margin-bottom:8px;color:var(--nk-text)}.nk-banner.info{background:var(--nk-tint-blue)}.nk-banner.success{background:var(--nk-tint-green)}.nk-banner.warning{background:var(--nk-tint-yellow)}.nk-banner.danger{background:var(--nk-tint-red)}.nk-banner .b-action,.nk-banner ::slotted(.b-action),.nk-banner ::slotted([slot=action]){margin-left:auto;font-weight:500;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.nk-avatar-group{display:flex}.nk-avatar-group .mini-avatar,.nk-avatar-group ::slotted(.mini-avatar){width:26px;height:26px;border-radius:50%;color:var(--nk-on-accent);font-size:10.5px;font-weight:600;border:2px solid var(--nk-bg);display:flex;align-items:center;justify-content:center;margin-left:-7px}.nk-avatar-group .mini-avatar:first-child,.nk-avatar-group ::slotted(.mini-avatar:first-child){margin-left:0}.nk-avatar-group .more,.nk-avatar-group ::slotted(.more){background:var(--nk-bg-callout);color:var(--nk-text-secondary)}.nk-skeleton{border-radius:5px;margin-bottom:10px;background:linear-gradient(90deg,var(--nk-bg-callout) 25%,var(--nk-bg-hover) 50%,var(--nk-bg-callout) 75%);background-size:200% 100%;animation:1.6s infinite nk-shimmer}@keyframes nk-shimmer{to{background-position:-200% 0}}.nk-empty{text-align:center;padding:36px 20px;border:1.5px dashed var(--nk-border-strong);border-radius:10px;color:var(--nk-text-tertiary)}.nk-empty .e-icon,.nk-empty ::slotted(.e-icon),.nk-empty ::slotted([slot=icon]){font-size:30px;margin-bottom:8px}.nk-empty .e-title,.nk-empty ::slotted(.e-title),.nk-empty ::slotted([slot=title]){font-weight:500;color:var(--nk-text-secondary);margin-bottom:3px;font-size:14px}.nk-empty .e-desc,.nk-empty ::slotted(.e-desc),.nk-empty ::slotted([slot=desc]){font-size:13px;margin-bottom:12px}.nk-empty .e-actions,.nk-empty ::slotted(.e-actions){display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.nk-comments{border-left:1px solid var(--nk-border);padding:4px 0 4px 18px;margin:8px 0 8px 8px}.nk-comment{display:flex;gap:9px;margin-bottom:14px}.nk-comment .mini-avatar,.nk-comment ::slotted(.mini-avatar),.nk-comment ::slotted([slot=avatar]){width:24px;height:24px;border-radius:50%;color:var(--nk-on-accent);flex-shrink:0;font-size:10px;font-weight:600;display:flex;align-items:center;justify-content:center}.nk-comment .c-head,.nk-comment ::slotted(.c-head){font-size:12px;color:var(--nk-text-tertiary);margin-bottom:2px}.nk-comment .c-head b{color:var(--nk-text);font-weight:600}.nk-comment .c-body,.nk-comment ::slotted(.c-body){font-size:14px;line-height:1.5}.nk-comment-input{display:flex;gap:8px;align-items:center;margin-top:4px}.nk-comment-input input{min-width:0;flex:1}.nk-ai-thread{display:flex;flex-direction:column;gap:14px}.nk-ai-msg{display:flex;gap:9px}.nk-ai-msg .mini-avatar,.nk-ai-msg ::slotted(.mini-avatar),.nk-ai-msg ::slotted([slot=avatar]){width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;background:var(--nk-bg-callout)}.nk-ai-msg.user .mini-avatar,.nk-ai-msg.user ::slotted(.mini-avatar),.nk-ai-msg.user ::slotted([slot=avatar]){background:linear-gradient(135deg,var(--nk-decor-purple),var(--nk-decor-blue));color:var(--nk-on-accent);font-size:9.5px;font-weight:600}.nk-ai-msg .a-body,.nk-ai-msg ::slotted(.a-body){font-size:14px;line-height:1.55;padding-top:2px}.nk-ai-msg .a-name,.nk-ai-msg ::slotted(.a-name){font-size:12px;font-weight:600;margin-bottom:2px}.nk-ai-msg .a-name span{color:var(--nk-text-tertiary);font-weight:400}.nk-ai-actions{display:flex;gap:4px;margin-top:6px}.nk-ai-actions button{font-family:inherit;font-size:12px;color:var(--nk-text-secondary);background:0 0;border:1px solid var(--nk-border);border-radius:5px;padding:2px 8px;cursor:pointer}.nk-ai-actions ::slotted(button){font-family:inherit;font-size:12px;color:var(--nk-text-secondary);background:0 0;border:1px solid var(--nk-border);border-radius:5px;padding:2px 8px!important;cursor:pointer}.nk-ai-actions ::slotted(button:hover),.nk-ai-actions button:hover{background:var(--nk-bg-hover);color:var(--nk-text)}.nk-ai-input-row{display:flex;align-items:center;gap:8px;margin-top:14px;border:1px solid var(--nk-border-strong);border-radius:10px;padding:8px 12px}.nk-ai-input-row:focus-within{border-color:var(--nk-accent)}.nk-ai-input-row input{flex:1;border:none;outline:0;background:0 0;font-family:inherit;font-size:14px;color:var(--nk-text);min-width:0}.nk-ai-input-row input::placeholder{color:var(--nk-text-tertiary)}.nk-ai-send{border:none;background:var(--nk-accent);color:var(--nk-on-accent);border-radius:6px;width:26px;height:26px;cursor:pointer;font-size:13px;flex-shrink:0}.nk-block-host{position:relative;border-radius:var(--nk-radius);margin:8px 0;padding:2px 0 2px 2px;transition:background .15s,box-shadow .15s}.nk-block-host:hover{background:var(--nk-bg-hover)}.nk-block-host:focus-within{background:0 0;box-shadow:0 0 0 2px color-mix(in srgb,var(--nk-accent) 25%,transparent)}.nk-block-host.nk-drop-target{box-shadow:0 -2px 0 0 var(--nk-accent);background:0 0}.nk-block-host .nk-block-handle,.nk-block-host ::slotted(.nk-block-handle){position:absolute;left:-26px;top:4px;width:18px;height:20px;border-radius:4px;display:flex;align-items:center;justify-content:center;color:var(--nk-text-tertiary);font-size:13px;cursor:grab;opacity:0;transition:opacity .15s;user-select:none}.nk-block-host:hover .nk-block-handle{opacity:1}.nk-block-host .nk-block-actions{position:absolute;display:flex;gap:1px;z-index:2;opacity:0;transition:opacity .15s;pointer-events:none}.nk-block-host .nk-block-actions.show{opacity:1;pointer-events:auto}.nk-block-host .nk-block-actions ::slotted(button),.nk-block-host .nk-block-actions button{width:20px;height:22px;padding:0;border:none;border-radius:4px;background:0 0;color:var(--nk-text-tertiary);font-family:inherit;font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}.nk-block-host .nk-block-actions button:hover{background:var(--nk-bg-hover);color:var(--nk-text)}.nk-block-host .nk-block-actions .drag{cursor:grab}.nk-block-host .nk-block-actions .drag:active{cursor:grabbing}.nk-block-host .ProseMirror{outline:0;font-family:var(--nk-font);font-size:14px;line-height:1.6;color:var(--nk-text);min-height:60px;padding:4px 2px}.nk-block-host .ProseMirror>*+*{margin-top:6px}.nk-block-host .ProseMirror h1{font-size:30px;font-weight:600;letter-spacing:-.01em;margin:24px 0 6px}.nk-block-host .ProseMirror h2{font-size:22px;font-weight:600;margin:20px 0 6px}.nk-block-host .ProseMirror h3{font-size:17px;font-weight:600;margin:16px 0 4px}.nk-block-host .ProseMirror p{margin:0}.nk-block-host .ProseMirror ol,.nk-block-host .ProseMirror ul{padding-left:24px;margin:4px 0}.nk-block-host .ProseMirror ul{list-style:disc}.nk-block-host .ProseMirror ol{list-style:decimal}.nk-block-host .ProseMirror li{margin:2px 0}.nk-block-host .ProseMirror li::marker{color:var(--nk-text-tertiary)}.nk-block-host .ProseMirror ul[data-type=taskList]{list-style:none;padding-left:2px}.nk-block-host .ProseMirror ul[data-type=taskList] li{display:flex;gap:8px;align-items:flex-start}.nk-block-host .ProseMirror ul[data-type=taskList] li>label{flex-shrink:0;margin-top:3px;user-select:none}.nk-block-host .ProseMirror ul[data-type=taskList] li>div{flex:1;min-width:0}.nk-block-host .ProseMirror ul[data-type=taskList] input[type=checkbox]{appearance:none;width:16px;height:16px;margin:0;border:1.4px solid var(--nk-border-strong);border-radius:2px;cursor:pointer;position:relative;background:var(--nk-bg);display:block}.nk-block-host .ProseMirror ul[data-type=taskList] input[type=checkbox]:checked{background:var(--nk-accent);border-color:var(--nk-accent)}.nk-block-host .ProseMirror ul[data-type=taskList] input[type=checkbox]:checked::after{content:"โ";color:var(--nk-on-accent);font-size:11px;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.nk-block-host .ProseMirror li[data-checked=true]>div{text-decoration:line-through;color:var(--nk-text-tertiary)}.nk-block-host .ProseMirror-gapcursor::after{border-top-color:var(--nk-text)}.nk-block-host .ProseMirror .ProseMirror-selectednode{background:color-mix(in srgb,var(--nk-accent) 8%,transparent)}.nk-block-host .ProseMirror blockquote{border-left:3px solid var(--nk-text);padding:2px 0 2px 14px;margin:12px 0;color:var(--nk-text-secondary)}.nk-block-host .ProseMirror code{font-family:var(--nk-font-mono);font-size:85%;color:var(--nk-danger);background:color-mix(in srgb,var(--nk-danger) 8%,transparent);border-radius:4px;padding:1px 5px}.nk-block-host .ProseMirror pre{background:var(--nk-bg-code);border:1px solid var(--nk-border);border-radius:var(--nk-radius);padding:16px 20px;margin:12px 0;font-family:var(--nk-font-mono);font-size:13px;line-height:1.6;color:var(--nk-text-secondary);overflow-x:auto}.nk-block-host .ProseMirror pre code{background:0 0;color:inherit;padding:0;font-size:inherit}.nk-block-host .ProseMirror hr{border:none;border-top:1px solid var(--nk-border);margin:20px 0}.nk-block-host .ProseMirror a{color:var(--nk-accent);text-decoration:underline;text-underline-offset:2px}.nk-block-host .ProseMirror-selectednode{box-shadow:0 0 0 2px color-mix(in srgb,var(--nk-accent) 35%,transparent);border-radius:3px}.nk-block-host .ProseMirror ::selection{background:color-mix(in srgb,var(--nk-accent) 25%,transparent)}.nk-block-host .ProseMirror .is-empty::before,.nk-block-host .ProseMirror p.is-editor-empty:first-child::before{content:attr(data-placeholder);color:var(--nk-text-tertiary);float:left;height:0;pointer-events:none}.nk-block-host .bn-container{font-family:var(--nk-font);color:var(--nk-text);background:0 0}.nk-block-host .bn-editor{padding:4px 2px}.nk-block-host .bn-block-content{font-size:14px;line-height:1.6}.nk-block-host .bn-side-menu{color:var(--nk-text-tertiary)}.nk-block-host .bn-drag-handle{border-radius:4px}.nk-block-host .bn-drag-handle:hover{background:var(--nk-bg-hover)}.nk-block-host .novel-editor{font-family:var(--nk-font);color:var(--nk-text)}.nk-block-host .novel-prose{max-width:none}.nk-block-host .bn-suggestion-menu,.nk-block-host .tippy-box,.nk-slash-menu{background:var(--nk-bg);border-radius:10px;box-shadow:var(--nk-shadow-menu);padding:6px;width:280px;max-height:320px;overflow-y:auto;font-family:var(--nk-font);font-size:14px;color:var(--nk-text)}.nk-slash-menu-label{font-size:12px;color:var(--nk-text-tertiary);padding:6px 9px 2px}.nk-slash-item{display:flex;align-items:center;gap:10px;padding:6px 9px;border-radius:5px;cursor:pointer;user-select:none}.nk-slash-item.selected,.nk-slash-item:hover{background:var(--nk-bg-hover)}.nk-slash-item .m-icon,.nk-slash-item ::slotted(.m-icon){width:28px;height:28px;flex-shrink:0;border-radius:4px;background:var(--nk-bg-callout);border:1px solid var(--nk-border);display:flex;align-items:center;justify-content:center;font-size:15px}.nk-slash-item .m-desc{font-size:12px;color:var(--nk-text-tertiary)}.nk-bubble-menu{display:flex;align-items:center;gap:2px;background:var(--nk-bg);border-radius:8px;box-shadow:var(--nk-shadow-menu);padding:4px}.nk-bubble-menu button{font-family:inherit;font-size:13px;border:none;background:0 0;color:var(--nk-text-secondary);padding:4px 8px;border-radius:5px;cursor:pointer}.nk-bubble-menu ::slotted(button){font-family:inherit;font-size:13px;border:none;background:0 0;color:var(--nk-text-secondary);padding:4px 8px!important;border-radius:5px;cursor:pointer}.nk-bubble-menu ::slotted(button:hover),.nk-bubble-menu button:hover{background:var(--nk-bg-hover);color:var(--nk-text)}.nk-bubble-menu ::slotted(button.active),.nk-bubble-menu button.active{color:var(--nk-accent)}@media (max-width:860px){.nk-sidebar{display:none}.nk-tab-bar{display:flex}.nk-tab-bar.fixed+.nk-tab-bar-spacer{display:block}.nk-page{padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px));padding-bottom:80px}.nk-settings-nav{width:60px;min-width:60px}.nk-settings-nav .label,.nk-settings-nav .nk-section-label,.nk-settings-user .u-text{display:none}.nk-settings-content{padding:24px}.nk-cmdk-backdrop{padding-top:max(6vh,env(safe-area-inset-top,0px))}.nk-cmdk{width:min(560px,96vw)}.nk-stats{flex-wrap:wrap}.nk-breadcrumb{min-width:0}.nk-breadcrumb ::slotted(.crumb:not(:last-child)),.nk-breadcrumb ::slotted(.sep),.nk-breadcrumb>.crumb:not(:last-child),.nk-breadcrumb>.sep,.nk-topbar-actions ::slotted(.nk-topbar-meta),.nk-topbar-meta{display:none}.nk-breadcrumb ::slotted(.crumb:last-child),.nk-breadcrumb>.crumb:last-child{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nk-topbar-actions{flex-shrink:0}.nk-field{flex-wrap:wrap;row-gap:6px}.nk-field .f-control,.nk-field ::slotted(.f-control){max-width:100%;min-width:0}.nk-input,.nk-select,.nk-slider,.nk-textarea{max-width:100%}:root:has(.nk-tab-bar:not([hidden])) .nk-toast{bottom:calc(var(--nk-tab-bar-height) + max(6px,env(safe-area-inset-bottom,0px)) + 6px)}:root:has(.nk-tab-bar.floating:not([hidden])) .nk-toast{bottom:calc(var(--nk-tab-bar-height) + 24px + env(safe-area-inset-bottom,0px))}}@media (prefers-reduced-motion:reduce){.nk-skeleton{animation:none;background:var(--nk-bg-callout)}[class*=nk-],[class*=nk-]::after,[class*=nk-]::before{animation-duration:NaNs!important;animation-iteration-count:1!important;transition-duration:NaNs!important;scroll-behavior:auto!important}}\n/*# sourceMappingURL=notionkit.min.css.map */',s=n+i,r=n+e+i;(new CSSStyleSheet).replaceSync(r);(new CSSStyleSheet).replaceSync(e);const o=new CSSStyleSheet;o.replaceSync(s);const a="__nkDefaultTokensInjected";!function(){if("undefined"==typeof document)return;if(globalThis[a])return;globalThis[a]=!0;const t=new CSSStyleSheet;t.replaceSync(`@layer notionkit-defaults { ${e} }`),document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}();const l=new Set;function h(){return document.documentElement.getAttribute("data-theme")||"light"}"undefined"!=typeof window&&"undefined"!=typeof MutationObserver&&new MutationObserver(function(){const t=h();for(const e of l)e._syncTheme(t)}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const d=new Map;function c(t){let e=d.get(t);return e||(e=new CSSStyleSheet,e.replaceSync(`\n :host { display: ${t}; }\n :host([hidden]) { display: none; }\n .nk-wrapper { display: contents; }\n `),d.set(t,e)),e}class p extends HTMLElement{static get display(){return"contents"}static get hostStyles(){return null}static get observesLightDom(){return!1}static get lightDomObserverInit(){return{childList:!0,subtree:!0,characterData:!0,attributes:!0}}static get slotAssignment(){return"named"}static get observedAttributes(){return[]}constructor(){super(),this._initialized=!1,this._shadow=this.attachShadow({mode:"open",slotAssignment:this.constructor.slotAssignment});const t=[o,c(this.constructor.display)],e=this.constructor.hostStyles;e&&t.push(e),this._shadow.adoptedStyleSheets=t}connectedCallback(){this._initialized?this._wrapper.setAttribute("data-theme",h()):(this._upgradeOwnProperties(),this._initialized=!0,this._wrapper=document.createElement("div"),this._wrapper.className="nk-wrapper",this._wrapper.setAttribute("data-theme",h()),this._shadow.appendChild(this._wrapper),this.render()),this.setupEvents(),l.add(this),this.constructor.observesLightDom&&(this._lightDomObserver??=new MutationObserver(t=>this.projectLightDom(t)),this._lightDomObserver.observe(this,this.constructor.lightDomObserverInit)),"manual"===this.constructor.slotAssignment&&(this.assignSlots(),this._slotObserver??=new MutationObserver(()=>this.assignSlots()),this._slotObserver.observe(this,{childList:!0}))}disconnectedCallback(){l.delete(this),this._lightDomObserver?.disconnect(),this._slotObserver?.disconnect(),this.teardownEvents()}attributeChangedCallback(t,e,n){this._initialized&&e!==n&&this.onAttributeChanged(t,e,n)}_syncTheme(t){this._wrapper?.setAttribute("data-theme",t)}_upgradeOwnProperties(){for(const t of Object.keys(this)){if(t.startsWith("_"))continue;let e,n=Object.getPrototypeOf(this);for(;n&&n!==HTMLElement.prototype&&!(e=Object.getOwnPropertyDescriptor(n,t));)n=Object.getPrototypeOf(n);if(!e?.set)continue;const i=this[t];delete this[t],this[t]=i}}render(){}setupEvents(){}teardownEvents(){}onAttributeChanged(t,e,n){}projectLightDom(){}assignSlots(){}refresh(){this.projectLightDom(),"manual"===this.constructor.slotAssignment&&this.assignSlots()}takeTitle(t=this.getAttribute("title")){return null!==t&&(this._titleText=t,this.removeAttribute("title"),!0)}getBoolAttr(t){return this.hasAttribute(t)}setBoolAttr(t,e){e?this.setAttribute(t,""):this.removeAttribute(t)}createElement(t,e=[],n={}){const i=document.createElement(t);e.length&&i.classList.add(...e);for(const[t,e]of Object.entries(n))null!=e&&!1!==e&&i.setAttribute(t,!0===e?"":e);return i}emit(t,e=null){return this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,cancelable:!0,detail:e}))}}class u extends p{static formAssociated=!0;constructor(){super(),this._internals=this.attachInternals()}get form(){return this._internals.form}get validationMessage(){return this._internals.validationMessage}get validity(){return this._internals.validity}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}connectedCallback(){const t=!this._initialized;super.connectedCallback(),t&&this._formDisabled&&this.onFormDisabled(!0)}formResetCallback(){this.resetValue()}formStateRestoreCallback(t,e){this.restoreValue(t,e)}formDisabledCallback(t){this._formDisabled=t,this._initialized&&this.onFormDisabled(t)}resetValue(){}restoreValue(t,e){}onFormDisabled(t){}setFormValue(t,e){this._internals.setFormValue(t,e)}setValidity(t,e,n){this._internals.setValidity(t,e,n)}syncValidityFrom(t){t&&(t.validity.valid?this._internals.setValidity({}):this._internals.setValidity(t.validity,t.validationMessage,t))}}const b=["primary","secondary","danger","danger-solid","topbar","share"];class g extends p{static get observedAttributes(){return["variant","small","disabled","type","href","title","aria-label"]}render(){this._build()}_build(){const t=this.getAttribute("href"),e=t?this.createElement("a",[],{href:t}):this.createElement("button",[],{type:this.getAttribute("type")||"button"});e.className=this._computeClasses().join(" "),e.appendChild(document.createElement("slot")),this._applyState(e),this._btn?(this._btn.removeEventListener("click",this._onClick),this._btn.replaceWith(e)):this._wrapper.appendChild(e),this._btn=e,this._onClick&&e.addEventListener("click",this._onClick)}_applyState(t){const e=this.getBoolAttr("disabled");"BUTTON"===t.tagName?t.disabled=e:t.setAttribute("aria-disabled",e?"true":"false");const n=this.getAttribute("title");n?t.setAttribute("title",n):t.removeAttribute("title");const i=this.getAttribute("aria-label");i?t.setAttribute("aria-label",i):t.removeAttribute("aria-label")}setupEvents(){this._onClick=t=>{if(this.getBoolAttr("disabled"))return t.preventDefault(),void t.stopPropagation();const e=this.getAttribute("type");if("submit"===e||"reset"===e){const t=this.closest("form");t&&("submit"===e?t.requestSubmit():t.reset())}},this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}onAttributeChanged(t){if(this._btn)switch(t){case"href":this._build();break;case"variant":case"small":this._btn.className=this._computeClasses().join(" ");break;case"type":"BUTTON"===this._btn.tagName&&this._btn.setAttribute("type",this.getAttribute("type")||"button");break;default:this._applyState(this._btn)}}_computeClasses(){const t=this.getAttribute("variant");if("topbar"===t)return["nk-topbar-btn"];if("share"===t)return["nk-topbar-btn","nk-share-btn"];const e=["nk-btn"];return b.includes(t)&&e.push(t),this.getBoolAttr("small")&&e.push("small"),e}focus(t){this._btn?.focus(t)}click(){this._btn?.click()}get variant(){return this.getAttribute("variant")}set variant(t){t?this.setAttribute("variant",t):this.removeAttribute("variant")}get small(){return this.getBoolAttr("small")}set small(t){this.setBoolAttr("small",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get type(){return this.getAttribute("type")||"button"}set type(t){this.setAttribute("type",t)}get href(){return this.getAttribute("href")}set href(t){t?this.setAttribute("href",t):this.removeAttribute("href")}}customElements.define("nk-btn",g);const m=["type","placeholder","name","min","max","step","autocomplete","pattern","maxlength","minlength","inputmode","list","aria-label"],k=["required","disabled","readonly"];class _ extends u{static get observedAttributes(){return["value","wide",...m,...k]}render(){this._input=this.createElement("input",["nk-input"]);for(const t of m)this._forward(t);for(const t of k)this._forward(t);this._input.value=this.getAttribute("value")??"",this._defaultValue=this._input.value,this._syncWide(),this._wrapper.appendChild(this._input),this._syncFormValue()}_forward(t){if(k.includes(t))return void(this._input["readonly"===t?"readOnly":t]=this.getBoolAttr(t)||"disabled"===t&&!!this._formDisabled);const e=this.getAttribute(t);null===e?this._input.removeAttribute(t):this._input.setAttribute(t,e)}_syncWide(){this._input.classList.toggle("wide",this.getBoolAttr("wide"))}setupEvents(){this._onInput=()=>{this._syncFormValue(),this.emit("nk-input",{value:this._input.value,name:this.name})},this._onChange=()=>{this._syncFormValue(),this.emit("nk-change",{value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("input",this._onInput),this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(this._input)return"value"===t?(this._input.value=this.getAttribute("value")??"",void this._syncFormValue()):void("wide"!==t?(this._forward(t),this._syncFormValue()):this._syncWide())}_syncFormValue(){this.setFormValue(this._input.value),this.syncValidityFrom(this._input)}resetValue(){this._input.value=this.getAttribute("value")??"",this._syncFormValue()}restoreValue(t){"string"==typeof t&&(this._input.value=t,this._syncFormValue())}onFormDisabled(t){this._input.disabled=t||this.getBoolAttr("disabled")}focus(t){this._input?.focus(t)}blur(){this._input?.blur()}select(){this._input?.select()}get value(){return this._input?.value??this.getAttribute("value")??""}set value(t){this._input?(this._input.value=t??"",this._syncFormValue()):this.setAttribute("value",t??"")}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("type")||"text"}set type(t){this.setAttribute("type",t)}get placeholder(){return this.getAttribute("placeholder")}set placeholder(t){this.setAttribute("placeholder",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get required(){return this.getBoolAttr("required")}set required(t){this.setBoolAttr("required",t)}get readonly(){return this.getBoolAttr("readonly")}set readonly(t){this.setBoolAttr("readonly",t)}get wide(){return this.getBoolAttr("wide")}set wide(t){this.setBoolAttr("wide",t)}}customElements.define("nk-input",_);const v=["placeholder","name","rows","maxlength","minlength","autocomplete","aria-label"],x=["required","disabled","readonly"];class f extends u{static get observedAttributes(){return["value","wide",...v,...x]}render(){this._input=this.createElement("textarea",["nk-textarea"]);for(const t of[...v,...x])this._forward(t);this._input.value=this.getAttribute("value")??this.textContent.trim(),this._syncWide(),this._wrapper.appendChild(this._input),this._syncFormValue()}_forward(t){if(x.includes(t))return void(this._input["readonly"===t?"readOnly":t]=this.getBoolAttr(t)||"disabled"===t&&!!this._formDisabled);const e=this.getAttribute(t);null===e?this._input.removeAttribute(t):this._input.setAttribute(t,e)}_syncWide(){this._input.classList.toggle("wide",this.getBoolAttr("wide"))}setupEvents(){this._onInput=()=>{this._syncFormValue(),this.emit("nk-input",{value:this._input.value,name:this.name})},this._onChange=()=>{this._syncFormValue(),this.emit("nk-change",{value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("input",this._onInput),this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(this._input)return"value"===t?(this._input.value=this.getAttribute("value")??"",void this._syncFormValue()):void("wide"!==t?(this._forward(t),this._syncFormValue()):this._syncWide())}_syncFormValue(){this.setFormValue(this._input.value),this.syncValidityFrom(this._input)}resetValue(){this._input.value=this.getAttribute("value")??this.textContent.trim(),this._syncFormValue()}restoreValue(t){"string"==typeof t&&(this._input.value=t,this._syncFormValue())}onFormDisabled(t){this._input.disabled=t||this.getBoolAttr("disabled")}focus(t){this._input?.focus(t)}blur(){this._input?.blur()}get value(){return this._input?.value??this.getAttribute("value")??""}set value(t){this._input?(this._input.value=t??"",this._syncFormValue()):this.setAttribute("value",t??"")}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get required(){return this.getBoolAttr("required")}set required(t){this.setBoolAttr("required",t)}get wide(){return this.getBoolAttr("wide")}set wide(t){this.setBoolAttr("wide",t)}}customElements.define("nk-textarea",f);class y extends u{static get observedAttributes(){return["value","name","disabled","required","compact","wide","aria-label"]}static get observesLightDom(){return!0}render(){this._select=this.createElement("select",["nk-select"]),this._forwardAll(),this._wrapper.appendChild(this._select),this._defaultValue=this.getAttribute("value"),this.projectLightDom(),requestAnimationFrame(()=>this.projectLightDom())}_forwardAll(){const t=this.getAttribute("name");t?this._select.setAttribute("name",t):this._select.removeAttribute("name");const e=this.getAttribute("aria-label");e?this._select.setAttribute("aria-label",e):this._select.removeAttribute("aria-label"),this._select.disabled=this.getBoolAttr("disabled")||!!this._formDisabled,this._select.required=this.getBoolAttr("required"),this._select.classList.toggle("compact",this.getBoolAttr("compact")),this._select.classList.toggle("wide",this.getBoolAttr("wide"))}projectLightDom(){if(!this._select)return;const t=[...this.children].filter(t=>t.matches("option, optgroup")),e=t.map(t=>t.outerHTML).join("");if(e===this._optionSignature)return;this._optionSignature=e;const n=this._select.selectedIndex>=0?this._select.value:null;this._select.innerHTML="";for(const e of t)this._select.appendChild(e.cloneNode(!0));this._applyValue(n)||this._applyValue(this.getAttribute("value")),this._syncFormValue()}_applyValue(t){return null!==t&&(!![...this._select.options].some(e=>e.value===t)&&(this._select.value=t,!0))}setupEvents(){this._onChange=()=>{this._syncFormValue(),this.emit("nk-change",{value:this._select.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._select.addEventListener("change",this._onChange)}teardownEvents(){this._select?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(this._select){if("value"===t)return this._applyValue(this.getAttribute("value")),void this._syncFormValue();this._forwardAll(),this._syncFormValue()}}_syncFormValue(){this.setFormValue(this._select.value),this.syncValidityFrom(this._select)}resetValue(){this._applyValue(this._defaultValue)||(this._select.selectedIndex=0),this._syncFormValue()}restoreValue(t){"string"==typeof t&&(this._applyValue(t),this._syncFormValue())}onFormDisabled(t){this._select.disabled=t||this.getBoolAttr("disabled")}focus(t){this._select?.focus(t)}get value(){return this._select?.value??""}set value(t){this._select?(this._select.value=t,this._syncFormValue()):this.setAttribute("value",t)}get selectedIndex(){return this._select?.selectedIndex??-1}get options(){return this._select?.options??[]}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get required(){return this.getBoolAttr("required")}set required(t){this.setBoolAttr("required",t)}get compact(){return this.getBoolAttr("compact")}set compact(t){this.setBoolAttr("compact",t)}get wide(){return this.getBoolAttr("wide")}set wide(t){this.setBoolAttr("wide",t)}}customElements.define("nk-select",y);class w extends u{static get observedAttributes(){return["checked","disabled","name","value","label","text"]}render(){this._row=this.createElement("label",["nk-switch-label"]),this._btn=this.createElement("button",["nk-switch"],{type:"button",role:"switch"}),this._text=document.createElement("span"),this._slot=document.createElement("slot"),this._textNode=document.createTextNode(""),this._slot.appendChild(this._textNode),this._text.appendChild(this._slot),this._row.append(this._btn,this._text),this._defaultChecked=this.getBoolAttr("checked"),this._apply(),this._syncText(),this._wrapper.appendChild(this._row),this._syncFormValue()}_apply(){this._btn.setAttribute("aria-checked",this.getBoolAttr("checked")?"true":"false"),this._btn.disabled=this.getBoolAttr("disabled")||!!this._formDisabled;const t=this.getAttribute("label");t?this._btn.setAttribute("aria-label",t):this._btn.removeAttribute("aria-label")}_syncText(){this._textNode.data=this.getAttribute("text")??"";const t=!(!this.getAttribute("text")&&!this._slot.assignedNodes().some(t=>t.nodeType===Node.ELEMENT_NODE||t.data.trim()));this._text.hidden=!t,this._row.style.display=t?"":"contents"}setupEvents(){this._onClick=()=>this.toggle(),this._onSlot=()=>this._syncText(),this._btn.addEventListener("click",this._onClick),this._slot.addEventListener("slotchange",this._onSlot),this._syncText()}teardownEvents(){this._btn?.removeEventListener("click",this._onClick),this._slot?.removeEventListener("slotchange",this._onSlot)}toggle(){this.getBoolAttr("disabled")||this._formDisabled||(this.checked=!this.checked,this.emit("nk-change",{checked:this.checked,value:this.getAttribute("value")||"on",name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0})))}onAttributeChanged(t){this._btn&&("text"!==t?(this._apply(),this._syncFormValue()):this._syncText())}_syncFormValue(){const t=this.getAttribute("value")||"on";this.setFormValue(this.getBoolAttr("checked")?t:null,this.getBoolAttr("checked")?"checked":"unchecked")}resetValue(){this.setBoolAttr("checked",this._defaultChecked)}restoreValue(t){"checked"!==t&&"unchecked"!==t||this.setBoolAttr("checked","checked"===t)}onFormDisabled(t){this._formDisabled=t,this._apply()}focus(t){this._btn?.focus(t)}get checked(){return this.getBoolAttr("checked")}set checked(t){this.setBoolAttr("checked",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}get text(){return this.getAttribute("text")}set text(t){null==t?this.removeAttribute("text"):this.setAttribute("text",t)}}customElements.define("nk-switch",w);class A extends u{static get observedAttributes(){return["checked","disabled","name","value","text","indeterminate","required"]}render(){const t=this.createElement("label",["nk-check"]);this._input=this.createElement("input",[],{type:"checkbox"});const e=document.createElement("slot");this._text=document.createTextNode(""),e.appendChild(this._text),this._apply(),this._defaultChecked=this.getBoolAttr("checked"),t.appendChild(this._input),t.appendChild(e),this._wrapper.appendChild(t),this._syncFormValue()}_apply(){this._input.checked=this.getBoolAttr("checked"),this._input.indeterminate=this.getBoolAttr("indeterminate"),this._input.disabled=this.getBoolAttr("disabled")||!!this._formDisabled,this._input.required=this.getBoolAttr("required");const t=this.getAttribute("name");t?this._input.setAttribute("name",t):this._input.removeAttribute("name"),this._input.value=this.getAttribute("value")||"on",this._text&&(this._text.data=this.getAttribute("text")??"")}setupEvents(){this._onChange=()=>{this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this.removeAttribute("indeterminate"),this._syncing=!1,this._syncFormValue(),this.emit("nk-change",{checked:this._input.checked,value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(){!this._syncing&&this._input&&(this._apply(),this._syncFormValue())}_syncFormValue(){this.setFormValue(this._input.checked?this._input.value:null,this._input.checked?"checked":"unchecked"),this.syncValidityFrom(this._input)}resetValue(){this.setBoolAttr("checked",this._defaultChecked)}restoreValue(t){"checked"!==t&&"unchecked"!==t||this.setBoolAttr("checked","checked"===t)}onFormDisabled(t){this._formDisabled=t,this._apply()}focus(t){this._input?.focus(t)}get checked(){return this._input?.checked??this.getBoolAttr("checked")}set checked(t){this.setBoolAttr("checked",t)}get indeterminate(){return this.getBoolAttr("indeterminate")}set indeterminate(t){this.setBoolAttr("indeterminate",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get text(){return this.getAttribute("text")}set text(t){null==t?this.removeAttribute("text"):this.setAttribute("text",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}}customElements.define("nk-check",A);const E={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1};function C(t){return(void 0!==t.form?t.form:t.closest("form"))??null}function L(t){const e=t.filter(t=>!t.disabled);if(!e.length)return;const n=e.find(t=>t.checked)||e[0];for(const e of t)e._input&&(e._input.tabIndex=e===n?0:-1)}class B extends u{static get observedAttributes(){return["checked","disabled","name","value","text","required"]}render(){const t=this.createElement("label",["nk-check"]);this._input=this.createElement("input",[],{type:"radio"});const e=document.createElement("slot");this._text=document.createTextNode(""),e.appendChild(this._text),this._apply(),this._defaultChecked=this.getBoolAttr("checked"),t.appendChild(this._input),t.appendChild(e),this._wrapper.appendChild(t),this._syncFormValue(),this._input.checked&&this._uncheckPeers(),L(this._group())}_apply(){this._input.checked=this.getBoolAttr("checked"),this._input.disabled=this.getBoolAttr("disabled")||!!this._formDisabled,this._input.required=this.getBoolAttr("required");const t=this.getAttribute("name");t?this._input.setAttribute("name",t):this._input.removeAttribute("name"),this._input.value=this.getAttribute("value")||"",this._text&&(this._text.data=this.getAttribute("text")??"")}setupEvents(){this._onChange=()=>this._applyChange(),this._onKeyDown=t=>{const e=E[t.key];if(!e||t.ctrlKey||t.metaKey||t.altKey)return;const n=this._group().filter(t=>!t.disabled);if(n.length<2)return;t.preventDefault();const i=n[(n.indexOf(this)+e+n.length)%n.length];i._input.focus(),i._input.checked=!0,i._applyChange()},this._input.addEventListener("change",this._onChange),this._input.addEventListener("keydown",this._onKeyDown),L(this._group())}teardownEvents(){this._input?.removeEventListener("change",this._onChange),this._input?.removeEventListener("keydown",this._onKeyDown)}_applyChange(){this._input.checked&&this._uncheckPeers(),this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this._syncing=!1,this._syncFormValue(),L(this._group()),this.emit("nk-change",{checked:this._input.checked,value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))}_group(){const t=this.getAttribute("name"),e=this.getRootNode();if(!t||"function"!=typeof e?.querySelectorAll)return[this];const n=C(this);return[...e.querySelectorAll("nk-radio")].filter(e=>e.getAttribute("name")===t&&C(e)===n)}_uncheckPeers(){for(const t of this._group())t!==this&&t.checked&&(t.checked=!1)}onAttributeChanged(t){!this._syncing&&this._input&&(this._apply(),"checked"===t&&this._input.checked&&this._uncheckPeers(),this._syncFormValue(),L(this._group()))}_syncFormValue(){const t=this.getAttribute("value")||"";this.setFormValue(this._input.checked?t:null,this._input.checked?"checked":"unchecked"),this.syncValidityFrom(this._input)}resetValue(){this._input.checked=this._defaultChecked,this.setBoolAttr("checked",this._defaultChecked),this._syncFormValue(),L(this._group())}restoreValue(t){"checked"===t&&(this.checked=!0)}onFormDisabled(t){this._formDisabled=t,this._apply(),L(this._group())}focus(t){this._input?.focus(t)}get checked(){return this._input?.checked??this.getBoolAttr("checked")}set checked(t){this._input&&(this._input.checked=t),t&&this._uncheckPeers(),this.setBoolAttr("checked",t),this._input&&(this._syncFormValue(),L(this._group()))}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get text(){return this.getAttribute("text")}set text(t){null==t?this.removeAttribute("text"):this.setAttribute("text",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}customElements.define("nk-radio",B);const S=["name","min","max","step","aria-label"];class N extends u{static get observedAttributes(){return["value","disabled","show-value","unit",...S]}render(){this._input=this.createElement("input",["nk-slider"],{type:"range"}),this._out=this.createElement("div",["nk-slider-value"]),this._apply(),this._input.value=this.getAttribute("value")??this._input.value,this._defaultValue=this._input.value,this._wrapper.appendChild(this._input),this._wrapper.appendChild(this._out),this._syncOut(),this._syncFormValue()}_apply(){for(const t of S){const e=this.getAttribute(t);null===e?this._input.removeAttribute(t):this._input.setAttribute(t,e)}this._input.disabled=this.getBoolAttr("disabled")||!!this._formDisabled,this._out.style.display=this.getBoolAttr("show-value")?"":"none"}_syncOut(){this._out.textContent=`${this._input.value}${this.getAttribute("unit")||""}`}setupEvents(){this._onInput=()=>{this._syncOut(),this._syncFormValue(),this.emit("nk-input",{value:Number(this._input.value),name:this.name})},this._onChange=()=>{this._syncFormValue(),this.emit("nk-change",{value:Number(this._input.value),name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("input",this._onInput),this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){this._input&&("value"===t?this._input.value=this.getAttribute("value")??"":this._apply(),this._syncOut(),this._syncFormValue())}_syncFormValue(){this.setFormValue(this._input.value)}resetValue(){this._input.value=this._defaultValue,this._syncOut(),this._syncFormValue()}restoreValue(t){"string"==typeof t&&(this._input.value=t,this._syncOut(),this._syncFormValue())}onFormDisabled(t){this._formDisabled=t,this._apply()}focus(t){this._input?.focus(t)}get value(){return Number(this._input?.value??this.getAttribute("value"))}set value(t){this._input?(this._input.value=t,this._syncOut(),this._syncFormValue()):this.setAttribute("value",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get showValue(){return this.getBoolAttr("show-value")}set showValue(t){this.setBoolAttr("show-value",t)}}customElements.define("nk-slider",N);const z=["nk-input","nk-textarea","nk-select"];class T extends p{static get observedAttributes(){return["label","desc","stacked","compact"]}render(){this._field=this.createElement("div",["nk-field"]);const t=document.createElement("div");this._label=this.createElement("div",["f-label"]);const e=this.createElement("slot",[],{name:"label"});e.appendChild(this._label),this._desc=this.createElement("div",["f-desc"]);const n=this.createElement("slot",[],{name:"desc"});n.appendChild(this._desc),t.appendChild(e),t.appendChild(n);const i=this.createElement("div",["f-control"]);this._slot=document.createElement("slot"),i.appendChild(this._slot),this._field.appendChild(t),this._field.appendChild(i),this._wrapper.appendChild(this._field),this._widened=new Set,this._sync()}setupEvents(){this._onSlot=()=>this._syncWide(),this._slot.addEventListener("slotchange",this._onSlot),this._sync()}teardownEvents(){this._slot?.removeEventListener("slotchange",this._onSlot)}onAttributeChanged(){this._sync()}get stacked(){return this.getBoolAttr("stacked")||!!this.closest("nk-fields")}set stacked(t){this.setBoolAttr("stacked",t)}get compact(){return this.getBoolAttr("compact")||!!this.closest("nk-fields")}set compact(t){this.setBoolAttr("compact",t)}_sync(){if(!this._label)return;this._label.textContent=this.getAttribute("label")||"";const t=this.getAttribute("desc");this._desc.textContent=t||"",this._desc.style.display=t?"":"none",this._field.classList.toggle("stacked",this.stacked),this._field.classList.toggle("compact",this.compact),this._syncWide()}_syncWide(){if(!this._slot)return;const t=this.stacked;for(const e of this._slot.assignedElements())z.includes(e.localName)&&(t&&!e.hasAttribute("wide")?(e.setAttribute("wide",""),this._widened.add(e)):!t&&this._widened.has(e)&&(e.removeAttribute("wide"),this._widened.delete(e)))}get label(){return this.getAttribute("label")}set label(t){this.setAttribute("label",t)}get desc(){return this.getAttribute("desc")}set desc(t){null==t?this.removeAttribute("desc"):this.setAttribute("desc",t)}}customElements.define("nk-field",T);class D extends p{render(){const t=this.createElement("div",["nk-fields"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-fields",D);const V=["gray","brown","orange","yellow","green","blue","purple","pink","red"];class F extends p{static get observedAttributes(){return["color"]}render(){this._tag=this.createElement("span",this._computeClasses()),this._tag.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._tag)}onAttributeChanged(){this._tag&&(this._tag.className=this._computeClasses().join(" "))}_computeClasses(){const t=["nk-tag"],e=this.getAttribute("color");return V.includes(e)&&t.push(e),t}get color(){return this.getAttribute("color")}set color(t){t?this.setAttribute("color",t):this.removeAttribute("color")}}customElements.define("nk-tag",F);class M extends p{static get observedAttributes(){return["value","max","label"]}render(){this._bar=this.createElement("span",["nk-progress"],{role:"progressbar"}),this._fill=document.createElement("i"),this._bar.appendChild(this._fill),this._label=this.createElement("span",["nk-progress-label"]),this._wrapper.appendChild(this._bar),this._wrapper.appendChild(this._label),this._sync()}onAttributeChanged(){this._sync()}_sync(){if(!this._bar)return;const t=Number(this.getAttribute("max"))||100,e=Math.min(t,Math.max(0,Number(this.getAttribute("value"))||0));this._fill.style.width=e/t*100+"%",this._bar.setAttribute("aria-valuenow",e),this._bar.setAttribute("aria-valuemin",0),this._bar.setAttribute("aria-valuemax",t);const n=this.getAttribute("label");this._label.textContent=n??"",this._label.style.display=null===n?"none":""}get value(){return Number(this.getAttribute("value"))||0}set value(t){this.setAttribute("value",t)}get max(){return Number(this.getAttribute("max"))||100}set max(t){this.setAttribute("max",t)}get label(){return this.getAttribute("label")}set label(t){null==t?this.removeAttribute("label"):this.setAttribute("label",t)}}customElements.define("nk-progress",M);class j extends p{static get observedAttributes(){return["icon"]}render(){this._box=this.createElement("div",["nk-callout"]),this._icon=this.createElement("span",["c-icon"]);const t=this.createElement("slot",[],{name:"icon"});t.appendChild(this._icon);const e=document.createElement("div");e.appendChild(document.createElement("slot")),this._box.appendChild(t),this._box.appendChild(e),this._wrapper.appendChild(this._box),this._syncIcon()}onAttributeChanged(){this._syncIcon()}_syncIcon(){this._icon&&(this._icon.textContent=this.getAttribute("icon")||"๐ก")}get icon(){return this.getAttribute("icon")}set icon(t){null==t?this.removeAttribute("icon"):this.setAttribute("icon",t)}}customElements.define("nk-callout",j);class I extends p{render(){this._wrapper.appendChild(this.createElement("hr",["nk-divider"]))}}customElements.define("nk-divider",I);class q extends p{static get observedAttributes(){return["level"]}render(){this._build()}_build(){const t=Math.min(4,Math.max(1,Number(this.getAttribute("level"))||2)),e=this.createElement(`h${t}`,["nk-heading"]);e.appendChild(document.createElement("slot")),this._heading?this._heading.replaceWith(e):this._wrapper.appendChild(e),this._heading=e}onAttributeChanged(){this._build()}get level(){return Number(this.getAttribute("level"))||2}set level(t){this.setAttribute("level",t)}}customElements.define("nk-heading",q);class K extends p{static get observedAttributes(){return["label","open"]}render(){this._details=this.createElement("details",["nk-toggle"]);const t=document.createElement("summary");this._label=document.createElement("span");const e=this.createElement("slot",[],{name:"label"});e.appendChild(this._label),t.appendChild(e);const n=this.createElement("div",["toggle-body"]);n.appendChild(document.createElement("slot")),this._details.appendChild(t),this._details.appendChild(n),this._details.open=this.getBoolAttr("open"),this._wrapper.appendChild(this._details),this._sync()}setupEvents(){this._onToggle=()=>{this._syncing=!0,this.setBoolAttr("open",this._details.open),this._syncing=!1,this.emit("nk-toggle",{open:this._details.open})},this._details.addEventListener("toggle",this._onToggle)}teardownEvents(){this._details?.removeEventListener("toggle",this._onToggle)}onAttributeChanged(t){this._details&&("open"!==t?this._sync():this._syncing||(this._details.open=this.getBoolAttr("open")))}_sync(){this._label.textContent=this.getAttribute("label")||""}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get label(){return this.getAttribute("label")}set label(t){this.setAttribute("label",t)}}customElements.define("nk-toggle",K);class O extends u{static get observedAttributes(){return["checked","disabled","name","value"]}render(){const t=this.createElement("label",["nk-todo"]);this._input=this.createElement("input",[],{type:"checkbox"}),this._apply(),this._defaultChecked=this.getBoolAttr("checked");const e=document.createElement("span");e.appendChild(document.createElement("slot")),t.appendChild(this._input),t.appendChild(e),this._wrapper.appendChild(t),this._syncFormValue()}_apply(){this._input.checked=this.getBoolAttr("checked"),this._input.disabled=this.getBoolAttr("disabled")||!!this._formDisabled;const t=this.getAttribute("name");t?this._input.setAttribute("name",t):this._input.removeAttribute("name"),this._input.value=this.getAttribute("value")||"on"}setupEvents(){this._onChange=()=>{this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this._syncing=!1,this._syncFormValue(),this.emit("nk-change",{checked:this._input.checked,value:this._input.value,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(){!this._syncing&&this._input&&(this._apply(),this._syncFormValue())}_syncFormValue(){this.setFormValue(this._input.checked?this._input.value:null,this._input.checked?"checked":"unchecked")}resetValue(){this.setBoolAttr("checked",this._defaultChecked)}restoreValue(t){"checked"!==t&&"unchecked"!==t||this.setBoolAttr("checked","checked"===t)}onFormDisabled(t){this._formDisabled=t,this._apply()}get checked(){return this._input?.checked??this.getBoolAttr("checked")}set checked(t){this.setBoolAttr("checked",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}}customElements.define("nk-todo",O);class P extends p{render(){const t=this.createElement("kbd",["nk-kbd"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-kbd",P);class $ extends p{static get observedAttributes(){return["lang","highlight"]}static get observesLightDom(){return!0}render(){this._box=this.createElement("div",["nk-code"]),this._lang=this.createElement("span",["lang"]),this._slot=document.createElement("slot"),this._pre=this.createElement("span",["hl"]),this._box.appendChild(this._lang),this._box.appendChild(this._slot),this._box.appendChild(this._pre),this._wrapper.appendChild(this._box),this._sync(),this.projectLightDom()}onAttributeChanged(){this._sync(),this.projectLightDom()}_sync(){if(!this._lang)return;const t=this.getAttribute("lang");this._lang.textContent=t||"",this._lang.style.display=t?"":"none"}projectLightDom(){if(!this._pre)return;const t=this.hasAttribute("highlight");if(this._slot.style.display=t?"none":"",this._pre.style.display=t?"":"none",!t)return;const e=this.textContent.replace(/^\n/,"");var n;e!==this._lastText&&(this._lastText=e,this._pre.innerHTML=(n=e,n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")).replace(/<(\/?)([a-zA-Z][\w-]*)([^&]*?)(\/?)>/g,(t,e,n,i,s)=>`<${e}<span class="tag">${n}</span>${i.replace(/([\w-]+)(=)("[^"]*"|'[^']*')?/g,(t,e,n,i)=>`<span class="attr">${e}</span>${n}${i??""}`)}${s}>`))}get lang(){return this.getAttribute("lang")}set lang(t){null==t?this.removeAttribute("lang"):this.setAttribute("lang",t)}}customElements.define("nk-code",$);class R extends p{static get observedAttributes(){return["cite"]}render(){this._quote=this.createElement("blockquote",["nk-quote"]),this._quote.appendChild(document.createElement("slot")),this._cite=this.createElement("cite",["q-cite"]),this._quote.appendChild(this._cite),this._wrapper.appendChild(this._quote),this._sync()}onAttributeChanged(){this._sync()}_sync(){if(!this._cite)return;const t=this.getAttribute("cite");this._cite.textContent=t||"",this._cite.style.display=t?"":"none"}get cite(){return this.getAttribute("cite")}set cite(t){null==t?this.removeAttribute("cite"):this.setAttribute("cite",t)}}customElements.define("nk-quote",R);class U extends p{render(){const t=this.createElement("div",["nk-app"]);t.appendChild(this.createElement("slot",[],{name:"sidebar"}));const e=this.createElement("main",["nk-main"]);e.appendChild(document.createElement("slot")),t.appendChild(e),this._wrapper.appendChild(t)}}customElements.define("nk-app",U);const H=new CSSStyleSheet;H.replaceSync("\n .nk-sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 59; background: var(--nk-scrim-soft); }\n @media (max-width: 860px) {\n .nk-sidebar {\n position: fixed; inset: 0 auto 0 0; z-index: 60;\n transform: translateX(-100%);\n transition: background .25s ease, transform .24s cubic-bezier(.2, .8, .25, 1), display .24s;\n transition-behavior: allow-discrete;\n }\n :host([open]) .nk-sidebar { display: flex; transform: none; }\n @starting-style { :host([open]) .nk-sidebar { transform: translateX(-100%); } }\n .nk-sidebar-backdrop {\n opacity: 0;\n transition: opacity .24s ease, display .24s;\n transition-behavior: allow-discrete;\n }\n :host([open]) .nk-sidebar-backdrop { display: block; opacity: 1; }\n @starting-style { :host([open]) .nk-sidebar-backdrop { opacity: 0; } }\n }\n @media (prefers-reduced-motion: reduce) { .nk-sidebar, .nk-sidebar-backdrop { transition: none; } }\n");class W extends p{static get hostStyles(){return H}static get observedAttributes(){return["open"]}render(){this._backdrop=this.createElement("div",["nk-sidebar-backdrop"]),this._aside=this.createElement("aside",["nk-sidebar"]),this._aside.appendChild(this.createElement("slot",[],{name:"workspace"}));const t=this.createElement("div",["nk-sidebar-scroll"]);t.appendChild(document.createElement("slot")),this._aside.appendChild(t),this._footer=this.createElement("div",["nk-sidebar-footer"]),this._footerSlot=this.createElement("slot",[],{name:"footer"}),this._footer.appendChild(this._footerSlot),this._aside.appendChild(this._footer),this._wrapper.appendChild(this._backdrop),this._wrapper.appendChild(this._aside),this._syncFooter()}_syncFooter(){const t=this._footerSlot.assignedElements();this._footer.style.display=t.length?"":"none";for(const e of t)"nk-tree-item"===e.localName&&e.setAttribute("compact","")}setupEvents(){this._onSlot=()=>this._syncFooter(),this._onBackdrop=()=>this.close(),this._onKey=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&this.close()},this._footerSlot.addEventListener("slotchange",this._onSlot),this._backdrop.addEventListener("click",this._onBackdrop),document.addEventListener("keydown",this._onKey)}teardownEvents(){this._footerSlot?.removeEventListener("slotchange",this._onSlot),this._backdrop?.removeEventListener("click",this._onBackdrop),document.removeEventListener("keydown",this._onKey)}onAttributeChanged(t){"open"===t&&this.emit("nk-toggle",{open:this.getBoolAttr("open")})}show(){this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}}customElements.define("nk-sidebar",W);const G=new CSSStyleSheet;G.replaceSync("\n .nk-ws-anchor { position: relative; }\n .nk-ws-menu { display: none; position: absolute; left: 8px; top: calc(100% - 2px); z-index: 50; }\n :host([open]) .nk-ws-menu { display: block; }\n");class Q extends p{static get hostStyles(){return G}static get observedAttributes(){return["name","avatar","open"]}render(){this._row=this.createElement("div",["nk-workspace"],{role:"button",tabindex:"0","aria-haspopup":"menu"}),this._avatar=this.createElement("div",["avatar"]);const t=this.createElement("slot",[],{name:"avatar"});t.appendChild(this._avatar),this._name=document.createElement("span");const e=this.createElement("span",["chev"]);e.textContent="โ",this._row.append(t,this._name,e),this._menu=this.createElement("div",["nk-ws-menu"]),this._menu.appendChild(this.createElement("slot",[],{name:"menu"}));const n=this.createElement("div",["nk-ws-anchor"]);n.append(this._row,this._menu),this._wrapper.appendChild(n),this._sync()}_sync(){const t=this.getAttribute("name")||"";this._name.textContent=t,this._avatar.textContent=this.getAttribute("avatar")||t.trim().charAt(0).toUpperCase(),this._row.setAttribute("aria-expanded",this.getBoolAttr("open")?"true":"false")}setupEvents(){this._onClick=()=>this.toggle(),this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.toggle())},this._onDocClick=t=>{this.getBoolAttr("open")&&!t.composedPath().includes(this)&&this.close()},this._onDocKey=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&this.close()},this._onMenuSelect=()=>this.close(),this._row.addEventListener("click",this._onClick),this._row.addEventListener("keydown",this._onKey),this._menu.addEventListener("nk-select",this._onMenuSelect),document.addEventListener("click",this._onDocClick),document.addEventListener("keydown",this._onDocKey)}teardownEvents(){this._row?.removeEventListener("click",this._onClick),this._row?.removeEventListener("keydown",this._onKey),this._menu?.removeEventListener("nk-select",this._onMenuSelect),document.removeEventListener("click",this._onDocClick),document.removeEventListener("keydown",this._onDocKey)}onAttributeChanged(t){this._sync(),"open"===t&&this.emit("nk-toggle",{open:this.getBoolAttr("open")})}show(){this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}}customElements.define("nk-workspace-switcher",Q);class X extends p{static get observedAttributes(){return["label","addable"]}render(){this._box=this.createElement("div",["nk-section-label"]),this._text=document.createElement("span"),this._text.appendChild(document.createElement("slot")),this._plus=this.createElement("span",["plus"],{role:"button",title:"+"}),this._plus.textContent="๏ผ",this._box.append(this._text,this._plus),this._wrapper.appendChild(this._box),this._sync()}_sync(){const t=this.getAttribute("label");null!==t&&(this._text.textContent=t),this._plus.style.display=this.getBoolAttr("addable")?"":"none"}setupEvents(){this._onPlus=t=>{t.stopPropagation(),this.emit("nk-action",{action:"add"})},this._plus.addEventListener("click",this._onPlus)}teardownEvents(){this._plus?.removeEventListener("click",this._onPlus)}onAttributeChanged(){this._sync()}get addable(){return this.getBoolAttr("addable")}set addable(t){this.setBoolAttr("addable",t)}}customElements.define("nk-section-label",X);const Y=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]);class Z extends p{static get observedAttributes(){return["manual"]}render(){const t=this.createElement("div",[],{role:"tree"});t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this._box=t}setActive(t){if(!this.getBoolAttr("manual")){for(const e of this.querySelectorAll("nk-tree-item[active]"))e!==t&&e.removeAttribute("active");t.setAttribute("active",""),this._syncTabIndex(t)}}setupEvents(){this._onKey=t=>{if(!Y.has(t.key)||t.ctrlKey||t.metaKey||t.altKey)return;const e=t.target.closest?.("nk-tree-item");if(!e)return;const n=this.visibleItems(),i=n.indexOf(e);if(i<0)return;let s=null;switch(t.key){case"ArrowDown":s=n[i+1];break;case"ArrowUp":s=n[i-1];break;case"Home":s=n[0];break;case"End":s=n[n.length-1];break;case"ArrowRight":e.hasChildren&&!e.open?e.open=!0:e.hasChildren&&(s=e.querySelector("nk-tree-item"));break;case"ArrowLeft":e.hasChildren&&e.open?e.open=!1:s=e.parentElement?.closest("nk-tree-item")}t.preventDefault(),s&&(this._syncTabIndex(s),s.focus())},this._onSlot=()=>this._syncTabIndex(),this.addEventListener("keydown",this._onKey),this._box.querySelector("slot").addEventListener("slotchange",this._onSlot),this._syncTabIndex()}teardownEvents(){this.removeEventListener("keydown",this._onKey),this._box?.querySelector("slot").removeEventListener("slotchange",this._onSlot)}visibleItems(){return[...this.querySelectorAll("nk-tree-item")].filter(t=>{for(let e=t.parentElement?.closest("nk-tree-item");e&&this.contains(e);e=e.parentElement?.closest("nk-tree-item"))if(!e.open)return!1;return!0})}requestSync(){this._syncQueued||(this._syncQueued=!0,queueMicrotask(()=>{this._syncQueued=!1,this._syncTabIndex()}))}_syncTabIndex(t){const e=[...this.querySelectorAll("nk-tree-item")];if(!e.length)return;const n=this.visibleItems(),i=t||n.find(t=>t.active)||n[0];for(const t of e)t.setTabbable?.(t===i)}set data(t){this._data=t;const e=t=>t.map(t=>{const n=document.createElement("nk-tree-item");return t.icon&&n.setAttribute("icon",t.icon),null!=t.value&&n.setAttribute("value",t.value),t.href&&n.setAttribute("href",t.href),t.open&&n.setAttribute("open",""),t.active&&n.setAttribute("active",""),n.append(document.createTextNode(t.label??""),...e(t.children||[])),n});for(const t of this.querySelectorAll(":scope > nk-tree-item"))t.remove();this.append(...e(t||[]))}get data(){return this._data}get activeItem(){return this.querySelector("nk-tree-item[active]")}get value(){return this.activeItem?.value??null}}customElements.define("nk-tree",Z);class J extends p{static get slotAssignment(){return"manual"}static get observedAttributes(){return["label","icon","value","href","active","open","compact","no-actions"]}render(){this._row=this.createElement("div",["nk-tree-item"],{role:"treeitem",tabindex:"-1"}),this._arrow=this.createElement("span",["nk-toggle-arrow"],{"aria-hidden":"true"}),this._arrow.textContent="โธ",this._iconSlot=this.createElement("slot",[],{name:"icon"}),this._icon=this.createElement("span",["icon"]),this._iconSlot.appendChild(this._icon),this._label=this.createElement("span",["label"]),this._labelSlot=this.createElement("slot",[],{name:"label"}),this._labelText=document.createTextNode(""),this._labelSlot.appendChild(this._labelText),this._label.appendChild(this._labelSlot),this._actions=this.createElement("span",["actions"]);for(const[t,e,n]of[["add","๏ผ","Add"],["more","โฏ","More"]]){const i=this.createElement("span",[],{"data-action":t,role:"button",title:n});i.textContent=e,this._actions.appendChild(i)}this._endSlot=this.createElement("slot",[],{name:"end"}),this._row.append(this._arrow,this._iconSlot,this._label,this._actions,this._endSlot),this._children=this.createElement("div",["nk-tree-children"],{role:"group"}),this._childSlot=this.createElement("slot",[],{name:"children"}),this._children.appendChild(this._childSlot),this._wrapper.append(this._row,this._children),this._sync(),this.closest("nk-tree")?.requestSync?.()}assignSlots(){if(!this._row)return;const t=[],e=[],n=[],i=[];for(const s of this.childNodes)if(s.nodeType===Node.ELEMENT_NODE){const r=s.getAttribute("slot");"icon"===r?t.push(s):"end"===r?e.push(s):"nk-tree-item"===s.localName?n.push(s):i.push(s)}else s.nodeType===Node.TEXT_NODE&&s.data.trim()&&i.push(s);this._iconSlot.assign(...t),this._endSlot.assign(...e),this._childSlot.assign(...n),this._labelSlot.assign(...this.hasAttribute("label")?[]:i),this._hasChildren=n.length>0,this._hasEnd=e.length>0,this._sync()}_sync(){const t=this.getBoolAttr("active"),e=this.getBoolAttr("open");this._row.classList.toggle("active",t),this._row.classList.toggle("compact",this.getBoolAttr("compact")),this._row.setAttribute("aria-selected",t?"true":"false"),this._arrow.classList.toggle("open",e),this._arrow.style.display=this._hasChildren?"":"none",this._hasChildren?this._row.setAttribute("aria-expanded",e?"true":"false"):this._row.removeAttribute("aria-expanded"),this._children.classList.toggle("collapsed",!e||!this._hasChildren),this._icon.textContent=this.getAttribute("icon")||"",this._icon.style.display=this.getAttribute("icon")?"":"none",this._labelText.data=this.getAttribute("label")||"";const n=!this.getBoolAttr("no-actions")&&!this._hasEnd;n&&!this._actions.isConnected&&this._row.insertBefore(this._actions,this._endSlot),!n&&this._actions.isConnected&&this._actions.remove();const i=this.getAttribute("href");i?this._row.setAttribute("data-href",i):this._row.removeAttribute("data-href")}setupEvents(){this._onRowClick=t=>{const e=t.target.closest?.("[data-action]");return e?(t.stopPropagation(),void this.emit("nk-action",{action:e.dataset.action,value:this.value,label:this.label})):t.target===this._arrow||this._arrow.contains(t.target)?(t.stopPropagation(),void this.toggle()):void this.select()},this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.select())},this._row.addEventListener("click",this._onRowClick),this._row.addEventListener("keydown",this._onKey)}teardownEvents(){this._row?.removeEventListener("click",this._onRowClick),this._row?.removeEventListener("keydown",this._onKey)}onAttributeChanged(t){"label"===t?this.assignSlots():this._sync(),"open"===t&&this.emit("nk-toggle",{open:this.getBoolAttr("open"),value:this.value})}select(){if(!this.emit("nk-select",{value:this.value,label:this.label,href:this.getAttribute("href"),item:this}))return;const t=this.closest("nk-tree");t?t.setActive(this):this.setBoolAttr("active",!0),this.getAttribute("href")&&location.assign(this.getAttribute("href"))}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}focus(t){this._row?.focus(t)}setTabbable(t){this._row&&(this._row.tabIndex=t?0:-1)}get tabbable(){return 0===this._row?.tabIndex}get hasChildren(){return!!this._hasChildren}get label(){return this.getAttribute("label")??this._labelSlot?.assignedNodes().map(t=>t.textContent).join("").trim()??""}set label(t){this.setAttribute("label",t)}get value(){return this.getAttribute("value")??this.label}set value(t){this.setAttribute("value",t)}get icon(){return this.getAttribute("icon")}set icon(t){null==t?this.removeAttribute("icon"):this.setAttribute("icon",t)}get active(){return this.getBoolAttr("active")}set active(t){this.setBoolAttr("active",t)}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get compact(){return this.getBoolAttr("compact")}set compact(t){this.setBoolAttr("compact",t)}}customElements.define("nk-tree-item",J);class tt extends p{render(){const t=this.createElement("div",["nk-topbar"]);t.appendChild(document.createElement("slot"));const e=this.createElement("div",["nk-topbar-actions"]);e.appendChild(this.createElement("slot",[],{name:"actions"})),t.appendChild(e),this._wrapper.appendChild(t)}}customElements.define("nk-topbar",tt);class et extends p{static get observedAttributes(){return["separator"]}static get observesLightDom(){return!0}render(){this._nav=this.createElement("nav",["nk-breadcrumb"],{"aria-label":"Breadcrumb"}),this._wrapper.appendChild(this._nav),this.projectLightDom()}projectLightDom(){if(!this._nav)return;const t=[...this.children],e=this.getAttribute("separator")??"/",n=t.map(t=>t.outerHTML).join("")+e;if(n===this._signature)return;this._signature=n,this._nav.innerHTML="";const i=t.some(t=>t.hasAttribute("current")||t.classList.contains("current"));t.forEach((n,s)=>{if(s>0){const t=this.createElement("span",["sep"],{"aria-hidden":"true"});t.textContent=e,this._nav.appendChild(t)}const r=n.cloneNode(!0);r.removeAttribute("slot"),r.classList.add("crumb");const o=i?n.hasAttribute("current")||n.classList.contains("current"):s===t.length-1;r.classList.toggle("current",o),o&&r.setAttribute("aria-current","page"),r.dataset.index=s,this._nav.appendChild(r)})}setupEvents(){this._onClick=t=>{const e=t.target.closest(".crumb");if(!e)return;t.preventDefault();const n=Number(e.dataset.index),i=this.children[n];this.emit("nk-select",{index:n,label:e.textContent.trim(),href:i?.getAttribute("href")??null,value:i?.dataset.value??i?.getAttribute("href")??e.textContent.trim(),current:e.classList.contains("current")})&&i?.click()},this._nav.addEventListener("click",this._onClick)}teardownEvents(){this._nav?.removeEventListener("click",this._onClick)}onAttributeChanged(){this.projectLightDom()}get separator(){return this.getAttribute("separator")??"/"}set separator(t){this.setAttribute("separator",t)}}customElements.define("nk-breadcrumb",et);class nt extends p{static get observedAttributes(){return["storage-key","title"]}render(){this._btn=this.createElement("button",["nk-topbar-btn","nk-theme-toggle"],{type:"button"}),this._btn.title=this.getAttribute("title")||"Toggle light / dark",this._wrapper.appendChild(this._btn);const t=document.documentElement;let e=null;try{e=localStorage.getItem(this.storageKey)}catch{}"light"===e||"dark"===e?t.setAttribute("data-theme",e):t.hasAttribute("data-theme")||t.setAttribute("data-theme",matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),this._syncGlyph()}_syncGlyph(){this._btn&&(this._btn.textContent="dark"===h()?"โ๏ธ":"๐")}_syncTheme(t){super._syncTheme(t),this._syncGlyph()}setupEvents(){this._onClick=()=>this.apply("dark"===h()?"light":"dark"),this._onMessage=t=>{const e=t.data?.nkTheme;"light"!==e&&"dark"!==e||this.apply(e)},this._btn.addEventListener("click",this._onClick),window.addEventListener("message",this._onMessage)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick),window.removeEventListener("message",this._onMessage)}onAttributeChanged(t){"title"===t&&this._btn&&(this._btn.title=this.getAttribute("title")||"Toggle light / dark")}apply(t){document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem(this.storageKey,t)}catch{}this._syncGlyph(),this.emit("nk-change",{value:t})}get storageKey(){return this.getAttribute("storage-key")||"nk-theme"}get value(){return h()}set value(t){this.apply(t)}}customElements.define("nk-theme-toggle",nt);class it extends p{static get observedAttributes(){return["value","always","fixed","floating","label"]}render(){this._bar=this.createElement("nav",["nk-tab-bar"]),this._slot=document.createElement("slot"),this._bar.appendChild(this._slot),this._spacer=this.createElement("div",["nk-tab-bar-spacer"]),this._wrapper.append(this._bar,this._spacer),this._syncBar(),this._sync()}get items(){return[...this.querySelectorAll(":scope > nk-tab-bar-item")]}_valueOf(t){return t.getAttribute("value")??t.getAttribute("label")??t.textContent.trim()}_syncBar(){this._bar.classList.toggle("always",this.getBoolAttr("always")),this._bar.classList.toggle("fixed",this.getBoolAttr("fixed")),this._bar.classList.toggle("floating",this.getBoolAttr("floating"));const t=this.getAttribute("label");t?this._bar.setAttribute("aria-label",t):this._bar.removeAttribute("aria-label")}_sync(){const t=this.items.filter(t=>!t.hasAttribute("drawer"));if(!t.length)return;let e=this.getAttribute("value");if(null===e||!t.some(t=>this._valueOf(t)===e)){const n=t.find(t=>t.hasAttribute("active"))||t[0];e=this._valueOf(n)}for(const n of t)this._valueOf(n)===e?n.setAttribute("active",""):n.removeAttribute("active");this._value=e}setupEvents(){this._onSlot=()=>this._sync(),this._slot.addEventListener("slotchange",this._onSlot),this._sync()}teardownEvents(){this._slot?.removeEventListener("slotchange",this._onSlot)}onAttributeChanged(t){if("value"!==t)return void this._syncBar();const e=this._value;this._sync(),this._value!==e&&this.emit("nk-change",{value:this._value})}get value(){return this._value??this.getAttribute("value")}set value(t){this.setAttribute("value",t)}get always(){return this.getBoolAttr("always")}set always(t){this.setBoolAttr("always",t)}get fixed(){return this.getBoolAttr("fixed")}set fixed(t){this.setBoolAttr("fixed",t)}get floating(){return this.getBoolAttr("floating")}set floating(t){this.setBoolAttr("floating",t)}}customElements.define("nk-tab-bar",it);class st extends p{static get observedAttributes(){return["icon","label","value","href","active","disabled","drawer"]}render(){this._btn=this.createElement("button",["nk-tab-bar-item"],{type:"button"}),this._iconSlot=this.createElement("slot",[],{name:"icon"}),this._icon=this.createElement("span",["icon"],{"aria-hidden":"true"}),this._iconSlot.appendChild(this._icon),this._label=this.createElement("span",["label"]),this._labelSlot=document.createElement("slot"),this._labelText=document.createTextNode(""),this._labelSlot.appendChild(this._labelText),this._label.appendChild(this._labelSlot),this._btn.append(this._iconSlot,this._label),this._wrapper.appendChild(this._btn),this._sync()}_sync(){this._icon.textContent=this.getAttribute("icon")??"",this._labelText.data=this.getAttribute("label")??"";const t=this.getBoolAttr("active");this._btn.classList.toggle("active",t),t?this._btn.setAttribute("aria-current","page"):this._btn.removeAttribute("aria-current"),this._btn.disabled=this.getBoolAttr("disabled");const e=this.getAttribute("href");e?this._btn.setAttribute("data-href",e):this._btn.removeAttribute("data-href")}setupEvents(){this._onClick=()=>this.select(),this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}select(){if(this.getBoolAttr("disabled"))return;const t=this.getAttribute("href");if(!this.emit("nk-select",{value:this.value,label:this.label,href:t,item:this,drawer:this.getBoolAttr("drawer")}))return;if(this.getBoolAttr("drawer")){const t=this.closest("nk-app")?.querySelector("nk-sidebar")??document.querySelector("nk-sidebar");return void t?.toggle?.()}const e=this.closest("nk-tab-bar");e?e.value=this.value:this.setBoolAttr("active",!0),t&&location.assign(t)}onAttributeChanged(){this._sync()}focus(t){this._btn?.focus(t)}get value(){return this.getAttribute("value")??this.label}set value(t){this.setAttribute("value",t)}get label(){return this.getAttribute("label")??this.textContent.trim()}set label(t){this.setAttribute("label",t)}get active(){return this.getBoolAttr("active")}set active(t){this.setBoolAttr("active",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get drawer(){return this.getBoolAttr("drawer")}set drawer(t){this.setBoolAttr("drawer",t)}}customElements.define("nk-tab-bar-item",st);class rt extends p{static get observedAttributes(){return["icon","cover","narrow"]}render(){this._page=this.createElement("div",["nk-page"]),this._icon=this.createElement("div",["nk-page-icon"],{role:"button",title:"Change icon"});const t=this.createElement("slot",[],{name:"icon"});t.appendChild(this._icon),this._page.appendChild(t),this._page.appendChild(document.createElement("slot")),this._cover=this.createElement("div",["nk-cover"]),this._coverSlot=this.createElement("slot",[],{name:"cover"}),this._coverSlot.appendChild(this._cover),this._build()}_build(){if(this._wrapper.replaceChildren(),this.getBoolAttr("narrow"))this._wrapper.append(this._coverSlot,this._page);else{const t=this.createElement("div",["nk-page-scroll"]);t.append(this._coverSlot,this._page),this._wrapper.appendChild(t)}this._sync()}_sync(){const t=this.getAttribute("icon");this._icon.textContent=t||"",this._icon.style.display=t?"":"none",this._cover.style.display=this.getBoolAttr("cover")?"":"none";const e=this._coverSlot.assignedNodes().some(t=>t.nodeType===Node.ELEMENT_NODE||t.data.trim());this._page.classList.toggle("covered",this.getBoolAttr("cover")||e)}setupEvents(){this._onIcon=()=>this.emit("nk-action",{action:"icon",value:this.getAttribute("icon")}),this._onCover=()=>this._sync(),this._icon.addEventListener("click",this._onIcon),this._coverSlot.addEventListener("slotchange",this._onCover),this._sync()}teardownEvents(){this._icon?.removeEventListener("click",this._onIcon),this._coverSlot?.removeEventListener("slotchange",this._onCover)}onAttributeChanged(t){"narrow"===t?this._build():this._sync()}get icon(){return this.getAttribute("icon")}set icon(t){null==t?this.removeAttribute("icon"):this.setAttribute("icon",t)}get cover(){return this.getBoolAttr("cover")}set cover(t){this.setBoolAttr("cover",t)}}customElements.define("nk-page",rt);class ot extends p{static get observedAttributes(){return["src"]}render(){this._cover=this.createElement("div",["nk-cover"]),this._wrapper.appendChild(this._cover),this._sync()}_sync(){const t=this.getAttribute("src");t?(this._cover.style.backgroundImage=`url("${t}")`,this._cover.style.backgroundSize="cover",this._cover.style.backgroundPosition="center"):(this._cover.style.backgroundImage="",this._cover.style.backgroundSize="",this._cover.style.backgroundPosition="")}onAttributeChanged(){this._sync()}get src(){return this.getAttribute("src")}set src(t){null==t?this.removeAttribute("src"):this.setAttribute("src",t)}}customElements.define("nk-page-cover",ot);class at extends p{static get observedAttributes(){return["editable","placeholder","value"]}static get observesLightDom(){return!0}render(){this._h1=this.createElement("h1",["nk-page-title"]),this._slot=document.createElement("slot"),this._h1.appendChild(this._slot),this._wrapper.appendChild(this._h1),this._sync()}_sync(){if(this.getBoolAttr("editable")){this._slot.isConnected&&this._slot.remove(),this._h1.setAttribute("contenteditable","plaintext-only"),this._h1.setAttribute("spellcheck","false"),this._h1.setAttribute("role","textbox"),this._h1.setAttribute("aria-label","Title");const t=this.getAttribute("value")??this.textContent.trim();this._h1.textContent!==t&&document.activeElement!==this&&(this._h1.textContent=t),this._h1.setAttribute("data-placeholder",this.getAttribute("placeholder")||"")}else this._h1.removeAttribute("contenteditable"),this._h1.removeAttribute("role"),this.hasAttribute("value")?(this._slot.isConnected&&this._slot.remove(),this._h1.textContent=this.getAttribute("value")):this._slot.isConnected||(this._h1.textContent="",this._h1.appendChild(this._slot))}projectLightDom(){this._h1&&!this.hasAttribute("value")&&this._sync()}setupEvents(){this._committed=this.value,this._onKey=t=>{"Enter"===t.key&&(t.preventDefault(),this._h1.blur())},this._onBlur=()=>this._commit(),this._h1.addEventListener("keydown",this._onKey),this._h1.addEventListener("blur",this._onBlur)}teardownEvents(){this._h1?.removeEventListener("keydown",this._onKey),this._h1?.removeEventListener("blur",this._onBlur)}_commit(){const t=this._h1.textContent.trim();t!==this._committed&&(this._committed=t,this.emit("nk-change",{value:t}))}onAttributeChanged(){this._sync()}get value(){return this.getBoolAttr("editable")?this._h1?.textContent.trim()??"":this.getAttribute("value")??this.textContent.trim()}set value(t){this.setAttribute("value",t)}get editable(){return this.getBoolAttr("editable")}set editable(t){this.setBoolAttr("editable",t)}focus(t){this._h1?.focus(t)}}customElements.define("nk-page-title",at);class lt extends p{render(){const t=this.createElement("div",["nk-page-meta"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-page-actions",lt);class ht extends p{static get observedAttributes(){return["handle","drop-target"]}render(){this._box=this.createElement("div",["nk-block-host"]),this._handle=this.createElement("span",["nk-block-handle"],{"aria-hidden":"true"}),this._handle.textContent="โ ฟ",this._box.appendChild(this._handle),this._box.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._box),this._sync()}_sync(){this._handle.style.display=this.getBoolAttr("handle")?"":"none",this._box.classList.toggle("nk-drop-target",this.getBoolAttr("drop-target"))}onAttributeChanged(){this._sync()}get handle(){return this.getBoolAttr("handle")}set handle(t){this.setBoolAttr("handle",t)}get dropTarget(){return this.getBoolAttr("drop-target")}set dropTarget(t){this.setBoolAttr("drop-target",t)}}customElements.define("nk-block-host",ht);const dt=["info","success","warning","danger"];class ct extends p{static get observedAttributes(){return["variant"]}render(){this._box=this.createElement("div",this._classes(),{role:"status"}),this._box.appendChild(document.createElement("slot")),this._box.appendChild(this.createElement("slot",[],{name:"action"})),this._wrapper.appendChild(this._box)}_classes(){const t=this.getAttribute("variant");return["nk-banner",...dt.includes(t)?[t]:[]]}onAttributeChanged(){this._box&&(this._box.className=this._classes().join(" "))}get variant(){return this.getAttribute("variant")}set variant(t){t?this.setAttribute("variant",t):this.removeAttribute("variant")}}customElements.define("nk-banner",ct);class pt extends p{static get observedAttributes(){return["icon","title","desc"]}render(){const t=this.createElement("div",["nk-empty"]);this._parts={};for(const[e,n]of[["icon","e-icon"],["title","e-title"],["desc","e-desc"]]){const i=this.createElement("div",[n]),s=this.createElement("slot",[],{name:e});s.appendChild(i),t.appendChild(s),this._parts[e]=i}const e=this.createElement("div",["e-actions"]);e.appendChild(document.createElement("slot")),t.appendChild(e),this._wrapper.appendChild(t),this.takeTitle(),this._sync()}_sync(){for(const[t,e]of Object.entries(this._parts)){const n="title"===t?this._titleText:this.getAttribute(t);e.textContent=n||"",e.style.display=n?"":"none"}}onAttributeChanged(t,e,n){("title"!==t||this.takeTitle(n))&&this._sync()}get title(){return this._titleText??""}set title(t){this._titleText=null==t?"":String(t),this._initialized&&this._sync()}}customElements.define("nk-empty",pt);class ut extends p{static get observedAttributes(){return["lines","height","width","widths"]}render(){this._build()}_build(){this._wrapper.replaceChildren();const t=Math.max(1,Number(this.getAttribute("lines"))||1),e=this.getAttribute("height")||"13",n=(this.getAttribute("widths")||"").split(",").map(t=>t.trim()).filter(Boolean),i=this.getAttribute("width");for(let s=0;s<t;s++){const t=this.createElement("div",["nk-skeleton"],{"aria-hidden":"true"});t.style.height=/^\d+(\.\d+)?$/.test(e)?`${e}px`:e;const r=n[s]??i;r&&(t.style.width=r),this._wrapper.appendChild(t)}}onAttributeChanged(){this._build()}}customElements.define("nk-skeleton",ut);class bt extends p{static get observedAttributes(){return["badge"]}render(){const t=this.createElement("div",["nk-synced"]);this._badge=this.createElement("span",["synced-badge"]),t.appendChild(this._badge),t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this._sync()}_sync(){this._badge.textContent=this.getAttribute("badge")??"โณ synced"}onAttributeChanged(){this._sync()}get badge(){return this.getAttribute("badge")}set badge(t){this.setAttribute("badge",t)}}customElements.define("nk-synced",bt);const gt={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};class mt extends p{static get observedAttributes(){return["value"]}render(){this._strip=this.createElement("div",["nk-tabs"],{role:"tablist"}),this._tabSlot=document.createElement("slot"),this._strip.appendChild(this._tabSlot),this._panelSlot=this.createElement("slot",[],{name:"panel"}),this._wrapper.append(this._strip,this._panelSlot),this._sync()}get tabs(){return[...this.querySelectorAll(":scope > nk-tab")]}get panels(){return[...this.querySelectorAll(':scope > [slot="panel"]')]}_sync(){const t=this.tabs;if(!t.length)return;let e=this.getAttribute("value");if(null===e||!t.some(t=>t.getAttribute("value")===e||null===t.getAttribute("value")&&t.textContent.trim()===e)){const n=t.find(t=>t.hasAttribute("active"))||t[0];e=n.getAttribute("value")??n.textContent.trim()}for(const n of t){(n.getAttribute("value")??n.textContent.trim())===e?n.setAttribute("active",""):n.removeAttribute("active")}for(const t of this.panels)t.hidden=t.dataset.tab!==e;this._value=e}setupEvents(){this._onSlot=()=>this._sync(),this._onKey=t=>{const e=gt[t.key];if(!e)return;const n=this.tabs.filter(t=>!t.hasAttribute("disabled")),i=n.indexOf(t.target.closest?.("nk-tab"));if(i<0||n.length<2)return;t.preventDefault();const s=n[(i+e+n.length)%n.length];s.select(),s.focus()},this._tabSlot.addEventListener("slotchange",this._onSlot),this._panelSlot.addEventListener("slotchange",this._onSlot),this.addEventListener("keydown",this._onKey),this._sync()}teardownEvents(){this._tabSlot?.removeEventListener("slotchange",this._onSlot),this._panelSlot?.removeEventListener("slotchange",this._onSlot),this.removeEventListener("keydown",this._onKey)}onAttributeChanged(){const t=this._value;this._sync(),this._value!==t&&this.emit("nk-change",{value:this._value})}get value(){return this._value??this.getAttribute("value")}set value(t){this.setAttribute("value",t)}}customElements.define("nk-tabs",mt);class kt extends p{static get observedAttributes(){return["active","value","disabled"]}render(){this._tab=this.createElement("span",["nk-tab"],{role:"tab"}),this._tab.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._tab),this._sync()}_sync(){const t=this.getBoolAttr("active");this._tab.classList.toggle("active",t),this._tab.setAttribute("aria-selected",t?"true":"false"),this._tab.tabIndex=t?0:-1,this._tab.setAttribute("aria-disabled",this.getBoolAttr("disabled")?"true":"false")}setupEvents(){this._onClick=()=>this.select(),this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.select())},this._tab.addEventListener("click",this._onClick),this._tab.addEventListener("keydown",this._onKey)}teardownEvents(){this._tab?.removeEventListener("click",this._onClick),this._tab?.removeEventListener("keydown",this._onKey)}select(){if(this.getBoolAttr("disabled"))return;if(!this.emit("nk-select",{value:this.value,label:this.textContent.trim(),item:this}))return;const t=this.closest("nk-tabs");t?t.value=this.value:this.setBoolAttr("active",!0)}onAttributeChanged(){this._sync()}focus(t){this._tab?.focus(t)}get value(){return this.getAttribute("value")??this.textContent.trim()}set value(t){this.setAttribute("value",t)}get active(){return this.getBoolAttr("active")}set active(t){this.setBoolAttr("active",t)}}customElements.define("nk-tab",kt);const _t={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};class vt extends u{static get observedAttributes(){return["value","name","disabled","scroll","wrap"]}render(){this._box=this.createElement("div",["nk-segmented"],{role:"radiogroup"}),this._slot=document.createElement("slot"),this._box.appendChild(this._slot),this._wrapper.appendChild(this._box),this._syncBox(),this._sync()}_syncBox(){this._box.classList.toggle("scroll",this.getBoolAttr("scroll")),this._box.classList.toggle("wrap",this.getBoolAttr("wrap"))}get buttons(){return this._slot?.assignedElements().filter(t=>"button"===t.localName)??[]}_valueOf(t){return t.getAttribute("value")??t.textContent.trim()}_sync(){const t=this.buttons;if(!t.length)return;let e=this.getAttribute("value");null!==e&&t.some(t=>this._valueOf(t)===e)||(e=this._valueOf(t.find(t=>t.classList.contains("active"))||t[0])),void 0===this._defaultValue&&(this._defaultValue=e);const n=this.getBoolAttr("disabled")||!!this._formDisabled;for(const i of t){const t=this._valueOf(i)===e;i.type="button",i.setAttribute("role","radio"),i.setAttribute("aria-checked",t?"true":"false"),i.classList.toggle("active",t),i.tabIndex=t?0:-1,i.disabled=n}this._value=e,this.setFormValue(e)}setupEvents(){this._onSlot=()=>this._sync(),this._onClick=t=>{const e=t.target.closest?.("button");e&&this.buttons.includes(e)&&!e.disabled&&this._choose(this._valueOf(e))},this._onKey=t=>{const e=_t[t.key];if(!e)return;const n=this.buttons,i=n.indexOf(t.target.closest?.("button"));if(i<0||n.length<2)return;t.preventDefault();const s=n[(i+e+n.length)%n.length];this._choose(this._valueOf(s)),s.focus()},this._slot.addEventListener("slotchange",this._onSlot),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKey),this._sync()}teardownEvents(){this._slot?.removeEventListener("slotchange",this._onSlot),this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKey)}_choose(t){t!==this._value&&(this._syncing=!0,this.setAttribute("value",t),this._syncing=!1,this._sync(),this.emit("nk-change",{value:t,name:this.name}),this.dispatchEvent(new Event("change",{bubbles:!0})))}onAttributeChanged(t){"scroll"!==t&&"wrap"!==t?this._syncing||this._sync():this._syncBox()}resetValue(){void 0!==this._defaultValue&&this.setAttribute("value",this._defaultValue)}onFormDisabled(t){this._formDisabled=t,this._sync()}get value(){return this._value??this.getAttribute("value")}set value(t){this.setAttribute("value",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get scroll(){return this.getBoolAttr("scroll")}set scroll(t){this.setBoolAttr("scroll",t)}get wrap(){return this.getBoolAttr("wrap")}set wrap(t){this.setBoolAttr("wrap",t)}}customElements.define("nk-segmented",vt);class xt extends p{render(){const t=this.createElement("div",["nk-stats"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-stats",xt);class ft extends p{static get observedAttributes(){return["label","value","delta","trend"]}render(){const t=this.createElement("div",["nk-stat"]);this._parts={};for(const[e,n]of[["label","s-label"],["value","s-value"],["delta","s-delta"]]){const i=this.createElement("div",[n]),s=this.createElement("slot",[],{name:e});s.appendChild(i),t.appendChild(s),this._parts[e]=i}this._wrapper.appendChild(t),this._sync()}_sync(){for(const[t,e]of Object.entries(this._parts)){const n=this.getAttribute(t);e.textContent=n??"",e.style.display=null===n?"none":""}const t=this.getAttribute("trend");this._parts.delta.className="s-delta"+("up"===t||"down"===t?` ${t}`:"")}onAttributeChanged(){this._sync()}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}}customElements.define("nk-stat",ft);class yt extends p{static get observedAttributes(){return["more"]}render(){const t=this.createElement("div",["nk-avatar-group"]);t.appendChild(document.createElement("slot")),this._more=this.createElement("span",["mini-avatar","more"]),t.appendChild(this._more),this._wrapper.appendChild(t),this._sync()}_sync(){const t=this.getAttribute("more");this._more.textContent=t||"",this._more.style.display=t?"":"none"}onAttributeChanged(){this._sync()}get more(){return this.getAttribute("more")}set more(t){null==t?this.removeAttribute("more"):this.setAttribute("more",t)}}customElements.define("nk-avatar-group",yt);const wt=["person","page","date"];class At extends p{static get observedAttributes(){return["type"]}render(){this._box=this.createElement("span",this._classes()),this._box.appendChild(this.createElement("slot",[],{name:"avatar"})),this._box.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._box)}_classes(){const t=this.getAttribute("type");return["nk-mention",...wt.includes(t)?[t]:[]]}onAttributeChanged(){this._box&&(this._box.className=this._classes().join(" "))}get type(){return this.getAttribute("type")}set type(t){t?this.setAttribute("type",t):this.removeAttribute("type")}}customElements.define("nk-mention",At);class Et extends p{static get observedAttributes(){return["icon","value","disabled"]}render(){this._btn=this.createElement("button",["nk-template-btn"],{type:"button"});const t=document.createElement("span");this._icon=document.createElement("span"),this._space=document.createTextNode(" "),t.append(this._icon,this._space,document.createElement("slot")),this._btn.appendChild(t),this._wrapper.appendChild(this._btn),this._sync()}_sync(){const t=this.getAttribute("icon");this._icon.textContent=t||"",this._space.data=t?" ":"",this._btn.disabled=this.getBoolAttr("disabled")}setupEvents(){this._onClick=()=>this.emit("nk-select",{value:this.value,label:this.textContent.trim()}),this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}onAttributeChanged(){this._sync()}focus(t){this._btn?.focus(t)}get value(){return this.getAttribute("value")??this.textContent.trim()}set value(t){this.setAttribute("value",t)}}customElements.define("nk-template-btn",Et);class Ct extends u{static get observedAttributes(){return["name","value","title","desc","selected","disabled"]}render(){this._card=this.createElement("div",["nk-model-card"],{role:"radio",tabindex:"0"}),this._card.appendChild(this.createElement("div",["m-radio"]));const t=document.createElement("div");this._name=this.createElement("div",["m-name"]);const e=this.createElement("slot",[],{name:"title"});e.appendChild(this._name),this._desc=this.createElement("div",["m-desc"]);const n=this.createElement("slot",[],{name:"desc"});n.appendChild(this._desc),t.append(e,n),this._card.appendChild(t),this._wrapper.appendChild(this._card),this._defaultSelected=this.getBoolAttr("selected"),this.takeTitle(),this._sync(),this.getBoolAttr("selected")&&this._unselectPeers()}_sync(){const t=this.getBoolAttr("selected");this._card.classList.toggle("selected",t),this._card.setAttribute("aria-checked",t?"true":"false"),this._card.setAttribute("aria-disabled",this.getBoolAttr("disabled")?"true":"false"),this._name.textContent=this._titleText||"";const e=this.getAttribute("desc");this._desc.textContent=e||"",this._desc.style.display=e?"":"none",this.setFormValue(t?this.getAttribute("value")||"on":null,t?"selected":"unselected")}_group(){const t=this.getAttribute("name"),e=this.getRootNode();return t&&"function"==typeof e?.querySelectorAll?[...e.querySelectorAll("nk-model-card")].filter(e=>e.getAttribute("name")===t):[this]}_unselectPeers(){for(const t of this._group())t!==this&&t.hasAttribute("selected")&&t.removeAttribute("selected")}setupEvents(){this._onClick=()=>this.select(),this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.select())},this._card.addEventListener("click",this._onClick),this._card.addEventListener("keydown",this._onKey)}teardownEvents(){this._card?.removeEventListener("click",this._onClick),this._card?.removeEventListener("keydown",this._onKey)}select(){this.getBoolAttr("disabled")||this.getBoolAttr("selected")||(this.setBoolAttr("selected",!0),this.emit("nk-change",{value:this.value,name:this.name,checked:!0}),this.emit("nk-select",{value:this.value,label:this.title}),this.dispatchEvent(new Event("change",{bubbles:!0})))}onAttributeChanged(t,e,n){("title"!==t||this.takeTitle(n))&&(this._sync(),"selected"===t&&this.getBoolAttr("selected")&&this._unselectPeers())}resetValue(){this.setBoolAttr("selected",this._defaultSelected)}focus(t){this._card?.focus(t)}get title(){return this._titleText??""}set title(t){this._titleText=null==t?"":String(t),this._initialized&&this._sync()}get selected(){return this.getBoolAttr("selected")}set selected(t){this.setBoolAttr("selected",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}}customElements.define("nk-model-card",Ct);class Lt extends p{static get observedAttributes(){return["avatar"]}render(){const t=this.createElement("div",["nk-profile-row"]);this._avatar=this.createElement("div",["big-avatar"]);const e=this.createElement("slot",[],{name:"avatar"});e.appendChild(this._avatar),t.appendChild(e),t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this._sync()}_sync(){this._avatar.textContent=this.getAttribute("avatar")||""}onAttributeChanged(){this._sync()}}customElements.define("nk-profile-row",Lt);class Bt extends p{static get observedAttributes(){return["title"]}render(){const t=this.createElement("div",["nk-danger-zone"]);this._titleEl=this.createElement("div",["dz-title"]),t.appendChild(this._titleEl),t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t),this.takeTitle(),this._sync()}_sync(){const t=this._titleText;this._titleEl.textContent=t||"",this._titleEl.style.display=t?"":"none"}onAttributeChanged(t,e,n){("title"!==t||this.takeTitle(n))&&this._sync()}get title(){return this._titleText??""}set title(t){this._titleText=null==t?"":String(t),this._initialized&&this._sync()}}customElements.define("nk-danger-zone",Bt);class St extends p{render(){const t=this.createElement("div",["nk-member-list"]);this._slot=document.createElement("slot"),t.appendChild(this._slot),this._wrapper.appendChild(t),this._mark()}_mark(){const t=this._slot.assignedElements().filter(t=>"nk-member-row"===t.localName);t.forEach((e,n)=>{n===t.length-1?e.setAttribute("last",""):e.removeAttribute("last")})}setupEvents(){this._onSlot=()=>this._mark(),this._slot.addEventListener("slotchange",this._onSlot),this._mark()}teardownEvents(){this._slot?.removeEventListener("slotchange",this._onSlot)}}customElements.define("nk-member-list",St);class Nt extends p{static get observedAttributes(){return["name","mail","avatar","color","last"]}render(){this._row=this.createElement("div",["nk-member-row"]),this._avatar=this.createElement("span",["mini-avatar"]);const t=this.createElement("slot",[],{name:"avatar"});t.appendChild(this._avatar);const e=document.createElement("div");this._name=document.createTextNode(""),this._mail=this.createElement("div",["m-mail"]),e.append(this._name,this._mail);const n=document.createElement("div");n.style.marginLeft="auto",n.appendChild(this.createElement("slot",[],{name:"role"})),this._row.append(t,e,n,document.createElement("slot")),this._wrapper.appendChild(this._row),this._sync()}_sync(){this._name.data=this.getAttribute("name")||"";const t=this.getAttribute("mail");this._mail.textContent=t||"",this._mail.style.display=t?"":"none";const e=this.getAttribute("avatar");this._avatar.textContent=e||(this.getAttribute("name")||"").split(/\s+/).map(t=>t[0]).join("").slice(0,2).toUpperCase(),this._avatar.style.background=this.getAttribute("color")||"var(--nk-text-tertiary)",this._row.classList.toggle("last",this.getBoolAttr("last"))}onAttributeChanged(){this._sync()}}customElements.define("nk-member-row",Nt);let zt=0,Tt="";function Dt(){0===zt++&&(Tt=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function Vt(){zt>0&&0===--zt&&(document.documentElement.style.overflow=Tt)}function Ft(t){const e=[];let n=t;for(;n&&n!==document.body;){const t=(n.parentNode,ShadowRoot,n.parentNode);if(!t)break;for(const i of t.children)i===n||i.inert||/^(SCRIPT|STYLE|LINK|TEMPLATE)$/.test(i.tagName)||(i.inert=!0,e.push(i));n=t instanceof ShadowRoot?t.host:t}return()=>{for(const t of e)t.inert=!1}}class Mt extends p{static get observedAttributes(){return["open","pane"]}render(){this._backdrop=this.createElement("div",["nk-modal-backdrop"]),this._backdrop.inert=!0,this._box=this.createElement("div",["nk-modal"],{role:"dialog","aria-modal":"true",tabindex:"-1"}),this._nav=this.createElement("nav",["nk-settings-nav"],{"aria-label":"Settings"}),this._nav.appendChild(this.createElement("slot",[],{name:"user"})),this._rows=document.createElement("div"),this._nav.appendChild(this._rows),this._nav.appendChild(this.createElement("slot",[],{name:"nav"})),this._content=this.createElement("div",["nk-settings-content"]),this._slot=document.createElement("slot"),this._content.appendChild(this._slot),this._box.append(this._nav,this._content),this._backdrop.appendChild(this._box),this._wrapper.appendChild(this._backdrop),this._syncOpen(),this.requestNav()}get panes(){return[...this.querySelectorAll(":scope > nk-settings-pane")]}requestNav(){this._navQueued||(this._navQueued=!0,queueMicrotask(()=>{this._navQueued=!1,this._buildNav()}))}_buildNav(){if(!this._rows)return;const t=this.panes.filter(t=>t.getAttribute("label"));this._rows.replaceChildren(),this._nav.style.display=t.length||this.querySelector(':scope > [slot="nav"], :scope > [slot="user"]')?"":"none";let e=null;for(const n of t){const t=n.getAttribute("group");if(t&&t!==e){const n=this.createElement("div",["nk-section-label"]);n.textContent=t,this._rows.appendChild(n),e=t}const i=this.createElement("div",["nk-tree-item"],{role:"tab",tabindex:"0","data-pane":n.name}),s=this.createElement("span",["icon"]);s.textContent=n.getAttribute("icon")||"";const r=this.createElement("span",["label"]);r.textContent=n.getAttribute("label"),i.append(s,r),this._rows.appendChild(i)}this._syncActive()}_syncActive(){const t=this.panes;let e=this.getAttribute("pane");t.some(t=>t.name===e)||(e=(t.find(t=>t.hasAttribute("active"))||t[0])?.name??null);for(const t of this._rows.querySelectorAll("[data-pane]")){const n=t.dataset.pane===e;t.classList.toggle("active",n),t.setAttribute("aria-selected",n?"true":"false")}for(const n of t)n.active=n.name===e;this._current=e}_syncOpen(){const t=this.getBoolAttr("open");if(this._backdrop.classList.toggle("open",t),this._backdrop.inert=!t,t!==this._wasOpen)if(this._wasOpen=t,t)this._returnFocus=document.activeElement,Dt(),this._undoInert=Ft(this),requestAnimationFrame(()=>{const t=this._rows.querySelector(".nk-tree-item.active")||function(t){const e=t=>{for(const n of t.querySelectorAll("*")){if(n.matches('a[href], button:not([disabled]), input:not([disabled]):not([type=hidden]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"], [contenteditable="plaintext-only"]')&&n.getClientRects().length)return n;if(n.shadowRoot){const t=e(n.shadowRoot);if(t)return t}}return null};return e(t)}(this)||this._box;t.focus({preventScroll:!0})});else{Vt(),this._undoInert?.(),this._undoInert=null;const t=this._returnFocus;t&&"function"==typeof t.focus&&t.isConnected&&t.focus({preventScroll:!0}),this._returnFocus=null}}setupEvents(){this._onBackdrop=t=>{t.target===this._backdrop&&this.close()},this._onKey=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&(t.stopPropagation(),this.close())},this._onNavClick=t=>{const e=t.target.closest("[data-pane]");e&&(e.focus(),this.pane=e.dataset.pane)},this._onNavKey=t=>{const e=t.target.closest?.("[data-pane]");if(!e)return;if("Enter"===t.key||" "===t.key)return t.preventDefault(),void(this.pane=e.dataset.pane);const n={ArrowDown:1,ArrowUp:-1}[t.key];if(!n)return;const i=[...this._rows.querySelectorAll("[data-pane]")],s=i[(i.indexOf(e)+n+i.length)%i.length];t.preventDefault(),s.focus(),this.pane=s.dataset.pane},this._onSlot=()=>this.requestNav(),this._backdrop.addEventListener("click",this._onBackdrop),document.addEventListener("keydown",this._onKey),this._rows.addEventListener("click",this._onNavClick),this._rows.addEventListener("keydown",this._onNavKey),this._slot.addEventListener("slotchange",this._onSlot)}teardownEvents(){this._backdrop?.removeEventListener("click",this._onBackdrop),document.removeEventListener("keydown",this._onKey),this._rows?.removeEventListener("click",this._onNavClick),this._rows?.removeEventListener("keydown",this._onNavKey),this._slot?.removeEventListener("slotchange",this._onSlot),this._wasOpen&&(Vt(),this._undoInert?.(),this._undoInert=null,this._wasOpen=!1)}onAttributeChanged(t){if("open"===t)this._syncOpen(),this.emit("nk-toggle",{open:this.getBoolAttr("open")});else if("pane"===t){const t=this._current;this._syncActive(),this._current!==t&&this.emit("nk-select",{value:this._current,label:this.panes.find(t=>t.name===this._current)?.getAttribute("label")??this._current})}}show(t){t&&this.setAttribute("pane",t),this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get pane(){return this._current??this.getAttribute("pane")}set pane(t){this.setAttribute("pane",t)}}customElements.define("nk-modal",Mt);class jt extends p{static get observedAttributes(){return["name","label","icon","group","title","active"]}render(){this._section=this.createElement("section",["nk-settings-pane"],{role:"tabpanel"}),this._h2=document.createElement("h2"),this._section.appendChild(this._h2),this._section.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._section),this.takeTitle(),this._sync()}_sync(){const t=this._titleText;this._h2.textContent=t||"",this._h2.style.display=t?"":"none",this._section.classList.toggle("active",this.getBoolAttr("active")),this._section.setAttribute("aria-label",this.getAttribute("label")||t||this.getAttribute("name")||"")}onAttributeChanged(t,e,n){("title"!==t||this.takeTitle(n))&&(this._sync(),["label","icon","group","name"].includes(t)&&this.closest("nk-modal")?.requestNav?.())}get title(){return this._titleText??""}set title(t){this._titleText=null==t?"":String(t),this._initialized&&this._sync()}get name(){return this.getAttribute("name")??this.getAttribute("label")??""}get active(){return this.getBoolAttr("active")}set active(t){this.setBoolAttr("active",t)}}customElements.define("nk-settings-pane",jt);class It extends p{static get observedAttributes(){return["name","mail","avatar"]}render(){const t=this.createElement("div",["nk-settings-user"]);this._avatar=this.createElement("div",["avatar"]);const e=this.createElement("slot",[],{name:"avatar"});e.appendChild(this._avatar);const n=this.createElement("div",["u-text"]);this._name=this.createElement("div",["name"]),this._mail=this.createElement("div",["mail"]),n.append(this._name,this._mail),t.append(e,n),this._wrapper.appendChild(t),this._sync()}_sync(){const t=this.getAttribute("name")||"";this._name.textContent=t;const e=this.getAttribute("mail");this._mail.textContent=e||"",this._mail.style.display=e?"":"none",this._avatar.textContent=this.getAttribute("avatar")||t.split(/\s+/).map(t=>t[0]).join("").slice(0,2).toUpperCase()}onAttributeChanged(){this._sync()}}function qt(t,e){const n=t.trim().toLowerCase();if(!n)return 1;const i=e.toLowerCase();let s=0,r=0,o=0;for(let t=0;t<n.length;t++){const e=i.indexOf(n[t],s);if(e<0)return 0;o=e===s?o+1:0,r+=1+2*o+(0===e||/[\s\-_/.]/.test(i[e-1])?3:0)-Math.min(3,.25*(e-s)),s=e+1}return i.startsWith(n)&&(r+=10),Math.max(.01,r/(1+i.length/40))}customElements.define("nk-settings-user",It);class Kt extends p{static get observedAttributes(){return["open","hotkey","placeholder"]}render(){this._backdrop=this.createElement("div",["nk-cmdk-backdrop"]),this._backdrop.inert=!0,this._box=this.createElement("div",["nk-cmdk"],{role:"dialog","aria-modal":"true","aria-label":"Command palette"});const t=this.createElement("div",["nk-cmdk-input-row"]),e=document.createElement("span");e.style.fontSize="15px",e.textContent="๐",this._input=this.createElement("input",[],{type:"text",autocomplete:"off",role:"combobox","aria-expanded":"true","aria-autocomplete":"list"});const n=this.createElement("kbd",["nk-kbd"]);n.textContent="esc",t.append(e,this._input,n),this._list=this.createElement("div",["nk-cmdk-list"],{role:"listbox",id:"list"}),this._input.setAttribute("aria-controls","list"),this._footer=this.createElement("div",["nk-cmdk-footer"]);const i=this.createElement("slot",[],{name:"footer"});i.innerHTML='<span><kbd class="nk-kbd">โ</kbd><kbd class="nk-kbd">โ</kbd> navigate</span><span><kbd class="nk-kbd">โต</kbd> open</span><span><kbd class="nk-kbd">โ</kbd><kbd class="nk-kbd">K</kbd> toggle</span>',this._footer.appendChild(i),this._box.append(t,this._list,this._footer),this._backdrop.appendChild(this._box),this._wrapper.appendChild(this._backdrop),this._commands=[],this._index=0,this._syncAttrs(),this._renderList(),this._syncOpen()}_syncAttrs(){this._input.placeholder=this.getAttribute("placeholder")||"Search or type a command โฆ"}results(){const t=this._input?.value??"",e=[];for(const n of this._commands){const i=(n.items||[]).map(e=>({item:e,group:n.group,score:qt(t,`${e.label} ${e.keywords||""}`)})).filter(t=>t.score>0);i.sort((t,e)=>e.score-t.score),e.push(...i)}return e}_renderList(){if(!this._list)return;const t=this.results();if(this._index=Math.min(this._index,Math.max(0,t.length-1)),this._list.replaceChildren(),!t.length){const t=this.createElement("div",["nk-cmdk-empty"]);return t.textContent=`No results for โ${this._input.value}โ`,this._list.appendChild(t),void this._input.removeAttribute("aria-activedescendant")}let e=null;t.forEach((t,n)=>{if(t.group&&t.group!==e){const n=this.createElement("div",["nk-cmdk-group"]);n.textContent=t.group,this._list.appendChild(n),e=t.group}const i=this.createElement("div",["nk-cmdk-item"],{role:"option",id:`opt-${n}`,"data-index":n});i.classList.toggle("selected",n===this._index),i.setAttribute("aria-selected",n===this._index?"true":"false");const s=this.createElement("span",["m-icon"]);s.textContent=t.item.icon||"";const r=document.createElement("span");if(r.textContent=t.item.label,i.append(s,r),t.item.shortcut){const e=this.createElement("span",["m-shortcut"]);e.textContent=t.item.shortcut,i.appendChild(e)}this._list.appendChild(i)}),this._input.setAttribute("aria-activedescendant",`opt-${this._index}`)}_move(t){const e=this.results().length;if(e){this._index=(this._index+t+e)%e;for(const t of this._list.querySelectorAll(".nk-cmdk-item")){const e=Number(t.dataset.index)===this._index;t.classList.toggle("selected",e),t.setAttribute("aria-selected",e?"true":"false"),e&&t.scrollIntoView({block:"nearest"})}this._input.setAttribute("aria-activedescendant",`opt-${this._index}`)}}pick(t=this._index){const e=this.results()[t];if(!e)return;const n=this._input.value;this.close();this.emit("nk-command",{id:e.item.id??e.item.label,item:e.item,query:n})&&"function"==typeof e.item.action&&e.item.action(e.item)}_matchesHotkey(t){const e=(this.getAttribute("hotkey")||"mod+k").toLowerCase().split("+"),n=e.pop(),i=!e.includes("mod")||(t.metaKey||t.ctrlKey),s=e.includes("shift")?t.shiftKey:!t.shiftKey,r=e.includes("alt")?t.altKey:!t.altKey;return i&&s&&r&&t.key.toLowerCase()===n}_syncOpen(){const t=this.getBoolAttr("open");if(this._backdrop.classList.toggle("open",t),this._backdrop.inert=!t,t!==this._wasOpen)if(this._wasOpen=t,t)this._returnFocus=document.activeElement,this._input.value="",this._index=0,this._renderList(),Dt(),this._undoInert=Ft(this),requestAnimationFrame(()=>this._input.focus({preventScroll:!0}));else{Vt(),this._undoInert?.(),this._undoInert=null;const t=this._returnFocus;t&&"function"==typeof t.focus&&t.isConnected&&t.focus({preventScroll:!0}),this._returnFocus=null}}setupEvents(){this._onDocKey=t=>{if(this._matchesHotkey(t))return t.preventDefault(),void this.toggle();"Escape"===t.key&&this.getBoolAttr("open")&&(t.stopPropagation(),this.close())},this._onInput=()=>{this._index=0,this._renderList()},this._onInputKey=t=>{"ArrowDown"===t.key?(t.preventDefault(),this._move(1)):"ArrowUp"===t.key?(t.preventDefault(),this._move(-1)):"Enter"===t.key&&(t.preventDefault(),this.pick())},this._onListClick=t=>{const e=t.target.closest(".nk-cmdk-item");e&&this.pick(Number(e.dataset.index))},this._onListMove=t=>{const e=t.target.closest(".nk-cmdk-item");e&&Number(e.dataset.index)!==this._index&&(this._index=Number(e.dataset.index),this._move(0))},this._onListDown=t=>t.preventDefault(),this._onBackdrop=t=>{t.target===this._backdrop&&this.close()},document.addEventListener("keydown",this._onDocKey),this._input.addEventListener("input",this._onInput),this._input.addEventListener("keydown",this._onInputKey),this._list.addEventListener("click",this._onListClick),this._list.addEventListener("mousemove",this._onListMove),this._list.addEventListener("mousedown",this._onListDown),this._backdrop.addEventListener("click",this._onBackdrop)}teardownEvents(){document.removeEventListener("keydown",this._onDocKey),this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("keydown",this._onInputKey),this._list?.removeEventListener("click",this._onListClick),this._list?.removeEventListener("mousemove",this._onListMove),this._list?.removeEventListener("mousedown",this._onListDown),this._backdrop?.removeEventListener("click",this._onBackdrop),this._wasOpen&&(Vt(),this._undoInert?.(),this._undoInert=null,this._wasOpen=!1)}onAttributeChanged(t){"open"===t?(this._syncOpen(),this.emit("nk-toggle",{open:this.getBoolAttr("open")})):this._syncAttrs()}show(){this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get commands(){return this._commands}set commands(t){this._commands=Array.isArray(t)?t:[],this._index=0,this._renderList()}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get query(){return this._input?.value??""}set query(t){this._input&&(this._input.value=t,this._index=0,this._renderList())}}customElements.define("nk-cmdk",Kt);class Ot extends p{render(){this._box=this.createElement("div",["nk-pop","nk-menu"],{role:"menu"}),this._box.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._box)}get items(){return[...this.querySelectorAll(":scope > nk-menu-item")].filter(t=>t.selectable)}setupEvents(){this._onKey=t=>{const e={ArrowDown:1,ArrowUp:-1}[t.key],n=t.target.closest?.("nk-menu-item"),i=this.items;if(i.length)if(e){t.preventDefault();const s=i.indexOf(n);i[(s+e+i.length)%i.length].focus()}else"Enter"!==t.key&&" "!==t.key||!n||(t.preventDefault(),n.select())},this.addEventListener("keydown",this._onKey)}teardownEvents(){this.removeEventListener("keydown",this._onKey)}focusFirst(){this.items[0]?.focus()}}customElements.define("nk-menu",Ot);class Pt extends p{static get observedAttributes(){return["icon","shortcut","danger","value","type","disabled"]}render(){this._build()}_build(){const t=this.getAttribute("type");let e;if("separator"===t)e=this.createElement("div",["nk-menu-sep"],{role:"separator"});else if("label"===t)e=this.createElement("div",["nk-menu-label"]),e.appendChild(document.createElement("slot"));else{e=this.createElement("div",["nk-menu-item"],{role:"menuitem",tabindex:"-1"}),this._icon=this.createElement("span",["m-icon"]);const t=this.createElement("slot",[],{name:"icon"});t.appendChild(this._icon),this._shortcut=this.createElement("span",["m-shortcut"]),e.append(t,document.createElement("slot"),this._shortcut)}this._el?(this._el.removeEventListener("click",this._onClick),this._el.replaceWith(e)):this._wrapper.appendChild(e),this._el=e,this._onClick&&e.addEventListener("click",this._onClick),this._sync()}_sync(){if(!this._el.classList.contains("nk-menu-item"))return;const t=this.getAttribute("icon");this._icon.textContent=t||"",this._icon.style.display=t?"":"none";const e=this.getAttribute("shortcut");this._shortcut.textContent=e||"",this._shortcut.style.display=e?"":"none",this._el.classList.toggle("danger",this.getBoolAttr("danger")),this._el.setAttribute("aria-disabled",this.getBoolAttr("disabled")?"true":"false")}setupEvents(){this._onClick=()=>this.select(),this._el.addEventListener("click",this._onClick)}teardownEvents(){this._el?.removeEventListener("click",this._onClick)}select(){this._el.classList.contains("nk-menu-item")&&!this.getBoolAttr("disabled")&&this.emit("nk-select",{value:this.value,label:this.textContent.trim(),item:this})}onAttributeChanged(t){"type"===t?this._build():this._sync()}focus(t){this._el?.focus(t)}get selectable(){return this._el?.classList.contains("nk-menu-item")&&!this.getBoolAttr("disabled")}get value(){return this.getAttribute("value")??this.textContent.trim()}set value(t){this.setAttribute("value",t)}}customElements.define("nk-menu-item",Pt);const $t=new CSSStyleSheet;$t.replaceSync('\n .nk-pop-anchor { position: relative; display: inline-block; }\n .nk-pop-float { display: none; position: absolute; z-index: 50; top: 100%; left: 0; margin-top: 4px; }\n :host([open]) .nk-pop-float { display: block; }\n :host([placement="bottom-end"]) .nk-pop-float { left: auto; right: 0; }\n :host([placement="top-start"]) .nk-pop-float { top: auto; bottom: 100%; margin: 0 0 4px; }\n :host([placement="top-end"]) .nk-pop-float { top: auto; bottom: 100%; left: auto; right: 0; margin: 0 0 4px; }\n');const Rt=new Set(["nk-menu","nk-emoji-picker"]);class Ut extends p{static get hostStyles(){return $t}static get observedAttributes(){return["open","placement","bare"]}render(){const t=this.createElement("div",["nk-pop-anchor"]);this._triggerSlot=this.createElement("slot",[],{name:"trigger"}),this._float=this.createElement("div",["nk-pop-float"]),this._surface=this.createElement("div",["nk-pop"]),this._slot=document.createElement("slot"),this._surface.appendChild(this._slot),this._float.appendChild(this._surface),t.append(this._triggerSlot,this._float),this._wrapper.appendChild(t),this._syncSurface()}_syncSurface(){const t=this.getBoolAttr("bare")||this._slot.assignedElements().some(t=>Rt.has(t.localName));this._surface.className=t?"":"nk-pop"}setupEvents(){this._onTrigger=t=>{t.composedPath().some(t=>t instanceof Element&&"trigger"===t.getAttribute?.("slot"))&&(t.stopPropagation(),this.toggle())},this._onDocClick=t=>{this.getBoolAttr("open")&&!t.composedPath().includes(this)&&this.close()},this._onKey=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&this.close()},this._onSelect=t=>{t.target!==this&&this.close()},this._onSlot=()=>this._syncSurface(),this.addEventListener("click",this._onTrigger),document.addEventListener("click",this._onDocClick),document.addEventListener("keydown",this._onKey),this._float.addEventListener("nk-select",this._onSelect),this._slot.addEventListener("slotchange",this._onSlot)}teardownEvents(){this.removeEventListener("click",this._onTrigger),document.removeEventListener("click",this._onDocClick),document.removeEventListener("keydown",this._onKey),this._float?.removeEventListener("nk-select",this._onSelect),this._slot?.removeEventListener("slotchange",this._onSlot)}onAttributeChanged(t){if("bare"===t&&this._syncSurface(),"open"===t){const t=this.getBoolAttr("open");for(const e of this._triggerSlot.assignedElements())e.setAttribute("aria-expanded",t?"true":"false");this.emit("nk-toggle",{open:t})}}show(){this.setBoolAttr("open",!0)}close(){this.setBoolAttr("open",!1)}toggle(){this.setBoolAttr("open",!this.getBoolAttr("open"))}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get placement(){return this.getAttribute("placement")||"bottom-start"}set placement(t){this.setAttribute("placement",t)}}customElements.define("nk-pop",Ut);const Ht=(t,e,n)=>n.map(([n,i])=>({char:n,name:i,cat:t,icon:e})),Wt=[{id:"smileys",icon:"๐"},{id:"people",icon:"๐"},{id:"nature",icon:"๐ฟ"},{id:"food",icon:"โ"},{id:"activity",icon:"๐ฏ"},{id:"travel",icon:"๐"},{id:"objects",icon:"๐ก"},{id:"symbols",icon:"โ
"}],Gt=[...Ht("smileys","๐",[["๐","grinning"],["๐","smile blush"],["๐","joy laugh"],["๐","slight smile"],["๐","wink"],["๐","heart eyes love"],["๐ค","thinking"],["๐","cool sunglasses"],["๐ฅณ","party"],["๐ด","sleep"],["๐คฏ","mind blown"],["๐
","sweat smile"],["๐","upside down"],["๐","angel halo"],["๐ค","hug"],["๐ข","cry sad"]]),...Ht("people","๐",[["๐","wave hello"],["๐","thumbs up"],["๐","thumbs down"],["๐","pray thanks"],["๐","clap"],["๐ค","handshake deal"],["๐ช","strong"],["๐","eyes look"],["๐ง ","brain knowledge"],["โค๏ธ","heart love"],["๐ค","person user"],["๐ฅ","people team members"],["๐งโ๐ป","developer"],["๐","raise hand"],["โ๏ธ","writing"],["๐ซถ","heart hands"]]),...Ht("nature","๐ฟ",[["๐ฟ","leaf herb"],["๐ฑ","seedling"],["๐ณ","tree"],["๐ธ","blossom flower"],["๐","sun"],["๐","moon night"],["โญ","star"],["๐ฅ","fire hot"],["๐","rainbow"],["๐","wave water"],["๐","clover luck"],["๐","bee"],["๐ฆ","butterfly"],["๐ข","turtle"],["๐","earth globe"],["โ๏ธ","snow"]]),...Ht("food","โ",[["โ","coffee"],["๐ต","tea"],["๐","apple"],["๐","pizza"],["๐ฐ","cake"],["๐ช","cookie"],["๐ฅ","croissant"],["๐","burger"],["๐","noodles"],["๐บ","beer"],["๐ท","wine"],["๐ฅ","salad"],["๐ซ","chocolate"],["๐","strawberry"],["๐ฅ","avocado"],["๐ฉ","donut"]]),...Ht("activity","๐ฏ",[["๐ฏ","target goal"],["๐","trophy win"],["๐","tada celebration"],["๐จ","art palette design"],["๐๏ธ","microphone podcast voice"],["๐ฌ","clapper movie"],["๐ฎ","game"],["โฝ","football"],["๐","run"],["๐ง","yoga calm"],["๐ต","music"],["๐ฒ","dice"],["๐","finish flag"],["๐","graduation learn"],["๐งฉ","puzzle piece"],["๐","repeat retro"]]),...Ht("travel","๐",[["๐","rocket launch"],["โ๏ธ","plane travel"],["๐","car"],["๐ฒ","bike"],["๐ ","house home"],["๐ข","office building"],["๐บ๏ธ","map"],["๐งญ","compass"],["โฐ๏ธ","mountain"],["๐๏ธ","beach"],["๐","station"],["๐ฐ๏ธ","satellite"],["๐","city"],["๐๏ธ","camping"],["โต","sailboat"],["๐ซ","departure"]]),...Ht("objects","๐ก",[["๐ก","idea bulb"],["๐","chart bar"],["๐","chart up"],["๐
","calendar date"],["๐","page document"],["๐","folder"],["๐๏ธ","card box database"],["๐","pin"],["๐","search"],["๐ ๏ธ","tools"],["โ๏ธ","gear settings"],["๐","bell notification"],["๐","gem diamond"],["๐","memo notes"],["๐","paperclip files"],["๐","lock secure"],["๐ฌ","speech comment"],["๐ค","export outbox"],["๐ฅ","inbox"],["๐๏ธ","trash bin"],["๐ฅ๏ธ","desktop"],["๐ฑ","phone"],["๐ป","laptop"],["๐งพ","receipt"]]),...Ht("symbols","โ
",[["โ
","check done"],["โจ","sparkles ai magic"],["โ","cross no"],["โ ๏ธ","warning"],["โน๏ธ","info"],["โ","question"],["โ","plus add"],["โก๏ธ","arrow right"],["๐ด","red circle"],["๐ข","green circle"],["๐ก","yellow circle"],["๐ต","blue circle"],["โณ","hourglass wait"],["โป๏ธ","recycle"],["๐","new"],["๐ฏ","hundred"]])];class Qt extends p{static get observedAttributes(){return["placeholder","value"]}render(){this._box=this.createElement("div",["nk-pop"]),this._search=this.createElement("input",["nk-emoji-search"],{type:"search",autocomplete:"off","aria-label":"Search emoji"}),this._grid=this.createElement("div",["nk-emoji-grid"],{role:"listbox"}),this._cats=this.createElement("div",["nk-emoji-cats"],{role:"tablist"}),this._box.append(this._search,this._grid,this._cats),this._wrapper.appendChild(this._box),this._emojis=Gt,this._cat=Wt[0].id,this._renderCats(),this._renderGrid(),this._syncAttrs()}_syncAttrs(){this._search.placeholder=this.getAttribute("placeholder")||"Searchโฆ"}_renderCats(){this._cats.replaceChildren();const t=this._categories();for(const e of t){const t=this.createElement("span",[],{role:"tab","data-cat":e.id,title:e.id});t.textContent=e.icon,t.classList.toggle("active",e.id===this._cat),this._cats.appendChild(t)}this._cats.style.display=t.length>1?"":"none"}_categories(){if(this._catList)return this._catList;const t=new Map;for(const e of this._emojis)e.cat&&!t.has(e.cat)&&t.set(e.cat,{id:e.cat,icon:e.icon||Wt.find(t=>t.id===e.cat)?.icon||e.char});return[...t.values()]}_renderGrid(){const t=this._search.value.trim().toLowerCase(),e=t?this._emojis.filter(e=>(e.name||"").toLowerCase().includes(t)||e.char===t):this._emojis.filter(t=>!t.cat||t.cat===this._cat);this._grid.replaceChildren();for(const t of e.slice(0,64)){const e=this.createElement("span",[],{role:"option",title:t.name||"","data-emoji":t.char});e.textContent=t.char,this._grid.appendChild(e)}for(const e of this._cats.children)e.classList.toggle("active",!t&&e.dataset.cat===this._cat)}setupEvents(){this._onInput=()=>this._renderGrid(),this._onGrid=t=>{const e=t.target.closest("[data-emoji]");e&&this.select(e.dataset.emoji)},this._onCats=t=>{const e=t.target.closest("[data-cat]");e&&(this._cat=e.dataset.cat,this._search.value="",this._renderGrid())},this._onKey=t=>{if("Enter"===t.key){const t=this._grid.querySelector("[data-emoji]");t&&this.select(t.dataset.emoji)}},this._search.addEventListener("input",this._onInput),this._search.addEventListener("keydown",this._onKey),this._grid.addEventListener("click",this._onGrid),this._cats.addEventListener("click",this._onCats)}teardownEvents(){this._search?.removeEventListener("input",this._onInput),this._search?.removeEventListener("keydown",this._onKey),this._grid?.removeEventListener("click",this._onGrid),this._cats?.removeEventListener("click",this._onCats)}select(t){this.setAttribute("value",t),this.emit("nk-select",{emoji:t,value:t})}onAttributeChanged(){this._syncAttrs()}focus(t){this._search?.focus(t)}get categories(){return this._categories()}set categories(t){this._catList=Array.isArray(t)&&t.length?t:null,this._cat=this._categories()[0]?.id,this._renderCats(),this._renderGrid()}get emojis(){return this._emojis}set emojis(t){this._emojis=Array.isArray(t)?t:Gt,this._cat=this._categories()[0]?.id,this._renderCats(),this._renderGrid()}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}}customElements.define("nk-emoji-picker",Qt);class Xt extends p{static get observedAttributes(){return["open","duration","icon"]}render(){this._box=this.createElement("div",["nk-toast"],{role:"status","aria-live":"polite"}),this._icon=document.createElement("span"),this._msg=document.createElement("span"),this._box.append(this._icon,this._msg,document.createElement("slot")),this._wrapper.appendChild(this._box),this._sync()}_sync(){this.getBoolAttr("open")&&this._lift(),this._box.classList.toggle("show",this.getBoolAttr("open"));const t=this.getAttribute("icon")??"โ";this._icon.textContent=t,this._icon.style.display=t?"":"none"}_lift(){const t=[...document.querySelectorAll(".nk-tab-bar")];for(const e of document.querySelectorAll("nk-tab-bar")){const n=e.shadowRoot?.querySelector(".nk-tab-bar");n&&t.push(n)}const e=t.map(t=>t.getBoundingClientRect()).find(t=>t.height>0&&t.top<innerHeight&&t.bottom>innerHeight-60);this._box.style.bottom=e?`${Math.round(innerHeight-e.top+12)}px`:""}show(t,{duration:e}={}){void 0!==t&&(this._msg.textContent=t),clearTimeout(this._timer),this.setBoolAttr("open",!0);const n=e??Number(this.getAttribute("duration"))??2200;n>0&&(this._timer=setTimeout(()=>this.close(),n||2200))}close(){clearTimeout(this._timer),this.setBoolAttr("open",!1)}onAttributeChanged(t){this._sync(),"open"===t&&this.emit("nk-toggle",{open:this.getBoolAttr("open")})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._timer)}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}get message(){return this._msg?.textContent??""}set message(t){this._msg&&(this._msg.textContent=t)}}customElements.define("nk-toast",Xt);class Yt extends p{static get observedAttributes(){return["view","add-view"]}render(){this._box=this.createElement("div",["nk-database"]),this._tabs=this.createElement("div",["nk-db-tabs"],{role:"tablist"}),this._slot=document.createElement("slot"),this._box.append(this._tabs,this._slot),this._wrapper.appendChild(this._box),this._columns=[],this._rows=[],this._sync()}get views(){return this._slot?.assignedElements().filter(t=>/^nk-[a-z]+-view$/.test(t.localName))??[]}_sync(){if(!this._tabs)return;const t=this.views;let e=this.getAttribute("view");t.some(t=>t.name===e)||(e=t[0]?.name??null),this._tabs.replaceChildren();for(const n of t){const t=this.createElement("span",["nk-db-tab"],{role:"tab","data-view":n.name,tabindex:"0"});t.classList.toggle("active",n.name===e),t.setAttribute("aria-selected",n.name===e?"true":"false"),t.append(document.createTextNode(n.getAttribute("label")||n.name));const i=n.hasAttribute("count")?String(this._rows.length):n.getAttribute("badge");if(i){const e=this.createElement("span",["badge"]);e.textContent=i,t.appendChild(e)}this._tabs.appendChild(t),n.hidden=n.name!==e,n.setData?.(this._columns,this._rows)}if(this.getBoolAttr("add-view")){const t=this.createElement("span",["nk-db-tab"],{role:"button","data-add":"",tabindex:"0"});t.style.color="var(--nk-text-tertiary)",t.textContent="๏ผ",this._tabs.appendChild(t)}this._tabs.style.display=t.length?"":"none",this._current=e}requestSync(){this._syncQueued||(this._syncQueued=!0,queueMicrotask(()=>{this._syncQueued=!1,this._sync()}))}setupEvents(){this._onClick=t=>{const e=t.target.closest("[data-view]");e?this.view=e.dataset.view:t.target.closest("[data-add]")&&this.emit("nk-action",{action:"add-view"})},this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||!t.target.closest("[data-view],[data-add]")||(t.preventDefault(),t.target.click())},this._onSlot=()=>this._sync(),this._tabs.addEventListener("click",this._onClick),this._tabs.addEventListener("keydown",this._onKey),this._slot.addEventListener("slotchange",this._onSlot),this._sync()}teardownEvents(){this._tabs?.removeEventListener("click",this._onClick),this._tabs?.removeEventListener("keydown",this._onKey),this._slot?.removeEventListener("slotchange",this._onSlot)}onAttributeChanged(t){const e=this._current;this._sync(),"view"===t&&this._current!==e&&this.emit("nk-view-change",{view:this._current})}get columns(){return this._columns}set columns(t){this._columns=Array.isArray(t)?t:[],this._sync()}get rows(){return this._rows}set rows(t){this._rows=Array.isArray(t)?t:[],this._sync()}get view(){return this._current??this.getAttribute("view")}set view(t){this.setAttribute("view",t)}refresh(){this._sync()}}customElements.define("nk-database",Yt);const Zt=(t,e,n)=>{const i=document.createElement(t);return e&&(i.className=e),null!=n&&(i.textContent=n),i},Jt=["gray","brown","orange","yellow","green","blue","purple","pink","red"];function te(t,e){const n=function(t,e){const n=t.options||[];return n.find(t=>t.value===e)||n.find(t=>t.label===e)||null}(t,e),i=n?.color&&Jt.includes(n.color)?n.color:"gray";return Zt("span",`nk-tag ${i}`,n?.label??String(e))}function ee(t,e,n={}){const i=t.type||"text";if(null==e||""===e)return"checkbox"===i?ne(t,!1,n):"progress"===i?ie(0):Zt("span","person"===i?"person-cell":null,"text"===i&&t.title?"":"โ");switch(i){case"select":return te(t,e);case"multi-select":{const n=Zt("span");n.style.display="inline-flex",n.style.gap="4px",n.style.flexWrap="wrap";for(const i of Array.isArray(e)?e:String(e).split(",").map(t=>t.trim()).filter(Boolean))n.appendChild(te(t,i));return n}case"date":return Zt("span","date-cell",String(e));case"person":{const t=Zt("span","person-cell"),n="string"==typeof e?{name:e}:e,i=Zt("span","mini-avatar",n.initials||n.avatar||(n.name||"").split(/\s+/).map(t=>t[0]).join("").slice(0,2).toUpperCase());return i.style.background=n.color||"var(--nk-text-tertiary)",t.append(i,document.createTextNode(" "+(n.name||""))),t}case"checkbox":return ne(t,!!e,n);case"url":{const t=Zt("a",null,String(e).replace(/^https?:\/\//,""));return t.href=String(e),t.target="_blank",t.rel="noopener",t}case"number":return Zt("span",null,"number"==typeof e?e.toLocaleString():String(e));case"progress":return ie(Number(e)||0);default:if(t.title){const t=Zt("span","row-title");return n.icon&&t.append(document.createTextNode(n.icon+" ")),t.append(document.createTextNode(String(e))),t}return Zt("span",null,String(e))}}function ne(t,e,n){const i=Zt("label","nk-check"),s=Zt("input");return s.type="checkbox",s.checked=e,s.dataset.key=t.key,null!=n.id&&(s.dataset.rowId=n.id),i.appendChild(s),i}function ie(t){const e=document.createDocumentFragment(),n=Zt("span","nk-progress"),i=Zt("i");return i.style.width=`${Math.max(0,Math.min(100,t))}%`,n.appendChild(i),e.append(n,Zt("span","nk-progress-label",`${Math.round(t)}%`)),e}function se(t,e=1){const n=t.type||"text";return(i,s)=>{let r=i[t.key],o=s[t.key];return"person"===n&&(r=r?.name??r??"",o=o?.name??o??""),"number"===n||"progress"===n||"checkbox"===n?((Number(r)||0)-(Number(o)||0))*e:String(r??"").localeCompare(String(o??""),void 0,{numeric:!0})*e}}class re extends p{static get observedAttributes(){return["name","label","badge","count","new-row","new-row-label","sortable","sort-key","sort-dir","wrap"]}render(){this._wrap=this.createElement("div",["nk-table-wrap"]),this._table=this.createElement("table",["nk-table"]),this._thead=document.createElement("thead"),this._tbody=document.createElement("tbody"),this._table.append(this._thead,this._tbody),this._newRow=this.createElement("div",["nk-new-row"],{role:"button",tabindex:"0"}),this._wrap.append(this._table,this._newRow),this._wrapper.appendChild(this._wrap),this._columns??=[],this._rows??=[],this._render(),this.closest("nk-database")?.requestSync?.()}_sortedRows(){const t=this.getAttribute("sort-key"),e=this._columns.find(e=>e.key===t);return e?[...this._rows].sort(se(e,"desc"===this.getAttribute("sort-dir")?-1:1)):this._rows}_render(){if(!this._thead)return;this._table.classList.toggle("wrap",this.getBoolAttr("wrap"));const t=document.createElement("tr");for(const e of this._columns){const n=this.createElement("th",[],{"data-key":e.key,scope:"col"});if(e.icon){const t=this.createElement("span",["th-icon"]);t.textContent=e.icon,n.appendChild(t)}n.appendChild(document.createTextNode(e.label??e.key)),e.key===this.getAttribute("sort-key")&&n.appendChild(document.createTextNode("desc"===this.getAttribute("sort-dir")?" โ":" โ")),e.width&&(n.style.width=e.width),t.appendChild(n)}this._thead.replaceChildren(t),this._tbody.replaceChildren();for(const t of this._sortedRows()){const e=this.createElement("tr",[],{"data-id":t.id??""});for(const n of this._columns){const i=document.createElement("td");i.appendChild(ee(n,t[n.key],t)),e.appendChild(i)}this._tbody.appendChild(e)}this._newRow.textContent=this.getAttribute("new-row-label")||"๏ผ New page",this._newRow.style.display=this.getBoolAttr("new-row")?"":"none"}setupEvents(){this._onClick=t=>{if(this._newRow.contains(t.target))return void this.emit("nk-action",{action:"new-row"});const e=t.target.closest("th[data-key]");if(e){const t=e.dataset.key,n=this.getAttribute("sort-key")===t&&"desc"!==this.getAttribute("sort-dir")?"desc":"asc";return void(this.emit("nk-action",{action:"sort",key:t,value:n})&&this.getBoolAttr("sortable")&&(this.setAttribute("sort-key",t),this.setAttribute("sort-dir",n)))}if(t.target.closest("input[type=checkbox], a"))return;const n=t.target.closest("tr[data-id]");if(n){const t=this._rowById(n.dataset.id);this.emit("nk-select",{row:t,id:t?.id,value:t?.id})}},this._onChange=t=>{const e=t.target;if("checkbox"!==e.type)return;const n=this._rowById(e.dataset.rowId);n&&(n[e.dataset.key]=e.checked),this.emit("nk-change",{row:n,key:e.dataset.key,value:e.checked})},this._onKey=t=>{"Enter"!==t.key&&" "!==t.key||t.target!==this._newRow||(t.preventDefault(),this.emit("nk-action",{action:"new-row"}))},this._wrap.addEventListener("click",this._onClick),this._wrap.addEventListener("change",this._onChange),this._wrap.addEventListener("keydown",this._onKey)}teardownEvents(){this._wrap?.removeEventListener("click",this._onClick),this._wrap?.removeEventListener("change",this._onChange),this._wrap?.removeEventListener("keydown",this._onKey)}_rowById(t){return this._rows.find(e=>String(e.id)===String(t))}onAttributeChanged(){this._render()}get name(){return this.getAttribute("name")||"table"}get columns(){return this._columns}set columns(t){this._columns=Array.isArray(t)?t:[],this._render()}get rows(){return this._rows}set rows(t){this._rows=Array.isArray(t)?t:[],this._render()}set data({columns:t,rows:e}){this.setData(t,e)}setData(t,e){this._columns=t||[],this._rows=e||[],this._render()}refresh(){this._render()}}customElements.define("nk-table-view",re);class oe extends p{static get observedAttributes(){return["name","label","badge","count","group-by","title-key","meta-keys","new-row"]}render(){this._board=this.createElement("div",["nk-board","active"]),this._wrapper.appendChild(this._board),this._columns??=[],this._rows??=[],this._render(),this.closest("nk-database")?.requestSync?.()}_groupColumn(){const t=this.getAttribute("group-by");return this._columns.find(e=>e.key===t)||this._columns.find(t=>"select"===t.type)||null}_titleColumn(){const t=this.getAttribute("title-key");return this._columns.find(e=>e.key===t)||this._columns.find(t=>t.title)||this._columns[0]||null}_metaColumns(){const t=(this.getAttribute("meta-keys")||"").split(",").map(t=>t.trim()).filter(Boolean);return t.length?t.map(t=>this._columns.find(e=>e.key===t)).filter(Boolean):this._columns.filter(t=>"date"===t.type||"progress"===t.type)}_render(){if(!this._board)return;this._board.replaceChildren();const t=this._groupColumn(),e=this._titleColumn();if(!t)return;const n=t.options?.length?t.options:[...new Set(this._rows.map(e=>e[t.key]))].map(t=>({value:t,label:String(t)}));for(const i of n){const n=this.createElement("div",["nk-board-col"],{"data-value":i.value}),s=this.createElement("div",["nk-board-col-header"]),r=this._rows.filter(e=>e[t.key]===i.value||e[t.key]===i.label),o=this.createElement("span",["count"]);o.textContent=String(r.length),s.append(te(t,i.value),o),n.appendChild(s);for(const t of r){const i=this.createElement("div",["nk-card"],{draggable:"true","data-id":t.id??"",tabindex:"0"}),s=this.createElement("div",["card-title"]);s.textContent=`${t.icon?t.icon+" ":""}${e?t[e.key]??"":""}`;const r=this.createElement("div",["card-meta"]);for(const e of this._metaColumns()){const n=t[e.key];if(null==n||""===n)continue;const i=document.createElement("span");"progress"===e.type?i.textContent=`โฐ ${n}%`:"date"===e.type?i.textContent=`๐
${n}`:i.appendChild(ee(e,n,t)),r.appendChild(i)}i.append(s,r),n.appendChild(i)}if(this.getBoolAttr("new-row")){const t=this.createElement("div",["nk-new-row"],{role:"button",tabindex:"0","data-add":i.value});t.style.padding="6px 10px",t.textContent="๏ผ",n.appendChild(t)}this._board.appendChild(n)}}setupEvents(){this._onClick=t=>{const e=t.target.closest("[data-add]");if(e)return void this.emit("nk-action",{action:"new-row",value:e.dataset.add});const n=t.target.closest(".nk-card");if(n){const t=this._rowById(n.dataset.id);this.emit("nk-select",{row:t,id:t?.id,value:t?.id})}},this._onDragStart=t=>{const e=t.target.closest?.(".nk-card");if(e){this._dragId=e.dataset.id,t.dataTransfer.effectAllowed="move";try{t.dataTransfer.setData("text/plain",e.dataset.id)}catch{}}},this._onDragOver=t=>{null!=this._dragId&&t.target.closest(".nk-board-col")&&(t.preventDefault(),t.dataTransfer.dropEffect="move")},this._onDrop=t=>{const e=t.target.closest(".nk-board-col");e&&null!=this._dragId&&(t.preventDefault(),this.move(this._dragId,e.dataset.value),this._dragId=null)},this._board.addEventListener("click",this._onClick),this._board.addEventListener("dragstart",this._onDragStart),this._board.addEventListener("dragover",this._onDragOver),this._board.addEventListener("drop",this._onDrop)}teardownEvents(){this._board?.removeEventListener("click",this._onClick),this._board?.removeEventListener("dragstart",this._onDragStart),this._board?.removeEventListener("dragover",this._onDragOver),this._board?.removeEventListener("drop",this._onDrop)}move(t,e){const n=this._rowById(t),i=this._groupColumn();n&&i&&n[i.key]!==e&&(n[i.key]=e,this._render(),this.emit("nk-change",{row:n,key:i.key,value:e}))}_rowById(t){return this._rows.find(e=>String(e.id)===String(t))}onAttributeChanged(){this._render()}get name(){return this.getAttribute("name")||"board"}get columns(){return this._columns}set columns(t){this._columns=Array.isArray(t)?t:[],this._render()}get rows(){return this._rows}set rows(t){this._rows=Array.isArray(t)?t:[],this._render()}set data({columns:t,rows:e}){this.setData(t,e)}setData(t,e){this._columns=t||[],this._rows=e||[],this._render()}refresh(){this._render()}}customElements.define("nk-board-view",oe);class ae extends p{static get observedAttributes(){return["search","placeholder","no-filter","no-sort","value"]}render(){this._bar=document.createElement("div"),this._bar.style.cssText="display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:8px 0",this._filterBtn=this.createElement("button",["nk-btn","secondary","small"],{type:"button","data-action":"filter"}),this._filterBtn.textContent="โฒ Filter",this._sortBtn=this.createElement("button",["nk-btn","secondary","small"],{type:"button","data-action":"sort"}),this._sortBtn.textContent="โ Sort",this._chips=document.createElement("span"),this._chips.style.cssText="display:inline-flex;gap:4px;flex-wrap:wrap",this._input=this.createElement("input",["nk-input"],{type:"search",autocomplete:"off"}),this._input.style.marginLeft="auto",this._bar.append(this._filterBtn,this._sortBtn,this._chips,document.createElement("slot"),this._input),this._wrapper.appendChild(this._bar),this._filters=[],this._sync()}_sync(){this._filterBtn.style.display=this.getBoolAttr("no-filter")?"none":"",this._sortBtn.style.display=this.getBoolAttr("no-sort")?"none":"",this._input.style.display=this.getBoolAttr("search")?"":"none",this._input.placeholder=this.getAttribute("placeholder")||"Search โฆ",this.hasAttribute("value")&&this._input.value!==this.getAttribute("value")&&(this._input.value=this.getAttribute("value")),this._chips.replaceChildren(),this._filters.forEach((t,e)=>{const n=this.createElement("span",["nk-tag",t.color||"blue"],{"data-index":e});n.style.cursor="pointer",n.textContent=`${t.label??`${t.key}: ${t.value}`} ร`,n.title="Remove filter",this._chips.appendChild(n)})}setupEvents(){this._onClick=t=>{const e=t.target.closest("[data-action]");if(e)return void this.emit("nk-action",{action:e.dataset.action});const n=t.target.closest("[data-index]");n&&(this._filters.splice(Number(n.dataset.index),1),this._sync(),this._emitChange())},this._onInput=()=>{clearTimeout(this._debounce),this._debounce=setTimeout(()=>this._emitChange(),150)},this._bar.addEventListener("click",this._onClick),this._input.addEventListener("input",this._onInput)}teardownEvents(){this._bar?.removeEventListener("click",this._onClick),this._input?.removeEventListener("input",this._onInput),clearTimeout(this._debounce)}_emitChange(){this.emit("nk-change",{filters:[...this._filters],search:this._input.value})}onAttributeChanged(){this._sync()}get filters(){return this._filters}set filters(t){this._filters=Array.isArray(t)?t:[],this._sync()}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t??"")}apply(t){const e=this.value.trim().toLowerCase();return t.filter(t=>this._filters.every(e=>t[e.key]===e.value)&&(!e||Object.values(t).some(t=>String("object"==typeof t&&t?t.name??"":t??"").toLowerCase().includes(e))))}}customElements.define("nk-filter-bar",ae);class le extends p{static get observedAttributes(){return["placeholder","send-label","no-input","disabled"]}render(){const t=this.createElement("div",["nk-comments"]);t.appendChild(document.createElement("slot")),this._row=this.createElement("div",["nk-comment-input"]),this._input=this.createElement("input",["nk-input"],{type:"text","aria-label":"Comment"}),this._btn=this.createElement("button",["nk-btn","primary","small"],{type:"button"}),this._row.append(this._input,this._btn),t.appendChild(this._row),this._wrapper.appendChild(t),this._sync()}_sync(){this._input.placeholder=this.getAttribute("placeholder")||"Comment โฆ",this._btn.textContent=this.getAttribute("send-label")||"Send",this._row.style.display=this.getBoolAttr("no-input")?"none":"",this._input.disabled=this._btn.disabled=this.getBoolAttr("disabled")}setupEvents(){this._onSend=()=>this.submit(),this._onKey=t=>{"Enter"===t.key&&(t.preventDefault(),this.submit())},this._btn.addEventListener("click",this._onSend),this._input.addEventListener("keydown",this._onKey)}teardownEvents(){this._btn?.removeEventListener("click",this._onSend),this._input?.removeEventListener("keydown",this._onKey)}submit(){const t=this._input.value.trim();if(!t)return;this.emit("nk-submit",{text:t})&&(this._input.value="")}onAttributeChanged(){this._sync()}focus(t){this._input?.focus(t)}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t??"")}}customElements.define("nk-comments",le);class he extends p{static get observedAttributes(){return["author","time","avatar","color"]}render(){const t=this.createElement("div",["nk-comment"]);this._avatar=this.createElement("span",["mini-avatar"]);const e=this.createElement("slot",[],{name:"avatar"});e.appendChild(this._avatar);const n=document.createElement("div");this._head=this.createElement("div",["c-head"]),this._author=document.createElement("b"),this._time=document.createTextNode(""),this._head.append(this._author,this.createElement("slot",[],{name:"head"}),this._time);const i=this.createElement("div",["c-body"]);i.appendChild(document.createElement("slot")),n.append(this._head,i),t.append(e,n),this._wrapper.appendChild(t),this._sync()}_sync(){const t=this.getAttribute("author")||"";this._author.textContent=t;const e=this.getAttribute("time");this._time.data=e?` ยท ${e}`:"",this._avatar.textContent=this.getAttribute("avatar")||t.split(/\s+/).map(t=>t[0]).join("").slice(0,2).toUpperCase(),this._avatar.style.background=this.getAttribute("color")||"var(--nk-text-tertiary)"}onAttributeChanged(){this._sync()}}customElements.define("nk-comment",he);class de extends p{render(){const t=this.createElement("div",["nk-ai-thread"],{role:"log","aria-live":"polite"});t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("nk-ai-thread",de);class ce extends p{static get observedAttributes(){return["role","name","badge","avatar","color"]}render(){this._box=this.createElement("div",["nk-ai-msg"]),this._avatar=this.createElement("span",["mini-avatar"]);const t=this.createElement("slot",[],{name:"avatar"});t.appendChild(this._avatar);const e=this.createElement("div",["a-body"]);this._name=this.createElement("div",["a-name"]),this._nameText=document.createTextNode(""),this._badge=document.createElement("span"),this._name.append(this._nameText,this._badge),this._actions=this.createElement("div",["nk-ai-actions"]),this._actionSlot=this.createElement("slot",[],{name:"actions"}),this._actions.appendChild(this._actionSlot),e.append(this._name,document.createElement("slot"),this._actions),this._box.append(t,e),this._wrapper.appendChild(this._box),this._sync()}_sync(){const t="user"===this.getAttribute("role");this._box.classList.toggle("user",t);const e=this.getAttribute("name");this._nameText.data=e||"";const n=this.getAttribute("badge");this._badge.textContent=n?` ${n}`:"",this._name.style.display=e?"":"none",this._avatar.textContent=this.getAttribute("avatar")||(t?(e||"U").slice(0,2).toUpperCase():"โจ");const i=this.getAttribute("color");this._avatar.style.background=i||"",this._actions.style.display=this._actionSlot.assignedElements().length?"":"none"}setupEvents(){this._onSlot=()=>this._sync(),this._onClick=t=>{const e=t.target.closest?.("button");e&&this._actionSlot.assignedElements().includes(e)&&this.emit("nk-action",{action:e.value||e.textContent.trim(),value:e.value||e.textContent.trim()})},this._actionSlot.addEventListener("slotchange",this._onSlot),this.addEventListener("click",this._onClick),this._sync()}teardownEvents(){this._actionSlot?.removeEventListener("slotchange",this._onSlot),this.removeEventListener("click",this._onClick)}onAttributeChanged(){this._sync()}}customElements.define("nk-ai-msg",ce);class pe extends p{static get observedAttributes(){return["placeholder","value","disabled","icon"]}render(){this._row=this.createElement("div",["nk-ai-input-row"]),this._icon=document.createElement("span"),this._icon.style.fontSize="14px",this._input=this.createElement("input",[],{type:"text","aria-label":"Message"}),this._btn=this.createElement("button",["nk-ai-send"],{type:"button","aria-label":"Send"}),this._btn.textContent="โ",this._row.append(this._icon,this._input,this._btn),this._wrapper.appendChild(this._row),this._sync()}_sync(){this._input.placeholder=this.getAttribute("placeholder")||"Ask something โฆ",this.hasAttribute("value")&&this._input.value!==this.getAttribute("value")&&(this._input.value=this.getAttribute("value")),this._input.disabled=this._btn.disabled=this.getBoolAttr("disabled");const t=this.getAttribute("icon")??"โจ";this._icon.textContent=t,this._icon.style.display=t?"":"none"}setupEvents(){this._onSend=()=>this.submit(),this._onKey=t=>{"Enter"===t.key&&(t.preventDefault(),this.submit())},this._btn.addEventListener("click",this._onSend),this._input.addEventListener("keydown",this._onKey)}teardownEvents(){this._btn?.removeEventListener("click",this._onSend),this._input?.removeEventListener("keydown",this._onKey)}submit(){const t=this._input.value.trim();if(!t||this.getBoolAttr("disabled"))return;this.emit("nk-submit",{text:t})&&(this._input.value="")}onAttributeChanged(){this._sync()}focus(t){this._input?.focus(t)}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t??"")}}return customElements.define("nk-ai-input-row",pe),t.NkAiInputRow=pe,t.NkAiMsg=ce,t.NkAiThread=de,t.NkApp=U,t.NkAvatarGroup=yt,t.NkBanner=ct,t.NkBlockHost=ht,t.NkBoardView=oe,t.NkBreadcrumb=et,t.NkBtn=g,t.NkCallout=j,t.NkCheck=A,t.NkCmdk=Kt,t.NkCode=$,t.NkComment=he,t.NkComments=le,t.NkDangerZone=Bt,t.NkDatabase=Yt,t.NkDivider=I,t.NkElement=p,t.NkEmojiPicker=Qt,t.NkEmpty=pt,t.NkField=T,t.NkFields=D,t.NkFilterBar=ae,t.NkFormElement=u,t.NkHeading=q,t.NkInput=_,t.NkKbd=P,t.NkMemberList=St,t.NkMemberRow=Nt,t.NkMention=At,t.NkMenu=Ot,t.NkMenuItem=Pt,t.NkModal=Mt,t.NkModelCard=Ct,t.NkPage=rt,t.NkPageActions=lt,t.NkPageCover=ot,t.NkPageTitle=at,t.NkPop=Ut,t.NkProfileRow=Lt,t.NkProgress=M,t.NkQuote=R,t.NkRadio=B,t.NkSectionLabel=X,t.NkSegmented=vt,t.NkSelect=y,t.NkSettingsPane=jt,t.NkSettingsUser=It,t.NkSidebar=W,t.NkSkeleton=ut,t.NkSlider=N,t.NkStat=ft,t.NkStats=xt,t.NkSwitch=w,t.NkSynced=bt,t.NkTab=kt,t.NkTabBar=it,t.NkTabBarItem=st,t.NkTableView=re,t.NkTabs=mt,t.NkTag=F,t.NkTemplateBtn=Et,t.NkTextarea=f,t.NkThemeToggle=nt,t.NkToast=Xt,t.NkTodo=O,t.NkToggle=K,t.NkTopbar=tt,t.NkTree=Z,t.NkTreeItem=J,t.NkWorkspaceSwitcher=Q,t.compareBy=se,t.renderPropertyCell=ee,t.tagFor=te,t}({});
|