@lekseek/ui
Version:
Vue 3 components library
1 lines • 166 kB
JavaScript
(function(N,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(N=typeof globalThis<"u"?globalThis:N||self,e(N["Lekseek UI"]={},N.Vue))})(this,function(N,e){"use strict";const _e="__v-click-outside",ln=typeof window<"u",sn=typeof navigator<"u",an=ln&&("ontouchstart"in window||sn&&navigator.msMaxTouchPoints>0)?["touchstart"]:["click"],rn=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||an,isActive:t.isActive!==!1}},cn=({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)},mt=(t,{value:n})=>{const{events:o,handler:l,middleware:s,isActive:i}=rn(n);!i||(t[_e]=o.map(a=>({event:a,handler:r=>cn({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)))},ft=t=>{(t[_e]||[]).forEach(({event:o,handler:l})=>document.documentElement.removeEventListener(o,l,!1)),delete t[_e]},Se={beforeMount:mt,updated:(t,{value:n,oldValue:o})=>{JSON.stringify(n)!==JSON.stringify(o)&&(ft(t),mt(t,{value:n}))},unmounted:ft};function Ke(t,n,o){return`${t}${n?`__${n}`:""}${o?`--${o}`:""}`}const dn={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"}},un={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"}},mn={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 Pe=(t=>(t.PL="pl",t.EN="en",t.UK="uk",t))(Pe||{});const ce={left:"left",right:"right",top:"top",bottom:"bottom"},fn={locale:Pe.PL,locales:{[Pe.PL]:un,[Pe.EN]:dn,[Pe.UK]:mn},t(){return this.locales[this.locale]}},pt={bem:{hyphenate:!0},...{test:{elAttrName:"data-test",elNamePrefix:""},testElName(t){return{[this.test.elAttrName]:`${this.test.elNamePrefix}${t}`}}},...fn,...{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"}}},...{chartColors:{red:"#e02020",green:"#95c11e",gray:"#717171"}}},et=Symbol("ui");function pn(t,n={}){const o=n.bem||pt.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(),c=this.$options.name,k=s||o.hyphenate?r(c):c,d=a?typeof a=="string"?[a]:Array.isArray(a)?a:Object.keys(a).filter(p=>a[p]):[],b=Ke(k,i),y=d.map(p=>Ke(k,i,p));return[b,...y]}}});const l=e.reactive({...pt,...n});t.config.globalProperties.$ui=l,t.provide(et,l)}function v(t,n=!0){function o({b:l,e:s,m:i}){const a=y=>y.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),r=t,c=l||n?a(r):r,k=i?typeof i=="string"?[i]:Array.isArray(i)?i:Object.keys(i).filter(y=>i[y]):[],d=Ke(c,s),b=k.map(y=>Ke(c,s,y));return[d,...b]}return o}const Ve=(t,n)=>n?`has-${t}-${n}`:null,qe=t=>Ve("color",t),me=t=>Ve("bg-color",t),hn=t=>Ve("hover-color",t),ht=t=>Ve("hover-bg-color",t),gt=t=>Ve("border-color",t),gn=t=>Ve("gradient",t),bt="is-elevated",tt="is-hoverable",Ne={bordered:{type:Boolean,default:!1}};function ge(t){return e.computed(()=>({"is-bordered":t.value}))}const Xe={elevated:{type:Boolean,default:!1}};function Fe(t){return e.computed(()=>({"is-elevated":t.value}))}const yt={depressed:{type:Boolean,default:!1}};function kt(t){return e.computed(()=>({"is-depressed":t.value}))}const ke={rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1}};function de(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 Ce={dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1}};function ue(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 Ct(t,n,o){return{component:e.computed(()=>t.value?"RouterLink":n.value?"a":"span"),target:e.computed(()=>o.value?"_blank":"_self")}}const nt={error:{type:Boolean,default:!1}};function $t(t){return{validationBorderClass:e.computed(()=>({"is-bordered":t.value,"has-border-color-error":t.value}))}}const yn={padding:{type:String,default:null}};function kn(t){return e.computed(()=>({[`has-padding-${t.value}`]:t.value}))}const ot={size:{type:String,default:"md"}},Cn={name:"LsIcon"},le=e.defineComponent({...Cn,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=v("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,c)=>(e.openBlock(),e.createElementBlock("i",e.mergeProps({class:e.unref(a)},e.unref(l).testElName("icon")),[e.renderSlot(r.$slots,"default")],16))}}),za="",$n=e.defineComponent({name:"LsSpinner",components:{LsIcon:le},props:{size:{type:String,default:"3x"}}}),X=(t,n)=>{const o=t.__vccOpts||t;for(const[l,s]of n)o[l]=s;return o};function Bn(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 He=X($n,[["render",Bn]]),En=["title","disabled"],Sn={name:"LsButton"},be=e.defineComponent({...Sn,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:c,href:k,newWindow:d,elevated:b}=e.toRefs(n),{component:y,target:p}=Ct(c,k,d),T=v("ls-button"),G=ae(),F=ue(o,l),z=ge(s),P=de(i,a,r),u=Fe(b),C=e.computed(()=>{let h=[];const f=n.color&&n.color!=="default"?n.color:null;if(f){const E=`${f}-darken-1`;h=n.plain?[qe(f),hn(E)]:[me(f),ht(E)]}return[...h,...T({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}}),{[tt]:n.hoverable},F.value,z.value,P.value,u.value]});return(h,f)=>{var E;return e.openBlock(),e.createElementBlock("button",e.mergeProps({title:(E=t.title)!=null?E:void 0,class:e.unref(C),type:"button",disabled:t.disabled||t.loading},e.unref(G).testElName("button")),[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(y)),{to:e.unref(c),href:e.unref(k),target:e.unref(p),rel:e.unref(d)?"noopener":"",class:e.normalizeClass(e.unref(T)({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(T)({e:"icon"}))},null,8,["name","class"])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(T)({e:"content"}))},[e.renderSlot(h.$slots,"default"),t.loading?(e.openBlock(),e.createBlock(e.unref(He),{key:0,color:e.unref(o)?"white":"default",class:e.normalizeClass(e.unref(T)({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(T)({e:"icon"}))},null,8,["name","class"])):e.createCommentVNode("",!0)])]),_:3},8,["to","href","target","rel","class"]))],16,En)}}}),Ra="",Nn={key:0},wn={name:"LsAsyncContent"},Bt=e.defineComponent({...wn,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=v("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(c,k)=>(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(c.$slots,"loader",{},()=>[e.createVNode(e.unref(He),{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",Nn,[e.renderSlot(c.$slots,"default")])):e.createCommentVNode("",!0)]),_:3})],16))}}),Oa="",Tn=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},...Ce,...Ne,...ke,...nt,...yt,...ot},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:c}=e.toRefs(t),{validationBorderClass:k}=$t(r);return{themeClass:ue(n,o),borderedClass:ge(l),roundedClass:de(s,i,a),depressedClass:kt(c),validationBorderClass:k}},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}}),{[bt]: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()}}}),_a="",Ln=["autofocus","type","min","max","maxlength","required","step","value","readonly","placeholder","disabled"];function In(t,n,o,l,s,i){var r,c,k;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]=(...d)=>t.onLeftIconClick&&t.onLeftIconClick(...d))}),[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:(c=t.max)!=null?c:void 0,maxlength:(k=t.maxlength)!=null?k: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]=(...d)=>t.onInput&&t.onInput(...d)),onFocus:n[2]||(n[2]=(...d)=>t.onFocus&&t.onFocus(...d)),onBlur:n[3]||(n[3]=(...d)=>t.onBlur&&t.onBlur(...d)),onKeydown:n[4]||(n[4]=e.withKeys((...d)=>t.enter&&t.enter(...d),["enter"])),onClick:n[5]||(n[5]=d=>t.$emit("click")),onMouseenter:n[6]||(n[6]=d=>t.$emit("mouseenter")),onMouseleave:n[7]||(n[7]=d=>t.$emit("mouseleave"))}),null,16,Ln),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]=(...d)=>t.onRightIconClick&&t.onRightIconClick(...d))}),[e.createVNode(a,{name:t.rightIcon,color:t.rightIconColor},null,8,["name","color"])],16)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],16)}const we=X(Tn,[["render",In]]),Vn=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},...Ce,...Ne,...ke,...nt,...yt,...ot},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:c}=e.toRefs(t),{validationBorderClass:k}=$t(r);return{themeClass:ue(n,o),borderedClass:ge(l),roundedClass:de(s,i,a),depressedClass:kt(c),validationBorderClass:k}},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}}),{[bt]: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()}}}),Pa="",An=["readonly","autofocus","rows","required","value","placeholder","maxlength","disabled"];function Dn(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]=(...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("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]=(...c)=>t.input&&t.input(...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"]))}),null,16,An),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]=(...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 Et=X(Vn,[["render",Dn]]),Mn=["disabled"],zn={name:"LsBadge"},lt=e.defineComponent({...zn,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:c}=e.toRefs(o),k=v("ls-badge"),d=ae(),b=ue(l,s),y=ge(i),p=de(r,c),T=Fe(a),G=e.computed(()=>[...o.color?[me(o.color),qe("white")]:[],...k({m:{[o.size]:!0,disabled:o.disabled,round:o.round}}),b.value,y.value,T.value,p.value]);return(F,z)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({disabled:t.disabled,class:e.unref(G)},e.unref(d).testElName("badge")),[e.renderSlot(F.$slots,"default")],16,Mn))}}),Fa="",Rn={name:"LsIconButton"},fe=e.defineComponent({...Rn,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=v("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"]))}}),Ha="",On=["data-item-key"],_n=["onClick"],Pn={name:"LsAutocomplete"},Fn=e.defineComponent({...Pn,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=v("ls-autocomplete"),s=ae(),{dark:i,light:a,bordered:r,rounded:c,roundedLg:k}=e.toRefs(o),d=e.ref(!1),b=e.ref(!1),y=e.ref(!1),p=e.ref(null),T=e.ref(""),G=e.ref(null),F=e.ref(null),z=e.ref(null),P=ue(i,a);ge(r),de(c,k);const u=e.computed(()=>Array.isArray(o.modelValue)?o.modelValue:o.modelValue?[o.modelValue]:[]),C=e.computed(()=>Array.isArray(o.modelValue)?null:o.modelValue),h=e.computed(()=>o.noMatchingItemsText||s.t().autocomplete.noMatchingItems),f=e.computed(()=>o.textarea?Et:we),E=e.computed(()=>{const A=o.external?o.items:o.items.filter(q=>{var ne;return!T.value||((ne=q.text)==null?void 0:ne.toLowerCase().includes(T.value.toLowerCase()||""))||q.header||q.divider});return A.filter((q,ne)=>{var se;const U=(q.header||q.divider)&&!q.key,he=!((se=A[ne+1])==null?void 0:se.key);return!(U&&he)})}),w=e.computed(()=>[...l({e:"input",m:{expanded:b.value}})]),L=e.computed(()=>[...l({e:"items",m:{"theme-default":!a.value&&!i.value,[o.listPosition]:!0,rounded:c.value,"rounded-lg":k.value,round:o.round}}),P.value]),D=A=>!!A&&u.value.map(q=>q.key).includes(A),R=A=>{A.code==="Tab"&&O()},H=()=>{var A,q,ne,U,he,se,Qe;if(p.value){const Oe=(q=(A=F.value)==null?void 0:A.offsetHeight)!=null?q:0,_=(U=(ne=F.value)==null?void 0:ne.scrollTop)!=null?U:0,je=(he=F.value)==null?void 0:he.querySelectorAll(`[data-item-key="${p.value}"]`)[0],oe=je.offsetTop,x=je.offsetHeight;oe<_?(se=F.value)==null||se.scrollTo({top:oe}):oe+x>Oe+_&&((Qe=F.value)==null||Qe.scrollTo({top:oe-Oe+x}))}},J=()=>{ie(),e.nextTick(()=>{const A=E.value.filter(U=>!!U.key&&!U.disabled);let q=A.length;p.value&&(q=A.findIndex(U=>U.key===p.value));const ne=A[q-1];ne&&(p.value=ne.key||null,H())})},Y=()=>{ie(),e.nextTick(()=>{const A=E.value.filter(U=>!!U.key&&!U.disabled);let q=-1;p.value&&(q=A.findIndex(U=>U.key===p.value));const ne=A[q+1];ne&&(p.value=ne.key||null,H())})},Q=A=>{n("update:model-value",A),n("update",A)},te=A=>{const q=u.value.filter(ne=>ne.key!==A.key);Q(q)},m=A=>{if(o.multiple)if(D(A.key))te(A);else{const q=[...u.value,A];Q(q)}else(!D(A.key)||Array.isArray(o.modelValue))&&(n("select",A),Q(A)),d.value=!1,b.value=!1,y.value=!1;p.value=null},$=()=>{if(p.value){const A=o.items.find(q=>q.key===p.value);A&&m(A)}},M=()=>{b.value?$():ie()},O=()=>{d.value=!1,b.value=!1,y.value=!1,p.value=null},S=A=>[...l({e:"item",m:{disabled:A.disabled===!0,active:A.key===p.value,selected:D(A.key)}}),tt],g=()=>{Q(null)},I=()=>{n("reload")},j=A=>{n("search",A)},K=A=>{T.value=A,o.searchDelay?j(A):(clearTimeout(G.value),G.value=setTimeout(()=>{j(A)},o.searchDelay))},ee=()=>{T.value="",b.value=!0},ie=()=>{n("focus"),d.value=!0,ee()},Be=A=>{var ne;const q=(ne=z.value)==null?void 0:ne.$el;q&&!q.contains(A.target)&&O()},Ee=A=>{n("blur",A)},pe=A=>{n("enter",{key:null,text:A})};return(A,q)=>{const ne=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:z,readonly:!b.value,"model-value":b.value?T.value:!t.multiple&&e.unref(C)?e.unref(C).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(C)&&e.unref(C).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(c),"rounded-lg":e.unref(k),round:t.round,error:t.error,class:e.unref(w),depressed:t.depressed,size:t.size,clearable:t.clearable},e.unref(s).testElName("autocomplete-input"),{onEnter:pe,onFocus:ie,onClick:ee,onBlur:Ee,onInput:K,onClickLeftIcon:q[1]||(q[1]=U=>n("click-left-icon")),onClickRightIcon:g,onKeydown:[e.withKeys(J,["up"]),e.withKeys(Y,["down"]),e.withKeys(e.withModifiers(M,["prevent","stop"]),["enter"]),e.withKeys(O,["esc"]),R]}),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:F,class:e.unref(L),style:{maxHeight:`${t.maxHeight}px`}},e.unref(s).testElName("autocomplete-list"),{onClick:q[0]||(q[0]=e.withModifiers(U=>y.value=!0,["stop"]))}),[e.createVNode(e.unref(Bt),{loading:t.itemsLoading,error:t.itemsError,reloadable:t.itemsReloadable,onReload:I},{default:e.withCtx(()=>[e.unref(E).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(E),(U,he)=>(e.openBlock(),e.createElementBlock("div",{key:he,"data-item-key":U.key},[U.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(l)({e:"item-header"}))},e.toDisplayString(U.header),3)):e.createCommentVNode("",!0),U.key?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:S(U)},e.unref(s).testElName("autocomplete-list-item"),{onClick:se=>m(U)}),[e.renderSlot(A.$slots,"item",{id:U.key,text:U.text,metadata:U.metadata,isActive:D(U.key)},()=>[e.createTextVNode(e.toDisplayString(U.text),1)])],16,_n)):e.createCommentVNode("",!0),U.divider?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(l)({e:"item-divider"}))},null,2)):e.createCommentVNode("",!0)],8,On))),128)),e.renderSlot(A.$slots,"additional-item")]),_:3},8,["loading","error","reloadable"])],16)),[[ne,Be]])]),_: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(u),(U,he)=>(e.openBlock(),e.createBlock(e.unref(lt),{key:he,class:e.normalizeClass(e.unref(l)({e:"selected-item-badge"})),color:"primary",round:""},{default:e.withCtx(()=>[e.renderSlot(A.$slots,"selected-item",{id:U.key,text:U.text,metadata:U.metadata},()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)({e:"selected-item-badge-text"}))},e.toDisplayString(U.text),3)]),e.createVNode(e.unref(fe),{icon:e.unref(s).icons.values.close,size:"sm",round:"",color:"primary",class:e.normalizeClass(e.unref(l)({e:"selected-item-remove"})),onClick:se=>te(U)},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)}}}),Ua="",Hn={name:"LsCard"},Un=e.defineComponent({...Hn,props:{title:{default:""}},setup(t){const n=t,o=v("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))}}),Wa="",Wn={name:"LsChart"},Gn=e.defineComponent({...Wn,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=v("ls-chart"),l=ae(),s=e.ref(),i=e.ref(),a=e.computed(()=>c(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),c=(u,C)=>C==="asc"?[...u].sort((h,f)=>h.value-f.value):C==="desc"?[...u].sort((h,f)=>f.value-h.value):[...u],k=(u,C,h,f)=>{let D="";f>0?(D=l.chartColors.green,u.beginPath(),u.moveTo(C+2,h-3-8),u.lineTo(C+3+2,h+3-8),u.lineTo(C-3+2,h+3-8)):f<0&&(D=l.chartColors.red,u.beginPath(),u.moveTo(C+2,h+3-8),u.lineTo(C+3+2,h-3-8),u.lineTo(C-3+2,h-3-8)),u.fillStyle=D,u.fill()},d=(u,C,h,f,E,w)=>{u.beginPath(),u.moveTo(C+w,h),u.lineTo(C+f-w,h),u.quadraticCurveTo(C+f,h,C+f,h+w),u.lineTo(C+f,h+E),u.lineTo(C,h+E),u.lineTo(C,h+w),u.quadraticCurveTo(C,h,C+w,h),u.closePath()},b=(u,C,h,f,E,w)=>{u.beginPath(),u.moveTo(C+w,h),u.lineTo(C+f-w,h),u.quadraticCurveTo(C+f,h,C+f,h+w),u.lineTo(C,h+w),u.quadraticCurveTo(C,h,C+w,h),u.closePath(),u.fill()},y=(u,C,h,f,E)=>{const[w,L=w]=C.split("|"),D=u.createLinearGradient(h,f,h,f+E);D.addColorStop(0,w),D.addColorStop(1,L),u.fillStyle=D},p=(u,C,h,f,E)=>{const{data:w,config:L}=n,D=parseFloat(getComputedStyle(document.body).fontSize)+5,R=Math.PI,H=R*2,J=-R/2,Q=w.map(m=>m.value).reduce((m,$)=>m+$,0);let te=0;u.lineWidth=E,w.forEach(m=>{u.beginPath(),u.arc(C,h,f,J+H*(te/Q),J+H*((te+m.value)/Q));const $=m.color.split("|");u.strokeStyle=$[0],u.stroke(),te+=m.value;const M=L.customLabelFontSize?L.customLabelFontSize:r.value,O=L.labelOffsetFromCenter||40;if(L.showLabels){const S=J+H*(te-m.value/2)/Q,g=C+Math.cos(S)*(f+O),I=h+Math.sin(S)*(f+O);u.fillStyle=L.darkLabels?"black":`${m.color}`,u.font=`${M}rem sans-serif`;const j=L.showLabelValuePrefixOrSufix&&m.prefix?m.prefix:"",K=L.showLabelValuePrefixOrSufix&&m.sufix?m.sufix:"",ee=`${j}${m.value}${K}`;S>-Math.PI/2&&S<Math.PI/2?u.textAlign="left":u.textAlign="right",u.textBaseline="middle",u.fillText(`${m.label}`,g,I),L.showLabelValue&&(u.fillStyle=L.darkLabels?"black":`${m.color}`,u.fillText(`${ee}`,g,I+D))}})},T=(u,C,h,f,E,w)=>{const L=n.config.columnBorderRadius||8;y(u,w,C,h,E),d(u,C,h,f,E,L),u.fill()},G=(u,C,h,f,E,w,L,D)=>{for(let R=0;R<w.length;R++){const{value:H,color:J}=w[R],Y=H*f,Q=C+R*(D+E),te=h-Y;T(u,Q,te,D,Y,J)}},F=(u,C,h,f,E,w,L)=>{const D=n.config.columnBorderRadius||8;y(u,w,C,h,E),b(u,C,h+(1-L)*E,f,E*L,D)},z=(u,C,h,f,E,w,L,D)=>{let R=0;const H=setInterval(()=>{if(R>=1){clearInterval(H);return}R+=.02,w.forEach(({value:J,color:Y},Q)=>{const te=J*f-9,m=C+Q*(D+E),$=h-te-9;F(u,m,$,D,te,Y,R)})},10)},P=(u,C,h,f,E)=>{const{data:w,config:L,legend:D}=n,R=Math.max(...w.map(m=>m.value)),H=n.config.chartHeight!==void 0?n.config.chartHeight:200,J=(f+E)*w.length,Y=H/R;w.forEach((m,$)=>{const{value:M,label:O,increase:S,prefix:g,sufix:I}=m,j=M*Y,K=C+$*(f+E),ee=h-j,ie=L.showLabelIncreaseValue?`${g||""}${S}${I||""}`:`${g||""}${M}${I||""}`,Be=L.showShortenedLabel?O.substring(0,3).toUpperCase():O.toUpperCase(),pe=u.measureText(ie).width+10,A=K+(f-pe)/2;u.fillStyle=l.chartColors.gray,u.textAlign="center",u.fillText(Be,K+f/2,h+20),S!==void 0&&(u.fillStyle=L.showLabelIncreaseValue&&S>0?l.chartColors.green:L.showLabelIncreaseValue&&S<0?l.chartColors.red:l.chartColors.gray),(L.showLabelValue||L.showLabelIncreaseValue)&&u.fillText(ie,K+f/2+(L.showLabelIncreaseValue?5:0),ee-5),L.showLabelIncreaseValue&&S!==void 0&&S!==0&&k(u,A,ee,S)});const Q=R/5;u.strokeStyle=l.chartColors.gray,u.lineWidth=1,u.beginPath();const te=L.showColumnChartTick?5:0;for(let m=0;m<=te;m++){const $=h-H/5*m;u.moveTo(C-5,$),u.lineTo(C+J+5,$),L.showColumnChartTick&&(u.fillStyle=l.chartColors.gray,u.fillText(Math.round(Q*m).toString(),C-30,$+5))}u.stroke(),n.config.animate?z(u,C,h,Y,E,w,L,f):G(u,C,h,Y,E,w,L,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):P(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)}),(u,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(o)({}))},[e.renderSlot(u.$slots,"header"),e.createElementVNode("canvas",{ref_key:"canvasChart",ref:s},null,512),e.renderSlot(u.$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(u.$slots,"footer")],2))}}),Ga="",jn=["id","disabled","checked"],Kn=["for"],qn={name:"LsCheckbox"},St=e.defineComponent({...qn,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=v("ls-checkbox"),s=ae(),i=e.computed({get:()=>o.modelValue,set:c=>{r(c)}}),a=e.computed(()=>{const c=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}}),...c]}),r=c=>{n("update:modelValue",c),n("change",c)};return(c,k)=>(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":k[0]||(k[0]=d=>e.isRef(i)?i.value=d:null),class:e.unref(l)({e:"input"}),type:"checkbox",disabled:t.disabled},e.unref(s).testElName("checkbox-input"),{checked:e.unref(i)}),null,16,jn)),[[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(c.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],10,Kn)],16))}}),ja="",Xn={name:"LsCheckboxGroup"},Yn=e.defineComponent({...Xn,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=v("ls-checkbox-group"),s=e.computed(()=>o.items||[]),i=e.computed({get(){return o.modelValue},set(c){n("update:model-value",c)}}),a=c=>i.value.includes(c),r=c=>{i.value.includes(c)?i.value=i.value.filter(d=>d!==c):i.value=[...i.value,c]};return(c,k)=>(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),d=>(e.openBlock(),e.createBlock(e.unref(St),{id:d.key,key:d.key,class:e.normalizeClass(e.unref(l)({e:"item",m:{inline:t.inline}})),disabled:d.disabled,bordered:"",rounded:"","model-value":a(d.key),error:t.error,label:d.label,"onUpdate:modelValue":b=>r(d.key)},null,8,["id","class","disabled","model-value","error","label","onUpdate:modelValue"]))),128))],2))}}),Ka="",Zn=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 Nt(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)&&Nt(o)}),t}class wt{constructor(n){n.data===void 0&&(n.data={}),this.data=n.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Tt(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $e(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 Jn="</span>",Lt=t=>!!t.scope,xn=(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 Qn{constructor(n,o){this.buffer="",this.classPrefix=o.classPrefix,n.walk(this)}addText(n){this.buffer+=Tt(n)}openNode(n){if(!Lt(n))return;const o=xn(n.scope,{prefix:this.classPrefix});this.span(o)}closeNode(n){!Lt(n)||(this.buffer+=Jn)}value(){return this.buffer}span(n){this.buffer+=`<span class="${n}">`}}const It=(t={})=>{const n={children:[]};return Object.assign(n,t),n};class st{constructor(){this.rootNode=It(),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=It({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=>{st._collapse(o)})))}}class vn extends st{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 Qn(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ue(t){return t?typeof t=="string"?t:t.source:null}function Vt(t){return Te("(?=",t,")")}function eo(t){return Te("(?:",t,")*")}function to(t){return Te("(?:",t,")?")}function Te(...t){return t.map(o=>Ue(o)).join("")}function no(t){const n=t[t.length-1];return typeof n=="object"&&n.constructor===Object?(t.splice(t.length-1,1),n):{}}function at(...t){return"("+(no(t).capture?"":"?:")+t.map(l=>Ue(l)).join("|")+")"}function At(t){return new RegExp(t.toString()+"|").exec("").length-1}function oo(t,n){const o=t&&t.exec(n);return o&&o.index===0}const lo=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function rt(t,{joinWith:n}){let o=0;return t.map(l=>{o+=1;const s=o;let i=Ue(l),a="";for(;i.length>0;){const r=lo.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 so=/\b\B/,Dt="[a-zA-Z]\\w*",it