litos-ui 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base.d.ts +4 -0
- package/lib/base.js +13 -7
- package/lib/button/index.js +1 -1
- package/lib/dialog/dialog_container.d.ts +28 -0
- package/lib/dialog/dialog_container.js +100 -0
- package/lib/dialog/index.d.ts +30 -0
- package/lib/dialog/index.js +86 -0
- package/lib/icon/close.d.ts +5 -0
- package/lib/icon/close.js +10 -0
- package/lib/index.d.ts +16 -2
- package/lib/index.js +89 -75
- package/lib/input/index.js +1 -1
- package/lib/list/index.d.ts +1 -1
- package/lib/litos-ui.css +1 -1
- package/lib/loading/index.d.ts +40 -0
- package/lib/loading/index.js +135 -0
- package/lib/radio/index.js +1 -1
- package/lib/utils/index.js +3 -3
- package/package.json +71 -72
- package/styles/dialog.css +56 -0
- package/styles/loading.css +100 -0
- package/styles/reset.css +10 -0
- package/lib/litos-ui.min.js +0 -1
package/lib/litos-ui.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Ur=Object.defineProperty;var Ie=v=>{throw TypeError(v)};var Gr=(v,x,g)=>x in v?Ur(v,x,{enumerable:!0,configurable:!0,writable:!0,value:g}):v[x]=g;var n=(v,x,g)=>Gr(v,typeof x!="symbol"?x+"":x,g),St=(v,x,g)=>x.has(v)||Ie("Cannot "+g);var m=(v,x,g)=>(St(v,x,"read from private field"),g?g.call(v):x.get(v)),C=(v,x,g)=>x.has(v)?Ie("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(v):x.set(v,g),Nt=(v,x,g,pt)=>(St(v,x,"write to private field"),pt?pt.call(v,g):x.set(v,g),g),b=(v,x,g)=>(St(v,x,"access private method"),g);(function(){"use strict";var Lt,nt,it,xt,W,zt,It,R,$,Ve,Vt,He,Fe,Re,J,je,Be,bt,De,mt,z,Pe,qe,Oe,gt,X,Z,at,We,Ye,I,kt,Ke,ct,Ue,Ge,ot,Je,Xe,dt;const v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",x="0123456789";function g(r,o=!0){return r==null?!0:(o&&typeof r=="string"?r.trim().length:r.length)===0}function pt(r,o){o={isPositive:!1,isFloat:!0,...o};const t=o.isPositive?"[+]?":"[+-]?",e=o.isFloat?"([0-9]*[.])?[0-9]+":"[0-9]+";return new RegExp("^"+t+e+"$").test(r)}function H(r){if(typeof r=="object"&&r.min!=null&&r.max!=null){const o=Math.random(),t=r.hasEnd?1:0,e=o*(r.max-r.min+t)+r.min;return r.isInteger!==!1?Math.floor(e):e}else{if(typeof r=="object"&&r.length==null)throw new Error("random_length_cannot_null");let o=typeof r=="object"?r.length:r,t=v;typeof r=="object"&&r.hasLetter===!1&&(t=x);const e=Array.from({length:o},()=>t.charAt(H({min:0,max:t.length-1,hasEnd:!0}))).join("");return typeof r=="object"&&r.firstIsZero===!1&&e.indexOf("0")===0?H(r):e}}function Ht(r,o){return typeof r=="string"?(o||document).querySelectorAll(r):[r]}function j(r,o){return Ht(r,o)}function S(r,o={},t){let e;if(r.startsWith("<")&&r.endsWith(">")?e=new DOMParser().parseFromString(r,"text/html").body.firstElementChild:e=document.createElement(r),e&&o)for(const i in o){const s=o[i];i==="class"?e.className=B(s):i==="style"?e.style.cssText=tt(s):i==="textContent"&&s?e.textContent=s:i==="innerHTML"&&s?e.innerHTML=s:i==="outerHTML"&&s?e.outerHTML=s:s===!0?e.setAttribute(i,""):typeof s=="string"&&e.setAttribute(i,s)}return e}function P(r,o={},t){return S(r,o)}function d(r,o){const t=Ht(r,o);return t.length>0?t[0]:void 0}function w(r,o){r.classList.add(o)}function A(r,o){r.classList.remove(o)}function Ft(r,o){return r.classList.contains(o)}function _(r,o,t,e){r.addEventListener(o,t,e)}function E(r,o,t,e){r.removeEventListener(o,t,e)}function Ze(r,o,t){let e=r.target,i="";do if(t&&t.isSameNode(e)||e.tagName==="BODY"||(e.getAttribute&&(i=e.getAttribute(o)||""),i===""&&(e=e.parentNode),!e))break;while(i==="");return[i!=="__stop__"&&i!=="",i,e]}function q(r,o){for(let t=0,e=r.length;t<e&&o(r[t],t)!==!0;t++);}function Q(r,o,t){const e=r.getAttribute(o);if(t==null)return e;const i=typeof t;return e==null?t:i==="bigint"||i==="number"?e===""?t:Number(e):i==="boolean"?e===""||e==="1"||e==="true"||e===o:i==="object"?e===""?t:JSON.parse(e):e}function Qe(r,o=null,t="horizontal"){o==null&&(o=r.offsetParent);const e=o.getBoundingClientRect(),i=r.getBoundingClientRect();let s=t==="horizontal"?i.left:i.top,l=t==="horizontal"?i.right:i.bottom,a=t==="horizontal"?e.left:e.top,c=t==="horizontal"?e.right:e.bottom;return s>=a&&l<=c}function B(r){let o="";if(Array.isArray(r))for(let t=0,e=r.length;t<e;t++){const i=r[t];i&&(o+=`${i} `)}else if(typeof r=="string")o=r;else for(const t in r)r[t]&&(o+=`${t} `);return o.trim()}function tt(r){let o="";if(Array.isArray(r))for(let t=0,e=r.length;t<e;t++){const i=r[t];i&&(o+=`${i};`)}else if(typeof r=="string")o=r;else for(const t in r){const e=r[t];e&&(o+=`${t}:${e};`)}return o}function ut(r,o,t="set"){for(let e=0,i=o.length;e<i;e++){const s=o[e];t==="set"?r.style.setProperty(s[0],s[1]):r.style.removeProperty(s[0])}}function Rt(r,o,t="enter",e){const i=t==="enter"?"from":"to";let s="",l="";const a=[];if(typeof o=="string")s=`${o}-${t}-${i}`,l=`${o}-${t}-active`;else for(let c=0,p=o.length;c<p;c++){const h=o[c];h.length>=3&&a.push(`${h[0]} ${h[2]}`)}t==="enter"?s?(r.classList.add(s),setTimeout(()=>{r.classList.add(l),requestAnimationFrame(()=>{r.classList.remove(s)})},0)):(ut(r,o,"set"),setTimeout(()=>{a.length>0&&r.style.setProperty("transition",a.join(", ")),requestAnimationFrame(()=>{ut(r,o,"remove")})},0)):s?(r.classList.add(l),requestAnimationFrame(()=>{r.classList.add(s)})):(a.length>0&&r.style.setProperty("transition",a.join(", ")),requestAnimationFrame(()=>{ut(r,o,"set")})),r.addEventListener("transitionend",()=>{s?(r.classList.remove(l),requestAnimationFrame(()=>{r.classList.remove(s)})):(r.style.removeProperty("transition"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ut(r,o,"remove")})})),e&&e()},{once:!0})}let tr=-1,jt={prefix:"l"};function u(r,o){const t=Array.isArray(r)?r:[r];for(const e of t){const i=`${jt.prefix}-${e.baseName}`;customElements.get(i)||customElements.define(i,e)}}function Bt(){return`${jt.prefix}-${++tr}`}function L(r,o,t){if(r==null)return o;switch(typeof o){case"boolean":return r===""||r==="true"||r==="1"||r===t;case"number":return Number(r);default:return r}}function M(r){const o=r.attributes;for(const t of o){const{name:e,value:i}=t;if(e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("_")||e.startsWith("$")||["id","class","style"].includes(e))continue;const l=e.split("-").map((h,k)=>k===0?h:h[0].toUpperCase()+h.slice(1)).join(""),a=L(i,r[l],e),c=Object.getOwnPropertyNames(r);(r._ignoreInitAttrs||[]).includes(l)||(e==="value"?(r[l]=a,r._resetValue=a):c.includes(l)&&(r[l]=a))}}function F(r,o){let t=" ";return o===!0?t=` ${r}`:typeof o=="string"&&!g(o)&&(t=` ${r}="${o}"`),t}function er(r){return r.map(t=>F(t[0],t[1])).join("")}function rr(r,o){for(const t of o){const e=t[1],i=t[0];e===!0?r.setAttribute(i,""):typeof e=="string"&&!g(e)&&r.setAttribute(i,e)}}function yt(r,o,t,e,i=10){let s=0;return t==="top"?s=o.height+i:t==="bottom"?s=-(r.height+i):(t==="left"||t==="right")&&(e===""?s=o.height/2-r.height/2:e==="end"&&(s=o.height-r.height)),s}function wt(r,o,t,e,i=10){let s=0;return t==="left"?s=o.width+i:t==="right"?s=-(r.width+i):(t==="top"||t==="bottom")&&(e===""?s=o.width/2-r.width/2:e==="end"&&(s=o.width-r.width)),s}function ir(r,o,t,e,i,s,l,a,c=10,p="absolute"){const h=window.innerHeight+s-10,k=window.innerWidth+i-10;let D=r.top+s-a;D+o.height>h&&(t==="left"||t==="right"?e="end":t="top",a=yt(r,o,t,e,c),D=r.top+s-a),D<s&&(t==="left"||t==="right"?e="start":t="bottom");let V=r.left+i-l;return V+o.width>k&&(t==="top"||t==="bottom"?e="end":t="left",l=wt(r,o,t,e,c),V=r.left+i-l),V<i&&(t==="top"||t==="bottom"?e="start":t="right"),p==="fixed"&&(a=yt(r,o,t,e,c),l=wt(r,o,t,e,c),V=r.left+i-l,D=r.top+s-a),{x:V,y:D,mainAlign:t,crossAlign:e}}class N extends HTMLElement{constructor(t=!0){super();n(this,"rendered",!1);t&&this.attachShadow({mode:"open"})}static get observedAttributes(){return[]}attributeChangedCallback(t,e,i){}get shadow(){return this.shadowRoot}get root(){return this.shadowRoot||this}createStyle(t){const e=document.createElement("style");e.textContent=t.trim(),this.root.appendChild(e)}createLink(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,this.root.appendChild(e)}loadStyleText(t){let e=t;Array.isArray(e)&&(e=e.join("")),this.createStyle(e)}getAttr(t,e){return Q(this,t,e)}appendToRoot(t){if(t)if(typeof t=="string"){let e=document.createElement("div");e.innerHTML=t,this.root.append(...e.children),e=void 0}else t.length?this.root.append(...t):this.root.append(t)}connectedCallback(){this.appendToRoot(this.render()),this.rendered=!0}disconnectedCallback(){this.root.innerHTML="",this.rendered=!1}render(){}}n(N,"baseName","base-component");const ft=2,or=.16,sr=.05,lr=.05,nr=.15,ar=/rgba?\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)/,Dt=/^#(?:([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})|([0-9A-Fa-f]{1})([0-9A-Fa-f]{1})([0-9A-Fa-f]{1}))$/;function cr(r){return r.r!=null&&r.g!=null&&r.b!=null}function Pt(r){return r.h!=null&&r.s!=null&&r.v!=null}function dr(r){let o=r.match(ar);if(o!=null){const t=parseInt(o[1].trim()),e=parseInt(o[2].trim()),i=parseInt(o[3].trim());if(isNaN(t)||isNaN(e)||isNaN(i))throw new Error("Invalid RGB color.");let s=1;return o[4]!=null&&(s=parseFloat(o[4].trim()),isNaN(s)&&(s=1)),{r:t,g:e,b:i,a:s}}}function hr(r){const o=r.match(Dt);if(o!=null){const t=o[4]!==void 0,e=parseInt(t?o[4]+o[4]:o[1],16),i=parseInt(t?o[5]+o[5]:o[2],16),s=parseInt(t?o[6]+o[6]:o[3],16);return{r:e,g:i,b:s}}}function _t(r){if(typeof r=="string"){let o=hr(r);if(o==null&&(o=dr(r)),o!=null)return o;throw new Error("Invalid color string")}else{if(cr(r))return r;if(Pt(r))return ur(r);throw new Error("Invalid color")}}function pr(r){if(Pt(r))return r;const o=_t(r),t=o.r/255,e=o.g/255,i=o.b/255;let s=Math.max(t,e,i),l=Math.min(t,e,i),a=s-l,c=s,p=s===0?0:a/s,h=0;if(s===l)h=0;else switch(s){case t:h=((e-i)/a+(e<i?6:0))/6;break;case e:h=((i-t)/a+2)/6;break;case i:h=((t-e)/a+4)/6;break}return h=h*360,{h,s:p,v:c}}function ur(r){let o=r.s,t=r.v;o>1&&(o/=100),t>1&&(t/=100);const e=r.h;var i=Math.floor(e/60)%6,s=e/60-Math.floor(e/60),l=t*(1-o),a=t*(1-s*o),c=t*(1-(1-s)*o);let p=0,h=0,k=0;switch(i){case 0:p=t,h=c,k=l;break;case 1:p=a,h=t,k=l;break;case 2:p=l,h=t,k=c;break;case 3:p=l,h=a,k=t;break;case 4:p=c,h=l,k=t;break;case 5:p=t,h=l,k=a;break}return p=Math.round(p*255),h=Math.round(h*255),k=Math.round(k*255),{r:p,g:h,b:k}}function fr(r,o,t){let e;return Math.round(r.h)>=60&&Math.round(r.h)<=240?e=t?Math.round(r.h)-ft*o:Math.round(r.h)+ft*o:e=t?Math.round(r.h)+ft*o:Math.round(r.h)-ft*o,e<0?e+=360:e>=360&&(e-=360),e}function br(r,o,t){if(r.h===0&&r.s===0)return r.s;let e;return t?e=r.s-or*o:e=r.s+sr*o,e>1&&(e=1),e<.06&&(e=.06),Number(e.toFixed(2))}function mr(r,o,t){let e;return t?e=r.v+lr*o:e=r.v-nr*o,e>1&&(e=1),Number(e.toFixed(2))}function qt(r){const o=t=>t.toString(16).padStart(2,"0");return`#${o(r.r)}${o(r.g)}${o(r.b)}`.toUpperCase()}function gr(r){return typeof r=="string"&&Dt.test(r)?r:qt(_t(r))}function et(r,o=1,t=!0){const e=pr(r);return gr({h:fr(e,o,t),s:br(e,o,t),v:mr(e,o,t)})}const vr=":host{--l-btn-text-color:#fff;--l-btn-hover-text-color:var(--l-btn-text-color);--l-btn-active-text-color:var(--l-btn-text-color);--l-btn-border-color:var(--l-primary-color,#722ed1);--l-btn-background:var(--l-btn-border-color);--l-btn-hover-border-color:var(--l-primary-color-light1,#9254de);--l-btn-hover-background:var(--l-btn-hover-border-color);--l-btn-active-border-color:var(--l-primary-color-dark1,#531dab);--l-btn-active-background:var(--l-btn-active-border-color);--l-btn-disabled-color:#c9c9c9;--l-btn-disabled-background:#fbfbfb;--l-btn-disabled-border-color:#e6e6e6;width:auto;display:inline-block}.l-btn{cursor:pointer;box-sizing:border-box;vertical-align:middle;width:100%;height:var(--l-form-edit-height,32px);color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);border-radius:3px;outline:none;justify-content:center;align-items:center;gap:5px;padding:0 15px;font-size:14px;line-height:1;transition:border-color .3s,background-color .3s,color .3s;display:inline-flex;position:relative}.l-btn:hover{border-color:var(--l-btn-hover-border-color,var(--l-btn-hover-background));color:var(--l-btn-hover-text-color);background:var(--l-btn-hover-background)}.l-btn:active{border-color:var(--l-btn-active-border-color,var(--l-btn-active-background));color:var(--l-btn-active-text-color);background:var(--l-btn-active-background)}.l-btn-normal{--l-btn-text-color:auto;--l-btn-background:transparent;--l-btn-border-color:#d9d9d9;--l-btn-hover-text-color:var(--l-primary-color-light1,#9254de);--l-btn-active-text-color:var(--l-primary-color-dark1,#531dab);--l-btn-hover-background:#fff;--l-btn-active-background:#fff;--l-btn-hover-border-color:var(--l-btn-hover-text-color);--l-btn-active-border-color:var(--l-btn-active-text-color)}.l-btn-primary{--l-btn-background:var(--l-primary-color,#722ed1);--l-btn-hover-background:var(--l-primary-color-light1,#9254de);--l-btn-active-background:var(--l-primary-color-dark1,#531dab)}.l-btn:not(.l-btn-loading):disabled{border-color:var(--l-btn-disabled-border-color);background:var(--l-btn-disabled-background);color:var(--l-btn-disabled-color);cursor:not-allowed;opacity:1}.l-btn-text{--l-btn-background:transparent;--l-btn-border-color:transparent;--l-btn-hover-border-color:transparent;--l-btn-active-border-color:transparent;--l-btn-disabled-background:transparent;--l-btn-disabled-border-color:transparent;--l-btn-hover-background:transparent;--l-btn-active-background:transparent;height:auto;padding:5px}.l-btn-primary.l-btn-text{--l-btn-text-color:var(--l-primary-color,#722ed1);--l-btn-hover-text-color:var(--l-primary-color-light1,#9254de);--l-btn-active-text-color:var(--l-primary-color-dark1,#531dab)}.l-btn-ghost{--l-btn-text-color:var(--l-btn-border-color);--l-btn-background:transparent;--l-btn-hover-background:transparent;--l-btn-active-background:transparent;--l-btn-hover-text-color:var(--l-btn-hover-border-color);--l-btn-active-text-color:var(--l-btn-active-border-color)}.l-btn-round{border-radius:calc(var(--l-form-edit-height,32px)/2)}.l-btn-circle{width:var(--l-form-edit-height,32px);border-radius:50%;padding:0}.l-btn-block{width:100%}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background:#ffffff14;--l-btn-disabled-color:#ffffff4d;--l-btn-disabled-border-color:#ffffff4d}",Ot="@keyframes l-rotate-frame{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.l-rotate-anim{animation:1.5s linear infinite l-rotate-frame}";class Wt extends N{constructor(){super();n(this,"htmlType","button");n(this,"_handleClick",t=>{const e=t.target,i=Q(e,"html-type");if(i==="reset"||i==="submit"){const s=this._getForm();s&&(i==="reset"?s.reset():i==="submit"&&s.submit())}});M(this)}static get observedAttributes(){return["loading","color","disabled"]}attributeChangedCallback(t,e,i){const s=d(".l-btn",this.root);if(s)if(t==="loading")L(i,!1,t)?(w(s,"l-btn-loading"),s.disabled=!0,s.innerHTML=this.loadingBody()):(A(s,"l-btn-loading"),s.disabled=this.getAttr("disabled",!1),s.innerHTML="<slot></slot>");else if(t==="color"){const l=this.getAttr("text",!1),a=this.getAttr("ghost",!1);s.style.cssText=this.applyColor(i,l,a)}else t==="disabled"&&(s.disabled=this.getAttr("disabled",!1))}connectedCallback(){this.loadStyleText([vr,Ot]),this.render(),(this.htmlType==="reset"||this.htmlType==="submit")&&_(this,"click",this._handleClick)}disconnectedCallback(){super.disconnectedCallback(),(this.htmlType==="reset"||this.htmlType==="submit")&&E(this,"click",this._handleClick)}render(){const t=this.getAttr("type","normal"),e=document.createElement("button"),i=this.getAttr("loading",!1),s=this.getAttr("shape","default"),l=this.getAttr("text",!1),a=this.getAttr("ghost",!1),c=["l-btn",`l-btn-${t}`,this.getAttr("block",!1)?"l-btn-block":"",s==="round"?"l-btn-round":"",s==="circle"?"l-btn-circle":"",a?"l-btn-ghost":"",l?"l-btn-text":"",i?"l-btn-loading":""];e.className=B(c),e.disabled=this.getAttr("disabled",!1)||i,e.type=this.getAttr("html-type","button");const p=this.applyColor(this.getAttr("color"),l,a);p&&(e.style.cssText=p),i?e.innerHTML=this.loadingBody():e.innerHTML="<slot></slot>",e.setAttribute("part","default"),this.root.appendChild(e)}loadingBody(){const t=this.getAttr("loading-text",""),e=['<l-loading-icon class="l-rotate-anim"></l-loading-icon>'];return t===""?e.push("<slot></slot>"):e.push(`<span>${t}</span>`),e.join("")}applyColor(t,e=!1,i=!1){if(!t)return"";const s=et(t,1,!0),l=et(t,3,!1);return tt({"--l-btn-border-color":e?"transparent":t,"--l-btn-text-color":i||e?t:"#ffffff","--l-btn-hover-text-color":i||e?s:"#ffffff","--l-btn-background":i||e?"transparent":t,"--l-btn-active-text-color":i||e?l:"#ffffff","--l-btn-hover-border-color":e?"transparent":s,"--l-btn-hover-background":i||e?"transparent":s,"--l-btn-active-background":i||e?"transparent":l,"--l-btn-active-border-color":e?"transparent":l})}_getForm(){let t=this.parentElement,e;for(;t!=null;){const i=t.tagName;if(i==="L-FORM"){e=t;break}if(i==="BODY")break;t=t.parentElement}return t=null,e}}n(Wt,"baseName","button");let f;function Y(r,o,t){f==null&&(f=new Map),f.has(r)||f.set(r,new Map([[o,new Set]])),f.get(r).has(o)||f.get(r).set(o,new Set),f.get(r).get(o).add(t)}function st(r,o,t){var e,i,s,l,a,c;(i=(e=f==null?void 0:f.get(r))==null?void 0:e.get(o))==null||i.delete(t),((l=(s=f==null?void 0:f.get(r))==null?void 0:s.get(o))==null?void 0:l.size)==0&&((a=f.get(r))==null||a.delete(o)),((c=f==null?void 0:f.get(r))==null?void 0:c.size)==0&&f.delete(r),(f==null?void 0:f.size)==0&&(f=void 0)}function Yt(r){r==null?f!=null&&(f.clear(),f=void 0):f!=null&&(f.delete(r),f.size===0&&(f=void 0))}function T(r,o,...t){var i;const e=(i=f==null?void 0:f.get(r))==null?void 0:i.get(o);if(e!=null)for(const s of e)s(...t)}class K extends N{constructor(t=!0){super();n(this,"disabled",!1);n(this,"name");n(this,"formAttrs",{});n(this,"formItemAttrs",{});n(this,"_value","");n(this,"_resetValue");n(this,"_firstPushValue",!0);n(this,"_reseting",!1);n(this,"_formAttributeChanged",(t,e,i)=>{i===this.formAttrs.formId?this.formAttrs[t]=e:this.formItemAttrs[t]=e,t==="disabled"&&this._changeDisabled()});n(this,"_resetFieldValue",()=>{this._reseting=!0,this.reset()});this._firstPushValue=t}set value(t){this.setValue(t)}get value(){return this.getValue()}setValue(t){this._value=t,this.pushValueChange()}getValue(){return this._value}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,i){if(this.rendered)if(t==="disabled"){const s=L(i,!1,t);s!==this.disabled&&(this._changeDisabled(),this.disabled=s)}else this.attributeChange(t,e,i)}attributeChange(t,e,i){}connectedCallback(){const t=this._getForm();this.formAttrs=t.formAttr,this.formItemAttrs=t.formItemAttr,this.formAttrs.id&&(Y(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),Y(this.formAttrs.id,"reset",this._resetFieldValue),this._firstPushValue&&this.pushValueChange()),this.formItemAttrs.id&&Y(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged),super.connectedCallback()}disconnectedCallback(){this.formAttrs.id&&(st(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),st(this.formAttrs.id,"reset",this._resetFieldValue)),this.formItemAttrs.id&&st(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged),super.disconnectedCallback()}isDisabled(){return this.disabled===!0||this.formItemAttrs.disabled===!0?!0:this.formAttrs.disabled||!1}getName(){return this.name?this.name:this.formItemAttrs.name}_getForm(){let t=this.parentElement,e={},i={};for(;t!=null;){const s=t.tagName;if(s==="L-FORM"){const l=t.sharedAttrs;for(let a=0;a<l.length;a++){const c=l[a];e[c]=t[c]}break}if(s==="BODY")break;if(s==="L-FORM-ITEM"){const l=t.sharedAttrs;for(let a=0;a<l.length;a++){const c=l[a];i[c]=t[c]}}t=t.parentElement}return t=null,{formAttr:e,formItemAttr:i}}_changeDisabled(){}pushValueChange(){const t=this.getName();this.formAttrs.id&&t&&T(this.formAttrs.id,"valueChange",t,this._value,!this._reseting),this._reseting=!1}reset(){this.value=this._resetValue||""}}const Ct=":host{width:var(--l-input-width,auto);display:inline-block}.l-input{box-sizing:border-box;width:100%;max-width:100%;height:var(--l-form-edit-height,32px);border:1px solid var(--l-border-color,#dedede);text-align:inherit;vertical-align:middle;border-radius:3px;outline:none;padding:0 5px;transition:border-color .3s}.l-input.is-error{--l-border-color:var(--nt-error-color,#ed3f13)}.l-input:not(.is-error):focus{border-color:var(--l-primary-color,#722ed1)}.l-input:disabled{cursor:not-allowed;background:var(--l-disabled-color,#f5f7fa)}";class Kt extends K{constructor(){super();n(this,"type","text");n(this,"placeholder");n(this,"autosize",!1);n(this,"allowInput");n(this,"parser");n(this,"width");n(this,"block",!1);n(this,"error",!1);n(this,"$input");n(this,"_input",t=>{const e=t.target;let i=e.value;if(this.allowInput!=null){let s=this.allowInput.indexOf("."),l=s===-1?s:parseInt(this.allowInput.substring(s+1));i=this._numberInputParse(i,{integer:this.allowInput.includes("integer"),negative:this.allowInput.startsWith("-"),precition:l}),i=String(i),e.value=i}this.parser!=null&&(i=this.parser(i),e.value=i),this.setValue(i)});n(this,"_validateChange",(t,e)=>{const i=this.getName();if(i){const s=t===!0?!1:t[i]!=null;(e==null||e===i&&this.error!=s)&&(this.error=s,this._updateError()),Object.keys(t)[0]===i&&this.focus()}});M(this)}set value(t){this.setValue(t),this.$input!=null&&(this.$input.value=this.value)}get value(){return this.getValue()}static get observedAttributes(){return["disabled","error"]}connectedCallback(){super.connectedCallback(),this.loadStyleText([Ct])}disconnectedCallback(){super.disconnectedCallback(),this.formAttrs.id&&st(this.formAttrs.id,"validateChange",this._validateChange),E(this.$input,"input",this._input),this.$input=void 0}attributeChange(t,e,i){if(t==="error"){const s=L(i,!1,t);s!==this.error&&(this.error=s,this._updateError())}}render(){let t=F("value",this.value);const e=F("placeholder",this.placeholder),i=F("disabled",this.isDisabled()),s=B({"l-input":!0,"is-autosize":this.autosize,"is-error":this.error}),l=this.getName(),a=F("name",l),c=`${t}${a}${e}${i}`;this.shadow.innerHTML=`<input part="default" type="${this.type}" class="${s}"${c}></input>`,this.$input=d("input",this.root),_(this.$input,"input",this._input),this.style.cssText=tt(this._getStyleObj())+this.getAttr("style",""),l&&this.formAttrs.id&&Y(this.formAttrs.id,"validateChange",this._validateChange)}setParser(t){this.parser=t}focus(){var t;(t=this.$input)==null||t.focus()}_changeDisabled(){this.$input!=null&&(this.$input.disabled=this.isDisabled())}_numberInputParse(t,e){let i=t,s=e.negative?"-?":"";if(e.integer){const a=i.match(new RegExp(`^(${s}\\d*)`));return a!=null?a[1]:i.substring(0,i.length-1)}const l=i.match(new RegExp(`(${s}\\d+\\.\\d{0,${e.precition}})|(${s}\\d*)`));return l!=null?i=l[1]||l[2]:i="",l!=null?l[1]||l[2]:""}_getStyleObj(){const t={};return this._isBlock()&&(t["--l-input-width"]="100%"),this.width&&(t["--l-input-width"]=this.width),t}_isBlock(){if(this.block===!0||this.formItemAttrs.innerBlock===!0||this.formAttrs.innerBlock===!0)return!0}_updateError(){this.$input&&(this.error?w(this.$input,"is-error"):A(this.$input,"is-error"))}}n(Kt,"baseName","input");const xr=":host{display:inline-flex}.l-icon{fill:currentColor;vertical-align:middle;width:1em;height:1em;display:inline-block}";class y extends N{constructor(){super();n(this,"useLink");n(this,"viewBox");this.useLink=!1,this.viewBox="0 0 1024 1024"}connectedCallback(){this.loadStyleText([xr]),this.render(),this.rendered=!0}render(){const t=this.createEl("svg"),e=this.getAttr("useLink",this.useLink),i=this.getAttr("viewBox",this.viewBox);t.classList.add("l-icon"),e||t.setAttribute("viewBox",i);const s=this.renderChildren();if(typeof s=="string")if(s===""){const l=this.children,a=[];for(let c=0,p=l.length;c<p;c++){const h=l[c];a.push(h.outerHTML)}t.innerHTML=a.join("")}else t.innerHTML=s;else t.append(s);this.shadow.appendChild(t)}renderChildren(){return""}createEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}n(y,"baseName","base-icon");class Ut extends y{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path>'}}n(Ut,"baseName","arrow-down-icon");class Gt extends y{renderChildren(){return'<path fill="currentColor" d="M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"></path>'}}n(Gt,"baseName","arrow-left-icon");class Jt extends y{renderChildren(){return'<path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"></path>'}}n(Jt,"baseName","arrow-right-icon");class Xt extends y{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"></path>'}}n(Xt,"baseName","arrow-up-icon");class Zt extends y{renderChildren(){return'<path fill="currentColor" d="M512 320 192 704h639.936z"></path>'}}n(Zt,"baseName","caret-top-icon");class Qt extends y{renderChildren(){return'<path fill="currentColor" d="m192 384 320 384 320-384z"></path>'}}n(Qt,"baseName","caret-bottom-icon");class te extends y{constructor(){super();n(this,"_t");n(this,"_start");this.useLink=!0,this._t=void 0,this._start=0}renderChildren(){return""}render(){super.render()}disconnectedCallback(){this._t!=null&&(cancelAnimationFrame(this._t),this._t=void 0)}connectedCallback(){super.connectedCallback();const t=this.getAttribute("name");this._start=Date.now(),t&&this._loadIcon(t)}_loadIcon(t){Date.now()-this._start>=1e4||(this._t=requestAnimationFrame(()=>{const i=document.querySelector(`#${t}`);if(i==null){this._loadIcon(t);return}this._t=void 0;let s=i.getAttribute("viewBox");s||(s="0 0 1024 1024");const l=this.shadow.querySelector("svg");l!=null&&(l.setAttribute("viewBox",s),l.innerHTML=i.innerHTML)}))}}n(te,"baseName","font-icon");let kr=(Lt=class extends y{renderChildren(){return'<path d="M520.665 64.564a29.244 29.244 0 0 0-7.071-.894c-16.211 0-29.35 13.14-29.35 29.35 0 15.83 12.538 28.696 28.223 29.293v.073c.375 0 .751-.014 1.127-.014 216.493 0 389.629 173.942 389.629 390.433 0 216.496-173.136 388.827-389.63 388.827s-389.63-172.333-389.63-388.829c0-.27.01-.536.01-.804h-.01c0-16.209-13.141-29.35-29.35-29.35s-29.35 13.139-29.35 29.35c0 .055.007.11.007.164-.001.214-.007.425-.007.64 0 247.609 200.722 448.331 448.33 448.331 247.607 0 448.33-200.722 448.33-448.33-.002-245.242-196.917-444.456-441.258-448.24z" fill="currentColor"></path>'}},n(Lt,"baseName","loading-icon"),Lt);class ee extends y{renderChildren(){return'<path fill="currentColor" d="m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"></path>'}}n(ee,"baseName","search-icon");class re extends y{constructor(){super(),this.viewBox="0 0 24 24"}renderChildren(){return'<path d="M12 18c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6zm0-10c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zM12 4c-.6 0-1-.4-1-1V1c0-.6.4-1 1-1s1 .4 1 1v2c0 .6-.4 1-1 1zM12 24c-.6 0-1-.4-1-1v-2c0-.6.4-1 1-1s1 .4 1 1v2c0 .6-.4 1-1 1zM5.6 6.6c-.3 0-.5-.1-.7-.3L3.5 4.9c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l1.4 1.4c.4.4.4 1 0 1.4-.1.2-.4.3-.7.3zM19.8 20.8c-.3 0-.5-.1-.7-.3l-1.4-1.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l1.4 1.4c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zM3 13H1c-.6 0-1-.4-1-1s.4-1 1-1h2c.6 0 1 .4 1 1s-.4 1-1 1zM23 13h-2c-.6 0-1-.4-1-1s.4-1 1-1h2c.6 0 1 .4 1 1s-.4 1-1 1zM4.2 20.8c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l1.4-1.4c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-1.4 1.4c-.2.2-.4.3-.7.3zM18.4 6.6c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l1.4-1.4c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-1.4 1.4c-.2.2-.5.3-.7.3z"></path>'}}n(re,"baseName","sun-icon");class ie extends y{constructor(){super(),this.viewBox="0 0 24 24"}renderChildren(){return'<path d="M12.1 22h-.9c-5.5-.5-9.5-5.4-9-10.9.4-4.8 4.2-8.6 9-9 .4 0 .8.2 1 .5.2.3.2.8-.1 1.1-2 2.7-1.4 6.4 1.3 8.4 2.1 1.6 5 1.6 7.1 0 .3-.2.7-.3 1.1-.1.3.2.5.6.5 1-.2 2.7-1.5 5.1-3.6 6.8-1.9 1.4-4.1 2.2-6.4 2.2zM9.3 4.4c-2.9 1-5 3.6-5.2 6.8-.4 4.4 2.8 8.3 7.2 8.7 2.1.2 4.2-.4 5.8-1.8 1.1-.9 1.9-2.1 2.4-3.4-2.5.9-5.3.5-7.5-1.1-2.8-2.2-3.9-5.9-2.7-9.2z"></path>'}}n(ie,"baseName","moon-icon");class oe extends y{constructor(){super()}renderChildren(){return'<path d="M1039.92888889 967.11111111L1039.92888889 56.88888889c0-40.15900445-32.65877333-72.81777778-72.81777778-72.81777778l-910.22222222 0c-40.15900445 0-72.81777778 32.65877333-72.81777778 72.81777778l0 910.22222222c0 40.15900445 32.65877333 72.81777778 72.81777778 72.81777778L967.11111111 1039.92888889c40.15900445 0 72.81777778-32.65877333 72.81777778-72.81777778zM56.88888889 56.88888889L967.11111111 56.88888889l0 910.22222222-910.22222221 0.07281778L56.88888889 56.88888889z"></path><path d="M876.08888889 349.17944888a36.40888889 36.40888889 0 0 0-36.40888889-36.40888889l-120.47701333 1e-8L719.20298668 184.32a36.40888889 36.40888889 0 0 0-72.81777779 0l0 164.85944889a36.40888889 36.40888889 0 0 0 36.40888889 36.40888889L839.68 385.58833778a36.40888889 36.40888889 0 0 0 36.40888889-36.4088889z m-156.88590221 473.27914667L719.20298667 694.04444445 839.68 694.04444445a36.40888889 36.40888889 0 1 0 0-72.81777778l-156.88590222 0a36.40888889 36.40888889 0 0 0-36.40888889 36.40888888l0 164.82304a36.40888889 36.40888889 0 1 0 72.81777779 0zM366.36444445 349.17944888L366.36444445 184.32a36.40888889 36.40888889 0 1 0-72.81777778 0l0 128.45055999-120.51342222 1e-8a36.40888889 36.40888889 0 1 0 0 72.81777778L329.95555555 385.58833778a36.40888889 36.40888889 0 0 0 36.4088889-36.4088889z m0 473.27914667L366.36444445 657.63555555a36.40888889 36.40888889 0 0 0-36.4088889-36.40888888l-156.9223111-1e-8a36.40888889 36.40888889 0 1 0 0 72.81777779L293.54666667 694.04444445l0 128.4141511a36.40888889 36.40888889 0 1 0 72.81777778 0z"></path>'}}n(oe,"baseName","reduction-icon");class se extends y{constructor(){super()}renderChildren(){return'<path d="M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"></path>'}}n(se,"baseName","refresh-left-icon");class le extends y{renderChildren(){return'<path d="M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"></path>'}}n(le,"baseName","refresh-right-icon");class ne extends y{constructor(){super(),this.viewBox="0 0 24 24"}renderChildren(){return'<path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10m0-1.5v-17a8.5 8.5 0 0 1 0 17"/>'}}n(ne,"baseName","theme-default-icon");class ae extends y{renderChildren(){return'<path d="M384 96a32 32 0 0 1 64 0v786.752a32 32 0 0 1-54.592 22.656L95.936 608a32 32 0 0 1 0-45.312h.128a32 32 0 0 1 45.184 0L384 805.632zm192 45.248a32 32 0 0 1 54.592-22.592L928.064 416a32 32 0 0 1 0 45.312h-.128a32 32 0 0 1-45.184 0L640 218.496V928a32 32 0 1 1-64 0V141.248z"></path>'}}n(ae,"baseName","sort-icon");class ce extends y{constructor(){super(),this.viewBox="0 0 24 24"}renderChildren(){return'<path fill="currentColor" d="M12 23a11 11 0 100-22 11 11 0 000 22zM8.82 7.4L12 10.6l3.18-3.19 1.42 1.42L13.4 12l3.19 3.18-1.42 1.42L12 13.4 8.82 16.6 7.4 15.18 10.6 12 7.4 8.82 8.82 7.4z"></path>'}}n(ce,"baseName","mask-close-icon");class de extends y{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="M512 0C228.693333 0 0 228.693333 0 512s228.693333 512 512 512 512-228.693333 512-512S795.306667 0 512 0z m307.2 368.64L467.626667 730.453333c0 3.413333-3.413333 3.413333-3.413334 6.826667-13.653333 13.653333-37.546667 13.653333-51.2 0l-177.493333-177.493333c-13.653333-13.653333-13.653333-37.546667 0-51.2 13.653333-13.653333 37.546667-13.653333 51.2 0l150.186667 153.6 334.506666-341.333334c13.653333-13.653333 37.546667-13.653333 51.2 0 10.24 10.24 10.24 34.133333-3.413333 47.786667z m0 0"></path>'}}n(de,"baseName","success-icon");class he extends y{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="M512 1024C229.234 1024 0 794.766 0 512S229.234 0 512 0s512 229.234 512 512-229.234 512-512 512z m-64.853-734.52l19.484 244.906 1.309 16.156c1.251 15.93 15.018 28.644 30.72 28.644h25.571c15.56 0 29.298-12.601 30.663-28.132l1.422-16.668 21.334-244.907c3.214-36.978-24.434-66.844-61.725-66.844h-6.627c-37.462 0-65.138 29.923-62.18 66.844zM512 801.393a66.788 66.788 0 1 0 0-133.575 66.788 66.788 0 0 0 0 133.575z"></path>'}}n(he,"baseName","warn-icon");class pe extends y{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="M512 64a448 448 0 110 896.064A448 448 0 01512 64zm67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344zM590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 01-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 017.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"></path>'}}n(pe,"baseName","info-icon");const rt=[],ue=[["opacity","0","0.3s"],["transform","translate3d(-50%, -100%, 0)","0.3s"]];let fe=!0;function be(r){const o=rt.findIndex(s=>s.id===r);if(o===-1)return;const t=rt.splice(o,1)[0];if(t==null)return;Rt(t,ue,"leave",()=>{t.remove()});const e=15+t.offsetHeight,i=rt.length;if(i!==0)for(let s=o;s<i;s++){const l=rt[s],a=parseInt(l.style.top,10)-e;l.style.setProperty("top",`${a}px`)}}function yr(r){const o=document.createElement("div");o.id=r.id;const t=r.type||"info";let e=`l-message l-message-${t}`;r.customClass&&(e+=" "+r.customClass),o.className=e,o.style.setProperty("top",`${r.offset}px`),o.style.setProperty("z-index",`${r.zindex||1e3}`),r.width&&o.style.setProperty("width",r.width);let i=t;return i==="error"&&(i="mask-close"),o.innerHTML=['<div class="l-message-container">',`<l-${i}-icon class="l-message-icon"></l-${i}-icon>`,`<span class="l-message-content">${r.message}</span>`,"</div>"].join(""),o}const O=r=>{fe&&(u([ce,de,he,pe]),fe=!1);const o=rt.reduce((l,a)=>l+a.offsetHeight+15,15),t=Bt(),e=typeof r=="string"?{message:r}:r;e.id=t,e.offset=o;const i=yr(e);rt.push(i),document.body.appendChild(i),Rt(i,ue,"enter");let s=e.duration;return s==null&&(s=3e3),s!==0&&setTimeout(()=>{be(t)},s),t};function lt(r,o="info"){const t=typeof r=="string"?{message:r}:r;return t.type||(t.type=o),O(t)}O.info=r=>lt(r,"info"),O.success=r=>lt(r,"success"),O.error=r=>lt(r,"error"),O.warn=r=>lt(r,"warn"),O.show=r=>lt(r),O.close=be;const $t={mobile:"请输入正确的手机号",same:"两次输入不一致",required:"%s为必填字段"},At="请输入正确的数据",U={same:/^same:(.+)$/i,mobile:/^1[345678]\d{9}$/,required:/^\S{1}.*/},Et={same(r,o){return o===r},pattern(r,o){return o==null?!1:r.test(String(o))}};class me extends Error{constructor(o,t,e){super(e),this.name="ValidateError",this.key=t,this.detail=o}}class wr{constructor(o){this.rules={},this.addSchemas(o)}addSchemas(o){for(let t of o)this.rules[t.key]=this._parseSchemaRules(t)}addSchema(o){this.rules[o.key]=this._parseSchemaRules(o)}async validate(o,t=!1){return new Promise((e,i)=>{const s={};let l,a;for(let c in this.rules){let p=this._validateRule(this.rules[c],o[c],o);if(p!==""&&(p=p.replace("%s",c),s[c]=p,l=c,a=p,t))break}l==null?e(!0):i(new me(s,l,a))})}async validateKey(o,t,e){return new Promise((i,s)=>{let l=this.rules[o];if(l==null){i({key:o,value:t});return}let a=this._validateRule(l,t,e);a!==""?(a=a.replace("%s",o),s(new me({[o]:a},o,a))):i({key:o,value:t})})}_validateRule(o,t,e){let i="";for(let s of o)if(s.rule==="required"?(t==null||!Et.pattern(U.required,t))&&(i=s.message):typeof s.rule=="function"?s.rule(t)||(i=s.message):s.sameKey!=null?e!=null&&(Et.same(t,e[s.sameKey])||(i=s.message)):Et.pattern(s.rule,t)||(i=s.message),i!=="")break;return i}_parseSchemaRules(o){let t=[],e=o.rules;if(o.required===!0&&t.push(...this._parseStringRule("required",o.message)),e!=null)if(typeof e=="string")t=t.concat(this._parseStringRule(e,o.message));else if(e instanceof Array)for(let i of e)typeof i=="string"?t.push(...this._parseStringRule(i,o.message)):i instanceof RegExp||typeof i=="function"?t.push({rule:i,message:o.message||At}):typeof i.rule=="string"?t.push(...this._parseStringRule(i.rule,i.message)):t.push({rule:i.rule,message:i.message||At});else t.push({rule:e,message:At});return t}_parseStringRule(o,t){let e=[],i=o.split("|");for(let s of i){let l=t,a=null,c;if(o==="required")a="required",l=l||t||$t.required;else if(U.same.test(s)){if(s.match(U.same)!=null){a=U.same;let h=s.match(U.same);h!=null&&(c=h[1]),l=l||$t.same}}else Object.hasOwn(U,s)&&(a=U[s],l=l||$t[s]);e.push({rule:a,message:l,sameKey:c})}return e}}const _r=":host{display:block}.l-form{grid-template-columns:var(--l-form-label-width,auto)1fr;row-gap:20px;display:grid}.l-form-inline{flex-flow:wrap;gap:20px;display:flex}.l-form.l-form-inline{--l-form-item-display:flex}.l-form.l-form--left{--l-form-label-align:left}.l-form.l-form--top{--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}";class ge extends N{constructor(){super();n(this,"inline",!1);n(this,"labelPosition","right");n(this,"labelWidth");n(this,"id");n(this,"disabled",!1);n(this,"sharedAttrs",["disabled","id","innerBlock"]);n(this,"validator");n(this,"innerBlock",!1);n(this,"novalidate",!1);n(this,"_data");n(this,"emit");n(this,"ruleChange",t=>{this.validator.addSchema(t)});n(this,"_valueChange",(t,e,i=!0)=>{this._data==null&&(this._data={});const s=Object.hasOwn(this._data,t);this._data[t]=e,!this.novalidate&&s&&i&&this.validator.validateKey(t,e,this._data).then(()=>{T(this.id,"validateChange",!0,t)}).catch(l=>{T(this.id,"validateChange",l.detail,t)})});M(this),this.id==null&&(this.id=`l-f${H(3)}-${H(6)}`),this.validator=new wr([]),this.emit=new CustomEvent("submit")}static get observedAttributes(){return["disabled","label-position"]}attributeChangedCallback(t,e,i){if(t==="disabled"){const s=L(i,!1,t);s!==this.disabled&&(T(this.id,"attributeChanged",t,s,this.id),this.disabled=s)}else if(t==="label-position"){const s=d("form",this.root);s&&(s.className=B(["l-form",this.inline?"l-form-inline":void 0,`l-form--${i}`]))}}connectedCallback(){this.loadStyleText([_r]),super.connectedCallback(),Y(this.id,"ruleChange",this.ruleChange),Y(this.id,"valueChange",this._valueChange)}disconnectedCallback(){Yt(this.id),this.validator=void 0}render(){const t=B(["l-form",this.inline?"l-form-inline":void 0,`l-form--${this.labelPosition}`]),e=tt({"--l-form-label-width":this.labelWidth?this.labelWidth:""});return`<form class="${t}" style="${e}"><slot></slot></form>`}validateField(t){const e=[];if(this._data!=null){if(Array.isArray(t))for(let i=0,s=t.length;i<s;i++){const l=t[i];e.push(this.validator.validateKey(l,this._data[l],this._data))}else e.push(this.validator.validateKey(t,this._data[t],this._data));Promise.allSettled(e).then(i=>{for(let s=0,l=i.length;s<l;s++){const a=i[s];a.status==="rejected"?T(this.id,"validateChange",a.reason.detail,a.reason.key):T(this.id,"validateChange",!0,a.value.key)}})}}clearValidate(){T(this.id,"validateChange",!0)}reset(){this.clearValidate(),T(this.id,"reset")}submit(){this.novalidate?this.dispatchEvent(this.emit):this.validate().then(t=>{t&&this.dispatchEvent(this.emit)})}async validate(){if(this._data!=null)try{return await this.validator.validate(this._data),T(this.id,"validateChange",!0),Promise.resolve(!0)}catch(t){return T(this.id,"validateChange",t.detail),Promise.resolve(!1)}return Promise.resolve(!0)}getData(){return{...this._data}}}n(ge,"baseName","form");const Cr=':host{display:contents}.l-form-item{display:var(--l-form-item-display,contents);grid-template-columns:1fr;font-size:14px}.l-form-item__label{text-align:var(--l-form-label-align,right);width:var(--l-form-label-width,auto);height:var(--l-form-edit-height,32px);line-height:var(--l-form-edit-height,32px);color:#606266;padding:0 10px 0 0;display:inline-block}.l-form-item__label:empty{display:var(--l-form-label-empty-display,inline-block)}.l-form-item.is-required .l-form-item__label:before{content:"*";color:var(--l-warn-color,#f56c6c);vertical-align:middle;margin-right:4px}.l-form-item__content{flex:1;align-items:center;display:flex;position:relative}.l-form-item__error{color:var(--nt-error-color,#ed3f13);padding-top:3px;font-size:12px;line-height:1;position:absolute;top:100%;left:0}.l-form-item.l-form-item--left{--l-form-label-align:left}.l-form-item.l-form-item--top{--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}';class ve extends N{constructor(){super();n(this,"disabled",!1);n(this,"sharedAttrs",["disabled","id","name","innerBlock"]);n(this,"required",!1);n(this,"error");n(this,"label");n(this,"id");n(this,"verify");n(this,"validity");n(this,"pattern");n(this,"name");n(this,"innerBlock",!1);n(this,"labelPosition","right");n(this,"formId");n(this,"_validateChange",(t,e)=>{const i=t===!0?void 0:t[this.name];(e==null||e===this.name&&this.error!=i)&&(this.error=i,this._updateError())});M(this),this.id==null&&(this.id=`l-fi${H(3)}-${H(6)}`)}static get observedAttributes(){return["error","label","disabled"]}attributeChangedCallback(t,e,i){if(t==="error")i!=this.error&&(this.error=i,this._updateError());else if(t==="label")this.label=i,this._updateLabel();else if(t==="disabled"){const s=L(i,!1,t);s!==this.disabled&&(T(this.id,"attributeChanged",t,s,this.id),this.disabled=s)}}connectedCallback(){var t;if(super.connectedCallback(),this.loadStyleText([Cr]),this.formId=this._getFormId(),this.name&&this.formId){let e=((t=this.verify)==null?void 0:t.split("|"))||[];this.pattern&&e.push(new RegExp(this.pattern));const i={key:this.name,required:this.required,message:this.validity,rules:e};T(this.formId,"ruleChange",i),Y(this.formId,"validateChange",this._validateChange)}}disconnectedCallback(){Yt(this.id),this.formId&&st(this.formId,"validateChange",this._validateChange)}setRules(t){const e={...t,key:this.name};e.required!=null&&this.required&&(e.required=!0),this.formId&&T(this.formId,"ruleChange",e)}setError(t){this.error=t}render(){const t=["l-form-item",this.required?"is-required":void 0,this.error?"is-error":void 0,`l-form-item--${this.labelPosition}`],e=this.label!=null?`<label class="l-form-item__label">${this.label}</label>`:"",i=this.error?`<div class="l-form-item__error">${this.error}</div>`:"";return[`<div class="${B(t)}">${e}`,'<div class="l-form-item__content">',`<slot></slot>${i}</div></div>`].join("")}_updateError(){if(!this.rendered)return;let t=d(".l-form-item__error",this.root);if(t)this.error?t.textContent=this.error:t.remove();else if(this.error){t=document.createElement("div"),t.className="l-form-item__error",t.textContent=this.error;const i=d(".l-form-item__content",this.root);i&&i.appendChild(t)}const e=d(".l-form-item",this.root);e&&(this.error?w(e,"is-error"):A(e,"is-error"))}_updateLabel(){if(!this.rendered)return;let t=d(".l-form-item__label",this.root);if(t==null){if(this.label!=null){t=document.createElement("div"),t.className="l-form-item__label",t.textContent=this.label;const e=d(".l-form-item",this.root);e&&e.appendChild(t)}}else this.label!=null?t.textContent=this.label:t.remove()}_getFormId(){let t=this.parentElement,e;for(;t!=null;){const i=t.tagName;if(i==="L-FORM"){e=t.id;break}if(i==="BODY")break;t=t.parentElement}return t=null,e}}n(ve,"baseName","form-item");const $r=':host{align-items:center;display:flex}.l-radio{--l-radio-size:16px;--l-radio-label-color:#333;--l-radio-disabled-color:#e6e6e6;--l-radio-disabled-label-color:var(--l-disabled-color,#c0c4cc);--l-radio-checked-color:var(--l-primary-color,#722ed1);--l-radio-item-margin:10px;cursor:pointer;align-items:center;display:inline-flex;position:relative}.l-radio__label{margin-left:5px;transition:color .3s ease-in-out}.l-radio__input{z-index:-1;opacity:0;width:0;height:0;position:absolute}.l-radio__inner{width:var(--l-radio-size);height:var(--l-radio-size);box-sizing:border-box;border:1px solid #dcddd9;border-radius:50%;justify-content:center;align-items:center;transition:border-color .3s ease-in-out;display:flex}.l-radio__inner:before{content:"";background-color:#0000;border-radius:50%;width:60%;height:60%;transition:background-color .3s ease-in-out;display:block}.l-radio.is-checked .l-radio__inner{border-color:var(--l-primary-color,#722ed1)}.l-radio.is-checked .l-radio__inner:before{background-color:var(--l-primary-color,#722ed1)}.l-radio.is-checked .l-radio__label{color:var(--l-primary-color,#722ed1)}.l-radio--disabled{cursor:not-allowed}.l-radio--disabledd .l-radio__inner{border-color:var(--l-radio-disabled-color)}.l-radio--disabled .l-radio__label{color:var(--l-radio-disabled-label-color)}.l-radio:not(:first-child){margin-left:var(--l-radio-item-margin)}.l-radio--button .l-radio__label{height:var(--l-form-edit-height,32px);border:1px solid #c0c4cc;border-left-width:0;justify-content:center;align-items:center;margin-left:0;padding:0 15px;display:inline-flex}.l-radio--button:not(:first-of-type){margin-left:0}.l-radio--button:first-of-type .l-radio__label{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.l-radio--button:last-of-type .l-radio__label{border-top-right-radius:3px;border-bottom-right-radius:3px}.is-checked.l-radio--button .l-radio__label{background-color:var(--l-radio-checked-color);color:#fff;border-color:var(--l-radio-checked-color)}';class xe extends K{constructor(){super(!1);n(this,"type");n(this,"label");n(this,"checked",!1);n(this,"_ignoreInitAttrs",[]);n(this,"_radioChange",t=>{const e=t.target;let i=e.parentElement;for(;i!=null&&!Ft(i,"l-radio");)i=i.parentElement;const s=d(".is-checked",this.root);s&&A(s,"is-checked"),this.value=e.value,i&&w(i,"is-checked"),this.dispatchEvent(new CustomEvent("change"))});M(this)}setItems(t){this._removeEvents(),this.root.innerHTML=this._renderItems(t),this._initEvents()}connectedCallback(){super.connectedCallback(),this.loadStyleText($r),this._initEvents()}disconnectedCallback(){super.disconnectedCallback(),this._removeEvents()}attributeChange(t,e,i){if(t==="checked"){const s=L(i,!1,t);this.checked=s,this.value=s;const l=d(".l-radio",this.root);if(l&&!Ft(l,"is-checked")){w(l,"is-checked");const a=d("input",l);a&&(a.checked=!0)}}}render(){this.getName()||(this.name=`la${H(3)}_${H(6)}`);const t=[],e=d('[slot="label"]',this),i=j("[radio-value]",this);return e!=null||this.label?(this.value=this._isChecked(),e?t.push(this._renderItem("slot",void 0,this._isChecked(),"label")):t.push(this._renderItem(this.label,void 0,this._isChecked(),"label"))):i.length>0&&(q(i,s=>{const l=s.cloneNode(!0),a=Q(s,"radio-value");t.push(this._renderItem(l.outerHTML,a,this.value===a))}),this.pushValueChange()),t.join("")}setValue(t){super.setValue(t);let e="";typeof t!="boolean"&&(e=`[l-value="${t}"]`);const i=d(".is-checked",this.root);i&&A(i,"is-checked");const s=d(`label${e}`,this.root);if(s){const l=d("input",s);typeof t=="boolean"?(t?w(s,"is-checked"):A(s,"is-checked"),l.checked=t):(w(s,"is-checked"),l.checked=!0)}}_renderItems(t){const e=[];for(let i=0,s=t.length;i<s;i++){const l=t[i];e.push(this._renderItem(l.label,l.value,this.value===l.value,l.labelPart))}return e.join("")}_renderItem(t,e,i=!1,s=void 0){const l=B({"l-radio":!0,"l-radio--disabled":this.isDisabled(),"l-radio--button":this.type==="button","is-checked":i}),a=F("disabled",this.isDisabled()),c=F("checked",i),p=F("value",e),k=`${F("name",this.getName())}${p}${a}${c}`,D=F("part",s),vt=F("l-value",e),V=[`<label class="${l}"${vt}>`,`<input type="radio" class="l-radio__input"${k} />`];this.type!=="button"&&V.push('<span class="l-radio__inner"></span>');let ht=t==="slot"?'<slot name="label"></slot>':t;return V.push(`<div class="l-radio__label"${D}>${ht}</div>`),V.push("</label>"),V.join("")}_isChecked(){return this.checked}_initEvents(){q(j("input",this.root),t=>{_(t,"change",this._radioChange)})}_removeEvents(){q(j("input",this.root),t=>{E(t,"change",this._radioChange)})}}n(xe,"baseName","radio");const Ar=":host{-webkit-overflow-scrolling:touch;height:100%;display:block;position:relative;overflow:auto}.l-list-loadmore{color:#999;justify-content:center;align-items:center;padding:10px;display:flex}.l-list-icon{margin-right:10px;font-size:24px;transform:rotate(80deg)}";class ke extends N{constructor(){super();n(this,"finish",!1);n(this,"infinite",!0);n(this,"observer");n(this,"loadMoreEmit");n(this,"$more");M(this),this.loadMoreEmit=new CustomEvent("load-more")}static get observedAttributes(){return["finish"]}attributeChangedCallback(t,e,i){if(t==="finish"){const s=L(i,!1,t);this.finish!==s&&(this.finish=s,this._finishChange())}}connectedCallback(){this.loadStyleText([Ar,Ot]),super.connectedCallback(),this.infinite&&(this.observer=new IntersectionObserver(t=>{t[0].isIntersecting&&!this.finish&&this.dispatchEvent(this.loadMoreEmit)}),this.$more=d(".l-list-loadmore",this.root),!this.finish&&this.$more&&this.observer.observe(this.$more))}disconnectedCallback(){super.disconnectedCallback(),this.observer&&(this.$more&&(this.observer.unobserve(this.$more),this.$more=void 0),this.observer.disconnect(),this.observer=void 0),this.loadMoreEmit=void 0}render(){const t=["<slot></slot>"];return this.infinite&&(t.push('<div class="l-list-loadmore">'),this.finish||t.push('<l-loading-icon class="l-list-icon l-rotate-anim"></l-loading-icon>'),t.push(`<span class="l-list-loadmore-text">${this._loadingText()}</span></div>`)),t.join("")}_loadingText(){return this.finish?"已经到底啦!":"加载中……"}_finishChange(){if(this.$more){this.observer&&(this.finish?this.observer.unobserve(this.$more):this.observer.observe(this.$more));const t=d(".l-list-loadmore-text",this.$more);t&&(t.textContent=this._loadingText());let e=d(".l-list-icon",this.$more);this.finish?e&&e.remove():e==null&&(e=document.createElement("l-loading-icon"),e.className="l-list-icon l-rotate-anim",this.$more.prepend(e))}}}n(ke,"baseName","list");const Er=".l-polygon{--l-polygen-size:10px;--l-polygen-width:var(--l-polygen-size);--l-polygen-height:var(--l-polygen-size);--l-polygen-background:#666;width:var(--l-polygen-width);height:var(--l-polygen-height);background:var(--l-polygen-background);transition:background .3s ease-in-out;display:inline-block}.l-polygon-triangle-top{clip-path:polygon(calc(var(--l-polygen-width)/2)0,var(--l-polygen-width)var(--l-polygen-height),0 var(--l-polygen-height))}.l-polygon-triangle-top-left{clip-path:polygon(0 0,var(--l-polygen-width)0,0 var(--l-polygen-height))}.l-polygon-triangle-top-right{clip-path:polygon(0 0,var(--l-polygen-width)0,var(--l-polygen-width)var(--l-polygen-height))}.l-polygon-triangle-right{clip-path:polygon(0 0,var(--l-polygen-width)calc(var(--l-polygen-height)/2),0 var(--l-polygen-height))}.l-polygon-triangle-left{clip-path:polygon(var(--l-polygen-width)0,var(--l-polygen-width)var(--l-polygen-height),0 calc(var(--l-polygen-height)/2))}.l-polygon-triangle-bottom{clip-path:polygon(0 0,var(--l-polygen-width)0,calc(var(--l-polygen-width)/2)var(--l-polygen-height))}.l-polygon-triangle-bottom-left{clip-path:polygon(0 0,0 var(--l-polygen-height),var(--l-polygen-width)var(--l-polygen-height))}.l-polygon-triangle-bottom-right{clip-path:polygon(var(--l-polygen-width)0,var(--l-polygen-width)var(--l-polygen-height),0 var(--l-polygen-height))}";class ye extends N{constructor(){super();n(this,"shape","triangle-top");n(this,"background");M(this)}connectedCallback(){this.loadStyleText(Er),super.connectedCallback()}render(){const t=B(["l-polygon",this.shape?`l-polygon-${this.shape}`:""]),e=tt([this.background?`--l-polygen-background: ${this.background}`:""]);return`<div part="default" class="${t}" style="${e}"></div>`}}n(ye,"baseName","polygon");class we extends K{constructor(){super();n(this,"$select");n(this,"changeEmit");n(this,"_handleChange",t=>{const e=t.target.value;super.setValue(e),this.dispatchEvent(this.changeEmit)});M(this),this.changeEmit=new CustomEvent("change")}connectedCallback(){this.loadStyleText(Ct),super.connectedCallback(),this.$select=d("select",this.root),this.value&&(this.$select.value=this.value),_(this.$select,"change",this._handleChange)}disconnectedCallback(){super.disconnectedCallback(),this.$select&&E(this.$select,"change",this._handleChange),this.changeEmit=void 0,this.$select=void 0}render(){let t=this.innerHTML.trim();return`<select class="l-input"${er([["name",this.getName()],["disabled",this.isDisabled()]])}>${t}</select>`}_changeDisabled(){this.$select&&(this.$select.disabled=this.isDisabled())}setOptions(t){if(!this.$select)return;const e=t.map(i=>`<option value="${i.value}">${i.label}</option>`);this.$select.innerHTML=e.join("")}appendOptions(t){if(!this.$select)return;const e=document.createDocumentFragment();for(let i=0,s=t.length;i<s;i++){const l=t[i],a=document.createElement("option");a.value=l.value,a.innerHTML=l.label,e.appendChild(a)}this.$select.appendChild(e)}reset(){super.reset(),this.$select&&(this.$select.value=this.value)}setValue(t){super.setValue(t),this.$select&&(this.$select.value=this.value)}}n(we,"baseName","select-ori");const Mr=":host{--l-switch-height:22px;--l-switch-width:40px;box-sizing:border-box;width:auto;width:var(--l-switch-width);height:var(--l-switch-height);border-radius:calc(var(--l-switch-height)/2);cursor:pointer;vertical-align:middle;background-color:#dcdfe6;border:1px solid #c2c2c2;justify-content:flex-start;align-items:center;padding:2px;transition:all .3s ease-in-out;display:inline-flex;position:relative}:host(:hover),:host(.l-switch--checked):hover{border-color:var(--l-primary-color,#722ed1)}:host(.l-switch--checked){background-color:var(--l-primary-color,#722ed1);border-color:var(--l-primary-color,#722ed1)}.l-switch-action{width:calc(var(--l-switch-height) - 6px);box-sizing:border-box;background-color:#fff;border-radius:50%;justify-content:center;align-items:center;padding:2px;font-size:12px;transition:all .3s ease-in-out;display:flex;position:absolute;top:2px;bottom:2px;left:2px}.l-switch-text{color:#fff;padding-left:calc(var(--l-switch-width) - 20px);transition:padding-left .3s ease-in-out}:host(.l-switch--checked) .l-switch-action{left:calc(var(--l-switch-width) - var(--l-switch-height) + 3px)}:host(.l-switch--checked) .l-switch-text{padding-left:5px}";class _e extends K{constructor(){super(!1);C(this,it);n(this,"actionRender");n(this,"checkedText");n(this,"uncheckedText");C(this,nt,t=>{this.isDisabled()||(this.setValue(!this.value),this.dispatchEvent(new CustomEvent("change")))});M(this);const t=this.value?L(this.value,!1,"value"):!1;this._resetValue=t,this.value=t}connectedCallback(){this.loadStyleText(Mr),super.connectedCallback(),this.pushValueChange(),b(this,it,xt).call(this),_(this,"click",m(this,nt))}disconnectedCallback(){super.disconnectedCallback(),E(this,"click",m(this,nt)),this.actionRender=void 0}render(){this.isDisabled()&&this.classList.add("l-switch--disabled"),this.value&&this.classList.add("l-switch--checked");const t=['<div class="l-switch-action" part="action"></div>'];if(this.checkedText||this.uncheckedText){const e=this.value?this.checkedText||"":this.uncheckedText||"";t.push(`<span class="l-switch-text">${e}</span>`)}return t.join("")}setValue(t){super.setValue(t),t?w(this,"l-switch--checked"):A(this,"l-switch--checked");const e=d(".l-switch-text",this.root);e&&(e.textContent=this.value?this.checkedText||"":this.uncheckedText||""),b(this,it,xt).call(this)}setActionRender(t){this.actionRender=t,b(this,it,xt).call(this)}}nt=new WeakMap,it=new WeakSet,xt=function(){const t=d(".l-switch-action",this.root);if(t)if(this.actionRender){const e=this.actionRender({checked:this.value});typeof e=="string"?t.innerHTML=e:t.innerHTML=e.outerHTML}else{const e=d('[slot="checked-action"]',this),i=d('[slot="unchecked-action"]',this);this.value&&e?t.innerHTML='<slot name="checked-action"></slot>':!this.value&&i&&(t.innerHTML='<slot name="unchecked-action"></slot>')}},n(_e,"baseName","switch");const Lr=":host{--l-input-width:60px}";class Ce extends K{constructor(){super();n(this,"$picker");n(this,"_value","#000000");n(this,"_handleChange",t=>{const e=t.target.value;super.setValue(e),this.dispatchEvent(new CustomEvent("change",{detail:e}))});M(this)}setValue(t){super.setValue(t),this.$picker&&(this.$picker.value=t)}connectedCallback(){this.loadStyleText([Ct,Lr]),super.connectedCallback(),this.$picker=d("input",this.root),_(this.$picker,"change",this._handleChange)}disconnectedCallback(){super.disconnectedCallback(),this.$picker&&(E(this.$picker,"change",this._handleChange),this.$picker=void 0)}render(){const t=document.createElement("input");return rr(t,[["value",this.value],["disabled",this.isDisabled()],["name",this.getName()],["type","color"],["class","l-input l-color-picker"]]),t}_changeDisabled(){this.$picker&&(this.$picker.disabled=this.isDisabled())}}n(Ce,"baseName","color-picker");const Tr=":host{--l-tabbar-hover-color:var(--l-primary-color-light1,#9254de);--l-tabbar-active-color:var(--l-primary-color,#722ed1);--l-tabbar-item-gap:0;--l-tabbar-height:38px;height:var(--l-tabbar-height);background-color:#fff;display:block;position:relative;overflow:hidden}.l-tabbar-wrapper{align-items:stretch;gap:var(--l-tabbar-item-gap);flex-wrap:nowrap;height:100%;display:flex}.l-tabbar-item{color:#666;cursor:pointer;justify-content:center;align-items:center;transition:all .3s ease-in-out;display:inline-flex}.l-tabbar-item:hover{color:var(--l-tabbar-hover-color)}.l-tabbar-item.active{color:var(--l-tabbar-active-color)}.l-tabbar-item-icon{justify-content:center;align-items:center;margin-bottom:5px;font-size:18px;display:flex}.l-tabbar-item-icon.only{margin-bottom:0;font-size:24px}:host(.l-tabbar--nav){--l-tabbar-height:50px;width:100%}:host(.l-tabbar--nav) .l-tabbar-item{flex-direction:column;flex-grow:1;justify-content:center;align-items:center;font-size:12px;line-height:1;display:inline-flex}:host(.l-tabbar--bar){--l-tabbar-bar-vertical-padding:10px;--l-tabbar-item-gap:30px;--l-tabbar-line-color:var(--l-primary-color,#722ed1);white-space:nowrap;overflow:auto}.l-tabbar--bar-line{background-color:var(--l-tabbar-line-color);border-radius:1px;width:32px;height:2px;transition:all .3s ease-in-out;position:absolute;bottom:0;left:0}:host(.l-tabbar--card){--l-tabbar-card-border-color:#f5f7fa;--l-tabbar-line-color:#fff;--l-tabbar-item-gap:0;--l-tabbar-card-border-radius:5px}.l-tabbar-card-border{background-color:var(--l-tabbar-card-border-color);height:1px;position:absolute;bottom:0;left:0;right:0}:host(.l-tabbar--card) .l-tabbar-item{background:#f5f7fa;border:1px solid #f0f0f0;padding:0 15px}:host(.l-tabbar--card) .l-tabbar-item:first-child{border-top-left-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar--card) .l-tabbar-item:last-child{border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar-gap) .l-tabbar-item{border-top-left-radius:var(--l-tabbar-card-border-radius);border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar--card) .l-tabbar-item.active{background:#fff}";function Sr(r,o,t){let e=r.target,i="";do if(t&&t.isSameNode(e)||e.tagName==="BODY"||(e.getAttribute&&(i=e.getAttribute(o)||""),i===""&&(e=e.parentNode),!e))break;while(i==="");return[i!=="__stop__"&&i!=="",i,e]}class $e extends N{constructor(){super();C(this,W);n(this,"type","nav");n(this,"name");n(this,"gap");n(this,"$line");n(this,"_handleClick",t=>{const[e,i]=Sr(t,"l-name",this.root);e&&i!==this.name&&(this.name=i,this.dispatchEvent(new CustomEvent("change",{detail:{name:i}})),this._updateActive(),this._updateLine())});M(this)}connectedCallback(){this.loadStyleText(Tr),w(this,`l-tabbar--${this.type}`),!g(this.gap)&&!this.gap.startsWith("0")&&w(this,"l-tabbar-gap"),super.connectedCallback(),this._init()}static get observedAttributes(){return["name","type","justify-content","gap"]}attributeChangedCallback(t,e,i){if(t==="name"){const s=L(i,void 0);this.name=s,this._updateActive(),this._updateLine()}else if(t==="type"){const s=L(i,"nav");if(s!==this.type&&(A(this,`l-tabbar--${this.type}`),this.type=s,A(this,`l-tabbar--${s}`),s==="card")){let l=d(".l-tabbar-card-border",this.root);l||(l=S("div",{class:"l-tabbar-card-border"}),this.root.appendChild(l))}}else{const s=L(i,void 0);this[t]=s;const l=d(".l-tabbar-wrapper",this.root);l&&(l.style.cssText=b(this,W,zt).call(this)),t==="gap"&&(!g(this.gap)&&!this.gap.startsWith("0")?w(this,"l-tabbar-gap"):A(this,"l-tabbar-gap"))}}disconnectedCallback(){super.disconnectedCallback(),this._destroy()}render(){const t=document.createDocumentFragment(),e=document.createElement("div");if(e.className="l-tabbar-wrapper",e.style.cssText=b(this,W,zt).call(this),e.setAttribute("part","default"),this.getAttr("custom-content",!1)){const s=document.createElement("slot");e.appendChild(s)}else{const s=j("[l-name]",this);s.length>0&&q(s,l=>{const a=l.getAttribute("l-name");if(a){const c=l.cloneNode(!0);c.classList.add("l-tabbar-item"),c.setAttribute("part","item"),a===this.name&&c.classList.add("active");const p=d("[l-icon]",c),h=j(":not([l-icon])",c);if(p){const k=S("div",{class:["l-tabbar-item-icon",h.length===0?"only":void 0]});k.appendChild(p.cloneNode(!0)),p.replaceWith(k)}e.appendChild(c)}})}if(t.appendChild(e),this.type==="card"){const s=S("div",{class:"l-tabbar-card-border"});t.appendChild(s)}return t}setItems(t){const e=d(".l-tabbar-wrapper",this.root);e&&(e.innerHTML="",e.appendChild(b(this,W,It).call(this,t)))}addItems(t){const e=d(".l-tabbar-wrapper",this.root);e&&e.appendChild(b(this,W,It).call(this,t))}_init(){_(this.root,"click",this._handleClick),setTimeout(()=>{this._updateLine()},300)}_destroy(){E(this.root,"click",this._handleClick),this.$line=void 0}_updateActive(){const e=this.getAttr("custom-content",!1)?this:this.root,i=d(".active",e);i&&A(i,"active");const s=d(`[l-name="${this.name}"]`,e);s&&w(s,"active")}_updateLine(){queueMicrotask(()=>{if(!this.name||this.type==="nav"||!this.rendered)return;const t=this.getAttr("custom-content",!1),e=d(".active",t?this:this.root);if(!e)return;const i=e.offsetLeft;if(!this.$line){const s=S("div",{class:"l-tabbar--bar-line"});s.part="line",this.root.appendChild(s),this.$line=d(".l-tabbar--bar-line",this.root)}this.$line.style.cssText=`width:${e.offsetWidth}px;left:${i}px`,Qe(e,this)||this.scrollTo({left:i,behavior:"smooth"})})}}W=new WeakSet,zt=function(){const t={},e=this.getAttr("justify-content");if(g(e)||(t["justify-content"]=e),!g(this.gap)){let i=this.gap;pt(i,{isPositive:!0})&&(i=`${i}px`),t["--l-tabbar-item-gap"]=i}return tt(t)},It=function(t){const e=document.createDocumentFragment();for(let i=0,s=t.length;i<s;i++){const l=t[i],a=S("div",{class:B(["l-tabbar-item",this.name===l.name?"active":void 0]),"l-name":l.name,part:"item"}),c=l.icon;if(c){const h=S("div",{class:"l-tabbar-item-icon"});let k=typeof c=="string"?c:c();typeof k=="string"?h.innerHTML=k:h.appendChild(k),a.appendChild(h)}const p=l.text;if(p){let h=typeof p=="string"?p:p();typeof h=="string"?a.appendChild(S(h)):a.appendChild(h)}e.appendChild(a)}return e},n($e,"baseName","tabbar");function Ae(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"auto"}async function Nr(r,o=!0){return new Promise(t=>{const e=document.documentElement.classList;r==null&&(r=Ae());function i(){r==="light"?(e.add("light"),e.remove("dark")):r==="dark"?(e.add("dark"),e.remove("light")):e.remove("light","dark")}o&&document.startViewTransition?document.startViewTransition(()=>{i(),t(r)}):(i(),t(r))})}function zr(){let r=document.documentElement.className.match(/light|dark/);return r!=null&&(r=r[0]),r==null&&(r=localStorage.getItem("web-theme-appearance")),r==null&&(r=Ae()),r}async function Ir(r,o=!0,t=!0){return o===!0&&localStorage.setItem("web-theme-appearance",r??"auto"),Nr(r,t)}function Vr(r){const o=document.documentElement,t=o.className.match(/color-([0-9a-fA-F]{6})/);if(t==null){let e=getComputedStyle(o).getPropertyValue("--nt-primary-color");return e===""&&(e=localStorage.getItem("web-theme-color")),e||r}return`#${t[1]}`}async function Hr(r){const o=[`--nt-primary-color: ${r};`,`--l-primary-color: ${r};`,`--nt-primary-color-dark1: ${et(r,1,!1)};`,`--l-primary-color-dark1: ${et(r,1,!1)};`];for(let e=1;e<=5;e++)o.push(`--nt-primary-color-light${e}: ${et(r,e)};`),o.push(`--l-primary-color-light${e}: ${et(r,e)};`);let t=document.getElementById("color-theme-style");return t==null&&(t=document.createElement("style"),t.id="color-theme-style",document.head.appendChild(t)),t.innerHTML=`:root{${o.join("")}}`,r}function Fr(r,o=!0){return o===!0&&localStorage.setItem("web-theme-color",r),Hr(r)}const Rr=":host{width:auto;display:inline-flex}.l-theme-btn::part(default){--l-btn-background:transparent;--l-btn-hover-background:transparent;--l-btn-text-color:#9ca3af;--l-btn-hover-text-color:#666;width:var(--l-form-edit-height,32px);padding:0;font-size:18px}.l-theme-switch.l-switch--checked{background-color:#65757129;border-color:#3c3f44}.l-theme-switch.l-switch--checked::part(action){color:#fff;background-color:#000}html.dark .l-theme-btn{--l-btn-hover-text-color:#fff}",jr=[{value:"auto",text:"跟随系统",icon:"l-theme-default-icon"},{value:"light",text:"浅色模式",icon:"l-sun-icon"},{value:"dark",text:"深色模式",icon:"l-moon-icon"}];class Ee extends N{constructor(){super();C(this,$);n(this,"type","button");n(this,"label","text");n(this,"theme");C(this,R);C(this,J,async t=>{let e;if(this.type==="button")e=this.theme==="dark"?"auto":"dark";else{const i=t.target.value;this.type!=="switch"?e=i:e=i?"dark":"light"}await Ir(e),this.theme=e,this.type==="button"&&b(this,$,Vt).call(this,m(this,R)),this.dispatchEvent(new CustomEvent("change",{detail:e}))});M(this),this.theme=zr()}connectedCallback(){this.loadStyleText(Rr),super.connectedCallback(),b(this,$,je).call(this)}disconnectedCallback(){super.disconnectedCallback(),b(this,$,Be).call(this)}render(){switch(this.type){case"select":return b(this,$,He).call(this);case"radio":return b(this,$,Re).call(this);case"switch":return b(this,$,Fe).call(this);default:return b(this,$,Ve).call(this)}}}R=new WeakMap,$=new WeakSet,Ve=function(){const t=S("l-button",{class:"l-theme-btn l-theme-inner"});return b(this,$,Vt).call(this,t),t},Vt=function(t){const e=this.theme==="auto"?"sun":"moon";t.innerHTML=`<l-${e}-icon></l-${e}-icon>`},He=function(){const t=S("l-select-ori",{class:"l-theme-inner"});t.value=this.theme;const e=['<option value="auto">跟随系统</option>','<option value="light">浅色模式</option>','<option value="dark">深色模式</option>'];return t.innerHTML=e.join(""),t},Fe=function(){const t=S("l-switch",{class:"l-theme-switch l-theme-inner"});return t.value=this.theme==="dark",t.innerHTML='<l-sun-icon slot="unchecked-action"></l-sun-icon><l-moon-icon slot="checked-action"></l-moon-icon>',t},Re=function(){const t=S("l-radio",{class:"l-theme-inner"});t.value=this.theme,t.type="button";const e=jr.map(i=>this.label==="icon"?`<${i.icon} radio-value="${i.value}"></${i.icon}>`:`<span radio-value="${i.value}">${i.text}</span>`);return t.innerHTML=e.join(""),t},J=new WeakMap,je=function(){Nt(this,R,d(".l-theme-inner",this.root)),this.type==="button"?_(m(this,R),"click",m(this,J)):_(m(this,R),"change",m(this,J))},Be=function(){m(this,R)&&(this.type==="button"?E(m(this,R),"click",m(this,J)):E(m(this,R),"change",m(this,J)),Nt(this,R,void 0))},n(Ee,"baseName","theme");class Me extends N{constructor(){super();C(this,bt);n(this,"color");C(this,mt,async t=>{const e=t.detail;this.color=e,await Fr(e),this.dispatchEvent(new CustomEvent("change",{detail:e}))});this.color=Vr()||"#722ed1"}connectedCallback(){super.connectedCallback(),b(this,bt,De).call(this)}render(){const t=document.createElement("l-color-picker");return t.value=this.color,t}}bt=new WeakSet,De=function(){const t=d("l-color-picker",this.root);t&&_(t,"change",m(this,mt))},mt=new WeakMap,n(Me,"baseName","theme-color");const G=new Map;function Le(r){for(const o of G.values())for(const t of o)Br(r,t)}function Br(r,o){const t=r.target,e=!t,i=o.el.contains(t),s=o.el===t;e||i||s||o.handler(r)}function Dr(r,o){G.has(r)||G.set(r,[]);const t=G.get(r);t&&t.push({el:r,handler:o}),G.size===1&&document.addEventListener("click",Le,!0)}function Pr(r){G.delete(r),G.size===0&&document.removeEventListener("click",Le,!0)}const qr=':host{width:max-content;position:relative}.l-popover--content{--l-popover-border-color:#e4e4e4;--l-popover-color:#666;--l-popover-box-shadow:0 4px 8px #0000001f;--l-popover-background:#fff;--l-popover-arrow-size:8px;--l-popover-offset:10px;width:max-content;box-shadow:var(--l-popover-box-shadow);background:var(--l-popover-background);border:1px solid var(--l-popover-border-color);z-index:30;color:var(--l-popover-color);box-sizing:border-box;border-radius:4px;padding:10px;position:absolute}.l-popover-tooltip{--l-popover-color:#fff;--l-popover-box-shadow:4px 4px 8px #0000004d;--l-popover-background:#383838;--l-popover-arrow-size:6px;border-radius:5px;padding:8px;font-size:12px;line-height:1}.l-popover--arrow{width:var(--l-popover-arrow-size,8px);height:var(--l-popover-arrow-size,8px);z-index:-1;position:absolute}.l-popover--arrow:before{content:"";width:var(--l-popover-arrow-size,8px);height:var(--l-popover-arrow-size,8px);background-color:var(--l-popover-background);border-style:solid;border-width:1px;position:absolute;transform:rotate(45deg)}.l-popover-top,.l-popover-top-start,.l-popover-top-end{bottom:calc(100% + var(--l-popover-offset,10px))}.l-popover-bottom,.l-popover-bottom-start,.l-popover-bottom-end{top:calc(100% + var(--l-popover-offset,10px))}.l-popover-top-start,.l-popover-bottom-start{left:0}.l-popover-top-end,.l-popover-bottom-end{right:0}.l-popover-bottom,.l-popover-top{left:50%;transform:translate(-50%)}.l-popover-left-start,.l-popover-left,.l-popover-left-end{right:calc(100% + var(--l-popover-offset,10px))}.l-popover-left-start,.l-popover-right-start{top:0}.l-popover-left-end,.l-popover-right-end{bottom:0}.l-popover-left,.l-popover-right{top:50%;transform:translateY(-50%)}.l-popover-right-start,.l-popover-right,.l-popover-right-end{left:calc(100% + var(--l-popover-offset,10px))}.l-popover-top .l-popover--arrow,.l-popover-bottom .l-popover--arrow{margin-left:-4px;left:50%}.l-popover-top .l-popover--arrow:before,.l-popover-top-start .l-popover--arrow:before,.l-popover-top-end .l-popover--arrow:before{border-color:transparent var(--l-popover-border-color)var(--l-popover-border-color)transparent}.l-popover-bottom .l-popover--arrow:before,.l-popover-bottom-start .l-popover--arrow:before,.l-popover-bottom-end .l-popover--arrow:before{border-color:var(--l-popover-border-color)transparent transparent var(--l-popover-border-color)}.l-popover-top .l-popover--arrow,.l-popover-top-start .l-popover--arrow,.l-popover-top-end .l-popover--arrow{bottom:calc((var(--l-popover-arrow-size,8px)/-2) + 1px)}.l-popover-top-start .l-popover--arrow,.l-popover-bottom-start .l-popover--arrow{left:10px}.l-popover-top-end .l-popover--arrow,.l-popover-bottom-end .l-popover--arrow{right:10px}.l-popover-bottom .l-popover--arrow,.l-popover-bottom-start .l-popover--arrow,.l-popover-bottom-end .l-popover--arrow{top:calc((var(--l-popover-arrow-size,8px)/-2) - 1px)}.l-popover-left .l-popover--arrow,.l-popover-left-start .l-popover--arrow,.l-popover-left-end .l-popover--arrow{margin-top:-4px;right:-4px}.l-popover-left-start .l-popover--arrow:before,.l-popover-left .l-popover--arrow:before,.l-popover-left-end .l-popover--arrow:before{border-color:var(--l-popover-border-color)var(--l-popover-border-color)transparent transparent}.l-popover-right .l-popover--arrow,.l-popover-right-start .l-popover--arrow,.l-popover-right-end .l-popover--arrow{margin-top:-4px;left:-4px}.l-popover-right-start .l-popover--arrow:before,.l-popover-right .l-popover--arrow:before,.l-popover-right-end .l-popover--arrow:before{border-color:transparent transparent var(--l-popover-border-color)var(--l-popover-border-color)}.l-popover-left .l-popover--arrow,.l-popover-right .l-popover--arrow{top:50%}.l-popover-left-start .l-popover--arrow,.l-popover-right-start .l-popover--arrow{top:10px}.l-popover-left-end .l-popover--arrow,.l-popover-right-end .l-popover--arrow{bottom:10px}';class Mt extends N{constructor(){super();C(this,z);n(this,"placement","top");n(this,"content");n(this,"showArrow",!0);n(this,"trigger","hover");n(this,"disabled",!1);n(this,"isShow",!1);n(this,"width");n(this,"destroyOnHide",!1);n(this,"offset");n(this,"position","absolute");n(this,"theme","default");n(this,"_t");C(this,gt,t=>{t.target.id!==this.id&&this.hide()});C(this,X,t=>{this.show(t.target)});C(this,Z,()=>{this.hide()});C(this,at,t=>{this.trigger==="click"?this.toggle(t.target):this.trigger==="focus"&&this.show(t.target)});M(this)}connectedCallback(){this.loadStyleText(qr),b(this,z,Pe).call(this),super.connectedCallback(),this.renderContent(),b(this,z,qe).call(this)}disconnectedCallback(){super.disconnectedCallback(),b(this,z,Oe).call(this)}render(){const t=document.createElement("slot");return t.setAttribute("name","trigger"),t}renderContent(){if(!this.isShow)return;let t=d(".l-popover--content",this.root);if(t){t.style.removeProperty("display");return}if(t=P("div",{class:["l-popover--content",`l-popover-${this.placement}`,this.theme==="default"?void 0:`l-popover-${this.theme}`]}),this.offset&&(t.style.cssText="--l-popover-offset: ${this.offset}px;"),t.part="content",t.innerHTML=this.contentHTML(),this.showArrow){const e=P("div",{class:"l-popover--arrow"});t.appendChild(e)}this.trigger==="hover"&&(_(t,"mouseenter",m(this,X)),_(t,"mouseleave",m(this,Z))),this.root.appendChild(t)}contentHTML(){return this.content?`<span>${this.content}</span>`:"<slot></slot>"}hideContent(){const t=d(".l-popover--content",this.root);t&&(this.destroyOnHide?(this.trigger==="hover"&&(E(t,"mouseenter",m(this,X)),E(t,"mouseleave",m(this,Z))),this.root.removeChild(t)):t.style.display="none")}show(t){if(!this.disabled){if(this.isShow){b(this,z,We).call(this);return}this.isShow=!0,this.renderContent(),b(this,z,Ye).call(this,t)}}hide(){this._t=setTimeout(()=>{this.isShow=!1,this.hideContent()},50)}toggle(t){this.isShow?this.hide():this.show(t)}}z=new WeakSet,Pe=function(){const t=this.getAttr("inline",!1);this.style.display=t?"inline-block":"block",this.id||(this.id=`${Bt()}-popover`)},qe=function(){const t=d('[slot="trigger"]',this);t&&(this.trigger==="hover"?(_(t,"mouseenter",m(this,X)),_(t,"mouseleave",m(this,Z))):(this.trigger==="click"||this.trigger==="focus")&&(_(t,"click",m(this,at)),Dr(t,m(this,gt))))},Oe=function(){const t=d('[slot="trigger"]',this);t&&(this.trigger==="hover"?(E(t,"mouseenter",m(this,X)),E(t,"mouseleave",m(this,Z))):(this.trigger==="click"||this.trigger==="focus")&&(E(t,"click",m(this,at)),Pr(t)))},gt=new WeakMap,X=new WeakMap,Z=new WeakMap,at=new WeakMap,We=function(){this._t&&(clearTimeout(this._t),this._t=void 0)},Ye=function(t){let e="bottom",i="";const s=this.placement.split("-");s!=null&&(e=s[0],i=s[1]||"");let l;t==null&&(t=d('[slot="trigger"]',this));const a=d(".l-popover--content",this.root);if(a){let c=a.getBoundingClientRect();const p=t.getBoundingClientRect();let h=document.documentElement;const k=h.scrollLeft,D=h.scrollTop;this.width!=null&&(this.width==="trigger"?l=p.width:l=this.width),l!=null&&(c.width=l);const vt=yt(p,c,e,i,this.offset),V=wt(p,c,e,i,this.offset),ht=ir(p,c,e,i,k,D,V,vt,this.offset);e=ht.mainAlign,i=ht.crossAlign,l!=null&&a.style.setProperty("width",`${l}px`);const ze=`l-popover-${e}${i===""?"":"-"+i}`,Tt=a.className.split(" ");Tt[1]!==ze&&(Tt[1]=`${ze}`,a.className=Tt.join(" "))}},n(Mt,"baseName","popover");const Or=".l-popover-popconfirm{min-width:200px}.l-popconfirm-container{align-items:center;display:flex}.l-popconfirm-icon-wrapper{color:var(--nt-warn-color,#f90);margin-right:10px;display:inline-flex}.l-popconfirm-footer{justify-content:flex-end;align-items:center;gap:5px;margin-top:7px;display:flex}.l-popconfirm-footer l-button::part(default){height:24px;padding:0 6px;font-size:13px}";class Te extends Mt{constructor(){super()}connectedCallback(){this.loadStyleText(Or),this.trigger="click",this.theme="popconfirm",super.connectedCallback(),_(this.root,"click",o=>{const[t,e]=Ze(o,"l-action",this);t&&(this.dispatchEvent(new CustomEvent(e,{detail:{action:e}})),this.hide())})}contentHTML(){const o=d('[slot="icon"]',this),t=[];return t.push('<div class="l-popconfirm-container">'),t.push('<div class="l-popconfirm-icon-wrapper">'),t.push(o?'<slot name="icon"></slot>':"<l-warn-icon></l-warn-icon>"),t.push(`</div>${super.contentHTML()}</div>`),t.push('<div class="l-popconfirm-footer">'),t.push('<l-button l-action="cancel">取消</l-button>'),t.push('<l-button type="primary" l-action="ok">确定</l-button>'),t.push("</div>"),t.join("")}}n(Te,"baseName","popconfirm");const Wr=':host{--l-checkbox-size:16px;--l-checkbox-label-color:#333;--l-checkbox-checked-color:var(--l-primary-color,#722ed1);--l-checkbox-disabled-color:#e6e6e6;--l-checkbox-disabled-label-color:#c0c4cc;--l-checkbox-item-margin:10px;align-items:center;display:inline-flex}.l-checkbox{cursor:pointer;align-items:center;display:inline-flex}.l-checkbox__input{opacity:0;z-index:-1;width:0;height:0;position:absolute}.l-checkbox__label{color:var(--l-checkbox-label-color);margin-left:5px;line-height:1;transition:color .3s ease-in-out}.l-checkbox__inner{width:var(--l-checkbox-size);height:var(--l-checkbox-size);box-sizing:border-box;border:1px solid #dcddd9;border-radius:3px;justify-content:center;align-items:center;transition:all .3s ease-in-out;display:flex;position:relative}.l-checkbox__inner:after{content:"";width:calc(var(--l-checkbox-size)*.6);height:calc(var(--l-checkbox-size)*.3);border-top:none;border-bottom:1px solid #0000;border-left:1px solid #0000;border-right:none;margin-top:-3px;transition:border-color .2s ease-in-out;display:block;transform:rotate(-45deg)}.l-checkbox--indeterminate .l-checkbox__inner{background-color:var(--l-checkbox-checked-color)}.l-checkbox--indeterminate .l-checkbox__inner:before{content:"";width:calc(var(--l-checkbox-size)*.4);border:none;border-bottom:1px solid #fff;height:1px;display:block;position:absolute}.l-checkbox:hover .l-checkbox__inner{border-color:var(--l-checkbox-checked-color)}.l-checkbox__input:checked+.l-checkbox__inner{background-color:var(--l-checkbox-checked-color)}.l-checkbox__input:checked+.l-checkbox__inner:after{border-color:#fff}.l-checkbox__input:checked~.l-checkbox__label{color:var(--l-checkbox-checked-color)}.l-checkbox--disabled{--l-checkbox-checked-color:var(--l-checkbox-disabled-color);cursor:not-allowed}.l-checkbox--disabled .l-checkbox__inner{border-color:var(--l-checkbox-disabled-color)}.l-checkbox--disabled .l-checkbox__inner:after{border-color:#0000}.l-checkbox--disabled .l-checkbox__label{color:var(--l-checkbox-disabled-label-color)}.l-checkbox+.l-checkbox{margin-left:var(--l-checkbox-item-margin)}.l-checkbox--button .l-checkbox__label{height:var(--l-form-edit-height,32px);border:1px solid #c0c4cc;border-left-width:0;justify-content:center;align-items:center;margin-left:0;padding:0 15px;display:inline-flex}.l-checkbox--button:first-child .l-checkbox__label{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.l-checkbox--button:last-child .l-checkbox__label{border-top-right-radius:3px;border-bottom-right-radius:3px}.l-checkbox--button .l-checkbox__input:checked~.l-checkbox__label{background-color:var(--l-checkbox-checked-color);color:#fff;border-top-color:var(--l-checkbox-checked-color);border-bottom-color:var(--l-checkbox-checked-color);border-right-color:#fff}';class Se extends K{constructor(){super(!1);C(this,I);n(this,"type");n(this,"checked",!1);n(this,"label");n(this,"indeterminate",!1);n(this,"_ignoreInitAttrs",["value"]);C(this,ct,t=>{const e=t.target;let i;if(typeof this.value=="boolean")this.value=e.checked,i=d("label",this.root);else{const s=e.value;if(e.checked)this.value.push(s);else{const l=this.value.indexOf(s);l>-1&&this.value.splice(l,l)}this.pushValueChange(),i=d(`label[l-value="${s}"]`,this.root)}i&&(e.checked?w(i,"is-checked"):A(i,"is-checked"))})}connectedCallback(){M(this),this.loadStyleText(Wr),this.getName()||(this.name=`la${H(3)}_${H(6)}`),super.connectedCallback(),b(this,I,Ue).call(this)}disconnectedCallback(){super.disconnectedCallback(),b(this,I,Ge).call(this)}static get observedAttributes(){return["disabled","value","indeterminate"]}attributeChange(t,e,i){if(t==="indeterminate"){this.indeterminate=L(i,!1);const s=d("label[l-value]",this.root);s&&(this.indeterminate?w(s,"l-checkbox--indeterminate"):A(s,"l-checkbox--indeterminate"))}else if(t==="value"){const s=i.split("&").map(l=>decodeURIComponent(l));this.setValue(s)}}render(){const t=document.createDocumentFragment(),e=d('[slot="label"]',this),i=j("[check-value]",this);return e||this.label?(this.value=this.checked,e?t.appendChild(b(this,I,kt).call(this,"slot",void 0,this.checked,"label")):t.appendChild(b(this,I,kt).call(this,this.label,void 0,this.checked,"label"))):i.length>0&&(b(this,I,Ke).call(this),q(i,s=>{const l=s.cloneNode(!0),a=Q(s,"check-value");t.appendChild(b(this,I,kt).call(this,l.outerHTML,a,this.value.includes(a)))})),t}setValue(t){if(super.setValue(t),typeof t=="boolean"){const e=d("label",this.root);e&&(this.checked?w(e,"is-checked"):A(e,"is-checked"))}else{const e=j("label[l-value]",this.root);q(e,i=>{const s=Q(i,"l-value");t.includes(s)?w(i,"is-checked"):A(i,"is-checked")})}}}I=new WeakSet,kt=function(t,e,i=!1,s=void 0){const l=P("label",{class:{"l-checkbox":!0,"l-checkbox--button":this.type==="button","is-checked":i,"l-checkbox--disabled":this.isDisabled(),"l-checkbox--indeterminate":this.indeterminate},"l-value":e}),a=P("input",{class:"l-checkbox__input",type:"checkbox",name:this.getName(),value:e,checked:i,disabled:this.isDisabled()});if(l.appendChild(a),this.type!=="button"){const h=P("span",{class:"l-checkbox__inner"});l.appendChild(h)}let c=t==="slot"?'<slot name="label"></slot>':t;const p=P("div",{class:"l-checkbox__label",part:s});return p.innerHTML=c,l.appendChild(p),l},Ke=function(){const t=Q(this,"value");let e=[];this.hasAttribute("checked")&&(e=this.checked),g(t)||(e=t.split("&").map(i=>decodeURIComponent(i))),this._resetValue=e,this.value=e},ct=new WeakMap,Ue=function(){q(j("input",this.root),t=>{_(t,"change",m(this,ct))})},Ge=function(){q(j("input",this.root),t=>{E(t,"change",m(this,ct))})},n(Se,"baseName","checkbox");const Yr=":host{--l-input-width:180px;width:var(--l-input-width,180px);height:var(--l-form-edit-height,32px);display:inline-block;position:relative}.l-md-input__inner{box-sizing:border-box;background:0 0;border:0 solid silver;border-bottom-width:1px;outline:none;width:100%;height:100%;transition:border-color .3s}.l-md-input__inner:focus{border-color:var(--l-primary-color,#722ed1)}:host(.l-has-value) .l-md-input__label,.l-md-input__inner:focus+.l-md-input__label{font-size:12px;transform:translateY(-150%)}.l-md-input__inner:focus+.l-md-input__label{color:var(--nt-primary-color,#722ed1)}.l-md-input__label{color:#8c8c8c;cursor:text;align-items:center;font-size:13px;line-height:1;transition:color .3s,transform .3s;display:flex;position:absolute;top:50%;bottom:0;left:0;transform:translateY(-50%)}:host(.l-md-input-outline){--l-input-label-background:#fff}:host(.l-md-input-outline) .l-md-input__inner{border-width:1px;border-radius:4px;padding:0 10px}:host(.l-md-input-outline) .l-md-input__label{left:10px}:host(.l-md-input-outline) .l-md-input__inner:focus{border-width:2px}:host(.l-md-input-outline) .l-md-input__inner:focus+.l-md-input__label,:host(.l-md-input-outline.l-has-value) .l-md-input__label{background-color:#fff;padding-left:4px;padding-right:4px}";class Ne extends K{constructor(){super(...arguments);C(this,ot);n(this,"outline",!1);n(this,"htmlType","text");n(this,"inputmode");n(this,"label");C(this,dt,t=>{const i=t.target.value;this.setValue(i),g(i)?A(this,"l-has-value"):w(this,"l-has-value")})}static get observedAttributes(){return["disabled"]}connectedCallback(){M(this),this.loadStyleText(Yr),super.connectedCallback(),b(this,ot,Je).call(this)}disconnectedCallback(){super.disconnectedCallback(),b(this,ot,Xe).call(this)}render(){g(this.value)||w(this,"l-has-value"),this.outline&&w(this,"l-md-input-outline");const t=document.createDocumentFragment(),e=`l-md-input-${H(8)}`,i=P("input",{class:"l-md-input__inner",type:this.htmlType,name:this.name,inputmode:this.inputmode,id:e});if(t.appendChild(i),this.label){const s=P("label",{class:"l-md-input__label",for:e});s.textContent=this.label,t.appendChild(s)}return t}setValue(t){super.setValue(t);const e=d("input",this.root);e&&(e.value=t)}}ot=new WeakSet,Je=function(){const t=d("input",this.root);t&&_(t,"input",m(this,dt))},Xe=function(){const t=d("input",this.root);t&&E(t,"input",m(this,dt))},dt=new WeakMap,n(Ne,"baseName","md-input"),u(Ne),u(Se),u(Te),u(Mt),u(ne),u(Me),u(Ee),u($e),u(Ce),u(_e),u(we),u(ye),u(ke),u(xe),u(ge),u(ve),u(Wt),u(Kt),u(y),u(Ut),u(Zt),u(Qt),u(te),u(kr),u(ee),u(re),u(ie),u(oe),u(se),u(le),u(ae),u([Gt,Jt,Xt]),globalThis.LMessage=O;function Kr(){const r=document.currentScript.src,o=r.lastIndexOf("/"),e=`${r.slice(0,o+1)}litos-ui.css`,i=document.createElement("link");i.rel="stylesheet",i.href=e,i.id="litos-ui-style",document.head.appendChild(i)}Kr()})();
|