UNPKG

@lekseek/ui

Version:

Vue 3 components library

1 lines 166 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_e="__v-click-outside",sn=typeof window<"u",an=typeof navigator<"u",rn=sn&&("ontouchstart"in window||an&&navigator.msMaxTouchPoints>0),un=rn?["touchstart"]:["click"],cn=t=>{const n=typeof t=="function";if(!n&&typeof t!="object")throw new Error("v-click-outside: Binding value must be a function or an object");return{handler:n?t:t.handler,middleware:t.middleware||(o=>o),events:t.events||un,isActive:t.isActive!==!1}},dn=({el:t,event:n,handler:o,middleware:l})=>{const s=n.path||n.composedPath&&n.composedPath();(s?s.indexOf(t)<0:!t.contains(n.target))&&l(n)&&o(n)},Bt=(t,{value:n})=>{const{events:o,handler:l,middleware:s,isActive:i}=cn(n);!i||(t[_e]=o.map(a=>({event:a,handler:r=>dn({event:r,el:t,handler:l,middleware:s})})),t[_e].forEach(({event:a,handler:r})=>setTimeout(()=>{!t[_e]||document.documentElement.addEventListener(a,r,!1)},0)))},Et=t=>{(t[_e]||[]).forEach(({event:o,handler:l})=>document.documentElement.removeEventListener(o,l,!1)),delete t[_e]},mn=(t,{value:n,oldValue:o})=>{JSON.stringify(n)!==JSON.stringify(o)&&(Et(t),Bt(t,{value:n}))},Ne={beforeMount:Bt,updated:mn,unmounted:Et};function qe(t,n,o){return`${t}${n?`__${n}`:""}${o?`--${o}`:""}`}const fn={asyncContent:{errorText:"Something went wrong",reloadText:"Try again"},autocomplete:{noMatchingItems:"No matching items"},infiniteScroll:{loadingText:"Loading...",completeText:"That is all!",errorText:"Loading data failed"},phoneInput:{errorText:"Type valid phone number"},pagination:{page:"Page",total:"of"},select:{placeholder:"Select",search:"Search",noMatchingItems:"No matching items"},image:{downloadFailed:"Image download failed",checkNetwork:"Check your network connection and try again",downloadImage:"Download image"},fileUploader:{selectFromDisk:"Select from disk",dropAreaText:"Move the file here",dropAreaTextWhenDragging:"Drop the file",dropAreaTextWhenDisabled:"Area disabled",title:"File add",validationError:"Invalid file",sizeError:"Invalid file size"},weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],timeline:{noItems:"No items to show"},table:{loading:"Loading",noItems:"No items to show"}},pn={asyncContent:{errorText:"Co\u015B posz\u0142o nie tak.",reloadText:"Spr\xF3buj ponownie"},autocomplete:{noMatchingItems:"Brak pasuj\u0105cych wynik\xF3w"},infiniteScroll:{loadingText:"\u0141adowanie danych",completeText:"To ju\u017C wszystko!",errorText:"B\u0142\u0105d \u0142adowania danych"},phoneInput:{errorText:"Podaj poprawny numer"},pagination:{page:"Strona:",total:"z"},select:{placeholder:"Wybierz",search:"Szukaj",noMatchingItems:"Brak pasuj\u0105cych wynik\xF3w"},image:{downloadFailed:"Nie uda\u0142o si\u0119 pobra\u0107 grafiki",checkNetwork:"Sprawd\u017A, czy masz po\u0142\u0105czenie z Internetem i spr\xF3buj ponownie",downloadImage:"Pobierz grafik\u0119"},fileUploader:{selectFromDisk:"Wybierz z dysku",dropAreaText:"Przeci\u0105gnij plik tutaj",dropAreaTextWhenDragging:"Upu\u015B\u0107 plik",dropAreaTextWhenDisabled:"Obszar nieaktywny",title:"Dodawanie pliku",validationError:"Plik jest nieprawid\u0142owy",sizeError:"Nieprawid\u0142owy rozmiar pliku"},weekdays:["Poniedzia\u0142ek","Wtorek","\u015Aroda","Czwartek","Pi\u0105tek","Sobota","Niedziela"],months:["Stycze\u0144","Luty","Marzec","Kwiecie\u0144","Maj","Czerwiec","Lipiec","Sierpie\u0144","Wrzesie\u0144","Pa\u017Adziernik","Listopad","Grudzie\u0144"],timeline:{noItems:"Brak element\xF3w do wy\u015Bwietlenia"},table:{loading:"\u0141adowanie danych",noItems:"Brak element\xF3w do wy\u015Bwietlenia"}},hn={asyncContent:{errorText:"\u0412\u0438\u043D\u0438\u043A\u043B\u0430 \u043F\u043E\u043C\u0438\u043B\u043A\u0430.",reloadText:"\u0421\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437"},autocomplete:{noMatchingItems:"\u041D\u0435\u043C\u0430\u0454 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u043D\u0438\u0445 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0456\u0432"},infiniteScroll:{loadingText:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0434\u0430\u043D\u0438\u0445",completeText:"\u0426\u0435 \u0432\u0441\u0435!",errorText:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u0456 \u0434\u0430\u043D\u0438\u0445"},phoneInput:{errorText:"\u0412\u0432\u0435\u0434\u0456\u0442\u044C \u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u043D\u043E\u043C\u0435\u0440"},pagination:{page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430:",total:"\u0437"},select:{placeholder:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",search:"\u041F\u043E\u0448\u0443\u043A",noMatchingItems:"\u041D\u0435\u043C\u0430\u0454 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u043D\u0438\u0445 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0456\u0432"},image:{downloadFailed:"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F",checkNetwork:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043E \u0432\u0438 \u0434\u043E \u0406\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0443, \u0456 \u043F\u043E\u0432\u0442\u043E\u0440\u0456\u0442\u044C \u0441\u043F\u0440\u043E\u0431\u0443",downloadImage:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0456\u043B\u044E\u0441\u0442\u0440\u0430\u0446\u0456\u044E"},fileUploader:{selectFromDisk:"\u0412\u0438\u0431\u0435\u0440\u0430\u0442\u0438 \u0437 \u0434\u0438\u0441\u043A\u0430",dropAreaText:"\u041F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0444\u0430\u0439\u043B \u0441\u044E\u0434\u0438",dropAreaTextWhenDragging:"\u0421\u043A\u0438\u043D\u044C\u0442\u0435 \u0444\u0430\u0439\u043B",dropAreaTextWhenDisabled:"\u041D\u0435\u0430\u043A\u0442\u0438\u0432\u043D\u0430 \u0437\u043E\u043D\u0430",title:"\u0414\u043E\u0434\u0430\u0432\u0430\u043D\u043D\u044F \u0444\u0430\u0439\u043B\u0443",validationError:"\u0424\u0430\u0439\u043B \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439",sizeError:"\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440 \u0444\u0430\u0439\u043B\u0443"},weekdays:["\u041F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A","\u0412\u0456\u0432\u0442\u043E\u0440\u043E\u043A","\u0421\u0435\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440","\u041F'\u044F\u0442\u043D\u0438\u0446\u044F","\u0421\u0443\u0431\u043E\u0442\u0430","\u041D\u0435\u0434\u0456\u043B\u044F"],months:["\u0421\u0456\u0447\u0435\u043D\u044C","\u041B\u044E\u0442\u0438\u0439","\u0411\u0435\u0440\u0435\u0437\u0435\u043D\u044C","\u041A\u0432\u0456\u0442\u0435\u043D\u044C","\u041C\u0430\u0439","\u0427\u0435\u0440\u0432\u0435\u043D\u044C","\u041B\u0438\u043F\u0435\u043D\u044C","\u0421\u0435\u0440\u043F\u0435\u043D\u044C","\u0412\u0435\u0440\u0435\u0441\u0435\u043D\u044C","\u0416\u043E\u0432\u0442\u0435\u043D\u044C","\u041B\u0438\u0441\u0442\u043E\u043F\u0430\u0434","\u0413\u0440\u0443\u0434\u0435\u043D\u044C"],timeline:{noItems:"\u041D\u0435\u043C\u0430\u0454 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u0434\u043B\u044F \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F"},table:{loading:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0434\u0430\u043D\u0438\u0445",noItems:"\u041D\u0435\u043C\u0430\u0454 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u0434\u043B\u044F \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F"}};var Oe=(t=>(t.PL="pl",t.EN="en",t.UK="uk",t))(Oe||{});const ie={left:"left",right:"right",top:"top",bottom:"bottom"},gn={locale:Oe.PL,locales:{[Oe.PL]:pn,[Oe.EN]:fn,[Oe.UK]:hn},t(){return this.locales[this.locale]}},bn={icons:{prefix:"fa-",type:"fa",values:{edit:"edit",error:"exclamation-triangle",spinner:"spinner",check:"check",previous:"chevron-left",next:"chevron-right",expand:"chevron-down",collapse:"chevron-up",file:"file-import",close:"times",hamburger:"bars"}}},vn={test:{elAttrName:"data-test",elNamePrefix:""},testElName(t){return{[this.test.elAttrName]:`${this.test.elNamePrefix}${t}`}}},yn={chartColors:{red:"#e02020",green:"#95c11e",gray:"#717171"}},dt={bem:{hyphenate:!0},...vn,...gn,...bn,...yn},nt=Symbol("ui");function kn(t,n={}){const o=n.bem||dt.bem;t.mixin({name:"BemMixin",methods:{$bem({b:s,e:i,m:a}){const r=p=>p.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),u=this.$options.name,y=s||o.hyphenate?r(u):u,c=a?typeof a=="string"?[a]:Array.isArray(a)?a:Object.keys(a).filter(p=>a[p]):[],b=qe(y,i),v=c.map(p=>qe(y,i,p));return[b,...v]}}});const l=e.reactive({...dt,...n});t.config.globalProperties.$ui=l,t.provide(nt,l)}function J(t,n=!0){function o({b:l,e:s,m:i}){const a=v=>v.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),r=t,u=l||n?a(r):r,y=i?typeof i=="string"?[i]:Array.isArray(i)?i:Object.keys(i).filter(v=>i[v]):[],c=qe(u,s),b=y.map(v=>qe(u,s,v));return[c,...b]}return o}const ze=(t,n)=>n?`has-${t}-${n}`:null,Ye=t=>ze("color",t),fe=t=>ze("bg-color",t),Cn=t=>ze("hover-color",t),St=t=>ze("hover-bg-color",t),Nt=t=>ze("border-color",t),$n=t=>ze("gradient",t),wt="is-elevated",ot="is-hoverable",we={bordered:{type:Boolean,default:!1}};function he(t){return e.computed(()=>({"is-bordered":t.value}))}const Ze={elevated:{type:Boolean,default:!1}};function Ue(t){return e.computed(()=>({"is-elevated":t.value}))}const Tt={depressed:{type:Boolean,default:!1}};function Lt(t){return e.computed(()=>({"is-depressed":t.value}))}const Ce={rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1}};function ue(t,n,o){return e.computed(()=>({"is-rounded":t.value,"is-rounded-lg":n.value,"is-round":(o==null?void 0:o.value)||!1}))}const $e={dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1}};function ce(t,n){return e.computed(()=>({"is-dark":t.value,"is-light":n.value}))}const Bn={to:{type:[Object,String],default:null},href:{type:String,default:null},newWindow:{type:Boolean,default:!1}};function It(t,n,o){return{component:e.computed(()=>t.value?"RouterLink":n.value?"a":"span"),target:e.computed(()=>o.value?"_blank":"_self")}}const lt={error:{type:Boolean,default:!1}};function Vt(t){return{validationBorderClass:e.computed(()=>({"is-bordered":t.value,"has-border-color-error":t.value}))}}const En={padding:{type:String,default:null}};function Sn(t){return e.computed(()=>({[`has-padding-${t.value}`]:t.value}))}const st={size:{type:String,default:"md"}},Nn={name:"LsIcon"},le=e.defineComponent({...Nn,props:{name:{default:""},prefix:{default:""},type:{default:""},size:{default:null},rotate:{default:null},flip:{default:null},pulse:{type:Boolean,default:!1},spin:{type:Boolean,default:!1}},setup(t){const n=t,o=J("ls-icon"),l=ae(),s=e.computed(()=>n.prefix||l.icons.prefix),i=e.computed(()=>n.type||l.icons.type),a=e.computed(()=>{let r=[];return r=[`${s.value}${n.name}`,i.value],[...o({m:{[`size-${n.size}`]:!!n.size,[`rotate-${n.rotate}`]:!!n.rotate,[`flip-${n.flip}`]:!!n.flip,pulse:n.pulse,spin:n.spin}}),...r]});return(r,u)=>(e.openBlock(),e.createElementBlock("i",e.mergeProps({class:e.unref(a)},e.unref(l).testElName("icon")),[e.renderSlot(r.$slots,"default")],16))}});const wn=e.defineComponent({name:"LsSpinner",components:{LsIcon:le},props:{size:{type:String,default:"3x"}}}),K=(t,n)=>{const o=t.__vccOpts||t;for(const[l,s]of n)o[l]=s;return o};function Tn(t,n,o,l,s,i){const a=e.resolveComponent("LsIcon");return e.openBlock(),e.createBlock(a,e.mergeProps({name:t.$ui.icons.values.spinner,spin:"",size:t.size},t.$ui.testElName("spinner")),null,16,["name","size"])}const We=K(wn,[["render",Tn]]),Ln=["title","disabled"],In={name:"LsButton"},be=e.defineComponent({...In,props:{color:{default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},leftIcon:{default:null},rightIcon:{default:null},title:{default:null},block:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},uppercase:{type:Boolean,default:!1},gradient:{default:null},theme:{default:null},dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},elevated:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1},to:{default:null},href:{default:null},newWindow:{type:Boolean,default:!1},size:{default:"md"}},setup(t){const n=t,{dark:o,light:l,bordered:s,rounded:i,roundedLg:a,round:r,to:u,href:y,newWindow:c,elevated:b}=e.toRefs(n),{component:v,target:p}=It(u,y,c),N=J("ls-button"),U=ae(),P=ce(o,l),D=he(s),O=ue(i,a,r),d=Ue(b),k=e.computed(()=>{let h=[];const f=n.color&&n.color!=="default"?n.color:null;if(f){const B=`${f}-darken-1`;h=n.plain?[Ye(f),Cn(B)]:[fe(f),St(B)]}return[...h,...N({m:{[n.size]:!0,disabled:n.disabled||n.loading,block:n.block,[`gradient-${n.gradient}`]:!!n.gradient,uppercase:n.uppercase,[`theme-${n.theme}`]:!!n.theme}}),{[ot]:n.hoverable},P.value,D.value,O.value,d.value]});return(h,f)=>{var B;return e.openBlock(),e.createElementBlock("button",e.mergeProps({title:(B=t.title)!=null?B:void 0,class:e.unref(k),type:"button",disabled:t.disabled||t.loading},e.unref(U).testElName("button")),[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)),{to:e.unref(u),href:e.unref(y),target:e.unref(p),rel:e.unref(c)?"noopener":"",class:e.normalizeClass(e.unref(N)({e:"container",m:{"with-icons":!!t.leftIcon||!!t.rightIcon}}))},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"container",{},()=>[t.leftIcon?(e.openBlock(),e.createBlock(e.unref(le),{key:0,name:t.leftIcon,class:e.normalizeClass(e.unref(N)({e:"icon"}))},null,8,["name","class"])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(N)({e:"content"}))},[e.renderSlot(h.$slots,"default"),t.loading?(e.openBlock(),e.createBlock(e.unref(We),{key:0,color:e.unref(o)?"white":"default",class:e.normalizeClass(e.unref(N)({e:"loader"})),size:"1x"},null,8,["color","class"])):e.createCommentVNode("",!0)],2),t.rightIcon?(e.openBlock(),e.createBlock(e.unref(le),{key:1,name:t.rightIcon,class:e.normalizeClass(e.unref(N)({e:"icon"}))},null,8,["name","class"])):e.createCommentVNode("",!0)])]),_:3},8,["to","href","target","rel","class"]))],16,Ln)}}});const Vn={key:0},An={name:"LsAsyncContent"},At=e.defineComponent({...An,props:{loading:{type:Boolean,default:!0},spinnerSize:{default:"2x"},loadingText:{default:""},error:{type:Boolean,default:!1},errorText:{default:""},reloadable:{type:Boolean,default:!1},reloadText:{default:""}},emits:["reload"],setup(t,{emit:n}){const o=t,l=J("ls-async-content"),s=ae(),i=e.computed(()=>o.errorText||s.t().asyncContent.errorText),a=e.computed(()=>o.reloadText||s.t().asyncContent.reloadText),r=()=>n("reload");return(u,y)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(l)({})},e.unref(s).testElName("async-content")),[t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(l)({e:"loading-wrapper"}))},[e.renderSlot(u.$slots,"loader",{},()=>[e.createVNode(e.unref(We),{class:e.normalizeClass(e.unref(l)({e:"loader"})),size:t.spinnerSize},null,8,["class","size"])]),e.createElementVNode("p",{class:e.normalizeClass(e.unref(l)({e:"loading-text"}))},e.toDisplayString(t.loadingText),3)],2)):t.error?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(l)({e:"error-wrapper"}))},[e.createVNode(e.unref(le),{class:e.normalizeClass(e.unref(l)({e:"error-icon"})),size:"3x",name:e.unref(s).icons.values.error},null,8,["class","name"]),e.createElementVNode("p",{class:e.normalizeClass(e.unref(l)({e:"error-text"}))},e.toDisplayString(e.unref(i)),3),t.reloadable?(e.openBlock(),e.createBlock(e.unref(be),e.mergeProps({key:0,color:"primary",rounded:"",dark:"",class:e.unref(l)({e:"reload-button"})},e.unref(s).testElName("async-content-reload"),{onClick:r}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1},16,["class"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"slide"},{default:e.withCtx(()=>[!t.loading&&!t.error?(e.openBlock(),e.createElementBlock("div",Vn,[e.renderSlot(u.$slots,"default")])):e.createCommentVNode("",!0)]),_:3})],16))}});const Dn=e.defineComponent({name:"LsInput",components:{LsIcon:le},props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:null},type:{type:String,default:"text"},required:{type:Boolean,default:!1},min:{type:Number,default:null},max:{type:Number,default:null},maxlength:{type:Number,default:null},step:{type:Number,default:1},label:{type:String,default:null},width:{type:Number,default:null},leftIcon:{type:String,default:null},rightIcon:{type:String,default:null},leftIconClickable:{type:Boolean,default:!1},rightIconClickable:{type:Boolean,default:!1},leftIconColor:{type:String,default:null},rightIconColor:{type:String,default:null},rememberCaretPosition:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},...$e,...we,...Ce,...lt,...Tt,...st},emits:["update:modelValue","enter","focus","blur","click-left-icon","click-right-icon","click","mouseenter","mouseleave","input"],setup(t){const{dark:n,light:o,bordered:l,rounded:s,roundedLg:i,round:a,error:r,depressed:u}=e.toRefs(t),{validationBorderClass:y}=Vt(r);return{themeClass:ce(n,o),borderedClass:he(l),roundedClass:ue(s,i,a),depressedClass:Lt(u),validationBorderClass:y}},data(){return{isFocused:!1}},computed:{widthStyle(){return this.width?{width:`${this.width}px`}:{}},styles(){return{...this.widthStyle}},classes(){return[...this.$bem({m:{[this.size]:!0,light:this.light,dark:this.dark,disabled:this.disabled,round:this.round,rounded:this.rounded,"rounded-lg":this.roundedLg}}),{[wt]:this.isFocused},this.borderedClass,this.validationBorderClass,this.roundedClass,this.depressedClass]}},methods:{setFocusStatus(t){this.isFocused=t},onFocus(){this.setFocusStatus(!0),this.$emit("focus")},onBlur(t){this.setFocusStatus(!1),this.$emit("blur",t)},onInput(t){const n=t.target.value;this.$emit("update:modelValue",n),this.$emit("input",n)},enter(t){const n=t.target.value;this.$emit("enter",n)},onLeftIconClick(){this.leftIconClickable&&this.$emit("click-left-icon")},onRightIconClick(){this.rightIconClickable&&this.$emit("click-right-icon")},focus(){this.$refs.input.focus()}}});const Mn=["autofocus","type","min","max","maxlength","required","step","value","readonly","placeholder","disabled"];function zn(t,n,o,l,s,i){var r,u,y;const a=e.resolveComponent("LsIcon");return e.openBlock(),e.createElementBlock("span",e.mergeProps({class:t.classes,style:t.styles},t.$ui.testElName("input")),[e.renderSlot(t.$slots,"before"),t.leftIcon?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0,class:[...t.$bem({e:"icon",m:{clickable:t.leftIconClickable,round:t.round}}),t.roundedClass]},t.$ui.testElName("input-icon-left"),{onClick:n[0]||(n[0]=(...c)=>t.onLeftIconClick&&t.onLeftIconClick(...c))}),[e.createVNode(a,{name:t.leftIcon,color:t.leftIconColor},null,8,["name","color"])],16)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(t.$bem({e:"content",m:{disabled:t.disabled,["left-padding"]:!t.leftIcon,["right-padding"]:!t.rightIcon}}))},[t.label&&(t.modelValue||t.placeholder)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.$bem({e:"label"}))},e.toDisplayString(t.label),3)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"before-text"),e.createElementVNode("input",e.mergeProps({ref:"input",autofocus:t.autofocus,type:t.type,min:(r=t.min)!=null?r:void 0,max:(u=t.max)!=null?u:void 0,maxlength:(y=t.maxlength)!=null?y:void 0,required:t.required,step:t.step,value:t.modelValue||void 0,readonly:t.readonly,placeholder:t.placeholder||t.label||void 0,class:t.$bem({e:"input",m:{"with-label":!!t.label&&(!!t.modelValue||!!t.placeholder)}}),disabled:t.disabled,"data-test":"field"},t.$ui.testElName("input-field"),{onInput:n[1]||(n[1]=(...c)=>t.onInput&&t.onInput(...c)),onFocus:n[2]||(n[2]=(...c)=>t.onFocus&&t.onFocus(...c)),onBlur:n[3]||(n[3]=(...c)=>t.onBlur&&t.onBlur(...c)),onKeydown:n[4]||(n[4]=e.withKeys((...c)=>t.enter&&t.enter(...c),["enter"])),onClick:n[5]||(n[5]=c=>t.$emit("click")),onMouseenter:n[6]||(n[6]=c=>t.$emit("mouseenter")),onMouseleave:n[7]||(n[7]=c=>t.$emit("mouseleave"))}),null,16,Mn),e.renderSlot(t.$slots,"after-text")],2),t.rightIcon?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:[...t.$bem({e:"icon",m:{clickable:t.rightIconClickable,round:t.round}}),t.roundedClass]},t.$ui.testElName("input-icon-right"),{onClick:n[8]||(n[8]=(...c)=>t.onRightIconClick&&t.onRightIconClick(...c))}),[e.createVNode(a,{name:t.rightIcon,color:t.rightIconColor},null,8,["name","color"])],16)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],16)}const Ee=K(Dn,[["render",zn]]),Rn=e.defineComponent({name:"LsTextarea",components:{LsIcon:le},props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:null},type:{type:String,default:"text"},required:{type:Boolean,default:!1},maxlength:{type:Number,default:null},rows:{type:Number,default:null},label:{type:String,default:null},leftIcon:{type:String,default:null},rightIcon:{type:String,default:null},leftIconClickable:{type:Boolean,default:!1},rightIconClickable:{type:Boolean,default:!1},leftIconColor:{type:String,default:null},rightIconColor:{type:String,default:null},width:{type:Number,default:null},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},...$e,...we,...Ce,...lt,...Tt,...st},emits:["enter","focus","blur","update:modelValue","click-left-icon","click-right-icon","enter-no-shift","enter-shift","input"],setup(t){const{dark:n,light:o,bordered:l,rounded:s,roundedLg:i,round:a,error:r,depressed:u}=e.toRefs(t),{validationBorderClass:y}=Vt(r);return{themeClass:ce(n,o),borderedClass:he(l),roundedClass:ue(s,i,a),depressedClass:Lt(u),validationBorderClass:y}},data(){return{isFocused:!1}},computed:{widthStyle(){return this.width?{width:`${this.width}px`}:{}},styles(){return{...this.widthStyle}},classes(){return[...this.$bem({m:{[this.size]:!0,light:this.light,dark:this.dark,disabled:this.disabled,rounded:this.rounded,"rounded-lg":this.roundedLg,round:this.round}}),{[wt]:this.isFocused},this.borderedClass,this.validationBorderClass,this.roundedClass,this.depressedClass]}},methods:{setFocusStatus(t){this.isFocused=t},onFocus(){this.setFocusStatus(!0),this.$emit("focus")},onBlur(){this.setFocusStatus(!1),this.$emit("blur")},input(t){const n=t.target.value;this.$emit("update:modelValue",n),this.$emit("input",n)},onLeftIconClick(){this.leftIconClickable&&this.$emit("click-left-icon")},onRightIconClick(){this.rightIconClickable&&this.$emit("click-right-icon")},enter(t){const n=t.target.value;t.shiftKey?this.$emit("enter-shift",t):this.$emit("enter-no-shift",t),this.$emit("enter",n)},focus(){this.$refs.textarea.focus()}}});const On=["readonly","autofocus","rows","required","value","placeholder","maxlength","disabled"];function Pn(t,n,o,l,s,i){var r;const a=e.resolveComponent("LsIcon");return e.openBlock(),e.createElementBlock("span",e.mergeProps({class:t.classes,style:t.styles},t.$ui.testElName("textarea")),[e.renderSlot(t.$slots,"before"),t.leftIcon?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0,class:["is-hoverable",[...t.$bem({e:"icon",m:{clickable:t.leftIconClickable,round:t.round}}),t.roundedClass]]},t.$ui.testElName("textarea-icon-left"),{onClick:n[0]||(n[0]=(...u)=>t.onLeftIconClick&&t.onLeftIconClick(...u))}),[e.createVNode(a,{name:t.leftIcon,color:t.leftIconColor},null,8,["name","color"])],16)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(t.$bem({e:"content",m:{disabled:t.disabled,["left-padding"]:!t.leftIcon,["right-padding"]:!t.rightIcon}}))},[t.label&&(t.modelValue||t.placeholder)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.$bem({e:"label"}))},e.toDisplayString(t.label),3)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"before-text"),e.createElementVNode("textarea",e.mergeProps({ref:"textarea",readonly:t.readonly,autofocus:t.autofocus,rows:t.rows,required:t.required,value:t.modelValue||void 0,placeholder:t.placeholder||t.label||void 0,maxlength:(r=t.maxlength)!=null?r:void 0,class:t.$bem({e:"textarea",m:{"with-label":!!t.label&&(!!t.modelValue||!!t.placeholder)}}),"data-test":"field",disabled:t.disabled},t.$ui.testElName("textarea-field"),{onInput:n[1]||(n[1]=(...u)=>t.input&&t.input(...u)),onFocus:n[2]||(n[2]=(...u)=>t.onFocus&&t.onFocus(...u)),onBlur:n[3]||(n[3]=(...u)=>t.onBlur&&t.onBlur(...u)),onKeydown:n[4]||(n[4]=e.withKeys((...u)=>t.enter&&t.enter(...u),["enter"]))}),null,16,On),e.renderSlot(t.$slots,"after-text")],2),t.rightIcon?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:["is-hoverable",[...t.$bem({e:"icon",m:{clickable:t.rightIconClickable,round:t.round}}),t.roundedClass]]},t.$ui.testElName("textarea-icon-right"),{onClick:n[5]||(n[5]=(...u)=>t.onRightIconClick&&t.onRightIconClick(...u))}),[e.createVNode(a,{name:t.rightIcon,color:t.rightIconColor},null,8,["name","color"])],16)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],16)}const Dt=K(Rn,[["render",Pn]]),_n=["disabled"],Fn={name:"LsBadge"},at=e.defineComponent({...Fn,props:{color:{default:null},disabled:{type:Boolean,default:!1},size:{default:"md"},dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},elevated:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const o=t,{dark:l,light:s,bordered:i,elevated:a,rounded:r,roundedLg:u}=e.toRefs(o),y=J("ls-badge"),c=ae(),b=ce(l,s),v=he(i),p=ue(r,u),N=Ue(a),U=e.computed(()=>[...o.color?[fe(o.color),Ye("white")]:[],...y({m:{[o.size]:!0,disabled:o.disabled,round:o.round}}),b.value,v.value,N.value,p.value]);return(P,D)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({disabled:t.disabled,class:e.unref(U)},e.unref(c).testElName("badge")),[e.renderSlot(P.$slots,"default")],16,_n))}});const Hn={name:"LsIconButton"},pe=e.defineComponent({...Hn,props:{icon:{default:""},iconType:{default:void 0},iconPrefix:{default:void 0},disabled:{type:Boolean,default:!1},color:{default:"default"},title:{default:null},loading:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},gradient:{default:null},theme:{default:null},bordered:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1},size:{default:"md"}},setup(t){const n=t,o=J("ls-icon-button"),l=e.computed(()=>{const s=[n.size];return o({m:s})});return(s,i)=>(e.openBlock(),e.createBlock(e.unref(be),e.mergeProps({class:e.unref(l),bordered:t.bordered,light:t.light,dark:t.dark,rounded:t.rounded,"rounded-lg":t.roundedLg,round:t.round,color:t.color,disabled:t.disabled,size:t.size,title:t.title,loading:t.loading,plain:t.plain,hoverable:t.hoverable,gradient:t.gradient,theme:t.theme},s.$ui.testElName("icon-button")),{container:e.withCtx(()=>[t.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(le),{key:0,name:t.icon,type:t.iconType,prefix:t.iconPrefix},null,8,["name","type","prefix"])),e.renderSlot(s.$slots,"default")]),_:3},16,["class","bordered","light","dark","rounded","rounded-lg","round","color","disabled","size","title","loading","plain","hoverable","gradient","theme"]))}});const Un=["data-item-key"],Wn=["onClick"],xn={name:"LsAutocomplete"},Gn=e.defineComponent({...xn,props:{modelValue:{default:null},items:null,placeholder:{default:null},type:{default:"text"},required:{type:Boolean,default:!1},min:{default:null},max:{default:null},maxlength:{default:null},step:{default:1},label:{default:null},width:{default:null},leftIcon:{default:null},leftIconClickable:{type:Boolean,default:!1},leftIconColor:{default:null},disabled:{type:Boolean,default:!1},maxHeight:{default:320},listPosition:{default:"bottom"},itemsLoading:{type:Boolean,default:!1},itemsError:{type:Boolean,default:!1},itemsReloadable:{type:Boolean,default:!1},textarea:{type:Boolean,default:!1},rows:{default:null},noMatchingItemsText:{default:""},external:{type:Boolean,default:!1},searchDelay:{default:0},multiple:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1},error:{type:Boolean,default:!1},depressed:{type:Boolean,default:!1},size:{default:"md"}},emits:["update:model-value","enter","focus","blur","click-left-icon","click-right-icon","select","update","reload","search"],setup(t,{emit:n}){const o=t,l=J("ls-autocomplete"),s=ae(),{dark:i,light:a,bordered:r,rounded:u,roundedLg:y}=e.toRefs(o),c=e.ref(!1),b=e.ref(!1),v=e.ref(!1),p=e.ref(null),N=e.ref(""),U=e.ref(null),P=e.ref(null),D=e.ref(null),O=ce(i,a);he(r),ue(u,y);const d=e.computed(()=>Array.isArray(o.modelValue)?o.modelValue:o.modelValue?[o.modelValue]:[]),k=e.computed(()=>Array.isArray(o.modelValue)?null:o.modelValue),h=e.computed(()=>o.noMatchingItemsText||s.t().autocomplete.noMatchingItems),f=e.computed(()=>o.textarea?Dt:Ee),B=e.computed(()=>{const I=o.external?o.items:o.items.filter(G=>{var te;return!N.value||((te=G.text)==null?void 0:te.toLowerCase().includes(N.value.toLowerCase()||""))||G.header||G.divider});return I.filter((G,te)=>{var oe;const F=(G.header||G.divider)&&!G.key,me=!((oe=I[te+1])==null?void 0:oe.key);return!(F&&me)})}),S=e.computed(()=>[...l({e:"input",m:{expanded:b.value}})]),w=e.computed(()=>[...l({e:"items",m:{"theme-default":!a.value&&!i.value,[o.listPosition]:!0,rounded:u.value,"rounded-lg":y.value,round:o.round}}),O.value]),V=I=>!!I&&d.value.map(G=>G.key).includes(I),M=I=>{I.code==="Tab"&&z()},_=()=>{var I,G,te,F,me,oe,xe;if(p.value){const Le=(G=(I=P.value)==null?void 0:I.offsetHeight)!=null?G:0,R=(F=(te=P.value)==null?void 0:te.scrollTop)!=null?F:0,Re=(me=P.value)==null?void 0:me.querySelectorAll(`[data-item-key="${p.value}"]`)[0],ne=Re.offsetTop,Y=Re.offsetHeight;ne<R?(oe=P.value)==null||oe.scrollTo({top:ne}):ne+Y>Le+R&&((xe=P.value)==null||xe.scrollTo({top:ne-Le+Y}))}},X=()=>{re(),e.nextTick(()=>{const I=B.value.filter(F=>!!F.key&&!F.disabled);let G=I.length;p.value&&(G=I.findIndex(F=>F.key===p.value));const te=I[G-1];te&&(p.value=te.key||null,_())})},j=()=>{re(),e.nextTick(()=>{const I=B.value.filter(F=>!!F.key&&!F.disabled);let G=-1;p.value&&(G=I.findIndex(F=>F.key===p.value));const te=I[G+1];te&&(p.value=te.key||null,_())})},Z=I=>{n("update:model-value",I),n("update",I)},ee=I=>{const G=d.value.filter(te=>te.key!==I.key);Z(G)},m=I=>{if(o.multiple)if(V(I.key))ee(I);else{const G=[...d.value,I];Z(G)}else(!V(I.key)||Array.isArray(o.modelValue))&&(n("select",I),Z(I)),c.value=!1,b.value=!1,v.value=!1;p.value=null},C=()=>{if(p.value){const I=o.items.find(G=>G.key===p.value);I&&m(I)}},A=()=>{b.value?C():re()},z=()=>{c.value=!1,b.value=!1,v.value=!1,p.value=null},E=I=>[...l({e:"item",m:{disabled:I.disabled===!0,active:I.key===p.value,selected:V(I.key)}}),ot],g=()=>{Z(null)},T=()=>{n("reload")},W=I=>{n("search",I)},x=I=>{N.value=I,o.searchDelay?W(I):(clearTimeout(U.value),U.value=setTimeout(()=>{W(I)},o.searchDelay))},Q=()=>{N.value="",b.value=!0},re=()=>{n("focus"),c.value=!0,Q()},ve=I=>{var te;const G=(te=D.value)==null?void 0:te.$el;G&&!G.contains(I.target)&&z()},ye=I=>{n("blur",I)},de=I=>{n("enter",{key:null,text:I})};return(I,G)=>{const te=e.resolveDirective("click-outside");return e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(l)({})},e.unref(s).testElName("autocomplete")),[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),e.mergeProps({ref_key:"input",ref:D,readonly:!b.value,"model-value":b.value?N.value:!t.multiple&&e.unref(k)?e.unref(k).text:"",placeholder:t.placeholder,type:t.type,required:t.required,min:t.min,max:t.max,maxlength:t.maxlength,step:t.step,label:t.label,width:t.width,rows:t.rows,"left-icon":t.leftIcon,"left-icon-clickable":t.leftIconClickable,"left-icon-color":t.leftIconColor,"right-icon":t.clearable&&e.unref(k)&&e.unref(k).key?e.unref(s).icons.values.close:null,"right-icon-clickable":"",disabled:t.disabled,bordered:e.unref(r),dark:e.unref(i),light:e.unref(a),rounded:e.unref(u),"rounded-lg":e.unref(y),round:t.round,error:t.error,class:e.unref(S),depressed:t.depressed,size:t.size,clearable:t.clearable},e.unref(s).testElName("autocomplete-input"),{onEnter:de,onFocus:re,onClick:Q,onBlur:ye,onInput:x,onClickLeftIcon:G[1]||(G[1]=F=>n("click-left-icon")),onClickRightIcon:g,onKeydown:[e.withKeys(X,["up"]),e.withKeys(j,["down"]),e.withKeys(e.withModifiers(A,["prevent","stop"]),["enter"]),e.withKeys(z,["esc"]),M]}),e.createSlots({after:e.withCtx(()=>[b.value?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:"slide-top"},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"list",ref:P,class:e.unref(w),style:{maxHeight:`${t.maxHeight}px`}},e.unref(s).testElName("autocomplete-list"),{onClick:G[0]||(G[0]=e.withModifiers(F=>v.value=!0,["stop"]))}),[e.createVNode(e.unref(At),{loading:t.itemsLoading,error:t.itemsError,reloadable:t.itemsReloadable,onReload:T},{default:e.withCtx(()=>[e.unref(B).length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(l)({e:"no-items-text"}))},e.toDisplayString(e.unref(h)),3)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(B),(F,me)=>(e.openBlock(),e.createElementBlock("div",{key:me,"data-item-key":F.key},[F.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(l)({e:"item-header"}))},e.toDisplayString(F.header),3)):e.createCommentVNode("",!0),F.key?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:E(F)},e.unref(s).testElName("autocomplete-list-item"),{onClick:oe=>m(F)}),[e.renderSlot(I.$slots,"item",{id:F.key,text:F.text,metadata:F.metadata,isActive:V(F.key)},()=>[e.createTextVNode(e.toDisplayString(F.text),1)])],16,Wn)):e.createCommentVNode("",!0),F.divider?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(l)({e:"item-divider"}))},null,2)):e.createCommentVNode("",!0)],8,Un))),128)),e.renderSlot(I.$slots,"additional-item")]),_:3},8,["loading","error","reloadable"])],16)),[[te,ve]])]),_:3})):e.createCommentVNode("",!0)]),_:2},[t.multiple?{name:"before-text",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)({e:"selected-items",m:t.leftIcon?"has-icon":""}))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(F,me)=>(e.openBlock(),e.createBlock(e.unref(at),{key:me,class:e.normalizeClass(e.unref(l)({e:"selected-item-badge"})),color:"primary",round:""},{default:e.withCtx(()=>[e.renderSlot(I.$slots,"selected-item",{id:F.key,text:F.text,metadata:F.metadata},()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)({e:"selected-item-badge-text"}))},e.toDisplayString(F.text),3)]),e.createVNode(e.unref(pe),{icon:e.unref(s).icons.values.close,size:"sm",round:"",color:"primary",class:e.normalizeClass(e.unref(l)({e:"selected-item-remove"})),onClick:oe=>ee(F)},null,8,["icon","class","onClick"])]),_:2},1032,["class"]))),128))],2)])}:void 0]),1040,["readonly","model-value","placeholder","type","required","min","max","maxlength","step","label","width","rows","left-icon","left-icon-clickable","left-icon-color","right-icon","disabled","bordered","dark","light","rounded","rounded-lg","round","error","class","depressed","size","clearable","onKeydown"]))],16)}}});const jn={name:"LsCard"},Kn=e.defineComponent({...jn,props:{title:{default:""}},setup(t){const n=t,o=J("ls-card"),l=ae(),s=e.useSlots(),i=()=>!!s.footer;return(a,r)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(o)({})},e.unref(l).testElName("card")),[n.title?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass(e.unref(o)({e:"header"}))},[e.createElementVNode("h3",{class:e.normalizeClass(e.unref(o)({e:"title"}))},e.toDisplayString(n.title),3)],2)):e.createCommentVNode("",!0),e.createElementVNode("main",e.mergeProps({class:e.unref(o)({e:"body"})},e.unref(l).testElName("card-body")),[e.renderSlot(a.$slots,"default")],16),i()?(e.openBlock(),e.createElementBlock("footer",e.mergeProps({key:1,class:e.unref(o)({e:"footer"})},e.unref(l).testElName("card-footer")),[e.renderSlot(a.$slots,"footer")],16)):e.createCommentVNode("",!0)],16))}});const qn={name:"LsChart"},Xn=e.defineComponent({...qn,props:{type:null,data:null,legend:{default:()=>({show:!0,showColorLabel:!0,sort:void 0,layout:"column",showValues:!0,position:"bottom",legendX:20,legendY:20})},config:{default:()=>({animate:!0,chartCx:35,chartCy:200,canvasWidth:300,canvasHeight:350,chartHeight:200,circleChartRadius:50,circleChartInnerRadius:0,columnWidth:30,columnSpacing:10,columnBorderRadius:8,darkLabels:!1,showLabels:!0,labelOffsetFromCenter:10,labelFontSize:"md",customLabelFontSize:null,showLabelValue:!0,showLabelIncreaseValue:!0,showLabelValuePrefixOrSufix:!0,showColumnChartTick:!0,showShortenedLabel:!0,staticPrefix:"",staticSufix:""})}},setup(t){const n=t,o=J("ls-chart"),l=ae(),s=e.ref(),i=e.ref(),a=e.computed(()=>u(n.data,n.legend.sort||"asc")),r=e.computed(()=>n.config.labelFontSize==="lg"?"2":n.config.labelFontSize==="md"?"1.5":n.config.labelFontSize==="sm"?"1.2":n.config.labelFontSize),u=(d,k)=>k==="asc"?[...d].sort((h,f)=>h.value-f.value):k==="desc"?[...d].sort((h,f)=>f.value-h.value):[...d],y=(d,k,h,f)=>{let V="";f>0?(V=l.chartColors.green,d.beginPath(),d.moveTo(k+2,h-3-8),d.lineTo(k+3+2,h+3-8),d.lineTo(k-3+2,h+3-8)):f<0&&(V=l.chartColors.red,d.beginPath(),d.moveTo(k+2,h+3-8),d.lineTo(k+3+2,h-3-8),d.lineTo(k-3+2,h-3-8)),d.fillStyle=V,d.fill()},c=(d,k,h,f,B,S)=>{d.beginPath(),d.moveTo(k+S,h),d.lineTo(k+f-S,h),d.quadraticCurveTo(k+f,h,k+f,h+S),d.lineTo(k+f,h+B),d.lineTo(k,h+B),d.lineTo(k,h+S),d.quadraticCurveTo(k,h,k+S,h),d.closePath()},b=(d,k,h,f,B,S)=>{d.beginPath(),d.moveTo(k+S,h),d.lineTo(k+f-S,h),d.quadraticCurveTo(k+f,h,k+f,h+S),d.lineTo(k,h+S),d.quadraticCurveTo(k,h,k+S,h),d.closePath(),d.fill()},v=(d,k,h,f,B)=>{const[S,w=S]=k.split("|"),V=d.createLinearGradient(h,f,h,f+B);V.addColorStop(0,S),V.addColorStop(1,w),d.fillStyle=V},p=(d,k,h,f,B)=>{const{data:S,config:w}=n,V=parseFloat(getComputedStyle(document.body).fontSize)+5,M=Math.PI,_=M*2,X=-M/2,Z=S.map(m=>m.value).reduce((m,C)=>m+C,0);let ee=0;d.lineWidth=B,S.forEach(m=>{d.beginPath(),d.arc(k,h,f,X+_*(ee/Z),X+_*((ee+m.value)/Z));const C=m.color.split("|");d.strokeStyle=C[0],d.stroke(),ee+=m.value;const A=w.customLabelFontSize?w.customLabelFontSize:r.value,z=w.labelOffsetFromCenter||40;if(w.showLabels){const E=X+_*(ee-m.value/2)/Z,g=k+Math.cos(E)*(f+z),T=h+Math.sin(E)*(f+z);d.fillStyle=w.darkLabels?"black":`${m.color}`,d.font=`${A}rem sans-serif`;const W=w.showLabelValuePrefixOrSufix&&m.prefix?m.prefix:"",x=w.showLabelValuePrefixOrSufix&&m.sufix?m.sufix:"",Q=`${W}${m.value}${x}`;E>-Math.PI/2&&E<Math.PI/2?d.textAlign="left":d.textAlign="right",d.textBaseline="middle",d.fillText(`${m.label}`,g,T),w.showLabelValue&&(d.fillStyle=w.darkLabels?"black":`${m.color}`,d.fillText(`${Q}`,g,T+V))}})},N=(d,k,h,f,B,S)=>{const w=n.config.columnBorderRadius||8;v(d,S,k,h,B),c(d,k,h,f,B,w),d.fill()},U=(d,k,h,f,B,S,w,V)=>{for(let M=0;M<S.length;M++){const{value:_,color:X}=S[M],j=_*f,Z=k+M*(V+B),ee=h-j;N(d,Z,ee,V,j,X)}},P=(d,k,h,f,B,S,w)=>{const V=n.config.columnBorderRadius||8;v(d,S,k,h,B),b(d,k,h+(1-w)*B,f,B*w,V)},D=(d,k,h,f,B,S,w,V)=>{let M=0;const _=setInterval(()=>{if(M>=1){clearInterval(_);return}M+=.02,S.forEach(({value:X,color:j},Z)=>{const ee=X*f-9,m=k+Z*(V+B),C=h-ee-9;P(d,m,C,V,ee,j,M)})},10)},O=(d,k,h,f,B)=>{const{data:S,config:w,legend:V}=n,M=Math.max(...S.map(m=>m.value)),_=n.config.chartHeight!==void 0?n.config.chartHeight:200,X=(f+B)*S.length,j=_/M;S.forEach((m,C)=>{const{value:A,label:z,increase:E,prefix:g,sufix:T}=m,W=A*j,x=k+C*(f+B),Q=h-W,re=w.showLabelIncreaseValue?`${g||""}${E}${T||""}`:`${g||""}${A}${T||""}`,ve=w.showShortenedLabel?z.substring(0,3).toUpperCase():z.toUpperCase(),de=d.measureText(re).width+10,I=x+(f-de)/2;d.fillStyle=l.chartColors.gray,d.textAlign="center",d.fillText(ve,x+f/2,h+20),E!==void 0&&(d.fillStyle=w.showLabelIncreaseValue&&E>0?l.chartColors.green:w.showLabelIncreaseValue&&E<0?l.chartColors.red:l.chartColors.gray),(w.showLabelValue||w.showLabelIncreaseValue)&&d.fillText(re,x+f/2+(w.showLabelIncreaseValue?5:0),Q-5),w.showLabelIncreaseValue&&E!==void 0&&E!==0&&y(d,I,Q,E)});const Z=M/5;d.strokeStyle=l.chartColors.gray,d.lineWidth=1,d.beginPath();const ee=w.showColumnChartTick?5:0;for(let m=0;m<=ee;m++){const C=h-_/5*m;d.moveTo(k-5,C),d.lineTo(k+X+5,C),w.showColumnChartTick&&(d.fillStyle=l.chartColors.gray,d.fillText(Math.round(Z*m).toString(),k-30,C+5))}d.stroke(),n.config.animate?D(d,k,h,j,B,S,w,f):U(d,k,h,j,B,S,w,f)};return e.onMounted(()=>{i.value=s.value.getContext("2d"),s.value.width=n.config.canvasWidth,s.value.height=n.config.canvasHeight,n.type==="donut"?p(i.value,n.config.chartCx,n.config.chartCy,n.config.circleChartRadius!==void 0?n.config.circleChartRadius:50,n.config.circleChartInnerRadius!==void 0?n.config.circleChartInnerRadius:30):O(i.value,n.config.chartCx,n.config.chartCy,n.config.columnWidth!==void 0?n.config.columnWidth:20,n.config.columnSpacing!==void 0?n.config.columnSpacing:10)}),(d,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(o)({}))},[e.renderSlot(d.$slots,"header"),e.createElementVNode("canvas",{ref_key:"canvasChart",ref:s},null,512),e.renderSlot(d.$slots,"before-legend"),t.legend.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o)({e:"legends",m:{column:t.legend.layout==="column"}}))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),(h,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:e.normalizeClass(e.unref(o)({e:"legend"}))},[t.legend.showColorLabel?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o)({e:"legend",m:"color"})),style:e.normalizeStyle({background:h.color})},null,6)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(o)({e:"legend",m:"label"}))},e.toDisplayString(h.label)+" "+e.toDisplayString(t.legend.showValues?" - "+(h.prefix||"")+h.value+(h.sufix||""):""),3)],2))),128))],2)):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"footer")],2))}});const Yn=["id","disabled","checked"],Zn=["for"],Jn={name:"LsCheckbox"},Mt=e.defineComponent({...Jn,props:{modelValue:{type:Boolean,default:!0},id:{default:""},label:{default:null},color:{default:"primary"},disabled:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},elevated:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1},error:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=J("ls-checkbox"),s=ae(),i=e.computed({get:()=>o.modelValue,set:u=>{r(u)}}),a=e.computed(()=>{const u=o.modelValue?[`has-bg-color-${o.color}`]:[];return[...l({e:"checkmark",m:{rounded:o.rounded,unchecked:!o.modelValue,bordered:o.bordered,dark:o.dark,light:o.light,error:o.error}}),...u]}),r=u=>{n("update:modelValue",u),n("change",u)};return(u,y)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(l)({m:{disabled:t.disabled}})},e.unref(s).testElName("checkbox")),[e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({id:`check_${o.id}`,ref:"checkboxRef",key:t.id,"onUpdate:modelValue":y[0]||(y[0]=c=>e.isRef(i)?i.value=c:null),class:e.unref(l)({e:"input"}),type:"checkbox",disabled:t.disabled},e.unref(s).testElName("checkbox-input"),{checked:e.unref(i)}),null,16,Yn)),[[e.vModelCheckbox,e.unref(i)]]),e.createElementVNode("label",{class:e.normalizeClass(e.unref(l)({e:"label"})),for:`check_${o.id}`},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a))},[e.unref(i)?(e.openBlock(),e.createBlock(e.unref(le),{key:0,name:e.unref(s).icons.values.check},null,8,["name"])):e.createCommentVNode("",!0)],2),e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],10,Zn)],16))}});const Qn={name:"LsCheckboxGroup"},eo=e.defineComponent({...Qn,props:{modelValue:{default:()=>[]},name:null,items:null,bordered:{type:Boolean,default:!1},error:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},inline:{type:Boolean,default:!1}},emits:["update:model-value"],setup(t,{emit:n}){const o=t,l=J("ls-checkbox-group"),s=e.computed(()=>o.items||[]),i=e.computed({get(){return o.modelValue},set(u){n("update:model-value",u)}}),a=u=>i.value.includes(u),r=u=>{i.value.includes(u)?i.value=i.value.filter(c=>c!==u):i.value=[...i.value,u]};return(u,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l)({m:{inline:t.inline}}))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),c=>(e.openBlock(),e.createBlock(e.unref(Mt),{id:c.key,key:c.key,class:e.normalizeClass(e.unref(l)({e:"item",m:{inline:t.inline}})),disabled:c.disabled,bordered:"",rounded:"","model-value":a(c.key),error:t.error,label:c.label,"onUpdate:modelValue":b=>r(c.key)},null,8,["id","class","disabled","model-value","error","label","onUpdate:modelValue"]))),128))],2))}});const to=t=>t?t.replace(/\n/g,"").replace(/\s+/g," ").replace(/> </g,"><").replace(/ </g,"<").replace(/: {/g,":{").replace(/ } /g,"}").replace(/ { /g,"{").replace(/; /g,";").replace(/: /g,":").replace(/= /g,"=").replace(/ =/g,"=").replace(/, /g,",").replace(/ ,/g,",").replace(/} /g,"}").replace(/{ /g,"{").replace(/ }/g,"}").trim():"";function zt(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n],l=typeof o;(l==="object"||l==="function")&&!Object.isFrozen(o)&&zt(o)}),t}class mt{constructor(n){n.data===void 0&&(n.data={}),this.data=n.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Rt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ke(t,...n){const o=Object.create(null);for(const l in t)o[l]=t[l];return n.forEach(function(l){for(const s in l)o[s]=l[s]}),o}const no="</span>",ft=t=>!!t.scope,oo=(t,{prefix:n})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const o=t.split(".");return[`${n}${o.shift()}`,...o.map((l,s)=>`${l}${"_".repeat(s+1)}`)].join(" ")}return`${n}${t}`};class lo{constructor(n,o){this.buffer="",this.classPrefix=o.classPrefix,n.walk(this)}addText(n){this.buffer+=Rt(n)}openNode(n){if(!ft(n))return;const o=oo(n.scope,{prefix:this.classPrefix});this.span(o)}closeNode(n){!ft(n)||(this.buffer+=no)}value(){return this.buffer}span(n){this.buffer+=`<span class="${n}">`}}const pt=(t={})=>{const n={children:[]};return Object.assign(n,t),n};class rt{constructor(){this.rootNode=pt(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(n){this.top.children.push(n)}openNode(n){const o=pt({scope:n});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(n){return this.constructor._walk(n,this.rootNode)}static _walk(n,o){return typeof o=="string"?n.addText(o):o.children&&(n.openNode(o),o.children.forEach(l=>this._walk(n,l)),n.closeNode(o)),n}static _collapse(n){typeof n!="string"&&(!n.children||(n.children.every(o=>typeof o=="string")?n.children=[n.children.join("")]:n.children.forEach(o=>{rt._collapse(o)})))}}class so extends rt{constructor(n){super(),this.options=n}addText(n){n!==""&&this.add(n)}startScope(n){this.openNode(n)}endScope(){this.closeNode()}__addSublanguage(n,o){const l=n.root;o&&(l.scope=`language:${o}`),this.add(l)}toHTML(){return new lo(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Fe(t){return t?typeof t=="string"?t:t.source:null}function Ot(t){return Te("(?=",t,")")}function ao(t){return Te("(?:",t,")*")}function ro(t){return Te("(?:",t,")?")}function Te(...t){return t.map(o=>Fe(o)).join("")}function io(t){const n=t[t.length-1];return typeof n=="object"&&n.constructor===Object?(t.splice(t.length-1,1),n):{}}function it(...t){return"("+(io(t).capture?"":"?:")+t.map(l=>Fe(l)).join("|")+")"}function Pt(t){return new RegExp(t.toString()+"|").exec("").length-1}function uo(t,n){const o=t&&t.exec(n);return o&&o.index===0}const co=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ut(t,{joinWith:n}){let o=0;return t.map(l=>{o+=1;const s=o;let i=Fe(l),a="";for(;i.length>0;){const r=co.exec(i);if(!r){a+=i;break}a+=i.substring(0,r.index),i=i.substring(r.index+r[0].length),r[0][0]==="\\"&&r[1]?a+="\\"+String(Number(r[1])+s):(a+=r[0],r[0]==="("&&o++)}return a}).map(l=>`(${l})`).join(n)}const mo=/\b\B/,_t="[a-zA-Z]\\w*",ct="[a-zA-Z_]\\w*",Ft="\\b\\d+(\\.\\d+)?",Ht="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+