diff --git a/website/control-panel/public/cp-v2/citizen-directory.css b/website/control-panel/public/cp-v2/citizen-directory.css index 9b63017f..e29b5fc4 100644 --- a/website/control-panel/public/cp-v2/citizen-directory.css +++ b/website/control-panel/public/cp-v2/citizen-directory.css @@ -18,3 +18,5 @@ .migration-directory .md-pager{display:flex;justify-content:end;align-items:center;gap:14px;margin-top:16px}.migration-directory .md-identity{display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin:18px 0 22px;padding-bottom:20px;border-bottom:1px solid var(--md-line)}.migration-directory .md-identity img{object-fit:contain;border-radius:9px}.migration-directory .md-identity a{margin-left:auto}.migration-directory .md-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.migration-directory .md-box{border:1px solid var(--md-line);border-radius:12px;background:linear-gradient(130deg,#1d4230,#102b22);padding:20px;display:grid;gap:14px;margin-bottom:18px}.migration-directory .md-detail{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:9px 0;border-bottom:1px solid #355741}.migration-directory .md-detail span{color:var(--md-muted)}.migration-directory .md-detail strong{overflow-wrap:anywhere}.migration-directory .md-assignment{border-left:3px solid #c7ad62;padding:8px 12px;background:#153326}.migration-directory .md-assignment strong{color:var(--md-gold)}.migration-directory .md-note{color:var(--md-muted);padding-top:12px}.migration-directory details{margin-top:12px}.migration-directory summary{color:var(--md-gold);cursor:pointer}.migration-directory .md-diagnostics{border-top:1px solid #476046;padding-top:16px}.migration-directory .md-diagnostics p{margin:12px 0}.migration-directory .md-status:empty{display:none}@media(max-width:850px){.migration-directory .md-grid{grid-template-columns:1fr}.migration-directory .md-table{min-width:650px}} .migration-directory .md-assignment-form{display:grid;gap:12px;margin-top:18px}.migration-directory textarea{font:inherit;background:#102b22;color:#f2e7c8;border:1px solid #66846b;border-radius:8px;padding:11px;box-sizing:border-box;width:100%}.migration-directory .md-policy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:14px}.migration-directory .md-permission{display:flex;align-items:start;gap:10px;padding:10px;background:#153528;border-radius:8px;overflow-wrap:anywhere}.migration-directory .md-permission input{margin-top:5px}.migration-directory .md-permission strong{font-weight:500}.migration-directory .md-permission small{display:block}.migration-directory .md-permission[hidden]{display:none}@media(max-width:850px){.migration-directory .md-policy-grid{grid-template-columns:1fr}} .md-seal-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:14px;margin:18px 0}.md-seal-gallery figure,.md-seal-choice{margin:0;padding:16px;border:1px solid #607653;border-radius:10px;background:#102b21;text-align:center;overflow-wrap:anywhere}.md-seal-gallery img{display:block;width:96px;height:96px;object-fit:contain;margin:0 auto 10px}.md-seal-gallery figcaption,.md-seal-choice span{display:block;color:#e5cf92;font-size:13px}.md-seal-gallery small{display:block;color:#a7bca7;font-size:11px}.md-seal-choice{cursor:pointer}.md-seal-choice:has(input:checked){border-color:#efcd79;box-shadow:0 0 0 1px #efcd79}.md-seal-choice input{accent-color:#ddbe70} +.md-console-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:20px;margin:20px 0}.md-console-tree{padding:16px;border:1px solid #9c8751;border-radius:12px;background:linear-gradient(145deg,#243c30,#102d24)}.md-console-tree h2{font:20px Georgia,serif;color:#ead09a;margin:0 0 18px}.md-directory-tree{height:580px;--wb-background-color:#102d24;--wb-text-color:#eee1ba;--wb-border-color:#8c7b4b;--wb-active-background-color:#756334;--wb-active-text-color:#fff0b7;--wb-hover-background-color:#2c4937}.md-directory-tree.wunderbaum{background:#102d24;color:#eadbb1;border-color:#8c7b4b}.md-directory-tree .wb-node{color:#eadbb1}.md-directory-tree .wb-node.wb-active{background:#695b31;color:#fff0b7}.md-console-actions{display:flex;gap:10px;flex-wrap:wrap;padding-bottom:15px;border-bottom:1px solid #887a4e}.md-console-actions button{padding:11px 16px;background:#2a4735;border:1px solid #a58b50;border-radius:7px;color:#eddaa5;cursor:pointer}.md-dashboard-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:13px;margin:24px 0}.md-dashboard-metrics article{padding:20px;border:1px solid #8b8254;border-radius:10px;background:linear-gradient(135deg,#2c4b38,#143329)}.md-dashboard-metrics small,.md-dashboard-metrics strong{display:block}.md-dashboard-metrics strong{font:34px Georgia,serif;color:#efda9a;margin-top:12px}.md-dashboard-activity article{display:grid;gap:7px;padding:15px;border-bottom:1px solid #74846766}.md-dashboard-activity time{font-size:12px;color:#aec1ad}@media(max-width:1000px){.md-console-layout{grid-template-columns:1fr}.md-directory-tree{height:260px}} +.md-console-layout{grid-template-columns:280px minmax(0,1fr)}.md-console-tree .md-directory-tree.wunderbaum{height:580px;min-height:580px;max-height:580px;font-size:13px;--wb-node-text-color:#eadbb1;--wb-background-color:#102d24;--wb-bg-highlight-color:#685b33;--wb-focus-border-color:#d6bb78;--wb-node-hover-color:#2d4936;--wb-alternate-row-color:#122f25}.md-directory-tree .wb-node.wb-active{background:transparent!important}.md-directory-tree .wb-row.wb-active>.wb-node{background:#685b33!important;color:#fff0b7}.md-directory-tree .wb-expander.bi::before{font-family:system-ui!important;font-style:normal;content:'▸'}.md-directory-tree .wb-expander.bi-chevron-down::before{content:'▾'}@media(max-width:1000px){.md-console-layout{grid-template-columns:1fr}.md-console-tree .md-directory-tree.wunderbaum{height:260px;min-height:260px;max-height:260px}} diff --git a/website/control-panel/public/cp-v2/citizen-directory.mjs b/website/control-panel/public/cp-v2/citizen-directory.mjs index 486998a9..b461d2a4 100644 --- a/website/control-panel/public/cp-v2/citizen-directory.mjs +++ b/website/control-panel/public/cp-v2/citizen-directory.mjs @@ -1,3 +1,4 @@ +import {mountDirectoryConsole} from './cp-v2-directory-console.mjs'; import {applyShellHeading} from './cp-v2-page-template.mjs'; const API='/api/admin/citizens'; @@ -118,7 +119,7 @@ export function mountCitizenDirectory(host){ }catch(e){if(e.name!=='AbortError'&&panel.isConnected)panel.replaceChildren(element('p',e.message));} } function renderAccount(){ - view.replaceChildren();heading();const back=button('← '+(context==='staff'?'Staff Directory':'User Directory'),()=>{selected=null;void load();});view.append(back); + view.replaceChildren();heading();const back=button('← '+(context==='staff'?'Staff Directory':'User Directory'),()=>{selected=null;void load();});view.append(back);if(selected.personnelNumber)view.append(badge(selected.personnelNumber)); const hero=element('header',undefined,'md-identity');const avatar=element('img');avatar.alt='';avatar.width=56;avatar.height=56;avatar.src=selected.minecraftUuid?'/api/avatars/face/'+encodeURIComponent(selected.minecraftUuid):'https://www.dunerealms.com/assets/nav-account-v2.webp'; const names=element('div');names.append(element('h2',selected.displayName),element('p',selected.username,'md-muted'));const publicLink=element('a','View public profile →');publicLink.href='https://www.dunerealms.com/people/'+encodeURIComponent(selected.username);hero.append(avatar,names,badge(selected.status),publicLink);view.append(hero); const tabs=context==='staff'?[['overview','Overview'],['account','Account'],['assignments','Staff assignments'],['permissions','Access preview'],['honours','Seals & honours'],['activity','Activity']]:[['overview','Overview'],['account','Account'],['assignments','Memberships & offices'],['honours','Seals & honours'],['activity','Activity']]; @@ -146,7 +147,7 @@ export function mountCitizenDirectory(host){ }view.append(toolbar);if(restoreSearch){search.focus({preventScroll:true});search.setSelectionRange(search.value.length,search.value.length);} const wrap=element('div',undefined,'md-table-wrap'),table=element('table',undefined,'md-table'),head=element('thead'),tr=element('tr'); for(const label of ['Citizen','Status',context==='staff'?'Functions':'Memberships & offices','Minecraft',''])tr.append(element('th',label));head.append(tr);table.append(head);const body=element('tbody'); - for(const a of data.accounts){const row=element('tr');const name=element('td');name.append(button(a.displayName,()=>open(a.id)),element('small',a.username));const state=element('td');state.append(badge(a.status));row.append(name,state,element('td',roleDescription(a)||(context==='staff'?'Awaiting migration':'Source integration pending'),'md-muted'),element('td',a.minecraftName||'Not linked'));const action=element('td');action.append(button(context==='staff'?'Manage staff →':'Manage user →',()=>open(a.id)));row.append(action);body.append(row);} + for(const a of data.accounts){const row=element('tr');const name=element('td');name.append(button(a.displayName,()=>open(a.id)),element('small',a.username+(a.personnelNumber?' · '+a.personnelNumber:'')));const state=element('td');state.append(badge(a.status));row.append(name,state,element('td',roleDescription(a)||(context==='staff'?'Awaiting migration':'Source integration pending'),'md-muted'),element('td',a.minecraftName||'Not linked'));const action=element('td');action.append(button(context==='staff'?'Manage staff →':'Manage user →',()=>open(a.id)));row.append(action);body.append(row);} if(!data.accounts.length){const row=element('tr'),cell=element('td','No matching '+(context==='staff'?'staff accounts.':'users.'));cell.colSpan=5;row.append(cell);body.append(row);}table.append(body);wrap.append(table);view.append(wrap); const pager=element('div',undefined,'md-pager'),previous=button('Previous',()=>{page--;void load();}),next=button('Next',()=>{page++;void load();});previous.disabled=page===1;next.disabled=!data.hasMore;pager.append(previous,element('span','Page '+page),next);view.append(pager); if(context==='staff'&&(department||branch))view.append(element('p','Department and branch filters use new-model assignments. Imported accounts appear in All staff until their assignments are migrated.','md-note')); @@ -160,5 +161,5 @@ export function mountCitizenDirectory(host){ } async function open(id){controller?.abort();controller=new AbortController();const current=++sequence;status.textContent='Loading account…';try{const data=await request(API+'/'+encodeURIComponent(id)+'?context='+context,controller.signal);if(disposed||current!==sequence)return;assignmentMode=data.assignmentMode;selected=data.account;tab='overview';renderAccount();status.textContent='';}catch(e){if(!disposed&&e.name!=='AbortError')status.textContent=e.message;}} async function load(){controller?.abort();controller=new AbortController();const current=++sequence;status.textContent='Loading '+context+'…';try{if(context==='staff'&&!catalogue.departments.length)catalogue=await request(API+'/catalogue?context=staff',controller.signal);const params=new URLSearchParams({context,page:String(page),q:query,status:filter,department,branch});const data=await request(API+'?'+params,controller.signal);if(disposed||current!==sequence)return;assignmentMode=data.assignmentMode;selected=null;renderList(data);status.textContent=data.accounts.length+' records on this page · search covers the complete directory.';}catch(e){if(!disposed&&e.name!=='AbortError'){view.replaceChildren();status.textContent=e.message;}}} - void load();return()=>{disposed=true;sequence++;clearTimeout(searchTimer);controller?.abort();root.remove();}; + const consoleView=mountDirectoryConsole(root,view,{select:route=>{context=route.context;department=route.department||'';branch=route.branch||'';page=1;selected=null;void load();},addStaff:()=>{context='staff';pickCandidate();},report:text=>{status.textContent=text;}});void consoleView.start();return()=>{consoleView.dispose();disposed=true;sequence++;clearTimeout(searchTimer);controller?.abort();root.remove();}; } diff --git a/website/control-panel/public/cp-v2/citizens-registry.mjs b/website/control-panel/public/cp-v2/citizens-registry.mjs index 1dd7ab83..c036a180 100644 --- a/website/control-panel/public/cp-v2/citizens-registry.mjs +++ b/website/control-panel/public/cp-v2/citizens-registry.mjs @@ -26,7 +26,7 @@ function renderRankBoxes(fieldset,available,{mode='multiple',selected=[]}={}){ } const game=node('section',undefined,'citizen-rank-section citizen-rank-game');game.append(node('h4','In-game ranks'),node('p','Minecraft permissions and house affiliation are managed separately. A verified in-game rank assignment API is not connected to this form.','citizen-scope'));groups.append(game);fieldset.append(groups) } -export function mountCitizensRegistry(host,{onCreated=()=>{}}={}){ +export function mountCitizensRegistry(host,{onCreated=()=>{},initialTab="directory"}={}){ if(!host)throw new Error('Citizens Registry requires a host element'); const root=node('section',undefined,'cp-v2-citizens'); const status=node('p','Connect to load authorized citizen records.','citizen-status');status.setAttribute('role','status'); @@ -90,7 +90,7 @@ export function mountCitizensRegistry(host,{onCreated=()=>{}}={}){ function activateTab(id){for(const [key,label,panel] of panels){const active=key===id;panel.hidden=!active;const b=tabButtons.get(key);b.setAttribute('aria-selected',String(active));b.tabIndex=active?0:-1}const current=tabButtons.get(id);if(current)current.focus({preventScroll:true})} for(const [key,label,panel,artwork] of panels){const b=node('button');b.type='button';b.className='citizen-art-tab';const icon=node('img');icon.src='https://www.dunerealms.com/assets/'+artwork;icon.alt='';icon.width=34;icon.height=34;icon.loading='lazy';b.append(icon,node('span',label));b.setAttribute('role','tab');b.setAttribute('aria-controls','citizen-panel-'+key);b.id='citizen-tab-'+key;b.onclick=()=>activateTab(key);b.onkeydown=e=>{if(e.key!=='ArrowLeft'&&e.key!=='ArrowRight')return;e.preventDefault();const i=panels.findIndex(x=>x[0]===key);activateTab(panels[(i+(e.key==='ArrowRight'?1:panels.length-1))%panels.length][0])};tabs.append(b);tabButtons.set(key,b)} for(const [key,label,panel] of panels){panel.id='citizen-panel-'+key;panel.setAttribute('role','tabpanel');panel.setAttribute('aria-labelledby','citizen-tab-'+key)} - root.append(tabs,...panels.map(x=>x[2]));activateTab('directory'); + root.append(tabs,...panels.map(x=>x[2]));activateTab(panels.some(p=>p[0]===initialTab)?initialTab:'directory'); host.replaceChildren(root); let page=1,rows=[],hasMore=false,disposed=false,controller=null,rankReady=false,submitting=false,sortField='rankLevel',sortDirection=-1;const checkedIds=new Set();function updateSelection(){selectedCount.textContent=checkedIds.size+' selected'} function selectCitizen(a){setSelected(a);activateTab('profile');detailBody.replaceChildren();for(const [label,value] of [['Username',a.username],['Email',a.email||'—'],['Minecraft',a.minecraftName||'Not linked'],['Status',a.accountStatus||'—'],['Primary rank',a.rankLabel||a.primaryRank],['Account ID',a.id],['Created',a.createdAt?new Date(a.createdAt).toLocaleString():'—']]){const row=node('div',undefined,'citizen-detail-row');row.append(node('span',label),node('strong',String(value??'—')));detailBody.append(row)}} diff --git a/website/control-panel/public/cp-v2/cp-v2-directory-console.mjs b/website/control-panel/public/cp-v2/cp-v2-directory-console.mjs new file mode 100644 index 00000000..0743dddf --- /dev/null +++ b/website/control-panel/public/cp-v2/cp-v2-directory-console.mjs @@ -0,0 +1,16 @@ +import {Wunderbaum} from './cp-v2-directory-tree-vendor.mjs'; +import {mountCitizensRegistry} from './citizens-registry.mjs'; +const el=(tag,text,cls)=>{const n=document.createElement(tag);if(text!==undefined)n.textContent=text;if(cls)n.className=cls;return n;}; +export function mountDirectoryConsole(root,view,{select,addStaff,report}={}){ + const css=el('link');css.rel='stylesheet';css.href='/v2/cp-v2-directory-tree-vendor.css';root.append(css); + const toolbar=el('nav',undefined,'md-console-actions'),layout=el('div',undefined,'md-console-layout'),sidebar=el('aside',undefined,'md-console-tree'),treeHost=el('div'); + sidebar.append(el('h2','DuneRealms Directory'),treeHost);treeHost.className='md-directory-tree';layout.append(sidebar,view);root.append(toolbar,layout); + let tree,active=true,disposeRegistry=()=>{};const controller=new AbortController(); + const button=(label,action)=>{const b=el('button',label);b.type='button';b.onclick=()=>{disposeRegistry();disposeRegistry=()=>{};action();};toolbar.append(b);return b;}; + const choose=route=>{disposeRegistry();disposeRegistry=()=>{};select(route);}; + button('Dashboard',()=>void dashboard());button('Create account',()=>{view.replaceChildren();disposeRegistry=mountCitizensRegistry(view,{initialTab:'enroll',onCreated:()=>choose({context:'users'})});});button('Appoint staff',()=>addStaff()); + async function data(){const r=await fetch('/api/admin/citizens/dashboard',{credentials:'same-origin',cache:'no-store',signal:controller.signal});const result=await r.json();if(!r.ok)throw Error(result.message||'Directory dashboard unavailable.');return result;} + async function dashboard(){try{const d=await data();if(!active)return;view.replaceChildren(el('h2','Directory Dashboard'),el('p','One account record for each person. User and staff responsibilities share the same directory.','md-muted'));const metrics=el('div',undefined,'md-dashboard-metrics');for(const [key,label]of [['users','Accounts'],['active','Active accounts'],['staff','Staff members'],['teams','Teams']]){const card=el('article');card.append(el('small',label),el('strong',String(d.counts[key])));metrics.append(card);}view.append(metrics,el('h3','Recent staff changes'));const activity=el('div',undefined,'md-dashboard-activity');for(const event of d.recent){const row=el('article');row.append(el('strong',[event.actor||'System',event.personnelNumber].filter(Boolean).join(' · ')),el('span',event.action+' · '+event.scope_key),el('time',new Date(Number(event.created_at)).toLocaleString('en-GB')));activity.append(row);}if(!d.recent.length)activity.append(el('p','No staff changes are recorded.'));view.append(activity);report('');}catch(error){if(active)report(error.message);}} + async function start(){try{const d=await data();if(!active)return;const routes=new Map([['users',{context:'users'}],['staff',{context:'staff'}]]),children=[{title:'Dashboard',key:'dashboard',icon:false},{title:'Users',key:'users',icon:false},{title:'Staff',key:'staff',expanded:true,icon:false,children:d.departments.map(department=>{const key='department:'+department.key;routes.set(key,{context:'staff',department:department.key});return{title:department.label,key,expanded:true,icon:false,children:department.branches.map(branch=>{const key='branch:'+branch.key;routes.set(key,{context:'staff',department:department.key,branch:branch.key});return{title:branch.label,key,icon:false};})};})}];tree=new Wunderbaum({element:treeHost,source:children,activate:event=>{if(event.node.key==='dashboard')void dashboard();else if(routes.has(event.node.key))choose(routes.get(event.node.key));}});await dashboard();}catch(error){if(active)report(error.message);}} + return {start,dispose(){active=false;controller.abort();disposeRegistry();tree?.destroy();layout.remove();toolbar.remove();css.remove();}}; +} diff --git a/website/control-panel/public/cp-v2/cp-v2-directory-tree-vendor.css b/website/control-panel/public/cp-v2/cp-v2-directory-tree-vendor.css new file mode 100644 index 00000000..bfccd3f8 --- /dev/null +++ b/website/control-panel/public/cp-v2/cp-v2-directory-tree-vendor.css @@ -0,0 +1,583 @@ +@charset "UTF-8"; +/*! + * Wunderbaum style sheet (generated from wunderbaum.scss) + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * @VERSION, @DATE (https://github.com/mar10/wunderbaum) + */ +:root, +:host { + --wb-font-stack: Helvetica, sans-serif; + --wb-error-color: #b5373b; + --wb-node-text-color: #56534c; + --wb-border-color: #56534c; + --wb-bg-highlight-color: #26a0da; + --wb-header-color: #dedede; + --wb-background-color: #ffffff; + --wb-alternate-row-color: #f7f7f7; + --wb-focus-border-color: #275dc5; + --wb-grid-color: #dedede; + --wb-filter-dim-color: #dedede; + --wb-filter-submatch-color: #868581; + --wb-row-outer-height: 22px; + --wb-row-inner-height: 20px; + --wb-row-padding-y: 1px; + --wb-col-padding-x: 2px; + --wb-icon-outer-height: 20px; + --wb-icon-outer-width: 20px; + --wb-icon-height: 16px; + --wb-icon-width: 16px; + --wb-icon-padding-y: 2px; + --wb-icon-padding-x: 2px; + --wb-header-height: 22px; +} + +@supports not (color: color-mix(in srgb, red, red)) { + :root, + :host { + --wb-alternate-row-color-hover: #f3f3f3; + --wb-drop-source-color: rgb(211.3703703704, 209.6481481481, 205.6296296296); + --wb-drop-target-color: rgb(212.2834645669, 236.2992125984, 247.7165354331); + --wb-dim-color: rgb(139.5925925926, 135.037037037, 124.4074074074); + --wb-error-background-color: rgb(244.6292372881, 220.8707627119, 221.625); + --wb-hover-color: rgb(247.1401574803, 251.5590551181, 253.6598425197); + --wb-active-color: #e5f3fb; + --wb-active-cell-color: rgb(125.1417322835, 198.1496062992, 232.8582677165); + --wb-active-border-color: #70c0e7; + --wb-active-hover-color: #dceff8; + --wb-active-hover-border-color: #26a0da; + --wb-active-column-color: rgb(247.1401574803, 251.5590551181, 253.6598425197); + --wb-active-header-column-color: rgb(196.5, 196.5, 196.5); + --wb-active-color-grayscale: #f0f0f0; + --wb-active-border-color-grayscale: rgb(171.5, 171.5, 171.5); + --wb-active-hover-color-grayscale: #eaeaea; + --wb-active-cell-color-grayscale: #b3b3b3; + --wb-grid-color-grayscale: #dedede; + } +} +div.wunderbaum * { + box-sizing: border-box; +} + +div.wunderbaum { + height: 100%; + min-height: 4px; + background-color: var(--wb-background-color); + margin: 0; + padding: 0; + font-family: var(--wb-font-stack); + font-size: 14px; + color: var(--wb-node-text-color); + border: 2px solid var(--wb-border-color); + border-radius: 4px; + background-clip: content-box; + overflow-x: auto; + overflow-y: scroll; +} +div.wunderbaum:focus, div.wunderbaum:focus-within { + border-color: var(--wb-focus-border-color); +} +div.wunderbaum.wb-disabled { + opacity: 0.7; + pointer-events: none; +} +div.wunderbaum div.wb-list-container { + position: relative; + min-height: 4px; +} +div.wunderbaum { + /* --- FIXED-COLUMN --- */ +} +div.wunderbaum div.wb-header { + position: sticky; + top: 0; + z-index: 2; + -webkit-user-select: none; /* Safari */ + user-select: none; +} +div.wunderbaum div.wb-header, +div.wunderbaum div.wb-list-container { + overflow: unset; +} +div.wunderbaum div.wb-row { + position: absolute; + width: 100%; + height: var(--wb-row-outer-height); + line-height: var(--wb-row-outer-height); + border: 1px solid transparent; +} +div.wunderbaum { + /* Fixed column must be opaque, i.e. have the bg color set. */ +} +div.wunderbaum.wb-fixed-col span.wb-col:first-of-type { + position: sticky; + left: 0; + z-index: 1; + background-color: var(--wb-background-color); +} +div.wunderbaum.wb-fixed-col div.wb-header span.wb-col:first-of-type { + background-color: var(--wb-header-color); +} +div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type, div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type { + background-color: var(--wb-active-color, color-mix(in srgb, var(--wb-bg-highlight-color) 12%, var(--wb-background-color))); +} +div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row.wb-active:hover span.wb-col:first-of-type, div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row.wb-selected:hover span.wb-col:first-of-type { + background-color: var(--wb-active-hover-color, color-mix(in srgb, var(--wb-bg-highlight-color) 16%, var(--wb-background-color))); +} +div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row:hover span.wb-col:first-of-type { + background-color: var(--wb-hover-color, color-mix(in srgb, var(--wb-bg-highlight-color) 4%, var(--wb-background-color))); +} +div.wunderbaum.wb-fixed-col:not(:focus-within) div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type, div.wunderbaum.wb-fixed-col:not(:focus-within) div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type, div.wunderbaum.wb-fixed-col:not(:focus) div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type, div.wunderbaum.wb-fixed-col:not(:focus) div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type { + background-color: var(--wb-active-color-grayscale, color-mix(in srgb, var(--wb-node-text-color) 9%, var(--wb-background-color))); + border-color: var(--wb-active-border-color-grayscale, color-mix(in srgb, var(--wb-node-text-color) 48%, var(--wb-background-color))); +} +div.wunderbaum.wb-fixed-col:not(:focus-within) div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type:hover span.wb-col:first-of-type, div.wunderbaum.wb-fixed-col:not(:focus-within) div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type:hover span.wb-col:first-of-type, div.wunderbaum.wb-fixed-col:not(:focus) div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type:hover span.wb-col:first-of-type, div.wunderbaum.wb-fixed-col:not(:focus) div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type:hover span.wb-col:first-of-type { + background-color: var(--wb-active-hover-color-grayscale, color-mix(in srgb, var(--wb-node-text-color) 12%, var(--wb-background-color))); +} +div.wunderbaum:not(:focus-within) div.wb-node-list div.wb-row.wb-active, div.wunderbaum:not(:focus-within) div.wb-node-list div.wb-row.wb-selected, div.wunderbaum:not(:focus) div.wb-node-list div.wb-row.wb-active, div.wunderbaum:not(:focus) div.wb-node-list div.wb-row.wb-selected { + background-color: var(--wb-active-color-grayscale, color-mix(in srgb, var(--wb-node-text-color) 9%, var(--wb-background-color))); + border-color: var(--wb-active-border-color-grayscale, color-mix(in srgb, var(--wb-node-text-color) 48%, var(--wb-background-color))); +} +div.wunderbaum:not(:focus-within) div.wb-node-list div.wb-row.wb-active:hover, div.wunderbaum:not(:focus-within) div.wb-node-list div.wb-row.wb-selected:hover, div.wunderbaum:not(:focus) div.wb-node-list div.wb-row.wb-active:hover, div.wunderbaum:not(:focus) div.wb-node-list div.wb-row.wb-selected:hover { + background-color: var(--wb-active-hover-color-grayscale, color-mix(in srgb, var(--wb-node-text-color) 12%, var(--wb-background-color))); +} +div.wunderbaum.wb-alternate div.wb-node-list div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected) { + background-color: var(--wb-alternate-row-color); +} +div.wunderbaum.wb-alternate div.wb-node-list div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected):hover { + background-color: var(--wb-alternate-row-color-hover, color-mix(in srgb, var(--wb-node-text-color) 3%, var(--wb-alternate-row-color))); +} +div.wunderbaum div.wb-node-list div.wb-row:hover { + background-color: var(--wb-hover-color, color-mix(in srgb, var(--wb-bg-highlight-color) 4%, var(--wb-background-color))); +} +div.wunderbaum div.wb-node-list div.wb-row.wb-active, div.wunderbaum div.wb-node-list div.wb-row.wb-selected { + background-color: var(--wb-active-color, color-mix(in srgb, var(--wb-bg-highlight-color) 12%, var(--wb-background-color))); +} +div.wunderbaum div.wb-node-list div.wb-row.wb-active:hover, div.wunderbaum div.wb-node-list div.wb-row.wb-selected:hover { + background-color: var(--wb-active-hover-color, color-mix(in srgb, var(--wb-bg-highlight-color) 16%, var(--wb-background-color))); +} +div.wunderbaum div.wb-node-list div.wb-row.wb-focus:not(.wb-active) { + border-style: dotted; + border-color: var(--wb-active-border-color, color-mix(in srgb, var(--wb-bg-highlight-color) 66%, var(--wb-background-color))); +} +div.wunderbaum div.wb-node-list div.wb-row.wb-active { + border-style: solid; + border-color: var(--wb-active-border-color, color-mix(in srgb, var(--wb-bg-highlight-color) 66%, var(--wb-background-color))); +} +div.wunderbaum div.wb-node-list div.wb-row.wb-active:hover { + border-color: var(--wb-active-hover-border-color, var(--wb-bg-highlight-color)); +} +div.wunderbaum div.wb-node-list div.wb-row.wb-loading { + font-style: italic; +} +div.wunderbaum div.wb-node-list div.wb-row.wb-busy, +div.wunderbaum div.wb-node-list div.wb-row i.wb-busy, +div.wunderbaum div.wb-node-list div.wb-row .wb-col.wb-busy { + font-style: italic; + background: repeating-linear-gradient(45deg, transparent, transparent 3.88px, var(--wb-grid-color) 3.88px, var(--wb-grid-color) 7.78px); + animation: wb-busy-animation 2s linear infinite; +} +div.wunderbaum div.wb-node-list div.wb-row.wb-error, div.wunderbaum div.wb-node-list div.wb-row.wb-status-error { + color: var(--wb-error-color); +} +div.wunderbaum div.wb-node-list div.wb-row.wb-status-paging span.wb-title { + cursor: pointer; + color: var(--wb-focus-border-color); + text-decoration: underline; +} +div.wunderbaum div.wb-header { + position: sticky; + height: var(--wb-header-height); + border-bottom: 1px solid var(--wb-border-color); + padding: 0; + background-color: var(--wb-header-color); +} +div.wunderbaum div.wb-header span.wb-col { + font-weight: bold; + overflow: visible; +} +div.wunderbaum div.wb-header span.wb-col-title { + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +div.wunderbaum div.wb-header span.wb-col-resizer { + position: absolute; + top: 0; + right: -1px; + width: 3px; + border: none; + border-right: 2px solid var(--wb-border-color); + height: 100%; + -webkit-user-select: none; + user-select: none; +} +div.wunderbaum div.wb-header span.wb-col-resizer.wb-col-resizer-active { + cursor: col-resize; +} +div.wunderbaum div.wb-header i.wb-col-icon { + float: inline-end; + padding-left: 2px; +} +div.wunderbaum div.wb-header i.wb-col-icon:hover { + cursor: pointer; + color: var(--wb-focus-border-color); +} +div.wunderbaum span.wb-col { + position: absolute; + display: inline-block; + overflow: hidden; + height: var(--wb-row-inner-height); + line-height: var(--wb-row-inner-height); + padding: 0 var(--wb-col-padding-x); + border-right: 1px solid var(--wb-grid-color); + white-space: nowrap; +} +div.wunderbaum span.wb-col:last-of-type { + border-right: none; +} +div.wunderbaum span.wb-node { + -webkit-user-select: none; + user-select: none; +} +div.wunderbaum span.wb-node i.wb-checkbox, +div.wunderbaum span.wb-node i.wb-expander, +div.wunderbaum span.wb-node i.wb-icon, +div.wunderbaum span.wb-node i.wb-indent { + height: var(--wb-icon-outer-height); + width: var(--wb-icon-outer-width); + padding: var(--wb-icon-padding-y) var(--wb-icon-padding-x); + display: inline-block; +} +div.wunderbaum span.wb-node i.wb-expander, +div.wunderbaum span.wb-node i.wb-icon { + background-repeat: no-repeat; + background-size: contain; +} +div.wunderbaum span.wb-node { + /* Fix Bootstrap Icon alignment */ +} +div.wunderbaum span.wb-node i.bi::before { + vertical-align: baseline; +} +div.wunderbaum span.wb-node img.wb-icon { + width: var(--wb-icon-width); + height: var(--wb-icon-height); + padding: var(--wb-icon-padding-y) var(--wb-icon-padding-x); +} +div.wunderbaum span.wb-node i.wb-indent::before { + content: " "; +} +div.wunderbaum span.wb-node i.wb-expander.wb-spin, +div.wunderbaum span.wb-node i.wb-icon.wb-spin { + height: unset; + width: unset; + padding: 0 3px; + animation: wb-spin-animation 2s linear infinite; +} +div.wunderbaum span.wb-node span.wb-title { + min-width: 1em; + vertical-align: top; + overflow-x: hidden; + display: inline-block; + white-space: nowrap; + text-overflow: ellipsis; +} +div.wunderbaum { + /* --- GRID --- */ +} +div.wunderbaum.wb-grid div.wb-header div.wb-row span.wb-col:hover { + background-color: var(--wb-active-header-column-color, color-mix(in srgb, var(--wb-node-text-color) 18%, var(--wb-header-color))); +} +div.wunderbaum.wb-grid.wb-cell-mode div.wb-header div.wb-row span.wb-col.wb-active { + background-color: var(--wb-active-hover-color, color-mix(in srgb, var(--wb-bg-highlight-color) 16%, var(--wb-background-color))); +} +div.wunderbaum.wb-grid div.wb-node-list div.wb-row { + border-bottom-color: var(--wb-grid-color); +} +div.wunderbaum.wb-grid div.wb-node-list div.wb-row:hover:not(.wb-active):not(.wb-selected) { + background-color: var(--wb-hover-color, color-mix(in srgb, var(--wb-bg-highlight-color) 4%, var(--wb-background-color))); +} +div.wunderbaum.wb-grid div.wb-node-list div.wb-row.wb-active { + border-bottom-color: var(--wb-active-border-color, color-mix(in srgb, var(--wb-bg-highlight-color) 66%, var(--wb-background-color))); +} +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col { + border-right: 1px solid var(--wb-grid-color); +} +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col input.wb-input-edit, +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=color], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=date], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=datetime], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=datetime-local], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=email], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=month], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=number], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=password], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=search], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=tel], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=text], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=time], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=url], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input[type=week], +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > select { + width: 100%; + max-height: var(--wb-row-inner-height); + border: none; +} +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > input:focus, +div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col > select:focus { + border: 1px dashed var(--wb-active-border-color, color-mix(in srgb, var(--wb-bg-highlight-color) 66%, var(--wb-background-color))); +} +div.wunderbaum.wb-grid.wb-cell-mode div.wb-row:not(.wb-colspan).wb-active span.wb-col.wb-active { + background-color: var(--wb-active-cell-color-grayscale, color-mix(in srgb, var(--wb-node-text-color) 44%, var(--wb-background-color))); +} +div.wunderbaum.wb-grid.wb-cell-mode:focus-within div.wb-row:not(.wb-colspan):not(.wb-selected) span.wb-col.wb-active, div.wunderbaum.wb-grid.wb-cell-mode:focus div.wb-row:not(.wb-colspan):not(.wb-selected) span.wb-col.wb-active { + background-color: var(--wb-active-column-color, color-mix(in srgb, var(--wb-bg-highlight-color) 4%, var(--wb-background-color))); +} +div.wunderbaum.wb-grid.wb-cell-mode:focus-within div.wb-row:not(.wb-colspan):not(.wb-selected).wb-active, div.wunderbaum.wb-grid.wb-cell-mode:focus div.wb-row:not(.wb-colspan):not(.wb-selected).wb-active { + background-color: var(--wb-active-column-color, color-mix(in srgb, var(--wb-bg-highlight-color) 4%, var(--wb-background-color))); +} +div.wunderbaum.wb-grid.wb-cell-mode:focus-within div.wb-row:not(.wb-colspan):not(.wb-selected).wb-active span.wb-col.wb-active, div.wunderbaum.wb-grid.wb-cell-mode:focus div.wb-row:not(.wb-colspan):not(.wb-selected).wb-active span.wb-col.wb-active { + background-color: var(--wb-active-cell-color, color-mix(in srgb, var(--wb-bg-highlight-color) 60%, var(--wb-background-color))); +} +div.wunderbaum.wb-grid.wb-alternate div.wb-node-list div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected) { + background-color: var(--wb-alternate-row-color); +} +div.wunderbaum.wb-grid.wb-alternate div.wb-node-list div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected):hover { + background-color: var(--wb-alternate-row-color-hover, color-mix(in srgb, var(--wb-node-text-color) 3%, var(--wb-alternate-row-color))); +} +div.wunderbaum.wb-grid:not(:focus-within) div.wb-node-list div.wb-row, div.wunderbaum.wb-grid:not(:focus) div.wb-node-list div.wb-row { + border-bottom-color: var(--wb-grid-color-grayscale, var(--wb-grid-color)); +} +div.wunderbaum { + /* --- FILTER --- */ +} +div.wunderbaum.wb-ext-filter-dim div.wb-node-list div.wb-row, div.wunderbaum.wb-ext-filter-hide div.wb-node-list div.wb-row { + color: var(--wb-filter-dim-color); +} +div.wunderbaum.wb-ext-filter-dim div.wb-node-list div.wb-row.wb-submatch, div.wunderbaum.wb-ext-filter-hide div.wb-node-list div.wb-row.wb-submatch { + color: var(--wb-filter-submatch-color); +} +div.wunderbaum.wb-ext-filter-dim div.wb-node-list div.wb-row.wb-match, div.wunderbaum.wb-ext-filter-hide div.wb-node-list div.wb-row.wb-match { + color: var(--wb-node-text-color); +} +div.wunderbaum.wb-ext-filter-hide.wb-ext-filter-hide-expanders div.wb-node-list div.wb-row:not(.wb-submatch) i.wb-expander { + visibility: hidden; +} +div.wunderbaum { + /* --- DND --- */ +} +div.wunderbaum div.wb-row.wb-drag-source { + opacity: 0.5; +} +div.wunderbaum div.wb-row.wb-drag-source .wb-node { + background-color: var(--wb-drop-source-color, color-mix(in srgb, var(--wb-node-text-color) 26%, var(--wb-background-color))); +} +div.wunderbaum div.wb-row.wb-drop-target { + overflow: visible; +} +div.wunderbaum div.wb-row.wb-drop-target .wb-node { + background-color: var(--wb-drop-target-color, color-mix(in srgb, var(--wb-bg-highlight-color) 20%, var(--wb-background-color))); + overflow: visible; +} +div.wunderbaum div.wb-row.wb-drop-target .wb-node .wb-icon { + position: relative; + overflow: visible; +} +div.wunderbaum div.wb-row.wb-drop-target .wb-node .wb-icon::after { + position: absolute; + z-index: 1000; + content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAMAAABA3o1rAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACKUExURe/v9/f39+//7+f35+f/79bW5wgIawwYd97e55Tnpc731rjA2d7350LOY1LWa7Xvvf///wAQcyAze97e773vxnuczgA5pQBCpdb33rXvxu//9whjxgBaxlKU1oOz5ABz3gB73tbn99bW1rXe/wCM9xiU997v/97e3gCc/xil/9bv/wic/+/3/wAAALM9X5QAAAAudFJOU////////////////////////////////////////////////////////////wCCj3NVAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAqUlEQVQoU6WQ2w6CMAxA54agsCHq1HlFBREv/f/fs1tHAoaoiedlbXrWtGXwhV8FNqAXuAi4DwkShmE0cgGIcSwCCgkSkrAxpEonot0DhQxJptFsbnOpdNdgsFh6VtYwyqzTmG+oijDY7hr22E4qY7QybeGQe46nsxP0Wwc3Q1GWl+qKec8MlqKubxX+xzV7tkDuD1+3d+heigT2zGx/hCMUeUj4wL8CwAsW1kqCTugMCwAAAABJRU5ErkJggg==); + left: 0; + top: calc((22px - var(--wb-icon-height)) / 2); +} +div.wunderbaum div.wb-row.wb-drop-target.wb-drop-before .wb-node .wb-icon::after, +div.wunderbaum div.wb-row.wb-drop-target.wb-drop-after .wb-node .wb-icon::after { + content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACNUExURe/v9/f39+//7+f35+f/79bW5wgIawwYd97e55Tnpc731rjA2d7350LOY1LWa7Xvvf///wAQcyAze97e773vxgAAAHuczgA5pQBCpdb33rXvxu//9whjxgBaxlKU1oOz5ABz3gB73tbn99bW1rXe/wCM9xiU997v/97e3gCc/xil/9bv/wic/+/3/wAAAParqS4AAAAvdFJOU/////////////////////////////////////////////////////////////8AWqU49wAAAAlwSFlzAAAOwwAADsMBx2+oZAAAALlJREFUOE/FktsSgiAQhglMS8WstKLzQTM77Ps/XguL16I208cFyzB8/LPAYCC/ErARzcCFx23pBgnGfjAxBYhpKDwq3SBB5DeGWCYz0SUDClIkmgeLpV7HMiNDbrbbYbBaWzbaoKTaJiHfQe5oYLA/NBwxTiyVyqTSghYwox4MTmfL5XozgqxjAtODoizv1QPXPXqgKer6WeH9+Iw9XgF5ve15/Q+6/SQSsE+q8yMcocoREgzg3wKAL4vrpBIKREShAAAAAElFTkSuQmCC); + left: 0; + top: calc((22px - var(--wb-icon-height)) / 2 - 11px); +} +div.wunderbaum div.wb-row.wb-drop-target.wb-drop-after .wb-node .wb-icon::after { + top: calc((22px - var(--wb-icon-height)) / 2 + 11px); +} +div.wunderbaum { + /* --- SPECIAL EFFECTS --- */ + /* Colorize indentation levels. */ +} +div.wunderbaum.wb-rainbow i.wb-expander:nth-child(4n+1), +div.wunderbaum.wb-rainbow i.wb-indent:nth-child(4n+1) { + background: rgb(255, 255, 201); +} +div.wunderbaum.wb-rainbow i.wb-expander:nth-child(4n+2), +div.wunderbaum.wb-rainbow i.wb-indent:nth-child(4n+2) { + background: rgb(218, 255, 218); +} +div.wunderbaum.wb-rainbow i.wb-expander:nth-child(4n+3), +div.wunderbaum.wb-rainbow i.wb-indent:nth-child(4n+3) { + background: rgb(255, 217, 254); +} +div.wunderbaum.wb-rainbow i.wb-expander:nth-child(4n+4), +div.wunderbaum.wb-rainbow i.wb-indent:nth-child(4n+4) { + background: rgb(204, 250, 250); +} +div.wunderbaum { + /* Fade out expanders, when container is not hovered or active */ +} +div.wunderbaum.wb-fade-expander i.wb-expander { + transition: color 1.5s; + color: rgba(86, 83, 76, 0); +} +div.wunderbaum.wb-fade-expander div.wb-row.wb-loading i.wb-expander, div.wunderbaum.wb-fade-expander:hover i.wb-expander, div.wunderbaum.wb-fade-expander:focus i.wb-expander, div.wunderbaum.wb-fade-expander:focus-within i.wb-expander, +div.wunderbaum.wb-fade-expander [class*=wb-statusnode-] i.wb-expander { + transition: color 0.6s; + color: var(--wb-node-text-color); +} +div.wunderbaum { + /* Skeleton */ +} +div.wunderbaum div.wb-row.wb-skeleton span.wb-title, +div.wunderbaum div.wb-row.wb-skeleton i.wb-icon { + animation: wb-skeleton-animation 1s linear infinite alternate; + border-radius: 0.25em; + color: transparent; + opacity: 0.7; +} +div.wunderbaum { + /* Auto-hide checkboxes unless selected or hovered */ +} +div.wunderbaum.wb-checkbox-auto-hide i.wb-checkbox { + visibility: hidden; +} +div.wunderbaum.wb-checkbox-auto-hide .wb-row:hover i.wb-checkbox, +div.wunderbaum.wb-checkbox-auto-hide .wb-row.wb-selected i.wb-checkbox { + visibility: unset; +} +div.wunderbaum.wb-checkbox-auto-hide:focus .wb-row.wb-active i.wb-checkbox, div.wunderbaum.wb-checkbox-auto-hide:focus-within .wb-row.wb-active i.wb-checkbox { + visibility: unset; +} + +/* --- TOOL CLASSES --- */ +a.wb-breadcrumb { + cursor: pointer; + text-decoration: none; +} + +.wb-helper-center { + text-align: center; +} + +.wb-helper-disabled { + color: var(--wb-dim-color, color-mix(in srgb, var(--wb-node-text-color) 70%, var(--wb-background-color))); +} + +.wb-helper-hidden { + display: none; +} + +.wb-helper-invalid { + color: var(--wb-error-color); +} + +.wb-helper-lazy-expander { + color: var(--wb-bg-highlight-color); +} + +.wb-helper-link { + cursor: pointer; +} + +.wb-no-select { + -webkit-user-select: none; + user-select: none; +} +.wb-no-select span.wb-title { + -webkit-user-select: contain; + user-select: contain; +} + +button.wb-filter-hide { + font-weight: bolder; +} + +/* RTL support */ +.wb-helper-start, +.wb-helper-start > input { + text-align: left; +} + +.wb-helper-end, +.wb-helper-end > input { + text-align: right; +} + +.wb-rtl .wb-helper-start, +.wb-rtl .wb-helper-start > input { + text-align: right; +} +.wb-rtl .wb-helper-end, +.wb-rtl .wb-helper-end > input { + text-align: left; +} + +i.wb-icon { + position: relative; +} +i.wb-icon > span.wb-badge { + position: absolute; + display: inline-block; + top: 0; + left: -0.6rem; + color: white; + background-color: var(--wb-bg-highlight-color); + padding: 0.2em 0.3rem 0.1em 0.3rem; + font-size: 60%; + font-weight: 200; + line-height: 1; + text-align: center; + white-space: nowrap; + border-radius: 0.5rem; + pointer-events: none; +} + +/* Class 'wb-tristate' is used to mark checkboxes that should toggle like + * indeterminate -> checked -> unchecked -> indeterminate ... + */ +.wb-col input[type=checkbox]:indeterminate { + color: var(--wb-dim-color, color-mix(in srgb, var(--wb-node-text-color) 70%, var(--wb-background-color))); + background-color: red; +} + +.wb-col input:invalid { + background-color: var(--wb-error-background-color, color-mix(in srgb, var(--wb-error-color) 17%, var(--wb-background-color))); +} + +.wb-col.wb-invalid { + border: 1px dotted var(--wb-error-color); +} + +@keyframes wb-spin-animation { + 0% { + transform: rotate(0deg); + } + to { + transform: rotate(1turn); + } +} +@keyframes wb-skeleton-animation { + 0% { + background-color: hsl(200, 20%, 70%); + } + 100% { + background-color: hsl(200, 20%, 95%); + } +} +@keyframes wb-busy-animation { + 0% { + background-position: 0 0; + } + 100% { + background-position: 0 22px; + } +} + +/*# sourceMappingURL=wunderbaum.css.map */ diff --git a/website/control-panel/public/cp-v2/cp-v2-directory-tree-vendor.mjs b/website/control-panel/public/cp-v2/cp-v2-directory-tree-vendor.mjs new file mode 100644 index 00000000..13edb98c --- /dev/null +++ b/website/control-panel/public/cp-v2/cp-v2-directory-tree-vendor.mjs @@ -0,0 +1,86 @@ +/*! + * Wunderbaum - debounce.ts + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */ +const freeGlobal="object"==typeof global&&null!==global&&global.Object===Object&&global,freeGlobalThis="object"==typeof globalThis&&null!==globalThis&&globalThis.Object==Object&&globalThis,freeSelf="object"==typeof self&&null!==self&&self.Object===Object&&self,root=freeGlobalThis||freeGlobal||freeSelf||Function("return this")();function isObject(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function debounce(e,t=0,i={}){let s,n,r,o,l,a,d=0,c=!1,h=!1,u=!0;const p=!t&&0!==t&&"function"==typeof root.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){const i=s,r=n;return s=n=void 0,d=t,o=e.apply(r,i),o}function g(e,t){return p?(root.cancelAnimationFrame(l),root.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const i=e-a;return void 0===a||i>=t||i<0||h&&e-d>=r}function v(){const e=Date.now();if(m(e))return b(e);l=g(v,function(e){const i=e-d,s=t-(e-a);return h?Math.min(s,r-i):s}(e))}function b(e){return l=void 0,u&&s?f(e):(s=n=void 0,o)}function y(...e){const i=Date.now(),r=m(i);if(s=e,n=this,a=i,r){if(void 0===l)return function(e){return d=e,l=g(v,t),c?f(e):o}(a);if(h)return l=g(v,t),f(a)}return void 0===l&&(l=g(v,t)),o}return t=+t||0,isObject(i)&&(c=!!i.leading,h="maxWait"in i,r=h?Math.max(+i.maxWait||0,t):r,u="trailing"in i?!!i.trailing:u),y.cancel=function(){void 0!==l&&function(e){if(p)return root.cancelAnimationFrame(e);clearTimeout(e)}(l),d=0,s=a=n=l=void 0},y.flush=function(){return void 0===l?o:b(Date.now())},y.pending=function(){return void 0!==l},y}function throttle(e,t=0,i={}){let s=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return isObject(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),debounce(e,t,{leading:s,trailing:n,maxWait:t})} +/*! + * Wunderbaum - util + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */const MOUSE_BUTTONS={0:"",1:"left",2:"middle",3:"right",4:"back",5:"forward"},MAX_INT=9007199254740991,userInfo=_getUserInfo(),isMac=userInfo.isMac,REX_HTML=/[&<>"'/]/g,REX_TOOLTIP=/[<>"'/]/g,ENTITY_MAP={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};class ValidationError extends Error{constructor(e){super(e),this.name="ValidationError"}}let Deferred$1=class{constructor(){this.thens=[],this.catches=[],this.status=""}resolve(e){if(this.status)throw new Error("already settled");this.status="resolved",this.resolvedValue=e,this.thens.forEach(t=>t(e)),this.thens=[]}reject(e){if(this.status)throw new Error("already settled");this.status="rejected",this.rejectedError=e,this.catches.forEach(t=>t(e)),this.catches=[]}then(e){"resolved"===status?e(this.resolvedValue):this.thens.unshift(e)}catch(e){"rejected"===this.status?e(this.rejectedError):this.catches.unshift(e)}promise(){return{then:this.then,catch:this.catch}}};function assert(e,t){if(!e)throw t=t||"Assertion failed.",new Error(t)}function _getUserInfo(){const e=navigator;return{isMac:/Mac/.test(e.platform)}}function documentReady(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function documentReadyPromise(){return new Promise(e=>{documentReady(e)})}function each(e,t){if(null==e)return e;const i=e.length;let s=0;if("number"==typeof i)for(;s")>=0&&error("Not implemented"),e}function getValueFromElem(e,t=!1){const i=e.tagName;let s=null;if("SPAN"===i&&e.classList.contains("wb-col")){const i=e,n=i.querySelector("input,select");if(n)return getValueFromElem(n,t);i.innerText=""+s}else if("INPUT"===i){const i=e;switch(i.type){case"button":case"reset":case"submit":case"image":break;case"checkbox":s=i.indeterminate?null:i.checked;break;case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":s=t?i.valueAsDate:i.value;break;case"number":case"range":s=i.valueAsNumber;break;case"radio":{const e=i.name,t=i.parentElement.querySelector(`input[name="${e}"]:checked`);s=t?t.value:void 0}break;default:s=i.value}}else if("SELECT"===i){s=e.value}return s}function setValueToElem(e,t){const i=e.tagName;if("SPAN"===i&&e.classList.contains("wb-col")){const i=e,s=i.querySelector("input,select");if(s)return setValueToElem(s,t);i.innerText=""+t}else if("INPUT"===i){const i=e,s=i.type;switch(s){case"checkbox":i.indeterminate=null===t,i.checked=!!t;break;case"date":case"month":case"time":case"week":case"datetime":case"datetime-local":i.valueAsDate=new Date(t);break;case"number":case"range":null==t?i.value=t:i.valueAsNumber=t;break;case"radio":error(`Not yet implemented: ${s}`);break;case"button":case"reset":case"submit":case"image":break;default:i.value=null!=t?t:""}}else if("SELECT"===i){const i=e;null==t?i.selectedIndex=-1:i.value=t}}function setElemDisplay(e,t){const i=elemFromSelector(e).style;t?"none"===i.display&&(i.display=""):""===i.display&&(i.display="none")}function elemFromHtml(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstElementChild}const _IGNORE_KEYS=new Set(["Alt","Control","Meta","Shift"]);function elemFromSelector(e){return e?"string"==typeof e?document.querySelector(e):e:null}function eventToString(e){const t=e.key,i=e.type,s=[];return e.altKey&&s.push("Alt"),e.ctrlKey&&s.push("Control"),e.metaKey&&s.push("Meta"),e.shiftKey&&s.push("Shift"),"click"===i||"dblclick"===i?s.push(MOUSE_BUTTONS[e.button]+i):"wheel"===i?s.push(i):_IGNORE_KEYS.has(t)||s.push(t),s.join("+")}function extend(...e){for(let t=1;t{e.addEventListener(t,function(e){if(!n)return r(e);if(e.target){let t=e.target;if(t.matches(n))return r(e);if(t=t.closest(n),t)return r(e)}})})}function overrideMethod(e,t,i,s){let n,r;const o=s||e,l=e[t],a=(...e)=>l.apply(o,e),d=e=>l.apply(o,e);e[t]=(...e)=>{try{return n=o._super,r=o._superApply,o._super=a,o._superApply=d,i.apply(o,e)}finally{o._super=n,o._superApply=r}}}function setTimeoutPromise(e,t){return new Promise((i,s)=>{setTimeout(()=>{try{i(e.apply(this))}catch(e){s(e)}},t)})}async function sleep(e){return new Promise(t=>setTimeout(t,e))}function toggleCheckbox(e,t,i){const s=elemFromSelector(e);if(assert("checkbox"===s.type,`Expected a checkbox: ${s.type}`),null!=i||(i=s.classList.contains("wb-tristate")||s.indeterminate),void 0===t){switch(s.indeterminate?null:s.checked){case!0:t=!1;break;case!1:t=!i||null;break;case null:t=!0}}s.indeterminate=null==t,s.checked=!!t}function getOption(e,t,i=void 0){let s;e&&t.indexOf(".")>=0&&([s,t]=t.split("."),e=e[s]);const n=e?e[t]:null;return null!=n?n:i}function rotate(e,t){const i=t.indexOf(e);return t[(i+1)%t.length]}function toSet(e){if(e instanceof Set)return e;if("string"==typeof e){const t=new Set;for(const i of e.split(" "))t.add(i.trim());return t}if(Array.isArray(e))return new Set(e);throw new Error("Cannot convert to Set: "+e)}function toPixel(...e){for(const t of e){if("number"==typeof t)return t;if("string"==typeof t&&t.endsWith("px"))return parseInt(t,10);assert(null==t,`Expected a number or string like '123px': ${t}`)}throw new Error(`Expected a string like '123px': ${e}`)}function unsafeCast(e){return e}function toBool(...e){for(const t of e)if(null!=t)return!!t;throw new Error("No default boolean value provided")}function intToBool(e){return"number"==typeof e?!!e:e}function type(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()}function adaptiveThrottle(e,t){const i=Object.assign({minDelay:16,defaultDelay:200,maxDelay:5e3,delayFactor:2},t),s=Math.max(16,+i.minDelay),n=+i.maxDelay;let r=0,o=null,l=null;const a=(...t)=>{if(r)o=t,r+=1;else{r=1;const d=t;o=null;const c=Date.now();try{e.apply(this,d)}catch(e){console.error(e)}const h=Date.now()-c,u=Math.min(Math.max(s,h*i.delayFactor),n),p=Math.max(s,u-h);l=setTimeout(()=>{l=null,r=0,null!=o&&a.apply(this,o)},p)}};return a.cancel=()=>{l&&(clearTimeout(l),l=null),o=null,r=0},a.pending=()=>!!l,a.flush=()=>{throw new Error("Not implemented")},a}function murmurHash3(e,t=!0,i=0){let s=i;const n=3&e.length,r=e.length-n,o=3432918353,l=461845907;let a=0;for(;a>>17,t=Math.imul(t,l),s^=t,s=s<<13|s>>>19,s=Math.imul(s,5)+3864292196}let d=0;switch(n){case 3:d^=(255&e.charCodeAt(a+2))<<16;case 2:d^=(255&e.charCodeAt(a+1))<<8;case 1:d^=255&e.charCodeAt(a),d=Math.imul(d,o),d=d<<15|d>>>17,d=Math.imul(d,l),s^=d}return s^=e.length,s^=s>>>16,s=Math.imul(s,2246822507),s^=s>>>13,s=Math.imul(s,3266489909),s^=s>>>16,t?(s>>>0).toString(16).padStart(8,"0"):s>>>0}var ChangeType,RenderFlag,NodeStatusType,NodeRegion,NavModeEnum,util=Object.freeze({__proto__:null,Deferred:Deferred$1,MAX_INT:MAX_INT,MOUSE_BUTTONS:MOUSE_BUTTONS,ValidationError:ValidationError,adaptiveThrottle:adaptiveThrottle,assert:assert,debounce:debounce,documentReady:documentReady,documentReadyPromise:documentReadyPromise,each:each,elemFromHtml:elemFromHtml,elemFromSelector:elemFromSelector,error:error,escapeHtml:escapeHtml,escapeRegex:escapeRegex,escapeTooltip:escapeTooltip,eventToString:eventToString,extend:extend,extractHtmlText:extractHtmlText,getOption:getOption,getValueFromElem:getValueFromElem,intToBool:intToBool,isArray:isArray,isEmptyObject:isEmptyObject,isFunction:isFunction,isMac:isMac,isPlainObject:isPlainObject,murmurHash3:murmurHash3,noop:noop,onEvent:onEvent,overrideMethod:overrideMethod,rotate:rotate,setElemDisplay:setElemDisplay,setTimeoutPromise:setTimeoutPromise,setValueToElem:setValueToElem,sleep:sleep,throttle:throttle,toBool:toBool,toPixel:toPixel,toSet:toSet,toggleCheckbox:toggleCheckbox,type:type,unsafeCast:unsafeCast}); +/*! + * Wunderbaum - types + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */!function(e){e.any="any",e.data="data",e.colStructure="colStructure",e.resize="resize",e.row="row",e.structure="structure",e.status="status",e.scroll="scroll"}(ChangeType||(ChangeType={})),function(e){e.clearMarkup="clearMarkup",e.header="header",e.redraw="redraw",e.scroll="scroll"}(RenderFlag||(RenderFlag={})),function(e){e.ok="ok",e.loading="loading",e.error="error",e.noData="noData",e.paging="paging"}(NodeStatusType||(NodeStatusType={})),function(e){e.unknown="",e.checkbox="checkbox",e.column="column",e.expander="expander",e.icon="icon",e.prefix="prefix",e.title="title"}(NodeRegion||(NodeRegion={})),function(e){e.startRow="startRow",e.cell="cell",e.startCell="startCell",e.row="row"}(NavModeEnum||(NavModeEnum={})); +/*! + * Wunderbaum - wb_extension_base + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */ +class WunderbaumExtension{constructor(e,t,i){this.enabled=!0,this.tree=e,this.id=t,this.treeOpts=e.options;const s=e.options;void 0===this.treeOpts[t]?s[t]=this.extensionOpts=extend({},i):(this.extensionOpts=extend({},i,s[t]),s[t]=this.extensionOpts),this.enabled=this.getPluginOption("enabled",!0)}init(){this.tree.element.classList.add("wb-ext-"+this.id)}getPluginOption(e,t){var i;return null!==(i=this.extensionOpts[e])&&void 0!==i?i:t}setPluginOption(e,t){this.extensionOpts[e]=t}setEnabled(e=!0){return this.setPluginOption("enabled",!!e)}onKeyEvent(e){}onRender(e){}} +/*! + * Wunderbaum - ext-filter + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */const START_MARKER="￷",END_MARKER="￸",RE_START_MARKER=new RegExp(escapeRegex("￷"),"g"),RE_END_MARTKER=new RegExp(escapeRegex("￸"),"g");class FilterExtension extends WunderbaumExtension{constructor(e){super(e,"filter",{autoApply:!0,autoExpand:!1,matchBranch:!1,connect:null,fuzzy:!1,hideExpanders:!1,highlight:!0,leavesOnly:!1,mode:"dim",noData:!0}),this.queryInput=null,this.prevButton=null,this.nextButton=null,this.modeButton=null,this.matchInfoElem=null,this.lastFilterArgs=null}init(){super.init();this.getPluginOption("connect")&&this._connectControls()}setPluginOption(e,t){if(super.setPluginOption(e,t),"mode"===e)this.tree.filterMode="hide"===t?"hide":"mark"===t?"mark":"dim",this.tree.updateFilter()}_updatedConnectedControls(){var e;const t=null!==this.tree.filterMode,i=this.tree.getActiveNode(),s=t?this.countMatches():0,n=this.treeOpts.strings;let r="?";if(this.matchInfoElem)if(t){let t;0===s?t=n.noMatch:i&&i.match>=1?(r=null!==(e=i.match)&&void 0!==e?e:"?",t=n.matchIndex):t=n.queryResult,t=t.replace("${count}",this.tree.count().toLocaleString()).replace("${match}",""+r).replace("${matches}",s.toLocaleString()),this.matchInfoElem.textContent=t}else this.matchInfoElem.textContent="";this.nextButton instanceof HTMLButtonElement&&(this.nextButton.disabled=!s),this.prevButton instanceof HTMLButtonElement&&(this.prevButton.disabled=!s),this.modeButton&&(this.modeButton.disabled=!t,this.modeButton.classList.toggle("wb-filter-hide","hide"===this.tree.filterMode))}_connectControls(){const e=this.tree,t=this.getPluginOption("connect");if(t){if(this.queryInput=elemFromSelector(t.inputElem),!this.queryInput)throw new Error(`Invalid 'filter.connect' option: ${t.inputElem}.`);this.prevButton=elemFromSelector(t.prevButton),this.nextButton=elemFromSelector(t.nextButton),this.modeButton=elemFromSelector(t.modeButton),this.matchInfoElem=elemFromSelector(t.matchInfoElem),this.prevButton&&onEvent(this.prevButton,"click",()=>{e.findRelatedNode(e.getActiveNode()||e.getFirstChild(),"prevMatch"),this._updatedConnectedControls()}),this.nextButton&&onEvent(this.nextButton,"click",()=>{e.findRelatedNode(e.getActiveNode()||e.getFirstChild(),"nextMatch"),this._updatedConnectedControls()}),this.modeButton&&onEvent(this.modeButton,"click",t=>{this.tree.filterMode&&this.setPluginOption("mode","dim"===e.filterMode?"hide":"dim")}),onEvent(this.queryInput,"input",debounce(e=>{this.filterNodes(this.queryInput.value.trim(),{})},700)),this._updatedConnectedControls()}}_applyFilterNoUpdate(e,t){return this.tree.runWithDeferredUpdate(()=>this._applyFilterImpl(e,t))}_applyFilterImpl(e,t){var i;let s=0;const n=Date.now(),r=this.tree,o=r.options,l=o.autoCollapse,a=extend({},o.filter,t),d="hide"===a.mode,c=!!a.matchBranch,h=!!a.leavesOnly&&!c;let u,p;if("string"==typeof e||e instanceof RegExp){if(""===e)return r.logInfo("Passing an empty string as a filter is handled as clearFilter()."),this.clearFilter(),0;if(a.fuzzy){assert("string"==typeof e,"fuzzy filter must be a string");const t=e.split("").map(escapeRegex).reduce(function(e,t){return e+"([^"+t+"]*)"+t},"");u=new RegExp(t,"i")}else if(e instanceof RegExp)u=e,p=e;else{const t=escapeRegex(e);u=new RegExp(t,"i"),p=new RegExp(t,"gi")}r.logDebug(`Filtering nodes by '${u}'`),e=e=>{if(!e.title)return!1;const t=e.title,i=u.exec(t);if(i&&a.highlight){let s;s=a.fuzzy?_markFuzzyMatchedChars(t,i,!0):t.replace(p,function(e){return"￷"+e+"￸"}),e.titleWithHighlight=escapeHtml(s).replace(RE_START_MARKER,"").replace(RE_END_MARTKER,"")}return!!i}}return r.filterMode=null!==(i=a.mode)&&void 0!==i?i:"dim",this.lastFilterArgs=arguments,r.element.classList.toggle("wb-ext-filter-hide",!!d),r.element.classList.toggle("wb-ext-filter-dim","dim"===a.mode),r.element.classList.toggle("wb-ext-filter-hide-expanders",!!a.hideExpanders),r.root.subMatchCount=0,r.visit(e=>{delete e.match,delete e.titleWithHighlight,e.subMatchCount=0}),r.setStatus(NodeStatusType.ok),o.autoCollapse=!1,r.visit(t=>{if(h&&null!=t.children)return;let i=e(t);if("skip"===i)return t.visit(function(e){e.match=void 0},!0),"skip";let n=!1;(c||"branch"===i)&&t.parent.match&&(i=!0,n=!0),i&&(s++,t.match=s,t.visitParents(e=>{e!==t&&(e.subMatchCount+=1),!a.autoExpand||n||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0}),e._filterAutoExpanded=!0)},!0))}),o.autoCollapse=l,0===s&&a.noData&&d&&("string"==typeof a.noData?r.root.setStatus(NodeStatusType.noData,{message:a.noData}):r.root.setStatus(NodeStatusType.noData)),r.logDebug(`Filter '${e}' found ${s} nodes in ${Date.now()-n} ms.`),this._updatedConnectedControls(),s}filterNodes(e,t){return this._applyFilterNoUpdate(e,t)}filterBranches(e,t){return assert(void 0===t.matchBranch,"filterBranches() is deprecated."),this.tree.logDeprecate("filterBranches()",{since:"0.9.0",hint:"Use `filterNodes` instead and set `options.matchBranch: true`"}),t.matchBranch=!0,this._applyFilterNoUpdate(e,t)}countMatches(){let e=0;return this.tree.visit(t=>{t.match&&!t.statusNodeType&&e++}),e}updateFilter(){var e;const t=this.tree;t.filterMode&&this.lastFilterArgs&&(null===(e=t.options.filter)||void 0===e?void 0:e.autoApply)?this._applyFilterNoUpdate.apply(this,this.lastFilterArgs):t.logWarn("updateFilter(): no filter active."),this._updatedConnectedControls()}clearFilter(){const e=this.tree;e.enableUpdate(!1),e.setStatus(NodeStatusType.ok),delete e.root.match,delete e.root.subMatchCount,e.visit(e=>{delete e.match,delete e.subMatchCount,delete e.titleWithHighlight,e._filterAutoExpanded&&e.expanded&&e.setExpanded(!1,{noAnimation:!0,noEvents:!0}),delete e._filterAutoExpanded}),e.filterMode=null,this.lastFilterArgs=null,e.element.classList.remove("wb-ext-filter-dim","wb-ext-filter-hide"),this._updatedConnectedControls(),e.enableUpdate(!0)}}function _markFuzzyMatchedChars(e,t,i=!0){const s=[];for(let e=1;e"}),n.join("")} +/*! + * Wunderbaum - ext-keynav + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */const QUICKSEARCH_DELAY=500;class KeynavExtension extends WunderbaumExtension{constructor(e){super(e,"keynav",{})}_getEmbeddedInputElem(e){var t;let i=null;if(e&&null!=e.type)i=e;else{const e=null===(t=this.tree.getActiveColElem())||void 0===t?void 0:t.querySelector("input,select");e&&(i=e)}return i}_isCurInputFocused(){var e;return!!(null===(e=this.tree.getActiveColElem())||void 0===e?void 0:e.querySelector("input:focus,select:focus"))}onKeyEvent(e){const t=e.event,i=this.tree,s=e.options,n=!t.ctrlKey||s.autoActivate,r=this._getEmbeddedInputElem(t.target),o=r&&this._isCurInputFocused(),l=s.navigationModeOption;let a,d=eventToString(t),c=e.node,h=!0;if(!i.isEnabled())return!1;if(!1===i._callEvent("keydown",e))return!1;if(!1===i._callMethod("edit._preprocessKeyEvent",e))return!1;if(!c){const e=i.getFocusNode()||i.getActiveNode(),t=i.getFirstChild();if(!e&&t&&"ArrowDown"===d)return t.logInfo("Keydown: activate first node."),void t.setActive();a=e||t,a&&(a.setFocus(),c=i.getFocusNode(),c.logInfo("Keydown: force focus on active node."))}const u=c.isColspan();if(c.isPagingNode()&&("Enter"===d||" "===d))return c._clickPaging(t),void t.preventDefault();if(i.isRowNav()){if(o){switch(d){case"Enter":r.blur(),i.setFocus();break;case"Escape":c._render(),i.setFocus()}return}const e=" "===d&&!!i.lastQuicksearchTerm&&Date.now()-i.lastQuicksearchTime<=500&&!!i.findNextNode(i.lastQuicksearchTerm+" ",i.getActiveNode());if(s.quicksearch&&1===d.length&&(/^\w$/.test(d)||e)&&!r){const e=Date.now();e-i.lastQuicksearchTime>500&&(i.lastQuicksearchTerm=""),i.lastQuicksearchTime=e,i.lastQuicksearchTerm+=d;const s=i.findNextNode(i.lastQuicksearchTerm,i.getActiveNode());return s&&(s.setFocus(),s.setActive(!0,{event:t})),void t.preventDefault()}switch(d){case"Enter":c.isActive()&&(c.isExpanded()?d="Subtract":c.isExpandable(!0)&&(d="Add"));break;case"ArrowLeft":c.expanded&&(d="Subtract");break;case"ArrowRight":if(!c.expanded&&c.isExpandable(!0))d="Add";else if(l===NavModeEnum.startCell||l===NavModeEnum.startRow)return t.preventDefault(),i.setCellNav(),!1}switch(d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":c.getOption("checkbox")?c.toggleSelected():c.setActive(!0,{event:t});break;case"Enter":c.setActive(!0,{event:t});break;case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"Backspace":case"Control+End":case"Control+Home":case"Meta+ArrowDown":case"Meta+ArrowUp":case"PageDown":case"PageUp":c.navigate(d,{activate:n,event:t});break;case"End":case"Home":c.navigate("Home"===d?"first":"last",{activate:n,event:t});break;default:h=!1}}else{const e=r?r.type||r.tagName:"",s=r&&"checkbox"!==e;if(o){if("Escape"===d)return c.logDebug("Reset focused input on Escape"),r.setCustomValidity(""),c._render(),i.setFocus(),void i.setColumn(i.activeColIdx);if("Enter"!==d)return r&&r.checkValidity&&!r.checkValidity()?(c.logDebug(`Ignored ${d} inside invalid input`),!1):void c.logDebug(`Ignored ${d} inside focused input`)}else if(r&&1===d.length&&s)return r.focus(),r.value="",c.logDebug(`Focus input: ${d}`),!1;switch("Tab"===d?(d="ArrowRight",h=!0):"Shift+Tab"===d&&(d=i.activeColIdx>0?"ArrowLeft":"",h=!0),d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":0===i.activeColIdx&&c.getOption("checkbox")?(c.toggleSelected(),h=!0):r&&"checkbox"===e&&(r.click(),h=!0);break;case"F2":r&&!o&&s&&(r.focus(),h=!0);break;case"Enter":i.setFocus(),(0===i.activeColIdx||u)&&c.isExpandable()?(c.setExpanded(!c.isExpanded()),h=!0):r&&!o&&s&&(r.focus(),h=!0);break;case"Escape":i.setFocus(),c.log("keynav: focus tree..."),i.isCellNav()&&l!==NavModeEnum.cell&&(c.log("keynav: setCellNav(false)"),i.setCellNav(!1),i.setFocus(),h=!0);break;case"ArrowLeft":i.setFocus(),u&&c.isExpanded()?c.setExpanded(!1):!u&&i.activeColIdx>0?i.setColumn(i.activeColIdx-1):l!==NavModeEnum.cell&&i.setCellNav(!1),h=!0;break;case"ArrowRight":i.setFocus(),u&&!c.isExpanded()?c.setExpanded():!u&&i.activeColIdx0&&i.setColumn(0),h=!0;break;case"End":i.setFocus(),!u&&i.activeColIdx=4){const t=this.ignoreEvents,i=this.prefix;overrideMethod(e,"callEvent",function(s,n){if(t.has(s))return e._superApply(arguments);const r=Date.now(),o=e._superApply(arguments);return e.logDebug(`${i}: callEvent('${s}') took ${Date.now()-r} ms.`,arguments[1]),o})}}onKeyEvent(e){this.tree.logDebug(`${this.prefix}: onKeyEvent()`,e)}} +/*! + * Wunderbaum - ext-dnd + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */const nodeMimeType="application/x-wunderbaum-node";class DndExtension extends WunderbaumExtension{constructor(e){super(e,"dnd",{autoExpandMS:1500,multiSource:!1,effectAllowed:"all",dropEffectDefault:"move",guessDropEffect:!0,preventForeignNodes:!1,preventLazyParents:!0,preventNonNodes:!1,preventRecursion:!0,preventSameParent:!1,preventVoidMoves:!0,serializeClipboardData:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,sourceCopyHook:null,dragStart:null,drag:null,dragEnd:null,dragEnter:null,dragOver:null,dragExpand:null,drop:null,dragLeave:null}),this.srcNode=null,this.lastTargetNode=null,this.lastEnterStamp=0,this.lastAllowedDropRegions=null,this.lastDropEffect=null,this.lastDropRegion=!1,this.currentScrollDir=0,this.applyScrollDirThrottled=throttle(this._applyScrollDir,50)}init(){super.init();const e=this.tree,t=e.options.dnd;t.dragStart&&onEvent(e.element,"dragstart drag dragend",this.onDragEvent.bind(this)),t.dragEnter&&onEvent(e.element,"dragenter dragover dragleave drop",this.onDropEvent.bind(this))}_leaveNode(){const e=this.lastTargetNode;this.lastEnterStamp=0,e&&(e.setClass("wb-drop-target wb-drop-over wb-drop-after wb-drop-before",!1),this.lastTargetNode=null)}unifyDragover(e){if(!1===e)return!1;if(e instanceof Set)return e.size>0&&e;if(!0===e)return new Set(["over","before","after"]);if("string"==typeof e||isArray(e))return(e=toSet(e)).size>0&&e;throw new Error("Unsupported drop region definition: "+e)}_calcDropRegion(e,t){const i=this.tree.options.rowHeightPx,s=e.offsetY;return!!t&&(3===t.size?s<.25*i?"before":s>.75*i?"after":"over":1===t.size&&t.has("over")?"over":s>i/2?"after":"before")}_guessDropEffect(e){var t;const i=this.treeOpts.dnd,s=null!==(t=i.effectAllowed)&&void 0!==t?t:"all",n=["all","copy","copyLink","copyMove"].includes(s),r=["all","link","copyLink","linkMove"].includes(s),o=["all","move","copyMove","linkMove"].includes(s);let l=i.dropEffectDefault;return i.guessDropEffect&&(isMac?(e.altKey&&n&&(l="copy"),e.metaKey&&o&&(l="move"),e.altKey&&e.metaKey&&r&&(l="link")):(e.ctrlKey&&n&&(l="copy"),e.shiftKey&&o&&(l="move"),e.altKey&&r&&(l="link"))),l}_isVoidDrop(e,t,i){return!(!this.treeOpts.dnd.preventVoidMoves||!t)&&("before"===i&&e===t.getNextSibling()||"after"===i&&e===t.getPrevSibling()||(t===e||t.parent===e))}_applyScrollDir(){if(this.isDragging()&&this.currentScrollDir){const e=this.tree.options.dnd,t=this.tree.element,i=t.scrollTop;this.currentScrollDir<0?t.scrollTop=Math.max(0,i-e.scrollSpeed):this.currentScrollDir>0&&(t.scrollTop=i+e.scrollSpeed)}}_autoScroll(e){const t=this.tree,i=t.options.dnd.scrollSensitivity,s=t.element,n=t.headerElement.clientHeight,r=s.offsetHeight,o=s.scrollTop;return this.currentScrollDir=0,o>0&&e>0&&e<=i+n?this.currentScrollDir=-1:o=r-i&&(this.currentScrollDir=1),this.currentScrollDir&&this.applyScrollDirThrottled(),s.scrollTop-o}isDragging(){return!!this.srcNode}onDragEvent(e){var t;const i=this.treeOpts.dnd,s=Wunderbaum.getNode(e);if(s){if(["dragstart","dragend"].includes(e.type)&&this.tree.logDebug(`onDragEvent.${e.type} srcNode: ${s}`,e),"dragstart"===e.type){if(e.dataTransfer.effectAllowed=i.effectAllowed,s.isEditingTitle())return s.logDebug("Prevented dragging node in edit mode."),e.preventDefault(),!1;if(!s._callEvent("dnd.dragStart",{event:e}))return e.preventDefault(),!1;const n=s.toDict(!0,e=>{e._orgKey=e.key,delete e.key});n._treeId=s.tree.id,i.serializeClipboardData&&("function"==typeof i.serializeClipboardData?e.dataTransfer.setData(nodeMimeType,i.serializeClipboardData(n,s)):e.dataTransfer.setData(nodeMimeType,JSON.stringify(n))),(null===(t=e.dataTransfer)||void 0===t?void 0:t.types.includes("text/plain"))||e.dataTransfer.setData("text/plain",s.title),this.srcNode=s,setTimeout(()=>{s.setClass("wb-drag-source")},0)}else"drag"===e.type?i.drag&&s._callEvent("dnd.drag",{event:e}):"dragend"===e.type&&(s.setClass("wb-drag-source",!1),this.srcNode=null,this.lastTargetNode&&this._leaveNode(),s._callEvent("dnd.dragEnd",{event:e}));return!0}this.tree.logWarn(`onDragEvent.${e.type}: no node`)}onDropEvent(e){var t;const i=this.srcNode,s=i?i.tree:null,n=Wunderbaum.getNode(e),r=this.treeOpts.dnd,o=e.dataTransfer,l=this._calcDropRegion(e,this.lastAllowedDropRegions),a=(e,t)=>(e&&this.tree.log(`Prevented drop operation (${t}).`),e);if(!n)return this._leaveNode(),void e.preventDefault();if(["drop"].includes(e.type)&&this.tree.logDebug(`onDropEvent.${e.type} targetNode: ${n}, ea: ${null==o?void 0:o.effectAllowed}, de: ${null==o?void 0:o.dropEffect}, cy: ${e.offsetY}, r: ${l}, srcNode: ${i}`,e),"dragenter"===e.type){if(this.lastAllowedDropRegions=null,this.lastTargetNode&&this.lastTargetNode!==n&&this._leaveNode(),this.lastTargetNode=n,this.lastEnterStamp=Date.now(),a(n.isStatusNode(),"is status node")||a(r.preventForeignNodes&&n.tree!==s,"preventForeignNodes")||a(r.preventLazyParents&&!n.isLoaded(),"preventLazyParents")||a(r.preventNonNodes&&!i,"preventNonNodes")||a(r.preventRecursion&&(null==i?void 0:i.isAncestorOf(n)),"preventRecursion")||a(r.preventSameParent&&i&&n.parent===i.parent,"preventSameParent")||a(r.preventVoidMoves&&n===i,"preventVoidMoves"))return o.dropEffect="none",!0;o.dropEffect=this._guessDropEffect(e)||"none";let t=n._callEvent("dnd.dragEnter",{event:e,sourceNode:i});if(t=this.unifyDragover(t),!t)return o.dropEffect="none",!0;this.lastAllowedDropRegions=t,this.lastDropEffect=o.dropEffect;const l=this._calcDropRegion(e,this.lastAllowedDropRegions);return n.setClass("wb-drop-target"),n.setClass("wb-drop-over","over"===l),n.setClass("wb-drop-before","before"===l),n.setClass("wb-drop-after","after"===l),e.preventDefault(),!1}if("dragover"===e.type){const t=e.clientY-this.tree.element.offsetTop;this._autoScroll(t),o.dropEffect=this._guessDropEffect(e)||"none",n._callEvent("dnd.dragOver",{event:e,sourceNode:i});const s=this._calcDropRegion(e,this.lastAllowedDropRegions);if(this.lastDropRegion=s,this.lastDropEffect=o.dropEffect,r.autoExpandMS>0&&n.isExpandable(!0)&&!n._isLoading&&Date.now()-this.lastEnterStamp>r.autoExpandMS&&!1!==n._callEvent("dnd.dragExpand",{event:e,sourceNode:i})&&n.setExpanded(),!s||this._isVoidDrop(n,i,s))return;return n.setClass("wb-drop-over","over"===s),n.setClass("wb-drop-before","before"===s),n.setClass("wb-drop-after","after"===s),e.preventDefault(),!1}if("dragleave"===e.type)n._callEvent("dnd.dragLeave",{event:e,sourceNode:i});else if("drop"===e.type){e.stopPropagation(),e.preventDefault(),this._leaveNode();const i=this.lastDropRegion;let s=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData(nodeMimeType);s=s?JSON.parse(s):null;const r=this.srcNode,o=this.lastDropEffect;n._callEvent("dnd.drop",{event:e,region:i,suggestedDropMode:"over"===i?"appendChild":i,suggestedDropEffect:o,sourceNode:r,sourceNodeData:s,dataTransfer:e.dataTransfer})}return!1}} +/*! + * Wunderbaum - drag_observer + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */class DragObserver{constructor(e){if(this.start={event:null,x:0,y:0,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1},this.dragElem=null,this.dragging=!1,this.customData={},this.events=["mousedown","mouseup","mousemove","keydown"],!e.root)throw new Error("Missing `root` option.");this.opts=Object.assign({thresh:5},e),this.root=e.root,this._handler=this.handleEvent.bind(this),this.events.forEach(e=>{this.root.addEventListener(e,this._handler)})}disconnect(){this.events.forEach(e=>{this.root.removeEventListener(e,this._handler)})}getDragElem(){return this.dragElem}isDragging(){return this.dragging}stopDrag(e){if(this.dragging&&this.opts.dragstop&&e){e.type="dragstop";try{this.opts.dragstop(e)}catch(e){console.error("dragstop error",e)}}this.dragElem=null,this.dragging=!1,this.start.event=null,this.customData={}}handleEvent(e){const t=e.type,i=this.opts,s={type:e.type,startEvent:"mousedown"===t?e:this.start.event,event:e,customData:this.customData,dragElem:this.dragElem,dx:e.pageX-this.start.x,dy:e.pageY-this.start.y,apply:void 0};switch(t){case"keydown":this.stopDrag(s);break;case"mousedown":if(this.dragElem){this.stopDrag(s);break}if(i.selector){let t=e.target;if(t.matches(i.selector))this.dragElem=t;else{if(t=t.closest(i.selector),!t)break;this.dragElem=t}}this.start.event=e,this.start.x=e.pageX,this.start.y=e.pageY,this.start.altKey=e.altKey,this.start.ctrlKey=e.ctrlKey,this.start.metaKey=e.metaKey,this.start.shiftKey=e.shiftKey;break;case"mousemove":if(!this.dragElem)break;if(!this.dragging){if(i.thresh){if(s.dx*s.dx+s.dy*s.dys?1:-1}function unflattenSource(e){var t,i,s;const{_format:n,_keyMap:r={},_positional:o=[],children:l}=e,a=o.length;if("flat"!==n)throw new Error(`Expected source._format: "flat", but got ${n}`);if(a&&o.includes("children"))throw new Error(`source._positional must not include "children": ${o}`);let d=r;if(r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),d={};for(const[e,t]of Object.entries(r))d[t]=e}const c=o.map(e=>{var t;return null!==(t=d[e])&&void 0!==t?t:e}),h=[],u={},p={},f=null!==(t=d.key)&&void 0!==t?t:"key",g=null!==(i=d.children)&&void 0!==i?i:"children";for(const[e,t]of l.entries()){let i;const[n,...r]=t;if(r.length===a)i={};else{if(r.length!==a+1)throw new Error(`unflattenSource: unexpected tuple length: ${t}`);if(i=r.pop(),"object"!=typeof i)throw new Error(`unflattenSource: Expected dict as last tuple element: ${t}`)}t[1]=null,null!=t[2]&&(t[2]=null),r.forEach((e,t)=>{i[c[t]]=e}),r.length=0,p[e]=i;const o=i[f];null!=o&&(u[o]=i);let l=null;if(null===n);else if("number"==typeof n){if(l=p[n],void 0===l)throw new Error(`unflattenSource: Could not find parent node by index: ${n}.`)}else if(l=u[n],void 0===l)throw new Error(`unflattenSource: Could not find parent node by key: ${n}`);l?(null!==(s=l[g])&&void 0!==s||(l[g]=[]),l[g].push(i)):h.push(i)}e.children=h}function decompressSourceData(e){let{_format:t,_version:i=1,_keyMap:s,_valueMap:n}=e;assert(1===i,`Expected file version 1 instead of ${i}`);let r=s,o={};if(r)for(const[e,t]of Object.entries(r))o[t]=e;if(r&&r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),[r,o]=[o,r]}if(null!=e._typeList){const t='source._typeList is deprecated since v0.7.0: use source._valueMap: {"type": [...]} instead.';if(null!=n)throw new Error(t);console.warn(t),n={type:e._typeList},delete e._typeList}"flat"===t&&unflattenSource(e),delete e._format,delete e._version,delete e._keyMap,delete e._valueMap,delete e._positional,(s||n)&&function e(t){for(const i of t)Object.getOwnPropertyNames(i).forEach(e=>{const t=i[e];let r=e;if(s&&null!=o[e]&&(r=o[e],r!==e&&(i[r]=t,delete i[e])),n&&"number"==typeof t&&null!=n[r]){const e=n[r][t];if(null==e)throw new Error(`Expected valueMap[${r}][${t}] entry in [${n[r]}]`);i[r]=e}}),i.children&&e(i.children)}(e.children)} +/*! + * Wunderbaum - ext-grid + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */class GridExtension extends WunderbaumExtension{constructor(e){super(e,"grid",{}),this.observer=new DragObserver({root:window.document,selector:"span.wb-col-resizer-active",thresh:4,dragstart:t=>{const i=Wunderbaum.getEventInfo(t.startEvent),s=i.colDef,n=s&&this.tree.element.contains(t.dragElem)&&toBool(s.resizable,e.options.columnsResizable,!1);if(this.tree.element.classList.toggle("wb-col-resizing",!!n),i.colElem.classList.toggle("wb-col-resizing",!!n),n){t.customData.colDef=s,t.customData.orgCustomWidthPx=s.customWidthPx;const e=Number.parseInt(i.colElem.style.width,10);t.customData.orgWidthPx=e,s.customWidthPx=e,this.tree.update(ChangeType.colStructure)}return n},drag:e=>this.handleDrag(e),dragstop:e=>this.handleDrag(e)})}init(){super.init()}handleDrag(e){const t=e.customData,i=t.colDef;if("dragstop"===e.type||"drag"===e.type){if(this.tree.element.classList.remove("wb-col-resizing"),e.apply||"drag"===e.type){const s=toPixel(i.minWidth,4),n=Math.max(s,t.orgWidthPx+e.dx);i.customWidthPx=n}else this.tree.log("Column resize cancelled",e),i.customWidthPx=t.orgCustomWidthPx;this.tree.update(ChangeType.colStructure)}}} +/*! + * Wunderbaum - deferred + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */class Deferred{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){this._resolve(e)}reject(e){this._reject(e)}promise(){return this._promise}then(e){return this._promise.then(e)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}} +/*! + * Wunderbaum - wunderbaum_node + * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license. + * v0.15.0, Sat, 24 Oct 2026 10:46:09 GMT (https://github.com/mar10/wunderbaum) + */const NODE_PROPS=new Set(["checkbox","classes","expanded","icon","iconTooltip","key","lazy","_partsel","radiogroup","refKey","selected","statusNodeType","title","tooltip","type","unselectable"]),NODE_DICT_PROPS=new Set(NODE_PROPS);NODE_DICT_PROPS.delete("_partsel"),NODE_DICT_PROPS.delete("unselectable");class WunderbaumNode{constructor(e,t,i){var s;this.refKey=void 0,this.children=null,this.classes=null,this.data={},this._isLoading=!1,this._requestId=0,this._errorInfo=null,this._partsel=!1,this._partload=!1,this.subMatchCount=0,this._rowIdx=0,this._rowElem=void 0,assert(!t||t.tree===e,`Invalid parent: ${t}`),assert(!i.children,"'children' not allowed here"),this.tree=e,this.parent=t,this.key=e._calculateKey(i,t),this.title=""+(null!==(s=i.title)&&void 0!==s?s:"<"+this.key+">"),this.expanded=!!i.expanded,this.lazy=!!i.lazy,null!=i.refKey&&(this.refKey=""+i.refKey),null!=i.type&&(this.type=""+i.type),null!=i.icon&&(this.icon=intToBool(i.icon)),null!=i.tooltip&&(this.tooltip=intToBool(i.tooltip)),null!=i.iconTooltip&&(this.iconTooltip=intToBool(i.iconTooltip)),null!=i.statusNodeType&&(this.statusNodeType=""+i.statusNodeType),null!=i.colspan&&(this.colspan=!!i.colspan),null!=i.checkbox&&(this.checkbox=intToBool(i.checkbox)),null!=i.radiogroup&&(this.radiogroup=!!i.radiogroup),null!=i.selected&&(this.selected=!!i.selected),null!=i.unselectable&&(this.unselectable=!!i.unselectable),i.classes&&this.setClass(i.classes);for(const[e,t]of Object.entries(i))NODE_PROPS.has(e)||(this.data[e]=t);t&&!this.statusNodeType&&e._registerNode(this)}toString(){return`WunderbaumNode@${this.key}<'${this.title}'>`}*[Symbol.iterator](){const e=this.children;if(e)for(let t=0,i=e.length;te.statusNodeType===NodeStatusType.paging).forEach(e=>e.remove()),this.addChildren(l,t)}_clickPaging(e){if(this._isLoading)return;const t=this._callEvent("clickPaging",{event:e});t instanceof Promise&&(this._isLoading=!0,this.update(ChangeType.status),t.finally(()=>{this._isLoading=!1,this.tree&&this.update(ChangeType.status)}))}addChildren(e,t){const i=this.tree;let{before:s=null,applyMinExpanLevel:n=!0,_level:r}=null!=t?t:{};null!=r||(r=this.getLevel());const o=[];try{i.enableUpdate(!1),isPlainObject(e)&&(e=[e]);const t=n&&r=0,`options.before must be a direct child of ${this}`),this.children.splice(e,0,...o)}else this.children=o;i.update(ChangeType.structure)}finally{i.enableUpdate(!0)}return o[0]}addNode(e,t="appendChild"){switch("over"===t&&(t="appendChild"),t){case"after":return this.parent.addChildren(e,{before:this.getNextSibling()});case"before":return this.parent.addChildren(e,{before:this});case"prependChild":return this.addChildren(e,{before:0});case"appendChild":return this.addChildren(e)}assert(!1,`Invalid mode: ${t}`)}applyCommand(e,t){return this.tree.applyCommand(e,this,t)}collapseSiblings(e){for(const t of this.parent.children)t!==this&&t.expanded&&t.setExpanded(!1,e)}setClass(e,t=!0){const i=toSet(e);if(t)null===this.classes&&(this.classes=new Set),i.forEach(e=>{var i;this.classes.add(e),null===(i=this._rowElem)||void 0===i||i.classList.toggle(e,t)});else{if(null===this.classes)return;i.forEach(e=>{var i;this.classes.delete(e),null===(i=this._rowElem)||void 0===i||i.classList.toggle(e,t)}),0===this.classes.size&&(this.classes=null)}}startEditTitle(){this.tree._callMethod("edit.startEditTitle",this)}async expandAll(e=!0,t){const i=this.tree,{collapseOthers:s,deep:n,depth:r,force:o,keepActiveNodeVisible:l=!0,loadLazy:a,resetLazy:d}=null!=t?t:{},c=this.tree.options.minExpandLevel||null,h=null!=r?r:o?null:c,u={deep:n,force:o,loadLazy:a,resetLazy:d,scrollIntoView:!1};this.logInfo(`expandAll(${e}, depth=${r}, minLevel=${h})`),assert(!(e&&null!=n&&!s),"Expanding with `deep` option is not supported (implied by the `depth` option).");const p=i.logTime(`${this}.expandAll(${e}, depth=${r})`);try{i.enableUpdate(!1),await async function t(i,s){var o;const l=[];return null===(o=i.children)||void 0===o||o.forEach(i=>{if(e)if(!i.expanded&&(null==h||s{await t(i,s+1)})}else l.push(t(i,s+1));else(null==h||s>=h)&&i.setExpanded(!1,u),(null!=h&&s{Promise.all(l).then(()=>{e(!0)})})}(this,0),s&&(assert(e,"Option `collapseOthers` requires flag=true"),assert(null!=h,"Option `collapseOthers` requires `depth` or `minExpandLevel`"),this.expandAll(!1,{depth:h}))}finally{i.enableUpdate(!0),i.logTimeEnd(p)}i.activeNode&&l&&i.activeNode.scrollIntoView()}findAll(e){const t="function"==typeof e?e:makeNodeTitleMatcher(e),i=[];return this.visit(e=>{t(e)&&i.push(e)}),i}findDirectChild(e){const t=this.children;if(!t)return null;if("string"==typeof e){for(let i=0,s=t.length;i{if(t(e))return i=e,!1}),i}findRelatedNode(e,t=!1){return this.tree.findRelatedNode(this,e,t)}*format_iter(e,t){function i(e){const t=e.parent.children;return e===t[t.length-1]}null!=t||(t=[" "," | "," ╰─ "," ├─ "]),null!=e||(e=e=>""+e);const s=s=>{const n=[e(s)];n.unshift(t[i(s)?2:3]);let r=s.parent;for(;r&&r!==this;)n.unshift(t[i(r)?0:1]),r=r.parent;return n.join("")};yield e(this);for(const e of this)yield s(e)}format(e,t){const i=[];for(const s of this.format_iter(e,t))i.push(s);return i.join("\n")}getColElem(e){var t;"string"==typeof e&&(e=this.tree.columns.findIndex(t=>t.id===e));const i=null===(t=this._rowElem)||void 0===t?void 0:t.querySelectorAll("span.wb-col");return i?i[e]:null}getCloneList(e=!1){if(!this.refKey)return[];const t=this.tree.findByRefKey(this.refKey);return e?t:[...t].filter(e=>e!==this)}getFirstChild(){return this.children?this.children[0]:null}getLastChild(){return this.children?this.children[this.children.length-1]:null}getLevel(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}getNextSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t+1]||null}getParent(){return this.parent}getParentList(e=!1,t=!1){const i=[];let s=t?this:this.parent;for(;s;)(e||s.parent)&&i.unshift(s),s=s.parent;return i}getPath(e=!0,t="title",i="/"){let s;const n=[],r="function"==typeof t;return this.visitParents(e=>{e.parent&&(s=r?t(e):e[t],n.unshift(s))},e),n.join(i)}getPrevSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t-1]||null}hasChildren(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)}hasClass(e){return!!this.classes&&this.classes.has(e)}hasFocus(){return this.tree.focusNode===this}isActive(){return this.tree.activeNode===this}isAncestorOf(e){return e&&e.isDescendantOf(this)}isChildOf(e){return e&&this.parent===e}isClone(){return!!this.refKey&&this.tree.findByRefKey(this.refKey).length>1}isColspan(){return!!this.getOption("colspan")}isDescendantOf(e){if(!e||e.tree!==this.tree)return!1;let t=this.parent;for(;t;){if(t===e)return!0;t===t.parent&&error(`Recursive parent link: ${t}`),t=t.parent}return!1}isExpandable(e=!1){return!(e&&this.expanded||!1===this.children)&&(null==this.children?!!this.lazy:0!==this.children.length||!!this.tree.options.emptyChildListExpandable)}isEditingTitle(){return this.tree._callMethod("edit.isEditingTitle",this)}isExpanded(){return!!this.expanded}isFirstSibling(){const e=this.parent;return!e||e.children[0]===this}isLastSibling(){const e=this.parent;return!e||e.children[e.children.length-1]===this}isLazy(){return!!this.lazy}isLoaded(){return!this.lazy||void 0!==this.hasChildren()}isLoading(){return this._isLoading}isPagingNode(){return"paging"===this.statusNodeType}isParentOf(e){return e&&e.parent===this}isPartload(){return!!this._partload}isPartsel(){return!this.selected&&!!this._partsel}isRadio(){return!!this.parent.radiogroup||"radio"===this.getOption("checkbox")}isRendered(){return!!this._rowElem}isRootNode(){return this.tree.root===this}isSelected(){return!!this.selected||!!this._partsel&&void 0}isStatusNode(){return!!this.statusNodeType}isTopLevel(){return this.tree.root===this.parent}isUnloaded(){return void 0===this.hasChildren()}isVisible(){const e="hide"===this.tree.filterMode,t=this.getParentList(!1,!1);if(e&&!this.match&&!this.subMatchCount)return!1;for(let e=0,i=t.length;ei)return void this.logWarn(`Ignored load response #${i} because #${this._requestId} is pending.`);if(this.logDebug(`Received response for load request #${i}`),null===this.parent&&null!==s)return void this.logWarn("Lazy parent node was removed while loading: discarding response.");this.setStatus(NodeStatusType.ok);const r=Date.now();this._loadSourceObject(t),l=Date.now()-r}else{if("function"==typeof e.then){const i=t.logTime(`Resolve thenable ${e}`);e=await Promise.resolve(e),t.logTimeEnd(i)}this._loadSourceObject(e),l=Date.now()-n}}catch(t){throw this.logError("Error during load()",e,t),this._callEvent("error",{error:t}),this.setStatus(NodeStatusType.error,{message:""+t}),t}finally{this._requestId=0,r=Date.now()-n,t.options.debugLevel>=3&&t.logInfo(`Load source took ${r/1e3} seconds (transfer: ${o/1e3}s, processing: ${l/1e3}s)`)}}async loadLazy(e=!1){const t=this.expanded;if(assert(this.lazy,"load() requires a lazy node"),e||this.isUnloaded())if(this.isLoading())this.logWarn("loadLazy() called while already loading: ignored.");else{this.isLoaded()&&this.resetLazy(),this.setStatus(NodeStatusType.loading);try{const e=await this._callEvent("lazyLoad");if(!1===e)return void this.setStatus(NodeStatusType.ok);assert(isArray(e)||e&&e.url,"The lazyLoad event must return a node list, `{url: ...}`, or false."),await this.load(e),this.setStatus(NodeStatusType.ok),t?(this.expanded=!0,this.tree.update(ChangeType.structure)):this.update()}catch(e){this.logError("Error during loadLazy()",e),this._callEvent("error",{error:e}),this.setStatus(NodeStatusType.error,{message:""+e})}}}log(...e){this.tree.options.debugLevel>=4&&console.log(this.toString(),...e)}logDebug(...e){this.tree.options.debugLevel>=4&&console.debug(this.toString(),...e)}logError(...e){this.tree.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.tree.options.debugLevel>=3&&console.info(this.toString(),...e)}logWarn(...e){this.tree.options.debugLevel>=2&&console.warn(this.toString(),...e)}async makeVisible(e){let t;const i=new Deferred,s=[],n=this.getParentList(!1,!1),r=n.length,o=getOption(e,"noAnimation",!1),l=getOption(e,"scrollIntoView",!0);for(t=r-1;t>=0;t--){const e={noAnimation:o};s.push(n[t].setExpanded(!0,e))}return Promise.all(s).then(()=>{l&&this.tree?(this.tree.updatePendingModifications(),this.scrollIntoView().then(()=>{i.resolve()})):i.resolve()}),i.promise()}moveTo(e,t="appendChild",i){let s;"over"===t&&(t="appendChild"),"prependChild"===t&&(e.children&&e.children.length?(t="before",e=e.children[0]):t="appendChild");const n=this.tree,r=this.parent,o="appendChild"===t?e:e.parent;if(this!==e){if(this.parent?o.isDescendantOf(this)&&error("Cannot move a node to its own descendant"):error("Cannot move system root"),o!==r&&r.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===o)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else s=this.parent.children.indexOf(this),assert(s>=0,"invalid source parent"),this.parent.children.splice(s,1);if(this.parent=o,o.hasChildren())switch(t){case"appendChild":o.children.push(this);break;case"before":s=o.children.indexOf(e),assert(s>=0,"invalid target parent"),o.children.splice(s,0,this);break;case"after":s=o.children.indexOf(e),assert(s>=0,"invalid target parent"),o.children.splice(s+1,0,this);break;default:error(`Invalid mode '${t}'.`)}else o.children=[this];i&&e.visit(i,!0),o===r?o.triggerModifyChild("move",this):o.triggerModifyChild("add",this),n!==e.tree&&(this.logWarn("Cross-tree moveTo is experimental!"),this.visit(t=>{t.tree=e.tree},!0)),setTimeout(()=>{n.update(ChangeType.any)},0)}}async navigate(e,t){var i;const s=null!==(i=KEY_TO_NAVIGATION_MAP[e])&&void 0!==i?i:e,n=this.findRelatedNode(s);if(!n)return this.logWarn(`Could not find related node '${e}'.`),Promise.resolve(this);try{n.makeVisible({scrollIntoView:!1})}catch(e){}return n.setFocus(),!1===(null==t?void 0:t.activate)?Promise.resolve(this):n.setActive(!0,{event:null==t?void 0:t.event})}remove(){const e=this.tree,t=this.parent.children.indexOf(this),i=e=>!!e&&(e===this||e.isDescendantOf(this));i(e.activeNode)&&e._setActiveNode(null),i(e.focusNode)&&e._setFocusNode(null),this.triggerModify("remove"),this.parent.children.splice(t,1),this.visit(t=>{t.removeMarkup(),e._unregisterNode(t)},!0),e.update(ChangeType.structure)}removeChildren(){var e,t;const i=this.tree;this.children&&((null===(e=i.activeNode)||void 0===e?void 0:e.isDescendantOf(this))&&i.activeNode.setActive(!1),(null===(t=i.focusNode)||void 0===t?void 0:t.isDescendantOf(this))&&i._setFocusNode(null),this.triggerModifyChild("remove",null),this.visit(e=>{i._unregisterNode(e)}),this.lazy?this.children=[]:this.children=null,this.isRootNode()||(this.expanded=!1),this.tree.update(ChangeType.structure))}removeMarkup(){if(this._rowElem){const e=this._rowElem.closest("[aria-activedescendant]");(null==e?void 0:e.getAttribute("aria-activedescendant"))===this._rowElem.id&&e.removeAttribute("aria-activedescendant"),delete this._rowElem._wb_node,this._rowElem.remove(),this._rowElem=void 0}}_getRenderInfo(){const e={},t={},i=this.isColspan(),s=this._rowElem?this._rowElem.querySelectorAll("span.wb-col"):null;let n=0;for(const r of this.tree.columns)e[r.id]={id:r.id,idx:n,elem:s?s[n]:null,info:r},i||"*"===r.id||(t[r.id]=e[r.id]),n++;return{allColInfosById:e,renderColInfosById:t}}_createIcon(e,t,i){const s=this.tree._createNodeIcon(this,i,!0);return s&&(t?e.replaceChild(s,t):e.appendChild(s)),s}_render_markup(e){const t=this.tree,i=t.options,s=i.rowHeightPx,n=this.getOption("checkbox"),r=t.columns,o=this.getLevel(),l=t.isRowNav()?null:t.activeColIdx;let a,d=this._rowElem,c=null,h=null;const u=!d;assert(u,"Expected unrendered node"),assert(!u||e&&e.after,"opts.after expected, unless updating"),assert(!this.isRootNode(),"Root node not allowed"),d=document.createElement("div"),d.classList.add("wb-row"),d.setAttribute("role","row"),d.id=`${t.id}-row-${encodeURIComponent(this.key)}`,d.style.top=this._rowIdx*s+"px",this._rowElem=d,d._wb_node=this;const p=document.createElement("span");p.classList.add("wb-node","wb-col"),p.setAttribute("role","gridcell"),p.setAttribute("aria-colindex","1"),this.isColspan()&&r.length>1&&p.setAttribute("aria-colspan",""+r.length),d.appendChild(p);let f=0;n&&(c=document.createElement("i"),c.classList.add("wb-checkbox"),c.setAttribute("aria-hidden","true"),("radio"===n||this.parent.radiogroup)&&c.classList.add("wb-radio"),p.appendChild(c),f+=20);for(let e=o-1;e>0;e--)a=document.createElement("i"),a.classList.add("wb-indent"),a.setAttribute("aria-hidden","true"),p.appendChild(a),f+=20;(!i.minExpandLevel||o>i.minExpandLevel)&&(h=document.createElement("i"),h.classList.add("wb-expander"),h.setAttribute("aria-hidden","true"),p.appendChild(h),f+=20);this._createIcon(p,null,!h)&&(f+=20);const g=document.createElement("span");g.classList.add("wb-title"),p.appendChild(g),p._ofsTitlePx=f,t.options.dnd.dragStart&&(p.draggable=!0);if(!this.isColspan()&&r.length>1){let e=0;for(const t of r){let i;e++,"*"===t.id?i=p:(i=document.createElement("span"),i.classList.add("wb-col"),i.setAttribute("role","gridcell"),i.setAttribute("aria-colindex",""+e),d.appendChild(i)),e===l&&i.classList.add("wb-active"),t.classes&&i.classList.add(...t.classes.split(" ")),i.style.left=t._ofsPx+"px",i.style.width=t._widthPx+"px",u&&t.html&&"string"==typeof t.html&&(i.innerHTML=t.html)}}switch(e?e.after:"last"){case"first":t.nodeListElement.prepend(d);break;case"last":t.nodeListElement.appendChild(d);break;default:e.after.after(d)}e.isNew=!0,this._render_data(e)}_render_data(e){assert(this._rowElem,"No _rowElem");const t=this.tree,i=t.options,s=this._rowElem,n=!!e.isNew,r=!!e.preventScroll,o=t.columns,l=this.isColspan(),a=s.querySelector("span.wb-node"),d=a.querySelector("span.wb-title"),c=r?t.element.scrollTop:0;this.titleWithHighlight?d.innerHTML=this.titleWithHighlight:d.textContent=this.title;const h=this.getOption("tooltip",!1);if(h&&(d.title=!0===h?this.title:h),r&&(t.element.scrollTop=c),!i.skeleton)if(l){const e=t.element.clientWidth;d.style.width=e-a._ofsTitlePx-7+"px"}else d.style.width=o[0]._widthPx-a._ofsTitlePx-7+"px";if(e.isDataChange=!0,this._render_status(e),this.statusNodeType)this._callEvent("renderStatusNode",{isNew:n,nodeElem:a,isColspan:l});else if(this.parent){const e=this._getRenderInfo();this._callEvent("render",{isNew:n,nodeElem:a,isColspan:l,allColInfosById:e.allColInfosById,renderColInfosById:e.renderColInfosById})}}_render_aria(e){const t=this.tree,i=(t,i)=>null==i?e.removeAttribute(t):e.setAttribute(t,i);if(e.setAttribute("aria-level",""+this.getLevel()),e.setAttribute("aria-rowindex",""+(this._rowIdx+1+t._ariaHeaderRows)),this.statusNodeType)i("aria-setsize",null),i("aria-posinset",null),i("aria-expanded",null),i("aria-selected",null);else{const s=this.parent;if(s._ariaSetPass!==t._ariaRenderPass||null==this._ariaPosInSet){let e=0;for(const t of s.children)t._ariaPosInSet=t.statusNodeType?void 0:++e;s._ariaSetSize=e,s._ariaSetPass=t._ariaRenderPass}e.setAttribute("aria-setsize",""+s._ariaSetSize),e.setAttribute("aria-posinset",""+this._ariaPosInSet),i("aria-expanded",this.isExpandable()?""+!!this.expanded:null),i("aria-selected",this.selected||this.getOption("checkbox")?""+!!this.selected:null)}i("aria-busy",this._isLoading?"true":null),this===t.focusNode&&t._updateActiveDescendant()}_render_status(e){const t=this.tree,i=t.iconMap,s=t.options,n=this.type?t.types[this.type]:null,r=this._rowElem,o=r.querySelector("span.wb-node"),l=o.querySelector("i.wb-expander"),a=o.querySelector("i.wb-checkbox"),d=["wb-row"];if(this.expanded&&d.push("wb-expanded"),this.lazy&&d.push("wb-lazy"),this.selected&&d.push("wb-selected"),this._partsel&&d.push("wb-partsel"),this===t.activeNode&&d.push("wb-active"),this===t.focusNode&&d.push("wb-focus"),this._errorInfo&&d.push("wb-error"),this._isLoading&&d.push("wb-loading"),this.isColspan()&&d.push("wb-colspan"),this.statusNodeType&&d.push("wb-status-"+this.statusNodeType),this.match&&d.push("wb-match"),this.subMatchCount&&d.push("wb-submatch"),s.skeleton&&d.push("wb-skeleton"),r.className=d.join(" "),this._render_aria(r),this.classes&&r.classList.add(...this.classes),n&&n.classes&&r.classList.add(...n.classes),l){let e=null;this._isLoading?e=i.loading:this.isExpandable(!1)?e=this.expanded?i.expanderExpanded:i.expanderCollapsed:this.lazy&&null==this.children&&(e=i.expanderLazy),null==e?(l.className="wb-expander",l.classList.add("wb-indent")):TEST_HTML.test(e)?l.replaceWith(elemFromHtml(e)):TEST_FILE_PATH.test(e)?l.style.backgroundImage=`url('${e}')`:l.className="wb-expander "+e}if(a){let e="wb-checkbox ";this.isRadio()?(e+="wb-radio ",this.selected?e+=i.radioChecked:e+=i.radioUnchecked):this.selected?e+=i.checkChecked:this._partsel?e+=i.checkUnknown:e+=i.checkUnchecked,a.className=e}if(!e.isNew){let e=0;for(const i of r.children)i.classList.toggle("wb-active",e++===t.activeColIdx),i.classList.remove("wb-error","wb-invalid");const i=o.querySelector("i.wb-icon");i&&this._createIcon(o,i,!l)}if(!1!==e.resizeCols&&!this.isColspan()){const e=r.querySelectorAll("span.wb-col");let t=0,i=0;for(const s of this.tree.columns){const n=e[t];n.style.left=`${i}px`,n.style.width=`${s._widthPx}px`,t++,i+=s._widthPx}}}_render(e){const t=Object.assign({change:ChangeType.data},e);switch(this._rowElem||(t.change=ChangeType.row),t.change){case"status":this._render_status(t);break;case"data":this._render_data(t);break;case"row":this._render_markup(t);break;default:error(`Invalid change type '${t.change}'.`)}}resetLazy(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=null,this.tree.update(ChangeType.structure)}toDict(e=!1,t){const i={};if(NODE_DICT_PROPS.forEach(e=>{const t=this[e];t instanceof Set?t.size&&(i[e]=Array.prototype.join.call(t.keys()," ")):(t||!1===t||0===t)&&(i[e]=t)}),isEmptyObject(this.data)||(i.data=extend({},this.data),isEmptyObject(i.data)&&delete i.data),t){const s=t(i,this);if(!1===s)return!1;"skip"===s&&(e=!1)}if(e&&isArray(this.children)){i.children=[];for(let e=0,s=this.children.length;e=0&&([s,e]=e.split("."));const n=s[e];if("function"==typeof n){const e=n.call(i,{type:"resolve",tree:i,node:this});if(void 0!==e)return e}if(void 0!==this[e])return this[e];const r=this.type?i.types[this.type]:void 0,o=r?r[e]:void 0;return void 0!==o?o:null!=n?n:t}async scrollIntoView(e){const t=Object.assign({node:this},e);return this.tree.scrollTo(t)}async setActive(e=!0,t){const i=this.tree,s=i.getActiveNode(),n=null==t?void 0:t.retrigger,r=null==t?void 0:t.focusTree,o=null==t?void 0:t.noEvents,l=null==t?void 0:t.event,a=null==t?void 0:t.colIdx,d=null==t?void 0:t.edit;if(assert(!d||null!=a,"edit requires colIdx"),!o)if(e){if(s!==this||n){if(!1===(null==s?void 0:s._callEvent("deactivate",{nextNode:this,event:l}))||!1===this._callEvent("beforeActivate",{prevNode:s,event:l}))return;i._setActiveNode(null),null==s||s.update(ChangeType.status)}}else(s===this||n)&&this._callEvent("deactivate",{nextNode:null,event:l});return s!==this&&(e&&i._setActiveNode(this),null==s||s.update(ChangeType.status),this.update(ChangeType.status)),this.makeVisible().then(()=>{e&&((r||d)&&(i.setFocus(),i._setFocusNode(this),i.focusNode.setFocus()),null!=a&&i.isCellNav()&&i.setColumn(a,{edit:d}),o||this._callEvent("activate",{prevNode:s,event:l}))})}async setExpanded(e=!0,t){const{force:i,scrollIntoView:s,immediate:n,resetLazy:r}=null!=t?t:{},o=!(null==t?void 0:t.noEvents);if(!e&&this.isExpanded()&&this.getLevel()<=this.tree.getOption("minExpandLevel")&&!i)return void this.logDebug("Ignored collapse request below minExpandLevel.");if(!e==!this.expanded)return;if(o&&!1===this._callEvent("beforeExpand",{flag:e}))return;e&&this.getOption("autoCollapse")&&this.collapseSiblings(t),e&&this.lazy&&null==this.children?await this.loadLazy():!e&&r&&this.lazy&&this.children&&this.resetLazy(),this.expanded=e;const l={immediate:n};if(this.tree.update(ChangeType.structure,l),e&&s){const e=this.getLastChild();e&&(this.tree.updatePendingModifications(),e.scrollIntoView({topNode:this}))}o&&this._callEvent("expand",{flag:e})}setFocus(e=!0){assert(!!e,"Blur is not yet implemented");const t=this.tree.focusNode;this.tree._setFocusNode(this),null==t||t.update(ChangeType.status),this.update(ChangeType.status)}setIcon(e){this.icon=e,this.update()}setKey(e,t){throw new Error("Not yet implemented")}update(e=ChangeType.data){assert(e===ChangeType.status||e===ChangeType.data,`Invalid change type ${e}`),this.tree.update(e,this)}getSelectedNodes(e=!1){const t=[];return this.visit(i=>{if(i.selected&&(t.push(i),!0===e))return"skip"}),t}getRefKeys(e=!1){const t=new Set;return this.visit(i=>{null==i.refKey||e&&!i.selected||t.add(i.refKey)}),Array.from(t)}toggleSelected(e){let t=this.isSelected();return t=void 0!==t||this.isRadio()?!t:this._anySelectable(),this.setSelected(t,e)}_anySelectable(){let e=!1;return this.visit(t=>{if(!1===t.selected&&!t.unselectable&&!t.hasChildren()&&!t.parent.radiogroup)return e=!0,!1}),e}_changeSelectStatusProps(e){let t=!1;switch(e){case!1:t=this.selected||this._partsel,this.selected=!1,this._partsel=!1;break;case!0:t=!this.selected||!this._partsel,this.selected=!0,this._partsel=!0;break;case void 0:t=this.selected||!this._partsel,this.selected=!1,this._partsel=!!this.hasChildren();break;default:error(`Invalid state: ${e}`)}return t&&this.update(),t}fixSelection3AfterClick(e){const t=!!(null==e?void 0:e.force),i=this.isSelected();this.visit(e=>{if(e.radiogroup)return"skip";!t&&e.getOption("unselectable")||e._changeSelectStatusProps(i)}),this.fixSelection3FromEndNodes()}fixSelection3FromEndNodes(e){const t=!!(null==e?void 0:e.force);assert("hier"===this.tree.options.selectMode,"expected selectMode 'hier'");const i=e=>{let s;const n=e.children;if(n&&n.length){let e=!0,t=!1;for(let s=0,r=n.length;s{let t;const i=e.children;let s=!0,n=!1;for(let e=0,r=i.length;e{this.visit(t=>{t.setSelected(e)})}),n):(e===n||s&&!1===this._callEvent("beforeSelect",{flag:e})||(i.runWithDeferredUpdate(()=>{if(r){if(!e&&!(null==t?void 0:t.force))return n;for(const e of this.parent.children)e.selected=e===this}else this.selected=e,"hier"===o?this.fixSelection3AfterClick():"single"===o&&e&&i.visit(e=>{e!==this&&(e.selected=!1)})}),s&&this._callEvent("select",{flag:e})),n):n}setStatus(e,t){const i=this.tree,s=null==t?void 0:t.message,n=null==t?void 0:t.details;let r=null;const o=e=>{const t=this.children,s=t?t[0]:null;return assert(e.statusNodeType,"Not a status node"),assert(!s||!s.isStatusNode(),"Child must not be a status node"),r=this.addNode(e,"prependChild"),r.match=-1,i.update(ChangeType.structure),r};switch((()=>{const e=this.children;e&&e.length&&e[0].isStatusNode()&&e[0].remove()})(),e){case"ok":this._isLoading=!1,this._errorInfo=null;break;case"loading":this._isLoading=!0,this._errorInfo=null,this.parent?this.update(ChangeType.status):o({statusNodeType:e,title:i.options.strings.loading+(s?" ("+s+")":""),checkbox:!1,colspan:!0,tooltip:n});break;case"error":o({statusNodeType:e,title:i.options.strings.loadError+(s?" ("+s+")":""),checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo={message:s,details:n};break;case"noData":o({statusNodeType:e,title:s||i.options.strings.noData,checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo=null;break;default:error("invalid node status "+e)}return i.update(ChangeType.structure),r}setTitle(e){this.title=e,this.update()}setTooltip(e){this.tooltip=e,this.update()}sortChildren(e=nodeTitleSorter,t=!1){return this.tree.logDeprecate("node.sortChildren()",{since:"0.14.0"}),this.sort({cmp:e||void 0,deep:t})}resetNativeChildOrder(e){const{recursive:t=!0,propName:i="_nativeIndex"}=null!=e?e:{};this.children&&this.children.forEach((s,n)=>{s.data[i]=n,t&&s.children&&s.resetNativeChildOrder(e)})}sortByProperty(e){return this.tree.logDeprecate("node.sortByProperty()",{since:"0.14.0"}),this.sort(e)}sort(e){const t=this.tree;let{propName:i,deep:s=!0,key:n,order:r,caseInsensitive:o=!0,cmp:l,updateColInfo:a=!1,nativeOrderPropName:d="_nativeIndex",colId:c}=e;null!=i||(i=c),"*"===i&&(i="title");const h=!0===t.options.sortFoldersFirst?e=>!1!==e.hasChildren()||"folder"===e.type:t.options.sortFoldersFirst;if(a){const t=this.tree._columnsById[e.colId];assert(t,`Invalid colId specified: ${e.colId}`),null!=r||(r=rotate(t.sortOrder,["asc","desc",void 0]));for(const e of this.tree.columns)e.sortOrder=e===t?r:void 0;void 0===r&&(i=d,r="asc"),this.tree.update(ChangeType.colStructure)}else null!=i||(i="title"),null!=r||(r="asc");this.logDebug(`sort(), propName=${i}, ${r}`,e),assert(i||l||n,"No `propName` or `key` specified"),null==n&&null==l&&(n=e=>{let t;return t=NODE_DICT_PROPS.has(i)?e[i]:e.data[i],o&&"string"==typeof t&&(t=t.toLowerCase()),t}),l?(assert(!n,"`key` and `cmp` are mutually exclusive"),t.logDeprecate("SortOptions.cmp",{since:"0.14.0",hint:"use the `key` callback instead"})):((e.propName||e.caseInsensitive)&&t.logWarn("sort(): ignoring propName, caseInsensitive"),l=(e,t)=>{if(h){const i=h(e);if(i!==h(t))return i?-1:1}let i=n(e),s=n(t);return null==i?i="string"==typeof s?"":0:"boolean"==typeof i&&(i=i?1:0),null==s?s="string"==typeof i?"":0:"boolean"==typeof s&&(s=s?1:0),"desc"===r?i===s?0:i>s?-1:1:i===s?0:i>s?1:-1}),this.children&&function e(t){if(t&&(t.sort((e,t)=>Number(e.isPagingNode())-Number(t.isPagingNode())||l(e,t)),s))for(let i=0,s=t.length;i{const r=t._callEvent(e,n);Promise.resolve(r).then(e=>{i(e)}).catch(e=>{s(e)})}).then(e=>{if(!s.checkValidity())throw t.logWarn("inputElem.checkValidity() failed: throwing...."),new ValidationError(s.validationMessage);return e}).catch(n=>{if(!(n instanceof ValidationError))throw t.logError(`Error in ${e} event handler (throw e.util.ValidationError instead if this was intended)`,n),i.classList.add("wb-error"),n;t.logWarn("catched ",n),i.classList.add("wb-invalid"),s.setCustomValidity&&!s.validationMessage&&s.setCustomValidity(n.message),s.validationMessage&&s.reportValidity()}).finally(()=>{i.classList.remove("wb-busy")})}_onChange(e){const t=Wunderbaum.getEventInfo(e),i=t.node,s=t.colElem;i&&0!==t.colIdx?this._applyChange("change",i,s,e.target,{info:t,event:e,inputElem:e.target,inputValue:Wunderbaum.util.getValueFromElem(e.target),inputValid:e.target.checkValidity()}):this.tree.log("Ignored change event for removed element or node title")}init(){super.init(),onEvent(this.tree.element,"change",".contenteditable,input,textarea,select",e=>this._onChange(e))}_preprocessKeyEvent(e){const t=e.event,i=eventToString(t),s=this.tree,n=this.getPluginOption("trigger");if(this.isEditingTitle()){switch(i){case"Enter":return this._stopEditTitle(!0,{event:t}),!1;case"Escape":return this._stopEditTitle(!1,{event:t}),!1}return!1}if(s.isRowNav()||0===s.activeColIdx){switch(i){case"Enter":if(n.indexOf("macEnter")>=0&&isMac)return this.startEditTitle(),!1;break;case"F2":if(n.indexOf("F2")>=0)return this.startEditTitle(),!1}return!0}return!0}isEditingTitle(e){return e?this.curEditNode===e:!!this.curEditNode}startEditTitle(e){e=null!=e?e:this.tree.getActiveNode();const t=this.getPluginOption("validity"),i=this.getPluginOption("select");if(!e)return;if(e.isStatusNode())return void e.logWarn("Cannot edit status node.");this.tree.logDebug(`startEditTitle(node=${e})`);let s=e._callEvent("edit.beforeEdit");if(!1===s)return void e.logDebug("beforeEdit canceled operation.");if(!0===s||!s){const t=escapeHtml(e.title);let i=this.getPluginOption("maxlength");const n=i?` maxlength="${i}"`:"";i=this.getPluginOption("minlength");s=`0?" required":""}${i?` minlength="${i}"`:""}${n} >`}const n=e.getColElem(0).querySelector(".wb-title");n.innerHTML=s;const r=n.firstElementChild;t&&r.addEventListener("keydown",t=>{r.setCustomValidity(""),r.reportValidity()||e.logWarn(`Invalid input: '${r.value}'`)}),r.focus(),i&&r.select(),this.curEditNode=e,e._callEvent("edit.edit",{inputElem:r})}stopEditTitle(e){return this._stopEditTitle(e,{})}_stopEditTitle(e,t){var i;null!=t||(t={});const s=document.activeElement;let n=s?getValueFromElem(s):null;const r=this.curEditNode,o=!!t.forceClose,l=this.getPluginOption("validity");if(n&&this.getPluginOption("trim")&&(n=n.trim()),r)if(r.logDebug(`stopEditTitle(${e})`,t,s,n),e&&null!==n&&n!==r.title){const e=s.validationMessage;if(e)throw new Error(`Input validation failed for "${n}": ${e}.`);const t=r.getColElem(0);this._applyChange("edit.apply",r,t,s,{oldValue:r.title,newValue:n,inputElem:s,inputValid:s.checkValidity()}).then(e=>{var t;const i=s.validationMessage;if(l&&i&&!1!==e)throw new Error(`Edit apply validation failed for "${n}": ${i}.`);(o||!1!==e)&&(null==r||r.setTitle(n),null===(t=this.curEditNode)||void 0===t||t._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus())})}else null===(i=this.curEditNode)||void 0===i||i._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus()}createNode(e="after",t,i){const s=this.tree;if(assert(t=null!=t?t:s.getActiveNode(),"No node was passed, or no node is currently active."),e=e||"prependChild",null==i?i={title:""}:"string"==typeof i?i={title:i}:assert(isPlainObject(i),`Expected a plain object: ${i}`),("prependChild"===e||"appendChild"===e)&&(null==t?void 0:t.isExpandable(!0)))return void t.setExpanded().then(()=>{this.createNode(e,t,i)});const n=t.addNode(i,e);n.setClass("wb-edit-new"),this.relatedNode=t,n.match=-1,n.makeVisible({noAnimation:!0}).then(()=>{this.startEditTitle(n)})}} +/*! + * wunderbaum.ts + * + * A treegrid control. + * + * Copyright (c) 2021-2025, Martin Wendt (https://wwWendt.de). + * https://github.com/mar10/wunderbaum + * + * Released under the MIT license. + * @version v0.15.0 + * @date Sat, 24 Oct 2026 10:46:09 GMT + */class WbSystemRoot extends WunderbaumNode{constructor(e){super(e,null,{key:"__root__",title:e.id})}toString(){return`WbSystemRoot@${this.key}<'${this.tree.id}'>`}}class Wunderbaum{get activeNode(){var e;return(null===(e=this._activeNode)||void 0===e?void 0:e.tree)?this._activeNode:null}get focusNode(){var e;return(null===(e=this._focusNode)||void 0===e?void 0:e.tree)?this._focusNode:null}constructor(e){this.enabled=!0,this.data={},this.extensionList=[],this.extensions={},this.keyMap=new Map,this.refKeyMap=new Map,this.treeRowCount=0,this._ariaHeaderRows=1,this._ariaRenderPass=0,this._disableUpdateCount=0,this._disableUpdateIgnoreCount=0,this._activeNode=null,this._focusNode=null,this._initialSource=null,this.types={},this.columns=[],this._columnsById={},this.pendingChangeTypes=new Set,this._util=util,this.breadcrumb=null,this.filterMode=null,this.activeColIdx=0,this._cellNavMode=!1,this.lastQuicksearchTime=0,this.lastQuicksearchTerm="",this.lastClickTime=0;const t=Object.assign({id:void 0,source:[],element:unsafeCast(null),debugLevel:3,header:null,rowHeightPx:22,iconMap:"bootstrap",columns:[],types:{},enabled:!0,fixedCol:!1,showSpinner:!1,checkbox:!1,minExpandLevel:0,emptyChildListExpandable:!1,skeleton:!1,autoCollapse:!1,adjustHeight:!0,connectTopBreadcrumb:null,columnsFilterable:!1,columnsMenu:!1,columnsResizable:!1,columnsSortable:!1,selectMode:"multi",scrollIntoViewOnExpandClick:!0,dnd:unsafeCast(null),edit:unsafeCast(null),filter:unsafeCast(null),navigationModeOption:unsafeCast(null),quicksearch:!0,strings:{loadError:"Error",loading:"Loading...",noData:"No data",breadcrumbDelimiter:" » ",queryResult:"Found ${matches} of ${count}",noMatch:"No results",matchIndex:"${match} of ${matches}",moreItems:"More..."}},e),i=t;this.options=i;const s=new Deferred;this.ready=s.promise();let n=!1;if(this.ready.then(()=>{n=!0;try{this._callEvent("init")}catch(e){this.logError("Exception inside `init(e)` event:",e)}}).catch(e=>{if(n)throw e;this._callEvent("init",{error:e})}),this.id=t.id||"wb_"+ ++Wunderbaum.sequence,delete t.id,this.root=new WbSystemRoot(this),this._registerExtension(new KeynavExtension(this)),this._registerExtension(new EditExtension(this)),this._registerExtension(new FilterExtension(this)),this._registerExtension(new DndExtension(this)),this._registerExtension(new GridExtension(this)),this._registerExtension(new LoggerExtension(this)),this._updateViewportThrottled=adaptiveThrottle(this._updateViewportImmediately.bind(this),{}),this.columns=t.columns||[],delete t.columns,!this.columns||!this.columns.length){const e="string"==typeof i.header?i.header:this.id;this.columns=[{id:"*",title:e,width:"*"}]}t.types&&this.setTypes(t.types,!0),delete t.types,this.element=elemFromSelector(t.element),assert(!!this.element,`Invalid 'element' option: ${t.element}`),delete t.element,this.element.classList.add("wunderbaum"),this.element.getAttribute("tabindex")||(this.element.tabIndex=0),this.element.setAttribute("role","treegrid"),!i.checkbox||"radio"===i.checkbox||"multi"!==i.selectMode&&"hier"!==i.selectMode?this.element.removeAttribute("aria-multiselectable"):this.element.setAttribute("aria-multiselectable","true"),22!==i.rowHeightPx&&(this.element.style.setProperty("--wb-row-outer-height",i.rowHeightPx+"px"),this.element.style.setProperty("--wb-row-inner-height",i.rowHeightPx-2+"px")),this.element._wb_tree=this,this.headerElement=this.element.querySelector("div.wb-header");const r=null==i.header?this.columns.length>1:!!i.header;if(this.headerElement){assert(!this.columns,"`opts.columns` must not be set if table markup already contains a header"),this.columns=[];const e=this.headerElement.querySelector("div.wb-row");for(const t of e.querySelectorAll("div"))this.columns.push({id:t.dataset.id||`col_${this.columns.length}`,title:""+t.textContent,width:"*"})}else{const e="".repeat(this.columns.length);if(this.element.innerHTML=`\n
\n
\n ${e}\n
\n
`,!r){this.element.querySelector("div.wb-header").style.display="none"}}this.element.innerHTML+='\n
\n
\n
',this.listContainerElement=this.element.querySelector("div.wb-list-container"),this.nodeListElement=this.listContainerElement.querySelector("div.wb-node-list"),this.headerElement=this.element.querySelector("div.wb-header"),this.headerElement.setAttribute("role","rowgroup");const o=this.headerElement.querySelector("div.wb-row");null==o||o.setAttribute("role","row"),null==o||o.setAttribute("aria-rowindex","1"),this.nodeListElement.setAttribute("role","rowgroup"),this.element.classList.toggle("wb-grid",this.columns.length>1),this.options.connectTopBreadcrumb&&(this.breadcrumb=elemFromSelector(this.options.connectTopBreadcrumb),assert(!this.breadcrumb||null!=this.breadcrumb.innerHTML,`Invalid 'connectTopBreadcrumb' option: ${this.breadcrumb}.`),this.breadcrumb.addEventListener("click",e=>{const t=e.target;if(t&&t.matches("a.wb-breadcrumb")){const i=this.keyMap.get(t.dataset.key);null==i||i.setActive(),e.preventDefault()}})),this._initExtensions(),["enabled","fixedCol"].forEach(e=>{null!=i[e]&&this.setOption(e,i[e])}),t.source?(i.showSpinner&&(this.nodeListElement.innerHTML=`${i.strings.loading}`),this.load(t.source).then(()=>{null==i.navigationModeOption?this.isGrid()?this.setNavigationOption(NavModeEnum.cell):this.setNavigationOption(NavModeEnum.row):this.setNavigationOption(i.navigationModeOption),this.update(ChangeType.structure,{immediate:!0}),s.resolve()}).catch(e=>{s.reject(e)}).finally(()=>{var e;null===(e=this.element.querySelector("progress.spinner"))||void 0===e||e.remove(),this.element.classList.remove("wb-initializing")})):s.resolve(),this.update(ChangeType.any),this._registerEventHandlers(),this.resizeObserver=new ResizeObserver(e=>{this.update(ChangeType.resize)}),this.resizeObserver.observe(this.element)}_registerEventHandlers(){this.element.addEventListener("scroll",e=>{this.update(ChangeType.scroll)}),onEvent(this.element,"click",".wb-button,.wb-col-icon",e=>{var t,i;const s=Wunderbaum.getEventInfo(e),n=null===(i=null===(t=e.target)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.command;this._callEvent("buttonClick",{event:e,info:s,command:n})}),onEvent(this.nodeListElement,"click","div.wb-row",e=>{const t=Wunderbaum.getEventInfo(e),i=t.node,s=e;if(!1===this._callEvent("click",{event:e,node:i,info:t}))return this.lastClickTime=Date.now(),!1;if(i&&i.isPagingNode())return i.setFocus(),i._clickPaging(e),void(this.lastClickTime=Date.now());if(i){if(s.ctrlKey)return void i.toggleSelected();const n=this.getOption("edit.trigger"),r=this.getOption("edit.slowClickDelay");n.indexOf("clickActive")>=0&&"title"===t.region&&i.isActive()&&(!r||Date.now()-this.lastClickTime=0?i.setActive(!0,{colIdx:t.colIdx,event:e}):i.setActive(!0,{event:e}),i.setFocus())}this.lastClickTime=Date.now()}),onEvent(this.nodeListElement,"dblclick","div.wb-row",e=>{const t=Wunderbaum.getEventInfo(e),i=t.node;if(!1===this._callEvent("dblclick",{event:e,node:i,info:t}))return!1;i&&0===t.colIdx&&i.isExpandable()&&t.region!==NodeRegion.expander&&(this._callMethod("edit._stopEditTitle"),i.setExpanded(!i.isExpanded()))}),onEvent(this.element,"keydown",e=>{const t=Wunderbaum.getEventInfo(e),i=eventToString(e),s=t.node||this.getFocusNode();this._callHook("onKeyEvent",{event:e,node:s,info:t,eventName:i})}),onEvent(this.element,"focusin focusout",e=>{const t="focusin"===e.type,i=Wunderbaum.getNode(e);this._callEvent("focus",{flag:t,event:e}),t&&this.isRowNav()&&!this.isEditingTitle()&&(this.options.navigationModeOption===NavModeEnum.row?null==i||i.setActive():this.setCellNav()),t||this._callMethod("edit._stopEditTitle",!0,{event:e,forceClose:!0})})}static getTree(e){if(e instanceof Wunderbaum)return e;if(e instanceof WunderbaumNode)return e.tree;if(void 0===e&&(e=0),"number"==typeof e)e=document.querySelectorAll(".wunderbaum")[e];else if("string"==typeof e){for(const t of document.querySelectorAll(".wunderbaum")){const i=t._wb_tree;if(i&&i.id===e)return i}if(!(e=document.querySelector(e)))return null}else e.target&&(e=e.target);return assert(e instanceof Element,`Invalid el type: ${e}`),e.matches(".wunderbaum")||(e=e.closest(".wunderbaum")),e&&e._wb_tree?e._wb_tree:null}get iconMap(){const e=this.options.iconMap;return"string"==typeof e?defaultIconMaps[e]:e}static getNode(e){if(!e)return null;if(e instanceof WunderbaumNode)return e;for(void 0!==e.target&&(e=e.target);e;){if(e._wb_node)return e._wb_node;e=e.parentElement}return null}*[Symbol.iterator](){yield*this.root}_registerExtension(e){this.extensionList.push(e),this.extensions[e.id]=e}_initExtensions(){for(const e of this.extensionList)e.init()}_calculateKey(e,t){if(e.key)return e.key;if(!this.options.autoKeys)return""+ ++WunderbaumNode.sequence;const i=(t?t.key:"")+(e.refKey||e.title),s=murmurHash3(i,!0);let n="id_"+s+murmurHash3(s+i,!0);const r=this.keyMap.get(n);return r&&(n+="."+ ++Wunderbaum.sequence,this.logWarn(`Node with existing key: '${r}', using ${n}.`,e)),n}_registerNode(e){const t=e.key;assert(null!=t,`Missing key: '${e}'.`),assert(!this.keyMap.has(t),`Duplicate key: '${t}': ${e}.`),this.keyMap.set(t,e);const i=e.refKey;if(null!=i){const t=this.refKeyMap.get(i);t?t.add(e):this.refKeyMap.set(i,new Set([e]))}}_unregisterNode(e){const t=e.refKey;if(null!=t){const i=this.refKeyMap.get(t);i&&i.delete(e)&&!i.size&&this.refKeyMap.delete(t)}this.keyMap.delete(e.key),e.tree=null,e.parent=null,e.removeMarkup()}_callHook(e,t={}){let i;const s=extend({},{tree:this,options:this.options,result:void 0},t);for(const t of this.extensionList){if(i=t[e].call(t,s),!1===i)break;void 0!==s.result&&(i=s.result)}return i}_callMethod(e,...t){const[i,s]=e.split("."),n=s?this.extensions[i]:this,r=n[s];if(r)return r.apply(n,t);this.logError(`Calling undefined method '${e}()'.`)}_callEvent(e,t){const[i,s]=e.split("."),n=this.options,r=s?n[i][s]:n[i];if(r)return r.call(this,extend({type:e,tree:this,util:this._util},t))}_getNodeByRowIdx(e){let t=null;return this.visitRows(i=>{if(i._rowIdx===e)return t=i,!1}),t}getTopmostVpNode(e=!0){const t=this.options.rowHeightPx,i=this.element.scrollTop;let s;return s=e?Math.ceil((i-1)/t):Math.floor(i/t),this._getNodeByRowIdx(s)}getLowestVpNode(e=!0){const t=this.options.rowHeightPx,i=this.element,s=this.headerElement.clientHeight,n=i.scrollTop,r=i.clientHeight-s;let o;return o=e?Math.floor((n+r)/t)-1:Math.ceil((n+r)/t)-1,o=Math.min(o,this.count(!0)-1),this._getNodeByRowIdx(o)}_getPrevNodeInView(e,t=1){return this.visitRows(i=>{if(e=i,t--<=0)return!1},{reverse:!0,start:e||this.getActiveNode()}),e}_getNextNodeInView(e,t){let i=(null==t?void 0:t.ofs)||1;const s=!!(null==t?void 0:t.reverse);return this.visitRows(s=>(e=s,(!(null==t?void 0:t.cb)||!t.cb(s))&&(!(i--<=0)&&void 0)),{reverse:s,start:e||this.getActiveNode()}),e}addChildren(e,t){return this.root.addChildren(e,t)}applyCommand(e,t,i){let s,n;switch(t instanceof WunderbaumNode?s=t:(s=this.getActiveNode(),assert(void 0===i,`Unexpected options: ${i}`),i=t),e){case"moveUp":n=s.getPrevSibling(),n&&(s.moveTo(n,"before"),s.setActive());break;case"moveDown":n=s.getNextSibling(),n&&(s.moveTo(n,"after"),s.setActive());break;case"indent":n=s.getPrevSibling(),n&&(s.moveTo(n,"appendChild"),n.setExpanded(),s.setActive());break;case"outdent":s.isTopLevel()||(s.moveTo(s.getParent(),"after"),s.setActive());break;case"remove":n=s.getPrevSibling()||s.getParent(),s.remove(),n&&n.setActive();break;case"addChild":this._callMethod("edit.createNode","prependChild");break;case"addSibling":this._callMethod("edit.createNode","after");break;case"rename":s.startEditTitle();break;case"down":case"first":case"last":case"left":case"nextMatch":case"pageDown":case"pageUp":case"parent":case"prevMatch":case"right":case"up":return s.navigate(e);default:error(`Unhandled command: '${e}'`)}}clear(){this.root.removeChildren(),this.root.children=null,this.keyMap.clear(),this.refKeyMap.clear(),this.treeRowCount=0,this._activeNode=null,this._focusNode=null,this.update(ChangeType.structure)}destroy(){this.logInfo("destroy()..."),this.clear(),this.resizeObserver.disconnect(),this.element.innerHTML="",this.element.outerHTML=this.element.outerHTML}getOption(e,t){let i,s=this.options;e.indexOf(".")>=0&&([i,e]=e.split("."),s=s[i]);let n=s[e];return"function"==typeof n&&(n=n({type:"resolve",tree:this})),null!=n?n:t}setOption(e,t){if(e.indexOf(".")>=0){const i=e.split(".");return void this.extensions[i[0]].setPluginOption(i[1],t)}switch(this.options[e]=t,e){case"checkbox":this.update(ChangeType.any);break;case"enabled":this.setEnabled(!!t);break;case"fixedCol":this.element.classList.toggle("wb-fixed-col",!!t)}}hasFocus(){return this.element.contains(document.activeElement)}hasHeader(){const e=this.options.header;return this.isGrid()?!1!==e:!!e}runWithDeferredUpdate(e){try{this.enableUpdate(!1);const t=e();return assert(!(t instanceof Promise),`Promise return not allowed (see 'runWithDeferredUpdateAsync()'): ${t}`),t}finally{this.enableUpdate(!0)}}async runWithDeferredUpdateAsync(e){try{return this.enableUpdate(!1),await e()}finally{this.enableUpdate(!0)}}async expandAll(e=!0,t){await this.root.expandAll(e,t)}selectAll(e=!0){return this.root.setSelected(e,{propagateDown:!0})}toggleSelect(){this.selectAll(this.root._anySelectable())}getSelectedNodes(e=!1){return this.root.getSelectedNodes(e)}getRefKeys(e=!1){return this.root.getRefKeys(e)}_selectRange(e){this.logDebug("_selectRange",e),error("Not yet implemented.")}count(e=!1){return e?this.treeRowCount:this.keyMap.size}countUnique(){return this.refKeyMap.size}_check(){let e=0;this.visit(t=>{e++}),this.keyMap.size!==e&&this.logWarn(`_check failed: ${this.keyMap.size} !== ${e}`)}findAll(e){return this.root.findAll(e)}findByRefKey(e){const t=this.refKeyMap.get(e);return t?Array.from(t):[]}findFirst(e){return this.root.findFirst(e)}findKey(e){return this.keyMap.get(e)||null}findNextNode(e,t,i=!1){let s=null;const n=this.getFirstChild(),r=i?this.findRelatedNode(n,"last"):null,o="string"==typeof e?makeNodeTitleStartMatcher(e):e;function l(e){if(o(e)&&(s=e),s||e===t)return!1}return t=t||(i?r:n),this.visitRows(l,{start:t,includeSelf:!1,reverse:i}),s||t===n||this.visitRows(l,{start:i?r:n,includeSelf:!0,reverse:i}),s}findRelatedNode(e,t,i=!1){const s=this.options.rowHeightPx;let n=null;const r=Math.floor(this.listContainerElement.clientHeight/s);switch(t){case"parent":case"left":e.parent&&e.parent.parent&&(n=e.parent);break;case"first":this.visit(e=>{if(e.isVisible())return n=e,!1});break;case"last":this.visit(e=>{e.isVisible()&&(n=e)});break;case"right":e.children&&e.children.length&&(n=e.children[0]);break;case"up":n=this._getNextNodeInView(e,{reverse:!0});break;case"down":n=this._getNextNodeInView(e);break;case"pageDown":{const t=this.getLowestVpNode();n=e._rowIdxt._rowIdx?t:this._getNextNodeInView(e,{reverse:!0,ofs:r})}break;case"prevMatch":case"nextMatch":if(!this.isFilterActive){this.logWarn(`${t}: Filter is not active.`);break}n=this.findNextNode(e=>e.isMatched(),e,"prevMatch"===t),null==n||n.setActive();break;default:this.logWarn("Unknown relation '"+t+"'.")}return n}*format_iter(e,t){yield*this.root.format_iter(e,t)}format(e,t){return this.root.format(e,t)}get parent(){return null}get children(){return this.root.children||[]}getActiveColElem(){return this.activeNode&&this.activeColIdx>=0?this.activeNode.getColElem(this.activeColIdx):null}getActiveNode(){return this.activeNode}getFirstChild(){return this.root.getFirstChild()}getLastChild(){return this.root.getLastChild()}getFocusNode(){return this.focusNode}static getEventInfo(e){const t=e.target,i=t.classList,s=t.closest("span.wb-col"),n=Wunderbaum.getNode(t),r=n?n.tree:Wunderbaum.getTree(e),o={event:e,canonicalName:eventToString(e),tree:r,node:n,region:NodeRegion.unknown,colDef:void 0,colIdx:-1,colId:void 0,colElem:s};if(i.contains("wb-title"))o.region=NodeRegion.title;else if(i.contains("wb-expander"))o.region=n.isExpandable()?NodeRegion.expander:NodeRegion.prefix;else if(i.contains("wb-checkbox"))o.region=NodeRegion.checkbox;else if(i.contains("wb-icon"))o.region=NodeRegion.icon;else if(i.contains("wb-node"))o.region=NodeRegion.title;else if(s){o.region=NodeRegion.column;const e=Array.prototype.indexOf.call(s.parentNode.children,s);o.colIdx=e}else{if(!i.contains("wb-row"))return"mousemove"===e.type||e instanceof KeyboardEvent||null==r||r.logWarn("getEventInfo(): not found",e,o),o;o.region=NodeRegion.title}return-1===o.colIdx&&(o.colIdx=0),o.colDef=null==r?void 0:r.columns[o.colIdx],null!=o.colDef&&(o.colId=o.colDef.id),o}toString(){return`Wunderbaum<'${this.id}'>`}isEditing(){return!!this.nodeListElement.querySelector("input:focus,select:focus")}isEditingTitle(){return this._callMethod("edit.isEditingTitle")}isLoading(){let e=!1;return this.root.visit(t=>{if(t._isLoading||t._requestId)return e=!0,!1},!0),e}log(...e){this.options.debugLevel>=4&&console.log(this.toString(),...e)}logDebug(...e){this.options.debugLevel>=4&&console.debug(this.toString(),...e)}logError(...e){this.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.options.debugLevel>=3&&console.info(this.toString(),...e)}logTime(e){return this.options.debugLevel>=4&&console.time(this+": "+e),e}logTimeEnd(e){this.options.debugLevel>=4&&console.timeEnd(this+": "+e)}logWarn(...e){this.options.debugLevel>=2&&console.warn(this.toString(),...e)}logDeprecate(e,t){if(this.options.debugLevel>=2){let i=`${this}: ${e} is deprecated`;(null==t?void 0:t.since)&&(i+=` since ${t.since}`),(null==t?void 0:t.hint)&&(i+=` (${t.since})`),console.warn(i+".")}}resetColumns(){this.columns.forEach(e=>{delete e.customWidthPx}),this.update(ChangeType.colStructure)}scrollTo(e){let t,i;e instanceof WunderbaumNode?t=e:(i=e,t=i.node),assert(t&&null!=t._rowIdx,`Invalid node: ${t}`);const s=this.options.rowHeightPx,n=this.element,r=this.headerElement.clientHeight,o=n.scrollTop,l=n.clientHeight,a=t._rowIdx*s+r,d=r,c=a-o,h=c+s,u=null==i?void 0:i.topNode;let p=null;c>=d?h<=l||(p=a+s-l+2):p=a-d-2,null!=p&&(this.log(`scrollTo(${a}): ${o} => ${p}`),n.scrollTop=p,u&&this.scrollTo(u))}scrollToHorz(){const e=this.columns[0]._widthPx,t=this.element.clientWidth,i=this.element.scrollLeft,s=this.getActiveColElem(),n=Number.parseInt(null==s?void 0:s.style.left,10),r=n+Number.parseInt(null==s?void 0:s.style.width,10);let o=i;n-it&&(o=r-t),o=Math.max(0,o),this.log(`scrollToHorz(${this.activeColIdx}): ${n}..${r}, fixedOfs=${e}, vpWidth=${t}, curLeft=${i} -> ${o}`),this.element.scrollLeft=o}setColumn(e,t){var i,s,n;const r=null==t?void 0:t.edit,o=!1!==(null==t?void 0:t.scrollIntoView);if(assert(this.isCellNav(),"Expected cellNav mode"),"string"==typeof e){const t=e;assert((e=this.columns.findIndex(t=>t.id===e))>=0,`Invalid colId: ${t}`)}if(assert(0<=e&&e{e.parent&&o.add(e.key)},!1);return{expandedKeys:o.size?Array.from(o):void 0,activeKey:null!==(i=null===(t=this.activeNode)||void 0===t?void 0:t.key)&&void 0!==i?i:null,activeColIdx:this.activeColIdx,selectedKeys:r?this.getSelectedNodes().flatMap(e=>e.key):void 0}}async setState(e,t={}){const{expandLazy:i=!0}=t;return this.runWithDeferredUpdateAsync(async()=>{var t,s;if(e.expandedKeys&&e.expandedKeys.length)if(i)await this._loadLazyNodes(e.expandedKeys,{expand:!0,noEvents:!0});else for(const i of e.expandedKeys)null===(t=this.findKey(i))||void 0===t||t.setExpanded(!0);if(e.activeKey&&this.setActiveNode(e.activeKey),e.selectedKeys){this.selectAll(!1);for(const t of e.selectedKeys)null===(s=this.findKey(t))||void 0===s||s.setSelected(!0)}this.isCellNav()&&null!=e.activeColIdx&&this.setColumn(e.activeColIdx)})}update(e,t,i){t instanceof WunderbaumNode||(i=t,t=void 0);const s=!!getOption(i,"immediate"),n=RenderFlag,r=this.pendingChangeTypes;if(this._disableUpdateCount)this._disableUpdateIgnoreCount++;else{switch(e){case ChangeType.any:case ChangeType.colStructure:r.add(n.header),r.add(n.clearMarkup),r.add(n.redraw),r.add(n.scroll);break;case ChangeType.resize:r.add(n.header),r.add(n.redraw);break;case ChangeType.structure:r.add(n.redraw);break;case ChangeType.scroll:r.add(n.scroll);break;case ChangeType.row:case ChangeType.data:case ChangeType.status:assert(t,`Option '${e}' requires a node.`),t._rowElem&&t._render({change:e});break;default:error(`Invalid change type '${e}'.`)}if(e===ChangeType.colStructure){const e=this.isGrid();this.element.classList.toggle("wb-grid",e),!e&&this.isCellNav()&&this.setCellNav(!1)}r.size>0&&(s?this._updateViewportImmediately():this._updateViewportThrottled())}}setEnabled(e=!0){const t=this.enabled;return this.enabled=!!e,this.element.classList.toggle("wb-disabled",!e),t}isEnabled(){return this.enabled}isGrid(){return this.columns&&this.columns.length>1}isCellNav(){return!!this._cellNavMode}isRowNav(){return!this._cellNavMode}setCellNav(e=!0){var t;const i=this._cellNavMode;this._cellNavMode=!!e,e&&!i&&this.setColumn(0),this.element.classList.toggle("wb-cell-mode",e),null===(t=this.activeNode)||void 0===t||t.update(ChangeType.status)}setNavigationOption(e,t=!1){if(this.isGrid()||e===NavModeEnum.row)switch(this.options.navigationModeOption=e,e){case NavModeEnum.cell:this.setCellNav(!0);break;case NavModeEnum.row:this.setCellNav(!1);break;case NavModeEnum.startCell:t&&this.setCellNav(!0);break;case NavModeEnum.startRow:t&&this.setCellNav(!1);break;default:error(`Invalid mode '${e}'.`)}else this.logWarn("Plain trees only support row navigation mode.")}setStatus(e,t){return this.root.setStatus(e,t)}setTypes(e,t=!0){assert(isPlainObject(e),`Expected plain objext: ${e}`),t?this.types=e:extend(this.types,e);for(const e of Object.values(this.types))e.classes&&(e.classes=toSet(e.classes))}sortChildren(e=nodeTitleSorter,t=!1){return this.logDeprecate("sortChildren()",{since:"0.14.0"}),this.sort({cmp:e||void 0,deep:t,propName:"title"})}sortByProperty(e){this.logDeprecate("sortByProperty()",{since:"0.14.0"}),this.root.sortByProperty(e)}sort(e){this.root.sort(e)}toDictArray(e){var t;return null!==(t=this.root.toDict(!0,e).children)&&void 0!==t?t:[]}_updateColumnWidths(){const e=this.element.clientWidth,t=this.columns,i=t[0];let s=0,n=0,r=0,o=!1;if("*"!==i.id)throw new Error(`First column must have id '*': got '${i.id}'.`);this._columnsById={};for(const e of t){this._columnsById[e.id]=e;const t=e.customWidthPx?`${e.customWidthPx}px`:e.width;if("*"===e.id&&e!==i)throw new Error(`Column id '*' must be defined only once: '${e.title}'.`);if(t&&"*"!==t)if("number"==typeof t)e._weight=t,n+=t;else if("string"==typeof t&&t.endsWith("px")){e._weight=0;const i=parseFloat(t.slice(0,-2));e._widthPx!=i&&(o=!0,e._widthPx=i),r+=i}else error(`Invalid column width: ${t} (expected string ending with 'px' or number, e.g. "px" or ).`);else e._weight=1,n+=1}const l=Math.max(0,e-r);let a=0;for(const e of t){let t;if(e._weight){const i=e.minWidth;t="number"==typeof i?i:"string"==typeof i&&i.endsWith("px")?parseFloat(i.slice(0,-2)):4;const s=Math.max(t,l*e._weight/n);e._widthPx!=s&&(o=!0,e._widthPx=s)}e._ofsPx=a,a+=e._widthPx}t[t.length-1]._widthPx-=1,s=a-1;const d=`${s}px`;return this.headerElement.style.width=d,this.listContainerElement.style.width=d,o}_renderHeaderMarkup(){assert(this.headerElement,"Expected a headerElement");const e=this.hasHeader();if(setElemDisplay(this.headerElement,e),this._ariaHeaderRows=e?1:0,!e)return;const t=this.iconMap,i=this.columns.length,s=this.headerElement.querySelector(".wb-row");assert(s,"Expected a row in header element"),s.innerHTML="".repeat(i);for(let e=0;e