@yongdall/theme 0.3.3 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{Menu as e,Page as t,PageSider as n,User as r,application as i,createComputed as a,createIcon as o,createShowField as s,createState as c,effect as l,filterPermission as u,neverAbortedSignal as d,root as f,runPattern as p,toFileLink as m,waitAbortSignal as h,watch as g}from"@yongdall/web";const _=`YongDallTheme`,v=`${_}-activity`,y=document.createElement(`div`);y.classList.add(v);const ee=new Map;let b,x=!1;function S(e){x=e}function C(e){document.title=[e?e.title:``,i.title||`拥道YongDall`].filter(Boolean).join(` | `)}C();var w=e=>{let t=document.createElement(`div`);t.classList.add(`${v}-page`);let n=t.appendChild(document.createElement(`a`));n.classList.add(`${v}-title`),n.href=e.href,n.innerText=e.title;let r=t.appendChild(document.createElement(`button`));r.type=`button`,r.classList.add(`${v}-close`),r.addEventListener(`click`,()=>{e.destroy()});let i={button:t,link:n,next:b};b&&(b.last=i),b=i,ee.set(e,i),y.insertBefore(t,x?null:y.firstChild),l(()=>{e.current&&C(e)},e.signal),l(()=>{n.innerText=e.title},e.signal),l(()=>{n.href=e.href},e.signal),l(()=>{e.current?t.classList.add(`${v}-current`):t.classList.remove(`${v}-current`)},e.signal),l(()=>{e.loading?t.classList.add(`${v}-loading`):t.classList.remove(`${v}-loading`)},e.signal),l(()=>{e.unsaved?t.classList.add(`${v}-unsaved`):t.classList.remove(`${v}-unsaved`)},e.signal),h(e.signal).then(()=>{let{last:e,next:n}=i;e&&(e.next=n),n&&(n.last=e),b===i&&(b=n),t.remove()})},T=class{#e;#t;#n;#r;#i=[];#a=document.createElement(`table`);#o=this.#a.appendChild(document.createElement(`thead`));#s=this.#o.appendChild(document.createElement(`tr`));#c=this.#a.appendChild(document.createElement(`tbody`));get root(){return this.#a}get createUrl(){return this.#e}set createUrl(e){let t=typeof e==`function`?e:null;this.#e!==t&&(this.#e=t,this.#l())}constructor(e,t){let n=Object.entries(t.fields).filter(([,{type:e}])=>e&&typeof e!=`object`),r=Object.entries(t.fields).filter(([,e])=>e.primary).map(([e])=>e);this.#n=t.labelPattern||``,this.#e=typeof e==`function`?e:null,this.#t=n,this.#r=r;let i=this.#s;i.innerHTML=``,i.appendChild(document.createElement(`th`)).appendChild(document.createTextNode(`#`));for(let[e,t]of n)i.appendChild(document.createElement(`th`)).appendChild(document.createTextNode(t.label||e))}#l(){let e=this.#c;e.innerHTML=``;let t=this.#r,n=this.#n,r=this.#t,i=this.#e;for(let a of this.#i){let o=e.appendChild(document.createElement(`tr`)),c=o.appendChild(document.createElement(`td`)),l=p(n,a)||t.map(e=>a[e]).join(`$`);if(i){let e=c.appendChild(document.createElement(`a`));e.href=i(t.map(e=>a[e]).join(`$`)),e.appendChild(document.createTextNode(l))}else c.appendChild(document.createTextNode(l));for(let[e,t]of r){let n=o.appendChild(document.createElement(`td`)),r=s(e,t,{inline:!0},a);n.appendChild(r.root)}}}setData(e){this.#i=e,this.#l()}destroy(){}},E=class extends HTMLElement{static formAssociated=!0;#e=document.createElement(`div`);#t=this.attachInternals();constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`:host {
1
+ import{Ident as e,Menu as t,Page as n,PageIdent as r,PageSider as i,User as a,application as o,createComputed as s,createIcon as c,createShowField as l,createState as u,effect as d,filterPermission as f,neverAbortedSignal as p,root as m,runPattern as h,toFileLink as g,waitAbortSignal as _,watch as v}from"@yongdall/web";const y=`YongDallTheme`,b=`${y}-activity`,x=document.createElement(`div`);x.classList.add(b);const S=new Map;let C,w=!1;function T(e){w=e}var ee=e=>{let t=document.createElement(`div`);t.classList.add(`${b}-page`);let n=t.appendChild(document.createElement(`a`));n.classList.add(`${b}-title`),n.href=e.href,n.innerText=e.title;let r=t.appendChild(document.createElement(`button`));r.type=`button`,r.classList.add(`${b}-close`),r.addEventListener(`click`,()=>{e.destroy()});let i={button:t,link:n,next:C};C&&(C.last=i),C=i,S.set(e,i),x.insertBefore(t,w?null:x.firstChild),d(()=>{n.innerText=e.title},e.signal),d(()=>{n.href=e.href},e.signal),d(()=>{e.current?t.classList.add(`${b}-current`):t.classList.remove(`${b}-current`)},e.signal),d(()=>{e.loading?t.classList.add(`${b}-loading`):t.classList.remove(`${b}-loading`)},e.signal),d(()=>{e.unsaved?t.classList.add(`${b}-unsaved`):t.classList.remove(`${b}-unsaved`)},e.signal),_(e.signal).then(()=>{let{last:e,next:n}=i;e&&(e.next=n),n&&(n.last=e),C===i&&(C=n),t.remove()})},E=class{#e;#t;#n;#r;#i=[];#a=document.createElement(`table`);#o=this.#a.appendChild(document.createElement(`thead`));#s=this.#o.appendChild(document.createElement(`tr`));#c=this.#a.appendChild(document.createElement(`tbody`));get root(){return this.#a}get createUrl(){return this.#e}set createUrl(e){let t=typeof e==`function`?e:null;this.#e!==t&&(this.#e=t,this.#l())}constructor(e,t){let n=Object.entries(t.fields).filter(([,{type:e}])=>e&&typeof e!=`object`),r=Object.entries(t.fields).filter(([,e])=>e.primary).map(([e])=>e);this.#n=t.labelPattern||``,this.#e=typeof e==`function`?e:null,this.#t=n,this.#r=r;let i=this.#s;i.innerHTML=``,i.appendChild(document.createElement(`th`)).appendChild(document.createTextNode(`#`));for(let[e,t]of n)i.appendChild(document.createElement(`th`)).appendChild(document.createTextNode(t.label||e))}#l(){let e=this.#c;e.innerHTML=``;let t=this.#r,n=this.#n,r=this.#t,i=this.#e;for(let a of this.#i){let o=e.appendChild(document.createElement(`tr`)),s=o.appendChild(document.createElement(`td`)),c=h(n,a)||t.map(e=>a[e]).join(`$`);if(i){let e=s.appendChild(document.createElement(`a`));e.href=i(t.map(e=>a[e]).join(`$`)),e.appendChild(document.createTextNode(c))}else s.appendChild(document.createTextNode(c));for(let[e,t]of r){let n=o.appendChild(document.createElement(`td`)),r=l(e,t,{inline:!0},a);n.appendChild(r.root)}}}setData(e){this.#i=e,this.#l()}destroy(){}},D=class extends HTMLElement{static formAssociated=!0;#e=document.createElement(`div`);#t=this.attachInternals();constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`:host {
2
2
  display: inline-block;
3
3
  color: #000;
4
4
  margin: auto;
@@ -24,7 +24,7 @@ div {
24
24
  pointer-events: none;
25
25
  transform-origin: left;
26
26
  }
27
- `,e.appendChild(this.#e);let t=e=>{if(!(e.buttons&1))return;let{left:t,width:n,top:r,height:i}=this.getBoundingClientRect(),a=e.clientX-t-n/2,o=e.clientY-r-i/2,s=Math.atan2(o,a)/Math.PI*180;this.value=Math.round(s),this.dispatchEvent(new InputEvent(`input`)),this.dispatchEvent(new InputEvent(`change`))};this.addEventListener(`pointerdown`,t),this.addEventListener(`pointermove`,t),this.value=this.getAttribute(`value`)}#n=0;get value(){return this.#n}set value(e){let t=parseInt(String(e));Number.isFinite(t)&&(this.#n=t,this.#e.style.transform=`rotate(${t}deg)`,this.#t.setFormValue(String(t)))}connectedCallback(){this.getAttribute(`tabindex`)===null&&this.setAttribute(`tabindex`,`0`)}};try{customElements.define(`nl-angle`,E)}catch{}var D=class extends HTMLElement{static observedAttributes=[`separator`];#e=document.createElement(`style`);#t(e){if(e===null){this.#e.textContent=``;return}let t=`::slotted(*)::after {content: ${JSON.stringify(e)}; }`;this.#e.textContent=t}constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`::slotted(*)::after {content: var(--nl-breadcrumb-separator, ' / ');}`,e.appendChild(this.#e),e.appendChild(document.createElement(`style`)).textContent=`::slotted(:last-child)::after {content: none}`,e.appendChild(document.createElement(`slot`))}get separator(){return this.getAttribute(`separator`)}set separator(e){e==null?this.removeAttribute(`separator`):this.setAttribute(`separator`,e)}connectedCallback(){this.#t(this.separator)}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`separator`:this.#t(n);break}}};try{customElements.define(`nl-breadcrumb`,D)}catch{}var te=class extends HTMLElement{static observedAttributes=[`label`,`explain`];get label(){return this.getAttribute(`label`)||``}set label(e){e?this.setAttribute(`label`,e):this.removeAttribute(`label`)}get explain(){return this.getAttribute(`explain`)||``}set explain(e){e?this.setAttribute(`explain`,e):this.removeAttribute(`explain`)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=document.createElement(`div`);#t=document.createElement(`div`);constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
27
+ `,e.appendChild(this.#e);let t=e=>{if(!(e.buttons&1))return;let{left:t,width:n,top:r,height:i}=this.getBoundingClientRect(),a=e.clientX-t-n/2,o=e.clientY-r-i/2,s=Math.atan2(o,a)/Math.PI*180;this.value=Math.round(s),this.dispatchEvent(new InputEvent(`input`)),this.dispatchEvent(new InputEvent(`change`))};this.addEventListener(`pointerdown`,t),this.addEventListener(`pointermove`,t),this.value=this.getAttribute(`value`)}#n=0;get value(){return this.#n}set value(e){let t=parseInt(String(e));Number.isFinite(t)&&(this.#n=t,this.#e.style.transform=`rotate(${t}deg)`,this.#t.setFormValue(String(t)))}connectedCallback(){this.getAttribute(`tabindex`)===null&&this.setAttribute(`tabindex`,`0`)}};try{customElements.define(`nl-angle`,D)}catch{}var te=class extends HTMLElement{static observedAttributes=[`separator`];#e=document.createElement(`style`);#t(e){if(e===null){this.#e.textContent=``;return}let t=`::slotted(*)::after {content: ${JSON.stringify(e)}; }`;this.#e.textContent=t}constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`::slotted(*)::after {content: var(--nl-breadcrumb-separator, ' / ');}`,e.appendChild(this.#e),e.appendChild(document.createElement(`style`)).textContent=`::slotted(:last-child)::after {content: none}`,e.appendChild(document.createElement(`slot`))}get separator(){return this.getAttribute(`separator`)}set separator(e){e==null?this.removeAttribute(`separator`):this.setAttribute(`separator`,e)}connectedCallback(){this.#t(this.separator)}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`separator`:this.#t(n);break}}};try{customElements.define(`nl-breadcrumb`,te)}catch{}var ne=class extends HTMLElement{static observedAttributes=[`label`,`explain`];get label(){return this.getAttribute(`label`)||``}set label(e){e?this.setAttribute(`label`,e):this.removeAttribute(`label`)}get explain(){return this.getAttribute(`explain`)||``}set explain(e){e?this.setAttribute(`explain`,e):this.removeAttribute(`explain`)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=document.createElement(`div`);#t=document.createElement(`div`);constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
28
28
  [hidden]{
29
29
  display: none!important;
30
30
  }
@@ -91,13 +91,13 @@ div {
91
91
  display: block;
92
92
  }
93
93
 
94
- `,e.addEventListener(`click`,e=>{this.disabled&&(e.stopPropagation(),e.preventDefault())});let t=e.appendChild(document.createElement(`slot`));t.name=`icon`,t.className=`icon`,t.hidden=!t.assignedNodes().length,t.addEventListener(`slotchange`,e=>{t.hidden=!t.assignedNodes().length});let n=e.appendChild(document.createElement(`div`));n.className=`body`;let r=n.appendChild(this.#e);r.className=`label`;let i=n.appendChild(this.#t);i.setAttribute(`part`,`explain`),i.className=`explain`;let a=e.appendChild(document.createElement(`slot`));a.name=`extra`,a.className=`extra`,a.hidden=!a.assignedNodes().length,a.addEventListener(`slotchange`,e=>{a.hidden=!a.assignedNodes().length});let o=e.appendChild(document.createElement(`div`));o.className=`link`,o.setAttribute(`part`,`link`)}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`label`:this.#e.innerText=n||``;break;case`explain`:this.#t.innerText=n||``;break}}};try{customElements.define(`nl-cell`,te)}catch{}
94
+ `,e.addEventListener(`click`,e=>{this.disabled&&(e.stopPropagation(),e.preventDefault())});let t=e.appendChild(document.createElement(`slot`));t.name=`icon`,t.className=`icon`,t.hidden=!t.assignedNodes().length,t.addEventListener(`slotchange`,e=>{t.hidden=!t.assignedNodes().length});let n=e.appendChild(document.createElement(`div`));n.className=`body`;let r=n.appendChild(this.#e);r.className=`label`;let i=n.appendChild(this.#t);i.setAttribute(`part`,`explain`),i.className=`explain`;let a=e.appendChild(document.createElement(`slot`));a.name=`extra`,a.className=`extra`,a.hidden=!a.assignedNodes().length,a.addEventListener(`slotchange`,e=>{a.hidden=!a.assignedNodes().length});let o=e.appendChild(document.createElement(`div`));o.className=`link`,o.setAttribute(`part`,`link`)}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`label`:this.#e.innerText=n||``;break;case`explain`:this.#t.innerText=n||``;break}}};try{customElements.define(`nl-cell`,ne)}catch{}
95
95
  /*!
96
96
  * 匿龙组件库 @neeloong/components v0.7.0
97
97
  * (c) 2023-2024 猛火Fierflame
98
98
  * @license MIT
99
99
  */
100
- const ne=new Set([`vertical-lr`,`vertical-rl`,`sideways-lr`,`sideways-rl`]);function O(e,t,n){n?e.setAttribute(t,``):e.removeAttribute(t)}var re=class e extends HTMLElement{static observedAttributes=[`accordion`,`disabled`,`open`,`menu`,`animation`,`label`];get nonTrigger(){return this.getAttribute(`non-trigger`)!==null}set nonTrigger(e){O(this,`non-trigger`,e)}get startTrigger(){return this.getAttribute(`start-trigger`)!==null}set startTrigger(e){O(this,`start-trigger`,e)}get accordion(){return this.getAttribute(`accordion`)!==null}set accordion(e){O(this,`accordion`,e)}get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){O(this,`disabled`,e)}get open(){return this.getAttribute(`open`)!==null}set open(e){O(this,`open`,e)}get animation(){return this.getAttribute(`animation`)!==null}set animation(e){O(this,`animation`,e)}get menu(){return this.getAttribute(`menu`)!==null}set menu(e){O(this,`menu`,e)}get label(){return this.getAttribute(`label`)||``}set label(e){e?this.setAttribute(`label`,e):this.removeAttribute(`label`)}#e=(()=>{let e=this.attachShadow({mode:`closed`});return e.appendChild(document.createElement(`style`)).textContent=`
100
+ const re=new Set([`vertical-lr`,`vertical-rl`,`sideways-lr`,`sideways-rl`]);function O(e,t,n){n?e.setAttribute(t,``):e.removeAttribute(t)}var ie=class e extends HTMLElement{static observedAttributes=[`accordion`,`disabled`,`open`,`menu`,`animation`,`label`];get nonTrigger(){return this.getAttribute(`non-trigger`)!==null}set nonTrigger(e){O(this,`non-trigger`,e)}get startTrigger(){return this.getAttribute(`start-trigger`)!==null}set startTrigger(e){O(this,`start-trigger`,e)}get accordion(){return this.getAttribute(`accordion`)!==null}set accordion(e){O(this,`accordion`,e)}get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){O(this,`disabled`,e)}get open(){return this.getAttribute(`open`)!==null}set open(e){O(this,`open`,e)}get animation(){return this.getAttribute(`animation`)!==null}set animation(e){O(this,`animation`,e)}get menu(){return this.getAttribute(`menu`)!==null}set menu(e){O(this,`menu`,e)}get label(){return this.getAttribute(`label`)||``}set label(e){e?this.setAttribute(`label`,e):this.removeAttribute(`label`)}#e=(()=>{let e=this.attachShadow({mode:`closed`});return e.appendChild(document.createElement(`style`)).textContent=`
101
101
  :host {
102
102
  display: block;
103
103
  border: 1px solid #666;
@@ -166,15 +166,15 @@ main {
166
166
  :host([start-trigger]) header {
167
167
  flex-direction: row-reverse;
168
168
  }
169
- `,e})();#t=(()=>{let e=document.createElement(`header`);e.setAttribute(`part`,`header`),this.#e.appendChild(e),e.tabIndex=0;let t=t=>{this.disabled||this.#e.activeElement===e&&this.dispatchEvent(new Event(`beforechange`,{cancelable:!0}))&&(this.open=!this.open,this.dispatchEvent(new Event(`change`)))};return e.addEventListener(`click`,t),e.addEventListener(`keydown`,e=>{(e.code===`Enter`||e.code===`Space`)&&t()}),e})();#n=(()=>{let e=document.createElement(`slot`);return this.#t.appendChild(e),e.className=`label`,e.name=`label`,e})();#r=(()=>{let e=document.createElement(`slot`);return this.#t.appendChild(e),e.name=`trigger`,e.className=`trigger-slot`,e.appendChild(document.createElement(`span`)).className=`trigger`,e})();#i=(()=>{let e=document.createElement(`section`);return e.setAttribute(`part`,`main`),this.#e.appendChild(e),e})();#a=(()=>{let e=document.createElement(`main`);return this.#i.appendChild(e),e.appendChild(document.createElement(`slot`)),e})();#o(){let e=ne.has(getComputedStyle(this).writingMode?.toLowerCase());this.#i.style.blockSize=`${e?this.#a.clientWidth:this.#a.clientHeight}px`}updateSize(){this.#o()}#s=new ResizeObserver(()=>this.#o());connectedCallback(){this.#s.observe(this.#a)}disconnectedCallback(){this.#s.unobserve(this.#a)}adoptedCallback(){}#c(){let t=this.parentElement;if(!t)return;let n=getComputedStyle(t).whiteSpace?.toLowerCase()||``,r=n.startsWith(`pre`)||n===`break-spaces`,i=this;for(;i=i.previousSibling;)if(!(i instanceof Comment)){if(i instanceof Text){let e=i.textContent||``;if(r?e.includes(`
169
+ `,e})();#t=(()=>{let e=document.createElement(`header`);e.setAttribute(`part`,`header`),this.#e.appendChild(e),e.tabIndex=0;let t=t=>{this.disabled||this.#e.activeElement===e&&this.dispatchEvent(new Event(`beforechange`,{cancelable:!0}))&&(this.open=!this.open,this.dispatchEvent(new Event(`change`)))};return e.addEventListener(`click`,t),e.addEventListener(`keydown`,e=>{(e.code===`Enter`||e.code===`Space`)&&t()}),e})();#n=(()=>{let e=document.createElement(`slot`);return this.#t.appendChild(e),e.className=`label`,e.name=`label`,e})();#r=(()=>{let e=document.createElement(`slot`);return this.#t.appendChild(e),e.name=`trigger`,e.className=`trigger-slot`,e.appendChild(document.createElement(`span`)).className=`trigger`,e})();#i=(()=>{let e=document.createElement(`section`);return e.setAttribute(`part`,`main`),this.#e.appendChild(e),e})();#a=(()=>{let e=document.createElement(`main`);return this.#i.appendChild(e),e.appendChild(document.createElement(`slot`)),e})();#o(){let e=re.has(getComputedStyle(this).writingMode?.toLowerCase());this.#i.style.blockSize=`${e?this.#a.clientWidth:this.#a.clientHeight}px`}updateSize(){this.#o()}#s=new ResizeObserver(()=>this.#o());connectedCallback(){this.#s.observe(this.#a)}disconnectedCallback(){this.#s.unobserve(this.#a)}adoptedCallback(){}#c(){let t=this.parentElement;if(!t)return;let n=getComputedStyle(t).whiteSpace?.toLowerCase()||``,r=n.startsWith(`pre`)||n===`break-spaces`,i=this;for(;i=i.previousSibling;)if(!(i instanceof Comment)){if(i instanceof Text){let e=i.textContent||``;if(r?e.includes(`
170
170
  `):e.replace(/[\s\n ]/g,``))break;continue}if(!(i instanceof e)||!i.accordion)break;i.open=!1}for(i=this;i=i.nextSibling;)if(!(i instanceof Comment)){if(i instanceof Text){let e=i.textContent||``;if(r?e.includes(`
171
- `):e.replace(/[\s\n ]/g,``))break;continue}if(!(i instanceof e)||!i.accordion)break;i.open=!1}}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`accordion`:if(n===null||!this.open)break;this.#c();break;case`disabled`:n===null?this.#t.tabIndex=0:this.#t.removeAttribute(`tabindex`);break;case`open`:if(!this.accordion||!this.open)break;this.#c();break;case`label`:this.#n.innerText=n||``;break}}};try{customElements.define(`nl-collapse`,re)}catch{}
171
+ `):e.replace(/[\s\n ]/g,``))break;continue}if(!(i instanceof e)||!i.accordion)break;i.open=!1}}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`accordion`:if(n===null||!this.open)break;this.#c();break;case`disabled`:n===null?this.#t.tabIndex=0:this.#t.removeAttribute(`tabindex`);break;case`open`:if(!this.accordion||!this.open)break;this.#c();break;case`label`:this.#n.innerText=n||``;break}}};try{customElements.define(`nl-collapse`,ie)}catch{}
172
172
  /*!
173
173
  * 匿龙组件库 @neeloong/components v0.7.0
174
174
  * (c) 2023-2024 猛火Fierflame
175
175
  * @license MIT
176
176
  */
177
- const ie=typeof HTMLElement.prototype.showPopover==`function`;let ae=0;function oe(e){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`),n=document.createElementNS(`http://www.w3.org/2000/svg`,`defs`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`mask`),i=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),a=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),o=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),s=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),c=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),l=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),u=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),d=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),f=`nl-focus-mask:${ae++}`;return t.appendChild(n),n.appendChild(r),r.setAttribute(`id`,f),r.appendChild(i),i.setAttribute(`x`,`0`),i.setAttribute(`y`,`0`),i.setAttribute(`width`,`100vw`),i.setAttribute(`height`,`100vh`),i.setAttribute(`fill`,`white`),r.appendChild(a),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`width`,`100vw`),a.setAttribute(`height`,`100vh`),a.setAttribute(`fill`,`black`),t.appendChild(o),o.setAttribute(`x`,`0`),o.setAttribute(`y`,`0`),o.setAttribute(`width`,`100%`),o.setAttribute(`height`,`100%`),o.setAttribute(`fill`,`currentcolor`),o.setAttribute(`mask`,`url(#${f})`),t.appendChild(s),s.setAttribute(`pointer-events`,`auto`),s.setAttribute(`fill`,`transparent`),s.appendChild(c),c.setAttribute(`x`,`0`),c.setAttribute(`y`,`0`),c.setAttribute(`width`,`100%`),c.setAttribute(`height`,`100%`),s.appendChild(l),l.setAttribute(`x`,`0`),l.setAttribute(`y`,`0`),l.setAttribute(`width`,`100%`),l.setAttribute(`height`,`100%`),s.appendChild(u),u.setAttribute(`x`,`0`),u.setAttribute(`y`,`0`),u.setAttribute(`width`,`100%`),u.setAttribute(`height`,`100%`),s.appendChild(d),d.setAttribute(`x`,`0`),d.setAttribute(`y`,`0`),d.setAttribute(`width`,`100%`),d.setAttribute(`height`,`100%`),e.appendChild(t),{setRect(e,t,n,r){a.setAttribute(`x`,`${e}`),a.setAttribute(`y`,`${t}`),a.setAttribute(`width`,`${n}`),a.setAttribute(`height`,`${r}`),c.setAttribute(`width`,`${e}`),l.setAttribute(`height`,`${t}`),u.setAttribute(`x`,`${e+n}`),d.setAttribute(`y`,`${t+r}`)}}}var se=class extends HTMLElement{static observedAttributes=[`hidden`,`target`,`x`,`y`,`width`,`height`];get x(){return parseFloat(this.getAttribute(`x`)||``)||0}set x(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`x`,String(e)):this.removeAttribute(`x`)}get y(){return parseFloat(this.getAttribute(`y`)||``)||0}set y(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`y`,String(e)):this.removeAttribute(`y`)}get width(){return parseFloat(this.getAttribute(`width`)||``)||0}set width(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`width`,String(e)):this.removeAttribute(`width`)}get height(){return parseFloat(this.getAttribute(`height`)||``)||0}set height(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`height`,String(e)):this.removeAttribute(`height`)}get target(){return this.getAttribute(`target`)}set target(e){typeof e==`string`?this.setAttribute(`target`,e):this.removeAttribute(`target`)}#e=(()=>{let e=this.attachShadow({mode:`closed`});return e.appendChild(document.createElement(`style`)).textContent=`
177
+ const ae=typeof HTMLElement.prototype.showPopover==`function`;let oe=0;function se(e){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`),n=document.createElementNS(`http://www.w3.org/2000/svg`,`defs`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`mask`),i=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),a=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),o=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),s=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),c=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),l=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),u=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),d=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),f=`nl-focus-mask:${oe++}`;return t.appendChild(n),n.appendChild(r),r.setAttribute(`id`,f),r.appendChild(i),i.setAttribute(`x`,`0`),i.setAttribute(`y`,`0`),i.setAttribute(`width`,`100vw`),i.setAttribute(`height`,`100vh`),i.setAttribute(`fill`,`white`),r.appendChild(a),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`width`,`100vw`),a.setAttribute(`height`,`100vh`),a.setAttribute(`fill`,`black`),t.appendChild(o),o.setAttribute(`x`,`0`),o.setAttribute(`y`,`0`),o.setAttribute(`width`,`100%`),o.setAttribute(`height`,`100%`),o.setAttribute(`fill`,`currentcolor`),o.setAttribute(`mask`,`url(#${f})`),t.appendChild(s),s.setAttribute(`pointer-events`,`auto`),s.setAttribute(`fill`,`transparent`),s.appendChild(c),c.setAttribute(`x`,`0`),c.setAttribute(`y`,`0`),c.setAttribute(`width`,`100%`),c.setAttribute(`height`,`100%`),s.appendChild(l),l.setAttribute(`x`,`0`),l.setAttribute(`y`,`0`),l.setAttribute(`width`,`100%`),l.setAttribute(`height`,`100%`),s.appendChild(u),u.setAttribute(`x`,`0`),u.setAttribute(`y`,`0`),u.setAttribute(`width`,`100%`),u.setAttribute(`height`,`100%`),s.appendChild(d),d.setAttribute(`x`,`0`),d.setAttribute(`y`,`0`),d.setAttribute(`width`,`100%`),d.setAttribute(`height`,`100%`),e.appendChild(t),{setRect(e,t,n,r){a.setAttribute(`x`,`${e}`),a.setAttribute(`y`,`${t}`),a.setAttribute(`width`,`${n}`),a.setAttribute(`height`,`${r}`),c.setAttribute(`width`,`${e}`),l.setAttribute(`height`,`${t}`),u.setAttribute(`x`,`${e+n}`),d.setAttribute(`y`,`${t+r}`)}}}var ce=class extends HTMLElement{static observedAttributes=[`hidden`,`target`,`x`,`y`,`width`,`height`];get x(){return parseFloat(this.getAttribute(`x`)||``)||0}set x(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`x`,String(e)):this.removeAttribute(`x`)}get y(){return parseFloat(this.getAttribute(`y`)||``)||0}set y(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`y`,String(e)):this.removeAttribute(`y`)}get width(){return parseFloat(this.getAttribute(`width`)||``)||0}set width(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`width`,String(e)):this.removeAttribute(`width`)}get height(){return parseFloat(this.getAttribute(`height`)||``)||0}set height(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`height`,String(e)):this.removeAttribute(`height`)}get target(){return this.getAttribute(`target`)}set target(e){typeof e==`string`?this.setAttribute(`target`,e):this.removeAttribute(`target`)}#e=(()=>{let e=this.attachShadow({mode:`closed`});return e.appendChild(document.createElement(`style`)).textContent=`
178
178
  :host {
179
179
  display: contents;
180
180
  color: inherit;
@@ -200,7 +200,7 @@ svg {
200
200
  inset: 0;
201
201
  pointer-events: none;
202
202
  }
203
- `,e})();#t=this.#e.appendChild(document.createElement(`div`));#n=oe(this.#t);#r=this.attachInternals();#i=null;get targetElement(){return this.#i}set targetElement(e){this.#i=e instanceof Element?e:null}#a=!1;#o=!1;#s(){this.#a&&=(this.#t.removeAttribute(`popover`),!1)}#c(){if(!(this.#a||!this.#o)){if(ie){let e=this.#t;e.popover=`manual`,e.showPopover()}this.update(),this.#a=!0}}#l(){let e=this.#i;if(e)return e;let{target:t}=this;if(t===``)return this.parentElement;if(!t)return null;try{return document.querySelector(t)}catch{}return null}update(){if(!this.#o)return;let{left:e,top:t,width:n,height:r}=this.#l()?.getBoundingClientRect()||{top:this.y,left:this.x,width:this.width,height:this.height};this.#n.setRect(e,t,n,r)}connectedCallback(){this.#o=!0,!this.hidden&&this.#c()}disconnectedCallback(){this.#o=!1}attributeChangedCallback(e,t,n){if(this.#o&&t!==n)switch(e){case`hidden`:n===null?this.#c():this.#s();break;case`target`:case`x`:case`y`:case`width`:case`height`:this.update();break}}};try{customElements.define(`nl-focus`,se)}catch{}var ce=class extends HTMLElement{static observedAttributes=[`radius`,`unit`];get radius(){let e=parseFloat(this.getAttribute(`radius`)||``);return Number.isNaN(e)||!Number.isFinite(e)?0:e<0?-1:e}set radius(e){typeof e!=`number`||!Number.isFinite(e)?this.removeAttribute(`radius`):this.setAttribute(`radius`,e<0?`-1`:String(e))}get unit(){return this.getAttribute(`unit`)||`px`}set unit(e){e?this.setAttribute(`unit`,e):this.removeAttribute(`unit`)}get long(){return this.hasAttribute(`nl-long`)}set long(e){e?this.setAttribute(`nl-long`,``):this.removeAttribute(`nl-long`)}get column(){return this.hasAttribute(`column`)}set column(e){e?this.setAttribute(`column`,``):this.removeAttribute(`column`)}#e=document.createElement(`style`);constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
203
+ `,e})();#t=this.#e.appendChild(document.createElement(`div`));#n=se(this.#t);#r=this.attachInternals();#i=null;get targetElement(){return this.#i}set targetElement(e){this.#i=e instanceof Element?e:null}#a=!1;#o=!1;#s(){this.#a&&=(this.#t.removeAttribute(`popover`),!1)}#c(){if(!(this.#a||!this.#o)){if(ae){let e=this.#t;e.popover=`manual`,e.showPopover()}this.update(),this.#a=!0}}#l(){let e=this.#i;if(e)return e;let{target:t}=this;if(t===``)return this.parentElement;if(!t)return null;try{return document.querySelector(t)}catch{}return null}update(){if(!this.#o)return;let{left:e,top:t,width:n,height:r}=this.#l()?.getBoundingClientRect()||{top:this.y,left:this.x,width:this.width,height:this.height};this.#n.setRect(e,t,n,r)}connectedCallback(){this.#o=!0,!this.hidden&&this.#c()}disconnectedCallback(){this.#o=!1}attributeChangedCallback(e,t,n){if(this.#o&&t!==n)switch(e){case`hidden`:n===null?this.#c():this.#s();break;case`target`:case`x`:case`y`:case`width`:case`height`:this.update();break}}};try{customElements.define(`nl-focus`,ce)}catch{}var le=class extends HTMLElement{static observedAttributes=[`radius`,`unit`];get radius(){let e=parseFloat(this.getAttribute(`radius`)||``);return Number.isNaN(e)||!Number.isFinite(e)?0:e<0?-1:e}set radius(e){typeof e!=`number`||!Number.isFinite(e)?this.removeAttribute(`radius`):this.setAttribute(`radius`,e<0?`-1`:String(e))}get unit(){return this.getAttribute(`unit`)||`px`}set unit(e){e?this.setAttribute(`unit`,e):this.removeAttribute(`unit`)}get long(){return this.hasAttribute(`nl-long`)}set long(e){e?this.setAttribute(`nl-long`,``):this.removeAttribute(`nl-long`)}get column(){return this.hasAttribute(`column`)}set column(e){e?this.setAttribute(`column`,``):this.removeAttribute(`column`)}#e=document.createElement(`style`);constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
204
204
  :host {
205
205
  display: inline-flex;
206
206
  flex-direction: row;
@@ -243,13 +243,13 @@ slot {
243
243
  ::slotted([nl-long]) {
244
244
  flex: 100000;
245
245
  }
246
- `,e.appendChild(this.#e),e.appendChild(document.createElement(`slot`)),this.#t()}#t(){let{radius:e}=this,t=e>=0?`${e}${this.unit}`:`50%`;this.#e.textContent=`:host {border-radius: var(--nl-group-radius, ${t})}`}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`radius`:case`unit`:this.#t();break}}};try{customElements.define(`nl-group`,ce)}catch{}
246
+ `,e.appendChild(this.#e),e.appendChild(document.createElement(`slot`)),this.#t()}#t(){let{radius:e}=this,t=e>=0?`${e}${this.unit}`:`50%`;this.#e.textContent=`:host {border-radius: var(--nl-group-radius, ${t})}`}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`radius`:case`unit`:this.#t();break}}};try{customElements.define(`nl-group`,le)}catch{}
247
247
  /*!
248
248
  * 匿龙组件库 @neeloong/components v0.7.0
249
249
  * (c) 2023-2024 猛火Fierflame
250
250
  * @license MIT
251
251
  */
252
- const le=new Set;document.addEventListener(`pointerdown`,e=>{if(!e.isPrimary)return;let t=new Set(e.composedPath());for(let e of[...le])t.has(e)||e.close()});const ue=new Set([`vertical-lr`,`vertical-rl`,`sideways-lr`,`sideways-rl`]),de=typeof HTMLElement.prototype.showPopover==`function`;function fe({left:e,top:t,width:n,height:r},i,a,o){let s=window.innerWidth-e-n,c=window.innerHeight-t-r,l=[[e,n,s],[t,r,c]];return i&&l.reverse(),a&&l[1].reverse(),o&&l[0].reverse(),l}const pe=[`blockEnd`,`blockStart`,`inlineEnd`,`inlineStart`],me=[`start`,`end`,`center`],he=[`inlineEnd`,`inlineStart`],ge=[`start`,`end`];function _e(e){let t=[];function n(e){t.includes(e)||t.push(e)}for(let t of(e||``).replace(/\n|\s|-/g,``).toLowerCase().split(/,/))(t===`inlineend`||t===`inline`)&&n(`inlineEnd`),(t===`inlinestart`||t===`inline`)&&n(`inlineStart`),(t===`blockend`||t===`block`)&&n(`blockEnd`),(t===`blockstart`||t===`block`)&&n(`blockStart`);return t.length?t:pe}function ve(e){let t=[];for(let n of(e||``).replace(/\n|\s|-/g,``).toLowerCase().split(/,/))[`start`,`end`,`center`].includes(n)&&(t.includes(n)||t.push(n));return t.length?t:me}function ye(e){let t=getComputedStyle(e),n=t.writingMode?.toLowerCase();return[ue.has(n),[`vertical-rl`,`sideways-rl`].includes(n),t.direction.toLowerCase()===`rtl`!=(n===`sideways-lr`)]}var be=class e extends HTMLElement{static observedAttributes=[`open`,`hidden`,`target`,`x`,`y`,`direction`,`align`,`mask`,`disabled`];close(){this.removeAttribute(`open`)}show(){this.setAttribute(`open`,``)}get open(){return this.hasAttribute(`open`)}set open(e){e?this.show():this.close()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get mask(){return this.hasAttribute(`mask`)}set mask(e){e?this.setAttribute(`mask`,``):this.removeAttribute(`mask`)}get x(){return parseFloat(this.getAttribute(`x`)||``)||0}set x(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`x`,String(e)):this.removeAttribute(`x`)}get y(){return parseFloat(this.getAttribute(`y`)||``)||0}set y(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`y`,String(e)):this.removeAttribute(`y`)}get target(){return this.getAttribute(`target`)}set target(e){typeof e==`string`?this.setAttribute(`target`,e):this.removeAttribute(`target`)}#e=pe;#t=me;get direction(){return[...this.#e]}set direction(e){let t=Array.isArray(e)?e.filter(Boolean).join(`,`):e;t!==null&&typeof t!=`string`||(t?this.setAttribute(`direction`,t):this.removeAttribute(`direction`))}get align(){return[...this.#t]}set align(e){let t=Array.isArray(e)?e.filter(Boolean).join(`,`):e;t!==null&&typeof t!=`string`||(t?this.setAttribute(`direction`,t):this.removeAttribute(`direction`))}#n=document.createElement(`div`);#r=document.createElement(`dialog`);#i=this.attachInternals();#a=this;constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
252
+ const ue=new Set;document.addEventListener(`pointerdown`,e=>{if(!e.isPrimary)return;let t=new Set(e.composedPath());for(let e of[...ue])t.has(e)||e.close()});const de=new Set([`vertical-lr`,`vertical-rl`,`sideways-lr`,`sideways-rl`]),fe=typeof HTMLElement.prototype.showPopover==`function`;function pe({left:e,top:t,width:n,height:r},i,a,o){let s=window.innerWidth-e-n,c=window.innerHeight-t-r,l=[[e,n,s],[t,r,c]];return i&&l.reverse(),a&&l[1].reverse(),o&&l[0].reverse(),l}const me=[`blockEnd`,`blockStart`,`inlineEnd`,`inlineStart`],he=[`start`,`end`,`center`],ge=[`inlineEnd`,`inlineStart`],_e=[`start`,`end`];function ve(e){let t=[];function n(e){t.includes(e)||t.push(e)}for(let t of(e||``).replace(/\n|\s|-/g,``).toLowerCase().split(/,/))(t===`inlineend`||t===`inline`)&&n(`inlineEnd`),(t===`inlinestart`||t===`inline`)&&n(`inlineStart`),(t===`blockend`||t===`block`)&&n(`blockEnd`),(t===`blockstart`||t===`block`)&&n(`blockStart`);return t.length?t:me}function ye(e){let t=[];for(let n of(e||``).replace(/\n|\s|-/g,``).toLowerCase().split(/,/))[`start`,`end`,`center`].includes(n)&&(t.includes(n)||t.push(n));return t.length?t:he}function be(e){let t=getComputedStyle(e),n=t.writingMode?.toLowerCase();return[de.has(n),[`vertical-rl`,`sideways-rl`].includes(n),t.direction.toLowerCase()===`rtl`!=(n===`sideways-lr`)]}var xe=class e extends HTMLElement{static observedAttributes=[`open`,`hidden`,`target`,`x`,`y`,`direction`,`align`,`mask`,`disabled`];close(){this.removeAttribute(`open`)}show(){this.setAttribute(`open`,``)}get open(){return this.hasAttribute(`open`)}set open(e){e?this.show():this.close()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get mask(){return this.hasAttribute(`mask`)}set mask(e){e?this.setAttribute(`mask`,``):this.removeAttribute(`mask`)}get x(){return parseFloat(this.getAttribute(`x`)||``)||0}set x(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`x`,String(e)):this.removeAttribute(`x`)}get y(){return parseFloat(this.getAttribute(`y`)||``)||0}set y(e){e&&typeof e==`number`&&Number.isFinite(e)?this.setAttribute(`y`,String(e)):this.removeAttribute(`y`)}get target(){return this.getAttribute(`target`)}set target(e){typeof e==`string`?this.setAttribute(`target`,e):this.removeAttribute(`target`)}#e=me;#t=he;get direction(){return[...this.#e]}set direction(e){let t=Array.isArray(e)?e.filter(Boolean).join(`,`):e;t!==null&&typeof t!=`string`||(t?this.setAttribute(`direction`,t):this.removeAttribute(`direction`))}get align(){return[...this.#t]}set align(e){let t=Array.isArray(e)?e.filter(Boolean).join(`,`):e;t!==null&&typeof t!=`string`||(t?this.setAttribute(`direction`,t):this.removeAttribute(`direction`))}#n=document.createElement(`div`);#r=document.createElement(`dialog`);#i=this.attachInternals();#a=this;constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
253
253
  :host {
254
254
  display: contents;
255
255
  }
@@ -303,13 +303,13 @@ div.open, div:hover, div:focus, dialog ::slotted(:hover), dialog ::slotted(:focu
303
303
  dialog::backdrop {
304
304
  background: transparent;
305
305
  }
306
- `;let t=e.appendChild(this.#n);t.appendChild(document.createElement(`slot`)).name=`label`,t.addEventListener(`pointerenter`,e=>{this.#u&&e.isPrimary&&this.#f()}),t.addEventListener(`click`,e=>{e.stopPropagation()});let n=e.appendChild(this.#r);n.setAttribute(`part`,`menu`);let r=n.appendChild(document.createElement(`slot`));n.addEventListener(`click`,e=>{if(this.#u)return;let t=e.composedPath(),r=t.indexOf(n);r>=0&&t.slice(0,r).find(e=>e instanceof Element&&e.getAttribute(`disabled`)!==null||e instanceof HTMLHRElement)||this.close()}),n.addEventListener(`close`,e=>{this.close()}),r.addEventListener(`pointermove`,e=>{if(!e.isPrimary)return;let t=this.#l;t&&(e.composedPath().includes(t)||t.#d())}),n.addEventListener(`scroll`,e=>{if(!this.#c)return;let t=this.#l;t&&t.#_()}),this.addEventListener(`contextmenu`,e=>{e.stopPropagation(),e.preventDefault()},{capture:!0})}#o=null;get targetElement(){return this.#o}set targetElement(e){this.#o=e instanceof Element?e:null}#s=!1;#c=!1;#l=null;#u=null;get parentMenu(){return this.#u}#d(){if(!this.#s)return;let e=this.#l;e&&e.#d();let t=this.#u;t&&t.#l===this?t.#l=null:le.delete(this);let n=this.#r;n.close(),this.#i.states?.delete(`--open`),this.#n.classList.remove(`open`),n.removeAttribute(`popover`),this.#s=!1}#f(){if(this.#s||!this.#c)return;let e=this.#u,t=this.#r;if(e){if(!e.#s||this.disabled)return;let n=e.#l;n&&n.#d(),e.#l=this,de?(t.popover=`manual`,t.showPopover()):t.show()}else{this.#v();let e=this.#l;e&&e.#d(),de&&!this.hasAttribute(`mask`)?(t.popover=`manual`,t.showPopover(),le.add(this)):t.showModal()}this.#n.classList.add(`open`),this.#i.states?.add(`--open`),requestAnimationFrame(()=>{this.#c&&this.#_()}),this.#s=!0}#p=!1;#m=!1;#h=!1;#g(){if(this.#u)return this.#n;let e=this.#o;if(e)return e;let{target:t}=this;if(t===``)return this.parentElement;if(!t)return null;try{return document.querySelector(t)}catch{}return null}#_(){if(!this.#c)return;let e=this.#r,t=this.#g(),n=this.#a,r=n.#p,i=fe(t?.getBoundingClientRect()||{top:this.y,left:this.x,width:0,height:0},n.#p,n.#m,n.#h),[[a,o,s],[c,l,u]]=i,[d,f]=this.#u?[he,ge]:[this.#e,this.#t],p=e.getBoundingClientRect(),m=r?p.height:p.width,h=r?p.width:p.height,[g]=d.map(e=>{switch(e){case`blockStart`:return[e,c/h,1];case`blockEnd`:return[e,u/h,1];case`inlineStart`:return[e,1,a/m];default:return[`inlineEnd`,1,s/m]}}).reduce((e,t)=>e[1]<1&&t[1]<1?e[1]>=t[1]?e:t:e[1]>=1&&t[1]<1?e:t[1]>=1&&e[1]<1?t:e[2]>=1||e[2]>=t[2]?e:t),_=g===`blockEnd`||g===`blockStart`;_&&i.reverse();let[[v,y,ee],[b,x,S]]=i,[C,w]=_?[m,h]:[h,m],T=f.find(e=>e===`start`?x+S>C:e===`end`?x+b>C:!0)||``,E=g===`inlineStart`||g===`blockStart`?v-w:v+y,D=0;switch(T){case`start`:D=b;break;case`end`:D=b+x-C;break;default:D=Math.max(18,Math.min(b+x/2-C/2,b+x+S-18-C));break}_&&([E,D]=[D,E]),e.style.insetBlockStart=`${D}px`,e.style.insetInlineStart=`${E}px`;let te=this.#l;te&&te.#_()}update(){if(this.#c)return this.#_()}#v(){let[e,t,n]=ye(this);this.#p=e,this.#m=t,this.#h=n}connectedCallback(){this.#c=!0;let t=this.parentNode,n=t instanceof e?t:null;this.#u=n,this.#a=n?n.#a:this,this.#n.hidden=!n,!this.hidden&&n&&n.#s&&this.#f()}disconnectedCallback(){this.close(),this.#a=this,this.#c=!1,this.#u=null}attributeChangedCallback(e,t,n){if(this.#c&&t!==n)switch(e){case`disabled`:this.#c&&this.open&&n!==null&&this.close();break;case`open`:!this.#u&&!this.hidden&&(n===null?this.#d():this.#f());break;case`mask`:if(n!==null){let e=this.#r;e.getAttribute(`popover`)!==null&&(e.removeAttribute(`popover`),this.close())}break;case`hidden`:n===null?this.open&&!this.#u&&this.#f():this.#d();break;case`direction`:this.#e=_e(n),this.#c&&!this.#u&&this.#_();break;case`align`:this.#t=ve(n),this.#c&&!this.#u&&this.#_();break;case`target`:case`x`:case`y`:this.#c&&!this.#u&&this.#_();break}}};try{customElements.define(`nl-menu`,be)}catch{}
306
+ `;let t=e.appendChild(this.#n);t.appendChild(document.createElement(`slot`)).name=`label`,t.addEventListener(`pointerenter`,e=>{this.#u&&e.isPrimary&&this.#f()}),t.addEventListener(`click`,e=>{e.stopPropagation()});let n=e.appendChild(this.#r);n.setAttribute(`part`,`menu`);let r=n.appendChild(document.createElement(`slot`));n.addEventListener(`click`,e=>{if(this.#u)return;let t=e.composedPath(),r=t.indexOf(n);r>=0&&t.slice(0,r).find(e=>e instanceof Element&&e.getAttribute(`disabled`)!==null||e instanceof HTMLHRElement)||this.close()}),n.addEventListener(`close`,e=>{this.close()}),r.addEventListener(`pointermove`,e=>{if(!e.isPrimary)return;let t=this.#l;t&&(e.composedPath().includes(t)||t.#d())}),n.addEventListener(`scroll`,e=>{if(!this.#c)return;let t=this.#l;t&&t.#_()}),this.addEventListener(`contextmenu`,e=>{e.stopPropagation(),e.preventDefault()},{capture:!0})}#o=null;get targetElement(){return this.#o}set targetElement(e){this.#o=e instanceof Element?e:null}#s=!1;#c=!1;#l=null;#u=null;get parentMenu(){return this.#u}#d(){if(!this.#s)return;let e=this.#l;e&&e.#d();let t=this.#u;t&&t.#l===this?t.#l=null:ue.delete(this);let n=this.#r;n.close(),this.#i.states?.delete(`--open`),this.#n.classList.remove(`open`),n.removeAttribute(`popover`),this.#s=!1}#f(){if(this.#s||!this.#c)return;let e=this.#u,t=this.#r;if(e){if(!e.#s||this.disabled)return;let n=e.#l;n&&n.#d(),e.#l=this,fe?(t.popover=`manual`,t.showPopover()):t.show()}else{this.#v();let e=this.#l;e&&e.#d(),fe&&!this.hasAttribute(`mask`)?(t.popover=`manual`,t.showPopover(),ue.add(this)):t.showModal()}this.#n.classList.add(`open`),this.#i.states?.add(`--open`),requestAnimationFrame(()=>{this.#c&&this.#_()}),this.#s=!0}#p=!1;#m=!1;#h=!1;#g(){if(this.#u)return this.#n;let e=this.#o;if(e)return e;let{target:t}=this;if(t===``)return this.parentElement;if(!t)return null;try{return document.querySelector(t)}catch{}return null}#_(){if(!this.#c)return;let e=this.#r,t=this.#g(),n=this.#a,r=n.#p,i=pe(t?.getBoundingClientRect()||{top:this.y,left:this.x,width:0,height:0},n.#p,n.#m,n.#h),[[a,o,s],[c,l,u]]=i,[d,f]=this.#u?[ge,_e]:[this.#e,this.#t],p=e.getBoundingClientRect(),m=r?p.height:p.width,h=r?p.width:p.height,[g]=d.map(e=>{switch(e){case`blockStart`:return[e,c/h,1];case`blockEnd`:return[e,u/h,1];case`inlineStart`:return[e,1,a/m];default:return[`inlineEnd`,1,s/m]}}).reduce((e,t)=>e[1]<1&&t[1]<1?e[1]>=t[1]?e:t:e[1]>=1&&t[1]<1?e:t[1]>=1&&e[1]<1?t:e[2]>=1||e[2]>=t[2]?e:t),_=g===`blockEnd`||g===`blockStart`;_&&i.reverse();let[[v,y,b],[x,S,C]]=i,[w,T]=_?[m,h]:[h,m],ee=f.find(e=>e===`start`?S+C>w:e===`end`?S+x>w:!0)||``,E=g===`inlineStart`||g===`blockStart`?v-T:v+y,D=0;switch(ee){case`start`:D=x;break;case`end`:D=x+S-w;break;default:D=Math.max(18,Math.min(x+S/2-w/2,x+S+C-18-w));break}_&&([E,D]=[D,E]),e.style.insetBlockStart=`${D}px`,e.style.insetInlineStart=`${E}px`;let te=this.#l;te&&te.#_()}update(){if(this.#c)return this.#_()}#v(){let[e,t,n]=be(this);this.#p=e,this.#m=t,this.#h=n}connectedCallback(){this.#c=!0;let t=this.parentNode,n=t instanceof e?t:null;this.#u=n,this.#a=n?n.#a:this,this.#n.hidden=!n,!this.hidden&&n&&n.#s&&this.#f()}disconnectedCallback(){this.close(),this.#a=this,this.#c=!1,this.#u=null}attributeChangedCallback(e,t,n){if(this.#c&&t!==n)switch(e){case`disabled`:this.#c&&this.open&&n!==null&&this.close();break;case`open`:!this.#u&&!this.hidden&&(n===null?this.#d():this.#f());break;case`mask`:if(n!==null){let e=this.#r;e.getAttribute(`popover`)!==null&&(e.removeAttribute(`popover`),this.close())}break;case`hidden`:n===null?this.open&&!this.#u&&this.#f():this.#d();break;case`direction`:this.#e=ve(n),this.#c&&!this.#u&&this.#_();break;case`align`:this.#t=ye(n),this.#c&&!this.#u&&this.#_();break;case`target`:case`x`:case`y`:this.#c&&!this.#u&&this.#_();break}}};try{customElements.define(`nl-menu`,xe)}catch{}
307
307
  /*!
308
308
  * 匿龙组件库 @neeloong/components v0.7.0
309
309
  * (c) 2023-2024 猛火Fierflame
310
310
  * @license MIT
311
311
  */
312
- const k=[];function xe(e){let t=getComputedStyle(e).writingMode?.toLowerCase();return[`vertical-lr`,`sideways-lr`].includes(t)?1:[`vertical-rl`,`sideways-rl`].includes(t)?2:0}function Se(){let e=[0,0,0,0];for(let{element:t}of k){let n=xe(t),r=t.classList.contains(`open`);r&&(e[n]+=20),t.style.insetBlockStart=`${e[n]}px`,r&&(e[n]+=n%3?t.clientWidth:t.clientHeight)}}const Ce=new ResizeObserver(function(){Se()});var we=class extends HTMLElement{static observedAttributes=[`open`,`hidden`,`duration`];get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get closable(){return this.hasAttribute(`closable`)}set closable(e){e?this.setAttribute(`closable`,``):this.removeAttribute(`closable`)}get duration(){let e=parseFloat(this.getAttribute(`duration`)||``);return Number.isNaN(e)?1.5:e<=0?1/0:Number.isFinite(e)?e:1.5}set duration(e){typeof e!=`number`||!Number.isFinite(e)?this.removeAttribute(`duration`):e<=0||!Number.isFinite(e)?this.setAttribute(`duration`,`0`):this.setAttribute(`duration`,String(e))}#e=document.createElement(`style`);#t=document.createElement(`section`);#n={element:this.#t};#r=!1;#i=null;#a=this.attachInternals();constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
312
+ const k=[];function Se(e){let t=getComputedStyle(e).writingMode?.toLowerCase();return[`vertical-lr`,`sideways-lr`].includes(t)?1:[`vertical-rl`,`sideways-rl`].includes(t)?2:0}function Ce(){let e=[0,0,0,0];for(let{element:t}of k){let n=Se(t),r=t.classList.contains(`open`);r&&(e[n]+=20),t.style.insetBlockStart=`${e[n]}px`,r&&(e[n]+=n%3?t.clientWidth:t.clientHeight)}}const we=new ResizeObserver(function(){Ce()});var Te=class extends HTMLElement{static observedAttributes=[`open`,`hidden`,`duration`];get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get closable(){return this.hasAttribute(`closable`)}set closable(e){e?this.setAttribute(`closable`,``):this.removeAttribute(`closable`)}get duration(){let e=parseFloat(this.getAttribute(`duration`)||``);return Number.isNaN(e)?1.5:e<=0?1/0:Number.isFinite(e)?e:1.5}set duration(e){typeof e!=`number`||!Number.isFinite(e)?this.removeAttribute(`duration`):e<=0||!Number.isFinite(e)?this.setAttribute(`duration`,`0`):this.setAttribute(`duration`,String(e))}#e=document.createElement(`style`);#t=document.createElement(`section`);#n={element:this.#t};#r=!1;#i=null;#a=this.attachInternals();constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
313
313
  :host {
314
314
  transition-property: none;
315
315
  transition-duration: .5s;
@@ -390,7 +390,7 @@ slot {
390
390
  transform: rotate(-45deg);
391
391
  }
392
392
 
393
- `,e.appendChild(this.#e);let t=e.appendChild(this.#t);t.popover=`manual`,t.setAttribute(`part`,`message`),t.appendChild(document.createElement(`slot`)).setAttribute(`part`,`slot`);let n=t.appendChild(document.createElement(`div`));n.className=`close`,n.addEventListener(`click`,e=>{this.#o(e)}),n.setAttribute(`part`,`close`),n.tabIndex=0,n.addEventListener(`keydown`,e=>{[`Enter`,`Space`].includes(e.code)&&this.#o(e)}),t.addEventListener(`transitionend`,e=>{e.propertyName===`opacity`&&(t.classList.contains(`open`)||this.#p())})}#o(e){e?.defaultPrevented||this.open&&this.dispatchEvent(new Event(`beforeclose`,{cancelable:!0}))&&(this.open=!1,this.dispatchEvent(new Event(`close`)))}#s=!1;#c(){let e=this.#i;e!==null&&(clearTimeout(e),this.#i=null)}#l(){this.#c();let{duration:e}=this;e!==1/0&&(this.#i=setTimeout(()=>{this.#i=null,this.open=!1},e*1e3))}#u(){if(this.#s)return;this.#s=!0;let e=0,t=xe(this.#t);for(let{element:n}of k)n.classList.contains(`open`)&&xe(n)===t&&(e+=(t%3?n.clientWidth:n.clientHeight)+20);let n=this.#t;n.style.insetBlockStart=`${e}px`,n.showPopover?.(),n.classList.add(`shown`),this.#a.states?.add(`--shown`),n.setAttribute(`part`,`message shown`),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.#s&&n.classList.contains(`shown`)&&(n.classList.add(`open`),this.#a.states?.add(`--open`),this.#l(),Ce.observe(n),k.push(this.#n),Se())})})}#d(){let e=k.indexOf(this.#n);e<0||(k.splice(e,1),!(e>=k.length)&&Se())}#f(){if(!this.#s)return;this.#s=!1,this.#c();let e=this.#t;e.classList.remove(`open`),this.#a.states?.delete(`--open`),Ce.unobserve(e),Se()}#p(){this.#d();let e=this.#t;e.hidePopover?.(),this.#a.states?.delete(`--shown`),e.classList.remove(`shown`),e.setAttribute(`part`,`message`)}connectedCallback(){this.#r=!0,!this.hidden&&this.open&&this.#u()}disconnectedCallback(){this.#r=!1,this.#f(),this.#p()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`hidden`:case`open`:this.#r&&(!this.hidden&&this.open?this.#u():this.#f());break;case`duration`:this.#l();break}}};try{customElements.define(`nl-message`,we)}catch{}function A(e,t,n){n?e.setAttribute(t,``):e.removeAttribute(t)}var Te=class extends HTMLElement{static observedAttributes=[`hidden`,`open`,`disabled`,`size`,`position`];get open(){return this.hasAttribute(`open`)}set open(e){A(this,`open`,e)}get cancelable(){return this.hasAttribute(`cancelable`)}set cancelable(e){A(this,`cancelable`,e)}get closable(){return this.hasAttribute(`closable`)}set closable(e){A(this,`closable`,e)}get mask(){return this.hasAttribute(`mask`)}set mask(e){A(this,`mask`,e)}get maskClosable(){return this.hasAttribute(`mask-closable`)}set maskClosable(e){A(this,`mask-closable`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){A(this,`disabled`,e)}get size(){return this.getAttribute(`size`)||``}set size(e){e?this.setAttribute(`size`,e):this.removeAttribute(`size`)}get position(){let e=this.getAttribute(`position`)||``;return[`block-start`,`block-end`,`inline-start`,`inline-end`].includes(e)?e:`center`}set position(e){e?this.setAttribute(`position`,e):this.removeAttribute(`position`)}cancel(){this.disabled||this.open&&this.dispatchEvent(new Event(`cancel`,{cancelable:!0}))&&(this.open=!1,this.dispatchEvent(new Event(`close`)))}ok(){this.disabled||this.open&&this.dispatchEvent(new Event(`ok`,{cancelable:!0}))&&(this.open=!1,this.dispatchEvent(new Event(`close`)))}#e=document.createElement(`section`);#t=document.createElement(`dialog`);#n=document.createElement(`button`);#r=document.createElement(`button`);constructor(){super();let e=()=>this.cancel(),t=this.attachShadow({mode:`closed`});t.appendChild(document.createElement(`style`)).textContent=`
393
+ `,e.appendChild(this.#e);let t=e.appendChild(this.#t);t.popover=`manual`,t.setAttribute(`part`,`message`),t.appendChild(document.createElement(`slot`)).setAttribute(`part`,`slot`);let n=t.appendChild(document.createElement(`div`));n.className=`close`,n.addEventListener(`click`,e=>{this.#o(e)}),n.setAttribute(`part`,`close`),n.tabIndex=0,n.addEventListener(`keydown`,e=>{[`Enter`,`Space`].includes(e.code)&&this.#o(e)}),t.addEventListener(`transitionend`,e=>{e.propertyName===`opacity`&&(t.classList.contains(`open`)||this.#p())})}#o(e){e?.defaultPrevented||this.open&&this.dispatchEvent(new Event(`beforeclose`,{cancelable:!0}))&&(this.open=!1,this.dispatchEvent(new Event(`close`)))}#s=!1;#c(){let e=this.#i;e!==null&&(clearTimeout(e),this.#i=null)}#l(){this.#c();let{duration:e}=this;e!==1/0&&(this.#i=setTimeout(()=>{this.#i=null,this.open=!1},e*1e3))}#u(){if(this.#s)return;this.#s=!0;let e=0,t=Se(this.#t);for(let{element:n}of k)n.classList.contains(`open`)&&Se(n)===t&&(e+=(t%3?n.clientWidth:n.clientHeight)+20);let n=this.#t;n.style.insetBlockStart=`${e}px`,n.showPopover?.(),n.classList.add(`shown`),this.#a.states?.add(`--shown`),n.setAttribute(`part`,`message shown`),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.#s&&n.classList.contains(`shown`)&&(n.classList.add(`open`),this.#a.states?.add(`--open`),this.#l(),we.observe(n),k.push(this.#n),Ce())})})}#d(){let e=k.indexOf(this.#n);e<0||(k.splice(e,1),!(e>=k.length)&&Ce())}#f(){if(!this.#s)return;this.#s=!1,this.#c();let e=this.#t;e.classList.remove(`open`),this.#a.states?.delete(`--open`),we.unobserve(e),Ce()}#p(){this.#d();let e=this.#t;e.hidePopover?.(),this.#a.states?.delete(`--shown`),e.classList.remove(`shown`),e.setAttribute(`part`,`message`)}connectedCallback(){this.#r=!0,!this.hidden&&this.open&&this.#u()}disconnectedCallback(){this.#r=!1,this.#f(),this.#p()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`hidden`:case`open`:this.#r&&(!this.hidden&&this.open?this.#u():this.#f());break;case`duration`:this.#l();break}}};try{customElements.define(`nl-message`,Te)}catch{}function A(e,t,n){n?e.setAttribute(t,``):e.removeAttribute(t)}var Ee=class extends HTMLElement{static observedAttributes=[`hidden`,`open`,`disabled`,`size`,`position`];get open(){return this.hasAttribute(`open`)}set open(e){A(this,`open`,e)}get cancelable(){return this.hasAttribute(`cancelable`)}set cancelable(e){A(this,`cancelable`,e)}get closable(){return this.hasAttribute(`closable`)}set closable(e){A(this,`closable`,e)}get mask(){return this.hasAttribute(`mask`)}set mask(e){A(this,`mask`,e)}get maskClosable(){return this.hasAttribute(`mask-closable`)}set maskClosable(e){A(this,`mask-closable`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){A(this,`disabled`,e)}get size(){return this.getAttribute(`size`)||``}set size(e){e?this.setAttribute(`size`,e):this.removeAttribute(`size`)}get position(){let e=this.getAttribute(`position`)||``;return[`block-start`,`block-end`,`inline-start`,`inline-end`].includes(e)?e:`center`}set position(e){e?this.setAttribute(`position`,e):this.removeAttribute(`position`)}cancel(){this.disabled||this.open&&this.dispatchEvent(new Event(`cancel`,{cancelable:!0}))&&(this.open=!1,this.dispatchEvent(new Event(`close`)))}ok(){this.disabled||this.open&&this.dispatchEvent(new Event(`ok`,{cancelable:!0}))&&(this.open=!1,this.dispatchEvent(new Event(`close`)))}#e=document.createElement(`section`);#t=document.createElement(`dialog`);#n=document.createElement(`button`);#r=document.createElement(`button`);constructor(){super();let e=()=>this.cancel(),t=this.attachShadow({mode:`closed`});t.appendChild(document.createElement(`style`)).textContent=`
394
394
  :host {
395
395
  display: none;
396
396
  }
@@ -588,20 +588,20 @@ footer {
588
588
  border-end-end-radius: inherit;
589
589
  }
590
590
 
591
- `,this.#t.autofocus=!1;let n=t.appendChild(this.#t);n.className=`center`,n.addEventListener(`keydown`,t=>{t.defaultPrevented||t.code===`Escape`&&(t.preventDefault(),e())}),n.addEventListener(`click`,t=>{t.target===t.currentTarget&&this.maskClosable&&e()});let r=n.appendChild(this.#e);r.style.inlineSize=this.getAttribute(`size`)||``;let i=r.appendChild(document.createElement(`header`)),a=i.appendChild(document.createElement(`slot`));a.name=`header`,a.addEventListener(`slotchange`,e=>{a.assignedNodes().length?i.classList.remove(`empty`):i.classList.add(`empty`)}),a.assignedNodes().length?i.classList.remove(`empty`):i.classList.add(`empty`);let o=i.appendChild(document.createElement(`slot`));o.className=`close`,o.name=`close`,o.addEventListener(`click`,e),o.addEventListener(`slotchange`,e=>{o.assignedNodes().length?o.classList.remove(`close-icon`):o.classList.add(`close-icon`)}),o.assignedNodes().length?o.classList.remove(`close-icon`):o.classList.add(`close-icon`),r.appendChild(document.createElement(`slot`)).className=`body`;let s=r.appendChild(document.createElement(`footer`)).appendChild(document.createElement(`slot`));s.name=`footer`;let{disabled:c}=this,l=s.appendChild(this.#n);l.addEventListener(`click`,()=>this.ok()),l.className=`ok`,l.disabled=c;let u=s.appendChild(this.#r);u.addEventListener(`click`,e),u.className=`cancel`,u.disabled=c}#i=!1;connectedCallback(){this.#i=!0,!this.hidden&&this.open&&this.#t.showModal()}disconnectedCallback(){this.#i=!1,this.#t.close()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`hidden`:case`open`:this.#i&&(!this.hidden&&this.open?this.#t.showModal():this.#t.close());break;case`disabled`:{let e=n!==null;this.#r.disabled=e,this.#n.disabled=e;break}case`position`:{let{size:e}=this,t=this.#e,r=this.#t;switch(n){case`block-start`:case`block-end`:t.style.inlineSize=``,t.style.blockSize=e,r.className=n;break;case`inline-start`:case`inline-end`:t.style.inlineSize=e,t.style.blockSize=``,r.className=n;break;default:t.style.inlineSize=e,t.style.blockSize=``,r.className=`center`}break}case`size`:this.position.startsWith(`block`)?this.#e.style.blockSize=n||``:this.#e.style.inlineSize=n||``;break}}};try{customElements.define(`nl-modal`,Te)}catch{}function Ee(e,t){let n=e.attachShadow({mode:`closed`});n.appendChild(document.createElement(`style`)).textContent=`:host {
591
+ `,this.#t.autofocus=!1;let n=t.appendChild(this.#t);n.className=`center`,n.addEventListener(`keydown`,t=>{t.defaultPrevented||t.code===`Escape`&&(t.preventDefault(),e())}),n.addEventListener(`click`,t=>{t.target===t.currentTarget&&this.maskClosable&&e()});let r=n.appendChild(this.#e);r.style.inlineSize=this.getAttribute(`size`)||``;let i=r.appendChild(document.createElement(`header`)),a=i.appendChild(document.createElement(`slot`));a.name=`header`,a.addEventListener(`slotchange`,e=>{a.assignedNodes().length?i.classList.remove(`empty`):i.classList.add(`empty`)}),a.assignedNodes().length?i.classList.remove(`empty`):i.classList.add(`empty`);let o=i.appendChild(document.createElement(`slot`));o.className=`close`,o.name=`close`,o.addEventListener(`click`,e),o.addEventListener(`slotchange`,e=>{o.assignedNodes().length?o.classList.remove(`close-icon`):o.classList.add(`close-icon`)}),o.assignedNodes().length?o.classList.remove(`close-icon`):o.classList.add(`close-icon`),r.appendChild(document.createElement(`slot`)).className=`body`;let s=r.appendChild(document.createElement(`footer`)).appendChild(document.createElement(`slot`));s.name=`footer`;let{disabled:c}=this,l=s.appendChild(this.#n);l.addEventListener(`click`,()=>this.ok()),l.className=`ok`,l.disabled=c;let u=s.appendChild(this.#r);u.addEventListener(`click`,e),u.className=`cancel`,u.disabled=c}#i=!1;connectedCallback(){this.#i=!0,!this.hidden&&this.open&&this.#t.showModal()}disconnectedCallback(){this.#i=!1,this.#t.close()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`hidden`:case`open`:this.#i&&(!this.hidden&&this.open?this.#t.showModal():this.#t.close());break;case`disabled`:{let e=n!==null;this.#r.disabled=e,this.#n.disabled=e;break}case`position`:{let{size:e}=this,t=this.#e,r=this.#t;switch(n){case`block-start`:case`block-end`:t.style.inlineSize=``,t.style.blockSize=e,r.className=n;break;case`inline-start`:case`inline-end`:t.style.inlineSize=e,t.style.blockSize=``,r.className=n;break;default:t.style.inlineSize=e,t.style.blockSize=``,r.className=`center`}break}case`size`:this.position.startsWith(`block`)?this.#e.style.blockSize=n||``:this.#e.style.inlineSize=n||``;break}}};try{customElements.define(`nl-modal`,Ee)}catch{}function De(e,t){let n=e.attachShadow({mode:`closed`});n.appendChild(document.createElement(`style`)).textContent=`:host {
592
592
  display: block;
593
593
  overflow: hidden;
594
594
  position: relative;
595
595
  }
596
- :host([hidden]) { display: none; }`,n.appendChild(document.createElement(`slot`));let r=new ResizeObserver(e=>{let n=e.pop();if(!n)return;let{contentRect:{width:r,height:i}}=n;for(let e of t)e.resize(r,i)});function i(n){let r=n.composedPath(),i=r.findIndex(t=>t===e),a=i<0?[]:r.slice(0,i).reverse();for(let e of[...t]){let t=e.match(a);if(t)return e;if(t===null)return null}return null}let a={};function o(t){let n=i(t);if(!n)return;let{pageX:r,pageY:o,pointerId:s}=t,{x:c,y:l}=e.getBoundingClientRect(),u=r-c,d=o-l,f=null;t.pointerType===`mouse`?f=n.mouseBegin(u,d,t.buttons):t.pointerType===`touch`&&(f=n.touchBegin(s,u,d)),typeof f==`boolean`&&(f&&e.setPointerCapture(s),a[s]=n)}function s(t){let{pointerId:n}=t,r=a[n];if(!r)return;let{pageX:i,pageY:o}=t,{x:s,y:c}=e.getBoundingClientRect(),l=i-s,u=o-c;if(t.pointerType===`mouse`){r?.mouseMove(l,u,t.buttons);return}t.pointerType===`touch`&&r.touchMove(n,l,u)}function c(t){let{pointerId:n}=t;e.hasPointerCapture(n)&&e.releasePointerCapture(n);let r=a[n];r&&(t.pointerType===`mouse`&&r.mouseEnd(),t.pointerType===`touch`&&(delete a[n],r.touchEnd(n)))}function l(t){let n=i(t);if(!n)return;let{deltaMode:r,deltaX:a,deltaY:o,pageX:s,pageY:c}=t,{x:l,y:u}=e.getBoundingClientRect(),d=s-l,f=c-u;n.wheel(r,a,o,d,f)}return e.addEventListener(`wheel`,l,!0),e.addEventListener(`pointermove`,s),e.addEventListener(`pointerdown`,o),e.addEventListener(`pointerup`,c),e.addEventListener(`pointercancel`,c),e.addEventListener(`lostpointercapture`,c),e.addEventListener(`touchmove`,e=>e.preventDefault()),[()=>{r.observe(e)},()=>{r.unobserve(e)}]}var De=class extends HTMLElement{#e=new Set;#t;#n;constructor(){super(),[this.#t,this.#n]=Ee(this,this.#e)}register(e){let t=this.#e;t.add(e);let{width:n,height:r}=this.getBoundingClientRect();return e.resize(n,r),()=>{t.delete(e)}}connectedCallback(){this.#t()}disconnectedCallback(){this.#n()}adoptedCallback(){}};function Oe(e,t){let n=e.reduce((e,t)=>e+t)/e.length,r=t.reduce((e,t)=>e+t)/t.length;return e.map((i,a)=>(e[a]-n)*(t[a]-r)).reduce((e,t)=>e+t)/e.map(e=>(e-n)**2).reduce((e,t)=>e+t)}function ke(e){let t=performance.now()/1e3;for(let n=0;n<e.length;n++){let[,,r]=e[n];if(t-r>.05){e.length=n;break}t=r}if(e.length<3)return;let n=e.map(e=>e[2]),r=Oe(n,e.map(e=>e[0])),i=Oe(n,e.map(e=>e[1])),a=Math.sign(r),o=Math.sign(i),s=Math.abs(r),c=Math.abs(i),l=(s**2+c**2)**.5,u=s/l,d=c/l,f=1e3,[[p,m,h]]=e;function g(){let e=performance.now()/1e3-h;return l-e*f<=0?[p+a*s*l/f/2,m+o*c*l/f/2,!0]:[p+a*(s+s-f*u*e)*e/2,m+o*(c+c-f*d*e)*e/2,!1]}return g}var Ae=class extends HTMLElement{#e;#t;constructor(){super();let e=()=>{};this.#t=()=>{let t=this.parentNode;for(;t&&!(t instanceof Fe);)t=t.parentNode;t&&(e=t.register(this))},this.#e=()=>{e()}}connectedCallback(){this.#t()}disconnectedCallback(){this.#e()}};function je(e,t,n,r){return((e-t)**2+(n-r)**2)**.5}function Me(e,t,n){let r=t-n,i=Math.min(r,0),a=Math.max(r,0);return Math.min(Math.max(i,e),a)}function Ne(e,t){let n=e.attachShadow({mode:`closed`});n.appendChild(document.createElement(`style`)).textContent=`
596
+ :host([hidden]) { display: none; }`,n.appendChild(document.createElement(`slot`));let r=new ResizeObserver(e=>{let n=e.pop();if(!n)return;let{contentRect:{width:r,height:i}}=n;for(let e of t)e.resize(r,i)});function i(n){let r=n.composedPath(),i=r.findIndex(t=>t===e),a=i<0?[]:r.slice(0,i).reverse();for(let e of[...t]){let t=e.match(a);if(t)return e;if(t===null)return null}return null}let a={};function o(t){let n=i(t);if(!n)return;let{pageX:r,pageY:o,pointerId:s}=t,{x:c,y:l}=e.getBoundingClientRect(),u=r-c,d=o-l,f=null;t.pointerType===`mouse`?f=n.mouseBegin(u,d,t.buttons):t.pointerType===`touch`&&(f=n.touchBegin(s,u,d)),typeof f==`boolean`&&(f&&e.setPointerCapture(s),a[s]=n)}function s(t){let{pointerId:n}=t,r=a[n];if(!r)return;let{pageX:i,pageY:o}=t,{x:s,y:c}=e.getBoundingClientRect(),l=i-s,u=o-c;if(t.pointerType===`mouse`){r?.mouseMove(l,u,t.buttons);return}t.pointerType===`touch`&&r.touchMove(n,l,u)}function c(t){let{pointerId:n}=t;e.hasPointerCapture(n)&&e.releasePointerCapture(n);let r=a[n];r&&(t.pointerType===`mouse`&&r.mouseEnd(),t.pointerType===`touch`&&(delete a[n],r.touchEnd(n)))}function l(t){let n=i(t);if(!n)return;let{deltaMode:r,deltaX:a,deltaY:o,pageX:s,pageY:c}=t,{x:l,y:u}=e.getBoundingClientRect(),d=s-l,f=c-u;n.wheel(r,a,o,d,f)}return e.addEventListener(`wheel`,l,!0),e.addEventListener(`pointermove`,s),e.addEventListener(`pointerdown`,o),e.addEventListener(`pointerup`,c),e.addEventListener(`pointercancel`,c),e.addEventListener(`lostpointercapture`,c),e.addEventListener(`touchmove`,e=>e.preventDefault()),[()=>{r.observe(e)},()=>{r.unobserve(e)}]}var Oe=class extends HTMLElement{#e=new Set;#t;#n;constructor(){super(),[this.#t,this.#n]=De(this,this.#e)}register(e){let t=this.#e;t.add(e);let{width:n,height:r}=this.getBoundingClientRect();return e.resize(n,r),()=>{t.delete(e)}}connectedCallback(){this.#t()}disconnectedCallback(){this.#n()}adoptedCallback(){}};function ke(e,t){let n=e.reduce((e,t)=>e+t)/e.length,r=t.reduce((e,t)=>e+t)/t.length;return e.map((i,a)=>(e[a]-n)*(t[a]-r)).reduce((e,t)=>e+t)/e.map(e=>(e-n)**2).reduce((e,t)=>e+t)}function Ae(e){let t=performance.now()/1e3;for(let n=0;n<e.length;n++){let[,,r]=e[n];if(t-r>.05){e.length=n;break}t=r}if(e.length<3)return;let n=e.map(e=>e[2]),r=ke(n,e.map(e=>e[0])),i=ke(n,e.map(e=>e[1])),a=Math.sign(r),o=Math.sign(i),s=Math.abs(r),c=Math.abs(i),l=(s**2+c**2)**.5,u=s/l,d=c/l,f=1e3,[[p,m,h]]=e;function g(){let e=performance.now()/1e3-h;return l-e*f<=0?[p+a*s*l/f/2,m+o*c*l/f/2,!0]:[p+a*(s+s-f*u*e)*e/2,m+o*(c+c-f*d*e)*e/2,!1]}return g}var je=class extends HTMLElement{#e;#t;constructor(){super();let e=()=>{};this.#t=()=>{let t=this.parentNode;for(;t&&!(t instanceof Ie);)t=t.parentNode;t&&(e=t.register(this))},this.#e=()=>{e()}}connectedCallback(){this.#t()}disconnectedCallback(){this.#e()}};function Me(e,t,n,r){return((e-t)**2+(n-r)**2)**.5}function Ne(e,t,n){let r=t-n,i=Math.min(r,0),a=Math.max(r,0);return Math.min(Math.max(i,e),a)}function Pe(e,t){let n=e.attachShadow({mode:`closed`});n.appendChild(document.createElement(`style`)).textContent=`
597
597
  :host{display: block; position: absolute; transform-origin: 0 0; }
598
598
  :host([hidden]) { display: none; }
599
- `,n.appendChild(document.createElement(`slot`));let r=!1;function i(){r=!0;let[t,n]=o;!t||!n||(r=!1,l=Math.min(t/e.clientWidth,n/e.clientHeight),s=(t-e.clientWidth*l)/2,c=(n-e.clientHeight*l)/2,e.style.transform=`translate(${s}px,${c}px)scale(${l})`)}let a={},o=[0,0],s=0,c=0,l=1;function u(t){let n=e.clientWidth,r=e.clientHeight,[i,a]=o;if(!i||!a)return t;let s=i/n,c=a/r,l=Math.max(s,c,5),u=Math.min(s,c,.5);return Math.max(u,Math.min(t,l))}let d=``,f;function p(e,t,n,r){let i=je(e,n,t,r),a=l;if(!i||!a){f=void 0;return}f={x:(s-(e+n)/2)/a,y:(c-(t+r)/2)/a,s:a/i}}function m(e,t,n,r){if(!f)return;let i=je(e,n,t,r);if(!i)return;let{s:a,x:o,y:d}=f,p=u(i*a);l=p,s=o*p+(e+n)/2,c=d*p+(t+r)/2,w()}function h(){d=``,f=void 0}let g=``,_,v=0;function y(e,t){cancelAnimationFrame(v),_=void 0,_={x:s,y:c,frame:[[s,c,performance.now()/1e3]],bx:e,by:t}}function ee(e,t){if(!_)return;let{x:n,y:r,bx:i,by:a}=_;s=n+e-i,c=r+t-a;let o=[s,c,performance.now()/1e3];_.frame=[o,..._.frame].slice(0,20),w()}function b(){if(!_)return;g=``;let{frame:t}=_;if(_=void 0,!e.inertia)return;let n=ke(t);if(!n)return;let r=()=>{let t;[s,c,t]=n(),w(),e.inertia&&(t||(v=requestAnimationFrame(r)))};r()}function x(){cancelAnimationFrame(v),g=``,_=void 0}let S={resize(t,n){o=[t,n],(e.autoAdaptively||r)&&i()},match(n){if(!n.length)return e.global||!1;if(n[0]!==e)return!1;if(!t.size)return!0;let r=new Set(n);for(let e of t)if(r.has(e))return!0;return null},touchMove(t,n,r){a[t]=[n,r];let i=Object.values(a);if(g===`touch`){if(i.length!==1)return x();let[e]=i;ee(e[0],e[1])}if(d!==`touch`)return;if(!e.touchScalable||i.length!==2)return h();let[o,s]=i;m(o[0],o[1],s[0],s[1])},touchBegin(t,n,r){a[t]=[n,r];let i=Object.values(a);if(i.length===1){if(!g&&e.touchMovable)return h(),g=`touch`,y(n,r),e.touchCapture}else if(i.length===2&&!d&&e.touchScalable){x(),d=`touch`;let[t,n]=i;return p(t[0],t[1],n[0],n[1]),e.touchCapture}return null},touchEnd(e){delete a[e],d===`touch`&&h(),g===`touch`&&b()},mouseMove(e,t,n){if(g===`leftMouse`&&!(n&1)||g===`roller`&&!(n&4)){b();return}g&&ee(e,t)},mouseBegin(t,n,r){if(g)return null;let i=``,a=null;if(r&1){if(!e.leftMouseMovable)return null;i=`leftMouse`,a=e.leftMouseMovableCapture}else if(r&4){if(!e.rollerMovable)return null;i=`roller`,a=e.rollerMovableCapture}return h(),g=i,y(t,n),a},mouseEnd(){g&&b()},wheel(t,n,r,i,a){if(!e.rollerScalable)return;let o=Math.abs(n)>Math.abs(r)?n:r;if(o===0)return;h();let d=Math.abs(o),f=0;if(o>0)switch(t){case 0:f=1.01;break;case 1:f=1.25;break;case 2:f=1.6;break}else switch(t){case 0:f=1/1.01;break;case 1:f=1/1.25;break;case 2:f=1/1.6;break}let p=l,m=u(f**d*p);l=m,s=(s-i)/p*m+i,c=(c-a)/p*m+a,w()}},C=()=>{};function w(){let[t,n]=o;(!t||!n)&&(e.style.transform=`translate(${s}px,${c}px)scale(${l})`),s=Me(s,t,e.clientWidth*l),c=Me(c,n,e.clientHeight*l),e.style.transform=`translate(${s}px,${c}px)scale(${l})`}return[()=>{e.autoAdaptively&&requestAnimationFrame(i);let t=e.parentNode;for(;t&&!(t instanceof De);)t=t.parentNode;t&&(C=t.register(S))},()=>{C()},i]}function j(e,t,n){if(!n&&n!==``){e.removeAttribute(t);return}e.setAttribute(t,n===!0?``:n)}var Pe=class extends HTMLElement{static get Area(){return De}static get Target(){return Ae}get inertia(){return this.getAttribute(`inertia`)!==null}set inertia(e){j(this,`inertia`,e)}get touchCapture(){return this.getAttribute(`touch-capture`)!==null}set touchCapture(e){j(this,`touch-capture`,e)}get touchMovable(){return this.getAttribute(`touch-movable`)!==null}set touchMovable(e){j(this,`touch-movable`,e)}get touchScalable(){return this.getAttribute(`touch-scalable`)!==null}set touchScalable(e){j(this,`touch-scalable`,e)}get rollerMovable(){return this.getAttribute(`roller-movable`)!==null}set rollerMovable(e){j(this,`roller-movable`,e)}get rollerMovableCapture(){return this.getAttribute(`roller-movable-capture`)!==null}set rollerMovableCapture(e){j(this,`roller-movable-capture`,e)}get rollerScalable(){return this.getAttribute(`roller-scalable`)!==null}set rollerScalable(e){j(this,`roller-scalable`,e)}get leftMouseMovable(){return this.getAttribute(`left-mouse-movable`)!==null}set leftMouseMovable(e){j(this,`left-mouse-movable`,e)}get leftMouseMovableCapture(){return this.getAttribute(`left-mouse-movable-capture`)!==null}set leftMouseMovableCapture(e){j(this,`left-mouse-movable-capture`,e)}get autoAdaptively(){return this.getAttribute(`adaptively`)!==null}set autoAdaptively(e){j(this,`adaptively`,e)}get global(){return this.getAttribute(`global`)!==null}set global(e){j(this,`global`,e)}#e=new Set;#t;#n;#r;constructor(){super(),[this.#t,this.#n,this.#r]=Ne(this,this.#e)}register(e){let t=this.#e;return t.add(e),()=>{t.delete(e)}}adaptively(){this.#r()}connectedCallback(){this.#t()}disconnectedCallback(){this.#n()}adoptedCallback(){}};try{customElements.define(`nl-movable-area`,De),customElements.define(`nl-movable`,Pe),customElements.define(`nl-movable-target`,Ae)}catch{}var Fe=Pe,M=class extends HTMLElement{#e=()=>{};#t=null;get pagination(){return this.#t}updateCallback(e){}#n=0;#r=0;#i=1;#a=1;get size(){return this.#n}get total(){return this.#r}get pages(){return this.#i}get page(){return this.#a}connectedCallback(){let e=this.parentNode;for(;e&&!(e instanceof qe);)e=e.parentNode;e&&(this.#t=e,this.#e=e.register({update:({size:e,total:t,pages:n,page:r})=>{this.#n=e,this.#r=t,this.#i=n,this.#a=r,this.updateCallback({size:e,total:t,pages:n,page:r})}}))}disconnectedCallback(){this.#t=null,this.#e()}};function N(e){let t=document.createElement(`style`);return t.textContent=e,t}var Ie=class extends M{static observedAttributes=[`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=document.createElement(`input`);e.setAttribute(`part`,`input`),e.type=`number`,e.min=`1`,e.step=`1`,this.#e.appendChild(e);let t=()=>{let{pagination:t}=this;if(!t)return;let n=e.value;n&&t.setPage(Number(n))};return e.addEventListener(`change`,t),e.addEventListener(`keydown`,e=>{e.code===`Enter`&&(e.preventDefault(),t())}),e})();updateCallback(){let e=this.#n,{pages:t,page:n}=this;e.max=String(t),e.value=String(n),e.placeholder=String(n)}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`disabled`:this.#n.disabled=this.disabled;break}}},Le=class extends M{static observedAttributes=[`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=document.createElement(`button`);return e.type=`button`,this.#e.appendChild(e),e.setAttribute(`part`,`button`),e})();#r=this.#n.appendChild(document.createElement(`slot`));#i(){this.#n.disabled=this.disabled||this.page===this.pages}constructor(){super(),this.addEventListener(`click`,e=>{let{defaultPrevented:t}=e;e.preventDefault(),this.#n.disabled?e.stopPropagation():t||this.pagination?.setPage(this.page+1)})}updateCallback(){this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`disabled`:this.#i();break}}},Re=class extends M{static observedAttributes=[`value`,`disabled`];get value(){return Math.max(1,parseInt(this.getAttribute(`value`)||``)||1)}set value(e){e?this.setAttribute(`value`,String(e)):this.removeAttribute(`value`)}get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get target(){return Math.min(this.value,this.pages)}get isCurrent(){return this.target===this.page}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=document.createElement(`button`);return e.type=`button`,e.setAttribute(`part`,`button`),this.#e.appendChild(e),e})();#r=(()=>{let e=document.createElement(`slot`);return this.#n.appendChild(e),e.innerText=`1`,e})();#i(){this.#n.disabled=this.disabled||this.isCurrent}constructor(){super(),this.addEventListener(`click`,e=>{let{defaultPrevented:t}=e;e.preventDefault(),this.#n.disabled?e.stopPropagation():t||this.pagination?.setPage(this.value)})}updateCallback(){this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`value`:this.#r.innerText=String(this.value),this.#i();break;case`disabled`:this.#i();break}}},ze=class extends M{static observedAttributes=[`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(`
599
+ `,n.appendChild(document.createElement(`slot`));let r=!1;function i(){r=!0;let[t,n]=o;!t||!n||(r=!1,l=Math.min(t/e.clientWidth,n/e.clientHeight),s=(t-e.clientWidth*l)/2,c=(n-e.clientHeight*l)/2,e.style.transform=`translate(${s}px,${c}px)scale(${l})`)}let a={},o=[0,0],s=0,c=0,l=1;function u(t){let n=e.clientWidth,r=e.clientHeight,[i,a]=o;if(!i||!a)return t;let s=i/n,c=a/r,l=Math.max(s,c,5),u=Math.min(s,c,.5);return Math.max(u,Math.min(t,l))}let d=``,f;function p(e,t,n,r){let i=Me(e,n,t,r),a=l;if(!i||!a){f=void 0;return}f={x:(s-(e+n)/2)/a,y:(c-(t+r)/2)/a,s:a/i}}function m(e,t,n,r){if(!f)return;let i=Me(e,n,t,r);if(!i)return;let{s:a,x:o,y:d}=f,p=u(i*a);l=p,s=o*p+(e+n)/2,c=d*p+(t+r)/2,T()}function h(){d=``,f=void 0}let g=``,_,v=0;function y(e,t){cancelAnimationFrame(v),_=void 0,_={x:s,y:c,frame:[[s,c,performance.now()/1e3]],bx:e,by:t}}function b(e,t){if(!_)return;let{x:n,y:r,bx:i,by:a}=_;s=n+e-i,c=r+t-a;let o=[s,c,performance.now()/1e3];_.frame=[o,..._.frame].slice(0,20),T()}function x(){if(!_)return;g=``;let{frame:t}=_;if(_=void 0,!e.inertia)return;let n=Ae(t);if(!n)return;let r=()=>{let t;[s,c,t]=n(),T(),e.inertia&&(t||(v=requestAnimationFrame(r)))};r()}function S(){cancelAnimationFrame(v),g=``,_=void 0}let C={resize(t,n){o=[t,n],(e.autoAdaptively||r)&&i()},match(n){if(!n.length)return e.global||!1;if(n[0]!==e)return!1;if(!t.size)return!0;let r=new Set(n);for(let e of t)if(r.has(e))return!0;return null},touchMove(t,n,r){a[t]=[n,r];let i=Object.values(a);if(g===`touch`){if(i.length!==1)return S();let[e]=i;b(e[0],e[1])}if(d!==`touch`)return;if(!e.touchScalable||i.length!==2)return h();let[o,s]=i;m(o[0],o[1],s[0],s[1])},touchBegin(t,n,r){a[t]=[n,r];let i=Object.values(a);if(i.length===1){if(!g&&e.touchMovable)return h(),g=`touch`,y(n,r),e.touchCapture}else if(i.length===2&&!d&&e.touchScalable){S(),d=`touch`;let[t,n]=i;return p(t[0],t[1],n[0],n[1]),e.touchCapture}return null},touchEnd(e){delete a[e],d===`touch`&&h(),g===`touch`&&x()},mouseMove(e,t,n){if(g===`leftMouse`&&!(n&1)||g===`roller`&&!(n&4)){x();return}g&&b(e,t)},mouseBegin(t,n,r){if(g)return null;let i=``,a=null;if(r&1){if(!e.leftMouseMovable)return null;i=`leftMouse`,a=e.leftMouseMovableCapture}else if(r&4){if(!e.rollerMovable)return null;i=`roller`,a=e.rollerMovableCapture}return h(),g=i,y(t,n),a},mouseEnd(){g&&x()},wheel(t,n,r,i,a){if(!e.rollerScalable)return;let o=Math.abs(n)>Math.abs(r)?n:r;if(o===0)return;h();let d=Math.abs(o),f=0;if(o>0)switch(t){case 0:f=1.01;break;case 1:f=1.25;break;case 2:f=1.6;break}else switch(t){case 0:f=1/1.01;break;case 1:f=1/1.25;break;case 2:f=1/1.6;break}let p=l,m=u(f**d*p);l=m,s=(s-i)/p*m+i,c=(c-a)/p*m+a,T()}},w=()=>{};function T(){let[t,n]=o;(!t||!n)&&(e.style.transform=`translate(${s}px,${c}px)scale(${l})`),s=Ne(s,t,e.clientWidth*l),c=Ne(c,n,e.clientHeight*l),e.style.transform=`translate(${s}px,${c}px)scale(${l})`}return[()=>{e.autoAdaptively&&requestAnimationFrame(i);let t=e.parentNode;for(;t&&!(t instanceof Oe);)t=t.parentNode;t&&(w=t.register(C))},()=>{w()},i]}function j(e,t,n){if(!n&&n!==``){e.removeAttribute(t);return}e.setAttribute(t,n===!0?``:n)}var Fe=class extends HTMLElement{static get Area(){return Oe}static get Target(){return je}get inertia(){return this.getAttribute(`inertia`)!==null}set inertia(e){j(this,`inertia`,e)}get touchCapture(){return this.getAttribute(`touch-capture`)!==null}set touchCapture(e){j(this,`touch-capture`,e)}get touchMovable(){return this.getAttribute(`touch-movable`)!==null}set touchMovable(e){j(this,`touch-movable`,e)}get touchScalable(){return this.getAttribute(`touch-scalable`)!==null}set touchScalable(e){j(this,`touch-scalable`,e)}get rollerMovable(){return this.getAttribute(`roller-movable`)!==null}set rollerMovable(e){j(this,`roller-movable`,e)}get rollerMovableCapture(){return this.getAttribute(`roller-movable-capture`)!==null}set rollerMovableCapture(e){j(this,`roller-movable-capture`,e)}get rollerScalable(){return this.getAttribute(`roller-scalable`)!==null}set rollerScalable(e){j(this,`roller-scalable`,e)}get leftMouseMovable(){return this.getAttribute(`left-mouse-movable`)!==null}set leftMouseMovable(e){j(this,`left-mouse-movable`,e)}get leftMouseMovableCapture(){return this.getAttribute(`left-mouse-movable-capture`)!==null}set leftMouseMovableCapture(e){j(this,`left-mouse-movable-capture`,e)}get autoAdaptively(){return this.getAttribute(`adaptively`)!==null}set autoAdaptively(e){j(this,`adaptively`,e)}get global(){return this.getAttribute(`global`)!==null}set global(e){j(this,`global`,e)}#e=new Set;#t;#n;#r;constructor(){super(),[this.#t,this.#n,this.#r]=Pe(this,this.#e)}register(e){let t=this.#e;return t.add(e),()=>{t.delete(e)}}adaptively(){this.#r()}connectedCallback(){this.#t()}disconnectedCallback(){this.#n()}adoptedCallback(){}};try{customElements.define(`nl-movable-area`,Oe),customElements.define(`nl-movable`,Fe),customElements.define(`nl-movable-target`,je)}catch{}var Ie=Fe,M=class extends HTMLElement{#e=()=>{};#t=null;get pagination(){return this.#t}updateCallback(e){}#n=0;#r=0;#i=1;#a=1;get size(){return this.#n}get total(){return this.#r}get pages(){return this.#i}get page(){return this.#a}connectedCallback(){let e=this.parentNode;for(;e&&!(e instanceof Je);)e=e.parentNode;e&&(this.#t=e,this.#e=e.register({update:({size:e,total:t,pages:n,page:r})=>{this.#n=e,this.#r=t,this.#i=n,this.#a=r,this.updateCallback({size:e,total:t,pages:n,page:r})}}))}disconnectedCallback(){this.#t=null,this.#e()}};function N(e){let t=document.createElement(`style`);return t.textContent=e,t}var Le=class extends M{static observedAttributes=[`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=document.createElement(`input`);e.setAttribute(`part`,`input`),e.type=`number`,e.min=`1`,e.step=`1`,this.#e.appendChild(e);let t=()=>{let{pagination:t}=this;if(!t)return;let n=e.value;n&&t.setPage(Number(n))};return e.addEventListener(`change`,t),e.addEventListener(`keydown`,e=>{e.code===`Enter`&&(e.preventDefault(),t())}),e})();updateCallback(){let e=this.#n,{pages:t,page:n}=this;e.max=String(t),e.value=String(n),e.placeholder=String(n)}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`disabled`:this.#n.disabled=this.disabled;break}}},Re=class extends M{static observedAttributes=[`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=document.createElement(`button`);return e.type=`button`,this.#e.appendChild(e),e.setAttribute(`part`,`button`),e})();#r=this.#n.appendChild(document.createElement(`slot`));#i(){this.#n.disabled=this.disabled||this.page===this.pages}constructor(){super(),this.addEventListener(`click`,e=>{let{defaultPrevented:t}=e;e.preventDefault(),this.#n.disabled?e.stopPropagation():t||this.pagination?.setPage(this.page+1)})}updateCallback(){this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`disabled`:this.#i();break}}},ze=class extends M{static observedAttributes=[`value`,`disabled`];get value(){return Math.max(1,parseInt(this.getAttribute(`value`)||``)||1)}set value(e){e?this.setAttribute(`value`,String(e)):this.removeAttribute(`value`)}get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get target(){return Math.min(this.value,this.pages)}get isCurrent(){return this.target===this.page}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=document.createElement(`button`);return e.type=`button`,e.setAttribute(`part`,`button`),this.#e.appendChild(e),e})();#r=(()=>{let e=document.createElement(`slot`);return this.#n.appendChild(e),e.innerText=`1`,e})();#i(){this.#n.disabled=this.disabled||this.isCurrent}constructor(){super(),this.addEventListener(`click`,e=>{let{defaultPrevented:t}=e;e.preventDefault(),this.#n.disabled?e.stopPropagation():t||this.pagination?.setPage(this.value)})}updateCallback(){this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`value`:this.#r.innerText=String(this.value),this.#i();break;case`disabled`:this.#i();break}}},Be=class extends M{static observedAttributes=[`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(`
600
600
  :host { display: contents; }
601
601
  .placeholder::after {
602
602
  content: var(--nl-pagination-pager-placeholder, '...');
603
603
  }
604
- `));#n=Object.create(null);#r=[];#i(){for(let e of this.#r)e.remove();let e=Object.create(null),t=[];this.#n=e,this.#r=t;let{disabled:n}=this,r=this.#e,i=this.page,a=this.pages,o=Math.max(2,i-2),s=Math.min(i+2,a-1),c=a=>{let o=document.createElement(`button`);o.type=`button`,o.innerText=String(a),o.setAttribute(`part`,a===i?`button current`:`button`),o.disabled=n||a===i,o.addEventListener(`click`,()=>{this.pagination?.setPage(a)}),t.push(o),r.appendChild(o),e[a]=o},l=()=>{let e=document.createElement(`span`);e.className=`placeholder`,e.setAttribute(`part`,`placeholder`),r.appendChild(e),t.push(e)};c(1),i>4&&l();for(let e=o;e<=s;e++)c(e);a-i>3&&l(),a>1&&c(a)}#a(){let{disabled:e}=this,t=String(this.page);for(let[n,r]of Object.entries(this.#n))r.disabled=e||n===t}updateCallback(){this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`disabled`:this.#a();break}}},Be=class extends M{static observedAttributes=[`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=document.createElement(`button`);return e.type=`button`,e.setAttribute(`part`,`button`),this.#e.appendChild(e),e})();#r=this.#n.appendChild(document.createElement(`slot`));#i(){this.#n.disabled=this.disabled||this.page===1}constructor(){super(),this.addEventListener(`click`,e=>{let{defaultPrevented:t}=e;e.preventDefault(),this.#n.disabled?e.stopPropagation():t||this.pagination?.setPage(this.page-1)})}updateCallback(){this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`disabled`:this.#i();break}}};function Ve(e){let t=e?.split(/[,;: ]/).map(e=>parseInt(e)).filter(e=>e>=0);return t?.length?new Set(t):null}function He(e){if(typeof e==`string`){let t=Ve(e);return t?[...t]:[]}if(typeof e==`number`){let t=Math.floor(e);return t>=0?[t]:[]}if(typeof e==`bigint`)return e>=0n?[Number(e)]:[];try{return Array(e).flat(1/0).flatMap(He)}catch{return[]}}const Ue=[10,20,30,50,100];function We(e,t){let n=Ve(e)||new Set(Ue);return typeof t==`number`&&n.add(t),[...n].sort((e,t)=>e-t)}var Ge=class extends M{static observedAttributes=[`sizes`,`label`,`non-label`,`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=this.#e.appendChild(document.createElement(`select`));return e.setAttribute(`part`,`input`),e.addEventListener(`change`,()=>{let{pagination:t}=this;t&&t.setSize(Number(e.value))}),e})();#r=(()=>{let e=document.createElement(`option`);return e.label=`-`,e.value=`0`,e})();#i=[];#a(){let e=Ve(this.getAttribute(`sizes`))||new Set(Ue),{size:t}=this;e.add(t);let n=this.#n;n.innerHTML=``,e.delete(0)&&n.appendChild(this.#r);let r=[];this.#i=r;let i=this.label;for(let t of[...e].sort((e,t)=>e-t)){let e=document.createElement(`option`);e.label=i.replace(/#/g,String(t)),e.value=String(t),r.push(e),n.appendChild(e)}n.value=String(t)}get label(){return this.getAttribute(`label`)||`#`}set label(e){e?this.setAttribute(`label`,e):this.removeAttribute(`label`)}get nonLabel(){return this.getAttribute(`non-label`)||`-`}set nonLabel(e){e?this.setAttribute(`non-label`,e):this.removeAttribute(`non-label`)}get sizes(){return We(this.getAttribute(`sizes`))}set sizes(e){let t=He(e);t.length?this.setAttribute(`sizes`,[...new Set(t)].sort((e,t)=>e-t).join(`,`)):this.removeAttribute(`sizes`)}#o=0;updateCallback(){let{size:e}=this;this.#o!==e&&(this.#o=e,this.#a())}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`sizes`:this.#a();break;case`label`:{let e=this.label;for(let t of this.#i)t.label=e.replace(/#/g,t.value);break}case`non-label`:this.#r.label=this.nonLabel;break;case`disabled`:this.#n.disabled=this.disabled;break}}},Ke=class extends M{static observedAttributes=[`name`];get name(){let e=this.getAttribute(`name`)?.toLowerCase()||``;return[`size`,`total`,`pages`,`page`,`start`,`end`].includes(e)?e:`page`}set name(e){e?this.setAttribute(`name`,String(e)):this.removeAttribute(`name`)}#e={size:0,total:0,pages:1,page:1,start:0,end:0};#t=this.attachShadow({mode:`closed`});#n=this.#t.appendChild(N(``));#r=this.#t.appendChild(document.createTextNode(``));#i(){let e=this.#e[this.name];this.#r.textContent=String(e)}updateCallback(){let{size:e,total:t,pages:n,page:r}=this;this.#e={size:e,total:t,pages:n,page:r,start:Math.min((r-1)*e+1,t),end:e?Math.min(r*e,t):t},this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`name`:this.#i()}}};function P(e,t,n){if(n=typeof n==`string`?parseInt(n):typeof n==`number`?Math.floor(n):typeof n==`bigint`?Number(n):NaN,Number.isNaN(n)||n<0){e.removeAttribute(t);return}e.setAttribute(t,String(n))}function F(e){if(!e)return 0;let t=parseInt(e);return Number.isNaN(t)||t<0?0:t}var qe=class extends HTMLElement{static get Widget(){return M}static get Jumper(){return Ie}static get Next(){return Le}static get Page(){return Re}static get Pager(){return ze}static get Prev(){return Be}static get Sizer(){return Ge}static get Value(){return Ke}static observedAttributes=[`size`,`total`,`pages`,`page`];get size(){return F(this.getAttribute(`size`))||0}set size(e){P(this,`size`,e)}get total(){return F(this.getAttribute(`total`))||0}set total(e){P(this,`total`,e)}get pages(){let e=F(this.getAttribute(`pages`));if(e)return e;let{size:t}=this;return t&&Math.ceil(this.total/t)||1}set pages(e){P(this,`pages`,e)}get page(){return Math.min(F(this.getAttribute(`page`))||1,this.pages)}set page(e){P(this,`page`,e)}setPage(e){this.page=e,this.dispatchEvent(new Event(`change`))}setSize(e){this.size=e,this.dispatchEvent(new Event(`change`))}#e=new Set;register(e){let t=this.#e;return t.add(e),e.update({...this.#t}),()=>{t.delete(e)}}connectedCallback(){}disconnectedCallback(){}adoptedCallback(){}#t={size:0,total:0,pages:1,page:1};attributeChangedCallback(e,t,n){if(t===n)return;let{size:r,total:i,pages:a,page:o}=this,s=this.#t;if(r===s.size&&i===s.total&&a===s.pages&&o===s.page)return;let c={size:r,total:i,pages:a,page:o};this.#t=c;for(let e of[...this.#e])e.update({...c})}};try{customElements.define(`nl-pagination`,qe),customElements.define(`nl-pagination-jumper`,Ie),customElements.define(`nl-pagination-next`,Le),customElements.define(`nl-pagination-page`,Re),customElements.define(`nl-pagination-pager`,ze),customElements.define(`nl-pagination-prev`,Be),customElements.define(`nl-pagination-sizer`,Ge),customElements.define(`nl-pagination-value`,Ke)}catch{}var Je=class extends HTMLElement{static observedAttributes=[`digit`,`value`,`sign`,`plus`,`zero`];#e=document.createElement(`span`);#t=document.createElement(`span`);#n=document.createElement(`span`);#r(){let e=this.currentDigit,t=this.currentSign;this.#n.innerText=this.sign?t:`${e}`,this.#e.style.insetBlockStart=`-${e}00%`,this.#t.style.insetBlockStart=`-${t===`+`?2:t===`-`?0:1}00%`}constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
604
+ `));#n=Object.create(null);#r=[];#i(){for(let e of this.#r)e.remove();let e=Object.create(null),t=[];this.#n=e,this.#r=t;let{disabled:n}=this,r=this.#e,i=this.page,a=this.pages,o=Math.max(2,i-2),s=Math.min(i+2,a-1),c=a=>{let o=document.createElement(`button`);o.type=`button`,o.innerText=String(a),o.setAttribute(`part`,a===i?`button current`:`button`),o.disabled=n||a===i,o.addEventListener(`click`,()=>{this.pagination?.setPage(a)}),t.push(o),r.appendChild(o),e[a]=o},l=()=>{let e=document.createElement(`span`);e.className=`placeholder`,e.setAttribute(`part`,`placeholder`),r.appendChild(e),t.push(e)};c(1),i>4&&l();for(let e=o;e<=s;e++)c(e);a-i>3&&l(),a>1&&c(a)}#a(){let{disabled:e}=this,t=String(this.page);for(let[n,r]of Object.entries(this.#n))r.disabled=e||n===t}updateCallback(){this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`disabled`:this.#a();break}}},Ve=class extends M{static observedAttributes=[`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=document.createElement(`button`);return e.type=`button`,e.setAttribute(`part`,`button`),this.#e.appendChild(e),e})();#r=this.#n.appendChild(document.createElement(`slot`));#i(){this.#n.disabled=this.disabled||this.page===1}constructor(){super(),this.addEventListener(`click`,e=>{let{defaultPrevented:t}=e;e.preventDefault(),this.#n.disabled?e.stopPropagation():t||this.pagination?.setPage(this.page-1)})}updateCallback(){this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`disabled`:this.#i();break}}};function He(e){let t=e?.split(/[,;: ]/).map(e=>parseInt(e)).filter(e=>e>=0);return t?.length?new Set(t):null}function Ue(e){if(typeof e==`string`){let t=He(e);return t?[...t]:[]}if(typeof e==`number`){let t=Math.floor(e);return t>=0?[t]:[]}if(typeof e==`bigint`)return e>=0n?[Number(e)]:[];try{return Array(e).flat(1/0).flatMap(Ue)}catch{return[]}}const We=[10,20,30,50,100];function Ge(e,t){let n=He(e)||new Set(We);return typeof t==`number`&&n.add(t),[...n].sort((e,t)=>e-t)}var Ke=class extends M{static observedAttributes=[`sizes`,`label`,`non-label`,`disabled`];get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}#e=this.attachShadow({mode:`closed`});#t=this.#e.appendChild(N(``));#n=(()=>{let e=this.#e.appendChild(document.createElement(`select`));return e.setAttribute(`part`,`input`),e.addEventListener(`change`,()=>{let{pagination:t}=this;t&&t.setSize(Number(e.value))}),e})();#r=(()=>{let e=document.createElement(`option`);return e.label=`-`,e.value=`0`,e})();#i=[];#a(){let e=He(this.getAttribute(`sizes`))||new Set(We),{size:t}=this;e.add(t);let n=this.#n;n.innerHTML=``,e.delete(0)&&n.appendChild(this.#r);let r=[];this.#i=r;let i=this.label;for(let t of[...e].sort((e,t)=>e-t)){let e=document.createElement(`option`);e.label=i.replace(/#/g,String(t)),e.value=String(t),r.push(e),n.appendChild(e)}n.value=String(t)}get label(){return this.getAttribute(`label`)||`#`}set label(e){e?this.setAttribute(`label`,e):this.removeAttribute(`label`)}get nonLabel(){return this.getAttribute(`non-label`)||`-`}set nonLabel(e){e?this.setAttribute(`non-label`,e):this.removeAttribute(`non-label`)}get sizes(){return Ge(this.getAttribute(`sizes`))}set sizes(e){let t=Ue(e);t.length?this.setAttribute(`sizes`,[...new Set(t)].sort((e,t)=>e-t).join(`,`)):this.removeAttribute(`sizes`)}#o=0;updateCallback(){let{size:e}=this;this.#o!==e&&(this.#o=e,this.#a())}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`sizes`:this.#a();break;case`label`:{let e=this.label;for(let t of this.#i)t.label=e.replace(/#/g,t.value);break}case`non-label`:this.#r.label=this.nonLabel;break;case`disabled`:this.#n.disabled=this.disabled;break}}},qe=class extends M{static observedAttributes=[`name`];get name(){let e=this.getAttribute(`name`)?.toLowerCase()||``;return[`size`,`total`,`pages`,`page`,`start`,`end`].includes(e)?e:`page`}set name(e){e?this.setAttribute(`name`,String(e)):this.removeAttribute(`name`)}#e={size:0,total:0,pages:1,page:1,start:0,end:0};#t=this.attachShadow({mode:`closed`});#n=this.#t.appendChild(N(``));#r=this.#t.appendChild(document.createTextNode(``));#i(){let e=this.#e[this.name];this.#r.textContent=String(e)}updateCallback(){let{size:e,total:t,pages:n,page:r}=this;this.#e={size:e,total:t,pages:n,page:r,start:Math.min((r-1)*e+1,t),end:e?Math.min(r*e,t):t},this.#i()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`name`:this.#i()}}};function P(e,t,n){if(n=typeof n==`string`?parseInt(n):typeof n==`number`?Math.floor(n):typeof n==`bigint`?Number(n):NaN,Number.isNaN(n)||n<0){e.removeAttribute(t);return}e.setAttribute(t,String(n))}function F(e){if(!e)return 0;let t=parseInt(e);return Number.isNaN(t)||t<0?0:t}var Je=class extends HTMLElement{static get Widget(){return M}static get Jumper(){return Le}static get Next(){return Re}static get Page(){return ze}static get Pager(){return Be}static get Prev(){return Ve}static get Sizer(){return Ke}static get Value(){return qe}static observedAttributes=[`size`,`total`,`pages`,`page`];get size(){return F(this.getAttribute(`size`))||0}set size(e){P(this,`size`,e)}get total(){return F(this.getAttribute(`total`))||0}set total(e){P(this,`total`,e)}get pages(){let e=F(this.getAttribute(`pages`));if(e)return e;let{size:t}=this;return t&&Math.ceil(this.total/t)||1}set pages(e){P(this,`pages`,e)}get page(){return Math.min(F(this.getAttribute(`page`))||1,this.pages)}set page(e){P(this,`page`,e)}setPage(e){this.page=e,this.dispatchEvent(new Event(`change`))}setSize(e){this.size=e,this.dispatchEvent(new Event(`change`))}#e=new Set;register(e){let t=this.#e;return t.add(e),e.update({...this.#t}),()=>{t.delete(e)}}connectedCallback(){}disconnectedCallback(){}adoptedCallback(){}#t={size:0,total:0,pages:1,page:1};attributeChangedCallback(e,t,n){if(t===n)return;let{size:r,total:i,pages:a,page:o}=this,s=this.#t;if(r===s.size&&i===s.total&&a===s.pages&&o===s.page)return;let c={size:r,total:i,pages:a,page:o};this.#t=c;for(let e of[...this.#e])e.update({...c})}};try{customElements.define(`nl-pagination`,Je),customElements.define(`nl-pagination-jumper`,Le),customElements.define(`nl-pagination-next`,Re),customElements.define(`nl-pagination-page`,ze),customElements.define(`nl-pagination-pager`,Be),customElements.define(`nl-pagination-prev`,Ve),customElements.define(`nl-pagination-sizer`,Ke),customElements.define(`nl-pagination-value`,qe)}catch{}var Ye=class extends HTMLElement{static observedAttributes=[`digit`,`value`,`sign`,`plus`,`zero`];#e=document.createElement(`span`);#t=document.createElement(`span`);#n=document.createElement(`span`);#r(){let e=this.currentDigit,t=this.currentSign;this.#n.innerText=this.sign?t:`${e}`,this.#e.style.insetBlockStart=`-${e}00%`,this.#t.style.insetBlockStart=`-${t===`+`?2:t===`-`?0:1}00%`}constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
605
605
  :host {
606
606
  display: inline-block;
607
607
  overflow: hidden;
@@ -675,7 +675,7 @@ footer {
675
675
  :host([sign]) .root {
676
676
  inset-inline-start: 100%;
677
677
  }
678
- `;let t=e.appendChild(this.#e);t.className=`root`;for(let e=0;e<10;e++)t.appendChild(document.createElement(`span`));let n=e.appendChild(this.#t);n.className=`sign`;for(let e=0;e<3;e++)n.appendChild(document.createElement(`span`));e.appendChild(this.#n).className=`value`}get currentDigit(){return Math.floor(Math.abs(this.value)/10**this.digit%10)}get currentSign(){let{value:e}=this;return e<0?`-`:e?this.plus?`+`:``:this.zero}get digit(){return parseInt(this.getAttribute(`digit`)||``)||0}set digit(e){e==null?this.removeAttribute(`digit`):this.setAttribute(`digit`,String(e))}get sign(){return this.hasAttribute(`sign`)}set sign(e){e?this.setAttribute(`sign`,``):this.removeAttribute(`sign`)}get plus(){return this.hasAttribute(`plus`)}set plus(e){e?this.setAttribute(`plus`,``):this.removeAttribute(`plus`)}get zero(){let e=this.getAttribute(`zero`);return e===`+`||e===`-`?e:``}set zero(e){e===`+`||e===`-`?this.setAttribute(`plus-zero`,e):this.removeAttribute(`zero`)}get value(){return parseFloat(this.getAttribute(`value`)||``)||0}set value(e){e==null?this.removeAttribute(`value`):this.setAttribute(`value`,String(e))}connectedCallback(){this.#r()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`digit`:case`value`:case`sign`:case`plus`:case`zero`:this.#r();break}}};try{customElements.define(`nl-roll-digit`,Je)}catch{}function Ye(e){return e?/^\d+$/.test(e)?`${e}px`:e:`0`}function Xe(e){let t=[`::slotted(*) {
678
+ `;let t=e.appendChild(this.#e);t.className=`root`;for(let e=0;e<10;e++)t.appendChild(document.createElement(`span`));let n=e.appendChild(this.#t);n.className=`sign`;for(let e=0;e<3;e++)n.appendChild(document.createElement(`span`));e.appendChild(this.#n).className=`value`}get currentDigit(){return Math.floor(Math.abs(this.value)/10**this.digit%10)}get currentSign(){let{value:e}=this;return e<0?`-`:e?this.plus?`+`:``:this.zero}get digit(){return parseInt(this.getAttribute(`digit`)||``)||0}set digit(e){e==null?this.removeAttribute(`digit`):this.setAttribute(`digit`,String(e))}get sign(){return this.hasAttribute(`sign`)}set sign(e){e?this.setAttribute(`sign`,``):this.removeAttribute(`sign`)}get plus(){return this.hasAttribute(`plus`)}set plus(e){e?this.setAttribute(`plus`,``):this.removeAttribute(`plus`)}get zero(){let e=this.getAttribute(`zero`);return e===`+`||e===`-`?e:``}set zero(e){e===`+`||e===`-`?this.setAttribute(`plus-zero`,e):this.removeAttribute(`zero`)}get value(){return parseFloat(this.getAttribute(`value`)||``)||0}set value(e){e==null?this.removeAttribute(`value`):this.setAttribute(`value`,String(e))}connectedCallback(){this.#r()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`digit`:case`value`:case`sign`:case`plus`:case`zero`:this.#r();break}}};try{customElements.define(`nl-roll-digit`,Ye)}catch{}function Xe(e){return e?/^\d+$/.test(e)?`${e}px`:e:`0`}function Ze(e){let t=[`::slotted(*) {
679
679
  flex-basis: calc(100% / ${e});
680
680
  max-inline-size: calc(100% / ${e});
681
681
  }`];for(let n=1;n<=e;n++)t.push(`::slotted([nl-span="${n}"]) {
@@ -685,14 +685,14 @@ footer {
685
685
  }`),t.push(`::slotted([nl-offset="${n}"]) {
686
686
  margin-inline-start: calc(${n}00% / ${e});
687
687
  }`);return t.join(`
688
- `)}function Ze(e){if(typeof e!=`number`)return 0;let t=Math.floor(e);return Number.isFinite(t)&&t>1?t:0}var Qe=class extends HTMLElement{static observedAttributes=[`aliquot`,`gutter-inline`,`gutter-block`];#e=document.createElement(`style`);#t=document.createElement(`style`);get gutterInline(){return Ye(this.getAttribute(`gutter-inline`))}set gutterInline(e){this.setAttribute(`gutter-inline`,String(e))}get gutterBlock(){return Ye(this.getAttribute(`gutter-block`))}set gutterBlock(e){this.setAttribute(`gutter-block`,String(e))}get aliquot(){let e=parseInt(this.getAttribute(`aliquot`)||``);return!e||e<2?24:e}set aliquot(e){let t=Ze(e);t?this.setAttribute(`aliquot`,String(t)):this.removeAttribute(`aliquot`)}constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
688
+ `)}function Qe(e){if(typeof e!=`number`)return 0;let t=Math.floor(e);return Number.isFinite(t)&&t>1?t:0}var $e=class extends HTMLElement{static observedAttributes=[`aliquot`,`gutter-inline`,`gutter-block`];#e=document.createElement(`style`);#t=document.createElement(`style`);get gutterInline(){return Xe(this.getAttribute(`gutter-inline`))}set gutterInline(e){this.setAttribute(`gutter-inline`,String(e))}get gutterBlock(){return Xe(this.getAttribute(`gutter-block`))}set gutterBlock(e){this.setAttribute(`gutter-block`,String(e))}get aliquot(){let e=parseInt(this.getAttribute(`aliquot`)||``);return!e||e<2?24:e}set aliquot(e){let t=Qe(e);t?this.setAttribute(`aliquot`,String(t)):this.removeAttribute(`aliquot`)}constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(document.createElement(`style`)).textContent=`
689
689
  :host { display: flex; flex-flow: row wrap; }
690
690
  ::slotted(*) { box-sizing: border-box; }
691
691
  ::slotted([nl-span=0]) { flex: 0 0 0%; max-inline-size: 0%; }
692
- `,e.appendChild(this.#t),e.appendChild(this.#e),e.appendChild(document.createElement(`slot`))}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`aliquot`:this.#t.textContent=Xe(this.aliquot);break;case`gutter-inline`:case`gutter-block`:this.#e.textContent=`::slotted(*) {
692
+ `,e.appendChild(this.#t),e.appendChild(this.#e),e.appendChild(document.createElement(`slot`))}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`aliquot`:this.#t.textContent=Ze(this.aliquot);break;case`gutter-inline`:case`gutter-block`:this.#e.textContent=`::slotted(*) {
693
693
  padding-block: ${this.gutterBlock};
694
694
  padding-inline: ${this.gutterInline};
695
- }`;break}}};try{customElements.define(`nl-row`,Qe)}catch{}var $e=class extends HTMLElement{static observedAttributes=[`column`,`space`,`unit`];get column(){return this.hasAttribute(`column`)}set column(e){e?this.setAttribute(`column`,``):this.removeAttribute(`column`)}get space(){let e=parseFloat(this.getAttribute(`space`)||``);return Number.isNaN(e)||!Number.isFinite(e)?16:e<=0?0:e}set space(e){typeof e!=`number`||!Number.isFinite(e)?this.removeAttribute(`space`):this.setAttribute(`space`,e<=0?`0`:String(e))}get unit(){return this.getAttribute(`unit`)||`px`}set unit(e){e?this.setAttribute(`unit`,e):this.removeAttribute(`unit`)}#e=document.createElement(`style`);constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(this.#e),e.appendChild(document.createElement(`style`)).textContent=`
695
+ }`;break}}};try{customElements.define(`nl-row`,$e)}catch{}var et=class extends HTMLElement{static observedAttributes=[`column`,`space`,`unit`];get column(){return this.hasAttribute(`column`)}set column(e){e?this.setAttribute(`column`,``):this.removeAttribute(`column`)}get space(){let e=parseFloat(this.getAttribute(`space`)||``);return Number.isNaN(e)||!Number.isFinite(e)?16:e<=0?0:e}set space(e){typeof e!=`number`||!Number.isFinite(e)?this.removeAttribute(`space`):this.setAttribute(`space`,e<=0?`0`:String(e))}get unit(){return this.getAttribute(`unit`)||`px`}set unit(e){e?this.setAttribute(`unit`,e):this.removeAttribute(`unit`)}#e=document.createElement(`style`);constructor(){super();let e=this.attachShadow({mode:`closed`});e.appendChild(this.#e),e.appendChild(document.createElement(`style`)).textContent=`
696
696
  :host {
697
697
  display: inline-block;
698
698
  }
@@ -706,7 +706,7 @@ footer {
706
706
  :host([column]) ::slotted(*) {
707
707
  display: block;
708
708
  }
709
- `,e.appendChild(document.createElement(`slot`))}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`column`:case`space`:case`unit`:this.#e.textContent=`::slotted(*) {margin-${this.column?`block`:`inline`}-end: var(--nl-space, ${this.space}${this.unit})}`;break}}};try{customElements.define(`nl-space`,$e)}catch{}function et(e,t,n){n?e.setAttribute(t,``):e.removeAttribute(t)}function I(e,t,n=0,r=1){let i=e?parseFloat(e):t;return Math.max(n,Math.min(Number.isNaN(i)?t:i,r))}function tt(e,t,n,r=0,i=1){let a=typeof n==`string`?parseFloat(n):n===null?NaN:n;if(Number.isNaN(a)){e.removeAttribute(t);return}e.setAttribute(t,String(Math.max(r,Math.min(a,i))))}const nt=new Set([`vertical-lr`,`vertical-rl`,`sideways-lr`,`sideways-rl`]);function rt(e){let t=getComputedStyle(e),n=t.writingMode?.toLowerCase(),r=nt.has(n),i=t.flexDirection.toLocaleLowerCase(),a=i.includes(`column`),o=a?[`vertical-rl`,`sideways-rl`].includes(n):t.direction.toLowerCase()===`rtl`!=(n===`sideways-lr`);return o=o!==i.includes(`reverse`),[r!==a,o]}var it=class extends HTMLElement{static observedAttributes=[`column`,`disabled`,`min`,`max`,`value`];get column(){return this.getAttribute(`column`)!==null}set column(e){et(this,`column`,e)}get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){et(this,`disabled`,e)}get min(){return I(this.getAttribute(`min`),0,0,1)}set min(e){tt(this,`min`,e,0,I(this.getAttribute(`max`),1,0,1))}get max(){return I(this.getAttribute(`max`),1,this.min,1)}set max(e){tt(this,`max`,e,this.min,1)}get value(){return I(this.getAttribute(`value`),.5,this.min,this.max)}set value(e){tt(this,`value`,e,this.min,this.max)}#e=null;#t(){let e=this.#e;e!==null&&(this.#i.states.delete(`--moving`),this.#e=null,this.#a.releasePointerCapture(e))}#n=(()=>{let e=this.attachShadow({mode:`closed`});return e.appendChild(document.createElement(`style`)).textContent=`
709
+ `,e.appendChild(document.createElement(`slot`))}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`column`:case`space`:case`unit`:this.#e.textContent=`::slotted(*) {margin-${this.column?`block`:`inline`}-end: var(--nl-space, ${this.space}${this.unit})}`;break}}};try{customElements.define(`nl-space`,et)}catch{}function tt(e,t,n){n?e.setAttribute(t,``):e.removeAttribute(t)}function I(e,t,n=0,r=1){let i=e?parseFloat(e):t;return Math.max(n,Math.min(Number.isNaN(i)?t:i,r))}function nt(e,t,n,r=0,i=1){let a=typeof n==`string`?parseFloat(n):n===null?NaN:n;if(Number.isNaN(a)){e.removeAttribute(t);return}e.setAttribute(t,String(Math.max(r,Math.min(a,i))))}const rt=new Set([`vertical-lr`,`vertical-rl`,`sideways-lr`,`sideways-rl`]);function it(e){let t=getComputedStyle(e),n=t.writingMode?.toLowerCase(),r=rt.has(n),i=t.flexDirection.toLocaleLowerCase(),a=i.includes(`column`),o=a?[`vertical-rl`,`sideways-rl`].includes(n):t.direction.toLowerCase()===`rtl`!=(n===`sideways-lr`);return o=o!==i.includes(`reverse`),[r!==a,o]}var at=class extends HTMLElement{static observedAttributes=[`column`,`disabled`,`min`,`max`,`value`];get column(){return this.getAttribute(`column`)!==null}set column(e){tt(this,`column`,e)}get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){tt(this,`disabled`,e)}get min(){return I(this.getAttribute(`min`),0,0,1)}set min(e){nt(this,`min`,e,0,I(this.getAttribute(`max`),1,0,1))}get max(){return I(this.getAttribute(`max`),1,this.min,1)}set max(e){nt(this,`max`,e,this.min,1)}get value(){return I(this.getAttribute(`value`),.5,this.min,this.max)}set value(e){nt(this,`value`,e,this.min,this.max)}#e=null;#t(){let e=this.#e;e!==null&&(this.#i.states.delete(`--moving`),this.#e=null,this.#a.releasePointerCapture(e))}#n=(()=>{let e=this.attachShadow({mode:`closed`});return e.appendChild(document.createElement(`style`)).textContent=`
710
710
  :host {
711
711
  display: flex;
712
712
  border: 1px solid;
@@ -743,7 +743,7 @@ slot {
743
743
  :host(:state(--moving)) div, div:hover {
744
744
  opacity: .5;
745
745
  }
746
- `,e})();#r=(()=>{let e=document.createElement(`slot`);return e.name=`start`,e.className=`start`,this.#n.appendChild(e),e})();#i=this.attachInternals();#a=(()=>{let e=document.createElement(`slot`);e.name=`trigger`,e.tabIndex=0,e.className=`trigger`,e.appendChild(document.createElement(`div`)),this.#n.appendChild(e);let t=0;e.addEventListener(`pointerdown`,n=>{if(this.hidden||this.disabled)return;let{pointerId:r}=n,i=this.#e;if([null,r].includes(i))switch(this.#i.states.add(`--moving`),this.#e=r,e.setPointerCapture(r),rt(e).map((e,t)=>e?2**t:0).reduce((e,t)=>e+t)){case 0:t=-n.offsetX;break;case 1:t=-n.offsetY;break;case 2:t=n.offsetX-e.offsetWidth;break;case 3:t=n.offsetY-e.offsetHeight;break}});let n=this,r=t=>t?n.clientHeight-e.offsetHeight:n.clientWidth-e.offsetWidth,i=i=>{let[a,o]=rt(e),s=0;switch([a,o].map((e,t)=>e?2**t:0).reduce((e,t)=>e+t)){case 0:s=i.clientX-n.getBoundingClientRect().left;break;case 1:s=i.clientY-n.getBoundingClientRect().top;break;case 2:s=n.getBoundingClientRect().right-i.clientX;break;case 3:s=n.getBoundingClientRect().bottom-i.clientY;break}let{max:c,min:l}=this,u=Math.max(l,Math.min((s+t)/r(a),c));this.setAttribute(`value`,String(u))};return e.addEventListener(`pointermove`,t=>{let{pointerId:n}=t;e.hasPointerCapture(n)&&i(t)}),e.addEventListener(`pointerup`,e=>{let{pointerId:t}=e;t===this.#e&&(i(e),this.#t())}),e.addEventListener(`pointercancel`,e=>{let{pointerId:t}=e;t===this.#e&&(i(e),this.#t())}),e.addEventListener(`keydown`,t=>{if(this.hidden||this.disabled||this.#e!==null||this.#n.activeElement!==e)return;let{max:n,min:i}=this;switch(t.code){case`Home`:t.preventDefault(),this.setAttribute(`value`,String(Math.max(i,0)));return;case`End`:t.preventDefault(),this.setAttribute(`value`,String(Math.min(1,n)));return}let[a,o]=rt(e),s=0;switch(t.code){case`ArrowUp`:s=a?-1:0;break;case`ArrowDown`:s=a?1:0;break;case`ArrowLeft`:s=a?0:-1;break;case`ArrowRight`:s=a?0:1;break}if(!s)return;t.preventDefault(),o&&(s=-s),t.ctrlKey&&(s*=100),t.shiftKey&&(s*=10);let c=I(this.getAttribute(`value`),.5,i,n);c=Math.max(i,Math.min(c+s/r(a),n)),this.setAttribute(`value`,String(c))}),e})();#o=(()=>{let e=document.createElement(`slot`);return e.name=`end`,e.className=`end`,this.#n.appendChild(e),e})();connectedCallback(){}disconnectedCallback(){this.#t()}adoptedCallback(){this.#t()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`hidden`:if(!this.hidden)break;this.#t();break;case`disabled`:n===null?this.#a.tabIndex=0:this.#a.removeAttribute(`tabindex`),this.#t();break;case`min`:case`max`:case`value`:{let{value:e}=this;this.#r.style.flex=`${e}`,this.#o.style.flex=`${1-e}`;break}}}};try{customElements.define(`nl-split`,it)}catch{}var at=class{#e;#t;constructor(){let e=document.createElement(`nl-pagination`);e.size=20,e.appendChild(document.createElement(`nl-pagination-value`)).name=`start`,e.appendChild(document.createTextNode(`-`)),e.appendChild(document.createElement(`nl-pagination-value`)).name=`end`,e.appendChild(document.createTextNode(`/`)),e.appendChild(document.createElement(`nl-pagination-value`)).name=`total`,e.appendChild(document.createElement(`nl-pagination-prev`)).innerText=`上一页`,e.appendChild(document.createElement(`nl-pagination-pager`)),e.appendChild(document.createElement(`nl-pagination-next`)).innerText=`下一页`,e.appendChild(document.createElement(`nl-pagination-sizer`));let t=new Set;e.addEventListener(`change`,()=>{for(let e of t)e()}),this.#e=t,this.#t=e}get root(){return this.#t}get size(){return this.#t.size}set size(e){this.#t.size=e}get page(){return this.#t.page}set page(e){this.#t.page=e}get total(){return this.#t.total}set total(e){this.#t.total=e}listen(e){let t=this.#e,n=()=>e(this);return t.add(n),()=>{t.delete(n)}}destroy(){}};function ot(e){e.listen(`update`,()=>{let{container:t}=e;t.innerHTML=``})}function*st(e,t,n){if(!e)return;let r=e.indexOf(`?`),i=r<0?e:e.slice(0,r);if(r>=0&&r+1<e.length)for(let n=e.slice(r).split(`&`);n.length;n.pop()){let e=t.get(`${i}${n.join(`&`)}`);e?.length&&(yield e)}let a=t.get(i);a?.length&&(yield a);let o=n.get(i);o?.length&&(yield o.map(e=>e[0]))}function*ct(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let e;e=t.nextNode();)yield e}function lt(e,t){let n=[],r=[...ct(t)].filter(e=>e.nodeValue?.length),i=r.reduce((e,t)=>{let n=e[e.length-1]?.[1]||0;return[...e,[n,n+(t.nodeValue?.length||0),t]]},[]),a=r.map(e=>e.nodeValue).join(``),o=0;for(let t of e){let e=a.indexOf(t,o);if(e===-1)return[];let r=e+t.length,s=i.findLast(([t])=>t<=e);if(!s)return[];let c=i.findLast(([,e])=>e>=r);if(!c)return[];o=e+t.length;let l=new Range;l.setStart(s[2],e-s[0]),l.setEnd(c[2],r-s[0]),n.push(l)}return n}function ut(e,t,n={}){let r=new Map,a=new Map,o=null,s=[],c=[];function l(e){let t=document.createElement(`a`);return t.href=e.path||`#`,t.appendChild(document.createTextNode(e.label||e.title||``)),t.title=e.title||e.label||``,t}let u=null;function f(e,t){let{children:n}=e;if(!n.length){let t=document.createElement(`div`),n=t.appendChild(document.createElement(`a`));n.appendChild(document.createTextNode(e.label||e.title||``));let{page:o,path:s,uri:c,target:d}=e,f=null;if(o)f=new URL(s?.[0]===`/`?`${o}${s}`:`${o}/${s||``}`,i.root),n.href=f.href,d&&typeof d==`string`&&(n.target=d);else if(c){n.href=c;try{f=new URL(c),f.origin!==location.origin&&(f=null)}catch{}d!==``&&(n.target=d??`_blank`)}if(f&&(n.target||`_self`)===`_self`){n.addEventListener(`click`,()=>{u=t,requestIdleCallback(()=>{u===t&&(u=null)})});let{pathname:e,search:i}=f,o=(i||`?`)===`?`?e:`${e}${i}`,s=a.get(o);s?s.push(t):a.set(e,[t]);let c=r.get(o);c?c.push([t,i.length]):r.set(e,[[t,i.length]])}for(let n of e.buttons||[])t.appendChild(l(n));return t.className=`NavMenu-item`,{el:t,filter(e,r){let i=r?lt(r,n):[];return t.hidden=!!(!e&&r&&!i.length),i}}}let o=document.createElement(`nl-collapse`);o.setAttribute(`animation`,``),o.setAttribute(`menu`,``);let s=o.appendChild(document.createElement(`div`));s.appendChild(document.createTextNode(e.label||e.title||``)),s.className=`NavMenu-label`,s.slot=`label`,s.style.flex=`1`;for(let t of e.buttons||[])o.appendChild(l(t)).slot=`label`;let c=p(o,n,t+1);return c.length?{el:o,filter(e,t){if(!t){for(let t of c)t.filter(e);return o.hidden=!1,o.open=!1,[]}let n=lt(t,s),r=!!(e||n.length),i=c.flatMap(e=>e.filter(r,t));o.open=!!i.length;let a=[...n,...i];return o.hidden=!e&&!a.length,a}}:null}function p(e,t,n){let r=!1,i=!1,a=[];for(let o of t){if(!o){if(!r)continue;i=!0;continue}i&&(i=!1,e.appendChild(document.createElement(`hr`)));let t=f(o,n);t&&(a.push(t),r=!0,e.appendChild(t.el),s.push(t.el),t.el.style.setProperty(`--NavMenu-level`,String(n)))}return a}let m=p(e,t,0),h=!1;function _(){if(!h){h=!0;for(let e of s)e.remove();for(let e of c)e()}}let v=n.signal||d;v.aborted?_():v.addEventListener(`abort`,_,{once:!0});let y=[];return g(()=>n.active?.replace(/#.*/,``)||``,t=>{for(let n of st(t,a,r)){let t=u&&n.includes(u)?u:null;if(t&&(u=null),!t&&o&&n.includes(o))return;let r=t||n[0],i=[],a=r.parentElement;for(;a&&a!==e;a=a.parentElement)i.push(a);if(a!==e)return;y=i,o?.classList.remove(`NavMenu-current`);for(let e of y)e.setAttribute(`open`,``);o=r,o?.classList.add(`NavMenu-current`);return}},{signal:v,immediate:!0}),e=>{let t=e.toLowerCase().split(/[\s\n]+/).filter(Boolean);if(t.length)return m.flatMap(e=>e.filter(!1,t));m.flatMap(e=>e.filter(!1));for(let e of y)e.setAttribute(`open`,``);return[]}}const L=document.createElement(`div`);L.style.display=`flex`,L.style.flexDirection=`column`;const dt=L.appendChild(document.createElement(`header`));dt.classList.add(`NavMenu-header`);const R=dt.appendChild(document.createElement(`input`));R.placeholder=`过滤菜单...`,R.type=`search`;const z=dt.appendChild(document.createElement(`button`));z.appendChild(o(`refresh`,!0)),z.classList.add(`icon`),z.title=`刷新`;const B=L.appendChild(document.createElement(`main`));B.style.flex=`1`,B.style.overflow=`auto`,B.classList.add(`NavMenu`);let ft=null;function pt(){let e=ft?.(R.value)||[],t=new Highlight(...e);CSS.highlights.set(`NavMenu-filter-highlight`,t)}R.addEventListener(`input`,pt);const mt=a(()=>e.fromDefine(i.menus,[])),ht=a(()=>{let t=r.permissions,n=mt.get();return t.size<0?n:e.filter(n,e=>{let n=e.permission;return n?u(n,t):!0})}),gt=c(``);let _t=null;l(()=>{_t?.abort(),B.innerHTML=``,_t=new AbortController,ft=ut(B,ht.get(),{signal:_t.signal,get active(){return gt.get()}}),pt()});function vt(e,t){gt.set(`${e}${t}`)}z.addEventListener(`click`,()=>i.refresh());function yt(e,t,n){if(!e){let e=o(`user`,t);return n||e.setAttribute(`fill-opacity`,`0.5`),e}let r=document.createElement(`img`);return r.src=e,r}function bt(e,t,n=d){e.classList.add(`${_}-user-avatar`);let i=a(()=>r.single?null:r.session?.avatar||``).get(),s=new AbortController,c=AbortSignal.any([s.signal,n]),u=i===null?o(`singleUser`,c):yt(i,c,t);e.appendChild(u),l(()=>{let a=r.single?null:r.session?.avatar||``;if(a===i)return;i=a,s?.abort(),s=new AbortController;let c=AbortSignal.any([s.signal,n]),l=i===null?o(`singleUser`,c):yt(i,c,t);!t&&i===null&&l.setAttribute(`fill-opacity`,`0.5`),e.replaceChild(l,u),u.remove(),u=l},n);let f=a(()=>{let e=r.target,t=r.session;return!e||e.id===(t?.id||``)?null:e.avatar||``}),p=null,m=null,h=null;l(()=>{let r=f.get();r!==p&&(p=r,m?.remove(),m=null,h?.abort(),r!==null&&(h=new AbortController,m=yt(r,AbortSignal.any([h.signal,n]),t),e.insertBefore(m,u)))},n)}const V=document.createElement(`div`);V.classList.add(`${_}-user`);const H=document.createElement(`div`);H.classList.add(`${_}-user-button`),bt(H,!0);const U=V.appendChild(document.createElement(`span`));U.classList.add(`${_}-user-info`);const xt=U.appendChild(document.createElement(`span`));bt(xt),xt.classList.add(`avatar`);const St=U.appendChild(document.createElement(`span`));St.classList.add(`username`),St.innerText=`用户名`;const Ct=U.appendChild(document.createElement(`span`));if(Ct.classList.add(`btns`),i.help){let e=Ct.appendChild(document.createElement(`a`));e.href=i.help,e.target=`_blank`,e.appendChild(o(`help`,!0)),e.title=`帮助`}const wt=Ct.appendChild(document.createElement(`div`));wt.appendChild(o(`logout`,!0)),wt.title=`退出登录`,l(()=>{wt.hidden=!r.current}),wt.addEventListener(`click`,()=>r.exit()),l(()=>{St.innerText=r.current?.name||``});const Tt=a(()=>e.fromDefine(i.userMenus,[])),Et=a(()=>{let t=Tt.get();return r.current?t:e.filter(t,e=>!e.logged)}),W=V.appendChild(document.createElement(`main`));W.style.flex=`1`,W.style.overflow=`auto`,W.classList.add(`NavMenu`);let Dt=null;l(()=>{Dt?.abort(),W.innerHTML=``,Dt=new AbortController,ut(W,Et.get(),{signal:Dt.signal})});const G=document.createElement(`a`);G.classList.add(`${_}-logo`),G.href=i.root,g(()=>{let e=i.logo;return e&&m(e)},e=>{if(G.innerHTML=``,e){let t=G.appendChild(document.createElement(`img`));t.src=e.href,t.classList.add(`logo`)}else G.appendChild(o(`logo`,!0)).classList.add(`logo`)},{immediate:!0});const Ot={404:{title:`您所请求的页面无法找到`,description:`服务器无法正常提供信息。
747
- 目标页面可能已经被更改、删除或移到其他位置,或您所输入页面地址错误。`}};function kt(e,t){if((t??``)==``){e.container.appendChild(document.createTextNode(`空页面`));return}let n=(typeof t==`number`||typeof t==`string`)&&Object.hasOwn(Ot,t)&&Ot[t]||Ot[404],r=n?.title||`Error`,i=n?.description,a=document.createElement(`div`),o=a.appendChild(document.createElement(`div`)),s=o.appendChild(document.createElement(`div`)),c=o.appendChild(document.createElement(`div`));if(a.style.marginBlock=`8%`,a.style.marginInline=`auto`,a.style.inlineSize=`600px`,a.style.maxInlineSize=`100%`,a.style.padding=`20px`,s.style.paddingBlock=`20px`,s.style.fontSize=`20px`,s.style.color=`#8e8e8e`,s.style.textAlign=`center`,c.style.fontSize=`13px`,c.style.lineHeight=`1.3em`,c.style.color=`#b5b5b5`,s.appendChild(document.createTextNode(r)),e.title=r||`Error`,i&&typeof i==`string`)for(let e of i.split(`
748
- `))c.appendChild(document.createTextNode(e)),c.appendChild(document.createElement(`br`));e.container.appendChild(a),e.loading=!1}const K=`${_}-allSider-nav`,At=document.createElement(`header`);At.className=`${K}-header`;const q=At.appendChild(document.createElement(`div`));q.classList.add(`${K}-actions`);const jt=At.appendChild(document.createElement(`div`));jt.classList.add(`${K}-sidebar`);const Mt=`${K}-open`;let J=null;function Nt(){window.innerWidth>800||J?.()}var Pt=class{button;sider;#e;#t=!1;get disabled(){return this.#t}set disabled(e){e?this.disable():this.enable()}disable(){if(this.#t)return;this.#t=!0;let e=this.#e;J===e&&e(),this.button.hidden=!0,this.sider.hidden=!0}enable(){this.#t&&(this.#t=!1,this.button.hidden=!1)}#n=()=>this.toggle();constructor(e,t){let n=t instanceof HTMLElement?t:document.createElement(`div`),r=e instanceof HTMLElement?e:document.createElement(`div`);n.tabIndex=0,n.classList.add(`${K}-button`),r.hidden=!0,jt.appendChild(r),n.classList.add(`${K}-selectable`),n.addEventListener(`click`,this.#n),this.#e=()=>{J=null,document.body.classList.remove(Mt),n.classList.remove(`${K}-selected`),r.hidden=!0},this.button=n,this.sider=r}get open(){return J===this.#e}set open(e){e?this.show():this.hide()}show(){if(this.#t)return;let e=this.#e;J!==e&&(J?.(),J=e,document.body.classList.add(Mt),this.button.classList.add(`${K}-selected`),this.sider.hidden=!1)}toggle(){if(this.#t)return;let e=this.#e;if(J===e){e();return}this.show()}hide(){if(this.#t)return;let e=this.#e;J===e&&e()}remove(){let e=this.#e;J===e&&e();let{button:t,sider:n}=this;t.remove(),n.remove(),t.classList.remove(`${K}-button`),t.classList.remove(`${K}-selectable`),t.removeEventListener(`click`,this.#n),n.hidden=!1}};jt.addEventListener(`click`,e=>{e.target===e.currentTarget&&J?.()});var Ft=class e{root=document.createElement(`div`);#e=new Set;constructor(e){let t=this.root;e.appendChild(t),t.className=`${K}-group`}remove(){this.root.remove();for(let e of[...this.#e])e()}createGroup(){let t=new e(this.root),n=this.#e,r=()=>{n.delete(r),t.remove()};return n.add(r),t}createAction(e){let t=document.createElement(e?`a`:`div`);t.tabIndex=0,t.classList.add(`${K}-button`),t.addEventListener(`click`,()=>{Nt()}),this.root.appendChild(t);let n=this.#e,r=()=>{n.delete(r),t.remove()};return n.add(r),t}createSider(e,t){let n=new Pt(e,t);this.root.appendChild(n.button);let r=this.#e,i=()=>{r.delete(i),n.remove()};return r.add(i),n}};const It=document.createElement(`div`),Lt=new Ft(q),Rt=new Ft(q);new Ft(q),q.appendChild(document.createElement(`span`));const zt=new Ft(q),Y=Rt.createSider(It);Y.button.innerText=`页面`,Y.disabled=!0;var Bt=class extends n{#e;#t;constructor(e,t,n,r,i){super(t,n,r,i),this.#e=e,this.#t=t,i.addEventListener(`abort`,()=>{this.#n()})}insert(){super.insert(),this.#e.show&&(Y.disabled=!1)}#n(){this.#e.show&&!this.#t.children.length&&(Y.disabled=!0)}remove(){super.remove(),this.#n()}},Vt=class extends t{#e=(()=>{let e=document.createElement(`div`);return e.classList.add(`Page-sides`),It.appendChild(e),e})();destroy(){return super.destroy()?(this.#e.remove(),!0):!1}toggle(e){super.toggle(e),Y.disabled=!(e&&this.#e.children.length)}get siderOpen(){return Y.open}set siderOpen(e){e?Y.show():Y.hide()}createSider(e,t){if(this.destroyed)throw Error(`页面组件已被销毁`);t?.throwIfAborted();let n=this.#e;return new Bt(this,n,null,e!==!1,t instanceof AbortSignal?AbortSignal.any([t,this.signal]):this.signal)}constructor(e){super(e),e&&(Y.disabled=!this.#e.children.length)}};function Ht(e,t,n){let r=document.createElement(`nl-menu`),i=!1,a=!1,o=()=>{i=!0,a&&(a=!1,r.appendChild(document.createElement(`hr`)))};for(let s of e){if(!s){if(!i)continue;a=!0;continue}let{children:e}=s;if(!e?.length){let e=new AbortController,i=t(s,AbortSignal.any([n,e.signal]));if(!i){e.abort();continue}o(),r.appendChild(i);continue}let c=Ht(e,t,n);if(!c)continue;o();let l=r.appendChild(c),u=l.insertBefore(document.createElement(`div`),l.firstChild);u.appendChild(document.createTextNode(s.label||s.title||``)),u.slot=`label`}return i?r:null}function Ut(e,t,n){if(n.aborted)return null;let r=document.createElement(`div`),i=!1,a=!1,o=()=>{i=!0,a&&(a=!1,r.appendChild(document.createElement(`hr`)))};for(let s of e){if(!s){if(!i)continue;a=!0;continue}let{children:e}=s;if(!e?.length){let e=new AbortController,i=t(s,AbortSignal.any([n,e.signal]),!0);if(!i){e.abort();continue}o(),r.appendChild(i);continue}let c=Ht(e,t,n);if(!c)continue;o();let l=r.appendChild(document.createElement(`button`));l.appendChild(document.createTextNode(s.label||s.title||``)),c.targetElement=l,l.addEventListener(`click`,()=>c.show?.()),r.appendChild(c)}return r.childNodes.length?(r.classList.add(`MenuButtons`),r):null}function Wt(e,t,n){let r=document.createElement(`a`),a=n?document.createElement(`button`):null;r.appendChild(document.createTextNode(e.label||e.title||``));let{page:o,path:s,uri:c,target:u,command:d,script:f,click:p}=e;function m(){let t=e.disabled;return!!(typeof t==`function`?t():t)}return l(()=>{let e=m();r.disabled=e,a&&(a.disabled=e)},t),o?(r.href=new URL(s?.[0]===`/`?`${o}${s}`:`${o}/${s||``}`,i.root).href,u&&typeof u==`string`&&(r.target=u)):c?(r.href=c,u!==``&&(r.target=u??`_blank`)):typeof p==`function`?r.addEventListener(`click`,e=>{m()||e.defaultPrevented||p()}):(d||f)&&r.addEventListener(`click`,e=>{m()||e.defaultPrevented}),a?(a.appendChild(r),a):r}function Gt(e,t,n,r){let i=document.createElement(`div`),a=Ht(e,n,r);if(!a)return null;let s=i.appendChild(document.createElement(`button`)),c=t?.label||t?.title||``;return c?s.appendChild(document.createTextNode(c)):s.appendChild(o(t?.icon||`more`,r)),a.targetElement=s,s.addEventListener(`click`,()=>a.show()),i.appendChild(a),i}var Kt={components:{List:T,Pagination:at,createMenuButtons:Ut,createMenuItem:Wt,createMenuButton:Gt},updatePath:vt,pageManager:w,elements:[f,At],classNames:[_,`${_}-allSider`],styleFiles:[`theme-allSider.css`],home:ot,rootClassName:`${_}-root`,createPage(e){return new Vt(e)},renderError(e,t){kt(e,t)},setup(e){S(!1),G.addEventListener(`click`,()=>{Nt()},{signal:e}),q.insertBefore(G,q.firstElementChild);let t=Lt.createSider(L);t.button.appendChild(o(`menu`,e)),t.button.title=`菜单`;let n=Lt.createSider(y);n.button.appendChild(o(`activity`,e)),n.button.title=`活动`,window.innerWidth>800&&t.show();let r=zt.createSider(V,H);e.addEventListener(`abort`,()=>{G.remove(),t.remove(),n.remove(),r.remove()},{once:!0})}};const X=`${_}-base`,qt=[`theme-base.css`],Jt=document.createElement(`header`),Z=Jt.appendChild(document.createElement(`div`));Z.classList.add(`${X}-header`);const Yt=Jt.appendChild(document.createElement(`div`));Yt.classList.add(`${X}-sidebar`);const Xt=Z.appendChild(o(`menu`,!0));Xt.classList.add(`${X}-menu-button`);const Zt=Z.appendChild(document.createElement(`span`)),Qt=`${X}-menu-open`;Xt.addEventListener(`click`,()=>{document.body.classList.toggle(Qt)}),Yt.addEventListener(`click`,e=>{e.target===e.currentTarget&&document.body.classList.remove(Qt)});var $t={components:{List:T,Pagination:at,createMenuButtons:Ut,createMenuItem:Wt,createMenuButton:Gt},updatePath:vt,pageManager(e){let t=!1;l(()=>{if(!e.current){t&&e.destroy();return}t=!0,document.title=[e?e.title:``,i.title||`拥道YongDall`].filter(Boolean).join(` | `)},e.signal)},elements:[Jt,f],classNames:[_,X],styleFiles:qt,home:ot,rootClassName:`${_}-root`,createPage(e){return new t(e)},renderError(e,t){kt(e,t)},setup(e){G.addEventListener(`click`,()=>{window.innerWidth>800||document.body.classList.remove(Qt)},{signal:e});let t=document.createElement(`div`);t.classList.add(`${X}-header-title`),l(()=>{t.innerText=i.title||i.company||``},e),Z.insertBefore(G,Zt),Z.insertBefore(t,Zt),window.innerWidth>800&&document.body.classList.add(Qt),Yt.appendChild(L),document.body.appendChild(V),V.setAttribute(`popover`,`auto`),H.addEventListener(`click`,()=>{V.showPopover()},{signal:e}),Z.appendChild(H),e.addEventListener(`abort`,()=>{G.remove(),t.remove(),L.remove(),V.removeAttribute(`popover`),V.remove(),H.remove()},{once:!0})}};const Q=`${_}-tabs`,en=document.createElement(`header`),$=en.appendChild(document.createElement(`div`));$.classList.add(`${Q}-header`);const tn=en.appendChild(document.createElement(`div`));tn.classList.add(`${Q}-sidebar`);const nn=$.appendChild(o(`menu`,!0));nn.classList.add(`${Q}-menu-button`);const rn=$.appendChild(document.createElement(`span`)),an=`${Q}-menu-open`;nn.addEventListener(`click`,()=>{document.body.classList.toggle(an)});function on(){window.innerWidth>800||document.body.classList.remove(an)}tn.addEventListener(`click`,e=>{e.target===e.currentTarget&&document.body.classList.remove(an)});var sn={components:{List:T,Pagination:at,createMenuButtons:Ut,createMenuItem:Wt,createMenuButton:Gt},updatePath:vt,pageManager:w,elements:[en,f],classNames:[_,`${_}-tabs`],styleFiles:[`theme-tabs.css`],home:ot,rootClassName:`${_}-root`,createPage(e){return new t(e)},renderError(e,t){kt(e,t)},setup(e){S(!0),G.addEventListener(`click`,()=>{on()},{signal:e});let t=document.createElement(`div`);t.classList.add(`${Q}-header-title`),l(()=>{t.innerText=i.title||i.company||``},e),$.insertBefore(G,rn),$.insertBefore(t,rn),en.appendChild(y),window.innerWidth>800&&document.body.classList.add(an),tn.appendChild(L),document.body.appendChild(V),V.setAttribute(`popover`,`auto`),H.addEventListener(`click`,()=>{V.showPopover()},{signal:e}),$.appendChild(H),e.addEventListener(`abort`,()=>{G.remove(),t.remove(),y.remove(),L.remove(),V.removeAttribute(`popover`),V.remove(),H.remove()},{once:!0})}};export{Kt as allSider,Kt as theme,$t as base,$t as tradition,sn as tabs};
746
+ `,e})();#r=(()=>{let e=document.createElement(`slot`);return e.name=`start`,e.className=`start`,this.#n.appendChild(e),e})();#i=this.attachInternals();#a=(()=>{let e=document.createElement(`slot`);e.name=`trigger`,e.tabIndex=0,e.className=`trigger`,e.appendChild(document.createElement(`div`)),this.#n.appendChild(e);let t=0;e.addEventListener(`pointerdown`,n=>{if(this.hidden||this.disabled)return;let{pointerId:r}=n,i=this.#e;if([null,r].includes(i))switch(this.#i.states.add(`--moving`),this.#e=r,e.setPointerCapture(r),it(e).map((e,t)=>e?2**t:0).reduce((e,t)=>e+t)){case 0:t=-n.offsetX;break;case 1:t=-n.offsetY;break;case 2:t=n.offsetX-e.offsetWidth;break;case 3:t=n.offsetY-e.offsetHeight;break}});let n=this,r=t=>t?n.clientHeight-e.offsetHeight:n.clientWidth-e.offsetWidth,i=i=>{let[a,o]=it(e),s=0;switch([a,o].map((e,t)=>e?2**t:0).reduce((e,t)=>e+t)){case 0:s=i.clientX-n.getBoundingClientRect().left;break;case 1:s=i.clientY-n.getBoundingClientRect().top;break;case 2:s=n.getBoundingClientRect().right-i.clientX;break;case 3:s=n.getBoundingClientRect().bottom-i.clientY;break}let{max:c,min:l}=this,u=Math.max(l,Math.min((s+t)/r(a),c));this.setAttribute(`value`,String(u))};return e.addEventListener(`pointermove`,t=>{let{pointerId:n}=t;e.hasPointerCapture(n)&&i(t)}),e.addEventListener(`pointerup`,e=>{let{pointerId:t}=e;t===this.#e&&(i(e),this.#t())}),e.addEventListener(`pointercancel`,e=>{let{pointerId:t}=e;t===this.#e&&(i(e),this.#t())}),e.addEventListener(`keydown`,t=>{if(this.hidden||this.disabled||this.#e!==null||this.#n.activeElement!==e)return;let{max:n,min:i}=this;switch(t.code){case`Home`:t.preventDefault(),this.setAttribute(`value`,String(Math.max(i,0)));return;case`End`:t.preventDefault(),this.setAttribute(`value`,String(Math.min(1,n)));return}let[a,o]=it(e),s=0;switch(t.code){case`ArrowUp`:s=a?-1:0;break;case`ArrowDown`:s=a?1:0;break;case`ArrowLeft`:s=a?0:-1;break;case`ArrowRight`:s=a?0:1;break}if(!s)return;t.preventDefault(),o&&(s=-s),t.ctrlKey&&(s*=100),t.shiftKey&&(s*=10);let c=I(this.getAttribute(`value`),.5,i,n);c=Math.max(i,Math.min(c+s/r(a),n)),this.setAttribute(`value`,String(c))}),e})();#o=(()=>{let e=document.createElement(`slot`);return e.name=`end`,e.className=`end`,this.#n.appendChild(e),e})();connectedCallback(){}disconnectedCallback(){this.#t()}adoptedCallback(){this.#t()}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`hidden`:if(!this.hidden)break;this.#t();break;case`disabled`:n===null?this.#a.tabIndex=0:this.#a.removeAttribute(`tabindex`),this.#t();break;case`min`:case`max`:case`value`:{let{value:e}=this;this.#r.style.flex=`${e}`,this.#o.style.flex=`${1-e}`;break}}}};try{customElements.define(`nl-split`,at)}catch{}var ot=class{#e;#t;constructor(){let e=document.createElement(`nl-pagination`);e.size=20,e.appendChild(document.createElement(`nl-pagination-value`)).name=`start`,e.appendChild(document.createTextNode(`-`)),e.appendChild(document.createElement(`nl-pagination-value`)).name=`end`,e.appendChild(document.createTextNode(`/`)),e.appendChild(document.createElement(`nl-pagination-value`)).name=`total`,e.appendChild(document.createElement(`nl-pagination-prev`)).innerText=`上一页`,e.appendChild(document.createElement(`nl-pagination-pager`)),e.appendChild(document.createElement(`nl-pagination-next`)).innerText=`下一页`,e.appendChild(document.createElement(`nl-pagination-sizer`));let t=new Set;e.addEventListener(`change`,()=>{for(let e of t)e()}),this.#e=t,this.#t=e}get root(){return this.#t}get size(){return this.#t.size}set size(e){this.#t.size=e}get page(){return this.#t.page}set page(e){this.#t.page=e}get total(){return this.#t.total}set total(e){this.#t.total=e}listen(e){let t=this.#e,n=()=>e(this);return t.add(n),()=>{t.delete(n)}}destroy(){}};function st(e){e.listen(`update`,()=>{let{container:t}=e;t.innerHTML=``})}function*ct(e,t,n){if(!e)return;let r=e.indexOf(`?`),i=r<0?e:e.slice(0,r);if(r>=0&&r+1<e.length)for(let n=e.slice(r).split(`&`);n.length;n.pop()){let e=t.get(`${i}${n.join(`&`)}`);e?.length&&(yield e)}let a=t.get(i);a?.length&&(yield a);let o=n.get(i);o?.length&&(yield o.map(e=>e[0]))}function*lt(t,n,r,i,a){if(yield*ct(t,n,r),i)for(let t of[...e.stringifyPaths(i)].reverse()){let e=a.get(t);e?.length&&(yield e)}}function*ut(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let e;e=t.nextNode();)yield e}function dt(e,t){let n=[],r=[...ut(t)].filter(e=>e.nodeValue?.length),i=r.reduce((e,t)=>{let n=e[e.length-1]?.[1]||0;return[...e,[n,n+(t.nodeValue?.length||0),t]]},[]),a=r.map(e=>e.nodeValue).join(``),o=0;for(let t of e){let e=a.indexOf(t,o);if(e===-1)return[];let r=e+t.length,s=i.findLast(([t])=>t<=e);if(!s)return[];let c=i.findLast(([,e])=>e>=r);if(!c)return[];o=e+t.length;let l=new Range;l.setStart(s[2],e-s[0]),l.setEnd(c[2],r-s[0]),n.push(l)}return n}function ft(t,n,i={}){let a=new Map,s=new Map,c=new Map,l=null,u=[],d=[];function f(e){let t=document.createElement(`a`);return t.href=e.path||`#`,t.appendChild(document.createTextNode(e.label||e.title||``)),t.title=e.title||e.label||``,t}let m=null;function h(t,n){let{children:i}=t;if(!i.length){let n=document.createElement(`div`),i=n.appendChild(document.createElement(`a`));i.appendChild(document.createTextNode(t.label||t.title||``));let{page:l,path:u,uri:d,target:p}=t,h=null,g=l&&e.parse(l);if(g)h=new URL(r.stringify(g,u),o.root),i.href=h.href,p&&typeof p==`string`&&(i.target=p);else if(d){i.href=d;try{h=new URL(d),h.origin!==location.origin&&(h=null)}catch{}p!==``&&(i.target=p??`_blank`)}if(h&&(i.target||`_self`)===`_self`){i.addEventListener(`click`,()=>{m=n,requestIdleCallback(()=>{m===n&&(m=null)})});let{pathname:t,search:r}=h,o=(r||`?`)===`?`?t:`${t}${r}`,l=s.get(o);l?l.push(n):s.set(t,[n]);let d=a.get(o);if(d?d.push([n,r.length]):a.set(t,[[n,r.length]]),g&&(!u||u[0]===`?`||u[0]===`#`)){let t=e.stringify(g),r=c.get(t);r?r.push(n):c.set(t,[n])}}for(let e of t.buttons||[])n.appendChild(f(e));return n.className=`NavMenu-item`,{el:n,filter(e,t){let r=t?dt(t,i):[];return n.hidden=!!(!e&&t&&!r.length),r}}}let l=document.createElement(`nl-collapse`);l.setAttribute(`animation`,``),l.setAttribute(`menu`,``);let u=l.appendChild(document.createElement(`div`));u.appendChild(document.createTextNode(t.label||t.title||``)),u.className=`NavMenu-label`,u.slot=`label`,u.style.flex=`1`;for(let e of t.buttons||[])l.appendChild(f(e)).slot=`label`;let d=g(l,i,n+1);return d.length?{el:l,filter(e,t){if(!t){for(let t of d)t.filter(e);return l.hidden=!1,l.open=!1,[]}let n=dt(t,u),r=!!(e||n.length),i=d.flatMap(e=>e.filter(r,t));l.open=!!i.length;let a=[...n,...i];return l.hidden=!e&&!a.length,a}}:null}function g(e,t,n){let r=!1,i=!1,a=[];for(let o of t){if(!o){if(!r)continue;i=!0;continue}i&&(i=!1,e.appendChild(document.createElement(`hr`)));let t=h(o,n);t&&(a.push(t),r=!0,e.appendChild(t.el),u.push(t.el),t.el.style.setProperty(`--NavMenu-level`,String(n)))}return a}let _=g(t,n,0),y=!1;function b(){if(!y){y=!0;for(let e of u)e.remove();for(let e of d)e()}}let x=i.signal||p;x.aborted?b():x.addEventListener(`abort`,b,{once:!0});let S=[];return v(()=>{let e=i.active;return e?typeof e==`string`?e.replace(/#.*/,``)||``:Array.isArray(e)?e[1]?[e[0]?.replace(/#.*/,``)||``,e[1]||null]:e[0]?.replace(/#.*/,``)||null:null:null},e=>{if(!e)return;let n=Array.isArray(e)?e[0]:``,r=Array.isArray(e)?e[1]:null;for(let e of lt(n,s,a,r,c)){let n=m&&e.includes(m)?m:null;if(n&&(m=null),!n&&l&&e.includes(l))return;let r=n||e[0],i=[],a=r.parentElement;for(;a&&a!==t;a=a.parentElement)i.push(a);if(a!==t)return;S=i,l?.classList.remove(`NavMenu-current`);for(let e of S)e.setAttribute(`open`,``);l=r,l?.classList.add(`NavMenu-current`);return}},{signal:x,immediate:!0}),e=>{let t=e.toLowerCase().split(/[\s\n]+/).filter(Boolean);if(t.length)return _.flatMap(e=>e.filter(!1,t));_.flatMap(e=>e.filter(!1));for(let e of S)e.setAttribute(`open`,``);return[]}}const L=document.createElement(`div`);L.style.display=`flex`,L.style.flexDirection=`column`;const pt=L.appendChild(document.createElement(`header`));pt.classList.add(`NavMenu-header`);const mt=pt.appendChild(document.createElement(`input`));mt.placeholder=`过滤菜单...`,mt.type=`search`;const R=pt.appendChild(document.createElement(`button`));R.appendChild(c(`refresh`,!0)),R.classList.add(`icon`),R.title=`刷新`;const z=L.appendChild(document.createElement(`main`));z.style.flex=`1`,z.style.overflow=`auto`,z.classList.add(`NavMenu`);let ht=null;function gt(){let e=ht?.(mt.value)||[],t=new Highlight(...e);CSS.highlights.set(`NavMenu-filter-highlight`,t)}mt.addEventListener(`input`,gt);const _t=s(()=>t.fromDefine(o.menus,[])),vt=s(()=>{let e=a.permissions,n=_t.get();return e.size<0?n:t.filter(n,t=>{let n=t.permission;return n?f(n,e):!0})}),yt=u(``);let bt=null;d(()=>{bt?.abort(),z.innerHTML=``,bt=new AbortController,ht=ft(z,vt.get(),{signal:bt.signal,get active(){return yt.get()}}),gt()});function xt(e,t,n,r){if(!r){yt.set(`${e}${t}`);return}yt.set([`${e}${t}`,r])}R.addEventListener(`click`,()=>o.refresh());function St(e,t,n){if(!e){let e=c(`user`,t);return n||e.setAttribute(`fill-opacity`,`0.5`),e}let r=document.createElement(`img`);return r.src=e,r}function Ct(e,t,n=p){e.classList.add(`${y}-user-avatar`);let r=s(()=>a.single?null:a.session?.avatar||``).get(),i=new AbortController,o=AbortSignal.any([i.signal,n]),l=r===null?c(`singleUser`,o):St(r,o,t);e.appendChild(l),d(()=>{let o=a.single?null:a.session?.avatar||``;if(o===r)return;r=o,i?.abort(),i=new AbortController;let s=AbortSignal.any([i.signal,n]),u=r===null?c(`singleUser`,s):St(r,s,t);!t&&r===null&&u.setAttribute(`fill-opacity`,`0.5`),e.replaceChild(u,l),l.remove(),l=u},n);let u=s(()=>{let e=a.target,t=a.session;return!e||e.id===(t?.id||``)?null:e.avatar||``}),f=null,m=null,h=null;d(()=>{let r=u.get();r!==f&&(f=r,m?.remove(),m=null,h?.abort(),r!==null&&(h=new AbortController,m=St(r,AbortSignal.any([h.signal,n]),t),e.insertBefore(m,l)))},n)}const B=document.createElement(`div`);B.classList.add(`${y}-user`);const V=document.createElement(`div`);V.classList.add(`${y}-user-button`),Ct(V,!0);const H=B.appendChild(document.createElement(`span`));H.classList.add(`${y}-user-info`);const wt=H.appendChild(document.createElement(`span`));Ct(wt),wt.classList.add(`avatar`);const Tt=H.appendChild(document.createElement(`span`));Tt.classList.add(`username`),Tt.innerText=`用户名`;const Et=H.appendChild(document.createElement(`span`));if(Et.classList.add(`btns`),o.help){let e=Et.appendChild(document.createElement(`a`));e.href=o.help,e.target=`_blank`,e.appendChild(c(`help`,!0)),e.title=`帮助`}const U=Et.appendChild(document.createElement(`div`));U.appendChild(c(`logout`,!0)),U.title=`退出登录`,d(()=>{U.hidden=!a.current}),U.addEventListener(`click`,()=>a.exit()),d(()=>{Tt.innerText=a.current?.name||``});const Dt=s(()=>t.fromDefine(o.userMenus,[])),Ot=s(()=>{let e=Dt.get();return a.current?e:t.filter(e,e=>!e.logged)}),W=B.appendChild(document.createElement(`main`));W.style.flex=`1`,W.style.overflow=`auto`,W.classList.add(`NavMenu`);let kt=null;d(()=>{kt?.abort(),W.innerHTML=``,kt=new AbortController,ft(W,Ot.get(),{signal:kt.signal})});const G=document.createElement(`a`);G.classList.add(`${y}-logo`),G.href=o.root,v(()=>{let e=o.logo;return e&&g(e)},e=>{if(G.innerHTML=``,e){let t=G.appendChild(document.createElement(`img`));t.src=e.href,t.classList.add(`logo`)}else G.appendChild(c(`logo`,!0)).classList.add(`logo`)},{immediate:!0});const At={404:{title:`您所请求的页面无法找到`,description:`服务器无法正常提供信息。
747
+ 目标页面可能已经被更改、删除或移到其他位置,或您所输入页面地址错误。`}};function jt(e,t){if((t??``)==``){e.container.appendChild(document.createTextNode(`空页面`));return}let n=(typeof t==`number`||typeof t==`string`)&&Object.hasOwn(At,t)&&At[t]||At[404],r=n?.title||`Error`,i=n?.description,a=document.createElement(`div`),o=a.appendChild(document.createElement(`div`)),s=o.appendChild(document.createElement(`div`)),c=o.appendChild(document.createElement(`div`));if(a.style.marginBlock=`8%`,a.style.marginInline=`auto`,a.style.inlineSize=`600px`,a.style.maxInlineSize=`100%`,a.style.padding=`20px`,s.style.paddingBlock=`20px`,s.style.fontSize=`20px`,s.style.color=`#8e8e8e`,s.style.textAlign=`center`,c.style.fontSize=`13px`,c.style.lineHeight=`1.3em`,c.style.color=`#b5b5b5`,s.appendChild(document.createTextNode(r)),e.title=r||`Error`,i&&typeof i==`string`)for(let e of i.split(`
748
+ `))c.appendChild(document.createTextNode(e)),c.appendChild(document.createElement(`br`));e.container.appendChild(a),e.loading=!1}const K=`${y}-allSider-nav`,Mt=document.createElement(`header`);Mt.className=`${K}-header`;const q=Mt.appendChild(document.createElement(`div`));q.classList.add(`${K}-actions`);const Nt=Mt.appendChild(document.createElement(`div`));Nt.classList.add(`${K}-sidebar`);const Pt=`${K}-open`;let J=null;function Ft(){window.innerWidth>800||J?.()}var It=class{button;sider;#e;#t=!1;get disabled(){return this.#t}set disabled(e){e?this.disable():this.enable()}disable(){if(this.#t)return;this.#t=!0;let e=this.#e;J===e&&e(),this.button.hidden=!0,this.sider.hidden=!0}enable(){this.#t&&(this.#t=!1,this.button.hidden=!1)}#n=()=>this.toggle();constructor(e,t){let n=t instanceof HTMLElement?t:document.createElement(`div`),r=e instanceof HTMLElement?e:document.createElement(`div`);n.tabIndex=0,n.classList.add(`${K}-button`),r.hidden=!0,Nt.appendChild(r),n.classList.add(`${K}-selectable`),n.addEventListener(`click`,this.#n),this.#e=()=>{J=null,document.body.classList.remove(Pt),n.classList.remove(`${K}-selected`),r.hidden=!0},this.button=n,this.sider=r}get open(){return J===this.#e}set open(e){e?this.show():this.hide()}show(){if(this.#t)return;let e=this.#e;J!==e&&(J?.(),J=e,document.body.classList.add(Pt),this.button.classList.add(`${K}-selected`),this.sider.hidden=!1)}toggle(){if(this.#t)return;let e=this.#e;if(J===e){e();return}this.show()}hide(){if(this.#t)return;let e=this.#e;J===e&&e()}remove(){let e=this.#e;J===e&&e();let{button:t,sider:n}=this;t.remove(),n.remove(),t.classList.remove(`${K}-button`),t.classList.remove(`${K}-selectable`),t.removeEventListener(`click`,this.#n),n.hidden=!1}};Nt.addEventListener(`click`,e=>{e.target===e.currentTarget&&J?.()});var Lt=class e{root=document.createElement(`div`);#e=new Set;constructor(e){let t=this.root;e.appendChild(t),t.className=`${K}-group`}remove(){this.root.remove();for(let e of[...this.#e])e()}createGroup(){let t=new e(this.root),n=this.#e,r=()=>{n.delete(r),t.remove()};return n.add(r),t}createAction(e){let t=document.createElement(e?`a`:`div`);t.tabIndex=0,t.classList.add(`${K}-button`),t.addEventListener(`click`,()=>{Ft()}),this.root.appendChild(t);let n=this.#e,r=()=>{n.delete(r),t.remove()};return n.add(r),t}createSider(e,t){let n=new It(e,t);this.root.appendChild(n.button);let r=this.#e,i=()=>{r.delete(i),n.remove()};return r.add(i),n}};const Rt=document.createElement(`div`),zt=new Lt(q),Bt=new Lt(q);new Lt(q),q.appendChild(document.createElement(`span`));const Vt=new Lt(q),Y=Bt.createSider(Rt);Y.button.innerText=`页面`,Y.disabled=!0;var Ht=class extends i{#e;#t;constructor(e,t,n,r,i){super(t,n,r,i),this.#e=e,this.#t=t,i.addEventListener(`abort`,()=>{this.#n()})}insert(){super.insert(),this.#e.show&&(Y.disabled=!1)}#n(){this.#e.show&&!this.#t.children.length&&(Y.disabled=!0)}remove(){super.remove(),this.#n()}},Ut=class extends n{#e=(()=>{let e=document.createElement(`div`);return e.classList.add(`Page-sides`),Rt.appendChild(e),e})();destroy(){return super.destroy()?(this.#e.remove(),!0):!1}toggle(e){super.toggle(e),Y.disabled=!(e&&this.#e.children.length)}get siderOpen(){return Y.open}set siderOpen(e){e?Y.show():Y.hide()}createSider(e,t){if(this.destroyed)throw Error(`页面组件已被销毁`);t?.throwIfAborted();let n=this.#e;return new Ht(this,n,null,e!==!1,t instanceof AbortSignal?AbortSignal.any([t,this.signal]):this.signal)}constructor(e){super(e),e&&(Y.disabled=!this.#e.children.length)}};function Wt(e,t,n){let r=document.createElement(`nl-menu`),i=!1,a=!1,o=()=>{i=!0,a&&(a=!1,r.appendChild(document.createElement(`hr`)))};for(let s of e){if(!s){if(!i)continue;a=!0;continue}let{children:e}=s;if(!e?.length){let e=new AbortController,i=t(s,AbortSignal.any([n,e.signal]));if(!i){e.abort();continue}o(),r.appendChild(i);continue}let c=Wt(e,t,n);if(!c)continue;o();let l=r.appendChild(c),u=l.insertBefore(document.createElement(`div`),l.firstChild);u.appendChild(document.createTextNode(s.label||s.title||``)),u.slot=`label`}return i?r:null}function Gt(e,t,n){if(n.aborted)return null;let r=document.createElement(`div`),i=!1,a=!1,o=()=>{i=!0,a&&(a=!1,r.appendChild(document.createElement(`hr`)))};for(let s of e){if(!s){if(!i)continue;a=!0;continue}let{children:e}=s;if(!e?.length){let e=new AbortController,i=t(s,AbortSignal.any([n,e.signal]),!0);if(!i){e.abort();continue}o(),r.appendChild(i);continue}let c=Wt(e,t,n);if(!c)continue;o();let l=r.appendChild(document.createElement(`button`));l.appendChild(document.createTextNode(s.label||s.title||``)),c.targetElement=l,l.addEventListener(`click`,()=>c.show?.()),r.appendChild(c)}return r.childNodes.length?(r.classList.add(`MenuButtons`),r):null}function Kt(e,t,n){let r=document.createElement(`a`),i=n?document.createElement(`button`):null;r.appendChild(document.createTextNode(e.label||e.title||``));let{page:a,path:s,uri:c,target:l,command:u,script:f,click:p}=e;function m(){let t=e.disabled;return!!(typeof t==`function`?t():t)}return d(()=>{let e=m();r.disabled=e,i&&(i.disabled=e)},t),a?(r.href=new URL(s?.[0]===`/`?`${a}${s}`:`${a}/${s||``}`,o.root).href,l&&typeof l==`string`&&(r.target=l)):c?(r.href=c,l!==``&&(r.target=l??`_blank`)):typeof p==`function`?r.addEventListener(`click`,e=>{m()||e.defaultPrevented||p()}):(u||f)&&r.addEventListener(`click`,e=>{m()||e.defaultPrevented}),i?(i.appendChild(r),i):r}function qt(e,t,n,r){let i=document.createElement(`div`),a=Wt(e,n,r);if(!a)return null;let o=i.appendChild(document.createElement(`button`)),s=t?.label||t?.title||``;return s?o.appendChild(document.createTextNode(s)):o.appendChild(c(t?.icon||`more`,r)),a.targetElement=o,o.addEventListener(`click`,()=>a.show()),i.appendChild(a),i}var Jt={title(e){return[e.title,o.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:E,Pagination:ot,createMenuButtons:Gt,createMenuItem:Kt,createMenuButton:qt},updatePath:xt,pageManager:ee,elements:[m,Mt],classNames:[y,`${y}-allSider`],styleFiles:[`theme-allSider.css`],home:st,rootClassName:`${y}-root`,createPage(e){return new Ut(e)},renderError(e,t){jt(e,t)},setup(e){T(!1),G.addEventListener(`click`,()=>{Ft()},{signal:e}),q.insertBefore(G,q.firstElementChild);let t=zt.createSider(L);t.button.appendChild(c(`menu`,e)),t.button.title=`菜单`;let n=zt.createSider(x);n.button.appendChild(c(`activity`,e)),n.button.title=`活动`,window.innerWidth>800&&t.show();let r=Vt.createSider(B,V);e.addEventListener(`abort`,()=>{G.remove(),t.remove(),n.remove(),r.remove()},{once:!0})}};const X=`${y}-base`,Yt=[`theme-base.css`],Xt=document.createElement(`header`),Z=Xt.appendChild(document.createElement(`div`));Z.classList.add(`${X}-header`);const Zt=Xt.appendChild(document.createElement(`div`));Zt.classList.add(`${X}-sidebar`);const Qt=Z.appendChild(c(`menu`,!0));Qt.classList.add(`${X}-menu-button`);const $t=Z.appendChild(document.createElement(`span`)),en=`${X}-menu-open`;Qt.addEventListener(`click`,()=>{document.body.classList.toggle(en)}),Zt.addEventListener(`click`,e=>{e.target===e.currentTarget&&document.body.classList.remove(en)});var tn={title(e){return[e.title,o.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:E,Pagination:ot,createMenuButtons:Gt,createMenuItem:Kt,createMenuButton:qt},updatePath:xt,pageManager(e){let t=!1;d(()=>{if(!e.current){t&&e.destroy();return}t=!0},e.signal)},elements:[Xt,m],classNames:[y,X],styleFiles:Yt,home:st,rootClassName:`${y}-root`,createPage(e){return new n(e)},renderError(e,t){jt(e,t)},setup(e){G.addEventListener(`click`,()=>{window.innerWidth>800||document.body.classList.remove(en)},{signal:e});let t=document.createElement(`div`);t.classList.add(`${X}-header-title`),d(()=>{t.innerText=o.title||o.company||``},e),Z.insertBefore(G,$t),Z.insertBefore(t,$t),window.innerWidth>800&&document.body.classList.add(en),Zt.appendChild(L),document.body.appendChild(B),B.setAttribute(`popover`,`auto`),V.addEventListener(`click`,()=>{B.showPopover()},{signal:e}),Z.appendChild(V),e.addEventListener(`abort`,()=>{G.remove(),t.remove(),L.remove(),B.removeAttribute(`popover`),B.remove(),V.remove()},{once:!0})}};const Q=`${y}-tabs`,nn=document.createElement(`header`),$=nn.appendChild(document.createElement(`div`));$.classList.add(`${Q}-header`);const rn=nn.appendChild(document.createElement(`div`));rn.classList.add(`${Q}-sidebar`);const an=$.appendChild(c(`menu`,!0));an.classList.add(`${Q}-menu-button`);const on=$.appendChild(document.createElement(`span`)),sn=`${Q}-menu-open`;an.addEventListener(`click`,()=>{document.body.classList.toggle(sn)});function cn(){window.innerWidth>800||document.body.classList.remove(sn)}rn.addEventListener(`click`,e=>{e.target===e.currentTarget&&document.body.classList.remove(sn)});var ln={title(e){return[e.title,o.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:E,Pagination:ot,createMenuButtons:Gt,createMenuItem:Kt,createMenuButton:qt},updatePath:xt,pageManager:ee,elements:[nn,m],classNames:[y,`${y}-tabs`],styleFiles:[`theme-tabs.css`],home:st,rootClassName:`${y}-root`,createPage(e){return new n(e)},renderError(e,t){jt(e,t)},setup(e){T(!0),G.addEventListener(`click`,()=>{cn()},{signal:e});let t=document.createElement(`div`);t.classList.add(`${Q}-header-title`),d(()=>{t.innerText=o.title||o.company||``},e),$.insertBefore(G,on),$.insertBefore(t,on),nn.appendChild(x),window.innerWidth>800&&document.body.classList.add(sn),rn.appendChild(L),document.body.appendChild(B),B.setAttribute(`popover`,`auto`),V.addEventListener(`click`,()=>{B.showPopover()},{signal:e}),$.appendChild(V),e.addEventListener(`abort`,()=>{G.remove(),t.remove(),x.remove(),L.remove(),B.removeAttribute(`popover`),B.remove(),V.remove()},{once:!0})}};export{Jt as allSider,Jt as theme,tn as base,tn as tradition,ln as tabs};
749
749
  //# sourceMappingURL=index.mjs.map