@inkline/inkline
Version:
Inkline is the intuitive UI Components library that gives you a developer-friendly foundation for building high-quality, accessible, and customizable Vue.js 3 Design Systems.
1 lines • 179 kB
JavaScript
(function(f,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(f=typeof globalThis<"u"?globalThis:f||self,t(f.Inkline={},f.Vue))})(this,function(f,t){"use strict";const cu="",gt="ILoader",Wa=t.defineComponent({name:gt,inheritAttrs:!1,props:{color:{type:String,default:void 0},size:{type:String,default:void 0}},setup(e){const n=t.computed(()=>e.color),o=t.computed(()=>e.size),{color:a}=V({componentName:gt,currentColor:n}),{size:l}=A({componentName:gt,currentSize:o});return{classes:t.computed(()=>({[`-${a.value}`]:!0,[`-${l.value}`]:!0}))}}}),S=(e,n)=>{const o=e.__vccOpts||e;for(const[a,l]of n)o[a]=l;return o},Xa={key:0,class:"loader-text"},qa=t.createElementVNode("svg",{viewBox:"25 25 50 50"},[t.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})],-1);function Qa(e,n,o,a,l,r){return t.openBlock(),t.createElementBlock("div",t.mergeProps(e.$attrs,{class:["loader",e.classes],role:"img","aria-hidden":"true"}),[e.$slots.default?(t.openBlock(),t.createElementBlock("span",Xa,[t.renderSlot(e.$slots,"default")])):t.createCommentVNode("",!0),qa],16)}const $t=S(Wa,[["render",Qa]]),Ne={xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1/0]},Un=["","xs","sm","md","lg","xl","xxl"],Ya={input:e=>e,blur:e=>e.target.value,focus:e=>e.target.value,mouseenter:e=>e.target.value,mouseleave:e=>e.target.value},Zn="inkline-modal-container",Hn="inkline-toast-container",ve="inkline",kt="inklineIcons",Wn="inklineModal",Xn="inklineToast",Ke="ButtonGroup",Bt="CheckboxGroup",wt="Collapsible",Ct="Dropdown",Z="Form",H="FormGroup",St="Nav",Ee="Navbar",It="Progress",Nt="RadioGroup",vt="Select",Ue="Sidebar",Ze="Tabs";function qn(e,n){if(!e||!n)return!1;if(n.indexOf(" ")!==-1)throw new Error("Class name should not contain spaces.");return e.classList?e.classList.contains(n):(" "+e.className+" ").indexOf(" "+n+" ")>-1}function Et(e,n){if(!e)return;let o=e.className;const a=(n||"").split(" ");for(let l=0,r=a.length;l<r;l++){const i=a[l];i&&(e.classList?e.classList.add(i):qn(e,i)||(o+=" "+i))}e.classList||(e.className=o)}function He(e){if(Array.isArray(e)){const n=e.slice().map(He),o=Object.keys(n);return Object.keys(e).filter(a=>!o.includes(a)).forEach(a=>{n[a]=e[a]}),n}else if(typeof e=="object")return Object.keys(e).reduce((n,o)=>(n[o]=He(e[o]),n),{});return e}const Ja={tab:["Tab",9],enter:["Enter",13],esc:["Escape",27],space:[" ","Space",32],left:["ArrowLeft","Left",37],up:["ArrowUp","Up",38],right:["ArrowRight","Right",39],down:["ArrowDown","Down",40]};function Ga(e,n){let o;return function(...a){const l=this;clearTimeout(o),o=setTimeout(()=>e.apply(l,a),n)}}function Qn(){const e=new Map;function n(l,r){let i=e.get(l);return i?i.push(r):i=[r],e.set(l,i),()=>o(l,r)}function o(l,r){const i=e.get(l);i&&i.splice(i.indexOf(r)>>>0,1)}function a(l,r){const i=e.get(l);i&&i.slice().forEach(s=>{s(r)})}return{on:n,off:o,emit:a}}function Yn(e,n){const{allowlist:o,denylist:a}=n;return Object.keys(e).reduce((l,r)=>{let i=!0;return o!=null&&o.length&&(i=i&&o.some(s=>typeof s=="string"?r===s:r.match(s))),a!=null&&a.length&&(i=i&&!a.some(s=>typeof s=="string"?r===s:r.match(s))),i&&(l[r]=e[r]),l},{})}function At(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}function _a(e){if(!At(e))return!1;try{e.focus()}catch{}return typeof window<"u"&&document.activeElement===e}function Jn(e){for(let n=0;n<e.childNodes.length;n++){const o=e.childNodes[n];if(_a(o)||Jn(o))return!0}return!1}function xa(e,n){if(!e||!n||typeof window>"u")return;if(e.currentStyle)return e.currentStyle[n];const o=window.getComputedStyle(e,null);return o.getPropertyValue?o.getPropertyValue(n):o[n]}const Gn=e=>e instanceof Function,L=(e,n)=>{const o=n.key||n.keyIdentifier||n.keyCode;return Ja[e].indexOf(o)!==-1};function el(e){return!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function tl(e,n){if(!n)return[{text:e}];const o=[],a=e.toLowerCase(),l=n.toLowerCase();let r=0,i=0;for(;i<e.length;){const s=a.indexOf(l,i),d=s>=0;i=d?s:e.length,i&&(o.push({text:e.substring(r,i)}),r=i),d&&(i+=n.length,o.push({text:e.substring(r,i),marked:!0}),r=i)}return o}function nl(e,n=(...o)=>JSON.stringify(o)){const o={};return(...a)=>{const l=n(...a);return o[l]===void 0&&(o[l]=e(...a)),o[l]}}function ol(e,n,o){e&&n&&e.removeEventListener(n,o,!1)}function al(e,n,o){e&&n&&e.detachEvent("on"+n,o)}const J=(()=>typeof window>"u"?()=>{}:window.document.removeEventListener?ol:al)();function ll(e,n,o){e&&n&&o&&e.addEventListener(n,o,!1)}function rl(e,n,o){e&&n&&o&&e.attachEvent("on"+n,o)}const G=(()=>typeof window>"u"?()=>{}:window.document.addEventListener?ll:rl)();function il(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")}function _n(e,n){if(!e||!n)return;const o=n.split(" ");let a=" "+e.className+" ";for(let l=0,r=o.length;l<r;l++){const i=o[l];i&&(e.classList?e.classList.remove(i):qn(e,i)&&(a=a.replace(" "+i+" "," ")))}e.classList||(e.className=il(a))}function Ae(e,n){return n.split(".").reduce((o,a)=>o&&o[a],e)}function sl(e,n,o,a=!0){const l=n.split("."),r=l.pop();let i=e;return l.forEach(s=>{!i.hasOwnProperty(s)&&a&&(i[s]={}),i=i[s]}),i&&r&&(i[r]=o),e}function xn(e,n,o){return n&&n.split(".").reduce((a,l)=>(Object.keys(o).forEach(r=>{a[l][r]=o[r]}),a&&a[l]),e),Object.keys(o).forEach(a=>{e[a]=o[a]}),e}function cl(e){return e.replace(/[-_]([a-z0-9])/g,(n,o)=>o.toUpperCase())}function M(e){return`${e?`${e}-`:""}${Math.random().toString(36).substr(2,9)}`}function dl(e){return{show:n=>{e.emit("show",n)},hide:n=>{e.emit("hide",n)},hideAll:()=>{e.emit("hideAll",{})}}}function ul(e){return{show:n=>{e.emit("show",n)},hide:n=>{e.emit("hide",n)},hideAll:()=>{e.emit("hideAll",{})}}}const We=Qn(),Xe=dl(We),qe=Qn(),Qe=ul(qe),fl={tab:["Tab",9],enter:["Enter",13],esc:["Escape",27],space:[" ","Space",32],left:["ArrowLeft","Left",37],up:["ArrowUp","Up",38],right:["ArrowRight","Right",39],down:["ArrowDown","Down",40]},Ye={pristine:!0,dirty:!1,untouched:!0,touched:!1,valid:!0,invalid:!1,errors:[]},eo={value:void 0,validators:[]},Je=["value","validators","pristine","dirty","untouched","touched","valid","invalid","errors"],Vt="IButton",ml=t.defineComponent({name:Vt,components:{ILoader:$t},events:["click"],inheritAttrs:!1,props:{active:{type:Boolean,default:!1},block:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},color:{type:String,default:void 0},disabled:{type:Boolean,default:!1},href:{type:String,default:void 0},link:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},showLoadingIcon:{type:Boolean,default:!0},outline:{type:Boolean,default:!1},tag:{type:String,default:"button"},tabindex:{type:[Number,String],default:0},to:{type:[String,Object],default:void 0},type:{type:String,default:"button"},size:{type:String,default:void 0}},setup(e,{attrs:n}){const o=t.inject(Ke,null),a=t.inject(Z,null),l=t.inject(H,null),r=t.computed(()=>e.color||(o==null?void 0:o.color.value)),i=t.computed(()=>e.size||(o==null?void 0:o.size.value)),{color:s}=V({componentName:Vt,currentColor:r}),{size:d}=A({componentName:Vt,currentSize:i}),c=t.toRef(e,"to"),u=t.toRef(e,"href"),p=t.toRef(e,"tag"),{tag:h,isLink:m}=he({to:c,href:u,tag:p}),y=t.computed(()=>e.disabled||e.loading||(o==null?void 0:o.disabled.value)||(l==null?void 0:l.disabled.value)||(a==null?void 0:a.disabled.value)),b=t.computed(()=>C.value!=="button"?null:e.loading?"true":null),k=t.computed(()=>y.value?"true":null),g=t.computed(()=>C.value!=="button"?null:e.active?"true":null),$=t.computed(()=>({[`-${s.value}`]:!0,[`-${d.value}`]:!0,"-active":e.active,"-block":e.block,"-circle":e.circle,"-disabled":y.value,"-link":e.link,"-outline":e.outline,"-loading":e.loading})),C=t.computed(()=>e.tag==="button"||e.tag==="input"?null:"button"),N=t.computed(()=>!m.value&&(e.tag==="button"||e.tag==="input")?e.type:null),B=t.computed(()=>y.value?-1:e.tabindex);return{bindings:t.computed(()=>({...n,...c.value?{to:c.value}:u.value?{href:u.value}:{},role:C.value,type:N.value,tabindex:B.value,disabled:y.value,"aria-disabled":k.value,"aria-pressed":g.value,"aria-busy":b.value,"aria-live":"polite"})),classes:$,currentTag:p,tag:h}}}),pl={key:1,class:"button-content"},yl={key:0,class:"button-icon"},hl={key:1,class:"button-content"};function bl(e,n,o,a,l,r){const i=t.resolveComponent("ILoader");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),t.mergeProps(e.bindings,{tag:e.currentTag,class:["button",e.classes]}),{default:t.withCtx(()=>[e.loading?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.showLoadingIcon?(t.openBlock(),t.createBlock(i,{key:0,class:"button-icon"})):t.createCommentVNode("",!0),e.$slots.loading?(t.openBlock(),t.createElementBlock("span",pl,[t.renderSlot(e.$slots,"loading")])):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.$slots.icon?(t.openBlock(),t.createElementBlock("span",yl,[t.renderSlot(e.$slots,"icon")])):t.createCommentVNode("",!0),e.$slots.default?(t.openBlock(),t.createElementBlock("span",hl,[t.renderSlot(e.$slots,"default")])):t.createCommentVNode("",!0)],64))]),_:3},16,["tag","class"])}const x=S(ml,[["render",bl]]),gl={validation:{alpha:({params:e})=>{let n;switch(!0){case((e==null?void 0:e.allowSpaces)&&(e==null?void 0:e.allowDashes)):n="letters, spaces, and dashes";break;case(e==null?void 0:e.allowSpaces):n="letters and spaces";break;case(e==null?void 0:e.allowDashes):n="letters and dashes";break;default:n="letters"}return`Please enter ${n} only.`},alphanumeric:({params:e})=>{let n;switch(!0){case((e==null?void 0:e.allowSpaces)&&(e==null?void 0:e.allowDashes)):n="letters, numbers, spaces, and dashes";break;case(e==null?void 0:e.allowSpaces):n="letters, numbers, and spaces";break;case(e==null?void 0:e.allowDashes):n="letters, numbers, and dashes";break;default:n="letters and numbers"}return`Please enter ${n} only.`},number:({params:e})=>{let n;switch(!0){case((e==null?void 0:e.allowNegative)&&(e==null?void 0:e.allowDecimal)):n="positive or negative decimal numbers";break;case(e==null?void 0:e.allowNegative):n="positive or negative numbers";break;case(e==null?void 0:e.allowDecimal):n="decimal numbers";break;default:n="numbers"}return`Please enter ${n} only.`},email:"Please enter a valid email address.",max:"Please enter a maximum value of {{params.value}}.",maxLength:({value:e})=>Array.isArray(e)?"Please select up to {{params.value}} items.":"Please enter up to {{params.value}} characters.",min:"Please enter a minimum value of {{params.value}}.",minLength:({value:e})=>Array.isArray(e)?"Please select at least {{params.value}} items.":"Please enter at least {{params.value}} characters.",required:"Please enter a value for this field.",sameAs:"Please make sure that the two values match.",custom:"Please enter a correct value for this field."},modals:{confirm:"Confirm",cancel:"Cancel"}};function Pt(e,n){return`-${e.replace("xxl","2xl").replace(/([A-Z])/g,"-$1").replace(/([a-z])([0-9])/g,"$1-$2").toLowerCase()}${typeof n!="boolean"&&n?`-${n}`:""}`}function ee(e){const n=t.unref(e);return n?n instanceof HTMLElement?n:n.$el:null}var to=0 .constructor,$l=to.isFinite;to.isInteger;var kl=[].constructor.isArray;function Ve(e){return e!==null&&typeof e=="object"}function Bl(e){return typeof e=="function"}function Ge(e,n){return n===void 0&&(n=0),typeof e=="string"&&e.length>=n}function no(e){return $l(e)}function Rt(e){return kl(e)}function wl(e,n){return Ve(e)&&n in e}var Cl=1e3,oo="'\"`",Sl=function(){function e(n){this.size=n,this.reset()}return e.prototype.reset=function(){this.oldestIndex=0,this.map={},this.cachedKeys=new Array(this.size)},e.prototype.get=function(n){return this.map[n]},e.prototype.set=function(n,o){this.map[n]=o;var a=this.cachedKeys[this.oldestIndex];a!==void 0&&delete this.map[a],this.cachedKeys[this.oldestIndex]=n,this.oldestIndex++,this.oldestIndex%=this.size},e}(),ao=new Sl(Cl);function Il(e){var n=e.charAt(0),o=e.substr(-1);if(oo.includes(n)||oo.includes(o)){if(e.length<2||n!==o)throw new SyntaxError('Mismatching string quotation: "'+e+'"');return e.substring(1,e.length-1)}if(e.includes("["))throw new SyntaxError('Missing ] in varName "'+e+'"');return n==="+"?e.substr(1):e}function lo(e,n,o){var a=n.trim();if(a==="")return e;if(a.startsWith("."))if(o){if(a=a.substr(1).trim(),a==="")return e}else throw new SyntaxError('Unexpected . at the start of "'+n+'"');else if(o)throw new SyntaxError('Missing . at the start of "'+n+'"');if(a.endsWith("."))throw new SyntaxError('Unexpected "." at the end of "'+n+'"');for(var l=a.split("."),r=0,i=l;r<i.length;r++){var s=i[r],d=s.trim();if(d==="")throw new SyntaxError('Empty prop name when parsing "'+n+'"');e.push(d)}return e}function _e(e){if(!Ge(e))throw new TypeError("Cannot parse path. Expected string. Got a "+typeof e);for(var n,o=0,a,l,r=!1,i=new Array(0),s=0;s<e.length&&(n=e.indexOf("[",s),n!==-1);s=o){if(o=e.indexOf("]",n),o===-1)throw new SyntaxError('Missing ] in varName "'+e+'"');if(l=e.substring(n+1,o).trim(),l.length===0)throw new SyntaxError("Unexpected token ]");o++,a=e.substring(s,n),lo(i,a,r),i.push(Il(l)),r=!0}var d=e.substring(o);return lo(i,d,r)}function Nl(e){var n=ao.get(e);return n===void 0&&(n=_e(e),ao.set(e,n)),n}_e.cached=Nl;function vl(e,n,o){if(o===void 0&&(o={}),!Ve(o))throw new TypeError("get expects an object option. Got "+typeof o);var a=o.depth,l=a===void 0?10:a;if(!no(l)||l<=0)throw new RangeError("Expected a positive number for depth. Got "+l);var r=Array.isArray(n)?n:_e.cached(n),i=function(){return r.join(" > ")};if(r.length>l)throw new ReferenceError("The path cannot be deeper than "+l+' levels. Got "'+i()+'"');for(var s=e,d=0,c=r;d<c.length;d++){var u=c[d];if(wl(s,u))s=s[u];else{if(o.propsExist)throw new ReferenceError(u+' is not defined in the scope at path: "'+i()+'"');return}}return s}var El=function(){function e(n,o){var a=this;if(o===void 0&&(o={}),this.tokens=n,this.options=o,this.render=function(l){l===void 0&&(l={});var r=a.tokens.varNames,i=r.length;a.cacheParsedPaths();for(var s=new Array(i),d=0;d<i;d++)s[d]=vl(l,a.toPathCache[d],a.options);return a.stringify(s)},this.renderFn=function(l,r){r===void 0&&(r={});var i=a.resolveVarNames(l,r);return a.stringify(i)},this.renderFnAsync=function(l,r){return r===void 0&&(r={}),Promise.all(a.resolveVarNames(l,r)).then(function(i){return a.stringify(i)})},!Ve(n)||!Rt(n.strings)||!Rt(n.varNames)||n.strings.length!==n.varNames.length+1)throw new TypeError("Invalid tokens object");if(!Ve(o))throw new TypeError("Options should be an object. Got a "+typeof o);o.validateVarNames&&this.cacheParsedPaths()}return e.prototype.cacheParsedPaths=function(){var n=this.tokens.varNames;if(this.toPathCache===void 0){this.toPathCache=new Array(n.length);for(var o=0;o<n.length;o++)this.toPathCache[o]=_e.cached(n[o])}},e.prototype.resolveVarNames=function(n,o){o===void 0&&(o={});var a=this.tokens.varNames;if(!Bl(n))throw new TypeError("Expected a resolver function. Got "+String(n));for(var l=a.length,r=new Array(l),i=0;i<l;i++)r[i]=n.call(null,a[i],o);return r},e.prototype.stringify=function(n){for(var o=this.tokens.strings,a=this.options.explicit,l=n.length,r="",i=0;i<l;i++){r+=o[i];var s=n[i];(a||s!=null)&&(r+=s)}return r+=o[l],r},e}();function Al(e,n){if(n===void 0&&(n={}),!Ge(e))throw new TypeError("The template parameter must be a string. Got a "+typeof e);if(!Ve(n))throw new TypeError("Options should be an object. Got a "+typeof n);var o=n.tags,a=o===void 0?["{{","}}"]:o,l=n.maxVarNameLength,r=l===void 0?1e3:l;if(!Rt(a)||a.length!==2)throw TypeError("tags should be an array of two elements. Got "+String(a));var i=a[0],s=a[1];if(!Ge(i,1)||!Ge(s,1)||i===s)throw new TypeError('The open and close symbols should be two distinct non-empty strings. Got "'+i+'" and "'+s+'"');if(!no(r)||r<=0)throw new Error("Expected a positive number for maxVarNameLength. Got "+r);for(var d=i.length,c=s.length,u,p=0,h,m=[],y=[],b=0;b<e.length&&(u=e.indexOf(i,b),u!==-1);){var k=u+d;if(p=e.substr(k,r+c).indexOf(s),p===-1)throw new SyntaxError('Missing "'+s+'" in the template for the "'+i+'" at position '+u+" within "+r+" characters");if(p+=k,h=e.substring(k,p).trim(),h.length===0)throw new SyntaxError('Unexpected "'+s+'" tag found at position '+u);if(h.includes(i))throw new SyntaxError('Variable names cannot have "'+i+'". But at position '+u+'. Got "'+h+'"');y.push(h),p+=c,m.push(e.substring(b,u)),b=p}return m.push(e.substring(p)),{strings:m,varNames:y}}function Vl(e,n){n===void 0&&(n={});var o=Al(e,n);return new El(o,n)}function Pl(e,n,o){var a=Vl(e,o);return a.render(n)}function xe(e,n={}){return Pl(e,n)}const zt=e=>e.map(n=>n.type==="element"?t.h(n.name,n.attributes,zt(n.children)):n.value);function fe(e,n={}){const o=Ae(et.messages[et.locale],e),a=(Gn(o)?o(n):o)||e;return xe(a,n)}const et={locale:"en",messages:{en:gl}};function ro(e){et.locale=e}function Pe(){return Xe}function io(){const e=Pe();return n=>new Promise(o=>{const a=M("alert");e.show({id:a,type:"alert",onClose:()=>o(),header:n.title,body:n.message,footer:n.footer||t.h(x,{onClick:()=>{e.hide({id:a})},color:"primary",...n.confirmButtonProps},()=>n.confirmButtonText??fe("modals.confirm")),...n})})}function so(){const e=Pe();return n=>new Promise(o=>{const a=M("confirm");e.show({id:a,type:"confirm",onClose:()=>o(!1),header:n.title,body:n.message,footer:n.footer||t.h("div",[t.h(x,{onClick:()=>{e.hide({id:a}),o(!1)},...n.cancelButtonProps},()=>n.cancelButtonText??fe("modals.cancel")),t.h(x,{onClick:()=>{e.hide({id:a}),o(!0)},color:"primary",...n.confirmButtonProps},()=>n.confirmButtonText??fe("modals.confirm"))]),...n})})}const co="IIcon",re=t.defineComponent({name:co,props:{name:{type:String,default:""},size:{type:String,default:void 0}},setup(e){const n=t.inject(kt,{}),o=t.computed(()=>cl(e.name)),a=t.computed(()=>n[o.value]),l=t.computed(()=>e.size),{size:r}=A({componentName:co,currentSize:l}),i=t.computed(()=>({"inkline-icon":!0,[`-${r.value}`]:!0}));return t.onMounted(()=>{o.value&&!n[o.value]&&console.error(`The icon ${o.value} is not registered.`)}),()=>{var s,d;return t.h("svg",{class:i.value,...(s=a.value)==null?void 0:s.attributes},zt(((d=a.value)==null?void 0:d.children)||[]))}}}),Ot="IInput",Rl=t.defineComponent({name:Ot,components:{IIcon:re},inheritAttrs:!1,props:{color:{type:String,default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},error:{type:[Array,Boolean],default:()=>["touched","dirty","invalid"]},id:{type:String,default:void 0},wrapperId:{type:String,default:void 0},modelValue:{type:[String,Number],default:""},name:{type:String,default:()=>M("input")},plaintext:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{type:String,default:void 0},tabindex:{type:[Number,String],default:0},type:{type:String,default:"text"},clearAriaLabel:{type:String,default:"Clear"},showPasswordToggleAriaLabel:{type:String,default:"Toggle password visibility"},showPasswordToggle:{type:Boolean,default:!0},validate:{type:Boolean,default:!0}},emits:["update:modelValue","clear","togglePassword"],setup(e,{attrs:n,emit:o,slots:a}){const l=t.inject(Z,null),r=t.inject(H,null),i=t.computed(()=>e.color||(r==null?void 0:r.color.value)||(l==null?void 0:l.color.value)),s=t.computed(()=>e.size||(r==null?void 0:r.size.value)||(l==null?void 0:l.size.value)),{color:d}=V({componentName:Ot,currentColor:i}),{size:c}=A({componentName:Ot,currentSize:s}),u=t.computed(()=>!!(e.disabled||r!=null&&r.disabled.value||l!=null&&l.disabled.value)),p=t.computed(()=>!!(e.readonly||r!=null&&r.readonly.value||l!=null&&l.readonly.value)),h=t.ref(null),m=["class","className",/^data-/],y=t.computed(()=>Yn(n,{allowlist:m})),b=t.computed(()=>Yn(n,{denylist:m})),k=t.toRef(e,"name"),g=t.toRef(e,"validate"),{schema:$,onInput:C,onBlur:N}=W({name:k,validate:g}),B=t.toRef(e,"error"),{hasError:w}=Y({schema:$,error:B}),v=t.ref(!1),z=t.computed(()=>e.showPasswordToggle&&e.type==="password"&&R.value!==""),O=t.computed(()=>e.type==="password"&&v.value?"text":e.type),P=t.computed(()=>u.value?-1:e.tabindex),R=t.computed(()=>$.value&&g.value?$.value.value:e.modelValue),I=t.computed(()=>e.clearable&&!u.value&&!p.value&&R.value!==""),T=t.ref(j()),D=t.computed(()=>({[`-${d.value}`]:!0,[`-${c.value}`]:!0,"-disabled":u.value,"-error":w.value,"-readonly":p.value,...T.value}));t.onBeforeUpdate(()=>{T.value=j()});function j(){return{"-prefixed":!!a.prefix,"-suffixed":!!a.suffix,"-prepended":!!a.prepend,"-appended":!!a.append}}function F(_){N(k,_)}function U(_){const je=_.target;C(k,je.value),o("update:modelValue",je.value)}function Se(_){_.stopPropagation(),o("clear",_),C(k,""),o("update:modelValue","")}function Kn(_){_.stopPropagation(),o("togglePassword",_),v.value=!v.value}return{input:h,wrapperAttrs:y,inputAttrs:b,tabIndex:P,value:R,inputType:O,isClearable:I,isPasswordToggleable:z,showPassword:v,classes:D,onBlur:F,onInput:U,onClear:Se,onTogglePassword:Kn}}}),zl=["id"],Ol={key:0,class:"input-prepend"},Tl={class:"input"},Ll={key:0,class:"input-prefix"},Dl={key:1,class:"input-value-overlay"},Ml=["id","value","name","type","tabindex","disabled","aria-disabled","readonly","aria-readonly"],Fl=["id","value","name","tabindex","disabled","aria-disabled","readonly","aria-readonly"],jl={key:4,class:"input-suffix"},Kl={key:1,class:"input-append"};function Ul(e,n,o,a,l,r){const i=t.resolveComponent("IIcon");return t.openBlock(),t.createElementBlock("div",t.mergeProps({id:e.id&&`${e.id}-wrapper`,class:["input-wrapper",e.classes]},e.wrapperAttrs),[e.$slots.prepend?(t.openBlock(),t.createElementBlock("div",Ol,[t.renderSlot(e.$slots,"prepend")])):t.createCommentVNode("",!0),t.createElementVNode("div",Tl,[e.$slots.prefix?(t.openBlock(),t.createElementBlock("span",Ll,[t.renderSlot(e.$slots,"prefix")])):t.createCommentVNode("",!0),e.$slots.value?(t.openBlock(),t.createElementBlock("div",Dl,[t.renderSlot(e.$slots,"value")])):t.createCommentVNode("",!0),e.type!=="textarea"?(t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2},e.inputAttrs,{id:e.id,ref:"input",value:e.value,name:e.name,type:e.inputType,tabindex:e.tabIndex,disabled:e.disabled,"aria-disabled":e.disabled?"true":!1,readonly:e.readonly||e.plaintext,"aria-readonly":e.readonly||e.plaintext?"true":!1,onInput:n[0]||(n[0]=(...s)=>e.onInput&&e.onInput(...s)),onBlur:n[1]||(n[1]=(...s)=>e.onBlur&&e.onBlur(...s))}),null,16,Ml)):(t.openBlock(),t.createElementBlock("textarea",t.mergeProps({key:3},e.inputAttrs,{id:e.id,ref:"input",value:e.value,role:"textbox",name:e.name,tabindex:e.tabIndex,disabled:e.disabled,"aria-disabled":e.disabled?"true":!1,readonly:e.readonly||e.plaintext,"aria-readonly":e.readonly||e.plaintext?"true":!1,"aria-multiline":"true",onInput:n[2]||(n[2]=(...s)=>e.onInput&&e.onInput(...s)),onBlur:n[3]||(n[3]=(...s)=>e.onBlur&&e.onBlur(...s))}),null,16,Fl)),e.$slots.suffix||e.isClearable||e.isPasswordToggleable?(t.openBlock(),t.createElementBlock("span",jl,[e.showPasswordToggle&&e.type==="password"?t.renderSlot(e.$slots,"password-toggle",{key:0,onTogglePassword:e.onTogglePassword},()=>[t.withDirectives(t.createVNode(i,{name:e.showPassword?"ink-eye":"ink-eye-off",class:"input-icon input-password-toggle",role:"button","aria-label":e.showPasswordToggleAriaLabel,"aria-hidden":e.isPasswordToggleable?"false":"true",onClick:e.onTogglePassword},null,8,["name","aria-label","aria-hidden","onClick"]),[[t.vShow,e.isPasswordToggleable]])]):t.createCommentVNode("",!0),e.clearable?t.renderSlot(e.$slots,"clearable",{key:1,onClear:e.onClear},()=>[t.withDirectives(t.createVNode(i,{name:"ink-clear",class:"input-icon input-clear",role:"button","aria-label":e.clearAriaLabel,"aria-hidden":e.isClearable?"false":"true",onClick:e.onClear},null,8,["aria-label","aria-hidden","onClick"]),[[t.vShow,e.isClearable]])]):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"suffix")])):t.createCommentVNode("",!0)]),e.$slots.append?(t.openBlock(),t.createElementBlock("div",Kl,[t.renderSlot(e.$slots,"append")])):t.createCommentVNode("",!0)],16,zl)}const te=S(Rl,[["render",Ul]]),Tt="IForm",Zl=t.defineComponent({name:Tt,inheritAttrs:!1,props:{color:{type:String,default:void 0},disabled:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},name:{type:String,default:M("form")},modelValue:{type:Object,default:void 0},readonly:{type:Boolean,default:!1},size:{type:String,default:void 0},validate:{type:Boolean,default:!0}},emits:["update:modelValue","submit"],setup(e,{emit:n}){const o=t.computed(()=>e.color),a=t.computed(()=>e.size),{size:l}=A({componentName:Tt,currentSize:a}),{color:r}=V({componentName:Tt,currentColor:o}),i=t.computed(()=>e.disabled),s=t.computed(()=>e.readonly),d=t.toRef(e,"validate"),c=t.toRef(e,"modelValue"),{schema:u,onBlur:p,onInput:h,onSubmit:m}=W({validate:d,schema:c,onUpdate:$=>{n("update:modelValue",$)},onSubmit:$=>{n("submit",$)}}),y=t.ref(["invalid"]),{hasError:b}=Y({schema:u,error:y}),k=t.computed(()=>({[`-${l.value}`]:!0,[`-${r.value}`]:!0,"-disabled":e.disabled,"-readonly":e.readonly,"-inline":e.inline,"-error":b.value}));async function g($){e.modelValue?await m($):n("submit",$)}return t.provide(Z,{schema:u,disabled:i,readonly:s,size:l,color:r,onBlur:p,onInput:h}),{classes:k,onSubmit:g}}}),Hl=["name","readonly","disabled"];function Wl(e,n,o,a,l,r){return t.openBlock(),t.createElementBlock("form",t.mergeProps(e.$attrs,{class:["form",e.classes],role:"form",name:e.name,readonly:e.readonly,disabled:e.disabled,onSubmit:n[0]||(n[0]=t.withModifiers((...i)=>e.onSubmit&&e.onSubmit(...i),["prevent"]))}),[t.renderSlot(e.$slots,"default")],16,Hl)}const Lt=S(Zl,[["render",Wl]]),Dt="IFormGroup",Xl=t.defineComponent({name:Dt,inheritAttrs:!1,props:{color:{type:String,default:void 0},disabled:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},name:{type:String,default:""},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},size:{type:String,default:void 0},validate:{type:Boolean,default:!0}},setup(e){const n=t.inject(Z,null),o=t.inject(H,null),a=t.toRef(e,"name"),l=t.toRef(e,"validate"),{schema:r,onBlur:i,onInput:s}=W({name:a,validate:l}),d=t.ref(["invalid"]),{hasError:c}=Y({schema:r,error:d}),u=t.computed(()=>e.color||(o==null?void 0:o.color.value)||(n==null?void 0:n.color.value)),p=t.computed(()=>e.size||(o==null?void 0:o.size.value)||(n==null?void 0:n.size.value)),{color:h}=V({componentName:Dt,currentColor:u}),{size:m}=A({componentName:Dt,currentSize:p}),y=t.computed(()=>!!(e.disabled||o!=null&&o.disabled.value||n!=null&&n.disabled.value)),b=t.computed(()=>!!(e.readonly||o!=null&&o.readonly.value||n!=null&&n.readonly.value)),k=t.computed(()=>({[`-${m.value}`]:!0,[`-${h.value}`]:!0,"-disabled":y.value,"-readonly":b.value,"-inline":e.inline,"-error":c.value,"-required":e.required}));return t.provide(H,{disabled:y,readonly:b,size:m,color:h,onBlur:i,onInput:s}),{classes:k,disabled:y,readonly:b,size:m,color:h,onBlur:i,onInput:s}}}),ql=["name"];function Ql(e,n,o,a,l,r){return t.openBlock(),t.createElementBlock("fieldset",t.mergeProps(e.$attrs,{class:["form-group",e.classes],name:e.name,role:"group"}),[t.renderSlot(e.$slots,"default")],16,ql)}const Mt=S(Xl,[["render",Ql]]),Yl="IFormError",Jl=t.defineComponent({name:Yl,inheritAttrs:!1,props:{for:{type:String,default:""},visible:{type:[Array,String],default:()=>["touched","dirty","invalid"]}},setup(e){const n=t.toRef(e,"for"),o=t.ref(!0),{schema:a}=W({name:n,validate:o}),l=t.computed(()=>a.value.errors||[]),r=t.computed(()=>{let i=!0;return a.value&&e.visible&&[].concat(e.visible).forEach(s=>{i=i&&a.value[s]}),i});return{errors:l,visible:r,schema:a}}});function Gl(e,n,o,a,l,r){return e.schema?(t.openBlock(),t.createBlock(t.Transition,{key:0,name:"fade-in-transition"},{default:t.withCtx(()=>[e.errors.length>0?t.withDirectives((t.openBlock(),t.createElementBlock("ul",t.mergeProps({key:0},e.$attrs,{class:"form-error","aria-live":"polite"}),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.errors,(i,s)=>(t.openBlock(),t.createElementBlock("li",{key:`${s}-${i.name}`},t.toDisplayString(i.message),1))),128))],16)),[[t.vShow,e.visible]]):t.createCommentVNode("",!0)]),_:1})):t.createCommentVNode("",!0)}const Ft=S(Jl,[["render",Gl]]);function uo(){const e=Pe();return n=>new Promise((o,a)=>{const l=M("prompt"),{schema:r,form:i,validate:s}=Vo(n.schema||{input:{validators:["required"]}}),d=t.computed(()=>r.value.invalid||r.value.pristine);e.show({id:l,type:"prompt",onClose:()=>a(new Error("Prompt cancelled")),header:n.title,body:n.body||t.h("div",[t.h("p",n.message),t.h(Lt,{modelValue:r,"onUpdate:modelValue"(c){r.value=c}},()=>[...n.inputs??[t.h(Mt,{},()=>[t.h(te,{name:"input",placeholder:"Enter a value...",...n.inputProps}),t.h(Ft,{for:"input"})])]])]),footer:n.footer||t.markRaw(t.defineComponent({setup(){return()=>t.h("div",[t.h(x,{onClick:()=>{e.hide({id:l}),a(new Error("Prompt cancelled"))},...n.cancelButtonProps},()=>n.cancelButtonText??fe("modals.cancel")),t.h(x,{onClick:async()=>{await s(),r.value.valid&&(e.hide({id:l}),o(i.value))},disabled:d.value,color:"primary",...n.confirmButtonProps},()=>n.confirmButtonText??fe("modals.confirm"))])}})),...n})})}function me(e){const n=o=>{const a=t.unref(e.fn);if(!e.elementRef.value)return;const l=o.target;!el(e.elementRef.value)||!l||e.elementRef.value===l||e.elementRef.value.contains(l)||a(o)};t.onMounted(()=>{typeof window<"u"&&G(window.document,"mousedown",n)}),t.onUnmounted(()=>{typeof window<"u"&&J(window.document,"mousedown",n)})}function jt(e){const n=t.ref(e.modelValue.value),o=t.ref(typeof e.collapse.value=="boolean"?e.collapse.value:!1),a=t.ref(typeof window<"u"?window.innerWidth:0),l=t.computed(()=>({"-open":n.value,"-collapsible":o.value,[`-collapse-${e.collapse.value}`]:!!e.collapse.value}));t.watch(()=>e.modelValue.value,c=>{n.value=c}),t.onMounted(()=>{typeof window<"u"&&(G(window,"resize",d),d())}),t.onBeforeUnmount(()=>{typeof window<"u"&&J(window,"resize",d)});function r(){e.collapse.value===!0||e.collapse.value===!1?o.value=e.collapse.value:o.value=a.value<=Ne[e.collapse.value][1]}function i(c){n.value=c,e.emit("update:modelValue",n.value)}function s(){n.value=!n.value,e.emit("update:modelValue",n.value)}function d(){if(!(typeof window>"u")){if(typeof e.collapse.value!="boolean"){const c=window.innerWidth;a.value<=Ne[e.collapse.value][1]&&c>Ne[e.collapse.value][1]&&i(!1),a.value=window.innerWidth}r()}}return{open:n,collapsible:o,classes:l,setOpen:i,toggleOpen:s}}function pe(){return t.inject(ve)}function V(e){const n=pe();return{color:t.computed(()=>{var l,r,i;let a=e.currentColor.value||"light";return!e.currentColor.value&&(n!=null&&n.options)&&((l=n.options.componentOptions[e.componentName])!=null&&l.color?a=(r=n.options.componentOptions[e.componentName])==null?void 0:r.color:n.options.color?a=n.options.color:n.options.colorMode==="system"?a=typeof window<"u"&&((i=window.matchMedia)!=null&&i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light":a=n.options.colorMode),a})}}function A(e){const n=pe();return{size:t.computed(()=>{var l,r;let a=e.currentSize.value||"md";return!e.currentSize.value&&(n!=null&&n.options)&&((l=n.options.componentOptions[e.componentName])!=null&&l.size?a=(r=n.options.componentOptions[e.componentName])==null?void 0:r.size:n.options.size&&(a=n.options.size)),a})}}const ne={"en-US":/^[A-Z]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ω]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/},oe={"en-US":/^[0-9A-Z]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/},_l=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"];["AU","GB","HK","IN","NZ","ZA","ZM"].forEach(e=>{ne[`en-${e}`]=ne["en-US"],oe[`en-${e}`]=oe["en-US"]}),_l.forEach(e=>{ne[`ar-${e}`]=ne.ar,oe[`ar-${e}`]=oe.ar}),ne["pt-BR"]=ne["pt-PT"],oe["pt-BR"]=oe["pt-PT"],ne["pl-Pl"]=ne["pl-PL"],oe["pl-Pl"]=oe["pl-PL"];const fo=(e,n)=>{const o=n.locale||"en-US",a=l=>{let r=String(l);return n.allowDashes&&(r=r.replace(/-/g,"")),n.allowSpaces&&(r=r.replace(/ /g,"")),r};return(e==null?void 0:e.constructor)===Array?e.every(l=>ne[o].test(a(l))):ne[o].test(a(e))},mo=(e,n)=>{const o=n.locale||"en-US",a=l=>{let r=String(l);return n.allowDashes&&(r=r.replace(/-/g,"")),n.allowSpaces&&(r=r.replace(/ /g,"")),r};return(e==null?void 0:e.constructor)===Array?e.every(l=>oe[o].test(a(l))):oe[o].test(a(e))},po=async(e,n)=>{if(!n.validator)return console.error("No `validator` function provided for custom validator."),!0;if((e==null?void 0:e.constructor)===Array){let o=!0;for(const a of e)o=o&&await n.validator(a,n);return o}return n.validator(e,n)},yo=(e,n)=>{let o="\\d+";n.allowNegative&&(o="[-]?"+o),n.allowDecimal&&(o+="([\\.\\,]\\d+)?");const a=new RegExp(`^${o}$`);return(e==null?void 0:e.constructor)===Array?e.every(l=>a.test(l)):a.test(String(e))},ho=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,bo=e=>(e==null?void 0:e.constructor)===Array?e.every(n=>!n||ho.test(String(n))):!e||ho.test(String(e)),go=(e,n)=>{if(typeof n.value>"u")return console.error('The "value" option must be specified for "max" validator.'),!0;if(typeof e>"u"||e===null)return!1;const o=a=>Number(a);return Array.isArray(e)?e.every(a=>o(a)<=n.value):o(e)<=n.value},$o=(e,n)=>typeof n.value>"u"?(console.error('The "value" option must be specified for "maxLength" validator.'),!0):typeof e>"u"||e===null?!1:e.constructor===Array?e.length<=n.value:typeof e=="object"?Object.keys(e).length<=n.value:String(e).length<=n.value,ko=(e,n)=>{if(typeof n.value>"u")return console.error('The "value" option must be specified for "min" validator.'),!0;if(typeof e>"u"||e===null)return!1;const o=a=>Number(a);return Array.isArray(e)?e.every(a=>o(a)>=n.value):o(e)>=n.value},Bo=(e,n)=>typeof n.value>"u"?(console.error('The "value" option must be specified for "minLength" validator.'),!0):typeof e>"u"||e===null?!1:e.constructor===Array?e.length>=n.value:typeof e=="object"?Object.keys(e).length>=n.value:String(e).length>=n.value,wo=(e,n)=>e==null?!1:e.constructor===Array?!!e.length:typeof e=="boolean"?n.invalidateFalse?!!e:!0:!!String(e).trim().length,Co=(e,n)=>{if(!n.target)return console.error('The "target" option must be specified for "sameAs" validator.'),!1;const o=Ae(n.schema,n.target);if(!o)throw new Error(`Could not find target with name '${n.target}' in 'sameAs' validator.`);return e===o.value};function ke(e){return Object.keys(e).length===0||e.hasOwnProperty("value")||e.hasOwnProperty("validators")}function So(e){return Array.isArray(e)&&e.every(ke)}function ye(e){return!ke(e)}function Io(e){return Array.isArray(e)&&e.every(ye)}function Re(e){return{...Ye,...eo,...e}}function No(e){return e.map(n=>ye(n)?ze(n):Re(n))}function vo(e){const n={...Ye};for(const o of Object.keys(e)){const a=e[o];Array.isArray(a)?n[o]=No(a):ye(a)?n[o]=ze(a):ke(a)&&(n[o]=Re(a))}return n}function ze(e){return vo(e)}function Kt(e){const n={...Ye};for(const o of Object.keys(e)){const a=e[o];Array.isArray(a)?n[o]=a.map(l=>typeof l=="object"?Kt(l):Re({value:l})):typeof a=="object"?n[o]=Kt(a):n[o]=Re({value:a})}return n}function tt(e){const n={};return Object.keys(e).forEach(o=>{if(!e.hasOwnProperty(o)||Je.includes(o))return;const a=e[o];Array.isArray(a)?n[o]=a.map(l=>ye(l)?tt(l):l.value):ye(a)?n[o]=tt(a):ke(a)&&(n[o]=a.value)}),n}function Ut(e,n){const o={...e};return Object.keys(n).forEach(a=>{const l=n[a];Array.isArray(e)||(o[a]=l)}),Object.keys(e).filter(a=>!Je.includes(a)).forEach(a=>{const l=e[a];(typeof e[a]=="object"||Array.isArray(e[a]))&&(o[a]=Ut(l,n))}),o}const nt={alpha:fo,alphanumeric:mo,custom:po,number:yo,email:bo,max:go,maxLength:$o,min:ko,minLength:Bo,required:wo,sameAs:Co};function xl(e,n){nt[e]=n}function er(e){delete nt[e]}async function Zt(e,n="",o){const a=[],l={...e};let r=!0;for(const i of l.validators||[]){const s={...typeof i=="string"?{name:i}:i,schema:o,path:n},d=await nt[s.name](l.value,s);if(!d){const{name:c,message:u,...p}=s,h={name:n.split(".").pop(),value:e.value,params:p},m=(u instanceof Function?u():u)||fe(`validation.${c}`,h);a.push({name:c,message:m,path:n})}r=r&&d}return l.valid=r,l.invalid=!r,l.errors=a,l}async function Eo(e,n="",o){return Promise.all(e.map((a,l)=>Zt(a,n?`${n}.${l}`:`${l}`,o)))}async function Ao(e,n="",o){return Promise.all(e.map((a,l)=>ot(a,n?`${n}.${l}`:`${l}`,o)))}async function ot(e,n="",o){const a={...e};let l=!0;const r=Object.keys(a).filter(i=>!Je.includes(i));for(const i of r){const s=a[i];let d=!0;So(s)?a[i]=await Eo(s,n?`${n}.${i}`:`${i}`,o):Io(s)?a[i]=await Ao(s,n?`${n}.${i}`:`${i}`,o):ke(s)?a[i]=await Zt(s,n?`${n}.${i}`:i,o):ye(s)&&(a[i]=await ot(s,n?`${n}.${i}`:i,o)),Array.isArray(a[i])?d=a[i].every(c=>c.valid):d=a[i].valid,l=l&&d}return a.valid=l,a.invalid=!l,a}async function Oe(e){return ot(e,"",e)}function Vo(e){const n=t.ref(ze(e)),o=t.computed(()=>tt(n.value));async function a(){n.value=await Oe(n.value)}return{form:o,schema:n,validate:a}}function Po(){return{isServer:t.ref(typeof window>"u")}}function he(e){const n=pe(),o=t.computed(()=>e.to.value||e.href.value);return{tag:t.computed(()=>{var r;const l=(r=n==null?void 0:n.options)==null?void 0:r.routerComponent;return e.to.value&&l?typeof l=="string"?t.resolveComponent(l):l:e.href.value?"a":e.tag.value}),isLink:o}}function tr(){const e=Pe(),n=io(),o=so(),a=uo();return{...e,alert:n,confirm:o,prompt:a}}const Be=Math.min,be=Math.max,at=Math.round,lt=Math.floor,ce=e=>({x:e,y:e}),nr={left:"right",right:"left",bottom:"top",top:"bottom"},or={start:"end",end:"start"};function Ht(e,n,o){return be(e,Be(n,o))}function Te(e,n){return typeof e=="function"?e(n):e}function ge(e){return e.split("-")[0]}function Le(e){return e.split("-")[1]}function Ro(e){return e==="x"?"y":"x"}function Wt(e){return e==="y"?"height":"width"}function rt(e){return["top","bottom"].includes(ge(e))?"y":"x"}function Xt(e){return Ro(rt(e))}function ar(e,n,o){o===void 0&&(o=!1);const a=Le(e),l=Xt(e),r=Wt(l);let i=l==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return n.reference[r]>n.floating[r]&&(i=it(i)),[i,it(i)]}function lr(e){const n=it(e);return[qt(e),n,qt(n)]}function qt(e){return e.replace(/start|end/g,n=>or[n])}function rr(e,n,o){const a=["left","right"],l=["right","left"],r=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return o?n?l:a:n?a:l;case"left":case"right":return n?r:i;default:return[]}}function ir(e,n,o,a){const l=Le(e);let r=rr(ge(e),o==="start",a);return l&&(r=r.map(i=>i+"-"+l),n&&(r=r.concat(r.map(qt)))),r}function it(e){return e.replace(/left|right|bottom|top/g,n=>nr[n])}function sr(e){return{top:0,right:0,bottom:0,left:0,...e}}function zo(e){return typeof e!="number"?sr(e):{top:e,right:e,bottom:e,left:e}}function st(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Oo(e,n,o){let{reference:a,floating:l}=e;const r=rt(n),i=Xt(n),s=Wt(i),d=ge(n),c=r==="y",u=a.x+a.width/2-l.width/2,p=a.y+a.height/2-l.height/2,h=a[s]/2-l[s]/2;let m;switch(d){case"top":m={x:u,y:a.y-l.height};break;case"bottom":m={x:u,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:p};break;case"left":m={x:a.x-l.width,y:p};break;default:m={x:a.x,y:a.y}}switch(Le(n)){case"start":m[i]-=h*(o&&c?-1:1);break;case"end":m[i]+=h*(o&&c?-1:1);break}return m}const cr=async(e,n,o)=>{const{placement:a="bottom",strategy:l="absolute",middleware:r=[],platform:i}=o,s=r.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(n));let c=await i.getElementRects({reference:e,floating:n,strategy:l}),{x:u,y:p}=Oo(c,a,d),h=a,m={},y=0;for(let b=0;b<s.length;b++){const{name:k,fn:g}=s[b],{x:$,y:C,data:N,reset:B}=await g({x:u,y:p,initialPlacement:a,placement:h,strategy:l,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:n}});if(u=$??u,p=C??p,m={...m,[k]:{...m[k],...N}},B&&y<=50){y++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(c=B.rects===!0?await i.getElementRects({reference:e,floating:n,strategy:l}):B.rects),{x:u,y:p}=Oo(c,h,d)),b=-1;continue}}return{x:u,y:p,placement:h,strategy:l,middlewareData:m}};async function To(e,n){var o;n===void 0&&(n={});const{x:a,y:l,platform:r,rects:i,elements:s,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=Te(n,e),y=zo(m),k=s[h?p==="floating"?"reference":"floating":p],g=st(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(k)))==null||o?k:k.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:d})),$=p==="floating"?{...i.floating,x:a,y:l}:i.reference,C=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),N=await(r.isElement==null?void 0:r.isElement(C))?await(r.getScale==null?void 0:r.getScale(C))||{x:1,y:1}:{x:1,y:1},B=st(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:$,offsetParent:C,strategy:d}):$);return{top:(g.top-B.top+y.top)/N.y,bottom:(B.bottom-g.bottom+y.bottom)/N.y,left:(g.left-B.left+y.left)/N.x,right:(B.right-g.right+y.right)/N.x}}const dr=e=>({name:"arrow",options:e,async fn(n){const{x:o,y:a,placement:l,rects:r,platform:i,elements:s,middlewareData:d}=n,{element:c,padding:u=0}=Te(e,n)||{};if(c==null)return{};const p=zo(u),h={x:o,y:a},m=Xt(l),y=Wt(m),b=await i.getDimensions(c),k=m==="y",g=k?"top":"left",$=k?"bottom":"right",C=k?"clientHeight":"clientWidth",N=r.reference[y]+r.reference[m]-h[m]-r.floating[y],B=h[m]-r.reference[m],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let v=w?w[C]:0;(!v||!await(i.isElement==null?void 0:i.isElement(w)))&&(v=s.floating[C]||r.floating[y]);const z=N/2-B/2,O=v/2-b[y]/2-1,P=Be(p[g],O),R=Be(p[$],O),I=P,T=v-b[y]-R,D=v/2-b[y]/2+z,j=Ht(I,D,T),F=!d.arrow&&Le(l)!=null&&D!=j&&r.reference[y]/2-(D<I?P:R)-b[y]/2<0,U=F?D<I?D-I:D-T:0;return{[m]:h[m]+U,data:{[m]:j,centerOffset:D-j-U,...F&&{alignmentOffset:U}},reset:F}}}),ur=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var o,a;const{placement:l,middlewareData:r,rects:i,initialPlacement:s,platform:d,elements:c}=n,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...k}=Te(e,n);if((o=r.arrow)!=null&&o.alignmentOffset)return{};const g=ge(l),$=ge(s)===s,C=await(d.isRTL==null?void 0:d.isRTL(c.floating)),N=h||($||!b?[it(s)]:lr(s));!h&&y!=="none"&&N.push(...ir(s,b,y,C));const B=[s,...N],w=await To(n,k),v=[];let z=((a=r.flip)==null?void 0:a.overflows)||[];if(u&&v.push(w[g]),p){const I=ar(l,i,C);v.push(w[I[0]],w[I[1]])}if(z=[...z,{placement:l,overflows:v}],!v.every(I=>I<=0)){var O,P;const I=(((O=r.flip)==null?void 0:O.index)||0)+1,T=B[I];if(T)return{data:{index:I,overflows:z},reset:{placement:T}};let D=(P=z.filter(j=>j.overflows[0]<=0).sort((j,F)=>j.overflows[1]-F.overflows[1])[0])==null?void 0:P.placement;if(!D)switch(m){case"bestFit":{var R;const j=(R=z.map(F=>[F.placement,F.overflows.filter(U=>U>0).reduce((U,Se)=>U+Se,0)]).sort((F,U)=>F[1]-U[1])[0])==null?void 0:R[0];j&&(D=j);break}case"initialPlacement":D=s;break}if(l!==D)return{reset:{placement:D}}}return{}}}};async function fr(e,n){const{placement:o,platform:a,elements:l}=e,r=await(a.isRTL==null?void 0:a.isRTL(l.floating)),i=ge(o),s=Le(o),d=rt(o)==="y",c=["left","top"].includes(i)?-1:1,u=r&&d?-1:1,p=Te(n,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&typeof y=="number"&&(m=s==="end"?y*-1:y),d?{x:m*u,y:h*c}:{x:h*c,y:m*u}}const mr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){const{x:o,y:a}=n,l=await fr(n,e);return{x:o+l.x,y:a+l.y,data:l}}}},pr=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:o,y:a,placement:l}=n,{mainAxis:r=!0,crossAxis:i=!1,limiter:s={fn:k=>{let{x:g,y:$}=k;return{x:g,y:$}}},...d}=Te(e,n),c={x:o,y:a},u=await To(n,d),p=rt(ge(l)),h=Ro(p);let m=c[h],y=c[p];if(r){const k=h==="y"?"top":"left",g=h==="y"?"bottom":"right",$=m+u[k],C=m-u[g];m=Ht($,m,C)}if(i){const k=p==="y"?"top":"left",g=p==="y"?"bottom":"right",$=y+u[k],C=y-u[g];y=Ht($,y,C)}const b=s.fn({...n,[h]:m,[p]:y});return{...b,data:{x:b.x-o,y:b.y-a}}}}};function de(e){return Lo(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function ie(e){var n;return(n=(Lo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Lo(e){return e instanceof Node||e instanceof q(e).Node}function se(e){return e instanceof Element||e instanceof q(e).Element}function ae(e){return e instanceof HTMLElement||e instanceof q(e).HTMLElement}function Do(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}function De(e){const{overflow:n,overflowX:o,overflowY:a,display:l}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(n+a+o)&&!["inline","contents"].includes(l)}function yr(e){return["table","td","th"].includes(de(e))}function Qt(e){const n=Yt(),o=Q(e);return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!n&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!n&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(a=>(o.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(o.contain||"").includes(a))}function hr(e){let n=we(e);for(;ae(n)&&!ct(n);){if(Qt(n))return n;n=we(n)}return null}function Yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ct(e){return["html","body","#document"].includes(de(e))}function Q(e){return q(e).getComputedStyle(e)}function dt(e){return se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function we(e){if(de(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Do(e)&&e.host||ie(e);return Do(n)?n.host:n}function Mo(e){const n=we(e);return ct(n)?e.ownerDocument?e.ownerDocument.body:e.body:ae(n)&&De(n)?n:Mo(n)}function Me(e,n,o){var a;n===void 0&&(n=[]),o===void 0&&(o=!0);const l=Mo(e),r=l===((a=e.ownerDocument)==null?void 0:a.body),i=q(l);return r?n.concat(i,i.visualViewport||[],De(l)?l:[],i.frameElement&&o?Me(i.frameElement):[]):n.concat(l,Me(l,[],o))}function Fo(e){const n=Q(e);let o=parseFloat(n.width)||0,a=parseFloat(n.height)||0;const l=ae(e),r=l?e.offsetWidth:o,i=l?e.offsetHeight:a,s=at(o)!==r||at(a)!==i;return s&&(o=r,a=i),{width:o,height:a,$:s}}function Jt(e){return se(e)?e:e.contextElement}function Ce(e){const n=Jt(e);if(!ae(n))return ce(1);const o=n.getBoundingClientRect(),{width:a,height:l,$:r}=Fo(n);let i=(r?at(o.width):o.width)/a,s=(r?at(o.height):o.height)/l;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const br=ce(0);function jo(e){const n=q(e);return!Yt()||!n.visualViewport?br:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function gr(e,n,o){return n===void 0&&(n=!1),!o||n&&o!==q(e)?!1:n}function $e(e,n,o,a){n===void 0&&(n=!1),o===void 0&&(o=!1);const l=e.getBoundingClientRect(),r=Jt(e);let i=ce(1);n&&(a?se(a)&&(i=Ce(a)):i=Ce(e));const s=gr(r,o,a)?jo(r):ce(0);let d=(l.left+s.x)/i.x,c=(l.top+s.y)/i.y,u=l.width/i.x,p=l.height/i.y;if(r){const h=q(r),m=a&&se(a)?q(a):a;let y=h.frameElement;for(;y&&a&&m!==h;){const b=Ce(y),k=y.getBoundingClientRect(),g=Q(y),$=k.left+(y.clientLeft+parseFloat(g.paddingLeft))*b.x,C=k.top+(y.clientTop+parseFloat(g.paddingTop))*b.y;d*=b.x,c*=b.y,u*=b.x,p*=b.y,d+=$,c+=C,y=q(y).frameElement}}return st({width:u,height:p,x:d,y:c})}function $r(e){let{rect:n,offsetParent:o,strategy:a}=e;const l=ae(o),r=ie(o);if(o===r)return n;let i={scrollLeft:0,scrollTop:0},s=ce(1);const d=ce(0);if((l||!l&&a!=="fixed")&&((de(o)!=="body"||De(r))&&(i=dt(o)),ae(o))){const c=$e(o);s=Ce(o),d.x=c.x+o.clientLeft,d.y=c.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-i.scrollLeft*s.x+d.x,y:n.y*s.y-i.scrollTop*s.y+d.y}}function kr(e){return Array.from(e.getClientRects())}function Ko(e){return $e(ie(e)).left+dt(e).scrollLeft}function Br(e){const n=ie(e),o=dt(e),a=e.ownerDocument.body,l=be(n.scrollWidth,n.clientWidth,a.scrollWidth,a.clientWidth),r=be(n.scrollHeight,n.clientHeight,a.scrollHeight,a.clientHeight);let i=-o.scrollLeft+Ko(e);const s=-o.scrollTop;return Q(a).direction==="rtl"&&(i+=be(n.clientWidt