litos-ui 0.3.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/lib/base.d.ts +3 -3
  2. package/lib/base.js +29 -27
  3. package/lib/browser.d.ts +7 -0
  4. package/lib/button/index.js +10 -11
  5. package/lib/color_picker/index.d.ts +13 -0
  6. package/lib/color_picker/index.js +44 -0
  7. package/lib/form/form_inner.js +26 -26
  8. package/lib/form/form_item.js +1 -1
  9. package/lib/form/index.js +1 -1
  10. package/lib/icon/arrow_left.d.ts +5 -0
  11. package/lib/icon/arrow_left.js +13 -0
  12. package/lib/icon/arrow_right.d.ts +5 -0
  13. package/lib/icon/arrow_right.js +13 -0
  14. package/lib/icon/arrow_up.d.ts +6 -0
  15. package/lib/icon/arrow_up.js +16 -0
  16. package/lib/icon/base.js +13 -13
  17. package/lib/icon/moon.d.ts +6 -0
  18. package/lib/icon/moon.js +16 -0
  19. package/lib/icon/reduction.d.ts +6 -0
  20. package/lib/icon/reduction.js +16 -0
  21. package/lib/icon/refresh_left.d.ts +6 -0
  22. package/lib/icon/refresh_left.js +16 -0
  23. package/lib/icon/refresh_right.d.ts +5 -0
  24. package/lib/icon/refresh_right.js +13 -0
  25. package/lib/icon/sort.d.ts +5 -0
  26. package/lib/icon/sort.js +13 -0
  27. package/lib/icon/sun.d.ts +6 -0
  28. package/lib/icon/sun.js +16 -0
  29. package/lib/icon/theme_default.d.ts +6 -0
  30. package/lib/icon/theme_default.js +16 -0
  31. package/lib/index-116dRdDj.js +4 -0
  32. package/lib/index-BUyxD_nH.js +4 -0
  33. package/lib/index-BeOxuMd4.js +4 -0
  34. package/lib/index-Bl8lRTJd.js +4 -0
  35. package/lib/index-BxlGVrX3.js +4 -0
  36. package/lib/index-C98Kx857.js +4 -0
  37. package/lib/index-CMz7GCCH.js +4 -0
  38. package/lib/index-DJ70Xyma.js +4 -0
  39. package/lib/index-DKvzJmsR.js +4 -0
  40. package/lib/index.d.ts +40 -1
  41. package/lib/index.js +82 -36
  42. package/lib/input/index.d.ts +1 -1
  43. package/lib/input/index.js +14 -14
  44. package/lib/list/index.js +1 -1
  45. package/lib/litos-ui.css +1 -1
  46. package/lib/litos-ui.min.js +1 -1
  47. package/lib/message/index.js +32 -32
  48. package/lib/polygon/index.d.ts +9 -0
  49. package/lib/polygon/index.js +30 -0
  50. package/lib/popover/index.d.ts +34 -0
  51. package/lib/popover/index.js +153 -0
  52. package/lib/radio/index.d.ts +1 -0
  53. package/lib/radio/index.js +61 -49
  54. package/lib/select_ori/index.d.ts +21 -0
  55. package/lib/select_ori/index.js +59 -0
  56. package/lib/switch/index.d.ts +18 -0
  57. package/lib/switch/index.js +64 -0
  58. package/lib/tabbar/index.d.ts +50 -0
  59. package/lib/tabbar/index.js +186 -0
  60. package/lib/theme/index.d.ts +12 -0
  61. package/lib/theme/index.js +95 -0
  62. package/lib/theme/theme_color.d.ts +9 -0
  63. package/lib/theme/theme_color.js +40 -0
  64. package/lib/utils/clickoutside.d.ts +5 -0
  65. package/lib/utils/clickoutside.js +22 -0
  66. package/lib/utils/event.js +24 -0
  67. package/lib/utils/index.d.ts +88 -0
  68. package/lib/utils/index.js +139 -0
  69. package/lib/utils/transition.js +58 -0
  70. package/package.json +69 -68
  71. package/styles/animation.css +13 -0
  72. package/styles/container.css +51 -0
  73. package/styles/scrollbar.css +23 -0
  74. package/styles/transition.css +33 -0
  75. package/lib/index-Boq1Q7q9.js +0 -4
  76. package/lib/index-ColsUDnt.js +0 -4
  77. package/lib/transition.d.ts +0 -15
  78. package/lib/transition.js +0 -52
  79. package/lib/util.d.ts +0 -40
  80. package/lib/util.js +0 -56
@@ -1 +1 @@
1
- var Ot=Object.defineProperty;var Kt=($,v,S)=>v in $?Ot($,v,{enumerable:!0,configurable:!0,writable:!0,value:S}):$[v]=S;var a=($,v,S)=>Kt($,typeof v!="symbol"?v+"":v,S);(function(){"use strict";var U;const $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",v="0123456789";function S(s,r=!0){return s==null?!0:(r&&typeof s=="string"?s.trim().length:s.length)===0}function C(s){if(typeof s=="object"&&s.min!=null&&s.max!=null){const r=Math.random(),t=s.hasEnd?1:0,e=r*(s.max-s.min+t)+s.min;return s.isInteger!==!1?Math.floor(e):e}else{if(typeof s=="object"&&s.length==null)throw new Error("random_length_cannot_null");let r=typeof s=="object"?s.length:s,t=$;typeof s=="object"&&s.hasLetter===!1&&(t=v);const e=Array.from({length:r},()=>t.charAt(C({min:0,max:t.length-1,hasEnd:!0}))).join("");return typeof s=="object"&&s.firstIsZero===!1&&e.indexOf("0")===0?C(s):e}}let yt=-1,Y={prefix:"l"};function f(s,r){const t=`${Y.prefix}-${s.baseName}`;customElements.get(t)||customElements.define(t,s)}function $t(){return`${Y.prefix}-${++yt}`}function y(s,r,t){if(s==null)return r;switch(typeof r){case"boolean":return s===""||s==="true"||s==="1"||s===t;case"number":return Number(s);default:return s}}function w(s){const r=s.attributes;for(const t of r){const{name:e,value:i}=t;if(e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("_")||e.startsWith("$"))continue;const l=e.split("-").map((h,d)=>d===0?h:h[0].toUpperCase()+h.slice(1)).join(""),o=y(i,s[l],e);s[l]=o,e==="value"&&(s._resetValue=o)}}function _(s,r){let t=" ";return r===!0?t=` ${s}`:typeof r=="string"&&!S(r)&&(t=` ${s}="${r}"`),t}function G(s,r){return typeof s=="string"?(r||document).querySelectorAll(s):[s]}function F(s,r){return G(s,r)}function m(s,r){return G(s,r)[0]}function M(s,r){s.classList.add(r)}function L(s,r){s.classList.remove(r)}function J(s,r){return s.classList.contains(r)}function P(s,r,t,e=!1){let i={eventStop:!1};typeof e=="boolean"?i.once=e:i=e,i.eventFlag!=null?(s.setAttribute(i.eventFlag,"__stop__"),s.addEventListener(r,n=>{let l=n.target,o="";do o=l.getAttribute(i.eventFlag)||"",o===""&&(l=l.parentNode);while(o==="");(o!=="__stop__"||i.eventStop)&&t(n,l,o)},i)):s.addEventListener(r,t,i)}function H(s,r,t){s.removeEventListener(r,t)}function B(s,r){for(let t=0,e=s.length;t<e&&r(s[t],t)!==!0;t++);}function q(s,r,t){const e=s.getAttribute(r);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===r:i==="object"?e===""?t:JSON.parse(e):e}function E(s){let r="";if(Array.isArray(s))for(let t=0,e=s.length;t<e;t++){const i=s[t];i&&(r+=`${i} `)}else for(const t in s)s[t]&&(r+=`${t} `);return r.trim()}function z(s){let r="";if(Array.isArray(s))for(let t=0,e=s.length;t<e;t++){const i=s[t];i&&(r+=`${i};`)}else for(const t in s){const e=s[t];e&&(r+=`${t}:${e};`)}return r}function kt(s,r,t="0.3s"){s.style.setProperty("display","none");const e=[];for(let i=0,n=r.length;i<n;i++){const l=r[i];s.style.setProperty(l[0],l[1]),e.push(`${l[0]} ${t}`)}t&&s.style.setProperty("transition",e.join(", ")),s.style.removeProperty("display"),requestAnimationFrame(()=>{for(let i=0,n=r.length;i<n;i++){const l=r[i];s.style.removeProperty(l[0])}})}function At(s,r,t){for(let e=0,i=r.length;e<i;e++){const n=r[e];s.style.setProperty(n[0],n[1])}s.addEventListener("transitionend",()=>{s.style.display="none";for(let e=0,i=r.length;e<i;e++){const n=r[e];s.style.removeProperty(n[0])}t!=null&&t()},{once:!0})}class k extends HTMLElement{constructor(t=!0){super();a(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.shadow.appendChild(e)}createLink(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,this.shadow.appendChild(e)}loadStyle(t){{let e=document.querySelector("#litos-ui-style");e?this.createLink(e.href):queueMicrotask(()=>{e=document.querySelector("#litos-ui-style"),e&&this.createLink(e.href)})}}loadExternalStyle(t){}loadStyleText(t){this.createStyle(t)}setProperty(t,e){this[t]=e}setProperties(t){for(const e in t)this.setProperty(e,t[e])}getAttr(t,e){return q(this,t,e)}connectedCallback(){this.render(),this.rendered=!0}disconnectedCallback(){}render(){}}a(k,"baseName","base-component");class g extends k{constructor(){super();a(this,"useLink");a(this,"viewBox");this.useLink=!1,this.viewBox="0 0 1024 1024"}connectedCallback(){this.loadStyle(["icon"]),this.render()}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 n=this.renderChildren();if(typeof n=="string")if(n===""){const l=this.children,o=[];for(let h=0,d=l.length;h<d;h++){const u=l[h];o.push(u.outerHTML),t.appendChild(u)}t.innerHTML=o.join("")}else t.innerHTML=n;else t.append(n);this.shadow.appendChild(t)}renderChildren(){return""}createEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}a(g,"baseName","base-icon");let j=(U=class extends g{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>'}},a(U,"baseName","loading-icon"),U);const T=2,xt=.16,St=.05,wt=.05,Et=.15,It=/rgba?\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)/,Z=/^#(?:([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 Mt(s){return s.r!=null&&s.g!=null&&s.b!=null}function Q(s){return s.h!=null&&s.s!=null&&s.v!=null}function Nt(s){let r=s.match(It);if(r!=null){const t=parseInt(r[1].trim()),e=parseInt(r[2].trim()),i=parseInt(r[3].trim());if(isNaN(t)||isNaN(e)||isNaN(i))throw new Error("Invalid RGB color.");let n=1;return r[4]!=null&&(n=parseFloat(r[4].trim()),isNaN(n)&&(n=1)),{r:t,g:e,b:i,a:n}}}function Lt(s){const r=s.match(Z);if(r!=null){const t=r[4]!==void 0,e=parseInt(t?r[4]+r[4]:r[1],16),i=parseInt(t?r[5]+r[5]:r[2],16),n=parseInt(t?r[6]+r[6]:r[3],16);return{r:e,g:i,b:n}}}function D(s){if(typeof s=="string"){let r=Lt(s);if(r==null&&(r=Nt(s)),r!=null)return r;throw new Error("Invalid color string")}else{if(Mt(s))return s;if(Q(s))return Rt(s);throw new Error("Invalid color")}}function Tt(s){if(Q(s))return s;const r=D(s),t=r.r/255,e=r.g/255,i=r.b/255;let n=Math.max(t,e,i),l=Math.min(t,e,i),o=n-l,h=n,d=n===0?0:o/n,u=0;if(n===l)u=0;else switch(n){case t:u=((e-i)/o+(e<i?6:0))/6;break;case e:u=((i-t)/o+2)/6;break;case i:u=((t-e)/o+4)/6;break}return u=u*360,{h:u,s:d,v:h}}function Rt(s){let r=s.s,t=s.v;r>1&&(r/=100),t>1&&(t/=100);const e=s.h;var i=Math.floor(e/60)%6,n=e/60-Math.floor(e/60),l=t*(1-r),o=t*(1-n*r),h=t*(1-(1-n)*r);let d=0,u=0,p=0;switch(i){case 0:d=t,u=h,p=l;break;case 1:d=o,u=t,p=l;break;case 2:d=l,u=t,p=h;break;case 3:d=l,u=o,p=t;break;case 4:d=h,u=l,p=t;break;case 5:d=t,u=l,p=o;break}return d=Math.round(d*255),u=Math.round(u*255),p=Math.round(p*255),{r:d,g:u,b:p}}function Vt(s,r,t){let e;return Math.round(s.h)>=60&&Math.round(s.h)<=240?e=t?Math.round(s.h)-T*r:Math.round(s.h)+T*r:e=t?Math.round(s.h)+T*r:Math.round(s.h)-T*r,e<0?e+=360:e>=360&&(e-=360),e}function Ft(s,r,t){if(s.h===0&&s.s===0)return s.s;let e;return t?e=s.s-xt*r:e=s.s+St*r,e>1&&(e=1),e<.06&&(e=.06),Number(e.toFixed(2))}function Pt(s,r,t){let e;return t?e=s.v+wt*r:e=s.v-Et*r,e>1&&(e=1),Number(e.toFixed(2))}function X(s){const r=t=>t.toString(16).padStart(2,"0");return`#${r(s.r)}${r(s.g)}${r(s.b)}`.toUpperCase()}function Ht(s){return typeof s=="string"&&Z.test(s)?s:X(D(s))}function tt(s,r=1,t=!0){const e=Tt(s);return Ht({h:Vt(e,r,t),s:Ft(e,r,t),v:Pt(e,r,t)})}f(j);class et extends k{constructor(){super();a(this,"htmlType","button");a(this,"_handleClick",t=>{const e=t.target,i=q(e,"html-type");if(i==="reset"||i==="submit"){const n=this._getForm();n&&(i==="reset"?n.reset():i==="submit"&&n.submit())}});w(this)}static get observedAttributes(){return["loading","color"]}attributeChangedCallback(t,e,i){const n=m(".l-button",this.root);if(n){if(t==="loading")y(i,!1,t)?(M(n,"l-btn-loading"),n.disabled=!0,n.innerHTML=this.loadingBody()):(L(n,"l-btn-loading"),n.disabled=this.getAttr("disabled",!1),n.innerHTML="<slot></slot>");else if(t==="color"){const l=this.getAttr("text",!1),o=this.getAttr("ghost",!1);n.style.cssText=this.applyColor(i,l,o)}}}connectedCallback(){this.loadStyle(["button"]),this.loadExternalStyle(["animation"]),this.render(),(this.htmlType==="reset"||this.htmlType==="submit")&&P(this,"click",this._handleClick)}disconnectedCallback(){super.disconnectedCallback(),(this.htmlType==="reset"||this.htmlType==="submit")&&H(this,"click",this._handleClick)}render(){const t=this.getAttr("type","normal"),e=document.createElement("button"),i=this.getAttr("loading",!1),n=this.getAttr("shape","default"),l=this.getAttr("text",!1),o=this.getAttr("ghost",!1),h=["l-btn",`l-btn-${t}`,this.getAttr("block",!1)?"l-btn-block":"",n==="round"?"l-btn-round":"",n==="circle"?"l-btn-circle":"",o?"l-btn-ghost":"",l?"l-btn-text":"",i?"l-btn-loading":""];e.className=E(h),e.disabled=this.getAttr("disabled",!1)||i,e.type=this.getAttr("html-type","button");const d=this.applyColor(this.getAttr("color"),l,o);d&&(e.style.cssText=d),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 n=tt(t,1,!0),l=tt(t,3,!1);return z({"--l-btn-border-color":e?"transparent":t,"--l-btn-text-color":i||e?t:"#ffffff","--l-btn-hover-text-color":i||e?n:"#ffffff","--l-btn-background":i||e?"transparent":t,"--l-btn-active-text-color":i||e?l:"#ffffff","--l-btn-hover-border-color":e?"transparent":n,"--l-btn-hover-background":i||e?"transparent":n,"--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}}a(et,"baseName","button");let c;function A(s,r,t){c==null&&(c=new Map),c.has(s)||c.set(s,new Map([[r,new Set]])),c.get(s).has(r)||c.get(s).set(r,new Set),c.get(s).get(r).add(t)}function N(s,r,t){var e,i,n,l,o,h;(i=(e=c==null?void 0:c.get(s))==null?void 0:e.get(r))==null||i.delete(t),((l=(n=c==null?void 0:c.get(s))==null?void 0:n.get(r))==null?void 0:l.size)==0&&((o=c.get(s))==null||o.delete(r)),((h=c==null?void 0:c.get(s))==null?void 0:h.size)==0&&c.delete(s),(c==null?void 0:c.size)==0&&(c=void 0)}function st(s){s==null?c!=null&&(c.clear(),c=void 0):c!=null&&(c.delete(s),c.size===0&&(c=void 0))}function b(s,r,...t){var i;const e=(i=c==null?void 0:c.get(s))==null?void 0:i.get(r);if(e!=null)for(const n of e)n(...t)}class it extends k{constructor(t=!0){super();a(this,"disabled",!1);a(this,"name");a(this,"formAttrs",{});a(this,"formItemAttrs",{});a(this,"_value","");a(this,"_resetValue");a(this,"_firstPushValue",!0);a(this,"_reseting",!1);a(this,"_formAttributeChanged",(t,e,i)=>{i===this.formAttrs.formId?this.formAttrs[t]=e:this.formItemAttrs[t]=e,t==="disabled"&&this._changeDisabled()});a(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(t==="disabled"){const n=y(i,!1,t);n!==this.disabled&&(this._changeDisabled(),this.disabled=n)}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&&(A(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),A(this.formAttrs.id,"reset",this._resetFieldValue),this._firstPushValue&&this.pushValueChange()),this.formItemAttrs.id&&A(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged),this.render()}disconnectedCallback(){this.formAttrs.id&&(N(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),N(this.formAttrs.id,"reset",this._resetFieldValue)),this.formItemAttrs.id&&N(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged)}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 n=t.tagName;if(n==="L-FORM"){const l=t.sharedAttrs;for(let o=0;o<l.length;o++){const h=l[o];e[h]=t[h]}break}if(n==="BODY")break;if(n==="L-FORM-ITEM"){const l=t.sharedAttrs;for(let o=0;o<l.length;o++){const h=l[o];i[h]=t[h]}}t=t.parentElement}return t=null,{formAttr:e,formItemAttr:i}}_changeDisabled(){}pushValueChange(){const t=this.getName();this.formAttrs.id&&t&&b(this.formAttrs.id,"valueChange",t,this._value,!this._reseting),this._reseting=!1}reset(){this.value=this._resetValue||""}}class rt extends it{constructor(){super();a(this,"type","text");a(this,"placeholder");a(this,"autosize",!1);a(this,"allowInput");a(this,"parser");a(this,"width");a(this,"block",!1);a(this,"error",!1);a(this,"$input");a(this,"_input",t=>{const e=t.target;let i=e.value;if(this.allowInput!=null){let n=this.allowInput.indexOf("."),l=n===-1?n:parseInt(this.allowInput.substring(n+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)});a(this,"_validateChange",(t,e)=>{const i=this.getName();if(i){const n=t===!0?!1:t[i]!=null;(e==null||e===i&&this.error!=n)&&(this.error=n,this._updateError()),Object.keys(t)[0]===i&&this.focus()}});w(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.loadStyle(["input"])}disconnectedCallback(){super.disconnectedCallback(),this.formAttrs.id&&N(this.formAttrs.id,"validateChange",this._validateChange),H(this.$input,"input",this._input),this.$input=void 0}attributeChange(t,e,i){if(t==="error"){const n=y(i,!1,t);n!==this.error&&(this.error=n,this._updateError())}}render(){let t=_("value",this.value);const e=_("placeholder",this.placeholder),i=_("disabled",this.isDisabled()),n=E({"l-input":!0,"is-autosize":this.autosize,"is-error":this.error}),l=this.getName(),o=_("name",l),h=`${t}${o}${e}${i}`;this.shadow.innerHTML=`<input part="default" type="${this.type}" class="${n}"${h}></input>`,this.$input=m("input",this.root),P(this.$input,"input",this._input),this.style.cssText=z(this._getStyleObj())+this.getAttr("style",""),l&&this.formAttrs.id&&A(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,n=e.negative?"-?":"";if(e.integer){const o=i.match(new RegExp(`^(${n}\\d*)`));return o!=null?o[1]:i.substring(0,i.length-1)}const l=i.match(new RegExp(`(${n}\\d+\\.\\d{0,${e.precition}})|(${n}\\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?M(this.$input,"is-error"):L(this.$input,"is-error"))}}a(rt,"baseName","input");class nt extends g{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>'}}a(nt,"baseName","arrow-down-icon");class lt extends g{renderChildren(){return'<path fill="currentColor" d="M512 320 192 704h639.936z"></path>'}}a(lt,"baseName","caret-top-icon");class at extends g{renderChildren(){return'<path fill="currentColor" d="m192 384 320 384 320-384z"></path>'}}a(at,"baseName","caret-bottom-icon");class ot extends g{constructor(){super();a(this,"_t");a(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 n=i.getAttribute("viewBox");n||(n="0 0 1024 1024");const l=this.shadow.querySelector("svg");l!=null&&(l.setAttribute("viewBox",n),l.innerHTML=i.innerHTML)}))}}a(ot,"baseName","font-icon");class ht extends g{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>'}}a(ht,"baseName","search-icon");class ct extends g{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>'}}a(ct,"baseName","mask-close-icon");class dt extends g{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>'}}a(dt,"baseName","success-icon");class ut extends g{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>'}}a(ut,"baseName","warn-icon");class ft extends g{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>'}}a(ft,"baseName","info-icon"),f(ct),f(dt),f(ut),f(ft);const I=[],mt=[["opacity","0"],["transform","translate3d(-50%, -100%, 0)"]];function bt(s){const r=I.findIndex(n=>n.id===s);if(r===-1)return;const t=I.splice(r,1)[0];if(t==null)return;At(t,mt,()=>{t.remove()});const e=15+t.offsetHeight,i=I.length;if(i!==0)for(let n=r;n<i;n++){const l=I[n],o=parseInt(l.style.top,10)-e;l.style.setProperty("top",`${o}px`)}}function Bt(s){const r=document.createElement("div");r.id=s.id;const t=s.type||"info";let e=`l-message l-message-${t}`;s.customClass&&(e+=" "+s.customClass),r.className=e,r.style.setProperty("top",`${s.offset}px`),r.style.setProperty("z-index",`${s.zindex||1e3}`),s.width&&r.style.setProperty("width",s.width);let i=t;return i==="error"&&(i="mask-close"),r.innerHTML=['<div class="l-message-container">',`<l-${i}-icon class="l-message-icon"></l-${i}-icon>`,`<span class="l-message-content">${s.message}</span>`,"</div>"].join(""),r}const R=s=>{const r=I.reduce((l,o)=>l+o.offsetHeight+15,15),t=$t(),e=typeof s=="string"?{message:s}:s;e.id=t,e.offset=r;const i=Bt(e);I.push(i),document.body.appendChild(i),kt(i,mt,null);let n=e.duration;return n==null&&(n=3e3),n!==0&&setTimeout(()=>{bt(t)},n),t};for(const s of["info","success","error","warn","show"])R[s]=r=>{const t=typeof r=="string"?{message:r}:r;return s!=="show"?t.type=s:t.type==null&&(t.type="info"),R(t)};R.close=bt;const O={mobile:"请输入正确的手机号",same:"两次输入不一致",required:"%s为必填字段"},K="请输入正确的数据",x={same:/^same:(.+)$/i,mobile:/^1[345678]\d{9}$/,required:/^\S{1}.*/},W={same(s,r){return r===s},pattern(s,r){return r==null?!1:s.test(String(r))}};class gt extends Error{constructor(r,t,e){super(e),this.name="ValidateError",this.key=t,this.detail=r}}class qt{constructor(r){this.rules={},this.addSchemas(r)}addSchemas(r){for(let t of r)this.rules[t.key]=this._parseSchemaRules(t)}addSchema(r){this.rules[r.key]=this._parseSchemaRules(r)}async validate(r,t=!1){return new Promise((e,i)=>{const n={};let l,o;for(let h in this.rules){let d=this._validateRule(this.rules[h],r[h],r);if(d!==""&&(d=d.replace("%s",h),n[h]=d,l=h,o=d,t))break}l==null?e(!0):i(new gt(n,l,o))})}async validateKey(r,t,e){return new Promise((i,n)=>{let l=this.rules[r];if(l==null){i({key:r,value:t});return}let o=this._validateRule(l,t,e);o!==""?(o=o.replace("%s",r),n(new gt({[r]:o},r,o))):i({key:r,value:t})})}_validateRule(r,t,e){let i="";for(let n of r)if(n.rule==="required"?(t==null||!W.pattern(x.required,t))&&(i=n.message):typeof n.rule=="function"?n.rule(t)||(i=n.message):n.sameKey!=null?e!=null&&(W.same(t,e[n.sameKey])||(i=n.message)):W.pattern(n.rule,t)||(i=n.message),i!=="")break;return i}_parseSchemaRules(r){let t=[],e=r.rules;if(r.required===!0&&t.push(...this._parseStringRule("required",r.message)),e!=null)if(typeof e=="string")t=t.concat(this._parseStringRule(e,r.message));else if(e instanceof Array)for(let i of e)typeof i=="string"?t.push(...this._parseStringRule(i,r.message)):i instanceof RegExp||typeof i=="function"?t.push({rule:i,message:r.message||K}):typeof i.rule=="string"?t.push(...this._parseStringRule(i.rule,i.message)):t.push({rule:i.rule,message:i.message||K});else t.push({rule:e,message:K});return t}_parseStringRule(r,t){let e=[],i=r.split("|");for(let n of i){let l=t,o=null,h;if(r==="required")o="required",l=l||t||O.required;else if(x.same.test(n)){if(n.match(x.same)!=null){o=x.same;let u=n.match(x.same);u!=null&&(h=u[1]),l=l||O.same}}else Object.hasOwn(x,n)&&(o=x[n],l=l||O[n]);e.push({rule:o,message:l,sameKey:h})}return e}}class pt extends k{constructor(){super();a(this,"inline",!1);a(this,"labelPosition","right");a(this,"labelWidth");a(this,"id");a(this,"disabled",!1);a(this,"sharedAttrs",["disabled","id","innerBlock"]);a(this,"validator");a(this,"innerBlock",!1);a(this,"novalidate",!1);a(this,"_data");a(this,"emit");a(this,"ruleChange",t=>{this.validator.addSchema(t)});a(this,"_valueChange",(t,e,i=!0)=>{this._data==null&&(this._data={});const n=Object.hasOwn(this._data,t);this._data[t]=e,!this.novalidate&&n&&i&&this.validator.validateKey(t,e,this._data).then(()=>{b(this.id,"validateChange",!0,t)}).catch(l=>{b(this.id,"validateChange",l.detail,t)})});w(this),this.id==null&&(this.id=`l-f${C(3)}-${C(6)}`),this.validator=new qt([]),this.emit=new CustomEvent("submit")}static get observedAttributes(){return["disabled","label-position"]}attributeChangedCallback(t,e,i){if(t==="disabled"){const n=y(i,!1,t);n!==this.disabled&&(b(this.id,"attributeChanged",t,n,this.id),this.disabled=n)}else if(t==="label-position"){const n=m("form",this.root);n&&(n.className=E(["l-form",this.inline?"l-form-inline":void 0,`l-form--${i}`]))}}connectedCallback(){this.loadStyle(["form"]),super.connectedCallback(),A(this.id,"ruleChange",this.ruleChange),A(this.id,"valueChange",this._valueChange)}disconnectedCallback(){st(this.id),this.validator=void 0}render(){const t=E(["l-form",this.inline?"l-form-inline":void 0,`l-form--${this.labelPosition}`]),e=z({"--l-form-label-width":this.labelWidth?this.labelWidth:""});this.shadow.innerHTML=`<form class="${t}" style="${e}"><slot></slot></form>`}validateField(t){const e=[];if(this._data!=null){if(Array.isArray(t))for(let i=0,n=t.length;i<n;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 n=0,l=i.length;n<l;n++){const o=i[n];o.status==="rejected"?b(this.id,"validateChange",o.reason.detail,o.reason.key):b(this.id,"validateChange",!0,o.value.key)}})}}clearValidate(){b(this.id,"validateChange",!0)}reset(){this.clearValidate(),b(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),b(this.id,"validateChange",!0),Promise.resolve(!0)}catch(t){return b(this.id,"validateChange",t.detail),Promise.resolve(!1)}return Promise.resolve(!0)}getData(){return{...this._data}}}a(pt,"baseName","form");class vt extends k{constructor(){super();a(this,"disabled",!1);a(this,"sharedAttrs",["disabled","id","name","innerBlock"]);a(this,"required",!1);a(this,"error");a(this,"label");a(this,"id");a(this,"verify");a(this,"validity");a(this,"pattern");a(this,"name");a(this,"innerBlock",!1);a(this,"labelPosition","right");a(this,"formId");a(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())});w(this),this.id==null&&(this.id=`l-fi${C(3)}-${C(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 n=y(i,!1,t);n!==this.disabled&&(b(this.id,"attributeChanged",t,n,this.id),this.disabled=n)}}connectedCallback(){var t;if(super.connectedCallback(),this.loadStyle(["form"]),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};b(this.formId,"ruleChange",i),A(this.formId,"validateChange",this._validateChange)}}disconnectedCallback(){st(this.id),this.formId&&N(this.formId,"validateChange",this._validateChange)}setRules(t){const e={...t,key:this.name};e.required!=null&&this.required&&(e.required=!0),this.formId&&b(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>`:"";this.shadow.innerHTML=[`<div class="${E(t)}">${e}`,'<div class="l-form-item__content">',`<slot></slot>${i}</div></div>`].join("")}_updateError(){if(!this.rendered)return;let t=m(".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=m(".l-form-item__content",this.root);i&&i.appendChild(t)}const e=m(".l-form-item",this.root);e&&(this.error?M(e,"is-error"):L(e,"is-error"))}_updateLabel(){if(!this.rendered)return;let t=m(".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=m(".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}}a(vt,"baseName","form-item");class _t extends it{constructor(){super(!1);a(this,"type");a(this,"label");a(this,"checked",!1);a(this,"_changeEvent");a(this,"_radioChange",t=>{const e=t.target;let i=e.parentElement;for(;i!=null&&!J(i,"l-radio");)i=i.parentElement;const n=m(".is-checked",this.root);n&&L(n,"is-checked"),this.value=e.value,i&&M(i,"is-checked"),this.dispatchEvent(this._changeEvent)});w(this),this._changeEvent=new CustomEvent("change")}setItems(t){this._removeEvents(),this.root.innerHTML=this._renderItems(t),this._initEvents()}connectedCallback(){super.connectedCallback(),this.loadStyle(["radio"]),this._initEvents()}disconnectedCallback(){super.disconnectedCallback(),this._removeEvents()}attributeChange(t,e,i){if(t==="checked"){const n=y(i,!1,t);this.checked=n,this.value=n;const l=m(".l-radio",this.root);if(l&&!J(l,"is-checked")){M(l,"is-checked");const o=m("input",l);o&&(o.checked=!0)}}}render(){this.getName()||(this.name=`la${C(3)}_${C(6)}`);const t=[],e=m('[slot="label"]',this),i=F("[radio-value]",this);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&&(B(i,n=>{const l=n.cloneNode(!0),o=q(n,"radio-value");t.push(this._renderItem(l.outerHTML,o,this.value===o))}),this.pushValueChange()),this.root.innerHTML=t.join("")}_renderItems(t){const e=[];for(let i=0,n=t.length;i<n;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,n=void 0){const l=E({"l-radio":!0,"l-radio--disabled":this.isDisabled(),"l-radio--button":this.type==="button","is-checked":i}),o=_("disabled",this.isDisabled()),h=_("checked",i),d=_("value",e),p=`${_("name",this.getName())}${d}${o}${h}`,jt=_("part",n),V=[`<label class="${l}">`,`<input type="radio" class="l-radio__input"${p} />`];this.type!=="button"&&V.push('<span class="l-radio__inner"></span>');let Dt=t==="slot"?'<slot name="label"></slot>':t;return V.push(`<div class="l-radio__label"${jt}>${Dt}</div>`),V.push("</label>"),V.join("")}_isChecked(){return this.checked}_initEvents(){B(F("input",this.root),t=>{P(t,"change",this._radioChange)})}_removeEvents(){B(F("input",this.root),t=>{H(t,"change",this._radioChange)})}}a(_t,"baseName","radio"),f(j);class Ct extends k{constructor(){super();a(this,"finish",!1);a(this,"infinite",!0);a(this,"observer");a(this,"loadMoreEmit");a(this,"$more");w(this),this.loadMoreEmit=new CustomEvent("load-more")}static get observedAttributes(){return["finish"]}attributeChangedCallback(t,e,i){if(t==="finish"){const n=y(i,!1,t);this.finish!==n&&(this.finish=n,this._finishChange())}}connectedCallback(){this.loadStyle(["list"]),this.loadExternalStyle(["animation"]),super.connectedCallback(),this.infinite&&(this.observer=new IntersectionObserver(t=>{t[0].isIntersecting&&!this.finish&&this.dispatchEvent(this.loadMoreEmit)}),this.$more=m(".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>"];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>`)),this.root.innerHTML=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=m(".l-list-loadmore-text",this.$more);t&&(t.textContent=this._loadingText());let e=m(".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))}}}a(Ct,"baseName","list"),f(Ct),f(_t),f(pt),f(vt),f(et),f(rt),f(g),f(nt),f(lt),f(at),f(ot),f(j),f(ht),globalThis.LMessage=R;function zt(){const s=document.currentScript.src,r=s.lastIndexOf("/"),e=`${s.slice(0,r+1)}litos-ui.css`,i=document.createElement("link");i.rel="stylesheet",i.href=e,i.id="litos-ui-style",document.head.appendChild(i)}zt()})();
1
+ var ms=Object.defineProperty;var _e=p=>{throw TypeError(p)};var ps=(p,g,v)=>g in p?ms(p,g,{enumerable:!0,configurable:!0,writable:!0,value:v}):p[g]=v;var a=(p,g,v)=>ps(p,typeof g!="symbol"?g+"":g,v),_t=(p,g,v)=>g.has(p)||_e("Cannot "+v);var b=(p,g,v)=>(_t(p,g,"read from private field"),v?v.call(p):g.get(p)),x=(p,g,v)=>g.has(p)?_e("Cannot add the same private member more than once"):g instanceof WeakSet?g.add(p):g.set(p,v),wt=(p,g,v,it)=>(_t(p,g,"write to private field"),it?it.call(p,v):g.set(p,v),v),$=(p,g,v)=>(_t(p,g,"access private method"),v);(function(){"use strict";var yt,tt,J,ut,q,xt,Mt,z,k,we,Et,xe,Me,Ee,W,Le,Se,ot,Ae,ct,V,Ne,Te,ht,O,K,et,Ie,He;const p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",g="0123456789";function v(s,r=!0){return s==null?!0:(r&&typeof s=="string"?s.trim().length:s.length)===0}function it(s,r){r={isPositive:!1,isFloat:!0,...r};const t=r.isPositive?"[+]?":"[+-]?",e=r.isFloat?"([0-9]*[.])?[0-9]+":"[0-9]+";return new RegExp("^"+t+e+"$").test(s)}function B(s){if(typeof s=="object"&&s.min!=null&&s.max!=null){const r=Math.random(),t=s.hasEnd?1:0,e=r*(s.max-s.min+t)+s.min;return s.isInteger!==!1?Math.floor(e):e}else{if(typeof s=="object"&&s.length==null)throw new Error("random_length_cannot_null");let r=typeof s=="object"?s.length:s,t=p;typeof s=="object"&&s.hasLetter===!1&&(t=g);const e=Array.from({length:r},()=>t.charAt(B({min:0,max:t.length-1,hasEnd:!0}))).join("");return typeof s=="object"&&s.firstIsZero===!1&&e.indexOf("0")===0?B(s):e}}function Lt(s,r){return typeof s=="string"?(r||document).querySelectorAll(s):[s]}function X(s,r){return Lt(s,r)}function L(s,r={},t){let e;if(s.startsWith("<")&&s.endsWith(">")?e=new DOMParser().parseFromString(s,"text/html").body.firstElementChild:e=document.createElement(s),e&&r)for(const i in r){const n=r[i];i==="class"?e.className=F(n):i==="style"?e.style.cssText=Y(n):i==="textContent"&&n?e.textContent=n:i==="innerHTML"&&n?e.innerHTML=n:i==="outerHTML"&&n?e.outerHTML=n:n===!0?e.setAttribute(i,""):typeof n=="string"&&e.setAttribute(i,n)}return e}function St(s,r={},t){return L(s,r)}function u(s,r){const t=Lt(s,r);return t.length>0?t[0]:void 0}function S(s,r){s.classList.add(r)}function I(s,r){s.classList.remove(r)}function At(s,r){return s.classList.contains(r)}function _(s,r,t,e){s.addEventListener(r,t,e)}function w(s,r,t,e){s.removeEventListener(r,t,e)}function rt(s,r){for(let t=0,e=s.length;t<e&&r(s[t],t)!==!0;t++);}function ft(s,r,t){const e=s.getAttribute(r);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===r:i==="object"?e===""?t:JSON.parse(e):e}function ze(s,r=null,t="horizontal"){r==null&&(r=s.offsetParent);const e=r.getBoundingClientRect(),i=s.getBoundingClientRect();let n=t==="horizontal"?i.left:i.top,l=t==="horizontal"?i.right:i.bottom,o=t==="horizontal"?e.left:e.top,c=t==="horizontal"?e.right:e.bottom;return n>=o&&l<=c}function F(s){let r="";if(Array.isArray(s))for(let t=0,e=s.length;t<e;t++){const i=s[t];i&&(r+=`${i} `)}else if(typeof s=="string")r=s;else for(const t in s)s[t]&&(r+=`${t} `);return r.trim()}function Y(s){let r="";if(Array.isArray(s))for(let t=0,e=s.length;t<e;t++){const i=s[t];i&&(r+=`${i};`)}else if(typeof s=="string")r=s;else for(const t in s){const e=s[t];e&&(r+=`${t}:${e};`)}return r}function nt(s,r,t="set"){for(let e=0,i=r.length;e<i;e++){const n=r[e];t==="set"?s.style.setProperty(n[0],n[1]):s.style.removeProperty(n[0])}}function Nt(s,r,t="enter",e){const i=t==="enter"?"from":"to";let n="",l="";const o=[];if(typeof r=="string")n=`${r}-${t}-${i}`,l=`${r}-${t}-active`;else for(let c=0,h=r.length;c<h;c++){const d=r[c];d.length>=3&&o.push(`${d[0]} ${d[2]}`)}t==="enter"?n?(s.classList.add(n),setTimeout(()=>{s.classList.add(l),requestAnimationFrame(()=>{s.classList.remove(n)})},0)):(nt(s,r,"set"),setTimeout(()=>{o.length>0&&s.style.setProperty("transition",o.join(", ")),requestAnimationFrame(()=>{nt(s,r,"remove")})},0)):n?(s.classList.add(l),requestAnimationFrame(()=>{s.classList.add(n)})):(o.length>0&&s.style.setProperty("transition",o.join(", ")),requestAnimationFrame(()=>{nt(s,r,"set")})),s.addEventListener("transitionend",()=>{n?(s.classList.remove(l),requestAnimationFrame(()=>{s.classList.remove(n)})):(s.style.removeProperty("transition"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{nt(s,r,"remove")})})),e&&e()},{once:!0})}let Ve=-1,Tt={prefix:"l"};function f(s,r){const t=Array.isArray(s)?s:[s];for(const e of t){const i=`${Tt.prefix}-${e.baseName}`;customElements.get(i)||customElements.define(i,e)}}function It(){return`${Tt.prefix}-${++Ve}`}function A(s,r,t){if(s==null)return r;switch(typeof r){case"boolean":return s===""||s==="true"||s==="1"||s===t;case"number":return Number(s);default:return s}}function M(s){const r=s.attributes;for(const t of r){const{name:e,value:i}=t;if(e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("_")||e.startsWith("$"))continue;const l=e.split("-").map((c,h)=>h===0?c:c[0].toUpperCase()+c.slice(1)).join(""),o=A(i,s[l],e);s[l]=o,e==="value"&&(s._resetValue=o)}}function H(s,r){let t=" ";return r===!0?t=` ${s}`:typeof r=="string"&&!v(r)&&(t=` ${s}="${r}"`),t}function Fe(s){return s.map(t=>H(t[0],t[1])).join("")}function Re(s,r){for(const t of r){const e=t[1],i=t[0];e===!0?s.setAttribute(i,""):typeof e=="string"&&!v(e)&&s.setAttribute(i,e)}}function mt(s,r,t,e,i=10){let n=0;return t==="top"?n=r.height+i:t==="bottom"?n=-(s.height+i):(t==="left"||t==="right")&&(e===""?n=r.height/2-s.height/2:e==="end"&&(n=r.height-s.height)),n}function pt(s,r,t,e,i=10){let n=0;return t==="left"?n=r.width+i:t==="right"?n=-(s.width+i):(t==="top"||t==="bottom")&&(e===""?n=r.width/2-s.width/2:e==="end"&&(n=r.width-s.width)),n}function Be(s,r,t,e,i,n,l,o,c=10,h="absolute"){const d=window.innerHeight+n-10,y=window.innerWidth+i-10;let R=s.top+n-o;R+r.height>d&&(t==="left"||t==="right"?e="end":t="top",o=mt(s,r,t,e,c),R=s.top+n-o),R<n&&(t==="left"||t==="right"?e="start":t="bottom");let T=s.left+i-l;return T+r.width>y&&(t==="top"||t==="bottom"?e="end":t="left",l=pt(s,r,t,e,c),T=s.left+i-l),T<i&&(t==="top"||t==="bottom"?e="start":t="right"),h==="fixed"&&(o=mt(s,r,t,e,c),l=pt(s,r,t,e,c),T=s.left+i-l,R=s.top+n-o),{x:T,y:R,mainAlign:t,crossAlign:e}}class N extends HTMLElement{constructor(t=!0){super();a(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)}loadStyle(t){{let e=document.querySelector("#litos-ui-style");e?this.createLink(e.href):queueMicrotask(()=>{e=document.querySelector("#litos-ui-style"),e&&this.createLink(e.href)})}}loadExternalStyle(t){}loadStyleText(t){this.createStyle(t)}getAttr(t,e){return ft(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(){}}a(N,"baseName","base-component");class C extends N{constructor(){super();a(this,"useLink");a(this,"viewBox");this.useLink=!1,this.viewBox="0 0 1024 1024"}connectedCallback(){this.loadStyle(["icon"]),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 n=this.renderChildren();if(typeof n=="string")if(n===""){const l=this.children,o=[];for(let c=0,h=l.length;c<h;c++){const d=l[c];o.push(d.outerHTML)}t.innerHTML=o.join("")}else t.innerHTML=n;else t.append(n);this.shadow.appendChild(t)}renderChildren(){return""}createEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}a(C,"baseName","base-icon");let bt=(yt=class extends C{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>'}},a(yt,"baseName","loading-icon"),yt);const at=2,qe=.16,Pe=.05,je=.05,De=.15,We=/rgba?\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)/,Ht=/^#(?:([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 Oe(s){return s.r!=null&&s.g!=null&&s.b!=null}function zt(s){return s.h!=null&&s.s!=null&&s.v!=null}function Ke(s){let r=s.match(We);if(r!=null){const t=parseInt(r[1].trim()),e=parseInt(r[2].trim()),i=parseInt(r[3].trim());if(isNaN(t)||isNaN(e)||isNaN(i))throw new Error("Invalid RGB color.");let n=1;return r[4]!=null&&(n=parseFloat(r[4].trim()),isNaN(n)&&(n=1)),{r:t,g:e,b:i,a:n}}}function Ye(s){const r=s.match(Ht);if(r!=null){const t=r[4]!==void 0,e=parseInt(t?r[4]+r[4]:r[1],16),i=parseInt(t?r[5]+r[5]:r[2],16),n=parseInt(t?r[6]+r[6]:r[3],16);return{r:e,g:i,b:n}}}function gt(s){if(typeof s=="string"){let r=Ye(s);if(r==null&&(r=Ke(s)),r!=null)return r;throw new Error("Invalid color string")}else{if(Oe(s))return s;if(zt(s))return Ge(s);throw new Error("Invalid color")}}function Ue(s){if(zt(s))return s;const r=gt(s),t=r.r/255,e=r.g/255,i=r.b/255;let n=Math.max(t,e,i),l=Math.min(t,e,i),o=n-l,c=n,h=n===0?0:o/n,d=0;if(n===l)d=0;else switch(n){case t:d=((e-i)/o+(e<i?6:0))/6;break;case e:d=((i-t)/o+2)/6;break;case i:d=((t-e)/o+4)/6;break}return d=d*360,{h:d,s:h,v:c}}function Ge(s){let r=s.s,t=s.v;r>1&&(r/=100),t>1&&(t/=100);const e=s.h;var i=Math.floor(e/60)%6,n=e/60-Math.floor(e/60),l=t*(1-r),o=t*(1-n*r),c=t*(1-(1-n)*r);let h=0,d=0,y=0;switch(i){case 0:h=t,d=c,y=l;break;case 1:h=o,d=t,y=l;break;case 2:h=l,d=t,y=c;break;case 3:h=l,d=o,y=t;break;case 4:h=c,d=l,y=t;break;case 5:h=t,d=l,y=o;break}return h=Math.round(h*255),d=Math.round(d*255),y=Math.round(y*255),{r:h,g:d,b:y}}function Je(s,r,t){let e;return Math.round(s.h)>=60&&Math.round(s.h)<=240?e=t?Math.round(s.h)-at*r:Math.round(s.h)+at*r:e=t?Math.round(s.h)+at*r:Math.round(s.h)-at*r,e<0?e+=360:e>=360&&(e-=360),e}function Xe(s,r,t){if(s.h===0&&s.s===0)return s.s;let e;return t?e=s.s-qe*r:e=s.s+Pe*r,e>1&&(e=1),e<.06&&(e=.06),Number(e.toFixed(2))}function Ze(s,r,t){let e;return t?e=s.v+je*r:e=s.v-De*r,e>1&&(e=1),Number(e.toFixed(2))}function Vt(s){const r=t=>t.toString(16).padStart(2,"0");return`#${r(s.r)}${r(s.g)}${r(s.b)}`.toUpperCase()}function Qe(s){return typeof s=="string"&&Ht.test(s)?s:Vt(gt(s))}function U(s,r=1,t=!0){const e=Ue(s);return Qe({h:Je(e,r,t),s:Xe(e,r,t),v:Ze(e,r,t)})}f(bt);class Ft extends N{constructor(){super();a(this,"htmlType","button");a(this,"_handleClick",t=>{const e=t.target,i=ft(e,"html-type");if(i==="reset"||i==="submit"){const n=this._getForm();n&&(i==="reset"?n.reset():i==="submit"&&n.submit())}});M(this)}static get observedAttributes(){return["loading","color","disabled"]}attributeChangedCallback(t,e,i){const n=u(".l-button",this.root);if(n)if(t==="loading")A(i,!1,t)?(S(n,"l-btn-loading"),n.disabled=!0,n.innerHTML=this.loadingBody()):(I(n,"l-btn-loading"),n.disabled=this.getAttr("disabled",!1),n.innerHTML="<slot></slot>");else if(t==="color"){const l=this.getAttr("text",!1),o=this.getAttr("ghost",!1);n.style.cssText=this.applyColor(i,l,o)}else t==="disabled"&&(n.disabled=this.getAttr("disabled",!1))}connectedCallback(){this.loadStyle(["button"]),this.loadExternalStyle(["animation"]),this.render(),(this.htmlType==="reset"||this.htmlType==="submit")&&_(this,"click",this._handleClick)}disconnectedCallback(){super.disconnectedCallback(),(this.htmlType==="reset"||this.htmlType==="submit")&&w(this,"click",this._handleClick)}render(){const t=this.getAttr("type","normal"),e=document.createElement("button"),i=this.getAttr("loading",!1),n=this.getAttr("shape","default"),l=this.getAttr("text",!1),o=this.getAttr("ghost",!1),c=["l-btn",`l-btn-${t}`,this.getAttr("block",!1)?"l-btn-block":"",n==="round"?"l-btn-round":"",n==="circle"?"l-btn-circle":"",o?"l-btn-ghost":"",l?"l-btn-text":"",i?"l-btn-loading":""];e.className=F(c),e.disabled=this.getAttr("disabled",!1)||i,e.type=this.getAttr("html-type","button");const h=this.applyColor(this.getAttr("color"),l,o);h&&(e.style.cssText=h),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 n=U(t,1,!0),l=U(t,3,!1);return Y({"--l-btn-border-color":e?"transparent":t,"--l-btn-text-color":i||e?t:"#ffffff","--l-btn-hover-text-color":i||e?n:"#ffffff","--l-btn-background":i||e?"transparent":t,"--l-btn-active-text-color":i||e?l:"#ffffff","--l-btn-hover-border-color":e?"transparent":n,"--l-btn-hover-background":i||e?"transparent":n,"--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}}a(Ft,"baseName","button");let m;function P(s,r,t){m==null&&(m=new Map),m.has(s)||m.set(s,new Map([[r,new Set]])),m.get(s).has(r)||m.get(s).set(r,new Set),m.get(s).get(r).add(t)}function Z(s,r,t){var e,i,n,l,o,c;(i=(e=m==null?void 0:m.get(s))==null?void 0:e.get(r))==null||i.delete(t),((l=(n=m==null?void 0:m.get(s))==null?void 0:n.get(r))==null?void 0:l.size)==0&&((o=m.get(s))==null||o.delete(r)),((c=m==null?void 0:m.get(s))==null?void 0:c.size)==0&&m.delete(s),(m==null?void 0:m.size)==0&&(m=void 0)}function Rt(s){s==null?m!=null&&(m.clear(),m=void 0):m!=null&&(m.delete(s),m.size===0&&(m=void 0))}function E(s,r,...t){var i;const e=(i=m==null?void 0:m.get(s))==null?void 0:i.get(r);if(e!=null)for(const n of e)n(...t)}class Q extends N{constructor(t=!0){super();a(this,"disabled",!1);a(this,"name");a(this,"formAttrs",{});a(this,"formItemAttrs",{});a(this,"_value","");a(this,"_resetValue");a(this,"_firstPushValue",!0);a(this,"_reseting",!1);a(this,"_formAttributeChanged",(t,e,i)=>{i===this.formAttrs.formId?this.formAttrs[t]=e:this.formItemAttrs[t]=e,t==="disabled"&&this._changeDisabled()});a(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(t==="disabled"){const n=A(i,!1,t);n!==this.disabled&&(this._changeDisabled(),this.disabled=n)}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&&(P(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),P(this.formAttrs.id,"reset",this._resetFieldValue),this._firstPushValue&&this.pushValueChange()),this.formItemAttrs.id&&P(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged),super.connectedCallback()}disconnectedCallback(){this.formAttrs.id&&(Z(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),Z(this.formAttrs.id,"reset",this._resetFieldValue)),this.formItemAttrs.id&&Z(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 n=t.tagName;if(n==="L-FORM"){const l=t.sharedAttrs;for(let o=0;o<l.length;o++){const c=l[o];e[c]=t[c]}break}if(n==="BODY")break;if(n==="L-FORM-ITEM"){const l=t.sharedAttrs;for(let o=0;o<l.length;o++){const c=l[o];i[c]=t[c]}}t=t.parentElement}return t=null,{formAttr:e,formItemAttr:i}}_changeDisabled(){}pushValueChange(){const t=this.getName();this.formAttrs.id&&t&&E(this.formAttrs.id,"valueChange",t,this._value,!this._reseting),this._reseting=!1}reset(){this.value=this._resetValue||""}}class Bt extends Q{constructor(){super();a(this,"type","text");a(this,"placeholder");a(this,"autosize",!1);a(this,"allowInput");a(this,"parser");a(this,"width");a(this,"block",!1);a(this,"error",!1);a(this,"$input");a(this,"_input",t=>{const e=t.target;let i=e.value;if(this.allowInput!=null){let n=this.allowInput.indexOf("."),l=n===-1?n:parseInt(this.allowInput.substring(n+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)});a(this,"_validateChange",(t,e)=>{const i=this.getName();if(i){const n=t===!0?!1:t[i]!=null;(e==null||e===i&&this.error!=n)&&(this.error=n,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.loadStyle(["input"])}disconnectedCallback(){super.disconnectedCallback(),this.formAttrs.id&&Z(this.formAttrs.id,"validateChange",this._validateChange),w(this.$input,"input",this._input),this.$input=void 0}attributeChange(t,e,i){if(t==="error"){const n=A(i,!1,t);n!==this.error&&(this.error=n,this._updateError())}}render(){let t=H("value",this.value);const e=H("placeholder",this.placeholder),i=H("disabled",this.isDisabled()),n=F({"l-input":!0,"is-autosize":this.autosize,"is-error":this.error}),l=this.getName(),o=H("name",l),c=`${t}${o}${e}${i}`;this.shadow.innerHTML=`<input part="default" type="${this.type}" class="${n}"${c}></input>`,this.$input=u("input",this.root),_(this.$input,"input",this._input),this.style.cssText=Y(this._getStyleObj())+this.getAttr("style",""),l&&this.formAttrs.id&&P(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,n=e.negative?"-?":"";if(e.integer){const o=i.match(new RegExp(`^(${n}\\d*)`));return o!=null?o[1]:i.substring(0,i.length-1)}const l=i.match(new RegExp(`(${n}\\d+\\.\\d{0,${e.precition}})|(${n}\\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?S(this.$input,"is-error"):I(this.$input,"is-error"))}}a(Bt,"componentName","input");class qt extends C{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>'}}a(qt,"baseName","arrow-down-icon");class Pt extends C{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>'}}a(Pt,"baseName","arrow-left-icon");class jt extends C{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>'}}a(jt,"baseName","arrow-right-icon");class Dt extends C{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>'}}a(Dt,"baseName","arrow-up-icon");class Wt extends C{renderChildren(){return'<path fill="currentColor" d="M512 320 192 704h639.936z"></path>'}}a(Wt,"baseName","caret-top-icon");class Ot extends C{renderChildren(){return'<path fill="currentColor" d="m192 384 320 384 320-384z"></path>'}}a(Ot,"baseName","caret-bottom-icon");class Kt extends C{constructor(){super();a(this,"_t");a(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 n=i.getAttribute("viewBox");n||(n="0 0 1024 1024");const l=this.shadow.querySelector("svg");l!=null&&(l.setAttribute("viewBox",n),l.innerHTML=i.innerHTML)}))}}a(Kt,"baseName","font-icon");class Yt extends C{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>'}}a(Yt,"baseName","search-icon");class Ut extends C{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>'}}a(Ut,"baseName","sun-icon");class Gt extends C{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>'}}a(Gt,"baseName","moon-icon");class Jt extends C{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>'}}a(Jt,"baseName","reduction-icon");class Xt extends C{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>'}}a(Xt,"baseName","refresh-left-icon");class Zt extends C{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>'}}a(Zt,"baseName","refresh-right-icon");class Qt extends C{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"/>'}}a(Qt,"baseName","theme-default-icon");class te extends C{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>'}}a(te,"baseName","sort-icon");class ee extends C{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>'}}a(ee,"baseName","mask-close-icon");class se extends C{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>'}}a(se,"baseName","success-icon");class ie extends C{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>'}}a(ie,"baseName","warn-icon");class re extends C{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>'}}a(re,"baseName","info-icon"),f(ee),f(se),f(ie),f(re);const G=[],ne=[["opacity","0","0.3s"],["transform","translate3d(-50%, -100%, 0)","0.3s"]];function ae(s){const r=G.findIndex(n=>n.id===s);if(r===-1)return;const t=G.splice(r,1)[0];if(t==null)return;Nt(t,ne,"leave",()=>{t.remove()});const e=15+t.offsetHeight,i=G.length;if(i!==0)for(let n=r;n<i;n++){const l=G[n],o=parseInt(l.style.top,10)-e;l.style.setProperty("top",`${o}px`)}}function ts(s){const r=document.createElement("div");r.id=s.id;const t=s.type||"info";let e=`l-message l-message-${t}`;s.customClass&&(e+=" "+s.customClass),r.className=e,r.style.setProperty("top",`${s.offset}px`),r.style.setProperty("z-index",`${s.zindex||1e3}`),s.width&&r.style.setProperty("width",s.width);let i=t;return i==="error"&&(i="mask-close"),r.innerHTML=['<div class="l-message-container">',`<l-${i}-icon class="l-message-icon"></l-${i}-icon>`,`<span class="l-message-content">${s.message}</span>`,"</div>"].join(""),r}const lt=s=>{const r=G.reduce((l,o)=>l+o.offsetHeight+15,15),t=It(),e=typeof s=="string"?{message:s}:s;e.id=t,e.offset=r;const i=ts(e);G.push(i),document.body.appendChild(i),Nt(i,ne,"enter");let n=e.duration;return n==null&&(n=3e3),n!==0&&setTimeout(()=>{ae(t)},n),t};for(const s of["info","success","error","warn","show"])lt[s]=r=>{const t=typeof r=="string"?{message:r}:r;return s!=="show"?t.type=s:t.type==null&&(t.type="info"),lt(t)};lt.close=ae;const vt={mobile:"请输入正确的手机号",same:"两次输入不一致",required:"%s为必填字段"},Ct="请输入正确的数据",j={same:/^same:(.+)$/i,mobile:/^1[345678]\d{9}$/,required:/^\S{1}.*/},$t={same(s,r){return r===s},pattern(s,r){return r==null?!1:s.test(String(r))}};class le extends Error{constructor(r,t,e){super(e),this.name="ValidateError",this.key=t,this.detail=r}}class es{constructor(r){this.rules={},this.addSchemas(r)}addSchemas(r){for(let t of r)this.rules[t.key]=this._parseSchemaRules(t)}addSchema(r){this.rules[r.key]=this._parseSchemaRules(r)}async validate(r,t=!1){return new Promise((e,i)=>{const n={};let l,o;for(let c in this.rules){let h=this._validateRule(this.rules[c],r[c],r);if(h!==""&&(h=h.replace("%s",c),n[c]=h,l=c,o=h,t))break}l==null?e(!0):i(new le(n,l,o))})}async validateKey(r,t,e){return new Promise((i,n)=>{let l=this.rules[r];if(l==null){i({key:r,value:t});return}let o=this._validateRule(l,t,e);o!==""?(o=o.replace("%s",r),n(new le({[r]:o},r,o))):i({key:r,value:t})})}_validateRule(r,t,e){let i="";for(let n of r)if(n.rule==="required"?(t==null||!$t.pattern(j.required,t))&&(i=n.message):typeof n.rule=="function"?n.rule(t)||(i=n.message):n.sameKey!=null?e!=null&&($t.same(t,e[n.sameKey])||(i=n.message)):$t.pattern(n.rule,t)||(i=n.message),i!=="")break;return i}_parseSchemaRules(r){let t=[],e=r.rules;if(r.required===!0&&t.push(...this._parseStringRule("required",r.message)),e!=null)if(typeof e=="string")t=t.concat(this._parseStringRule(e,r.message));else if(e instanceof Array)for(let i of e)typeof i=="string"?t.push(...this._parseStringRule(i,r.message)):i instanceof RegExp||typeof i=="function"?t.push({rule:i,message:r.message||Ct}):typeof i.rule=="string"?t.push(...this._parseStringRule(i.rule,i.message)):t.push({rule:i.rule,message:i.message||Ct});else t.push({rule:e,message:Ct});return t}_parseStringRule(r,t){let e=[],i=r.split("|");for(let n of i){let l=t,o=null,c;if(r==="required")o="required",l=l||t||vt.required;else if(j.same.test(n)){if(n.match(j.same)!=null){o=j.same;let d=n.match(j.same);d!=null&&(c=d[1]),l=l||vt.same}}else Object.hasOwn(j,n)&&(o=j[n],l=l||vt[n]);e.push({rule:o,message:l,sameKey:c})}return e}}class oe extends N{constructor(){super();a(this,"inline",!1);a(this,"labelPosition","right");a(this,"labelWidth");a(this,"id");a(this,"disabled",!1);a(this,"sharedAttrs",["disabled","id","innerBlock"]);a(this,"validator");a(this,"innerBlock",!1);a(this,"novalidate",!1);a(this,"_data");a(this,"emit");a(this,"ruleChange",t=>{this.validator.addSchema(t)});a(this,"_valueChange",(t,e,i=!0)=>{this._data==null&&(this._data={});const n=Object.hasOwn(this._data,t);this._data[t]=e,!this.novalidate&&n&&i&&this.validator.validateKey(t,e,this._data).then(()=>{E(this.id,"validateChange",!0,t)}).catch(l=>{E(this.id,"validateChange",l.detail,t)})});M(this),this.id==null&&(this.id=`l-f${B(3)}-${B(6)}`),this.validator=new es([]),this.emit=new CustomEvent("submit")}static get observedAttributes(){return["disabled","label-position"]}attributeChangedCallback(t,e,i){if(t==="disabled"){const n=A(i,!1,t);n!==this.disabled&&(E(this.id,"attributeChanged",t,n,this.id),this.disabled=n)}else if(t==="label-position"){const n=u("form",this.root);n&&(n.className=F(["l-form",this.inline?"l-form-inline":void 0,`l-form--${i}`]))}}connectedCallback(){this.loadStyle(["form"]),super.connectedCallback(),P(this.id,"ruleChange",this.ruleChange),P(this.id,"valueChange",this._valueChange)}disconnectedCallback(){Rt(this.id),this.validator=void 0}render(){const t=F(["l-form",this.inline?"l-form-inline":void 0,`l-form--${this.labelPosition}`]),e=Y({"--l-form-label-width":this.labelWidth?this.labelWidth:""});this.shadow.innerHTML=`<form class="${t}" style="${e}"><slot></slot></form>`}validateField(t){const e=[];if(this._data!=null){if(Array.isArray(t))for(let i=0,n=t.length;i<n;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 n=0,l=i.length;n<l;n++){const o=i[n];o.status==="rejected"?E(this.id,"validateChange",o.reason.detail,o.reason.key):E(this.id,"validateChange",!0,o.value.key)}})}}clearValidate(){E(this.id,"validateChange",!0)}reset(){this.clearValidate(),E(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),E(this.id,"validateChange",!0),Promise.resolve(!0)}catch(t){return E(this.id,"validateChange",t.detail),Promise.resolve(!1)}return Promise.resolve(!0)}getData(){return{...this._data}}}a(oe,"baseName","form");class ce extends N{constructor(){super();a(this,"disabled",!1);a(this,"sharedAttrs",["disabled","id","name","innerBlock"]);a(this,"required",!1);a(this,"error");a(this,"label");a(this,"id");a(this,"verify");a(this,"validity");a(this,"pattern");a(this,"name");a(this,"innerBlock",!1);a(this,"labelPosition","right");a(this,"formId");a(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${B(3)}-${B(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 n=A(i,!1,t);n!==this.disabled&&(E(this.id,"attributeChanged",t,n,this.id),this.disabled=n)}}connectedCallback(){var t;if(super.connectedCallback(),this.loadStyle(["form"]),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};E(this.formId,"ruleChange",i),P(this.formId,"validateChange",this._validateChange)}}disconnectedCallback(){Rt(this.id),this.formId&&Z(this.formId,"validateChange",this._validateChange)}setRules(t){const e={...t,key:this.name};e.required!=null&&this.required&&(e.required=!0),this.formId&&E(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>`:"";this.shadow.innerHTML=[`<div class="${F(t)}">${e}`,'<div class="l-form-item__content">',`<slot></slot>${i}</div></div>`].join("")}_updateError(){if(!this.rendered)return;let t=u(".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=u(".l-form-item__content",this.root);i&&i.appendChild(t)}const e=u(".l-form-item",this.root);e&&(this.error?S(e,"is-error"):I(e,"is-error"))}_updateLabel(){if(!this.rendered)return;let t=u(".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=u(".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}}a(ce,"baseName","form-item");class he extends Q{constructor(){super(!1);a(this,"type");a(this,"label");a(this,"checked",!1);a(this,"_changeEvent");a(this,"_radioChange",t=>{const e=t.target;let i=e.parentElement;for(;i!=null&&!At(i,"l-radio");)i=i.parentElement;const n=u(".is-checked",this.root);n&&I(n,"is-checked"),this.value=e.value,i&&S(i,"is-checked"),this.dispatchEvent(this._changeEvent)});M(this),this._changeEvent=new CustomEvent("change")}setItems(t){this._removeEvents(),this.root.innerHTML=this._renderItems(t),this._initEvents()}connectedCallback(){super.connectedCallback(),this.loadStyle(["radio"]),this._initEvents()}disconnectedCallback(){super.disconnectedCallback(),this._removeEvents()}attributeChange(t,e,i){if(t==="checked"){const n=A(i,!1,t);this.checked=n,this.value=n;const l=u(".l-radio",this.root);if(l&&!At(l,"is-checked")){S(l,"is-checked");const o=u("input",l);o&&(o.checked=!0)}}}render(){this.getName()||(this.name=`la${B(3)}_${B(6)}`);const t=[],e=u('[slot="label"]',this),i=X("[radio-value]",this);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&&(rt(i,n=>{const l=n.cloneNode(!0),o=ft(n,"radio-value");t.push(this._renderItem(l.outerHTML,o,this.value===o))}),this.pushValueChange()),this.root.innerHTML=t.join("")}setValue(t){super.setValue(t);let e="";typeof t!="boolean"&&(e=`[l-value="${t}"]`);const i=u(".is-checked",this.root);i&&I(i,"is-checked");const n=u(`label${e}`,this.root);if(n){const l=u("input",n);typeof t=="boolean"?(t?S(n,"is-checked"):I(n,"is-checked"),l.checked=t):(S(n,"is-checked"),l.checked=!0)}}_renderItems(t){const e=[];for(let i=0,n=t.length;i<n;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,n=void 0){const l=F({"l-radio":!0,"l-radio--disabled":this.isDisabled(),"l-radio--button":this.type==="button","is-checked":i}),o=H("disabled",this.isDisabled()),c=H("checked",i),h=H("value",e),y=`${H("name",this.getName())}${h}${o}${c}`,R=H("part",n),dt=H("l-value",e),T=[`<label class="${l}"${dt}>`,`<input type="radio" class="l-radio__input"${y} />`];this.type!=="button"&&T.push('<span class="l-radio__inner"></span>');let st=t==="slot"?'<slot name="label"></slot>':t;return T.push(`<div class="l-radio__label"${R}>${st}</div>`),T.push("</label>"),T.join("")}_isChecked(){return this.checked}_initEvents(){rt(X("input",this.root),t=>{_(t,"change",this._radioChange)})}_removeEvents(){rt(X("input",this.root),t=>{w(t,"change",this._radioChange)})}}a(he,"baseName","radio"),f(bt);class de extends N{constructor(){super();a(this,"finish",!1);a(this,"infinite",!0);a(this,"observer");a(this,"loadMoreEmit");a(this,"$more");M(this),this.loadMoreEmit=new CustomEvent("load-more")}static get observedAttributes(){return["finish"]}attributeChangedCallback(t,e,i){if(t==="finish"){const n=A(i,!1,t);this.finish!==n&&(this.finish=n,this._finishChange())}}connectedCallback(){this.loadStyle(["list"]),this.loadExternalStyle(["animation"]),super.connectedCallback(),this.infinite&&(this.observer=new IntersectionObserver(t=>{t[0].isIntersecting&&!this.finish&&this.dispatchEvent(this.loadMoreEmit)}),this.$more=u(".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>"];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>`)),this.root.innerHTML=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=u(".l-list-loadmore-text",this.$more);t&&(t.textContent=this._loadingText());let e=u(".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))}}}a(de,"baseName","list");class ue extends N{constructor(){super();a(this,"shape","triangle-top");a(this,"background");M(this)}connectedCallback(){this.loadStyle(["polygon"]),super.connectedCallback()}render(){const t=F(["l-polygon",this.shape?`l-polygon-${this.shape}`:""]),e=Y([this.background?`--l-polygen-background: ${this.background}`:""]);this.root.innerHTML=`<div part="default" class="${t}" style="${e}"></div>`}}a(ue,"baseName","polygon");class fe extends Q{constructor(){super();a(this,"$select");a(this,"changeEmit");a(this,"_handleChange",t=>{const e=t.target.value;super.setValue(e),this.dispatchEvent(this.changeEmit)});M(this),this.changeEmit=new CustomEvent("change")}connectedCallback(){this.loadStyle(["input"]),super.connectedCallback(),this.$select=u("select",this.root),this.value&&(this.$select.value=this.value),_(this.$select,"change",this._handleChange)}disconnectedCallback(){super.disconnectedCallback(),this.$select&&w(this.$select,"change",this._handleChange),this.changeEmit=void 0,this.$select=void 0}render(){let t=this.innerHTML.trim();const e=Fe([["name",this.getName()],["disabled",this.isDisabled()]]);this.root.innerHTML=`<select class="l-input"${e}>${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,n=t.length;i<n;i++){const l=t[i],o=document.createElement("option");o.value=l.value,o.innerHTML=l.label,e.appendChild(o)}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)}}a(fe,"baseName","select-ori");class me extends Q{constructor(){super(!1);x(this,J);a(this,"actionRender");a(this,"checkedText");a(this,"uncheckedText");x(this,tt,t=>{this.isDisabled()||(this.setValue(!this.value),this.dispatchEvent(new CustomEvent("change")))});M(this);const t=this.value?A(this.value,!1,"value"):!1;this._resetValue=t,this.value=t}connectedCallback(){this.loadStyle(["switch"]),super.connectedCallback(),this.pushValueChange(),$(this,J,ut).call(this),_(this,"click",b(this,tt))}disconnectedCallback(){super.disconnectedCallback(),w(this,"click",b(this,tt)),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?S(this,"l-switch--checked"):I(this,"l-switch--checked");const e=u(".l-switch-text",this.root);e&&(e.textContent=this.value?this.checkedText||"":this.uncheckedText||""),$(this,J,ut).call(this)}setActionRender(t){this.actionRender=t,$(this,J,ut).call(this)}}tt=new WeakMap,J=new WeakSet,ut=function(){const t=u(".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=u('[slot="checked-action"]',this),i=u('[slot="unchecked-action"]',this);this.value&&e?t.innerHTML='<slot name="checked-action"></slot>':!this.value&&i&&(t.innerHTML='<slot name="unchecked-action"></slot>')}},a(me,"baseName","switch");class pe extends Q{constructor(){super();a(this,"$picker");a(this,"_value","#000000");a(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.loadStyle(["input","color_picker"]),super.connectedCallback(),this.$picker=u("input",this.root),_(this.$picker,"change",this._handleChange)}disconnectedCallback(){super.disconnectedCallback(),this.$picker&&(w(this.$picker,"change",this._handleChange),this.$picker=void 0)}render(){const t=document.createElement("input");return Re(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())}}a(pe,"baseName","color-picker");function ss(s,r,t){let e=s.target,i="";do if(t&&t.isSameNode(e)||e.tagName==="BODY"||(e.getAttribute&&(i=e.getAttribute(r)||""),i===""&&(e=e.parentNode),!e))break;while(i==="");return[i!=="__stop__"&&i!=="",i,e]}class be extends N{constructor(){super();x(this,q);a(this,"type","nav");a(this,"name");a(this,"justifyContent");a(this,"gap");a(this,"$line");a(this,"_handleClick",t=>{const[e,i]=ss(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),this.root}connectedCallback(){this.loadStyle(["tabbar"]),S(this,`l-tabbar--${this.type}`),!v(this.gap)&&!this.gap.startsWith("0")&&S(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 n=A(i,void 0);this.name=n,this._updateActive(),this._updateLine()}else if(t==="type"){const n=A(i,"nav");if(n!==this.type&&(I(this,`l-tabbar--${this.type}`),this.type=n,I(this,`l-tabbar--${n}`),n==="card")){let l=u(".l-tabbar-card-border",this.root);l||(l=L("div",{class:"l-tabbar-card-border"}),this.root.appendChild(l))}}else{const n=A(i,void 0);this[t]=n;const l=u(".l-tabbar-wrapper",this.root);l&&(l.style.cssText=$(this,q,xt).call(this)),t==="gap"&&(!v(this.gap)&&!this.gap.startsWith("0")?S(this,"l-tabbar-gap"):I(this,"l-tabbar-gap"))}}disconnectedCallback(){super.disconnectedCallback(),this._destroy()}render(){const t=X("[l-name]",this),e=document.createDocumentFragment(),i=document.createElement("div");if(i.className="l-tabbar-wrapper",i.style.cssText=$(this,q,xt).call(this),i.setAttribute("part","default"),t.length>0&&rt(t,n=>{const l=n.getAttribute("l-name");if(l){const o=n.cloneNode(!0);o.classList.add("l-tabbar-item"),l===this.name&&o.classList.add("active");const c=u("[l-icon]",o),h=X(":not([l-icon])",o);if(c){const d=L("div",{class:["l-tabbar-item-icon",h.length===0?"only":void 0]});d.appendChild(c.cloneNode(!0)),c.replaceWith(d)}i.appendChild(o)}}),e.appendChild(i),this.type==="card"){const n=L("div",{class:"l-tabbar-card-border"});e.appendChild(n)}return e}setItems(t){const e=u(".l-tabbar-wrapper",this.root);e&&(e.innerHTML="",e.appendChild($(this,q,Mt).call(this,t)))}addItems(t){const e=u(".l-tabbar-wrapper",this.root);e&&e.appendChild($(this,q,Mt).call(this,t))}_init(){_(this.root,"click",this._handleClick),setTimeout(()=>{this._updateLine()},300)}_destroy(){w(this.root,"click",this._handleClick),this.$line=void 0}_updateActive(){const t=u(".active",this.root);t&&I(t,"active");const e=u(`[l-name="${this.name}"]`,this.root);e&&S(e,"active")}_updateLine(){queueMicrotask(()=>{if(!this.name||this.type==="nav"||!this.rendered)return;const t=u(".active",this.root);if(!t)return;const e=t.offsetLeft;if(!this.$line){const i=L("div",{class:"l-tabbar--bar-line"});this.root.appendChild(i),this.$line=u(".l-tabbar--bar-line",this.root)}this.$line.style.cssText=`width:${t.offsetWidth}px;left:${e}px`,ze(t,this)||this.scrollTo({left:e,behavior:"smooth"})})}}q=new WeakSet,xt=function(){const t={};if(v(this.justifyContent)||(t["justify-content"]=this.justifyContent),!v(this.gap)){let e=this.gap;it(e,{isPositive:!0})&&(e=`${e}px`),t["--l-tabbar-item-gap"]=e}return Y(t)},Mt=function(t){const e=document.createDocumentFragment();for(let i=0,n=t.length;i<n;i++){const l=t[i],o=L("div",{class:F(["l-tabbar-item",this.name===l.name?"active":void 0]),"l-name":l.name}),c=l.icon;if(c){const d=L("div",{class:"l-tabbar-item-icon"});let y=typeof c=="string"?c:c();typeof y=="string"?d.innerHTML=y:d.appendChild(y),o.appendChild(d)}const h=l.text;if(h){let d=typeof h=="string"?h:h();typeof d=="string"?o.appendChild(L(d)):o.appendChild(d)}e.appendChild(o)}return e},a(be,"baseName","tabbar");function ge(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"auto"}async function is(s,r=!0){return new Promise(t=>{const e=document.documentElement.classList;s==null&&(s=ge());function i(){s==="light"?(e.add("light"),e.remove("dark")):s==="dark"?(e.add("dark"),e.remove("light")):e.remove("light","dark")}r&&document.startViewTransition?document.startViewTransition(()=>{i(),t(s)}):(i(),t(s))})}function rs(){let s=document.documentElement.className.match(/light|dark/);return s!=null&&(s=s[0]),s==null&&(s=localStorage.getItem("web-theme-appearance")),s==null&&(s=ge()),s}async function ns(s,r=!0,t=!0){return r===!0&&localStorage.setItem("web-theme-appearance",s??"auto"),is(s,t)}function as(s){const r=document.documentElement,t=r.className.match(/color-([0-9a-fA-F]{6})/);if(t==null){let e=getComputedStyle(r).getPropertyValue("--nt-primary-color");return e===""&&(e=localStorage.getItem("web-theme-color")),e||s}return`#${t[1]}`}async function ls(s){const r=[`--nt-primary-color: ${s};`,`--l-primary-color: ${s};`,`--nt-primary-color-dark1: ${U(s,1,!1)};`,`--l-primary-color-dark1: ${U(s,1,!1)};`];for(let e=1;e<=5;e++)r.push(`--nt-primary-color-light${e}: ${U(s,e)};`),r.push(`--l-primary-color-light${e}: ${U(s,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{${r.join("")}}`,s}function os(s,r=!0){return r===!0&&localStorage.setItem("web-theme-color",s),ls(s)}const cs=[{value:"auto",text:"跟随系统",icon:"l-theme-default-icon"},{value:"light",text:"浅色模式",icon:"l-sun-icon"},{value:"dark",text:"深色模式",icon:"l-moon-icon"}];class ve extends N{constructor(){super();x(this,k);a(this,"type","button");a(this,"label","text");a(this,"theme");x(this,z);x(this,W,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 ns(e),this.theme=e,this.type==="button"&&$(this,k,Et).call(this,b(this,z)),this.dispatchEvent(new CustomEvent("change",{detail:e}))});M(this),this.theme=rs()}connectedCallback(){this.loadStyle(["theme"]),super.connectedCallback(),$(this,k,Le).call(this)}disconnectedCallback(){super.disconnectedCallback(),$(this,k,Se).call(this)}render(){switch(this.type){case"select":return $(this,k,xe).call(this);case"radio":return $(this,k,Ee).call(this);case"switch":return $(this,k,Me).call(this);default:return $(this,k,we).call(this)}}}z=new WeakMap,k=new WeakSet,we=function(){const t=L("l-button",{class:"l-theme-btn l-theme-inner"});return $(this,k,Et).call(this,t),t},Et=function(t){const e=this.theme==="auto"?"sun":"moon";t.innerHTML=`<l-${e}-icon></l-${e}-icon>`},xe=function(){const t=L("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},Me=function(){const t=L("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},Ee=function(){const t=L("l-radio",{class:"l-theme-inner"});t.value=this.theme,t.type="button";const e=cs.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},W=new WeakMap,Le=function(){wt(this,z,u(".l-theme-inner",this.root)),this.type==="button"?_(b(this,z),"click",b(this,W)):_(b(this,z),"change",b(this,W))},Se=function(){b(this,z)&&(this.type==="button"?w(b(this,z),"click",b(this,W)):w(b(this,z),"change",b(this,W)),wt(this,z,void 0))},a(ve,"baseName","theme");class Ce extends N{constructor(){super();x(this,ot);a(this,"color");x(this,ct,async t=>{const e=t.detail;this.color=e,await os(e),this.dispatchEvent(new CustomEvent("change",{detail:e}))});this.color=as()||"#722ed1"}connectedCallback(){super.connectedCallback(),$(this,ot,Ae).call(this)}render(){const t=document.createElement("l-color-picker");return t.value=this.color,t}}ot=new WeakSet,Ae=function(){const t=u("l-color-picker",this.root);t&&_(t,"change",b(this,ct))},ct=new WeakMap,a(Ce,"baseName","theme-color");const D=new Map;function $e(s){for(const r of D.values())for(const t of r)hs(s,t)}function hs(s,r){const t=s.target,e=!t,i=r.el.contains(t),n=r.el===t;e||i||n||r.handler(s)}function ds(s,r){D.has(s)||D.set(s,[]);const t=D.get(s);t&&t.push({el:s,handler:r}),D.size===1&&document.addEventListener("click",$e,!0)}function us(s){D.delete(s),D.size===0&&document.removeEventListener("click",$e,!0)}class ye extends N{constructor(){super();x(this,V);a(this,"inline",!1);a(this,"placement","top");a(this,"content");a(this,"showArrow",!0);a(this,"trigger","hover");a(this,"disabled",!1);a(this,"isShow",!1);a(this,"width");a(this,"destroyOnHide",!1);a(this,"offset");a(this,"position","absolute");a(this,"theme","default");a(this,"_t");x(this,ht,t=>{t.target.id!==this.id&&this.hide()});x(this,O,t=>{this.show(t.target)});x(this,K,()=>{this.hide()});x(this,et,t=>{this.trigger==="click"?this.toggle(t.target):this.trigger==="focus"&&this.show(t.target)});M(this),this.id||(this.id=`${It()}-popover`),this.style.display=this.inline?"inline-block":"block"}connectedCallback(){this.loadStyle(["popover"]),super.connectedCallback(),this.renderContent(),$(this,V,Ne).call(this)}disconnectedCallback(){super.disconnectedCallback(),$(this,V,Te).call(this)}render(){const t=document.createElement("slot");return t.setAttribute("name","trigger"),t}renderContent(){if(!this.isShow)return;let t=u(".l-popover--content",this.root);if(t){t.style.removeProperty("display");return}if(t=St("div",{class:["l-popover--content",`l-popover-${this.placement}`,this.theme==="tooltip"?"l-popover-tooltip":void 0]}),this.offset&&(t.style.cssText="--l-popover-offset: ${this.offset}px;"),t.part="content",t.innerHTML=this.content?this.content:"<slot></slot>",this.showArrow){const e=St("div",{class:"l-popover--arrow"});t.appendChild(e)}this.trigger==="hover"&&(_(t,"mouseenter",b(this,O)),_(t,"mouseleave",b(this,K))),this.root.appendChild(t)}hideContent(){const t=u(".l-popover--content",this.root);t&&(this.destroyOnHide?(this.trigger==="hover"&&(w(t,"mouseenter",b(this,O)),w(t,"mouseleave",b(this,K))),this.root.removeChild(t)):t.style.display="none")}show(t){if(!this.disabled){if(this.isShow){$(this,V,Ie).call(this);return}this.isShow=!0,this.renderContent(),$(this,V,He).call(this,t)}}hide(){this._t=setTimeout(()=>{this.isShow=!1,this.hideContent()},50)}toggle(t){this.isShow?this.hide():this.show(t)}}V=new WeakSet,Ne=function(){const t=u('[slot="trigger"]',this);t&&(this.trigger==="hover"?(_(t,"mouseenter",b(this,O)),_(t,"mouseleave",b(this,K))):(this.trigger==="click"||this.trigger==="focus")&&(_(t,"click",b(this,et)),ds(t,b(this,ht))))},Te=function(){const t=u('[slot="trigger"]',this);t&&(this.trigger==="hover"?(w(t,"mouseenter",b(this,O)),w(t,"mouseleave",b(this,K))):(this.trigger==="click"||this.trigger==="focus")&&(w(t,"click",b(this,et)),us(t)))},ht=new WeakMap,O=new WeakMap,K=new WeakMap,et=new WeakMap,Ie=function(){this._t&&(clearTimeout(this._t),this._t=void 0)},He=function(t){let e="bottom",i="";const n=this.placement.split("-");n!=null&&(e=n[0],i=n[1]||"");let l;t==null&&(t=u('[slot="trigger"]',this));const o=u(".l-popover--content",this.root);if(o){let c=o.getBoundingClientRect();const h=t.getBoundingClientRect();let d=document.documentElement;const y=d.scrollLeft,R=d.scrollTop;this.width!=null&&(this.width==="trigger"?l=h.width:l=this.width),l!=null&&(c.width=l);const dt=mt(h,c,e,i,this.offset),T=pt(h,c,e,i,this.offset),st=Be(h,c,e,i,y,R,T,dt,this.offset);e=st.mainAlign,i=st.crossAlign,l!=null&&o.style.setProperty("width",`${l}px`);const ke=`l-popover-${e}${i===""?"":"-"+i}`,kt=o.className.split(" ");kt[1]!==ke&&(kt[1]=`${ke}`,o.className=kt.join(" "))}},a(ye,"baseName","popover"),f(ye),f(Qt),f(Ce),f(ve),f(be),f(pe),f(me),f(fe),f(ue),f(de),f(he),f(oe),f(ce),f(Ft),f(Bt),f(C),f(qt),f(Wt),f(Ot),f(Kt),f(bt),f(Yt),f(Ut),f(Gt),f(Jt),f(Xt),f(Zt),f(te),f([Pt,jt,Dt]),globalThis.LMessage=lt;function fs(){const s=document.currentScript.src,r=s.lastIndexOf("/"),e=`${s.slice(0,r+1)}litos-ui.css`,i=document.createElement("link");i.rel="stylesheet",i.href=e,i.id="litos-ui-style",document.head.appendChild(i)}fs()})();
@@ -1,38 +1,38 @@
1
- import { regist as a, useId as u } from "../util.js";
2
- import { startTransition as y, endTransition as g } from "ph-utils/dom";
3
- import p from "../icon/mask_close.js";
4
- import h from "../icon/success.js";
5
- import $ from "../icon/warn.js";
6
- import x from "../icon/info.js";
1
+ import { regist as a, useId as y } from "../utils/index.js";
2
+ import { transition as m } from "ph-utils/dom";
3
+ import g from "../icon/mask_close.js";
4
+ import p from "../icon/success.js";
5
+ import h from "../icon/warn.js";
6
+ import $ from "../icon/info.js";
7
+ a(g);
7
8
  a(p);
8
9
  a(h);
9
10
  a($);
10
- a(x);
11
- const r = [], m = [
12
- ["opacity", "0"],
13
- ["transform", "translate3d(-50%, -100%, 0)"]
11
+ const i = [], d = [
12
+ ["opacity", "0", "0.3s"],
13
+ ["transform", "translate3d(-50%, -100%, 0)", "0.3s"]
14
14
  ];
15
- function d(e) {
16
- const t = r.findIndex((o) => o.id === e);
15
+ function u(e) {
16
+ const t = i.findIndex((o) => o.id === e);
17
17
  if (t === -1) return;
18
- const s = r.splice(t, 1)[0];
18
+ const s = i.splice(t, 1)[0];
19
19
  if (s == null) return;
20
- g(s, m, () => {
20
+ m(s, d, "leave", () => {
21
21
  s.remove();
22
22
  });
23
- const i = 15 + s.offsetHeight, n = r.length;
23
+ const r = 15 + s.offsetHeight, n = i.length;
24
24
  if (n !== 0)
25
25
  for (let o = t; o < n; o++) {
26
- const c = r[o], l = parseInt(c.style.top, 10) - i;
27
- c.style.setProperty("top", `${l}px`);
26
+ const c = i[o], f = parseInt(c.style.top, 10) - r;
27
+ c.style.setProperty("top", `${f}px`);
28
28
  }
29
29
  }
30
30
  function v(e) {
31
31
  const t = document.createElement("div");
32
32
  t.id = e.id;
33
33
  const s = e.type || "info";
34
- let i = `l-message l-message-${s}`;
35
- e.customClass && (i += " " + e.customClass), t.className = i, t.style.setProperty("top", `${e.offset}px`), t.style.setProperty("z-index", `${e.zindex || 1e3}`), e.width && t.style.setProperty("width", e.width);
34
+ let r = `l-message l-message-${s}`;
35
+ e.customClass && (r += " " + e.customClass), t.className = r, t.style.setProperty("top", `${e.offset}px`), t.style.setProperty("z-index", `${e.zindex || 1e3}`), e.width && t.style.setProperty("width", e.width);
36
36
  let n = s;
37
37
  return n === "error" && (n = "mask-close"), t.innerHTML = [
38
38
  '<div class="l-message-container">',
@@ -41,25 +41,25 @@ function v(e) {
41
41
  "</div>"
42
42
  ].join(""), t;
43
43
  }
44
- const f = (e) => {
45
- const t = r.reduce(
46
- (c, l) => c + l.offsetHeight + 15,
44
+ const l = (e) => {
45
+ const t = i.reduce(
46
+ (c, f) => c + f.offsetHeight + 15,
47
47
  15
48
- ), s = u(), i = typeof e == "string" ? { message: e } : e;
49
- i.id = s, i.offset = t;
50
- const n = v(i);
51
- r.push(n), document.body.appendChild(n), y(n, m, null);
52
- let o = i.duration;
48
+ ), s = y(), r = typeof e == "string" ? { message: e } : e;
49
+ r.id = s, r.offset = t;
50
+ const n = v(r);
51
+ i.push(n), document.body.appendChild(n), m(n, d, "enter");
52
+ let o = r.duration;
53
53
  return o == null && (o = 3e3), o !== 0 && setTimeout(() => {
54
- d(s);
54
+ u(s);
55
55
  }, o), s;
56
56
  };
57
57
  for (const e of ["info", "success", "error", "warn", "show"])
58
- f[e] = (t) => {
58
+ l[e] = (t) => {
59
59
  const s = typeof t == "string" ? { message: t } : t;
60
- return e !== "show" ? s.type = e : s.type == null && (s.type = "info"), f(s);
60
+ return e !== "show" ? s.type = e : s.type == null && (s.type = "info"), l(s);
61
61
  };
62
- f.close = d;
62
+ l.close = u;
63
63
  export {
64
- f as default
64
+ l as default
65
65
  };
@@ -0,0 +1,9 @@
1
+ import BaseComponent from "../base";
2
+ export default class Polygon extends BaseComponent {
3
+ static baseName: string;
4
+ shape: "triangle-top" | "triangle-bottom" | "triangle-left" | "triangle-right" | "triangle-top-right" | "triangle-top-left" | "triangle-bottom-right" | "triangle-bottom-left";
5
+ background?: string;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ render(): void;
9
+ }
@@ -0,0 +1,30 @@
1
+ var r = Object.defineProperty;
2
+ var l = (o, t, s) => t in o ? r(o, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[t] = s;
3
+ var a = (o, t, s) => l(o, typeof t != "symbol" ? t + "" : t, s);
4
+ import { formatClass as n, formatStyle as c } from "ph-utils/dom";
5
+ import i from "../base.js";
6
+ import { initAttr as p } from "../utils/index.js";
7
+ class d extends i {
8
+ constructor() {
9
+ super();
10
+ a(this, "shape", "triangle-top");
11
+ a(this, "background");
12
+ p(this);
13
+ }
14
+ connectedCallback() {
15
+ this.loadStyle(["polygon"]), super.connectedCallback();
16
+ }
17
+ render() {
18
+ const s = n([
19
+ "l-polygon",
20
+ this.shape ? `l-polygon-${this.shape}` : ""
21
+ ]), e = c([
22
+ this.background ? `--l-polygen-background: ${this.background}` : ""
23
+ ]);
24
+ this.root.innerHTML = `<div part="default" class="${s}" style="${e}"></div>`;
25
+ }
26
+ }
27
+ a(d, "baseName", "polygon");
28
+ export {
29
+ d as default
30
+ };
@@ -0,0 +1,34 @@
1
+ import BaseComponent from "../base";
2
+ type PlacementProp = "top-start" | "top" | "top-end" | "bottom-start" | "bottom" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
3
+ type TriggerProp = "hover" | "click" | "focus";
4
+ export default class Popover extends BaseComponent {
5
+ #private;
6
+ static baseName: string;
7
+ inline: boolean;
8
+ placement: PlacementProp;
9
+ content?: string;
10
+ showArrow: boolean;
11
+ trigger: TriggerProp;
12
+ disabled: boolean;
13
+ isShow: boolean;
14
+ /** 宽度, 'trigger' 表示 popover 的宽度会和它的触发元素一致 */
15
+ width?: string | number;
16
+ /** 隐藏时销毁 DOM 结构 */
17
+ destroyOnHide: boolean;
18
+ /** 浮层偏移量 */
19
+ offset?: number;
20
+ /** 浮层定位方式 */
21
+ position: "absolute" | "fixed";
22
+ theme: "default" | "tooltip";
23
+ private _t?;
24
+ constructor();
25
+ connectedCallback(): void;
26
+ disconnectedCallback(): void;
27
+ render(): HTMLSlotElement;
28
+ renderContent(): void;
29
+ hideContent(): void;
30
+ show($referece?: HTMLElement): void;
31
+ hide(): void;
32
+ toggle($referece?: HTMLElement): void;
33
+ }
34
+ export {};
@@ -0,0 +1,153 @@
1
+ var M = Object.defineProperty;
2
+ var S = (e) => {
3
+ throw TypeError(e);
4
+ };
5
+ var N = (e, i, t) => i in e ? M(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t;
6
+ var s = (e, i, t) => N(e, typeof i != "symbol" ? i + "" : i, t), T = (e, i, t) => i.has(e) || S("Cannot " + t);
7
+ var o = (e, i, t) => (T(e, i, "read from private field"), t ? t.call(e) : i.get(e)), d = (e, i, t) => i.has(e) ? S("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t);
8
+ var g = (e, i, t) => (T(e, i, "access private method"), t);
9
+ import j from "../base.js";
10
+ import { initAttr as D, useId as X, getPopoverOffsetY as Y, getPopoverOffsetX as q, impactDetect as z } from "../utils/index.js";
11
+ import { set as F, remove as G } from "../utils/clickoutside.js";
12
+ import { $one as f, $$ as x, on as m, off as u } from "ph-utils/dom";
13
+ var r, A, E, $, h, c, v, L, R;
14
+ class J extends j {
15
+ constructor() {
16
+ super();
17
+ d(this, r);
18
+ s(this, "inline", !1);
19
+ s(this, "placement", "top");
20
+ s(this, "content");
21
+ s(this, "showArrow", !0);
22
+ s(this, "trigger", "hover");
23
+ s(this, "disabled", !1);
24
+ s(this, "isShow", !1);
25
+ /** 宽度, 'trigger' 表示 popover 的宽度会和它的触发元素一致 */
26
+ s(this, "width");
27
+ /** 隐藏时销毁 DOM 结构 */
28
+ s(this, "destroyOnHide", !1);
29
+ /** 浮层偏移量 */
30
+ s(this, "offset");
31
+ /** 浮层定位方式 */
32
+ s(this, "position", "absolute");
33
+ s(this, "theme", "default");
34
+ s(this, "_t");
35
+ d(this, $, (t) => {
36
+ t.target.id !== this.id && this.hide();
37
+ });
38
+ d(this, h, (t) => {
39
+ this.show(t.target);
40
+ });
41
+ d(this, c, () => {
42
+ this.hide();
43
+ });
44
+ d(this, v, (t) => {
45
+ this.trigger === "click" ? this.toggle(t.target) : this.trigger === "focus" && this.show(t.target);
46
+ });
47
+ D(this), this.id || (this.id = `${X()}-popover`), this.style.display = this.inline ? "inline-block" : "block";
48
+ }
49
+ connectedCallback() {
50
+ this.loadStyle(["popover"]), super.connectedCallback(), this.renderContent(), g(this, r, A).call(this);
51
+ }
52
+ disconnectedCallback() {
53
+ super.disconnectedCallback(), g(this, r, E).call(this);
54
+ }
55
+ render() {
56
+ const t = document.createElement("slot");
57
+ return t.setAttribute("name", "trigger"), t;
58
+ }
59
+ renderContent() {
60
+ if (!this.isShow) return;
61
+ let t = f(".l-popover--content", this.root);
62
+ if (t) {
63
+ t.style.removeProperty("display");
64
+ return;
65
+ }
66
+ if (t = x("div", {
67
+ class: [
68
+ "l-popover--content",
69
+ `l-popover-${this.placement}`,
70
+ this.theme === "tooltip" ? "l-popover-tooltip" : void 0
71
+ ]
72
+ }), this.offset && (t.style.cssText = "--l-popover-offset: ${this.offset}px;"), t.part = "content", t.innerHTML = this.content ? this.content : "<slot></slot>", this.showArrow) {
73
+ const n = x("div", {
74
+ class: "l-popover--arrow"
75
+ });
76
+ t.appendChild(n);
77
+ }
78
+ this.trigger === "hover" && (m(t, "mouseenter", o(this, h)), m(t, "mouseleave", o(this, c))), this.root.appendChild(t);
79
+ }
80
+ hideContent() {
81
+ const t = f(".l-popover--content", this.root);
82
+ t && (this.destroyOnHide ? (this.trigger === "hover" && (u(t, "mouseenter", o(this, h)), u(t, "mouseleave", o(this, c))), this.root.removeChild(t)) : t.style.display = "none");
83
+ }
84
+ show(t) {
85
+ if (!this.disabled) {
86
+ if (this.isShow) {
87
+ g(this, r, L).call(this);
88
+ return;
89
+ }
90
+ this.isShow = !0, this.renderContent(), g(this, r, R).call(this, t);
91
+ }
92
+ }
93
+ hide() {
94
+ this._t = setTimeout(() => {
95
+ this.isShow = !1, this.hideContent();
96
+ }, 50);
97
+ }
98
+ toggle(t) {
99
+ this.isShow ? this.hide() : this.show(t);
100
+ }
101
+ }
102
+ r = new WeakSet(), A = function() {
103
+ const t = f('[slot="trigger"]', this);
104
+ t && (this.trigger === "hover" ? (m(t, "mouseenter", o(this, h)), m(t, "mouseleave", o(this, c))) : (this.trigger === "click" || this.trigger === "focus") && (m(t, "click", o(this, v)), F(t, o(this, $))));
105
+ }, E = function() {
106
+ const t = f('[slot="trigger"]', this);
107
+ t && (this.trigger === "hover" ? (u(t, "mouseenter", o(this, h)), u(t, "mouseleave", o(this, c))) : (this.trigger === "click" || this.trigger === "focus") && (u(t, "click", o(this, v)), G(t)));
108
+ }, $ = new WeakMap(), h = new WeakMap(), c = new WeakMap(), v = new WeakMap(), L = function() {
109
+ this._t && (clearTimeout(this._t), this._t = void 0);
110
+ }, R = function(t) {
111
+ let n = "bottom", l = "";
112
+ const y = this.placement.split("-");
113
+ y != null && (n = y[0], l = y[1] || "");
114
+ let a;
115
+ t == null && (t = f('[slot="trigger"]', this));
116
+ const p = f(".l-popover--content", this.root);
117
+ if (p) {
118
+ let w = p.getBoundingClientRect();
119
+ const C = t.getBoundingClientRect();
120
+ let k = document.documentElement;
121
+ const _ = k.scrollLeft, H = k.scrollTop;
122
+ this.width != null && (this.width === "trigger" ? a = C.width : a = this.width), a != null && (w.width = a);
123
+ const B = Y(
124
+ C,
125
+ w,
126
+ n,
127
+ l,
128
+ this.offset
129
+ ), I = q(
130
+ C,
131
+ w,
132
+ n,
133
+ l,
134
+ this.offset
135
+ ), O = z(
136
+ C,
137
+ w,
138
+ n,
139
+ l,
140
+ _,
141
+ H,
142
+ I,
143
+ B,
144
+ this.offset
145
+ );
146
+ n = O.mainAlign, l = O.crossAlign, a != null && p.style.setProperty("width", `${a}px`);
147
+ const P = `l-popover-${n}${l === "" ? "" : "-" + l}`, b = p.className.split(" ");
148
+ b[1] !== P && (b[1] = `${P}`, p.className = b.join(" "));
149
+ }
150
+ }, s(J, "baseName", "popover");
151
+ export {
152
+ J as default
153
+ };
@@ -17,6 +17,7 @@ export default class Radio extends FormInner {
17
17
  disconnectedCallback(): void;
18
18
  protected attributeChange(name: string, oldValue: string, newValue: string): void;
19
19
  render(): void;
20
+ setValue(value: any): void;
20
21
  private _renderItems;
21
22
  private _renderItem;
22
23
  private _isChecked;