diff --git a/CHANGELOG.md b/CHANGELOG.md index f969f20..e43555b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## v2.6.9 + +> `2024-07-29` + +### 🐞 Bug Fixes + - Removed optional chaining, fixes #420 + ## v2.6.8 > `2024-06-14` diff --git a/dist/multiselect.global.js b/dist/multiselect.global.js index 77e59f4..c0d7006 100644 --- a/dist/multiselect.global.js +++ b/dist/multiselect.global.js @@ -1 +1 @@ -var VueformMultiselect=function(e){"use strict";function t(e){return null==e}function a(a,l,n){const{object:r,valueProp:o,mode:i}=e.toRefs(a),u=e.getCurrentInstance().proxy,s=n.iv,c=e=>r.value||t(e)?e:Array.isArray(e)?e.map((e=>e[o.value])):e[o.value],d=e=>t(e)?"single"===i.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function l(t){return e.customRef((()=>({get:t,set:()=>{}})))}function n(t,a){const{value:n,modelValue:r,mode:o,valueProp:i}=e.toRefs(t),u=e.ref("single"!==o.value?[]:{}),s=l((()=>void 0!==r.value?r.value:n.value)),c=e.computed((()=>"single"===o.value?u.value[i.value]:u.value.map((e=>e[i.value])))),d=l((()=>"single"!==o.value?u.value.map((e=>e[i.value])).join(","):u.value[i.value]));return{iv:u,internalValue:u,ev:s,externalValue:s,textValue:d,plainValue:c}}function r(t,a,l){const{regex:n}=e.toRefs(t),r=e.getCurrentInstance().proxy,o=l.isOpen,i=l.open,u=e.ref(null);return e.watch(u,(e=>{!o.value&&e&&i(),a.emit("search-change",e,r)})),{search:u,clearSearch:()=>{u.value=""},handleSearchInput:e=>{u.value=e.target.value},handleKeypress:e=>{if(n.value){let t=n.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(n.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=n.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}a.emit("paste",e,r)}}}function o(t,a,l){const{groupSelect:n,mode:r,groups:o,disabledProp:i}=e.toRefs(t),u=e.ref(null),s=e=>{void 0===e||null!==e&&e[i.value]||o.value&&e&&e.group&&("single"===r.value||!n.value)||(u.value=e)};return{pointer:u,setPointer:s,clearPointer:()=>{s(null)}}}function i(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/æ/g,"ae").replace(/œ/g,"oe").replace(/ø/g,"o").replace(/\p{Diacritic}/gu,"")}function u(a,n,r){const{options:o,mode:u,trackBy:s,limit:c,hideSelected:d,createTag:p,createOption:v,label:f,appendNewTag:m,appendNewOption:h,multipleLabel:g,object:b,loading:y,delay:w,resolveOnLoad:x,minChars:O,filterResults:k,clearOnSearch:S,clearOnSelect:C,valueProp:L,allowAbsent:E,groupLabel:B,canDeselect:T,max:V,strict:_,closeOnSelect:q,closeOnDeselect:P,groups:N,reverse:D,infinite:A,groupOptions:R,groupHideEmpty:I,groupSelect:j,onCreate:M,disabledProp:z,searchStart:$,searchFilter:W}=e.toRefs(a),H=e.getCurrentInstance().proxy,F=r.iv,K=r.ev,G=r.search,U=r.clearSearch,X=r.update,Y=r.pointer,J=r.setPointer,Q=r.clearPointer,Z=r.focus,ee=r.deactivate,te=r.close,ae=r.localize,le=e.ref([]),ne=e.ref([]),re=e.ref(!1),oe=e.ref(null),ie=e.ref(A.value&&-1===c.value?10:c.value),ue=e.computed({get:()=>ne.value,set:e=>ne.value=e}),se=l((()=>p.value||v.value||!1)),ce=l((()=>void 0!==m.value?m.value:void 0===h.value||h.value)),de=e.computed((()=>{if(N.value){let e=fe.value||[],t=[];return e.forEach((e=>{$e(e[R.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=$e(ne.value||[]);return le.value.length&&(e=e.concat(le.value)),e}})),pe=e.computed((()=>{let e=de.value;return D.value&&(e=e.reverse()),xe.value.length&&(e=xe.value.concat(e)),ze(e)})),ve=e.computed((()=>{let e=pe.value;return ie.value>0&&(e=e.slice(0,ie.value)),e})),fe=e.computed((()=>{if(!N.value)return[];let e=[],t=ne.value||[];return le.value.length&&e.push({[B.value]:" ",[R.value]:[...le.value],__CREATE__:!0}),e.concat(t)})),me=e.computed((()=>{let e=[...fe.value].map((e=>({...e})));return xe.value.length&&(e[0]&&e[0].__CREATE__?e[0][R.value]=[...xe.value,...e[0][R.value]]:e=[{[B.value]:" ",[R.value]:[...xe.value],__CREATE__:!0}].concat(e)),e})),he=e.computed((()=>{if(!N.value)return[];let e=me.value;return Me((e||[]).map(((e,t)=>{const a=$e(e[R.value]);return{...e,index:t,group:!0,[R.value]:ze(a,!1).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{}))),__VISIBLE__:ze(a).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{})))}})))})),ge=e.computed((()=>{switch(u.value){case"single":return!t(F.value[L.value]);case"multiple":case"tags":return!t(F.value)&&F.value.length>0}})),be=e.computed((()=>void 0!==g.value?g.value(F.value,H):F.value&&F.value.length>1?`${F.value.length} options selected`:"1 option selected")),ye=l((()=>!de.value.length&&!re.value&&!xe.value.length)),we=l((()=>de.value.length>0&&0==ve.value.length&&(G.value&&N.value||!N.value))),xe=e.computed((()=>!1!==se.value&&G.value?-1!==Ie(G.value)?[]:[{[L.value]:G.value,[Oe.value[0]]:G.value,[f.value]:G.value,__CREATE__:!0}]:[])),Oe=e.computed((()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[f.value])),ke=l((()=>{switch(u.value){case"single":return null;case"multiple":case"tags":return[]}})),Se=l((()=>y.value||re.value)),Ce=e=>{switch("object"!=typeof e&&(e=Re(e)),u.value){case"single":X(e);break;case"multiple":case"tags":X(F.value.concat(e))}n.emit("select",Ee(e),e,H)},Le=e=>{switch("object"!=typeof e&&(e=Re(e)),u.value){case"single":Te();break;case"tags":case"multiple":X(Array.isArray(e)?F.value.filter((t=>-1===e.map((e=>e[L.value])).indexOf(t[L.value]))):F.value.filter((t=>t[L.value]!=e[L.value])))}n.emit("deselect",Ee(e),e,H)},Ee=e=>b.value?e:e[L.value],Be=e=>{Le(e)},Te=()=>{X(ke.value),n.emit("clear",H)},Ve=e=>{if(void 0!==e.group)return"single"!==u.value&&(Ae(e[R.value])&&e[R.value].length);switch(u.value){case"single":return!t(F.value)&&F.value[L.value]==e[L.value];case"tags":case"multiple":return!t(F.value)&&-1!==F.value.map((e=>e[L.value])).indexOf(e[L.value])}},_e=e=>!0===e[z.value],qe=()=>!(void 0===V||-1===V.value||!ge.value&&V.value>0)&&F.value.length>=V.value,Pe=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,u.value){case"single":if(e&&Ve(e))return T.value&&Le(e),void(P.value&&(Q(),te()));e&&Ne(e),C.value&&U(),q.value&&(Q(),te()),e&&Ce(e);break;case"multiple":if(e&&Ve(e))return Le(e),void(P.value&&(Q(),te()));if(qe())return void n.emit("max",H);e&&(Ne(e),Ce(e)),C.value&&U(),d.value&&Q(),q.value&&te();break;case"tags":if(e&&Ve(e))return Le(e),void(P.value&&(Q(),te()));if(qe())return void n.emit("max",H);e&&Ne(e),C.value&&U(),e&&Ce(e),d.value&&Q(),q.value&&te()}q.value||Z()},Ne=e=>{void 0===Re(e[L.value])&&se.value&&(n.emit("tag",e[L.value],H),n.emit("option",e[L.value],H),n.emit("create",e[L.value],H),ce.value&&je(e),U())},De=e=>void 0===e.find((e=>!Ve(e)&&!e[z.value])),Ae=e=>void 0===e.find((e=>!Ve(e))),Re=e=>de.value[de.value.map((e=>String(e[L.value]))).indexOf(String(e))],Ie=e=>de.value.findIndex((t=>Oe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),je=e=>{le.value.push(e)},Me=e=>I.value?e.filter((e=>G.value?e.__VISIBLE__.length:e[R.value].length)):e.filter((e=>!G.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(G.value&&k.value){let e=W.value;e||(e=(e,t,a)=>Oe.value.some((a=>{let l=i(ae(e[a]),_.value);return $.value?l.startsWith(i(t,_.value)):-1!==l.indexOf(i(t,_.value))}))),a=a.filter((t=>e(t,G.value,H)))}return d.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(u.value)&&d.value&&Ve(e))(e)))),a},$e=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[L.value]:e,[Oe.value[0]]:a,[f.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[L.value]:e,[Oe.value[0]]:e,[f.value]:e})),t},We=()=>{t(K.value)||(F.value=Ke(K.value))},He=e=>(re.value=!0,new Promise(((t,a)=>{o.value(G.value,H).then((t=>{ne.value=t||[],"function"==typeof e&&e(t),re.value=!1})).catch((e=>{console.error(e),ne.value=[],re.value=!1})).finally((()=>{t()}))}))),Fe=()=>{if(ge.value)if("single"===u.value){let e=Re(F.value[L.value]);if(void 0!==e){let t=e[f.value];F.value[f.value]=t,b.value&&(K.value[f.value]=t)}}else F.value.forEach(((e,t)=>{let a=Re(F.value[t][L.value]);if(void 0!==a){let e=a[f.value];F.value[t][f.value]=e,b.value&&(K.value[t][f.value]=e)}}))},Ke=e=>t(e)?"single"===u.value?{}:[]:b.value?e:"single"===u.value?Re(e)||(E.value?{[f.value]:e,[L.value]:e,[Oe.value[0]]:e}:{}):e.filter((e=>!!Re(e)||E.value)).map((e=>Re(e)||{[f.value]:e,[L.value]:e,[Oe.value[0]]:e})),Ge=()=>{oe.value=e.watch(G,(e=>{e.length{e==G.value&&o.value(G.value,H).then((t=>{e!=G.value&&G.value||(ne.value=t,Y.value=ve.value.filter((e=>!0!==e[z.value]))[0]||null,re.value=!1)})).catch((e=>{console.error(e)}))}),w.value))}),{flush:"sync"})};if("single"!==u.value&&!t(K.value)&&!Array.isArray(K.value))throw new Error(`v-model must be an array when using "${u.value}" mode`);return o&&"function"==typeof o.value?x.value?He(We):1==b.value&&We():(ne.value=o.value,We()),w.value>-1&&Ge(),e.watch(w,((e,t)=>{oe.value&&oe.value(),e>=0&&Ge()})),e.watch(K,(e=>{if(t(e))X(Ke(e),!1);else switch(u.value){case"single":(b.value?e[L.value]!=F.value[L.value]:e!=F.value[L.value])&&X(Ke(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(b.value?e.map((e=>e[L.value])):e,F.value.map((e=>e[L.value])))||X(Ke(e),!1)}}),{deep:!0}),e.watch(o,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&He():(ne.value=a.options,Object.keys(F.value).length||We(),Fe())})),e.watch(f,Fe),e.watch(c,((e,t)=>{ie.value=A.value&&-1===e?10:e})),{resolvedOptions:ue,pfo:pe,fo:ve,filteredOptions:ve,hasSelected:ge,multipleLabelText:be,eo:de,extendedOptions:de,eg:fe,extendedGroups:fe,fg:he,filteredGroups:he,noOptions:ye,noResults:we,resolving:re,busy:Se,offset:ie,select:Ce,deselect:Le,remove:Be,selectAll:()=>{"single"!==u.value&&Ce(ve.value.filter((e=>!e.disabled&&!Ve(e))))},clear:Te,isSelected:Ve,isDisabled:_e,isMax:qe,getOption:Re,handleOptionClick:e=>{if(!_e(e))return M.value&&!Ve(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=M.value(e,H))instanceof Promise)?(re.value=!0,void e.then((e=>{re.value=!1,Pe(e)}))):void Pe(e)},handleGroupClick:e=>{if(!_e(e)&&"single"!==u.value&&j.value){switch(u.value){case"multiple":case"tags":De(e[R.value])?Le(e[R.value]):Ce(e[R.value].filter((e=>-1===F.value.map((e=>e[L.value])).indexOf(e[L.value]))).filter((e=>!e[z.value])).filter(((e,t)=>F.value.length+1+t<=V.value||-1===V.value))),d.value&&Y.value&&J(he.value.filter((e=>!e[z.value]))[Y.value.index])}q.value&&ee()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{He(e)},resolveOptions:He,refreshLabels:Fe}}function s(t,a,n){const{valueProp:r,showOptions:o,searchable:i,groupLabel:u,groups:s,mode:c,groupSelect:d,disabledProp:p,groupOptions:v}=e.toRefs(t),f=n.fo,m=n.fg,h=n.handleOptionClick,g=n.handleGroupClick,b=n.search,y=n.pointer,w=n.setPointer,x=n.clearPointer,O=n.multiselect,k=n.isOpen,S=e.computed((()=>f.value.filter((e=>!e[p.value])))),C=e.computed((()=>m.value.filter((e=>!e[p.value])))),L=l((()=>"single"!==c.value&&d.value)),E=l((()=>y.value&&y.value.group)),B=e.computed((()=>I(y.value))),T=e.computed((()=>{const e=E.value?y.value:I(y.value),t=C.value.map((e=>e[u.value])).indexOf(e[u.value]);let a=C.value[t-1];return void 0===a&&(a=_.value),a})),V=e.computed((()=>{let e=C.value.map((e=>e.label)).indexOf(E.value?y.value[u.value]:I(y.value)[u.value])+1;return C.value.length<=e&&(e=0),C.value[e]})),_=e.computed((()=>[...C.value].slice(-1)[0])),q=e.computed((()=>y.value.__VISIBLE__.filter((e=>!e[p.value]))[0])),P=e.computed((()=>{const e=B.value.__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])-1]})),N=e.computed((()=>{const e=I(y.value).__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])+1]})),D=e.computed((()=>[...T.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),A=e.computed((()=>[..._.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),R=()=>{w(S.value[0]||null)},I=e=>C.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[r.value])).indexOf(e[r.value]))),j=()=>{let e=O.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;s.value&&(t=E.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{i.value&&(e.length&&o.value?R():x())})),e.watch(k,(t=>{if(t&&O?.value){let t=O.value.querySelectorAll("[data-selected]")[0];if(!t)return;let a=t.parentElement.parentElement;e.nextTick((()=>{a.scrollTop=t.offsetTop}))}})),{pointer:y,canPointGroups:L,isPointed:e=>!(!y.value||!(!e.group&&y.value[r.value]===e[r.value]||void 0!==e.group&&y.value[u.value]===e[u.value]))||void 0,setPointerFirst:R,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(E.value?g(y.value):h(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&L.value?C.value[0].__CREATE__?S.value[0]:C.value[0]:S.value[0])||null);else if(s.value&&L.value){let e=E.value?q.value:N.value;void 0===e&&(e=V.value,e.__CREATE__&&(e=e[v.value][0])),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])+1;S.value.length<=e&&(e=0),w(S.value[e]||null)}e.nextTick((()=>{j()}))},backwardPointer:()=>{if(null===y.value){let e=S.value[S.value.length-1];s.value&&L.value&&(e=A.value,void 0===e&&(e=_.value)),w(e||null)}else if(s.value&&L.value){let e=E.value?D.value:P.value;void 0===e&&(e=E.value?T.value:B.value,e.__CREATE__&&(e=D.value,void 0===e&&(e=T.value))),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])-1;e<0&&(e=S.value.length-1),w(S.value[e]||null)}e.nextTick((()=>{j()}))}}}function c(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function d(e){return e instanceof c(e).Element||e instanceof Element}function p(e){return e instanceof c(e).HTMLElement||e instanceof HTMLElement}function v(e){return"undefined"!=typeof ShadowRoot&&(e instanceof c(e).ShadowRoot||e instanceof ShadowRoot)}var f=Math.max,m=Math.min,h=Math.round;function g(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function b(){return!/^((?!chrome|android).)*safari/i.test(g())}function y(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&p(e)&&(n=e.offsetWidth>0&&h(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&h(l.height)/e.offsetHeight||1);var o=(d(e)?c(e):window).visualViewport,i=!b()&&a,u=(l.left+(i&&o?o.offsetLeft:0))/n,s=(l.top+(i&&o?o.offsetTop:0))/r,v=l.width/n,f=l.height/r;return{width:v,height:f,top:s,right:u+v,bottom:s+f,left:u,x:u,y:s}}function w(e){var t=c(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(e){return e?(e.nodeName||"").toLowerCase():null}function O(e){return((d(e)?e.ownerDocument:e.document)||window.document).documentElement}function k(e){return y(O(e)).left+w(e).scrollLeft}function S(e){return c(e).getComputedStyle(e)}function C(e){var t=S(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function L(e,t,a){void 0===a&&(a=!1);var l,n,r=p(t),o=p(t)&&function(e){var t=e.getBoundingClientRect(),a=h(t.width)/e.offsetWidth||1,l=h(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),i=O(t),u=y(e,o,a),s={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!a)&&(("body"!==x(t)||C(i))&&(s=(l=t)!==c(l)&&p(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:w(l)),p(t)?((d=y(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):i&&(d.x=k(i))),{x:u.left+s.scrollLeft-d.x,y:u.top+s.scrollTop-d.y,width:u.width,height:u.height}}function E(e){var t=y(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function B(e){return"html"===x(e)?e:e.assignedSlot||e.parentNode||(v(e)?e.host:null)||O(e)}function T(e){return["html","body","#document"].indexOf(x(e))>=0?e.ownerDocument.body:p(e)&&C(e)?e:T(B(e))}function V(e,t){var a;void 0===t&&(t=[]);var l=T(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=c(l),o=n?[r].concat(r.visualViewport||[],C(l)?l:[]):l,i=t.concat(o);return n?i:i.concat(V(B(o)))}function _(e){return["table","td","th"].indexOf(x(e))>=0}function q(e){return p(e)&&"fixed"!==S(e).position?e.offsetParent:null}function P(e){for(var t=c(e),a=q(e);a&&_(a)&&"static"===S(a).position;)a=q(a);return a&&("html"===x(a)||"body"===x(a)&&"static"===S(a).position)?t:a||function(e){var t=/firefox/i.test(g());if(/Trident/i.test(g())&&p(e)&&"fixed"===S(e).position)return null;var a=B(e);for(v(a)&&(a=a.host);p(a)&&["html","body"].indexOf(x(a))<0;){var l=S(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var N="top",D="bottom",A="right",R="left",I="auto",j=[N,D,A,R],M="start",z="end",$="clippingParents",W="viewport",H="popper",F="reference",K=j.reduce((function(e,t){return e.concat([t+"-"+M,t+"-"+z])}),[]),G=[].concat(j,[I]).reduce((function(e,t){return e.concat([t,t+"-"+M,t+"-"+z])}),[]),U=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function X(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function Y(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function J(e,t,a){return t===W?Y(function(e,t){var a=c(e),l=O(e),n=a.visualViewport,r=l.clientWidth,o=l.clientHeight,i=0,u=0;if(n){r=n.width,o=n.height;var s=b();(s||!s&&"fixed"===t)&&(i=n.offsetLeft,u=n.offsetTop)}return{width:r,height:o,x:i+k(e),y:u}}(e,a)):d(t)?function(e,t){var a=y(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):Y(function(e){var t,a=O(e),l=w(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=f(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=f(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),i=-l.scrollLeft+k(e),u=-l.scrollTop;return"rtl"===S(n||a).direction&&(i+=f(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:o,x:i,y:u}}(O(e)))}function Q(e){var t=V(B(e)),a=["absolute","fixed"].indexOf(S(e).position)>=0&&p(e)?P(e):e;return d(a)?t.filter((function(e){return d(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&v(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==x(e)})):[]}function Z(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ae(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?Z(n):null,o=n?ee(n):null,i=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case N:t={x:i,y:a.y-l.height};break;case D:t={x:i,y:a.y+a.height};break;case A:t={x:a.x+a.width,y:u};break;case R:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?te(r):null;if(null!=s){var c="y"===s?"height":"width";switch(o){case M:t[s]=t[s]-(a[c]/2-l[c]/2);break;case z:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function le(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,o=l.strategy,i=void 0===o?e.strategy:o,u=l.boundary,s=void 0===u?$:u,c=l.rootBoundary,p=void 0===c?W:c,v=l.elementContext,h=void 0===v?H:v,g=l.altBoundary,b=void 0!==g&&g,w=l.padding,x=void 0===w?0:w,k=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof x?x:(a=x,j.reduce((function(e,t){return e[t]=a,e}),{}))),S=h===H?F:H,C=e.rects.popper,L=e.elements[b?S:h],E=function(e,t,a,l){var n="clippingParents"===t?Q(e):[].concat(t),r=[].concat(n,[a]),o=r[0],i=r.reduce((function(t,a){var n=J(e,a,l);return t.top=f(n.top,t.top),t.right=m(n.right,t.right),t.bottom=m(n.bottom,t.bottom),t.left=f(n.left,t.left),t}),J(e,o,l));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}(d(L)?L:L.contextElement||O(e.elements.popper),s,p,i),B=y(e.elements.reference),T=ae({reference:B,element:C,strategy:"absolute",placement:r}),V=Y(Object.assign({},C,T)),_=h===H?V:B,q={top:E.top-_.top+k.top,bottom:_.bottom-E.bottom+k.bottom,left:E.left-_.left+k.left,right:_.right-E.right+k.right},P=e.modifiersData.offset;if(h===H&&P){var R=P[r];Object.keys(q).forEach((function(e){var t=[A,D].indexOf(e)>=0?1:-1,a=[N,D].indexOf(e)>=0?"y":"x";q[e]+=R[a]*t}))}return q}var ne={placement:"bottom",modifiers:[],strategy:"absolute"};function re(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(xe,me,Oe):de(v?xe:ge,me,v?Oe:be);S[k]=ke,_[k]=ke-me}t.modifiersData[l]=_}},requiresIfExists:["offset"]},ve={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ve[e]}))}var me={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,(function(e){return me[e]}))}function ge(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,o=a.padding,i=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?G:u,c=ee(l),d=c?i?K:K.filter((function(e){return ee(e)===c})):j,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=le(e,{placement:a,boundary:n,rootBoundary:r,padding:o})[Z(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,o=a.altAxis,i=void 0===o||o,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,m=a.allowedAutoPlacements,h=t.options.placement,g=Z(h),b=u||(g===h||!f?[fe(h)]:function(e){if(Z(e)===I)return[];var t=fe(e);return[he(e),t,he(t)]}(h)),y=[h].concat(b).reduce((function(e,a){return e.concat(Z(a)===I?ge(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:m}):a)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,k=!0,S=y[0],C=0;C=0,V=T?"width":"height",_=le(t,{placement:L,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),q=T?B?A:R:B?D:N;w[V]>x[V]&&(q=fe(q));var P=fe(q),j=[];if(r&&j.push(_[E]<=0),i&&j.push(_[q]<=0,_[P]<=0),j.every((function(e){return e}))){S=L,k=!1;break}O.set(L,j)}if(k)for(var z=function(e){var t=y.find((function(t){var a=O.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},$=f?3:1;$>0;$--){if("break"===z($))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(t,a,n){const{disabled:r,appendTo:o,appendToBody:i,openDirection:u}=e.toRefs(t),s=e.getCurrentInstance().proxy,c=n.multiselect,d=n.dropdown,p=e.ref(!1),v=e.ref(null),f=e.ref(null),m=l((()=>o.value||i.value)),h=l((()=>"top"===u.value&&"bottom"===f.value||"bottom"===u.value&&"top"!==f.value?"bottom":"top")),g=()=>{if(!v.value)return;let e=parseInt(window.getComputedStyle(d.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(d.value).borderBottomWidth.replace("px",""));v.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===h.value?e:t)]}}]}))),v.value.update()},b=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return e.onMounted((()=>{m.value&&(v.value=ce(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[pe,be,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){f.value=e.placement}}]}))})),e.onBeforeUnmount((()=>{m.value&&v.value&&(v.value.destroy(),v.value=null)})),{popper:v,isOpen:p,open:()=>{p.value||r.value||(p.value=!0,a.emit("open",s),m.value&&e.nextTick((()=>{g()})))},close:()=>{p.value&&(p.value=!1,a.emit("close",s))},placement:h,updatePopper:g}}function we(t,a,n){const{searchable:r,disabled:o,clearOnBlur:i}=e.toRefs(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,m=e.ref(!1),h=e.ref(!1),g=l((()=>r.value||o.value?-1:0)),b=()=>{r.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{o.value||(m.value=!0,e&&s())},w=()=>{m.value=!1,setTimeout((()=>{m.value||(c(),i.value&&d())}),1)};return{tabindex:g,isActive:m,mouseClicked:h,blur:b,focus:()=>{r.value&&!o.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(h.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{h.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{h.value=!1}),0)}}}function xe(t,a,n){const{mode:r,addTagOn:o,openDirection:i,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:m}=e.toRefs(t),h=e.getCurrentInstance().proxy,g=n.iv,b=n.update,y=n.deselect,w=n.search,x=n.setPointer,O=n.selectPointer,k=n.backwardPointer,S=n.forwardPointer,C=n.multiselect,L=n.wrapper,E=n.tags,B=n.isOpen,T=n.open,V=n.blur,_=n.fo,q=l((()=>v.value||f.value||!1)),P=l((()=>void 0!==o.value?o.value:void 0!==p.value?p.value:["enter"])),N=()=>{"tags"===r.value&&!s.value&&q.value&&u.value&&!d.value&&x(_.value[_.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,l;switch(a.emit("keydown",e,h),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...C.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==E.value)),l=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===g.value.length)return;let a=g.value.filter((e=>!e.disabled&&!1!==e.remove));a.length&&y(a[a.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==l&&void 0!==l)return b([...g.value].filter(((e,t)=>t!==l))),void(l===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?E.value.querySelector("input").focus():L.value.focus()));if(-1===P.value.indexOf("enter")&&q.value)return;N(),O();break;case" ":if(!q.value&&!u.value)return e.preventDefault(),N(),void O();if(!q.value)return!1;if(-1===P.value.indexOf("space")&&q.value)return;e.preventDefault(),N(),O();break;case"Tab":case";":case",":if(-1===P.value.indexOf(e.key.toLowerCase())||!q.value)return;N(),O(),e.preventDefault();break;case"Escape":V();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;B.value||T(),k();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;B.value||T(),S();break;case"ArrowLeft":if(u.value&&E.value&&E.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),-1===l?t[t.length-1].focus():l>0&&t[l-1].focus();break;case"ArrowRight":if(-1===l||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),t.length>l+1?t[l+1].focus():u.value?E.value.querySelector("input").focus():u.value||L.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,h)},preparePointer:N}}function Oe(t,a,n){const{classes:r,disabled:o,showOptions:i,breakTags:u}=e.toRefs(t),s=n.isOpen,c=n.isPointed,d=n.isSelected,p=n.isDisabled,v=n.isActive,f=n.canPointGroups,m=n.resolving,h=n.fo,g=n.placement,b=l((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),y=l((()=>!!(s.value&&i.value&&(!m.value||m.value&&h.value.length))));return{classList:e.computed((()=>{const e=b.value;return{container:[e.container].concat(o.value?e.containerDisabled:[]).concat(y.value&&"top"===g.value?e.containerOpenTop:[]).concat(y.value&&"top"!==g.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(o.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===g.value?e.dropdownTop:[]).concat(s.value&&i.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===g.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function ke(t,a,n){const{limit:r,infinite:o}=e.toRefs(t),i=n.isOpen,u=n.offset,s=n.search,c=n.pfo,d=n.eo,p=e.ref(null),v=e.shallowRef(null),f=l((()=>u.value{const{isIntersecting:a,target:l}=t[0];if(a){const t=l.offsetParent,a=t.scrollTop;u.value+=-1==r.value?10:r.value,e.nextTick((()=>{t.scrollTop=a}))}},h=()=>{i.value&&u.value{o.value&&h()})),e.watch(s,(()=>{o.value&&(u.value=r.value,h())}),{flush:"post"}),e.watch(d,(()=>{o.value&&h()}),{immediate:!1,flush:"post"}),e.onMounted((()=>{window&&window.IntersectionObserver&&(p.value=new IntersectionObserver(m))})),{hasMore:f,infiniteLoader:v}}function Se(t,a,n){const{placeholder:r,id:o,valueProp:i,label:u,mode:s,groupLabel:c,aria:d,searchable:p}=e.toRefs(t),v=n.pointer,f=n.iv,m=n.hasSelected,h=n.multipleLabelText,g=e.ref(null),b=l((()=>(o.value?o.value+"-":"")+"assist")),y=l((()=>(o.value?o.value+"-":"")+"multiselect-options")),w=l((()=>{if(v.value){let e=o.value?`${o.value}-`:"";return e+=(v.value.group?"multiselect-group":"multiselect-option")+"-",e+=v.value.group?v.value.index:v.value[i.value],e}})),x=l((()=>r.value)),O=l((()=>"single"!==s.value)),k=e.computed((()=>"single"===s.value&&m.value?f.value[u.value]:"multiple"===s.value&&m.value?h.value:"tags"===s.value&&m.value?f.value.map((e=>e[u.value])).join(", "):"")),S=e.computed((()=>{let e={...d.value};return p.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${b.value} ${e["aria-labelledby"]}`:b.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return e.onMounted((()=>{if(o.value&&document&&document.querySelector){let e=document.querySelector(`[for="${o.value}"]`);g.value=e?e.innerText:null}})),{arias:S,ariaLabel:k,ariaAssist:b,ariaControls:y,ariaPlaceholder:x,ariaMultiselectable:O,ariaActiveDescendant:w,ariaOptionId:e=>`${o.value?o.value+"-":""}multiselect-option-${e[i.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${o.value?o.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Ce(t,a,l){const{locale:n,fallbackLocale:r}=e.toRefs(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Le(t,a,l){return{multiselect:e.shallowRef(null),wrapper:e.shallowRef(null),tags:e.shallowRef(null),input:e.shallowRef(null),dropdown:e.shallowRef(null)}}var Ee={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Le,Ce,n,o,ye,r,a,we,u,ke,s,xe,Oe,Se]),beforeMount(){(this.$root.constructor?.version?.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};const Be=["id","dir"],Te=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Ve=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],_e=["onKeyup","aria-label"],qe=["onClick"],Pe=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],Ne=["innerHTML"],De=["id"],Ae=["id"],Re=["id","aria-label","aria-selected"],Ie=["data-pointed","onMouseenter","onClick"],je=["innerHTML"],Me=["aria-label"],ze=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],$e=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],We=["innerHTML"],He=["innerHTML"],Fe=["value"],Ke=["name","value"],Ge=["name","value"],Ue=["id"];return Ee.render=function(t,a,l,n,r,o){return e.openBlock(),e.createElementBlock("div",{ref:"multiselect",class:e.normalizeClass(t.classList.container),id:l.searchable?void 0:l.id,dir:l.rtl?"rtl":void 0,onFocusin:a[12]||(a[12]=(...e)=>t.handleFocusIn&&t.handleFocusIn(...e)),onFocusout:a[13]||(a[13]=(...e)=>t.handleFocusOut&&t.handleFocusOut(...e)),onKeyup:a[14]||(a[14]=(...e)=>t.handleKeyup&&t.handleKeyup(...e)),onKeydown:a[15]||(a[15]=(...e)=>t.handleKeydown&&t.handleKeydown(...e))},[e.createElementVNode("div",e.mergeProps({class:t.classList.wrapper,onMousedown:a[9]||(a[9]=(...e)=>t.handleMousedown&&t.handleMousedown(...e)),ref:"wrapper",tabindex:t.tabindex,"aria-controls":l.searchable?void 0:t.ariaControls,"aria-placeholder":l.searchable?void 0:t.ariaPlaceholder,"aria-expanded":l.searchable?void 0:t.isOpen,"aria-activedescendant":l.searchable?void 0:t.ariaActiveDescendant,"aria-multiselectable":l.searchable?void 0:t.ariaMultiselectable,role:l.searchable?void 0:"combobox"},l.searchable?{}:t.arias),[e.createCommentVNode(" Search "),"tags"!==l.mode&&l.searchable&&!l.disabled?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:l.inputType,modelValue:t.search,value:t.search,class:t.classList.search,autocomplete:l.autocomplete,id:l.searchable?l.id:void 0,onInput:a[0]||(a[0]=(...e)=>t.handleSearchInput&&t.handleSearchInput(...e)),onKeypress:a[1]||(a[1]=(...e)=>t.handleKeypress&&t.handleKeypress(...e)),onPaste:a[2]||(a[2]=e.withModifiers(((...e)=>t.handlePaste&&t.handlePaste(...e)),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...l.attrs,...t.arias}),null,16,Ve)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Tags (with search) "),"tags"==l.mode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.classList.tags),"data-tags":""},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.iv,((a,n,r)=>e.renderSlot(t.$slots,"tag",{option:a,handleTagRemove:t.handleTagRemove,disabled:l.disabled},(()=>[(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([t.classList.tag,a.disabled?t.classList.tagDisabled:null]),tabindex:"-1",onKeyup:e.withKeys((e=>t.handleTagRemove(a,e)),["enter"]),key:r,"aria-label":t.ariaTagLabel(t.localize(a[l.label]))},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagWrapper)},e.toDisplayString(t.localize(a[l.label])),3),l.disabled||a.disabled?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.classList.tagRemove),onClick:e.withModifiers((e=>t.handleTagRemove(a,e)),["stop"])},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagRemoveIcon)},null,2)],10,qe))],42,_e))])))),256)),e.createElementVNode("div",{class:e.normalizeClass(t.classList.tagsSearchWrapper),ref:"tags"},[e.createCommentVNode(" Used for measuring search width "),e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagsSearchCopy)},e.toDisplayString(t.search),3),e.createCommentVNode(" Actual search input "),l.searchable&&!l.disabled?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:l.inputType,modelValue:t.search,value:t.search,class:t.classList.tagsSearch,id:l.searchable?l.id:void 0,autocomplete:l.autocomplete,onInput:a[3]||(a[3]=(...e)=>t.handleSearchInput&&t.handleSearchInput(...e)),onKeypress:a[4]||(a[4]=(...e)=>t.handleKeypress&&t.handleKeypress(...e)),onPaste:a[5]||(a[5]=e.withModifiers(((...e)=>t.handlePaste&&t.handlePaste(...e)),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...l.attrs,...t.arias}),null,16,Pe)):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Single label "),"single"==l.mode&&t.hasSelected&&!t.search&&t.iv?e.renderSlot(t.$slots,"singlelabel",{key:2,value:t.iv},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.singleLabel)},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.singleLabelText)},e.toDisplayString(t.localize(t.iv[l.label])),3)],2)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Multiple label "),"multiple"==l.mode&&t.hasSelected&&!t.search?e.renderSlot(t.$slots,"multiplelabel",{key:3,values:t.iv},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.multipleLabel),innerHTML:t.multipleLabelText},null,10,Ne)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Placeholder "),!l.placeholder||t.hasSelected||t.search?e.createCommentVNode("v-if",!0):e.renderSlot(t.$slots,"placeholder",{key:4},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.placeholder),"aria-hidden":"true"},e.toDisplayString(l.placeholder),3)])),e.createCommentVNode(" Spinner "),l.loading||t.resolving?e.renderSlot(t.$slots,"spinner",{key:5},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.spinner),"aria-hidden":"true"},null,2)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Clear "),t.hasSelected&&!l.disabled&&l.canClear&&!t.busy?e.renderSlot(t.$slots,"clear",{key:6,clear:t.clear},(()=>[e.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:e.normalizeClass(t.classList.clear),onClick:a[6]||(a[6]=(...e)=>t.clear&&t.clear(...e)),onKeyup:a[7]||(a[7]=e.withKeys(((...e)=>t.clear&&t.clear(...e)),["enter"]))},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.clearIcon)},null,2)],34)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Caret "),l.caret&&l.showOptions?e.renderSlot(t.$slots,"caret",{key:7,handleCaretClick:t.handleCaretClick,isOpen:t.isOpen},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.caret),onClick:a[8]||(a[8]=(...e)=>t.handleCaretClick&&t.handleCaretClick(...e)),"aria-hidden":"true"},null,2)])):e.createCommentVNode("v-if",!0)],16,Te),e.createCommentVNode(" Options "),(e.openBlock(),e.createBlock(e.Teleport,{to:l.appendTo||"body",disabled:!l.appendToBody&&!l.appendTo},[e.createElementVNode("div",{id:l.id?`${l.id}-dropdown`:void 0,class:e.normalizeClass(t.classList.dropdown),tabindex:"-1",ref:"dropdown",onFocusin:a[10]||(a[10]=(...e)=>t.handleFocusIn&&t.handleFocusIn(...e)),onFocusout:a[11]||(a[11]=(...e)=>t.handleFocusOut&&t.handleFocusOut(...e))},[e.renderSlot(t.$slots,"beforelist",{options:t.fo}),e.createElementVNode("ul",{class:e.normalizeClass(t.classList.options),id:t.ariaControls,role:"listbox"},[l.groups?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.fg,((a,n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.group),key:r,id:t.ariaGroupId(a),"aria-label":t.ariaGroupLabel(t.localize(a[l.groupLabel])),"aria-selected":t.isSelected(a),role:"option"},[a.__CREATE__?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.classList.groupLabel(a)),"data-pointed":t.isPointed(a),onMouseenter:e=>t.setPointer(a,n),onClick:e=>t.handleGroupClick(a)},[e.renderSlot(t.$slots,"grouplabel",{group:a,isSelected:t.isSelected,isPointed:t.isPointed},(()=>[e.createElementVNode("span",{innerHTML:t.localize(a[l.groupLabel])},null,8,je)]))],42,Ie)),e.createElementVNode("ul",{class:e.normalizeClass(t.classList.groupOptions),"aria-label":t.ariaGroupLabel(t.localize(a[l.groupLabel])),role:"group"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.__VISIBLE__,((n,r,o)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.option(n,a)),"data-pointed":t.isPointed(n),"data-selected":t.isSelected(n)||void 0,key:o,onMouseenter:e=>t.setPointer(n),onClick:e=>t.handleOptionClick(n),id:t.ariaOptionId(n),"aria-selected":t.isSelected(n),"aria-label":t.ariaOptionLabel(t.localize(n[l.label])),role:"option"},[e.renderSlot(t.$slots,"option",{option:n,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},(()=>[e.createElementVNode("span",null,e.toDisplayString(t.localize(n[l.label])),1)]))],42,ze)))),128))],10,Me)],10,Re)))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.fo,((a,n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.option(a)),"data-pointed":t.isPointed(a),"data-selected":t.isSelected(a)||void 0,key:r,onMouseenter:e=>t.setPointer(a),onClick:e=>t.handleOptionClick(a),id:t.ariaOptionId(a),"aria-selected":t.isSelected(a),"aria-label":t.ariaOptionLabel(t.localize(a[l.label])),role:"option"},[e.renderSlot(t.$slots,"option",{option:a,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},(()=>[e.createElementVNode("span",null,e.toDisplayString(t.localize(a[l.label])),1)]))],42,$e)))),128))],10,Ae),t.noOptions?e.renderSlot(t.$slots,"nooptions",{key:0},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.noOptions),innerHTML:t.localize(l.noOptionsText)},null,10,We)])):e.createCommentVNode("v-if",!0),t.noResults?e.renderSlot(t.$slots,"noresults",{key:1},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.noResults),innerHTML:t.localize(l.noResultsText)},null,10,He)])):e.createCommentVNode("v-if",!0),l.infinite&&t.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.classList.inifinite),ref:"infiniteLoader"},[e.renderSlot(t.$slots,"infinite",{},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.inifiniteSpinner)},null,2)]))],2)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"afterlist",{options:t.fo})],42,De)],8,["to","disabled"])),e.createCommentVNode(" Hacky input element to show HTML5 required warning "),l.required?(e.openBlock(),e.createElementBlock("input",{key:0,class:e.normalizeClass(t.classList.fakeInput),tabindex:"-1",value:t.textValue,required:""},null,10,Fe)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Native input support "),l.nativeSupport?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},["single"==l.mode?(e.openBlock(),e.createElementBlock("input",{key:0,type:"hidden",name:l.name,value:void 0!==t.plainValue?t.plainValue:""},null,8,Ke)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.plainValue,((t,a)=>(e.openBlock(),e.createElementBlock("input",{type:"hidden",name:`${l.name}[]`,value:t,key:a},null,8,Ge)))),128))],64)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Screen reader assistive text "),l.searchable&&t.hasSelected?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.classList.assist),id:t.ariaAssist,"aria-hidden":"true"},e.toDisplayString(t.ariaLabel),11,Ue)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Create height for empty input "),e.createElementVNode("div",{class:e.normalizeClass(t.classList.spacer)},null,2)],42,Be)},Ee.__file="src/Multiselect.vue",Ee}(Vue); +var VueformMultiselect=function(e){"use strict";function t(e){return null==e}function a(a,l,n){const{object:r,valueProp:o,mode:i}=e.toRefs(a),u=e.getCurrentInstance().proxy,s=n.iv,c=e=>r.value||t(e)?e:Array.isArray(e)?e.map((e=>e[o.value])):e[o.value],d=e=>t(e)?"single"===i.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function l(t){return e.customRef((()=>({get:t,set:()=>{}})))}function n(t,a){const{value:n,modelValue:r,mode:o,valueProp:i}=e.toRefs(t),u=e.ref("single"!==o.value?[]:{}),s=l((()=>void 0!==r.value?r.value:n.value)),c=e.computed((()=>"single"===o.value?u.value[i.value]:u.value.map((e=>e[i.value])))),d=l((()=>"single"!==o.value?u.value.map((e=>e[i.value])).join(","):u.value[i.value]));return{iv:u,internalValue:u,ev:s,externalValue:s,textValue:d,plainValue:c}}function r(t,a,l){const{regex:n}=e.toRefs(t),r=e.getCurrentInstance().proxy,o=l.isOpen,i=l.open,u=e.ref(null);return e.watch(u,(e=>{!o.value&&e&&i(),a.emit("search-change",e,r)})),{search:u,clearSearch:()=>{u.value=""},handleSearchInput:e=>{u.value=e.target.value},handleKeypress:e=>{if(n.value){let t=n.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(n.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=n.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}a.emit("paste",e,r)}}}function o(t,a,l){const{groupSelect:n,mode:r,groups:o,disabledProp:i}=e.toRefs(t),u=e.ref(null),s=e=>{void 0===e||null!==e&&e[i.value]||o.value&&e&&e.group&&("single"===r.value||!n.value)||(u.value=e)};return{pointer:u,setPointer:s,clearPointer:()=>{s(null)}}}function i(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/æ/g,"ae").replace(/œ/g,"oe").replace(/ø/g,"o").replace(/\p{Diacritic}/gu,"")}function u(a,n,r){const{options:o,mode:u,trackBy:s,limit:c,hideSelected:d,createTag:p,createOption:v,label:f,appendNewTag:m,appendNewOption:h,multipleLabel:g,object:b,loading:y,delay:w,resolveOnLoad:x,minChars:O,filterResults:k,clearOnSearch:S,clearOnSelect:C,valueProp:L,allowAbsent:E,groupLabel:B,canDeselect:T,max:V,strict:_,closeOnSelect:q,closeOnDeselect:P,groups:N,reverse:D,infinite:A,groupOptions:R,groupHideEmpty:I,groupSelect:j,onCreate:M,disabledProp:z,searchStart:$,searchFilter:W}=e.toRefs(a),H=e.getCurrentInstance().proxy,F=r.iv,K=r.ev,G=r.search,U=r.clearSearch,X=r.update,Y=r.pointer,J=r.setPointer,Q=r.clearPointer,Z=r.focus,ee=r.deactivate,te=r.close,ae=r.localize,le=e.ref([]),ne=e.ref([]),re=e.ref(!1),oe=e.ref(null),ie=e.ref(A.value&&-1===c.value?10:c.value),ue=e.computed({get:()=>ne.value,set:e=>ne.value=e}),se=l((()=>p.value||v.value||!1)),ce=l((()=>void 0!==m.value?m.value:void 0===h.value||h.value)),de=e.computed((()=>{if(N.value){let e=fe.value||[],t=[];return e.forEach((e=>{$e(e[R.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=$e(ne.value||[]);return le.value.length&&(e=e.concat(le.value)),e}})),pe=e.computed((()=>{let e=de.value;return D.value&&(e=e.reverse()),xe.value.length&&(e=xe.value.concat(e)),ze(e)})),ve=e.computed((()=>{let e=pe.value;return ie.value>0&&(e=e.slice(0,ie.value)),e})),fe=e.computed((()=>{if(!N.value)return[];let e=[],t=ne.value||[];return le.value.length&&e.push({[B.value]:" ",[R.value]:[...le.value],__CREATE__:!0}),e.concat(t)})),me=e.computed((()=>{let e=[...fe.value].map((e=>({...e})));return xe.value.length&&(e[0]&&e[0].__CREATE__?e[0][R.value]=[...xe.value,...e[0][R.value]]:e=[{[B.value]:" ",[R.value]:[...xe.value],__CREATE__:!0}].concat(e)),e})),he=e.computed((()=>{if(!N.value)return[];let e=me.value;return Me((e||[]).map(((e,t)=>{const a=$e(e[R.value]);return{...e,index:t,group:!0,[R.value]:ze(a,!1).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{}))),__VISIBLE__:ze(a).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{})))}})))})),ge=e.computed((()=>{switch(u.value){case"single":return!t(F.value[L.value]);case"multiple":case"tags":return!t(F.value)&&F.value.length>0}})),be=e.computed((()=>void 0!==g.value?g.value(F.value,H):F.value&&F.value.length>1?`${F.value.length} options selected`:"1 option selected")),ye=l((()=>!de.value.length&&!re.value&&!xe.value.length)),we=l((()=>de.value.length>0&&0==ve.value.length&&(G.value&&N.value||!N.value))),xe=e.computed((()=>!1!==se.value&&G.value?-1!==Ie(G.value)?[]:[{[L.value]:G.value,[Oe.value[0]]:G.value,[f.value]:G.value,__CREATE__:!0}]:[])),Oe=e.computed((()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[f.value])),ke=l((()=>{switch(u.value){case"single":return null;case"multiple":case"tags":return[]}})),Se=l((()=>y.value||re.value)),Ce=e=>{switch("object"!=typeof e&&(e=Re(e)),u.value){case"single":X(e);break;case"multiple":case"tags":X(F.value.concat(e))}n.emit("select",Ee(e),e,H)},Le=e=>{switch("object"!=typeof e&&(e=Re(e)),u.value){case"single":Te();break;case"tags":case"multiple":X(Array.isArray(e)?F.value.filter((t=>-1===e.map((e=>e[L.value])).indexOf(t[L.value]))):F.value.filter((t=>t[L.value]!=e[L.value])))}n.emit("deselect",Ee(e),e,H)},Ee=e=>b.value?e:e[L.value],Be=e=>{Le(e)},Te=()=>{X(ke.value),n.emit("clear",H)},Ve=e=>{if(void 0!==e.group)return"single"!==u.value&&(Ae(e[R.value])&&e[R.value].length);switch(u.value){case"single":return!t(F.value)&&F.value[L.value]==e[L.value];case"tags":case"multiple":return!t(F.value)&&-1!==F.value.map((e=>e[L.value])).indexOf(e[L.value])}},_e=e=>!0===e[z.value],qe=()=>!(void 0===V||-1===V.value||!ge.value&&V.value>0)&&F.value.length>=V.value,Pe=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,u.value){case"single":if(e&&Ve(e))return T.value&&Le(e),void(P.value&&(Q(),te()));e&&Ne(e),C.value&&U(),q.value&&(Q(),te()),e&&Ce(e);break;case"multiple":if(e&&Ve(e))return Le(e),void(P.value&&(Q(),te()));if(qe())return void n.emit("max",H);e&&(Ne(e),Ce(e)),C.value&&U(),d.value&&Q(),q.value&&te();break;case"tags":if(e&&Ve(e))return Le(e),void(P.value&&(Q(),te()));if(qe())return void n.emit("max",H);e&&Ne(e),C.value&&U(),e&&Ce(e),d.value&&Q(),q.value&&te()}q.value||Z()},Ne=e=>{void 0===Re(e[L.value])&&se.value&&(n.emit("tag",e[L.value],H),n.emit("option",e[L.value],H),n.emit("create",e[L.value],H),ce.value&&je(e),U())},De=e=>void 0===e.find((e=>!Ve(e)&&!e[z.value])),Ae=e=>void 0===e.find((e=>!Ve(e))),Re=e=>de.value[de.value.map((e=>String(e[L.value]))).indexOf(String(e))],Ie=e=>de.value.findIndex((t=>Oe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),je=e=>{le.value.push(e)},Me=e=>I.value?e.filter((e=>G.value?e.__VISIBLE__.length:e[R.value].length)):e.filter((e=>!G.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(G.value&&k.value){let e=W.value;e||(e=(e,t,a)=>Oe.value.some((a=>{let l=i(ae(e[a]),_.value);return $.value?l.startsWith(i(t,_.value)):-1!==l.indexOf(i(t,_.value))}))),a=a.filter((t=>e(t,G.value,H)))}return d.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(u.value)&&d.value&&Ve(e))(e)))),a},$e=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[L.value]:e,[Oe.value[0]]:a,[f.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[L.value]:e,[Oe.value[0]]:e,[f.value]:e})),t},We=()=>{t(K.value)||(F.value=Ke(K.value))},He=e=>(re.value=!0,new Promise(((t,a)=>{o.value(G.value,H).then((t=>{ne.value=t||[],"function"==typeof e&&e(t),re.value=!1})).catch((e=>{console.error(e),ne.value=[],re.value=!1})).finally((()=>{t()}))}))),Fe=()=>{if(ge.value)if("single"===u.value){let e=Re(F.value[L.value]);if(void 0!==e){let t=e[f.value];F.value[f.value]=t,b.value&&(K.value[f.value]=t)}}else F.value.forEach(((e,t)=>{let a=Re(F.value[t][L.value]);if(void 0!==a){let e=a[f.value];F.value[t][f.value]=e,b.value&&(K.value[t][f.value]=e)}}))},Ke=e=>t(e)?"single"===u.value?{}:[]:b.value?e:"single"===u.value?Re(e)||(E.value?{[f.value]:e,[L.value]:e,[Oe.value[0]]:e}:{}):e.filter((e=>!!Re(e)||E.value)).map((e=>Re(e)||{[f.value]:e,[L.value]:e,[Oe.value[0]]:e})),Ge=()=>{oe.value=e.watch(G,(e=>{e.length{e==G.value&&o.value(G.value,H).then((t=>{e!=G.value&&G.value||(ne.value=t,Y.value=ve.value.filter((e=>!0!==e[z.value]))[0]||null,re.value=!1)})).catch((e=>{console.error(e)}))}),w.value))}),{flush:"sync"})};if("single"!==u.value&&!t(K.value)&&!Array.isArray(K.value))throw new Error(`v-model must be an array when using "${u.value}" mode`);return o&&"function"==typeof o.value?x.value?He(We):1==b.value&&We():(ne.value=o.value,We()),w.value>-1&&Ge(),e.watch(w,((e,t)=>{oe.value&&oe.value(),e>=0&&Ge()})),e.watch(K,(e=>{if(t(e))X(Ke(e),!1);else switch(u.value){case"single":(b.value?e[L.value]!=F.value[L.value]:e!=F.value[L.value])&&X(Ke(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(b.value?e.map((e=>e[L.value])):e,F.value.map((e=>e[L.value])))||X(Ke(e),!1)}}),{deep:!0}),e.watch(o,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&He():(ne.value=a.options,Object.keys(F.value).length||We(),Fe())})),e.watch(f,Fe),e.watch(c,((e,t)=>{ie.value=A.value&&-1===e?10:e})),{resolvedOptions:ue,pfo:pe,fo:ve,filteredOptions:ve,hasSelected:ge,multipleLabelText:be,eo:de,extendedOptions:de,eg:fe,extendedGroups:fe,fg:he,filteredGroups:he,noOptions:ye,noResults:we,resolving:re,busy:Se,offset:ie,select:Ce,deselect:Le,remove:Be,selectAll:()=>{"single"!==u.value&&Ce(ve.value.filter((e=>!e.disabled&&!Ve(e))))},clear:Te,isSelected:Ve,isDisabled:_e,isMax:qe,getOption:Re,handleOptionClick:e=>{if(!_e(e))return M.value&&!Ve(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=M.value(e,H))instanceof Promise)?(re.value=!0,void e.then((e=>{re.value=!1,Pe(e)}))):void Pe(e)},handleGroupClick:e=>{if(!_e(e)&&"single"!==u.value&&j.value){switch(u.value){case"multiple":case"tags":De(e[R.value])?Le(e[R.value]):Ce(e[R.value].filter((e=>-1===F.value.map((e=>e[L.value])).indexOf(e[L.value]))).filter((e=>!e[z.value])).filter(((e,t)=>F.value.length+1+t<=V.value||-1===V.value))),d.value&&Y.value&&J(he.value.filter((e=>!e[z.value]))[Y.value.index])}q.value&&ee()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{He(e)},resolveOptions:He,refreshLabels:Fe}}function s(t,a,n){const{valueProp:r,showOptions:o,searchable:i,groupLabel:u,groups:s,mode:c,groupSelect:d,disabledProp:p,groupOptions:v}=e.toRefs(t),f=n.fo,m=n.fg,h=n.handleOptionClick,g=n.handleGroupClick,b=n.search,y=n.pointer,w=n.setPointer,x=n.clearPointer,O=n.multiselect,k=n.isOpen,S=e.computed((()=>f.value.filter((e=>!e[p.value])))),C=e.computed((()=>m.value.filter((e=>!e[p.value])))),L=l((()=>"single"!==c.value&&d.value)),E=l((()=>y.value&&y.value.group)),B=e.computed((()=>I(y.value))),T=e.computed((()=>{const e=E.value?y.value:I(y.value),t=C.value.map((e=>e[u.value])).indexOf(e[u.value]);let a=C.value[t-1];return void 0===a&&(a=_.value),a})),V=e.computed((()=>{let e=C.value.map((e=>e.label)).indexOf(E.value?y.value[u.value]:I(y.value)[u.value])+1;return C.value.length<=e&&(e=0),C.value[e]})),_=e.computed((()=>[...C.value].slice(-1)[0])),q=e.computed((()=>y.value.__VISIBLE__.filter((e=>!e[p.value]))[0])),P=e.computed((()=>{const e=B.value.__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])-1]})),N=e.computed((()=>{const e=I(y.value).__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])+1]})),D=e.computed((()=>[...T.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),A=e.computed((()=>[..._.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),R=()=>{w(S.value[0]||null)},I=e=>C.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[r.value])).indexOf(e[r.value]))),j=()=>{let e=O.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;s.value&&(t=E.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{i.value&&(e.length&&o.value?R():x())})),e.watch(k,(t=>{if(t&&O&&O.value){let t=O.value.querySelectorAll("[data-selected]")[0];if(!t)return;let a=t.parentElement.parentElement;e.nextTick((()=>{a.scrollTop=t.offsetTop}))}})),{pointer:y,canPointGroups:L,isPointed:e=>!(!y.value||!(!e.group&&y.value[r.value]===e[r.value]||void 0!==e.group&&y.value[u.value]===e[u.value]))||void 0,setPointerFirst:R,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(E.value?g(y.value):h(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&L.value?C.value[0].__CREATE__?S.value[0]:C.value[0]:S.value[0])||null);else if(s.value&&L.value){let e=E.value?q.value:N.value;void 0===e&&(e=V.value,e.__CREATE__&&(e=e[v.value][0])),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])+1;S.value.length<=e&&(e=0),w(S.value[e]||null)}e.nextTick((()=>{j()}))},backwardPointer:()=>{if(null===y.value){let e=S.value[S.value.length-1];s.value&&L.value&&(e=A.value,void 0===e&&(e=_.value)),w(e||null)}else if(s.value&&L.value){let e=E.value?D.value:P.value;void 0===e&&(e=E.value?T.value:B.value,e.__CREATE__&&(e=D.value,void 0===e&&(e=T.value))),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])-1;e<0&&(e=S.value.length-1),w(S.value[e]||null)}e.nextTick((()=>{j()}))}}}function c(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function d(e){return e instanceof c(e).Element||e instanceof Element}function p(e){return e instanceof c(e).HTMLElement||e instanceof HTMLElement}function v(e){return"undefined"!=typeof ShadowRoot&&(e instanceof c(e).ShadowRoot||e instanceof ShadowRoot)}var f=Math.max,m=Math.min,h=Math.round;function g(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function b(){return!/^((?!chrome|android).)*safari/i.test(g())}function y(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&p(e)&&(n=e.offsetWidth>0&&h(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&h(l.height)/e.offsetHeight||1);var o=(d(e)?c(e):window).visualViewport,i=!b()&&a,u=(l.left+(i&&o?o.offsetLeft:0))/n,s=(l.top+(i&&o?o.offsetTop:0))/r,v=l.width/n,f=l.height/r;return{width:v,height:f,top:s,right:u+v,bottom:s+f,left:u,x:u,y:s}}function w(e){var t=c(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(e){return e?(e.nodeName||"").toLowerCase():null}function O(e){return((d(e)?e.ownerDocument:e.document)||window.document).documentElement}function k(e){return y(O(e)).left+w(e).scrollLeft}function S(e){return c(e).getComputedStyle(e)}function C(e){var t=S(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function L(e,t,a){void 0===a&&(a=!1);var l,n,r=p(t),o=p(t)&&function(e){var t=e.getBoundingClientRect(),a=h(t.width)/e.offsetWidth||1,l=h(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),i=O(t),u=y(e,o,a),s={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!a)&&(("body"!==x(t)||C(i))&&(s=(l=t)!==c(l)&&p(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:w(l)),p(t)?((d=y(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):i&&(d.x=k(i))),{x:u.left+s.scrollLeft-d.x,y:u.top+s.scrollTop-d.y,width:u.width,height:u.height}}function E(e){var t=y(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function B(e){return"html"===x(e)?e:e.assignedSlot||e.parentNode||(v(e)?e.host:null)||O(e)}function T(e){return["html","body","#document"].indexOf(x(e))>=0?e.ownerDocument.body:p(e)&&C(e)?e:T(B(e))}function V(e,t){var a;void 0===t&&(t=[]);var l=T(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=c(l),o=n?[r].concat(r.visualViewport||[],C(l)?l:[]):l,i=t.concat(o);return n?i:i.concat(V(B(o)))}function _(e){return["table","td","th"].indexOf(x(e))>=0}function q(e){return p(e)&&"fixed"!==S(e).position?e.offsetParent:null}function P(e){for(var t=c(e),a=q(e);a&&_(a)&&"static"===S(a).position;)a=q(a);return a&&("html"===x(a)||"body"===x(a)&&"static"===S(a).position)?t:a||function(e){var t=/firefox/i.test(g());if(/Trident/i.test(g())&&p(e)&&"fixed"===S(e).position)return null;var a=B(e);for(v(a)&&(a=a.host);p(a)&&["html","body"].indexOf(x(a))<0;){var l=S(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var N="top",D="bottom",A="right",R="left",I="auto",j=[N,D,A,R],M="start",z="end",$="clippingParents",W="viewport",H="popper",F="reference",K=j.reduce((function(e,t){return e.concat([t+"-"+M,t+"-"+z])}),[]),G=[].concat(j,[I]).reduce((function(e,t){return e.concat([t,t+"-"+M,t+"-"+z])}),[]),U=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function X(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function Y(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function J(e,t,a){return t===W?Y(function(e,t){var a=c(e),l=O(e),n=a.visualViewport,r=l.clientWidth,o=l.clientHeight,i=0,u=0;if(n){r=n.width,o=n.height;var s=b();(s||!s&&"fixed"===t)&&(i=n.offsetLeft,u=n.offsetTop)}return{width:r,height:o,x:i+k(e),y:u}}(e,a)):d(t)?function(e,t){var a=y(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):Y(function(e){var t,a=O(e),l=w(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=f(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=f(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),i=-l.scrollLeft+k(e),u=-l.scrollTop;return"rtl"===S(n||a).direction&&(i+=f(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:o,x:i,y:u}}(O(e)))}function Q(e){var t=V(B(e)),a=["absolute","fixed"].indexOf(S(e).position)>=0&&p(e)?P(e):e;return d(a)?t.filter((function(e){return d(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&v(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==x(e)})):[]}function Z(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ae(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?Z(n):null,o=n?ee(n):null,i=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case N:t={x:i,y:a.y-l.height};break;case D:t={x:i,y:a.y+a.height};break;case A:t={x:a.x+a.width,y:u};break;case R:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?te(r):null;if(null!=s){var c="y"===s?"height":"width";switch(o){case M:t[s]=t[s]-(a[c]/2-l[c]/2);break;case z:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function le(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,o=l.strategy,i=void 0===o?e.strategy:o,u=l.boundary,s=void 0===u?$:u,c=l.rootBoundary,p=void 0===c?W:c,v=l.elementContext,h=void 0===v?H:v,g=l.altBoundary,b=void 0!==g&&g,w=l.padding,x=void 0===w?0:w,k=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof x?x:(a=x,j.reduce((function(e,t){return e[t]=a,e}),{}))),S=h===H?F:H,C=e.rects.popper,L=e.elements[b?S:h],E=function(e,t,a,l){var n="clippingParents"===t?Q(e):[].concat(t),r=[].concat(n,[a]),o=r[0],i=r.reduce((function(t,a){var n=J(e,a,l);return t.top=f(n.top,t.top),t.right=m(n.right,t.right),t.bottom=m(n.bottom,t.bottom),t.left=f(n.left,t.left),t}),J(e,o,l));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}(d(L)?L:L.contextElement||O(e.elements.popper),s,p,i),B=y(e.elements.reference),T=ae({reference:B,element:C,strategy:"absolute",placement:r}),V=Y(Object.assign({},C,T)),_=h===H?V:B,q={top:E.top-_.top+k.top,bottom:_.bottom-E.bottom+k.bottom,left:E.left-_.left+k.left,right:_.right-E.right+k.right},P=e.modifiersData.offset;if(h===H&&P){var R=P[r];Object.keys(q).forEach((function(e){var t=[A,D].indexOf(e)>=0?1:-1,a=[N,D].indexOf(e)>=0?"y":"x";q[e]+=R[a]*t}))}return q}var ne={placement:"bottom",modifiers:[],strategy:"absolute"};function re(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(xe,me,Oe):de(v?xe:ge,me,v?Oe:be);S[k]=ke,_[k]=ke-me}t.modifiersData[l]=_}},requiresIfExists:["offset"]},ve={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ve[e]}))}var me={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,(function(e){return me[e]}))}function ge(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,o=a.padding,i=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?G:u,c=ee(l),d=c?i?K:K.filter((function(e){return ee(e)===c})):j,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=le(e,{placement:a,boundary:n,rootBoundary:r,padding:o})[Z(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,o=a.altAxis,i=void 0===o||o,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,m=a.allowedAutoPlacements,h=t.options.placement,g=Z(h),b=u||(g===h||!f?[fe(h)]:function(e){if(Z(e)===I)return[];var t=fe(e);return[he(e),t,he(t)]}(h)),y=[h].concat(b).reduce((function(e,a){return e.concat(Z(a)===I?ge(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:m}):a)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,k=!0,S=y[0],C=0;C=0,V=T?"width":"height",_=le(t,{placement:L,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),q=T?B?A:R:B?D:N;w[V]>x[V]&&(q=fe(q));var P=fe(q),j=[];if(r&&j.push(_[E]<=0),i&&j.push(_[q]<=0,_[P]<=0),j.every((function(e){return e}))){S=L,k=!1;break}O.set(L,j)}if(k)for(var z=function(e){var t=y.find((function(t){var a=O.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},$=f?3:1;$>0;$--){if("break"===z($))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(t,a,n){const{disabled:r,appendTo:o,appendToBody:i,openDirection:u}=e.toRefs(t),s=e.getCurrentInstance().proxy,c=n.multiselect,d=n.dropdown,p=e.ref(!1),v=e.ref(null),f=e.ref(null),m=l((()=>o.value||i.value)),h=l((()=>"top"===u.value&&"bottom"===f.value||"bottom"===u.value&&"top"!==f.value?"bottom":"top")),g=()=>{if(!v.value)return;let e=parseInt(window.getComputedStyle(d.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(d.value).borderBottomWidth.replace("px",""));v.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===h.value?e:t)]}}]}))),v.value.update()},b=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return e.onMounted((()=>{m.value&&(v.value=ce(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[pe,be,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){f.value=e.placement}}]}))})),e.onBeforeUnmount((()=>{m.value&&v.value&&(v.value.destroy(),v.value=null)})),{popper:v,isOpen:p,open:()=>{p.value||r.value||(p.value=!0,a.emit("open",s),m.value&&e.nextTick((()=>{g()})))},close:()=>{p.value&&(p.value=!1,a.emit("close",s))},placement:h,updatePopper:g}}function we(t,a,n){const{searchable:r,disabled:o,clearOnBlur:i}=e.toRefs(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,m=e.ref(!1),h=e.ref(!1),g=l((()=>r.value||o.value?-1:0)),b=()=>{r.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{o.value||(m.value=!0,e&&s())},w=()=>{m.value=!1,setTimeout((()=>{m.value||(c(),i.value&&d())}),1)};return{tabindex:g,isActive:m,mouseClicked:h,blur:b,focus:()=>{r.value&&!o.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(h.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{h.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{h.value=!1}),0)}}}function xe(t,a,n){const{mode:r,addTagOn:o,openDirection:i,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:m}=e.toRefs(t),h=e.getCurrentInstance().proxy,g=n.iv,b=n.update,y=n.deselect,w=n.search,x=n.setPointer,O=n.selectPointer,k=n.backwardPointer,S=n.forwardPointer,C=n.multiselect,L=n.wrapper,E=n.tags,B=n.isOpen,T=n.open,V=n.blur,_=n.fo,q=l((()=>v.value||f.value||!1)),P=l((()=>void 0!==o.value?o.value:void 0!==p.value?p.value:["enter"])),N=()=>{"tags"===r.value&&!s.value&&q.value&&u.value&&!d.value&&x(_.value[_.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,l;switch(a.emit("keydown",e,h),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...C.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==E.value)),l=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===g.value.length)return;let a=g.value.filter((e=>!e.disabled&&!1!==e.remove));a.length&&y(a[a.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==l&&void 0!==l)return b([...g.value].filter(((e,t)=>t!==l))),void(l===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?E.value.querySelector("input").focus():L.value.focus()));if(-1===P.value.indexOf("enter")&&q.value)return;N(),O();break;case" ":if(!q.value&&!u.value)return e.preventDefault(),N(),void O();if(!q.value)return!1;if(-1===P.value.indexOf("space")&&q.value)return;e.preventDefault(),N(),O();break;case"Tab":case";":case",":if(-1===P.value.indexOf(e.key.toLowerCase())||!q.value)return;N(),O(),e.preventDefault();break;case"Escape":V();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;B.value||T(),k();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;B.value||T(),S();break;case"ArrowLeft":if(u.value&&E.value&&E.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),-1===l?t[t.length-1].focus():l>0&&t[l-1].focus();break;case"ArrowRight":if(-1===l||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),t.length>l+1?t[l+1].focus():u.value?E.value.querySelector("input").focus():u.value||L.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,h)},preparePointer:N}}function Oe(t,a,n){const{classes:r,disabled:o,showOptions:i,breakTags:u}=e.toRefs(t),s=n.isOpen,c=n.isPointed,d=n.isSelected,p=n.isDisabled,v=n.isActive,f=n.canPointGroups,m=n.resolving,h=n.fo,g=n.placement,b=l((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),y=l((()=>!!(s.value&&i.value&&(!m.value||m.value&&h.value.length))));return{classList:e.computed((()=>{const e=b.value;return{container:[e.container].concat(o.value?e.containerDisabled:[]).concat(y.value&&"top"===g.value?e.containerOpenTop:[]).concat(y.value&&"top"!==g.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(o.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===g.value?e.dropdownTop:[]).concat(s.value&&i.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===g.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function ke(t,a,n){const{limit:r,infinite:o}=e.toRefs(t),i=n.isOpen,u=n.offset,s=n.search,c=n.pfo,d=n.eo,p=e.ref(null),v=e.shallowRef(null),f=l((()=>u.value{const{isIntersecting:a,target:l}=t[0];if(a){const t=l.offsetParent,a=t.scrollTop;u.value+=-1==r.value?10:r.value,e.nextTick((()=>{t.scrollTop=a}))}},h=()=>{i.value&&u.value{o.value&&h()})),e.watch(s,(()=>{o.value&&(u.value=r.value,h())}),{flush:"post"}),e.watch(d,(()=>{o.value&&h()}),{immediate:!1,flush:"post"}),e.onMounted((()=>{window&&window.IntersectionObserver&&(p.value=new IntersectionObserver(m))})),{hasMore:f,infiniteLoader:v}}function Se(t,a,n){const{placeholder:r,id:o,valueProp:i,label:u,mode:s,groupLabel:c,aria:d,searchable:p}=e.toRefs(t),v=n.pointer,f=n.iv,m=n.hasSelected,h=n.multipleLabelText,g=e.ref(null),b=l((()=>(o.value?o.value+"-":"")+"assist")),y=l((()=>(o.value?o.value+"-":"")+"multiselect-options")),w=l((()=>{if(v.value){let e=o.value?`${o.value}-`:"";return e+=(v.value.group?"multiselect-group":"multiselect-option")+"-",e+=v.value.group?v.value.index:v.value[i.value],e}})),x=l((()=>r.value)),O=l((()=>"single"!==s.value)),k=e.computed((()=>"single"===s.value&&m.value?f.value[u.value]:"multiple"===s.value&&m.value?h.value:"tags"===s.value&&m.value?f.value.map((e=>e[u.value])).join(", "):"")),S=e.computed((()=>{let e={...d.value};return p.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${b.value} ${e["aria-labelledby"]}`:b.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return e.onMounted((()=>{if(o.value&&document&&document.querySelector){let e=document.querySelector(`[for="${o.value}"]`);g.value=e?e.innerText:null}})),{arias:S,ariaLabel:k,ariaAssist:b,ariaControls:y,ariaPlaceholder:x,ariaMultiselectable:O,ariaActiveDescendant:w,ariaOptionId:e=>`${o.value?o.value+"-":""}multiselect-option-${e[i.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${o.value?o.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Ce(t,a,l){const{locale:n,fallbackLocale:r}=e.toRefs(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Le(t,a,l){return{multiselect:e.shallowRef(null),wrapper:e.shallowRef(null),tags:e.shallowRef(null),input:e.shallowRef(null),dropdown:e.shallowRef(null)}}var Ee={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Le,Ce,n,o,ye,r,a,we,u,ke,s,xe,Oe,Se]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};const Be=["id","dir"],Te=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Ve=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],_e=["onKeyup","aria-label"],qe=["onClick"],Pe=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],Ne=["innerHTML"],De=["id"],Ae=["id"],Re=["id","aria-label","aria-selected"],Ie=["data-pointed","onMouseenter","onClick"],je=["innerHTML"],Me=["aria-label"],ze=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],$e=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],We=["innerHTML"],He=["innerHTML"],Fe=["value"],Ke=["name","value"],Ge=["name","value"],Ue=["id"];return Ee.render=function(t,a,l,n,r,o){return e.openBlock(),e.createElementBlock("div",{ref:"multiselect",class:e.normalizeClass(t.classList.container),id:l.searchable?void 0:l.id,dir:l.rtl?"rtl":void 0,onFocusin:a[12]||(a[12]=(...e)=>t.handleFocusIn&&t.handleFocusIn(...e)),onFocusout:a[13]||(a[13]=(...e)=>t.handleFocusOut&&t.handleFocusOut(...e)),onKeyup:a[14]||(a[14]=(...e)=>t.handleKeyup&&t.handleKeyup(...e)),onKeydown:a[15]||(a[15]=(...e)=>t.handleKeydown&&t.handleKeydown(...e))},[e.createElementVNode("div",e.mergeProps({class:t.classList.wrapper,onMousedown:a[9]||(a[9]=(...e)=>t.handleMousedown&&t.handleMousedown(...e)),ref:"wrapper",tabindex:t.tabindex,"aria-controls":l.searchable?void 0:t.ariaControls,"aria-placeholder":l.searchable?void 0:t.ariaPlaceholder,"aria-expanded":l.searchable?void 0:t.isOpen,"aria-activedescendant":l.searchable?void 0:t.ariaActiveDescendant,"aria-multiselectable":l.searchable?void 0:t.ariaMultiselectable,role:l.searchable?void 0:"combobox"},l.searchable?{}:t.arias),[e.createCommentVNode(" Search "),"tags"!==l.mode&&l.searchable&&!l.disabled?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:l.inputType,modelValue:t.search,value:t.search,class:t.classList.search,autocomplete:l.autocomplete,id:l.searchable?l.id:void 0,onInput:a[0]||(a[0]=(...e)=>t.handleSearchInput&&t.handleSearchInput(...e)),onKeypress:a[1]||(a[1]=(...e)=>t.handleKeypress&&t.handleKeypress(...e)),onPaste:a[2]||(a[2]=e.withModifiers(((...e)=>t.handlePaste&&t.handlePaste(...e)),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...l.attrs,...t.arias}),null,16,Ve)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Tags (with search) "),"tags"==l.mode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.classList.tags),"data-tags":""},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.iv,((a,n,r)=>e.renderSlot(t.$slots,"tag",{option:a,handleTagRemove:t.handleTagRemove,disabled:l.disabled},(()=>[(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([t.classList.tag,a.disabled?t.classList.tagDisabled:null]),tabindex:"-1",onKeyup:e.withKeys((e=>t.handleTagRemove(a,e)),["enter"]),key:r,"aria-label":t.ariaTagLabel(t.localize(a[l.label]))},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagWrapper)},e.toDisplayString(t.localize(a[l.label])),3),l.disabled||a.disabled?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.classList.tagRemove),onClick:e.withModifiers((e=>t.handleTagRemove(a,e)),["stop"])},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagRemoveIcon)},null,2)],10,qe))],42,_e))])))),256)),e.createElementVNode("div",{class:e.normalizeClass(t.classList.tagsSearchWrapper),ref:"tags"},[e.createCommentVNode(" Used for measuring search width "),e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagsSearchCopy)},e.toDisplayString(t.search),3),e.createCommentVNode(" Actual search input "),l.searchable&&!l.disabled?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:l.inputType,modelValue:t.search,value:t.search,class:t.classList.tagsSearch,id:l.searchable?l.id:void 0,autocomplete:l.autocomplete,onInput:a[3]||(a[3]=(...e)=>t.handleSearchInput&&t.handleSearchInput(...e)),onKeypress:a[4]||(a[4]=(...e)=>t.handleKeypress&&t.handleKeypress(...e)),onPaste:a[5]||(a[5]=e.withModifiers(((...e)=>t.handlePaste&&t.handlePaste(...e)),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...l.attrs,...t.arias}),null,16,Pe)):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Single label "),"single"==l.mode&&t.hasSelected&&!t.search&&t.iv?e.renderSlot(t.$slots,"singlelabel",{key:2,value:t.iv},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.singleLabel)},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.singleLabelText)},e.toDisplayString(t.localize(t.iv[l.label])),3)],2)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Multiple label "),"multiple"==l.mode&&t.hasSelected&&!t.search?e.renderSlot(t.$slots,"multiplelabel",{key:3,values:t.iv},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.multipleLabel),innerHTML:t.multipleLabelText},null,10,Ne)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Placeholder "),!l.placeholder||t.hasSelected||t.search?e.createCommentVNode("v-if",!0):e.renderSlot(t.$slots,"placeholder",{key:4},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.placeholder),"aria-hidden":"true"},e.toDisplayString(l.placeholder),3)])),e.createCommentVNode(" Spinner "),l.loading||t.resolving?e.renderSlot(t.$slots,"spinner",{key:5},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.spinner),"aria-hidden":"true"},null,2)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Clear "),t.hasSelected&&!l.disabled&&l.canClear&&!t.busy?e.renderSlot(t.$slots,"clear",{key:6,clear:t.clear},(()=>[e.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:e.normalizeClass(t.classList.clear),onClick:a[6]||(a[6]=(...e)=>t.clear&&t.clear(...e)),onKeyup:a[7]||(a[7]=e.withKeys(((...e)=>t.clear&&t.clear(...e)),["enter"]))},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.clearIcon)},null,2)],34)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Caret "),l.caret&&l.showOptions?e.renderSlot(t.$slots,"caret",{key:7,handleCaretClick:t.handleCaretClick,isOpen:t.isOpen},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.caret),onClick:a[8]||(a[8]=(...e)=>t.handleCaretClick&&t.handleCaretClick(...e)),"aria-hidden":"true"},null,2)])):e.createCommentVNode("v-if",!0)],16,Te),e.createCommentVNode(" Options "),(e.openBlock(),e.createBlock(e.Teleport,{to:l.appendTo||"body",disabled:!l.appendToBody&&!l.appendTo},[e.createElementVNode("div",{id:l.id?`${l.id}-dropdown`:void 0,class:e.normalizeClass(t.classList.dropdown),tabindex:"-1",ref:"dropdown",onFocusin:a[10]||(a[10]=(...e)=>t.handleFocusIn&&t.handleFocusIn(...e)),onFocusout:a[11]||(a[11]=(...e)=>t.handleFocusOut&&t.handleFocusOut(...e))},[e.renderSlot(t.$slots,"beforelist",{options:t.fo}),e.createElementVNode("ul",{class:e.normalizeClass(t.classList.options),id:t.ariaControls,role:"listbox"},[l.groups?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.fg,((a,n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.group),key:r,id:t.ariaGroupId(a),"aria-label":t.ariaGroupLabel(t.localize(a[l.groupLabel])),"aria-selected":t.isSelected(a),role:"option"},[a.__CREATE__?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.classList.groupLabel(a)),"data-pointed":t.isPointed(a),onMouseenter:e=>t.setPointer(a,n),onClick:e=>t.handleGroupClick(a)},[e.renderSlot(t.$slots,"grouplabel",{group:a,isSelected:t.isSelected,isPointed:t.isPointed},(()=>[e.createElementVNode("span",{innerHTML:t.localize(a[l.groupLabel])},null,8,je)]))],42,Ie)),e.createElementVNode("ul",{class:e.normalizeClass(t.classList.groupOptions),"aria-label":t.ariaGroupLabel(t.localize(a[l.groupLabel])),role:"group"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.__VISIBLE__,((n,r,o)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.option(n,a)),"data-pointed":t.isPointed(n),"data-selected":t.isSelected(n)||void 0,key:o,onMouseenter:e=>t.setPointer(n),onClick:e=>t.handleOptionClick(n),id:t.ariaOptionId(n),"aria-selected":t.isSelected(n),"aria-label":t.ariaOptionLabel(t.localize(n[l.label])),role:"option"},[e.renderSlot(t.$slots,"option",{option:n,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},(()=>[e.createElementVNode("span",null,e.toDisplayString(t.localize(n[l.label])),1)]))],42,ze)))),128))],10,Me)],10,Re)))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.fo,((a,n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.option(a)),"data-pointed":t.isPointed(a),"data-selected":t.isSelected(a)||void 0,key:r,onMouseenter:e=>t.setPointer(a),onClick:e=>t.handleOptionClick(a),id:t.ariaOptionId(a),"aria-selected":t.isSelected(a),"aria-label":t.ariaOptionLabel(t.localize(a[l.label])),role:"option"},[e.renderSlot(t.$slots,"option",{option:a,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},(()=>[e.createElementVNode("span",null,e.toDisplayString(t.localize(a[l.label])),1)]))],42,$e)))),128))],10,Ae),t.noOptions?e.renderSlot(t.$slots,"nooptions",{key:0},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.noOptions),innerHTML:t.localize(l.noOptionsText)},null,10,We)])):e.createCommentVNode("v-if",!0),t.noResults?e.renderSlot(t.$slots,"noresults",{key:1},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.noResults),innerHTML:t.localize(l.noResultsText)},null,10,He)])):e.createCommentVNode("v-if",!0),l.infinite&&t.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.classList.inifinite),ref:"infiniteLoader"},[e.renderSlot(t.$slots,"infinite",{},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.inifiniteSpinner)},null,2)]))],2)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"afterlist",{options:t.fo})],42,De)],8,["to","disabled"])),e.createCommentVNode(" Hacky input element to show HTML5 required warning "),l.required?(e.openBlock(),e.createElementBlock("input",{key:0,class:e.normalizeClass(t.classList.fakeInput),tabindex:"-1",value:t.textValue,required:""},null,10,Fe)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Native input support "),l.nativeSupport?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},["single"==l.mode?(e.openBlock(),e.createElementBlock("input",{key:0,type:"hidden",name:l.name,value:void 0!==t.plainValue?t.plainValue:""},null,8,Ke)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.plainValue,((t,a)=>(e.openBlock(),e.createElementBlock("input",{type:"hidden",name:`${l.name}[]`,value:t,key:a},null,8,Ge)))),128))],64)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Screen reader assistive text "),l.searchable&&t.hasSelected?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.classList.assist),id:t.ariaAssist,"aria-hidden":"true"},e.toDisplayString(t.ariaLabel),11,Ue)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Create height for empty input "),e.createElementVNode("div",{class:e.normalizeClass(t.classList.spacer)},null,2)],42,Be)},Ee.__file="src/Multiselect.vue",Ee}(Vue); diff --git a/dist/multiselect.js b/dist/multiselect.js index 06a961f..9f90005 100644 --- a/dist/multiselect.js +++ b/dist/multiselect.js @@ -1356,7 +1356,7 @@ function usePointer (props, context, dep) }); watch(isOpen, (val) => { - if (val && multiselect?.value) { + if (val && multiselect && multiselect.value) { let firstSelected = multiselect.value.querySelectorAll(`[data-selected]`)[0]; if (!firstSelected) { @@ -4322,7 +4322,7 @@ var script = { ]) }, beforeMount() { - if (this.$root.constructor?.version?.match(/^2\./) || this.vueVersionMs === 2) { + if ((this.$root.constructor && this.$root.constructor.version && this.$root.constructor.version.match(/^2\./)) || this.vueVersionMs === 2) { if (!this.$options.components.Teleport) { this.$options.components.Teleport = { render() { diff --git a/dist/multiselect.min.js b/dist/multiselect.min.js index c50ab37..5fe375d 100644 --- a/dist/multiselect.min.js +++ b/dist/multiselect.min.js @@ -1 +1 @@ -import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as i,watch as n,nextTick as r,onMounted as o,onBeforeUnmount as u,shallowRef as s,openBlock as c,createElementBlock as d,normalizeClass as p,createElementVNode as v,mergeProps as f,createCommentVNode as h,withModifiers as g,Fragment as m,renderList as b,renderSlot as y,withKeys as w,toDisplayString as O,createBlock as x,Teleport as L}from"vue";function S(e){return null==e}function k(a,l,i){const{object:n,valueProp:r,mode:o}=e(a),u=t().proxy,s=i.iv,c=e=>n.value||S(e)?e:Array.isArray(e)?e.map((e=>e[r.value])):e[r.value],d=e=>S(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function T(e){return a((()=>({get:e,set:()=>{}})))}function E(t,a){const{value:n,modelValue:r,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=T((()=>void 0!==r.value?r.value:n.value)),d=i((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),p=T((()=>"single"!==o.value?s.value.map((e=>e[u.value])).join(","):s.value[u.value]));return{iv:s,internalValue:s,ev:c,externalValue:c,textValue:p,plainValue:d}}function _(a,i,r){const{regex:o}=e(a),u=t().proxy,s=r.isOpen,c=r.open,d=l(null);return n(d,(e=>{!s.value&&e&&c(),i.emit("search-change",e,u)})),{search:d,clearSearch:()=>{d.value=""},handleSearchInput:e=>{d.value=e.target.value},handleKeypress:e=>{if(o.value){let t=o.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(o.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=o.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}i.emit("paste",e,u)}}}function q(t,a,i){const{groupSelect:n,mode:r,groups:o,disabledProp:u}=e(t),s=l(null),c=e=>{void 0===e||null!==e&&e[u.value]||o.value&&e&&e.group&&("single"===r.value||!n.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:()=>{c(null)}}}function P(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/æ/g,"ae").replace(/œ/g,"oe").replace(/ø/g,"o").replace(/\p{Diacritic}/gu,"")}function C(a,r,o){const{options:u,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:h,appendNewTag:g,appendNewOption:m,multipleLabel:b,object:y,loading:w,delay:O,resolveOnLoad:x,minChars:L,filterResults:k,clearOnSearch:E,clearOnSelect:_,valueProp:q,allowAbsent:C,groupLabel:A,canDeselect:B,max:D,strict:I,closeOnSelect:j,closeOnDeselect:R,groups:M,reverse:$,infinite:V,groupOptions:W,groupHideEmpty:H,groupSelect:F,onCreate:N,disabledProp:K,searchStart:z,searchFilter:G}=e(a),U=t().proxy,X=o.iv,Y=o.ev,J=o.search,Q=o.clearSearch,Z=o.update,ee=o.pointer,te=o.setPointer,ae=o.clearPointer,le=o.focus,ie=o.deactivate,ne=o.close,re=o.localize,oe=l([]),ue=l([]),se=l(!1),ce=l(null),de=l(V.value&&-1===d.value?10:d.value),pe=i({get:()=>ue.value,set:e=>ue.value=e}),ve=T((()=>v.value||f.value||!1)),fe=T((()=>void 0!==g.value?g.value:void 0===m.value||m.value)),he=i((()=>{if(M.value){let e=be.value||[],t=[];return e.forEach((e=>{ze(e[W.value]).forEach((a=>{t.push(Object.assign({},a,e[K.value]?{[K.value]:!0}:{}))}))})),t}{let e=ze(ue.value||[]);return oe.value.length&&(e=e.concat(oe.value)),e}})),ge=i((()=>{let e=he.value;return $.value&&(e=e.reverse()),ke.value.length&&(e=ke.value.concat(e)),Ke(e)})),me=i((()=>{let e=ge.value;return de.value>0&&(e=e.slice(0,de.value)),e})),be=i((()=>{if(!M.value)return[];let e=[],t=ue.value||[];return oe.value.length&&e.push({[A.value]:" ",[W.value]:[...oe.value],__CREATE__:!0}),e.concat(t)})),ye=i((()=>{let e=[...be.value].map((e=>({...e})));return ke.value.length&&(e[0]&&e[0].__CREATE__?e[0][W.value]=[...ke.value,...e[0][W.value]]:e=[{[A.value]:" ",[W.value]:[...ke.value],__CREATE__:!0}].concat(e)),e})),we=i((()=>{if(!M.value)return[];let e=ye.value;return Ne((e||[]).map(((e,t)=>{const a=ze(e[W.value]);return{...e,index:t,group:!0,[W.value]:Ke(a,!1).map((t=>Object.assign({},t,e[K.value]?{[K.value]:!0}:{}))),__VISIBLE__:Ke(a).map((t=>Object.assign({},t,e[K.value]?{[K.value]:!0}:{})))}})))})),Oe=i((()=>{switch(s.value){case"single":return!S(X.value[q.value]);case"multiple":case"tags":return!S(X.value)&&X.value.length>0}})),xe=i((()=>void 0!==b.value?b.value(X.value,U):X.value&&X.value.length>1?`${X.value.length} options selected`:"1 option selected")),Le=T((()=>!he.value.length&&!se.value&&!ke.value.length)),Se=T((()=>he.value.length>0&&0==me.value.length&&(J.value&&M.value||!M.value))),ke=i((()=>!1!==ve.value&&J.value?-1!==He(J.value)?[]:[{[q.value]:J.value,[Te.value[0]]:J.value,[h.value]:J.value,__CREATE__:!0}]:[])),Te=i((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),Ee=T((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),_e=T((()=>w.value||se.value)),qe=e=>{switch("object"!=typeof e&&(e=We(e)),s.value){case"single":Z(e);break;case"multiple":case"tags":Z(X.value.concat(e))}r.emit("select",Ce(e),e,U)},Pe=e=>{switch("object"!=typeof e&&(e=We(e)),s.value){case"single":Be();break;case"tags":case"multiple":Z(Array.isArray(e)?X.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):X.value.filter((t=>t[q.value]!=e[q.value])))}r.emit("deselect",Ce(e),e,U)},Ce=e=>y.value?e:e[q.value],Ae=e=>{Pe(e)},Be=()=>{Z(Ee.value),r.emit("clear",U)},De=e=>{if(void 0!==e.group)return"single"!==s.value&&(Ve(e[W.value])&&e[W.value].length);switch(s.value){case"single":return!S(X.value)&&X.value[q.value]==e[q.value];case"tags":case"multiple":return!S(X.value)&&-1!==X.value.map((e=>e[q.value])).indexOf(e[q.value])}},Ie=e=>!0===e[K.value],je=()=>!(void 0===D||-1===D.value||!Oe.value&&D.value>0)&&X.value.length>=D.value,Re=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&De(e))return B.value&&Pe(e),void(R.value&&(ae(),ne()));e&&Me(e),_.value&&Q(),j.value&&(ae(),ne()),e&&qe(e);break;case"multiple":if(e&&De(e))return Pe(e),void(R.value&&(ae(),ne()));if(je())return void r.emit("max",U);e&&(Me(e),qe(e)),_.value&&Q(),p.value&&ae(),j.value&&ne();break;case"tags":if(e&&De(e))return Pe(e),void(R.value&&(ae(),ne()));if(je())return void r.emit("max",U);e&&Me(e),_.value&&Q(),e&&qe(e),p.value&&ae(),j.value&&ne()}j.value||le()},Me=e=>{void 0===We(e[q.value])&&ve.value&&(r.emit("tag",e[q.value],U),r.emit("option",e[q.value],U),r.emit("create",e[q.value],U),fe.value&&Fe(e),Q())},$e=e=>void 0===e.find((e=>!De(e)&&!e[K.value])),Ve=e=>void 0===e.find((e=>!De(e))),We=e=>he.value[he.value.map((e=>String(e[q.value]))).indexOf(String(e))],He=e=>he.value.findIndex((t=>Te.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Fe=e=>{oe.value.push(e)},Ne=e=>H.value?e.filter((e=>J.value?e.__VISIBLE__.length:e[W.value].length)):e.filter((e=>!J.value||e.__VISIBLE__.length)),Ke=(e,t=!0)=>{let a=e;if(J.value&&k.value){let e=G.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=P(re(e[a]),I.value);return z.value?l.startsWith(P(t,I.value)):-1!==l.indexOf(P(t,I.value))}))),a=a.filter((t=>e(t,J.value,U)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&De(e))(e)))),a},ze=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[q.value]:e,[Te.value[0]]:a,[h.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[q.value]:e,[Te.value[0]]:e,[h.value]:e})),t},Ge=()=>{S(Y.value)||(X.value=Ye(Y.value))},Ue=e=>(se.value=!0,new Promise(((t,a)=>{u.value(J.value,U).then((t=>{ue.value=t||[],"function"==typeof e&&e(t),se.value=!1})).catch((e=>{console.error(e),ue.value=[],se.value=!1})).finally((()=>{t()}))}))),Xe=()=>{if(Oe.value)if("single"===s.value){let e=We(X.value[q.value]);if(void 0!==e){let t=e[h.value];X.value[h.value]=t,y.value&&(Y.value[h.value]=t)}}else X.value.forEach(((e,t)=>{let a=We(X.value[t][q.value]);if(void 0!==a){let e=a[h.value];X.value[t][h.value]=e,y.value&&(Y.value[t][h.value]=e)}}))},Ye=e=>S(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?We(e)||(C.value?{[h.value]:e,[q.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!We(e)||C.value)).map((e=>We(e)||{[h.value]:e,[q.value]:e,[Te.value[0]]:e})),Je=()=>{ce.value=n(J,(e=>{e.length{e==J.value&&u.value(J.value,U).then((t=>{e!=J.value&&J.value||(ue.value=t,ee.value=me.value.filter((e=>!0!==e[K.value]))[0]||null,se.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!S(Y.value)&&!Array.isArray(Y.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?x.value?Ue(Ge):1==y.value&&Ge():(ue.value=u.value,Ge()),O.value>-1&&Je(),n(O,((e,t)=>{ce.value&&ce.value(),e>=0&&Je()})),n(Y,(e=>{if(S(e))Z(Ye(e),!1);else switch(s.value){case"single":(y.value?e[q.value]!=X.value[q.value]:e!=X.value[q.value])&&Z(Ye(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(y.value?e.map((e=>e[q.value])):e,X.value.map((e=>e[q.value])))||Z(Ye(e),!1)}}),{deep:!0}),n(u,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Ue():(ue.value=a.options,Object.keys(X.value).length||Ge(),Xe())})),n(h,Xe),n(d,((e,t)=>{de.value=V.value&&-1===e?10:e})),{resolvedOptions:pe,pfo:ge,fo:me,filteredOptions:me,hasSelected:Oe,multipleLabelText:xe,eo:he,extendedOptions:he,eg:be,extendedGroups:be,fg:we,filteredGroups:we,noOptions:Le,noResults:Se,resolving:se,busy:_e,offset:de,select:qe,deselect:Pe,remove:Ae,selectAll:()=>{"single"!==s.value&&qe(me.value.filter((e=>!e.disabled&&!De(e))))},clear:Be,isSelected:De,isDisabled:Ie,isMax:je,getOption:We,handleOptionClick:e=>{if(!Ie(e))return N.value&&!De(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=N.value(e,U))instanceof Promise)?(se.value=!0,void e.then((e=>{se.value=!1,Re(e)}))):void Re(e)},handleGroupClick:e=>{if(!Ie(e)&&"single"!==s.value&&F.value){switch(s.value){case"multiple":case"tags":$e(e[W.value])?Pe(e[W.value]):qe(e[W.value].filter((e=>-1===X.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[K.value])).filter(((e,t)=>X.value.length+1+t<=D.value||-1===D.value))),p.value&&ee.value&&te(we.value.filter((e=>!e[K.value]))[ee.value.index])}j.value&&ie()}},handleTagRemove:(e,t)=>{0===t.button?Ae(e):t.preventDefault()},refreshOptions:e=>{Ue(e)},resolveOptions:Ue,refreshLabels:Xe}}function A(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:d,mode:p,groupSelect:v,disabledProp:f,groupOptions:h}=e(t),g=l.fo,m=l.fg,b=l.handleOptionClick,y=l.handleGroupClick,w=l.search,O=l.pointer,x=l.setPointer,L=l.clearPointer,S=l.multiselect,k=l.isOpen,E=i((()=>g.value.filter((e=>!e[f.value])))),_=i((()=>m.value.filter((e=>!e[f.value])))),q=T((()=>"single"!==p.value&&v.value)),P=T((()=>O.value&&O.value.group)),C=i((()=>W(O.value))),A=i((()=>{const e=P.value?O.value:W(O.value),t=_.value.map((e=>e[c.value])).indexOf(e[c.value]);let a=_.value[t-1];return void 0===a&&(a=D.value),a})),B=i((()=>{let e=_.value.map((e=>e.label)).indexOf(P.value?O.value[c.value]:W(O.value)[c.value])+1;return _.value.length<=e&&(e=0),_.value[e]})),D=i((()=>[..._.value].slice(-1)[0])),I=i((()=>O.value.__VISIBLE__.filter((e=>!e[f.value]))[0])),j=i((()=>{const e=C.value.__VISIBLE__.filter((e=>!e[f.value]));return e[e.map((e=>e[o.value])).indexOf(O.value[o.value])-1]})),R=i((()=>{const e=W(O.value).__VISIBLE__.filter((e=>!e[f.value]));return e[e.map((e=>e[o.value])).indexOf(O.value[o.value])+1]})),M=i((()=>[...A.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),$=i((()=>[...D.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),V=()=>{x(E.value[0]||null)},W=e=>_.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[o.value])).indexOf(e[o.value]))),H=()=>{let e=S.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;d.value&&(t=P.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{s.value&&(e.length&&u.value?V():L())})),n(k,(e=>{if(e&&S?.value){let e=S.value.querySelectorAll("[data-selected]")[0];if(!e)return;let t=e.parentElement.parentElement;r((()=>{t.scrollTop=e.offsetTop}))}})),{pointer:O,canPointGroups:q,isPointed:e=>!(!O.value||!(!e.group&&O.value[o.value]===e[o.value]||void 0!==e.group&&O.value[c.value]===e[c.value]))||void 0,setPointerFirst:V,selectPointer:()=>{O.value&&!0!==O.value[f.value]&&(P.value?y(O.value):b(O.value))},forwardPointer:()=>{if(null===O.value)x((d.value&&q.value?_.value[0].__CREATE__?E.value[0]:_.value[0]:E.value[0])||null);else if(d.value&&q.value){let e=P.value?I.value:R.value;void 0===e&&(e=B.value,e.__CREATE__&&(e=e[h.value][0])),x(e||null)}else{let e=E.value.map((e=>e[o.value])).indexOf(O.value[o.value])+1;E.value.length<=e&&(e=0),x(E.value[e]||null)}r((()=>{H()}))},backwardPointer:()=>{if(null===O.value){let e=E.value[E.value.length-1];d.value&&q.value&&(e=$.value,void 0===e&&(e=D.value)),x(e||null)}else if(d.value&&q.value){let e=P.value?M.value:j.value;void 0===e&&(e=P.value?A.value:C.value,e.__CREATE__&&(e=M.value,void 0===e&&(e=A.value))),x(e||null)}else{let e=E.value.map((e=>e[o.value])).indexOf(O.value[o.value])-1;e<0&&(e=E.value.length-1),x(E.value[e]||null)}r((()=>{H()}))}}}function B(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function D(e){return e instanceof B(e).Element||e instanceof Element}function I(e){return e instanceof B(e).HTMLElement||e instanceof HTMLElement}function j(e){return"undefined"!=typeof ShadowRoot&&(e instanceof B(e).ShadowRoot||e instanceof ShadowRoot)}var R=Math.max,M=Math.min,$=Math.round;function V(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function W(){return!/^((?!chrome|android).)*safari/i.test(V())}function H(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),i=1,n=1;t&&I(e)&&(i=e.offsetWidth>0&&$(l.width)/e.offsetWidth||1,n=e.offsetHeight>0&&$(l.height)/e.offsetHeight||1);var r=(D(e)?B(e):window).visualViewport,o=!W()&&a,u=(l.left+(o&&r?r.offsetLeft:0))/i,s=(l.top+(o&&r?r.offsetTop:0))/n,c=l.width/i,d=l.height/n;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function F(e){var t=B(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function N(e){return e?(e.nodeName||"").toLowerCase():null}function K(e){return((D(e)?e.ownerDocument:e.document)||window.document).documentElement}function z(e){return H(K(e)).left+F(e).scrollLeft}function G(e){return B(e).getComputedStyle(e)}function U(e){var t=G(e),a=t.overflow,l=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+i+l)}function X(e,t,a){void 0===a&&(a=!1);var l,i,n=I(t),r=I(t)&&function(e){var t=e.getBoundingClientRect(),a=$(t.width)/e.offsetWidth||1,l=$(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=K(t),u=H(e,r,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!a)&&(("body"!==N(t)||U(o))&&(s=(l=t)!==B(l)&&I(l)?{scrollLeft:(i=l).scrollLeft,scrollTop:i.scrollTop}:F(l)),I(t)?((c=H(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=z(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function Y(e){var t=H(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function J(e){return"html"===N(e)?e:e.assignedSlot||e.parentNode||(j(e)?e.host:null)||K(e)}function Q(e){return["html","body","#document"].indexOf(N(e))>=0?e.ownerDocument.body:I(e)&&U(e)?e:Q(J(e))}function Z(e,t){var a;void 0===t&&(t=[]);var l=Q(e),i=l===(null==(a=e.ownerDocument)?void 0:a.body),n=B(l),r=i?[n].concat(n.visualViewport||[],U(l)?l:[]):l,o=t.concat(r);return i?o:o.concat(Z(J(r)))}function ee(e){return["table","td","th"].indexOf(N(e))>=0}function te(e){return I(e)&&"fixed"!==G(e).position?e.offsetParent:null}function ae(e){for(var t=B(e),a=te(e);a&&ee(a)&&"static"===G(a).position;)a=te(a);return a&&("html"===N(a)||"body"===N(a)&&"static"===G(a).position)?t:a||function(e){var t=/firefox/i.test(V());if(/Trident/i.test(V())&&I(e)&&"fixed"===G(e).position)return null;var a=J(e);for(j(a)&&(a=a.host);I(a)&&["html","body"].indexOf(N(a))<0;){var l=G(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var le="top",ie="bottom",ne="right",re="left",oe="auto",ue=[le,ie,ne,re],se="start",ce="end",de="clippingParents",pe="viewport",ve="popper",fe="reference",he=ue.reduce((function(e,t){return e.concat([t+"-"+se,t+"-"+ce])}),[]),ge=[].concat(ue,[oe]).reduce((function(e,t){return e.concat([t,t+"-"+se,t+"-"+ce])}),[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(e){var t=new Map,a=new Set,l=[];function i(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&i(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||i(e)})),l}function ye(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function we(e,t,a){return t===pe?ye(function(e,t){var a=B(e),l=K(e),i=a.visualViewport,n=l.clientWidth,r=l.clientHeight,o=0,u=0;if(i){n=i.width,r=i.height;var s=W();(s||!s&&"fixed"===t)&&(o=i.offsetLeft,u=i.offsetTop)}return{width:n,height:r,x:o+z(e),y:u}}(e,a)):D(t)?function(e,t){var a=H(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):ye(function(e){var t,a=K(e),l=F(e),i=null==(t=e.ownerDocument)?void 0:t.body,n=R(a.scrollWidth,a.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),r=R(a.scrollHeight,a.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-l.scrollLeft+z(e),u=-l.scrollTop;return"rtl"===G(i||a).direction&&(o+=R(a.clientWidth,i?i.clientWidth:0)-n),{width:n,height:r,x:o,y:u}}(K(e)))}function Oe(e){var t=Z(J(e)),a=["absolute","fixed"].indexOf(G(e).position)>=0&&I(e)?ae(e):e;return D(a)?t.filter((function(e){return D(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&j(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==N(e)})):[]}function xe(e){return e.split("-")[0]}function Le(e){return e.split("-")[1]}function Se(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ke(e){var t,a=e.reference,l=e.element,i=e.placement,n=i?xe(i):null,r=i?Le(i):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(n){case le:t={x:o,y:a.y-l.height};break;case ie:t={x:o,y:a.y+a.height};break;case ne:t={x:a.x+a.width,y:u};break;case re:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=n?Se(n):null;if(null!=s){var c="y"===s?"height":"width";switch(r){case se:t[s]=t[s]-(a[c]/2-l[c]/2);break;case ce:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function Te(e,t){void 0===t&&(t={});var a,l=t,i=l.placement,n=void 0===i?e.placement:i,r=l.strategy,o=void 0===r?e.strategy:r,u=l.boundary,s=void 0===u?de:u,c=l.rootBoundary,d=void 0===c?pe:c,p=l.elementContext,v=void 0===p?ve:p,f=l.altBoundary,h=void 0!==f&&f,g=l.padding,m=void 0===g?0:g,b=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof m?m:(a=m,ue.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===ve?fe:ve,w=e.rects.popper,O=e.elements[h?y:v],x=function(e,t,a,l){var i="clippingParents"===t?Oe(e):[].concat(t),n=[].concat(i,[a]),r=n[0],o=n.reduce((function(t,a){var i=we(e,a,l);return t.top=R(i.top,t.top),t.right=M(i.right,t.right),t.bottom=M(i.bottom,t.bottom),t.left=R(i.left,t.left),t}),we(e,r,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(D(O)?O:O.contextElement||K(e.elements.popper),s,d,o),L=H(e.elements.reference),S=ke({reference:L,element:w,strategy:"absolute",placement:n}),k=ye(Object.assign({},w,S)),T=v===ve?k:L,E={top:x.top-T.top+b.top,bottom:T.bottom-x.bottom+b.bottom,left:x.left-T.left+b.left,right:T.right-x.right+b.right},_=e.modifiersData.offset;if(v===ve&&_){var q=_[n];Object.keys(E).forEach((function(e){var t=[ne,ie].indexOf(e)>=0?1:-1,a=[le,ie].indexOf(e)>=0?"y":"x";E[e]+=q[a]*t}))}return E}var Ee={placement:"bottom",modifiers:[],strategy:"absolute"};function _e(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(ge,ce,me):De(v?ge:pe,ce,v?me:ve);x[O]=be,_[O]=be-ce}t.modifiersData[l]=_}},requiresIfExists:["offset"]},je={left:"right",right:"left",bottom:"top",top:"bottom"};function Re(e){return e.replace(/left|right|bottom|top/g,(function(e){return je[e]}))}var Me={start:"end",end:"start"};function $e(e){return e.replace(/start|end/g,(function(e){return Me[e]}))}function Ve(e,t){void 0===t&&(t={});var a=t,l=a.placement,i=a.boundary,n=a.rootBoundary,r=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?ge:u,c=Le(l),d=c?o?he:he.filter((function(e){return Le(e)===c})):ue,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=Te(e,{placement:a,boundary:i,rootBoundary:n,padding:r})[xe(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var We={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var i=a.mainAxis,n=void 0===i||i,r=a.altAxis,o=void 0===r||r,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=xe(g),b=u||(m===g||!f?[Re(g)]:function(e){if(xe(e)===oe)return[];var t=Re(e);return[$e(e),t,$e(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(xe(a)===oe?Ve(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),w=t.rects.reference,O=t.rects.popper,x=new Map,L=!0,S=y[0],k=0;k=0,P=q?"width":"height",C=Te(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),A=q?_?ne:re:_?ie:le;w[P]>O[P]&&(A=Re(A));var B=Re(A),D=[];if(n&&D.push(C[E]<=0),o&&D.push(C[A]<=0,C[B]<=0),D.every((function(e){return e}))){S=T,L=!1;break}x.set(T,D)}if(L)for(var I=function(e){var t=y.find((function(t){var a=x.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},j=f?3:1;j>0;j--){if("break"===I(j))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function He(a,i,n){const{disabled:s,appendTo:c,appendToBody:d,openDirection:p}=e(a),v=t().proxy,f=n.multiselect,h=n.dropdown,g=l(!1),m=l(null),b=l(null),y=T((()=>c.value||d.value)),w=T((()=>"top"===p.value&&"bottom"===b.value||"bottom"===p.value&&"top"!==b.value?"bottom":"top")),O=()=>{if(!m.value)return;let e=parseInt(window.getComputedStyle(h.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(h.value).borderBottomWidth.replace("px",""));m.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===w.value?e:t)]}}]}))),m.value.update()},x=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return o((()=>{y.value&&(m.value=Be(f.value,h.value,{strategy:x(f.value)?"fixed":void 0,placement:p.value,modifiers:[Ie,We,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){b.value=e.placement}}]}))})),u((()=>{y.value&&m.value&&(m.value.destroy(),m.value=null)})),{popper:m,isOpen:g,open:()=>{g.value||s.value||(g.value=!0,i.emit("open",v),y.value&&r((()=>{O()})))},close:()=>{g.value&&(g.value=!1,i.emit("close",v))},placement:w,updatePopper:O}}function Fe(t,a,i){const{searchable:n,disabled:r,clearOnBlur:o}=e(t),u=i.input,s=i.open,c=i.close,d=i.clearSearch,p=i.isOpen,v=i.wrapper,f=i.tags,h=l(!1),g=l(!1),m=T((()=>n.value||r.value?-1:0)),b=()=>{n.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{r.value||(h.value=!0,e&&s())},w=()=>{h.value=!1,setTimeout((()=>{h.value||(c(),o.value&&d())}),1)};return{tabindex:m,isActive:h,mouseClicked:g,blur:b,focus:()=>{n.value&&!r.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(g.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{g.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{g.value=!1}),0)}}}function Ne(a,l,i){const{mode:n,addTagOn:r,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:h}=e(a),g=t().proxy,m=i.iv,b=i.update,y=i.deselect,w=i.search,O=i.setPointer,x=i.selectPointer,L=i.backwardPointer,S=i.forwardPointer,k=i.multiselect,E=i.wrapper,_=i.tags,q=i.isOpen,P=i.open,C=i.blur,A=i.fo,B=T((()=>v.value||f.value||!1)),D=T((()=>void 0!==r.value?r.value:void 0!==p.value?p.value:["enter"])),I=()=>{"tags"===n.value&&!s.value&&B.value&&u.value&&!d.value&&O(A.value[A.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,a;switch(l.emit("keydown",e,g),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===n.value&&(t=[...k.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==_.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===n.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===m.value.length)return;let l=m.value.filter((e=>!e.disabled&&!1!==e.remove));l.length&&y(l[l.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==a&&void 0!==a)return b([...m.value].filter(((e,t)=>t!==a))),void(a===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?_.value.querySelector("input").focus():E.value.focus()));if(-1===D.value.indexOf("enter")&&B.value)return;I(),x();break;case" ":if(!B.value&&!u.value)return e.preventDefault(),I(),void x();if(!B.value)return!1;if(-1===D.value.indexOf("space")&&B.value)return;e.preventDefault(),I(),x();break;case"Tab":case";":case",":if(-1===D.value.indexOf(e.key.toLowerCase())||!B.value)return;I(),x(),e.preventDefault();break;case"Escape":C();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;q.value||P(),L();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;q.value||P(),S();break;case"ArrowLeft":if(u.value&&_.value&&_.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==n.value||!m.value||!m.value.length)return;e.preventDefault(),-1===a?t[t.length-1].focus():a>0&&t[a-1].focus();break;case"ArrowRight":if(-1===a||e.shiftKey||"tags"!==n.value||!m.value||!m.value.length)return;e.preventDefault(),t.length>a+1?t[a+1].focus():u.value?_.value.querySelector("input").focus():u.value||E.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,g)},preparePointer:I}}function Ke(t,a,l){const{classes:n,disabled:r,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,d=l.isSelected,p=l.isDisabled,v=l.isActive,f=l.canPointGroups,h=l.resolving,g=l.fo,m=l.placement,b=T((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...n.value}))),y=T((()=>!!(s.value&&o.value&&(!h.value||h.value&&g.value.length))));return{classList:i((()=>{const e=b.value;return{container:[e.container].concat(r.value?e.containerDisabled:[]).concat(y.value&&"top"===m.value?e.containerOpenTop:[]).concat(y.value&&"top"!==m.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(r.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===m.value?e.dropdownTop:[]).concat(s.value&&o.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===m.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function ze(t,a,i){const{limit:u,infinite:c}=e(t),d=i.isOpen,p=i.offset,v=i.search,f=i.pfo,h=i.eo,g=l(null),m=s(null),b=T((()=>p.value{const{isIntersecting:t,target:a}=e[0];if(t){const e=a.offsetParent,t=e.scrollTop;p.value+=-1==u.value?10:u.value,r((()=>{e.scrollTop=t}))}},w=()=>{d.value&&p.value{c.value&&w()})),n(v,(()=>{c.value&&(p.value=u.value,w())}),{flush:"post"}),n(h,(()=>{c.value&&w()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(g.value=new IntersectionObserver(y))})),{hasMore:b,infiniteLoader:m}}function Ge(t,a,n){const{placeholder:r,id:u,valueProp:s,label:c,mode:d,groupLabel:p,aria:v,searchable:f}=e(t),h=n.pointer,g=n.iv,m=n.hasSelected,b=n.multipleLabelText,y=l(null),w=T((()=>(u.value?u.value+"-":"")+"assist")),O=T((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=T((()=>{if(h.value){let e=u.value?`${u.value}-`:"";return e+=(h.value.group?"multiselect-group":"multiselect-option")+"-",e+=h.value.group?h.value.index:h.value[s.value],e}})),L=T((()=>r.value)),S=T((()=>"single"!==d.value)),k=i((()=>"single"===d.value&&m.value?g.value[c.value]:"multiple"===d.value&&m.value?b.value:"tags"===d.value&&m.value?g.value.map((e=>e[c.value])).join(", "):"")),E=i((()=>{let e={...v.value};return f.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${w.value} ${e["aria-labelledby"]}`:w.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return o((()=>{if(u.value&&document&&document.querySelector){let e=document.querySelector(`[for="${u.value}"]`);y.value=e?e.innerText:null}})),{arias:E,ariaLabel:k,ariaAssist:w,ariaControls:O,ariaPlaceholder:L,ariaMultiselectable:S,ariaActiveDescendant:x,ariaOptionId:e=>`${u.value?u.value+"-":""}multiselect-option-${e[s.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${u.value?u.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Ue(t,a,l){const{locale:i,fallbackLocale:n}=e(t);return{localize:e=>e&&"object"==typeof e?e&&e[i.value]?e[i.value]:e&&i.value&&e[i.value.toUpperCase()]?e[i.value.toUpperCase()]:e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Xe(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}var Ye={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Xe,Ue,E,q,He,_,k,Fe,C,ze,A,Ne,Ke,Ge]),beforeMount(){(this.$root.constructor?.version?.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};const Je=["id","dir"],Qe=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Ze=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],et=["onKeyup","aria-label"],tt=["onClick"],at=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],lt=["innerHTML"],it=["id"],nt=["id"],rt=["id","aria-label","aria-selected"],ot=["data-pointed","onMouseenter","onClick"],ut=["innerHTML"],st=["aria-label"],ct=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],dt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],pt=["innerHTML"],vt=["innerHTML"],ft=["value"],ht=["name","value"],gt=["name","value"],mt=["id"];Ye.render=function(e,t,a,l,i,n){return c(),d("div",{ref:"multiselect",class:p(e.classList.container),id:a.searchable?void 0:a.id,dir:a.rtl?"rtl":void 0,onFocusin:t[12]||(t[12]=(...t)=>e.handleFocusIn&&e.handleFocusIn(...t)),onFocusout:t[13]||(t[13]=(...t)=>e.handleFocusOut&&e.handleFocusOut(...t)),onKeyup:t[14]||(t[14]=(...t)=>e.handleKeyup&&e.handleKeyup(...t)),onKeydown:t[15]||(t[15]=(...t)=>e.handleKeydown&&e.handleKeydown(...t))},[v("div",f({class:e.classList.wrapper,onMousedown:t[9]||(t[9]=(...t)=>e.handleMousedown&&e.handleMousedown(...t)),ref:"wrapper",tabindex:e.tabindex,"aria-controls":a.searchable?void 0:e.ariaControls,"aria-placeholder":a.searchable?void 0:e.ariaPlaceholder,"aria-expanded":a.searchable?void 0:e.isOpen,"aria-activedescendant":a.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":a.searchable?void 0:e.ariaMultiselectable,role:a.searchable?void 0:"combobox"},a.searchable?{}:e.arias),[h(" Search "),"tags"!==a.mode&&a.searchable&&!a.disabled?(c(),d("input",f({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:a.autocomplete,id:a.searchable?a.id:void 0,onInput:t[0]||(t[0]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onKeypress:t[1]||(t[1]=(...t)=>e.handleKeypress&&e.handleKeypress(...t)),onPaste:t[2]||(t[2]=g(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...a.attrs,...e.arias}),null,16,Ze)):h("v-if",!0),h(" Tags (with search) "),"tags"==a.mode?(c(),d("div",{key:1,class:p(e.classList.tags),"data-tags":""},[(c(!0),d(m,null,b(e.iv,((t,l,i)=>y(e.$slots,"tag",{option:t,handleTagRemove:e.handleTagRemove,disabled:a.disabled},(()=>[(c(),d("span",{class:p([e.classList.tag,t.disabled?e.classList.tagDisabled:null]),tabindex:"-1",onKeyup:w((a=>e.handleTagRemove(t,a)),["enter"]),key:i,"aria-label":e.ariaTagLabel(e.localize(t[a.label]))},[v("span",{class:p(e.classList.tagWrapper)},O(e.localize(t[a.label])),3),a.disabled||t.disabled?h("v-if",!0):(c(),d("span",{key:0,class:p(e.classList.tagRemove),onClick:g((a=>e.handleTagRemove(t,a)),["stop"])},[v("span",{class:p(e.classList.tagRemoveIcon)},null,2)],10,tt))],42,et))])))),256)),v("div",{class:p(e.classList.tagsSearchWrapper),ref:"tags"},[h(" Used for measuring search width "),v("span",{class:p(e.classList.tagsSearchCopy)},O(e.search),3),h(" Actual search input "),a.searchable&&!a.disabled?(c(),d("input",f({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,id:a.searchable?a.id:void 0,autocomplete:a.autocomplete,onInput:t[3]||(t[3]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onKeypress:t[4]||(t[4]=(...t)=>e.handleKeypress&&e.handleKeypress(...t)),onPaste:t[5]||(t[5]=g(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...a.attrs,...e.arias}),null,16,at)):h("v-if",!0)],2)],2)):h("v-if",!0),h(" Single label "),"single"==a.mode&&e.hasSelected&&!e.search&&e.iv?y(e.$slots,"singlelabel",{key:2,value:e.iv},(()=>[v("div",{class:p(e.classList.singleLabel)},[v("span",{class:p(e.classList.singleLabelText)},O(e.localize(e.iv[a.label])),3)],2)])):h("v-if",!0),h(" Multiple label "),"multiple"==a.mode&&e.hasSelected&&!e.search?y(e.$slots,"multiplelabel",{key:3,values:e.iv},(()=>[v("div",{class:p(e.classList.multipleLabel),innerHTML:e.multipleLabelText},null,10,lt)])):h("v-if",!0),h(" Placeholder "),!a.placeholder||e.hasSelected||e.search?h("v-if",!0):y(e.$slots,"placeholder",{key:4},(()=>[v("div",{class:p(e.classList.placeholder),"aria-hidden":"true"},O(a.placeholder),3)])),h(" Spinner "),a.loading||e.resolving?y(e.$slots,"spinner",{key:5},(()=>[v("span",{class:p(e.classList.spinner),"aria-hidden":"true"},null,2)])):h("v-if",!0),h(" Clear "),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?y(e.$slots,"clear",{key:6,clear:e.clear},(()=>[v("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:p(e.classList.clear),onClick:t[6]||(t[6]=(...t)=>e.clear&&e.clear(...t)),onKeyup:t[7]||(t[7]=w(((...t)=>e.clear&&e.clear(...t)),["enter"]))},[v("span",{class:p(e.classList.clearIcon)},null,2)],34)])):h("v-if",!0),h(" Caret "),a.caret&&a.showOptions?y(e.$slots,"caret",{key:7,handleCaretClick:e.handleCaretClick,isOpen:e.isOpen},(()=>[v("span",{class:p(e.classList.caret),onClick:t[8]||(t[8]=(...t)=>e.handleCaretClick&&e.handleCaretClick(...t)),"aria-hidden":"true"},null,2)])):h("v-if",!0)],16,Qe),h(" Options "),(c(),x(L,{to:a.appendTo||"body",disabled:!a.appendToBody&&!a.appendTo},[v("div",{id:a.id?`${a.id}-dropdown`:void 0,class:p(e.classList.dropdown),tabindex:"-1",ref:"dropdown",onFocusin:t[10]||(t[10]=(...t)=>e.handleFocusIn&&e.handleFocusIn(...t)),onFocusout:t[11]||(t[11]=(...t)=>e.handleFocusOut&&e.handleFocusOut(...t))},[y(e.$slots,"beforelist",{options:e.fo}),v("ul",{class:p(e.classList.options),id:e.ariaControls,role:"listbox"},[a.groups?(c(!0),d(m,{key:0},b(e.fg,((t,l,i)=>(c(),d("li",{class:p(e.classList.group),key:i,id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[a.groupLabel])),"aria-selected":e.isSelected(t),role:"option"},[t.__CREATE__?h("v-if",!0):(c(),d("div",{key:0,class:p(e.classList.groupLabel(t)),"data-pointed":e.isPointed(t),onMouseenter:a=>e.setPointer(t,l),onClick:a=>e.handleGroupClick(t)},[y(e.$slots,"grouplabel",{group:t,isSelected:e.isSelected,isPointed:e.isPointed},(()=>[v("span",{innerHTML:e.localize(t[a.groupLabel])},null,8,ut)]))],42,ot)),v("ul",{class:p(e.classList.groupOptions),"aria-label":e.ariaGroupLabel(e.localize(t[a.groupLabel])),role:"group"},[(c(!0),d(m,null,b(t.__VISIBLE__,((l,i,n)=>(c(),d("li",{class:p(e.classList.option(l,t)),"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,key:n,onMouseenter:t=>e.setPointer(l),onClick:t=>e.handleOptionClick(l),id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[a.label])),role:"option"},[y(e.$slots,"option",{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},(()=>[v("span",null,O(e.localize(l[a.label])),1)]))],42,ct)))),128))],10,st)],10,rt)))),128)):(c(!0),d(m,{key:1},b(e.fo,((t,l,i)=>(c(),d("li",{class:p(e.classList.option(t)),"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,key:i,onMouseenter:a=>e.setPointer(t),onClick:a=>e.handleOptionClick(t),id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[a.label])),role:"option"},[y(e.$slots,"option",{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},(()=>[v("span",null,O(e.localize(t[a.label])),1)]))],42,dt)))),128))],10,nt),e.noOptions?y(e.$slots,"nooptions",{key:0},(()=>[v("div",{class:p(e.classList.noOptions),innerHTML:e.localize(a.noOptionsText)},null,10,pt)])):h("v-if",!0),e.noResults?y(e.$slots,"noresults",{key:1},(()=>[v("div",{class:p(e.classList.noResults),innerHTML:e.localize(a.noResultsText)},null,10,vt)])):h("v-if",!0),a.infinite&&e.hasMore?(c(),d("div",{key:2,class:p(e.classList.inifinite),ref:"infiniteLoader"},[y(e.$slots,"infinite",{},(()=>[v("span",{class:p(e.classList.inifiniteSpinner)},null,2)]))],2)):h("v-if",!0),y(e.$slots,"afterlist",{options:e.fo})],42,it)],8,["to","disabled"])),h(" Hacky input element to show HTML5 required warning "),a.required?(c(),d("input",{key:0,class:p(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,ft)):h("v-if",!0),h(" Native input support "),a.nativeSupport?(c(),d(m,{key:1},["single"==a.mode?(c(),d("input",{key:0,type:"hidden",name:a.name,value:void 0!==e.plainValue?e.plainValue:""},null,8,ht)):(c(!0),d(m,{key:1},b(e.plainValue,((e,t)=>(c(),d("input",{type:"hidden",name:`${a.name}[]`,value:e,key:t},null,8,gt)))),128))],64)):h("v-if",!0),h(" Screen reader assistive text "),a.searchable&&e.hasSelected?(c(),d("div",{key:2,class:p(e.classList.assist),id:e.ariaAssist,"aria-hidden":"true"},O(e.ariaLabel),11,mt)):h("v-if",!0),h(" Create height for empty input "),v("div",{class:p(e.classList.spacer)},null,2)],42,Je)},Ye.__file="src/Multiselect.vue";export{Ye as default}; +import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as i,watch as n,nextTick as r,onMounted as o,onBeforeUnmount as u,shallowRef as s,openBlock as c,createElementBlock as d,normalizeClass as p,createElementVNode as v,mergeProps as f,createCommentVNode as h,withModifiers as g,Fragment as m,renderList as b,renderSlot as y,withKeys as w,toDisplayString as O,createBlock as x,Teleport as L}from"vue";function S(e){return null==e}function k(a,l,i){const{object:n,valueProp:r,mode:o}=e(a),u=t().proxy,s=i.iv,c=e=>n.value||S(e)?e:Array.isArray(e)?e.map((e=>e[r.value])):e[r.value],d=e=>S(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function T(e){return a((()=>({get:e,set:()=>{}})))}function E(t,a){const{value:n,modelValue:r,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=T((()=>void 0!==r.value?r.value:n.value)),d=i((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),p=T((()=>"single"!==o.value?s.value.map((e=>e[u.value])).join(","):s.value[u.value]));return{iv:s,internalValue:s,ev:c,externalValue:c,textValue:p,plainValue:d}}function _(a,i,r){const{regex:o}=e(a),u=t().proxy,s=r.isOpen,c=r.open,d=l(null);return n(d,(e=>{!s.value&&e&&c(),i.emit("search-change",e,u)})),{search:d,clearSearch:()=>{d.value=""},handleSearchInput:e=>{d.value=e.target.value},handleKeypress:e=>{if(o.value){let t=o.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(o.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=o.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}i.emit("paste",e,u)}}}function q(t,a,i){const{groupSelect:n,mode:r,groups:o,disabledProp:u}=e(t),s=l(null),c=e=>{void 0===e||null!==e&&e[u.value]||o.value&&e&&e.group&&("single"===r.value||!n.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:()=>{c(null)}}}function P(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/æ/g,"ae").replace(/œ/g,"oe").replace(/ø/g,"o").replace(/\p{Diacritic}/gu,"")}function C(a,r,o){const{options:u,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:h,appendNewTag:g,appendNewOption:m,multipleLabel:b,object:y,loading:w,delay:O,resolveOnLoad:x,minChars:L,filterResults:k,clearOnSearch:E,clearOnSelect:_,valueProp:q,allowAbsent:C,groupLabel:A,canDeselect:B,max:D,strict:I,closeOnSelect:j,closeOnDeselect:R,groups:M,reverse:$,infinite:V,groupOptions:W,groupHideEmpty:H,groupSelect:F,onCreate:N,disabledProp:K,searchStart:z,searchFilter:G}=e(a),U=t().proxy,X=o.iv,Y=o.ev,J=o.search,Q=o.clearSearch,Z=o.update,ee=o.pointer,te=o.setPointer,ae=o.clearPointer,le=o.focus,ie=o.deactivate,ne=o.close,re=o.localize,oe=l([]),ue=l([]),se=l(!1),ce=l(null),de=l(V.value&&-1===d.value?10:d.value),pe=i({get:()=>ue.value,set:e=>ue.value=e}),ve=T((()=>v.value||f.value||!1)),fe=T((()=>void 0!==g.value?g.value:void 0===m.value||m.value)),he=i((()=>{if(M.value){let e=be.value||[],t=[];return e.forEach((e=>{ze(e[W.value]).forEach((a=>{t.push(Object.assign({},a,e[K.value]?{[K.value]:!0}:{}))}))})),t}{let e=ze(ue.value||[]);return oe.value.length&&(e=e.concat(oe.value)),e}})),ge=i((()=>{let e=he.value;return $.value&&(e=e.reverse()),ke.value.length&&(e=ke.value.concat(e)),Ke(e)})),me=i((()=>{let e=ge.value;return de.value>0&&(e=e.slice(0,de.value)),e})),be=i((()=>{if(!M.value)return[];let e=[],t=ue.value||[];return oe.value.length&&e.push({[A.value]:" ",[W.value]:[...oe.value],__CREATE__:!0}),e.concat(t)})),ye=i((()=>{let e=[...be.value].map((e=>({...e})));return ke.value.length&&(e[0]&&e[0].__CREATE__?e[0][W.value]=[...ke.value,...e[0][W.value]]:e=[{[A.value]:" ",[W.value]:[...ke.value],__CREATE__:!0}].concat(e)),e})),we=i((()=>{if(!M.value)return[];let e=ye.value;return Ne((e||[]).map(((e,t)=>{const a=ze(e[W.value]);return{...e,index:t,group:!0,[W.value]:Ke(a,!1).map((t=>Object.assign({},t,e[K.value]?{[K.value]:!0}:{}))),__VISIBLE__:Ke(a).map((t=>Object.assign({},t,e[K.value]?{[K.value]:!0}:{})))}})))})),Oe=i((()=>{switch(s.value){case"single":return!S(X.value[q.value]);case"multiple":case"tags":return!S(X.value)&&X.value.length>0}})),xe=i((()=>void 0!==b.value?b.value(X.value,U):X.value&&X.value.length>1?`${X.value.length} options selected`:"1 option selected")),Le=T((()=>!he.value.length&&!se.value&&!ke.value.length)),Se=T((()=>he.value.length>0&&0==me.value.length&&(J.value&&M.value||!M.value))),ke=i((()=>!1!==ve.value&&J.value?-1!==He(J.value)?[]:[{[q.value]:J.value,[Te.value[0]]:J.value,[h.value]:J.value,__CREATE__:!0}]:[])),Te=i((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),Ee=T((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),_e=T((()=>w.value||se.value)),qe=e=>{switch("object"!=typeof e&&(e=We(e)),s.value){case"single":Z(e);break;case"multiple":case"tags":Z(X.value.concat(e))}r.emit("select",Ce(e),e,U)},Pe=e=>{switch("object"!=typeof e&&(e=We(e)),s.value){case"single":Be();break;case"tags":case"multiple":Z(Array.isArray(e)?X.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):X.value.filter((t=>t[q.value]!=e[q.value])))}r.emit("deselect",Ce(e),e,U)},Ce=e=>y.value?e:e[q.value],Ae=e=>{Pe(e)},Be=()=>{Z(Ee.value),r.emit("clear",U)},De=e=>{if(void 0!==e.group)return"single"!==s.value&&(Ve(e[W.value])&&e[W.value].length);switch(s.value){case"single":return!S(X.value)&&X.value[q.value]==e[q.value];case"tags":case"multiple":return!S(X.value)&&-1!==X.value.map((e=>e[q.value])).indexOf(e[q.value])}},Ie=e=>!0===e[K.value],je=()=>!(void 0===D||-1===D.value||!Oe.value&&D.value>0)&&X.value.length>=D.value,Re=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&De(e))return B.value&&Pe(e),void(R.value&&(ae(),ne()));e&&Me(e),_.value&&Q(),j.value&&(ae(),ne()),e&&qe(e);break;case"multiple":if(e&&De(e))return Pe(e),void(R.value&&(ae(),ne()));if(je())return void r.emit("max",U);e&&(Me(e),qe(e)),_.value&&Q(),p.value&&ae(),j.value&&ne();break;case"tags":if(e&&De(e))return Pe(e),void(R.value&&(ae(),ne()));if(je())return void r.emit("max",U);e&&Me(e),_.value&&Q(),e&&qe(e),p.value&&ae(),j.value&&ne()}j.value||le()},Me=e=>{void 0===We(e[q.value])&&ve.value&&(r.emit("tag",e[q.value],U),r.emit("option",e[q.value],U),r.emit("create",e[q.value],U),fe.value&&Fe(e),Q())},$e=e=>void 0===e.find((e=>!De(e)&&!e[K.value])),Ve=e=>void 0===e.find((e=>!De(e))),We=e=>he.value[he.value.map((e=>String(e[q.value]))).indexOf(String(e))],He=e=>he.value.findIndex((t=>Te.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Fe=e=>{oe.value.push(e)},Ne=e=>H.value?e.filter((e=>J.value?e.__VISIBLE__.length:e[W.value].length)):e.filter((e=>!J.value||e.__VISIBLE__.length)),Ke=(e,t=!0)=>{let a=e;if(J.value&&k.value){let e=G.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=P(re(e[a]),I.value);return z.value?l.startsWith(P(t,I.value)):-1!==l.indexOf(P(t,I.value))}))),a=a.filter((t=>e(t,J.value,U)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&De(e))(e)))),a},ze=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[q.value]:e,[Te.value[0]]:a,[h.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[q.value]:e,[Te.value[0]]:e,[h.value]:e})),t},Ge=()=>{S(Y.value)||(X.value=Ye(Y.value))},Ue=e=>(se.value=!0,new Promise(((t,a)=>{u.value(J.value,U).then((t=>{ue.value=t||[],"function"==typeof e&&e(t),se.value=!1})).catch((e=>{console.error(e),ue.value=[],se.value=!1})).finally((()=>{t()}))}))),Xe=()=>{if(Oe.value)if("single"===s.value){let e=We(X.value[q.value]);if(void 0!==e){let t=e[h.value];X.value[h.value]=t,y.value&&(Y.value[h.value]=t)}}else X.value.forEach(((e,t)=>{let a=We(X.value[t][q.value]);if(void 0!==a){let e=a[h.value];X.value[t][h.value]=e,y.value&&(Y.value[t][h.value]=e)}}))},Ye=e=>S(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?We(e)||(C.value?{[h.value]:e,[q.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!We(e)||C.value)).map((e=>We(e)||{[h.value]:e,[q.value]:e,[Te.value[0]]:e})),Je=()=>{ce.value=n(J,(e=>{e.length{e==J.value&&u.value(J.value,U).then((t=>{e!=J.value&&J.value||(ue.value=t,ee.value=me.value.filter((e=>!0!==e[K.value]))[0]||null,se.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!S(Y.value)&&!Array.isArray(Y.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?x.value?Ue(Ge):1==y.value&&Ge():(ue.value=u.value,Ge()),O.value>-1&&Je(),n(O,((e,t)=>{ce.value&&ce.value(),e>=0&&Je()})),n(Y,(e=>{if(S(e))Z(Ye(e),!1);else switch(s.value){case"single":(y.value?e[q.value]!=X.value[q.value]:e!=X.value[q.value])&&Z(Ye(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(y.value?e.map((e=>e[q.value])):e,X.value.map((e=>e[q.value])))||Z(Ye(e),!1)}}),{deep:!0}),n(u,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Ue():(ue.value=a.options,Object.keys(X.value).length||Ge(),Xe())})),n(h,Xe),n(d,((e,t)=>{de.value=V.value&&-1===e?10:e})),{resolvedOptions:pe,pfo:ge,fo:me,filteredOptions:me,hasSelected:Oe,multipleLabelText:xe,eo:he,extendedOptions:he,eg:be,extendedGroups:be,fg:we,filteredGroups:we,noOptions:Le,noResults:Se,resolving:se,busy:_e,offset:de,select:qe,deselect:Pe,remove:Ae,selectAll:()=>{"single"!==s.value&&qe(me.value.filter((e=>!e.disabled&&!De(e))))},clear:Be,isSelected:De,isDisabled:Ie,isMax:je,getOption:We,handleOptionClick:e=>{if(!Ie(e))return N.value&&!De(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=N.value(e,U))instanceof Promise)?(se.value=!0,void e.then((e=>{se.value=!1,Re(e)}))):void Re(e)},handleGroupClick:e=>{if(!Ie(e)&&"single"!==s.value&&F.value){switch(s.value){case"multiple":case"tags":$e(e[W.value])?Pe(e[W.value]):qe(e[W.value].filter((e=>-1===X.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[K.value])).filter(((e,t)=>X.value.length+1+t<=D.value||-1===D.value))),p.value&&ee.value&&te(we.value.filter((e=>!e[K.value]))[ee.value.index])}j.value&&ie()}},handleTagRemove:(e,t)=>{0===t.button?Ae(e):t.preventDefault()},refreshOptions:e=>{Ue(e)},resolveOptions:Ue,refreshLabels:Xe}}function A(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:d,mode:p,groupSelect:v,disabledProp:f,groupOptions:h}=e(t),g=l.fo,m=l.fg,b=l.handleOptionClick,y=l.handleGroupClick,w=l.search,O=l.pointer,x=l.setPointer,L=l.clearPointer,S=l.multiselect,k=l.isOpen,E=i((()=>g.value.filter((e=>!e[f.value])))),_=i((()=>m.value.filter((e=>!e[f.value])))),q=T((()=>"single"!==p.value&&v.value)),P=T((()=>O.value&&O.value.group)),C=i((()=>W(O.value))),A=i((()=>{const e=P.value?O.value:W(O.value),t=_.value.map((e=>e[c.value])).indexOf(e[c.value]);let a=_.value[t-1];return void 0===a&&(a=D.value),a})),B=i((()=>{let e=_.value.map((e=>e.label)).indexOf(P.value?O.value[c.value]:W(O.value)[c.value])+1;return _.value.length<=e&&(e=0),_.value[e]})),D=i((()=>[..._.value].slice(-1)[0])),I=i((()=>O.value.__VISIBLE__.filter((e=>!e[f.value]))[0])),j=i((()=>{const e=C.value.__VISIBLE__.filter((e=>!e[f.value]));return e[e.map((e=>e[o.value])).indexOf(O.value[o.value])-1]})),R=i((()=>{const e=W(O.value).__VISIBLE__.filter((e=>!e[f.value]));return e[e.map((e=>e[o.value])).indexOf(O.value[o.value])+1]})),M=i((()=>[...A.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),$=i((()=>[...D.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),V=()=>{x(E.value[0]||null)},W=e=>_.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[o.value])).indexOf(e[o.value]))),H=()=>{let e=S.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;d.value&&(t=P.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{s.value&&(e.length&&u.value?V():L())})),n(k,(e=>{if(e&&S&&S.value){let e=S.value.querySelectorAll("[data-selected]")[0];if(!e)return;let t=e.parentElement.parentElement;r((()=>{t.scrollTop=e.offsetTop}))}})),{pointer:O,canPointGroups:q,isPointed:e=>!(!O.value||!(!e.group&&O.value[o.value]===e[o.value]||void 0!==e.group&&O.value[c.value]===e[c.value]))||void 0,setPointerFirst:V,selectPointer:()=>{O.value&&!0!==O.value[f.value]&&(P.value?y(O.value):b(O.value))},forwardPointer:()=>{if(null===O.value)x((d.value&&q.value?_.value[0].__CREATE__?E.value[0]:_.value[0]:E.value[0])||null);else if(d.value&&q.value){let e=P.value?I.value:R.value;void 0===e&&(e=B.value,e.__CREATE__&&(e=e[h.value][0])),x(e||null)}else{let e=E.value.map((e=>e[o.value])).indexOf(O.value[o.value])+1;E.value.length<=e&&(e=0),x(E.value[e]||null)}r((()=>{H()}))},backwardPointer:()=>{if(null===O.value){let e=E.value[E.value.length-1];d.value&&q.value&&(e=$.value,void 0===e&&(e=D.value)),x(e||null)}else if(d.value&&q.value){let e=P.value?M.value:j.value;void 0===e&&(e=P.value?A.value:C.value,e.__CREATE__&&(e=M.value,void 0===e&&(e=A.value))),x(e||null)}else{let e=E.value.map((e=>e[o.value])).indexOf(O.value[o.value])-1;e<0&&(e=E.value.length-1),x(E.value[e]||null)}r((()=>{H()}))}}}function B(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function D(e){return e instanceof B(e).Element||e instanceof Element}function I(e){return e instanceof B(e).HTMLElement||e instanceof HTMLElement}function j(e){return"undefined"!=typeof ShadowRoot&&(e instanceof B(e).ShadowRoot||e instanceof ShadowRoot)}var R=Math.max,M=Math.min,$=Math.round;function V(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function W(){return!/^((?!chrome|android).)*safari/i.test(V())}function H(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),i=1,n=1;t&&I(e)&&(i=e.offsetWidth>0&&$(l.width)/e.offsetWidth||1,n=e.offsetHeight>0&&$(l.height)/e.offsetHeight||1);var r=(D(e)?B(e):window).visualViewport,o=!W()&&a,u=(l.left+(o&&r?r.offsetLeft:0))/i,s=(l.top+(o&&r?r.offsetTop:0))/n,c=l.width/i,d=l.height/n;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function F(e){var t=B(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function N(e){return e?(e.nodeName||"").toLowerCase():null}function K(e){return((D(e)?e.ownerDocument:e.document)||window.document).documentElement}function z(e){return H(K(e)).left+F(e).scrollLeft}function G(e){return B(e).getComputedStyle(e)}function U(e){var t=G(e),a=t.overflow,l=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+i+l)}function X(e,t,a){void 0===a&&(a=!1);var l,i,n=I(t),r=I(t)&&function(e){var t=e.getBoundingClientRect(),a=$(t.width)/e.offsetWidth||1,l=$(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=K(t),u=H(e,r,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!a)&&(("body"!==N(t)||U(o))&&(s=(l=t)!==B(l)&&I(l)?{scrollLeft:(i=l).scrollLeft,scrollTop:i.scrollTop}:F(l)),I(t)?((c=H(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=z(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function Y(e){var t=H(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function J(e){return"html"===N(e)?e:e.assignedSlot||e.parentNode||(j(e)?e.host:null)||K(e)}function Q(e){return["html","body","#document"].indexOf(N(e))>=0?e.ownerDocument.body:I(e)&&U(e)?e:Q(J(e))}function Z(e,t){var a;void 0===t&&(t=[]);var l=Q(e),i=l===(null==(a=e.ownerDocument)?void 0:a.body),n=B(l),r=i?[n].concat(n.visualViewport||[],U(l)?l:[]):l,o=t.concat(r);return i?o:o.concat(Z(J(r)))}function ee(e){return["table","td","th"].indexOf(N(e))>=0}function te(e){return I(e)&&"fixed"!==G(e).position?e.offsetParent:null}function ae(e){for(var t=B(e),a=te(e);a&&ee(a)&&"static"===G(a).position;)a=te(a);return a&&("html"===N(a)||"body"===N(a)&&"static"===G(a).position)?t:a||function(e){var t=/firefox/i.test(V());if(/Trident/i.test(V())&&I(e)&&"fixed"===G(e).position)return null;var a=J(e);for(j(a)&&(a=a.host);I(a)&&["html","body"].indexOf(N(a))<0;){var l=G(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var le="top",ie="bottom",ne="right",re="left",oe="auto",ue=[le,ie,ne,re],se="start",ce="end",de="clippingParents",pe="viewport",ve="popper",fe="reference",he=ue.reduce((function(e,t){return e.concat([t+"-"+se,t+"-"+ce])}),[]),ge=[].concat(ue,[oe]).reduce((function(e,t){return e.concat([t,t+"-"+se,t+"-"+ce])}),[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(e){var t=new Map,a=new Set,l=[];function i(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&i(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||i(e)})),l}function ye(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function we(e,t,a){return t===pe?ye(function(e,t){var a=B(e),l=K(e),i=a.visualViewport,n=l.clientWidth,r=l.clientHeight,o=0,u=0;if(i){n=i.width,r=i.height;var s=W();(s||!s&&"fixed"===t)&&(o=i.offsetLeft,u=i.offsetTop)}return{width:n,height:r,x:o+z(e),y:u}}(e,a)):D(t)?function(e,t){var a=H(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):ye(function(e){var t,a=K(e),l=F(e),i=null==(t=e.ownerDocument)?void 0:t.body,n=R(a.scrollWidth,a.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),r=R(a.scrollHeight,a.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-l.scrollLeft+z(e),u=-l.scrollTop;return"rtl"===G(i||a).direction&&(o+=R(a.clientWidth,i?i.clientWidth:0)-n),{width:n,height:r,x:o,y:u}}(K(e)))}function Oe(e){var t=Z(J(e)),a=["absolute","fixed"].indexOf(G(e).position)>=0&&I(e)?ae(e):e;return D(a)?t.filter((function(e){return D(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&j(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==N(e)})):[]}function xe(e){return e.split("-")[0]}function Le(e){return e.split("-")[1]}function Se(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ke(e){var t,a=e.reference,l=e.element,i=e.placement,n=i?xe(i):null,r=i?Le(i):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(n){case le:t={x:o,y:a.y-l.height};break;case ie:t={x:o,y:a.y+a.height};break;case ne:t={x:a.x+a.width,y:u};break;case re:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=n?Se(n):null;if(null!=s){var c="y"===s?"height":"width";switch(r){case se:t[s]=t[s]-(a[c]/2-l[c]/2);break;case ce:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function Te(e,t){void 0===t&&(t={});var a,l=t,i=l.placement,n=void 0===i?e.placement:i,r=l.strategy,o=void 0===r?e.strategy:r,u=l.boundary,s=void 0===u?de:u,c=l.rootBoundary,d=void 0===c?pe:c,p=l.elementContext,v=void 0===p?ve:p,f=l.altBoundary,h=void 0!==f&&f,g=l.padding,m=void 0===g?0:g,b=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof m?m:(a=m,ue.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===ve?fe:ve,w=e.rects.popper,O=e.elements[h?y:v],x=function(e,t,a,l){var i="clippingParents"===t?Oe(e):[].concat(t),n=[].concat(i,[a]),r=n[0],o=n.reduce((function(t,a){var i=we(e,a,l);return t.top=R(i.top,t.top),t.right=M(i.right,t.right),t.bottom=M(i.bottom,t.bottom),t.left=R(i.left,t.left),t}),we(e,r,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(D(O)?O:O.contextElement||K(e.elements.popper),s,d,o),L=H(e.elements.reference),S=ke({reference:L,element:w,strategy:"absolute",placement:n}),k=ye(Object.assign({},w,S)),T=v===ve?k:L,E={top:x.top-T.top+b.top,bottom:T.bottom-x.bottom+b.bottom,left:x.left-T.left+b.left,right:T.right-x.right+b.right},_=e.modifiersData.offset;if(v===ve&&_){var q=_[n];Object.keys(E).forEach((function(e){var t=[ne,ie].indexOf(e)>=0?1:-1,a=[le,ie].indexOf(e)>=0?"y":"x";E[e]+=q[a]*t}))}return E}var Ee={placement:"bottom",modifiers:[],strategy:"absolute"};function _e(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(ge,ce,me):De(v?ge:pe,ce,v?me:ve);x[O]=be,_[O]=be-ce}t.modifiersData[l]=_}},requiresIfExists:["offset"]},je={left:"right",right:"left",bottom:"top",top:"bottom"};function Re(e){return e.replace(/left|right|bottom|top/g,(function(e){return je[e]}))}var Me={start:"end",end:"start"};function $e(e){return e.replace(/start|end/g,(function(e){return Me[e]}))}function Ve(e,t){void 0===t&&(t={});var a=t,l=a.placement,i=a.boundary,n=a.rootBoundary,r=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?ge:u,c=Le(l),d=c?o?he:he.filter((function(e){return Le(e)===c})):ue,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=Te(e,{placement:a,boundary:i,rootBoundary:n,padding:r})[xe(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var We={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var i=a.mainAxis,n=void 0===i||i,r=a.altAxis,o=void 0===r||r,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=xe(g),b=u||(m===g||!f?[Re(g)]:function(e){if(xe(e)===oe)return[];var t=Re(e);return[$e(e),t,$e(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(xe(a)===oe?Ve(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),w=t.rects.reference,O=t.rects.popper,x=new Map,L=!0,S=y[0],k=0;k=0,P=q?"width":"height",C=Te(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),A=q?_?ne:re:_?ie:le;w[P]>O[P]&&(A=Re(A));var B=Re(A),D=[];if(n&&D.push(C[E]<=0),o&&D.push(C[A]<=0,C[B]<=0),D.every((function(e){return e}))){S=T,L=!1;break}x.set(T,D)}if(L)for(var I=function(e){var t=y.find((function(t){var a=x.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},j=f?3:1;j>0;j--){if("break"===I(j))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function He(a,i,n){const{disabled:s,appendTo:c,appendToBody:d,openDirection:p}=e(a),v=t().proxy,f=n.multiselect,h=n.dropdown,g=l(!1),m=l(null),b=l(null),y=T((()=>c.value||d.value)),w=T((()=>"top"===p.value&&"bottom"===b.value||"bottom"===p.value&&"top"!==b.value?"bottom":"top")),O=()=>{if(!m.value)return;let e=parseInt(window.getComputedStyle(h.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(h.value).borderBottomWidth.replace("px",""));m.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===w.value?e:t)]}}]}))),m.value.update()},x=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return o((()=>{y.value&&(m.value=Be(f.value,h.value,{strategy:x(f.value)?"fixed":void 0,placement:p.value,modifiers:[Ie,We,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){b.value=e.placement}}]}))})),u((()=>{y.value&&m.value&&(m.value.destroy(),m.value=null)})),{popper:m,isOpen:g,open:()=>{g.value||s.value||(g.value=!0,i.emit("open",v),y.value&&r((()=>{O()})))},close:()=>{g.value&&(g.value=!1,i.emit("close",v))},placement:w,updatePopper:O}}function Fe(t,a,i){const{searchable:n,disabled:r,clearOnBlur:o}=e(t),u=i.input,s=i.open,c=i.close,d=i.clearSearch,p=i.isOpen,v=i.wrapper,f=i.tags,h=l(!1),g=l(!1),m=T((()=>n.value||r.value?-1:0)),b=()=>{n.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{r.value||(h.value=!0,e&&s())},w=()=>{h.value=!1,setTimeout((()=>{h.value||(c(),o.value&&d())}),1)};return{tabindex:m,isActive:h,mouseClicked:g,blur:b,focus:()=>{n.value&&!r.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(g.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{g.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{g.value=!1}),0)}}}function Ne(a,l,i){const{mode:n,addTagOn:r,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:h}=e(a),g=t().proxy,m=i.iv,b=i.update,y=i.deselect,w=i.search,O=i.setPointer,x=i.selectPointer,L=i.backwardPointer,S=i.forwardPointer,k=i.multiselect,E=i.wrapper,_=i.tags,q=i.isOpen,P=i.open,C=i.blur,A=i.fo,B=T((()=>v.value||f.value||!1)),D=T((()=>void 0!==r.value?r.value:void 0!==p.value?p.value:["enter"])),I=()=>{"tags"===n.value&&!s.value&&B.value&&u.value&&!d.value&&O(A.value[A.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,a;switch(l.emit("keydown",e,g),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===n.value&&(t=[...k.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==_.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===n.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===m.value.length)return;let l=m.value.filter((e=>!e.disabled&&!1!==e.remove));l.length&&y(l[l.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==a&&void 0!==a)return b([...m.value].filter(((e,t)=>t!==a))),void(a===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?_.value.querySelector("input").focus():E.value.focus()));if(-1===D.value.indexOf("enter")&&B.value)return;I(),x();break;case" ":if(!B.value&&!u.value)return e.preventDefault(),I(),void x();if(!B.value)return!1;if(-1===D.value.indexOf("space")&&B.value)return;e.preventDefault(),I(),x();break;case"Tab":case";":case",":if(-1===D.value.indexOf(e.key.toLowerCase())||!B.value)return;I(),x(),e.preventDefault();break;case"Escape":C();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;q.value||P(),L();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;q.value||P(),S();break;case"ArrowLeft":if(u.value&&_.value&&_.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==n.value||!m.value||!m.value.length)return;e.preventDefault(),-1===a?t[t.length-1].focus():a>0&&t[a-1].focus();break;case"ArrowRight":if(-1===a||e.shiftKey||"tags"!==n.value||!m.value||!m.value.length)return;e.preventDefault(),t.length>a+1?t[a+1].focus():u.value?_.value.querySelector("input").focus():u.value||E.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,g)},preparePointer:I}}function Ke(t,a,l){const{classes:n,disabled:r,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,d=l.isSelected,p=l.isDisabled,v=l.isActive,f=l.canPointGroups,h=l.resolving,g=l.fo,m=l.placement,b=T((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...n.value}))),y=T((()=>!!(s.value&&o.value&&(!h.value||h.value&&g.value.length))));return{classList:i((()=>{const e=b.value;return{container:[e.container].concat(r.value?e.containerDisabled:[]).concat(y.value&&"top"===m.value?e.containerOpenTop:[]).concat(y.value&&"top"!==m.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(r.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===m.value?e.dropdownTop:[]).concat(s.value&&o.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===m.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function ze(t,a,i){const{limit:u,infinite:c}=e(t),d=i.isOpen,p=i.offset,v=i.search,f=i.pfo,h=i.eo,g=l(null),m=s(null),b=T((()=>p.value{const{isIntersecting:t,target:a}=e[0];if(t){const e=a.offsetParent,t=e.scrollTop;p.value+=-1==u.value?10:u.value,r((()=>{e.scrollTop=t}))}},w=()=>{d.value&&p.value{c.value&&w()})),n(v,(()=>{c.value&&(p.value=u.value,w())}),{flush:"post"}),n(h,(()=>{c.value&&w()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(g.value=new IntersectionObserver(y))})),{hasMore:b,infiniteLoader:m}}function Ge(t,a,n){const{placeholder:r,id:u,valueProp:s,label:c,mode:d,groupLabel:p,aria:v,searchable:f}=e(t),h=n.pointer,g=n.iv,m=n.hasSelected,b=n.multipleLabelText,y=l(null),w=T((()=>(u.value?u.value+"-":"")+"assist")),O=T((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=T((()=>{if(h.value){let e=u.value?`${u.value}-`:"";return e+=(h.value.group?"multiselect-group":"multiselect-option")+"-",e+=h.value.group?h.value.index:h.value[s.value],e}})),L=T((()=>r.value)),S=T((()=>"single"!==d.value)),k=i((()=>"single"===d.value&&m.value?g.value[c.value]:"multiple"===d.value&&m.value?b.value:"tags"===d.value&&m.value?g.value.map((e=>e[c.value])).join(", "):"")),E=i((()=>{let e={...v.value};return f.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${w.value} ${e["aria-labelledby"]}`:w.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return o((()=>{if(u.value&&document&&document.querySelector){let e=document.querySelector(`[for="${u.value}"]`);y.value=e?e.innerText:null}})),{arias:E,ariaLabel:k,ariaAssist:w,ariaControls:O,ariaPlaceholder:L,ariaMultiselectable:S,ariaActiveDescendant:x,ariaOptionId:e=>`${u.value?u.value+"-":""}multiselect-option-${e[s.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${u.value?u.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Ue(t,a,l){const{locale:i,fallbackLocale:n}=e(t);return{localize:e=>e&&"object"==typeof e?e&&e[i.value]?e[i.value]:e&&i.value&&e[i.value.toUpperCase()]?e[i.value.toUpperCase()]:e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Xe(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}var Ye={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Xe,Ue,E,q,He,_,k,Fe,C,ze,A,Ne,Ke,Ge]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};const Je=["id","dir"],Qe=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Ze=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],et=["onKeyup","aria-label"],tt=["onClick"],at=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],lt=["innerHTML"],it=["id"],nt=["id"],rt=["id","aria-label","aria-selected"],ot=["data-pointed","onMouseenter","onClick"],ut=["innerHTML"],st=["aria-label"],ct=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],dt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],pt=["innerHTML"],vt=["innerHTML"],ft=["value"],ht=["name","value"],gt=["name","value"],mt=["id"];Ye.render=function(e,t,a,l,i,n){return c(),d("div",{ref:"multiselect",class:p(e.classList.container),id:a.searchable?void 0:a.id,dir:a.rtl?"rtl":void 0,onFocusin:t[12]||(t[12]=(...t)=>e.handleFocusIn&&e.handleFocusIn(...t)),onFocusout:t[13]||(t[13]=(...t)=>e.handleFocusOut&&e.handleFocusOut(...t)),onKeyup:t[14]||(t[14]=(...t)=>e.handleKeyup&&e.handleKeyup(...t)),onKeydown:t[15]||(t[15]=(...t)=>e.handleKeydown&&e.handleKeydown(...t))},[v("div",f({class:e.classList.wrapper,onMousedown:t[9]||(t[9]=(...t)=>e.handleMousedown&&e.handleMousedown(...t)),ref:"wrapper",tabindex:e.tabindex,"aria-controls":a.searchable?void 0:e.ariaControls,"aria-placeholder":a.searchable?void 0:e.ariaPlaceholder,"aria-expanded":a.searchable?void 0:e.isOpen,"aria-activedescendant":a.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":a.searchable?void 0:e.ariaMultiselectable,role:a.searchable?void 0:"combobox"},a.searchable?{}:e.arias),[h(" Search "),"tags"!==a.mode&&a.searchable&&!a.disabled?(c(),d("input",f({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:a.autocomplete,id:a.searchable?a.id:void 0,onInput:t[0]||(t[0]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onKeypress:t[1]||(t[1]=(...t)=>e.handleKeypress&&e.handleKeypress(...t)),onPaste:t[2]||(t[2]=g(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...a.attrs,...e.arias}),null,16,Ze)):h("v-if",!0),h(" Tags (with search) "),"tags"==a.mode?(c(),d("div",{key:1,class:p(e.classList.tags),"data-tags":""},[(c(!0),d(m,null,b(e.iv,((t,l,i)=>y(e.$slots,"tag",{option:t,handleTagRemove:e.handleTagRemove,disabled:a.disabled},(()=>[(c(),d("span",{class:p([e.classList.tag,t.disabled?e.classList.tagDisabled:null]),tabindex:"-1",onKeyup:w((a=>e.handleTagRemove(t,a)),["enter"]),key:i,"aria-label":e.ariaTagLabel(e.localize(t[a.label]))},[v("span",{class:p(e.classList.tagWrapper)},O(e.localize(t[a.label])),3),a.disabled||t.disabled?h("v-if",!0):(c(),d("span",{key:0,class:p(e.classList.tagRemove),onClick:g((a=>e.handleTagRemove(t,a)),["stop"])},[v("span",{class:p(e.classList.tagRemoveIcon)},null,2)],10,tt))],42,et))])))),256)),v("div",{class:p(e.classList.tagsSearchWrapper),ref:"tags"},[h(" Used for measuring search width "),v("span",{class:p(e.classList.tagsSearchCopy)},O(e.search),3),h(" Actual search input "),a.searchable&&!a.disabled?(c(),d("input",f({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,id:a.searchable?a.id:void 0,autocomplete:a.autocomplete,onInput:t[3]||(t[3]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onKeypress:t[4]||(t[4]=(...t)=>e.handleKeypress&&e.handleKeypress(...t)),onPaste:t[5]||(t[5]=g(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...a.attrs,...e.arias}),null,16,at)):h("v-if",!0)],2)],2)):h("v-if",!0),h(" Single label "),"single"==a.mode&&e.hasSelected&&!e.search&&e.iv?y(e.$slots,"singlelabel",{key:2,value:e.iv},(()=>[v("div",{class:p(e.classList.singleLabel)},[v("span",{class:p(e.classList.singleLabelText)},O(e.localize(e.iv[a.label])),3)],2)])):h("v-if",!0),h(" Multiple label "),"multiple"==a.mode&&e.hasSelected&&!e.search?y(e.$slots,"multiplelabel",{key:3,values:e.iv},(()=>[v("div",{class:p(e.classList.multipleLabel),innerHTML:e.multipleLabelText},null,10,lt)])):h("v-if",!0),h(" Placeholder "),!a.placeholder||e.hasSelected||e.search?h("v-if",!0):y(e.$slots,"placeholder",{key:4},(()=>[v("div",{class:p(e.classList.placeholder),"aria-hidden":"true"},O(a.placeholder),3)])),h(" Spinner "),a.loading||e.resolving?y(e.$slots,"spinner",{key:5},(()=>[v("span",{class:p(e.classList.spinner),"aria-hidden":"true"},null,2)])):h("v-if",!0),h(" Clear "),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?y(e.$slots,"clear",{key:6,clear:e.clear},(()=>[v("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:p(e.classList.clear),onClick:t[6]||(t[6]=(...t)=>e.clear&&e.clear(...t)),onKeyup:t[7]||(t[7]=w(((...t)=>e.clear&&e.clear(...t)),["enter"]))},[v("span",{class:p(e.classList.clearIcon)},null,2)],34)])):h("v-if",!0),h(" Caret "),a.caret&&a.showOptions?y(e.$slots,"caret",{key:7,handleCaretClick:e.handleCaretClick,isOpen:e.isOpen},(()=>[v("span",{class:p(e.classList.caret),onClick:t[8]||(t[8]=(...t)=>e.handleCaretClick&&e.handleCaretClick(...t)),"aria-hidden":"true"},null,2)])):h("v-if",!0)],16,Qe),h(" Options "),(c(),x(L,{to:a.appendTo||"body",disabled:!a.appendToBody&&!a.appendTo},[v("div",{id:a.id?`${a.id}-dropdown`:void 0,class:p(e.classList.dropdown),tabindex:"-1",ref:"dropdown",onFocusin:t[10]||(t[10]=(...t)=>e.handleFocusIn&&e.handleFocusIn(...t)),onFocusout:t[11]||(t[11]=(...t)=>e.handleFocusOut&&e.handleFocusOut(...t))},[y(e.$slots,"beforelist",{options:e.fo}),v("ul",{class:p(e.classList.options),id:e.ariaControls,role:"listbox"},[a.groups?(c(!0),d(m,{key:0},b(e.fg,((t,l,i)=>(c(),d("li",{class:p(e.classList.group),key:i,id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[a.groupLabel])),"aria-selected":e.isSelected(t),role:"option"},[t.__CREATE__?h("v-if",!0):(c(),d("div",{key:0,class:p(e.classList.groupLabel(t)),"data-pointed":e.isPointed(t),onMouseenter:a=>e.setPointer(t,l),onClick:a=>e.handleGroupClick(t)},[y(e.$slots,"grouplabel",{group:t,isSelected:e.isSelected,isPointed:e.isPointed},(()=>[v("span",{innerHTML:e.localize(t[a.groupLabel])},null,8,ut)]))],42,ot)),v("ul",{class:p(e.classList.groupOptions),"aria-label":e.ariaGroupLabel(e.localize(t[a.groupLabel])),role:"group"},[(c(!0),d(m,null,b(t.__VISIBLE__,((l,i,n)=>(c(),d("li",{class:p(e.classList.option(l,t)),"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,key:n,onMouseenter:t=>e.setPointer(l),onClick:t=>e.handleOptionClick(l),id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[a.label])),role:"option"},[y(e.$slots,"option",{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},(()=>[v("span",null,O(e.localize(l[a.label])),1)]))],42,ct)))),128))],10,st)],10,rt)))),128)):(c(!0),d(m,{key:1},b(e.fo,((t,l,i)=>(c(),d("li",{class:p(e.classList.option(t)),"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,key:i,onMouseenter:a=>e.setPointer(t),onClick:a=>e.handleOptionClick(t),id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[a.label])),role:"option"},[y(e.$slots,"option",{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},(()=>[v("span",null,O(e.localize(t[a.label])),1)]))],42,dt)))),128))],10,nt),e.noOptions?y(e.$slots,"nooptions",{key:0},(()=>[v("div",{class:p(e.classList.noOptions),innerHTML:e.localize(a.noOptionsText)},null,10,pt)])):h("v-if",!0),e.noResults?y(e.$slots,"noresults",{key:1},(()=>[v("div",{class:p(e.classList.noResults),innerHTML:e.localize(a.noResultsText)},null,10,vt)])):h("v-if",!0),a.infinite&&e.hasMore?(c(),d("div",{key:2,class:p(e.classList.inifinite),ref:"infiniteLoader"},[y(e.$slots,"infinite",{},(()=>[v("span",{class:p(e.classList.inifiniteSpinner)},null,2)]))],2)):h("v-if",!0),y(e.$slots,"afterlist",{options:e.fo})],42,it)],8,["to","disabled"])),h(" Hacky input element to show HTML5 required warning "),a.required?(c(),d("input",{key:0,class:p(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,ft)):h("v-if",!0),h(" Native input support "),a.nativeSupport?(c(),d(m,{key:1},["single"==a.mode?(c(),d("input",{key:0,type:"hidden",name:a.name,value:void 0!==e.plainValue?e.plainValue:""},null,8,ht)):(c(!0),d(m,{key:1},b(e.plainValue,((e,t)=>(c(),d("input",{type:"hidden",name:`${a.name}[]`,value:e,key:t},null,8,gt)))),128))],64)):h("v-if",!0),h(" Screen reader assistive text "),a.searchable&&e.hasSelected?(c(),d("div",{key:2,class:p(e.classList.assist),id:e.ariaAssist,"aria-hidden":"true"},O(e.ariaLabel),11,mt)):h("v-if",!0),h(" Create height for empty input "),v("div",{class:p(e.classList.spacer)},null,2)],42,Je)},Ye.__file="src/Multiselect.vue";export{Ye as default}; diff --git a/dist/multiselect.mjs b/dist/multiselect.mjs index 06a961f..9f90005 100644 --- a/dist/multiselect.mjs +++ b/dist/multiselect.mjs @@ -1356,7 +1356,7 @@ function usePointer (props, context, dep) }); watch(isOpen, (val) => { - if (val && multiselect?.value) { + if (val && multiselect && multiselect.value) { let firstSelected = multiselect.value.querySelectorAll(`[data-selected]`)[0]; if (!firstSelected) { @@ -4322,7 +4322,7 @@ var script = { ]) }, beforeMount() { - if (this.$root.constructor?.version?.match(/^2\./) || this.vueVersionMs === 2) { + if ((this.$root.constructor && this.$root.constructor.version && this.$root.constructor.version.match(/^2\./)) || this.vueVersionMs === 2) { if (!this.$options.components.Teleport) { this.$options.components.Teleport = { render() { diff --git a/dist/multiselect.vue2.global.js b/dist/multiselect.vue2.global.js index 4db7259..e45891d 100644 --- a/dist/multiselect.vue2.global.js +++ b/dist/multiselect.vue2.global.js @@ -1 +1 @@ -var VueformMultiselect=function(e){"use strict";function t(e){return null==e}function a(a,l,n){const{object:r,valueProp:i,mode:o}=e.toRefs(a),u=e.getCurrentInstance().proxy,s=n.iv,c=e=>r.value||t(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],d=e=>t(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function l(t){return e.customRef((()=>({get:t,set:()=>{}})))}function n(t,a){const{value:n,modelValue:r,mode:i,valueProp:o}=e.toRefs(t),u=e.ref("single"!==i.value?[]:{}),s=l((()=>void 0!==r.value?r.value:n.value)),c=e.computed((()=>"single"===i.value?u.value[o.value]:u.value.map((e=>e[o.value])))),d=l((()=>"single"!==i.value?u.value.map((e=>e[o.value])).join(","):u.value[o.value]));return{iv:u,internalValue:u,ev:s,externalValue:s,textValue:d,plainValue:c}}function r(t,a,l){const{regex:n}=e.toRefs(t),r=e.getCurrentInstance().proxy,i=l.isOpen,o=l.open,u=e.ref(null);return e.watch(u,(e=>{!i.value&&e&&o(),a.emit("search-change",e,r)})),{search:u,clearSearch:()=>{u.value=""},handleSearchInput:e=>{u.value=e.target.value},handleKeypress:e=>{if(n.value){let t=n.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(n.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=n.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}a.emit("paste",e,r)}}}function i(t,a,l){const{groupSelect:n,mode:r,groups:i,disabledProp:o}=e.toRefs(t),u=e.ref(null),s=e=>{void 0===e||null!==e&&e[o.value]||i.value&&e&&e.group&&("single"===r.value||!n.value)||(u.value=e)};return{pointer:u,setPointer:s,clearPointer:()=>{s(null)}}}function o(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/æ/g,"ae").replace(/œ/g,"oe").replace(/ø/g,"o").replace(/\p{Diacritic}/gu,"")}function u(a,n,r){const{options:i,mode:u,trackBy:s,limit:c,hideSelected:d,createTag:p,createOption:v,label:f,appendNewTag:h,appendNewOption:m,multipleLabel:g,object:b,loading:y,delay:w,resolveOnLoad:_,minChars:O,filterResults:x,clearOnSearch:S,clearOnSelect:L,valueProp:T,allowAbsent:k,groupLabel:E,canDeselect:P,max:q,strict:R,closeOnSelect:C,closeOnDeselect:A,groups:B,reverse:D,infinite:I,groupOptions:j,groupHideEmpty:V,groupSelect:M,onCreate:W,disabledProp:$,searchStart:H,searchFilter:N}=e.toRefs(a),F=e.getCurrentInstance().proxy,z=r.iv,U=r.ev,G=r.search,K=r.clearSearch,X=r.update,Y=r.pointer,J=r.setPointer,Q=r.clearPointer,Z=r.focus,ee=r.deactivate,te=r.close,ae=r.localize,le=e.ref([]),ne=e.ref([]),re=e.ref(!1),ie=e.ref(null),oe=e.ref(I.value&&-1===c.value?10:c.value),ue=e.computed({get:()=>ne.value,set:e=>ne.value=e}),se=l((()=>p.value||v.value||!1)),ce=l((()=>void 0!==h.value?h.value:void 0===m.value||m.value)),de=e.computed((()=>{if(B.value){let e=fe.value||[],t=[];return e.forEach((e=>{He(e[j.value]).forEach((a=>{t.push(Object.assign({},a,e[$.value]?{[$.value]:!0}:{}))}))})),t}{let e=He(ne.value||[]);return le.value.length&&(e=e.concat(le.value)),e}})),pe=e.computed((()=>{let e=de.value;return D.value&&(e=e.reverse()),_e.value.length&&(e=_e.value.concat(e)),$e(e)})),ve=e.computed((()=>{let e=pe.value;return oe.value>0&&(e=e.slice(0,oe.value)),e})),fe=e.computed((()=>{if(!B.value)return[];let e=[],t=ne.value||[];return le.value.length&&e.push({[E.value]:" ",[j.value]:[...le.value],__CREATE__:!0}),e.concat(t)})),he=e.computed((()=>{let e=[...fe.value].map((e=>({...e})));return _e.value.length&&(e[0]&&e[0].__CREATE__?e[0][j.value]=[..._e.value,...e[0][j.value]]:e=[{[E.value]:" ",[j.value]:[..._e.value],__CREATE__:!0}].concat(e)),e})),me=e.computed((()=>{if(!B.value)return[];let e=he.value;return We((e||[]).map(((e,t)=>{const a=He(e[j.value]);return{...e,index:t,group:!0,[j.value]:$e(a,!1).map((t=>Object.assign({},t,e[$.value]?{[$.value]:!0}:{}))),__VISIBLE__:$e(a).map((t=>Object.assign({},t,e[$.value]?{[$.value]:!0}:{})))}})))})),ge=e.computed((()=>{switch(u.value){case"single":return!t(z.value[T.value]);case"multiple":case"tags":return!t(z.value)&&z.value.length>0}})),be=e.computed((()=>void 0!==g.value?g.value(z.value,F):z.value&&z.value.length>1?`${z.value.length} options selected`:"1 option selected")),ye=l((()=>!de.value.length&&!re.value&&!_e.value.length)),we=l((()=>de.value.length>0&&0==ve.value.length&&(G.value&&B.value||!B.value))),_e=e.computed((()=>!1!==se.value&&G.value?-1!==Ve(G.value)?[]:[{[T.value]:G.value,[Oe.value[0]]:G.value,[f.value]:G.value,__CREATE__:!0}]:[])),Oe=e.computed((()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[f.value])),xe=l((()=>{switch(u.value){case"single":return null;case"multiple":case"tags":return[]}})),Se=l((()=>y.value||re.value)),Le=e=>{switch("object"!=typeof e&&(e=je(e)),u.value){case"single":X(e);break;case"multiple":case"tags":X(z.value.concat(e))}n.emit("select",ke(e),e,F)},Te=e=>{switch("object"!=typeof e&&(e=je(e)),u.value){case"single":Pe();break;case"tags":case"multiple":X(Array.isArray(e)?z.value.filter((t=>-1===e.map((e=>e[T.value])).indexOf(t[T.value]))):z.value.filter((t=>t[T.value]!=e[T.value])))}n.emit("deselect",ke(e),e,F)},ke=e=>b.value?e:e[T.value],Ee=e=>{Te(e)},Pe=()=>{X(xe.value),n.emit("clear",F)},qe=e=>{if(void 0!==e.group)return"single"!==u.value&&(Ie(e[j.value])&&e[j.value].length);switch(u.value){case"single":return!t(z.value)&&z.value[T.value]==e[T.value];case"tags":case"multiple":return!t(z.value)&&-1!==z.value.map((e=>e[T.value])).indexOf(e[T.value])}},Re=e=>!0===e[$.value],Ce=()=>!(void 0===q||-1===q.value||!ge.value&&q.value>0)&&z.value.length>=q.value,Ae=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,u.value){case"single":if(e&&qe(e))return P.value&&Te(e),void(A.value&&(Q(),te()));e&&Be(e),L.value&&K(),C.value&&(Q(),te()),e&&Le(e);break;case"multiple":if(e&&qe(e))return Te(e),void(A.value&&(Q(),te()));if(Ce())return void n.emit("max",F);e&&(Be(e),Le(e)),L.value&&K(),d.value&&Q(),C.value&&te();break;case"tags":if(e&&qe(e))return Te(e),void(A.value&&(Q(),te()));if(Ce())return void n.emit("max",F);e&&Be(e),L.value&&K(),e&&Le(e),d.value&&Q(),C.value&&te()}C.value||Z()},Be=e=>{void 0===je(e[T.value])&&se.value&&(n.emit("tag",e[T.value],F),n.emit("option",e[T.value],F),n.emit("create",e[T.value],F),ce.value&&Me(e),K())},De=e=>void 0===e.find((e=>!qe(e)&&!e[$.value])),Ie=e=>void 0===e.find((e=>!qe(e))),je=e=>de.value[de.value.map((e=>String(e[T.value]))).indexOf(String(e))],Ve=e=>de.value.findIndex((t=>Oe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Me=e=>{le.value.push(e)},We=e=>V.value?e.filter((e=>G.value?e.__VISIBLE__.length:e[j.value].length)):e.filter((e=>!G.value||e.__VISIBLE__.length)),$e=(e,t=!0)=>{let a=e;if(G.value&&x.value){let e=N.value;e||(e=(e,t,a)=>Oe.value.some((a=>{let l=o(ae(e[a]),R.value);return H.value?l.startsWith(o(t,R.value)):-1!==l.indexOf(o(t,R.value))}))),a=a.filter((t=>e(t,G.value,F)))}return d.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(u.value)&&d.value&&qe(e))(e)))),a},He=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[T.value]:e,[Oe.value[0]]:a,[f.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[T.value]:e,[Oe.value[0]]:e,[f.value]:e})),t},Ne=()=>{t(U.value)||(z.value=Ue(U.value))},Fe=e=>(re.value=!0,new Promise(((t,a)=>{i.value(G.value,F).then((t=>{ne.value=t||[],"function"==typeof e&&e(t),re.value=!1})).catch((e=>{console.error(e),ne.value=[],re.value=!1})).finally((()=>{t()}))}))),ze=()=>{if(ge.value)if("single"===u.value){let e=je(z.value[T.value]);if(void 0!==e){let t=e[f.value];z.value[f.value]=t,b.value&&(U.value[f.value]=t)}}else z.value.forEach(((e,t)=>{let a=je(z.value[t][T.value]);if(void 0!==a){let e=a[f.value];z.value[t][f.value]=e,b.value&&(U.value[t][f.value]=e)}}))},Ue=e=>t(e)?"single"===u.value?{}:[]:b.value?e:"single"===u.value?je(e)||(k.value?{[f.value]:e,[T.value]:e,[Oe.value[0]]:e}:{}):e.filter((e=>!!je(e)||k.value)).map((e=>je(e)||{[f.value]:e,[T.value]:e,[Oe.value[0]]:e})),Ge=()=>{ie.value=e.watch(G,(e=>{e.length{e==G.value&&i.value(G.value,F).then((t=>{e!=G.value&&G.value||(ne.value=t,Y.value=ve.value.filter((e=>!0!==e[$.value]))[0]||null,re.value=!1)})).catch((e=>{console.error(e)}))}),w.value))}),{flush:"sync"})};if("single"!==u.value&&!t(U.value)&&!Array.isArray(U.value))throw new Error(`v-model must be an array when using "${u.value}" mode`);return i&&"function"==typeof i.value?_.value?Fe(Ne):1==b.value&&Ne():(ne.value=i.value,Ne()),w.value>-1&&Ge(),e.watch(w,((e,t)=>{ie.value&&ie.value(),e>=0&&Ge()})),e.watch(U,(e=>{if(t(e))X(Ue(e),!1);else switch(u.value){case"single":(b.value?e[T.value]!=z.value[T.value]:e!=z.value[T.value])&&X(Ue(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(b.value?e.map((e=>e[T.value])):e,z.value.map((e=>e[T.value])))||X(Ue(e),!1)}}),{deep:!0}),e.watch(i,((e,t)=>{"function"==typeof a.options?_.value&&(!t||e&&e.toString()!==t.toString())&&Fe():(ne.value=a.options,Object.keys(z.value).length||Ne(),ze())})),e.watch(f,ze),e.watch(c,((e,t)=>{oe.value=I.value&&-1===e?10:e})),{resolvedOptions:ue,pfo:pe,fo:ve,filteredOptions:ve,hasSelected:ge,multipleLabelText:be,eo:de,extendedOptions:de,eg:fe,extendedGroups:fe,fg:me,filteredGroups:me,noOptions:ye,noResults:we,resolving:re,busy:Se,offset:oe,select:Le,deselect:Te,remove:Ee,selectAll:()=>{"single"!==u.value&&Le(ve.value.filter((e=>!e.disabled&&!qe(e))))},clear:Pe,isSelected:qe,isDisabled:Re,isMax:Ce,getOption:je,handleOptionClick:e=>{if(!Re(e))return W.value&&!qe(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=W.value(e,F))instanceof Promise)?(re.value=!0,void e.then((e=>{re.value=!1,Ae(e)}))):void Ae(e)},handleGroupClick:e=>{if(!Re(e)&&"single"!==u.value&&M.value){switch(u.value){case"multiple":case"tags":De(e[j.value])?Te(e[j.value]):Le(e[j.value].filter((e=>-1===z.value.map((e=>e[T.value])).indexOf(e[T.value]))).filter((e=>!e[$.value])).filter(((e,t)=>z.value.length+1+t<=q.value||-1===q.value))),d.value&&Y.value&&J(me.value.filter((e=>!e[$.value]))[Y.value.index])}C.value&&ee()}},handleTagRemove:(e,t)=>{0===t.button?Ee(e):t.preventDefault()},refreshOptions:e=>{Fe(e)},resolveOptions:Fe,refreshLabels:ze}}function s(t,a,n){const{valueProp:r,showOptions:i,searchable:o,groupLabel:u,groups:s,mode:c,groupSelect:d,disabledProp:p,groupOptions:v}=e.toRefs(t),f=n.fo,h=n.fg,m=n.handleOptionClick,g=n.handleGroupClick,b=n.search,y=n.pointer,w=n.setPointer,_=n.clearPointer,O=n.multiselect,x=n.isOpen,S=e.computed((()=>f.value.filter((e=>!e[p.value])))),L=e.computed((()=>h.value.filter((e=>!e[p.value])))),T=l((()=>"single"!==c.value&&d.value)),k=l((()=>y.value&&y.value.group)),E=e.computed((()=>V(y.value))),P=e.computed((()=>{const e=k.value?y.value:V(y.value),t=L.value.map((e=>e[u.value])).indexOf(e[u.value]);let a=L.value[t-1];return void 0===a&&(a=R.value),a})),q=e.computed((()=>{let e=L.value.map((e=>e.label)).indexOf(k.value?y.value[u.value]:V(y.value)[u.value])+1;return L.value.length<=e&&(e=0),L.value[e]})),R=e.computed((()=>[...L.value].slice(-1)[0])),C=e.computed((()=>y.value.__VISIBLE__.filter((e=>!e[p.value]))[0])),A=e.computed((()=>{const e=E.value.__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])-1]})),B=e.computed((()=>{const e=V(y.value).__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])+1]})),D=e.computed((()=>[...P.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),I=e.computed((()=>[...R.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),j=()=>{w(S.value[0]||null)},V=e=>L.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[r.value])).indexOf(e[r.value]))),M=()=>{let e=O.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;s.value&&(t=k.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{o.value&&(e.length&&i.value?j():_())})),e.watch(x,(t=>{if(t&&O?.value){let t=O.value.querySelectorAll("[data-selected]")[0];if(!t)return;let a=t.parentElement.parentElement;e.nextTick((()=>{a.scrollTop=t.offsetTop}))}})),{pointer:y,canPointGroups:T,isPointed:e=>!(!y.value||!(!e.group&&y.value[r.value]===e[r.value]||void 0!==e.group&&y.value[u.value]===e[u.value]))||void 0,setPointerFirst:j,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(k.value?g(y.value):m(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&T.value?L.value[0].__CREATE__?S.value[0]:L.value[0]:S.value[0])||null);else if(s.value&&T.value){let e=k.value?C.value:B.value;void 0===e&&(e=q.value,e.__CREATE__&&(e=e[v.value][0])),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])+1;S.value.length<=e&&(e=0),w(S.value[e]||null)}e.nextTick((()=>{M()}))},backwardPointer:()=>{if(null===y.value){let e=S.value[S.value.length-1];s.value&&T.value&&(e=I.value,void 0===e&&(e=R.value)),w(e||null)}else if(s.value&&T.value){let e=k.value?D.value:A.value;void 0===e&&(e=k.value?P.value:E.value,e.__CREATE__&&(e=D.value,void 0===e&&(e=P.value))),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])-1;e<0&&(e=S.value.length-1),w(S.value[e]||null)}e.nextTick((()=>{M()}))}}}function c(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function d(e){return e instanceof c(e).Element||e instanceof Element}function p(e){return e instanceof c(e).HTMLElement||e instanceof HTMLElement}function v(e){return"undefined"!=typeof ShadowRoot&&(e instanceof c(e).ShadowRoot||e instanceof ShadowRoot)}var f=Math.max,h=Math.min,m=Math.round;function g(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function b(){return!/^((?!chrome|android).)*safari/i.test(g())}function y(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&p(e)&&(n=e.offsetWidth>0&&m(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&m(l.height)/e.offsetHeight||1);var i=(d(e)?c(e):window).visualViewport,o=!b()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,v=l.width/n,f=l.height/r;return{width:v,height:f,top:s,right:u+v,bottom:s+f,left:u,x:u,y:s}}function w(e){var t=c(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _(e){return e?(e.nodeName||"").toLowerCase():null}function O(e){return((d(e)?e.ownerDocument:e.document)||window.document).documentElement}function x(e){return y(O(e)).left+w(e).scrollLeft}function S(e){return c(e).getComputedStyle(e)}function L(e){var t=S(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function T(e,t,a){void 0===a&&(a=!1);var l,n,r=p(t),i=p(t)&&function(e){var t=e.getBoundingClientRect(),a=m(t.width)/e.offsetWidth||1,l=m(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=O(t),u=y(e,i,a),s={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!a)&&(("body"!==_(t)||L(o))&&(s=(l=t)!==c(l)&&p(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:w(l)),p(t)?((d=y(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):o&&(d.x=x(o))),{x:u.left+s.scrollLeft-d.x,y:u.top+s.scrollTop-d.y,width:u.width,height:u.height}}function k(e){var t=y(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function E(e){return"html"===_(e)?e:e.assignedSlot||e.parentNode||(v(e)?e.host:null)||O(e)}function P(e){return["html","body","#document"].indexOf(_(e))>=0?e.ownerDocument.body:p(e)&&L(e)?e:P(E(e))}function q(e,t){var a;void 0===t&&(t=[]);var l=P(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=c(l),i=n?[r].concat(r.visualViewport||[],L(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(q(E(i)))}function R(e){return["table","td","th"].indexOf(_(e))>=0}function C(e){return p(e)&&"fixed"!==S(e).position?e.offsetParent:null}function A(e){for(var t=c(e),a=C(e);a&&R(a)&&"static"===S(a).position;)a=C(a);return a&&("html"===_(a)||"body"===_(a)&&"static"===S(a).position)?t:a||function(e){var t=/firefox/i.test(g());if(/Trident/i.test(g())&&p(e)&&"fixed"===S(e).position)return null;var a=E(e);for(v(a)&&(a=a.host);p(a)&&["html","body"].indexOf(_(a))<0;){var l=S(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var B="top",D="bottom",I="right",j="left",V="auto",M=[B,D,I,j],W="start",$="end",H="clippingParents",N="viewport",F="popper",z="reference",U=M.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+$])}),[]),G=[].concat(M,[V]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+$])}),[]),K=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function X(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function Y(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function J(e,t,a){return t===N?Y(function(e,t){var a=c(e),l=O(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=b();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+x(e),y:u}}(e,a)):d(t)?function(e,t){var a=y(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):Y(function(e){var t,a=O(e),l=w(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=f(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=f(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+x(e),u=-l.scrollTop;return"rtl"===S(n||a).direction&&(o+=f(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(O(e)))}function Q(e){var t=q(E(e)),a=["absolute","fixed"].indexOf(S(e).position)>=0&&p(e)?A(e):e;return d(a)?t.filter((function(e){return d(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&v(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==_(e)})):[]}function Z(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ae(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?Z(n):null,i=n?ee(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case B:t={x:o,y:a.y-l.height};break;case D:t={x:o,y:a.y+a.height};break;case I:t={x:a.x+a.width,y:u};break;case j:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?te(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case W:t[s]=t[s]-(a[c]/2-l[c]/2);break;case $:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function le(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,i=l.strategy,o=void 0===i?e.strategy:i,u=l.boundary,s=void 0===u?H:u,c=l.rootBoundary,p=void 0===c?N:c,v=l.elementContext,m=void 0===v?F:v,g=l.altBoundary,b=void 0!==g&&g,w=l.padding,_=void 0===w?0:w,x=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof _?_:(a=_,M.reduce((function(e,t){return e[t]=a,e}),{}))),S=m===F?z:F,L=e.rects.popper,T=e.elements[b?S:m],k=function(e,t,a,l){var n="clippingParents"===t?Q(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=J(e,a,l);return t.top=f(n.top,t.top),t.right=h(n.right,t.right),t.bottom=h(n.bottom,t.bottom),t.left=f(n.left,t.left),t}),J(e,i,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(d(T)?T:T.contextElement||O(e.elements.popper),s,p,o),E=y(e.elements.reference),P=ae({reference:E,element:L,strategy:"absolute",placement:r}),q=Y(Object.assign({},L,P)),R=m===F?q:E,C={top:k.top-R.top+x.top,bottom:R.bottom-k.bottom+x.bottom,left:k.left-R.left+x.left,right:R.right-k.right+x.right},A=e.modifiersData.offset;if(m===F&&A){var j=A[r];Object.keys(C).forEach((function(e){var t=[I,D].indexOf(e)>=0?1:-1,a=[B,D].indexOf(e)>=0?"y":"x";C[e]+=j[a]*t}))}return C}var ne={placement:"bottom",modifiers:[],strategy:"absolute"};function re(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,he,Oe):de(v?_e:ge,he,v?Oe:be);S[x]=xe,R[x]=xe-he}t.modifiersData[l]=R}},requiresIfExists:["offset"]},ve={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ve[e]}))}var he={start:"end",end:"start"};function me(e){return e.replace(/start|end/g,(function(e){return he[e]}))}function ge(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,i=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?G:u,c=ee(l),d=c?o?U:U.filter((function(e){return ee(e)===c})):M,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=le(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[Z(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,i=a.altAxis,o=void 0===i||i,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,m=t.options.placement,g=Z(m),b=u||(g===m||!f?[fe(m)]:function(e){if(Z(e)===V)return[];var t=fe(e);return[me(e),t,me(t)]}(m)),y=[m].concat(b).reduce((function(e,a){return e.concat(Z(a)===V?ge(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),w=t.rects.reference,_=t.rects.popper,O=new Map,x=!0,S=y[0],L=0;L=0,q=P?"width":"height",R=le(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?I:j:E?D:B;w[q]>_[q]&&(C=fe(C));var A=fe(C),M=[];if(r&&M.push(R[k]<=0),o&&M.push(R[C]<=0,R[A]<=0),M.every((function(e){return e}))){S=T,x=!1;break}O.set(T,M)}if(x)for(var $=function(e){var t=y.find((function(t){var a=O.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},H=f?3:1;H>0;H--){if("break"===$(H))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(t,a,n){const{disabled:r,appendTo:i,appendToBody:o,openDirection:u}=e.toRefs(t),s=e.getCurrentInstance().proxy,c=n.multiselect,d=n.dropdown,p=e.ref(!1),v=e.ref(null),f=e.ref(null),h=l((()=>i.value||o.value)),m=l((()=>"top"===u.value&&"bottom"===f.value||"bottom"===u.value&&"top"!==f.value?"bottom":"top")),g=()=>{if(!v.value)return;let e=parseInt(window.getComputedStyle(d.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(d.value).borderBottomWidth.replace("px",""));v.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===m.value?e:t)]}}]}))),v.value.update()},b=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return e.onMounted((()=>{h.value&&(v.value=ce(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[pe,be,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){f.value=e.placement}}]}))})),e.onBeforeUnmount((()=>{h.value&&v.value&&(v.value.destroy(),v.value=null)})),{popper:v,isOpen:p,open:()=>{p.value||r.value||(p.value=!0,a.emit("open",s),h.value&&e.nextTick((()=>{g()})))},close:()=>{p.value&&(p.value=!1,a.emit("close",s))},placement:m,updatePopper:g}}function we(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e.toRefs(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,h=e.ref(!1),m=e.ref(!1),g=l((()=>r.value||i.value?-1:0)),b=()=>{r.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{i.value||(h.value=!0,e&&s())},w=()=>{h.value=!1,setTimeout((()=>{h.value||(c(),o.value&&d())}),1)};return{tabindex:g,isActive:h,mouseClicked:m,blur:b,focus:()=>{r.value&&!i.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(m.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{m.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{m.value=!1}),0)}}}function _e(t,a,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:h}=e.toRefs(t),m=e.getCurrentInstance().proxy,g=n.iv,b=n.update,y=n.deselect,w=n.search,_=n.setPointer,O=n.selectPointer,x=n.backwardPointer,S=n.forwardPointer,L=n.multiselect,T=n.wrapper,k=n.tags,E=n.isOpen,P=n.open,q=n.blur,R=n.fo,C=l((()=>v.value||f.value||!1)),A=l((()=>void 0!==i.value?i.value:void 0!==p.value?p.value:["enter"])),B=()=>{"tags"===r.value&&!s.value&&C.value&&u.value&&!d.value&&_(R.value[R.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,l;switch(a.emit("keydown",e,m),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...L.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==k.value)),l=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===g.value.length)return;let a=g.value.filter((e=>!e.disabled&&!1!==e.remove));a.length&&y(a[a.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==l&&void 0!==l)return b([...g.value].filter(((e,t)=>t!==l))),void(l===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?k.value.querySelector("input").focus():T.value.focus()));if(-1===A.value.indexOf("enter")&&C.value)return;B(),O();break;case" ":if(!C.value&&!u.value)return e.preventDefault(),B(),void O();if(!C.value)return!1;if(-1===A.value.indexOf("space")&&C.value)return;e.preventDefault(),B(),O();break;case"Tab":case";":case",":if(-1===A.value.indexOf(e.key.toLowerCase())||!C.value)return;B(),O(),e.preventDefault();break;case"Escape":q();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;E.value||P(),x();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;E.value||P(),S();break;case"ArrowLeft":if(u.value&&k.value&&k.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),-1===l?t[t.length-1].focus():l>0&&t[l-1].focus();break;case"ArrowRight":if(-1===l||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),t.length>l+1?t[l+1].focus():u.value?k.value.querySelector("input").focus():u.value||T.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,m)},preparePointer:B}}function Oe(t,a,n){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e.toRefs(t),s=n.isOpen,c=n.isPointed,d=n.isSelected,p=n.isDisabled,v=n.isActive,f=n.canPointGroups,h=n.resolving,m=n.fo,g=n.placement,b=l((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),y=l((()=>!!(s.value&&o.value&&(!h.value||h.value&&m.value.length))));return{classList:e.computed((()=>{const e=b.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(y.value&&"top"===g.value?e.containerOpenTop:[]).concat(y.value&&"top"!==g.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===g.value?e.dropdownTop:[]).concat(s.value&&o.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===g.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function xe(t,a,n){const{limit:r,infinite:i}=e.toRefs(t),o=n.isOpen,u=n.offset,s=n.search,c=n.pfo,d=n.eo,p=e.ref(null),v=e.shallowRef(null),f=l((()=>u.value{const{isIntersecting:a,target:l}=t[0];if(a){const t=l.offsetParent,a=t.scrollTop;u.value+=-1==r.value?10:r.value,e.nextTick((()=>{t.scrollTop=a}))}},m=()=>{o.value&&u.value{i.value&&m()})),e.watch(s,(()=>{i.value&&(u.value=r.value,m())}),{flush:"post"}),e.watch(d,(()=>{i.value&&m()}),{immediate:!1,flush:"post"}),e.onMounted((()=>{window&&window.IntersectionObserver&&(p.value=new IntersectionObserver(h))})),{hasMore:f,infiniteLoader:v}}function Se(t,a,n){const{placeholder:r,id:i,valueProp:o,label:u,mode:s,groupLabel:c,aria:d,searchable:p}=e.toRefs(t),v=n.pointer,f=n.iv,h=n.hasSelected,m=n.multipleLabelText,g=e.ref(null),b=l((()=>(i.value?i.value+"-":"")+"assist")),y=l((()=>(i.value?i.value+"-":"")+"multiselect-options")),w=l((()=>{if(v.value){let e=i.value?`${i.value}-`:"";return e+=(v.value.group?"multiselect-group":"multiselect-option")+"-",e+=v.value.group?v.value.index:v.value[o.value],e}})),_=l((()=>r.value)),O=l((()=>"single"!==s.value)),x=e.computed((()=>"single"===s.value&&h.value?f.value[u.value]:"multiple"===s.value&&h.value?m.value:"tags"===s.value&&h.value?f.value.map((e=>e[u.value])).join(", "):"")),S=e.computed((()=>{let e={...d.value};return p.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${b.value} ${e["aria-labelledby"]}`:b.value,x.value&&e["aria-label"]&&(e["aria-label"]=`${x.value}, ${e["aria-label"]}`)),e}));return e.onMounted((()=>{if(i.value&&document&&document.querySelector){let e=document.querySelector(`[for="${i.value}"]`);g.value=e?e.innerText:null}})),{arias:S,ariaLabel:x,ariaAssist:b,ariaControls:y,ariaPlaceholder:_,ariaMultiselectable:O,ariaActiveDescendant:w,ariaOptionId:e=>`${i.value?i.value+"-":""}multiselect-option-${e[o.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${i.value?i.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Le(t,a,l){const{locale:n,fallbackLocale:r}=e.toRefs(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Te(t,a,l){return{multiselect:e.shallowRef(null),wrapper:e.shallowRef(null),tags:e.shallowRef(null),input:e.shallowRef(null),dropdown:e.shallowRef(null)}}function ke(e,t,a,l,n,r,i,o,u,s){"boolean"!=typeof i&&(u=o,o=i,i=!1);const c="function"==typeof a?a.options:a;let d;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=d):t&&(d=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),d)if(c.functional){const e=c.render;c.render=function(t,a){return d.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,d):[d]}return a}const Ee={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Te,Le,n,i,ye,r,a,we,u,xe,s,_e,Oe,Se]),beforeMount(){(this.$root.constructor?.version?.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};var Pe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"multiselect",class:e.classList.container,attrs:{id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut,keyup:e.handleKeyup,keydown:e.handleKeydown}},[a("div",e._b({ref:"wrapper",class:e.classList.wrapper,attrs:{tabindex:e.tabindex,"aria-controls":e.searchable?void 0:e.ariaControls,"aria-placeholder":e.searchable?void 0:e.ariaPlaceholder,"aria-expanded":e.searchable?void 0:e.isOpen,"aria-activedescendant":e.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:e.ariaMultiselectable,role:e.searchable?void 0:"combobox"},on:{mousedown:e.handleMousedown}},"div",e.searchable?{}:e.arias,!1),["tags"!==e.mode&&e.searchable&&!e.disabled?[a("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1))]:e._e(),e._v(" "),"tags"==e.mode?[a("div",{class:e.classList.tags,attrs:{"data-tags":""}},[e._l(e.iv,(function(t,l,n){return e._t("tag",(function(){return[a("span",{key:n,class:[e.classList.tag,t.disabled?e.classList.tagDisabled:null],attrs:{tabindex:"-1","aria-label":e.ariaTagLabel(e.localize(t[e.label]))},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagWrapper},[e._v(e._s(e.localize(t[e.label])))]),e._v(" "),e.disabled||t.disabled?e._e():a("span",{class:e.classList.tagRemove,on:{click:function(a){return a.stopPropagation(),e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagRemoveIcon})])])]}),{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),a("div",{ref:"tags",class:e.classList.tagsSearchWrapper},[a("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?a("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",(function(){return[a("div",{class:e.classList.singleLabel},[a("span",{class:e.classList.singleLabelText},[e._v(e._s(e.localize(e.iv[e.label])))])])]}),{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",(function(){return[a("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})]}),{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",(function(){return[a("div",{class:e.classList.placeholder,attrs:{"aria-hidden":"true"}},[e._v("\n "+e._s(e.placeholder)+"\n ")])]}))],e._v(" "),e.loading||e.resolving?e._t("spinner",(function(){return[a("span",{class:e.classList.spinner,attrs:{"aria-hidden":"true"}})]})):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",(function(){return[a("span",{class:e.classList.clear,attrs:{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎"},on:{click:e.clear,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clear.apply(null,arguments)}}},[a("span",{class:e.classList.clearIcon})])]}),{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",(function(){return[a("span",{class:e.classList.caret,attrs:{"aria-hidden":"true"},on:{click:e.handleCaretClick}})]}),{handleCaretClick:e.handleCaretClick,isOpen:e.isOpen}):e._e()],2),e._v(" "),a("Teleport",{attrs:{to:e.appendTo||"body",disabled:!e.appendToBody&&!e.appendTo}},[a("div",{ref:"dropdown",class:e.classList.dropdown,attrs:{id:e.id?e.id+"-dropdown":void 0,tabindex:"-1"},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),a("ul",{class:e.classList.options,attrs:{id:e.ariaControls,role:"listbox"}},[e.groups?e._l(e.fg,(function(t,l,n){return a("li",{key:n,class:e.classList.group,attrs:{id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),"aria-selected":e.isSelected(t),role:"option"}},[t.__CREATE__?e._e():a("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(a){return e.setPointer(t,l)},click:function(a){return e.handleGroupClick(t)}}},[e._t("grouplabel",(function(){return[a("span",{domProps:{innerHTML:e._s(e.localize(t[e.groupLabel]))}})]}),{group:t,isSelected:e.isSelected,isPointed:e.isPointed})],2),e._v(" "),a("ul",{class:e.classList.groupOptions,attrs:{"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),role:"group"}},e._l(t.__VISIBLE__,(function(l,n,r){return a("li",{key:r,class:e.classList.option(l,t),attrs:{"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[e.label])),role:"option"},on:{mouseenter:function(t){return e.setPointer(l)},click:function(t){return e.handleOptionClick(l)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(l[e.label])))])]}),{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,l,n){return a("li",{key:n,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[e.label])),role:"option"},on:{mouseenter:function(a){return e.setPointer(t)},click:function(a){return e.handleOptionClick(t)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(t[e.label])))])]}),{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",(function(){return[a("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.localize(e.noOptionsText))}})]})):e._e(),e._v(" "),e.noResults?e._t("noresults",(function(){return[a("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.localize(e.noResultsText))}})]})):e._e(),e._v(" "),e.infinite&&e.hasMore?a("div",{ref:"infiniteLoader",class:e.classList.inifinite},[e._t("infinite",(function(){return[a("span",{class:e.classList.inifiniteSpinner})]}))],2):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2)]),e._v(" "),e.required?a("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?a("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,l){return a("input",{key:l,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),e.searchable&&e.hasSelected?a("div",{class:e.classList.assist,attrs:{id:e.ariaAssist,"aria-hidden":"true"}},[e._v("\n "+e._s(e.ariaLabel)+"\n ")]):e._e(),e._v(" "),a("div",{class:e.classList.spacer})],2)};Pe._withStripped=!0;return ke({render:Pe,staticRenderFns:[]},undefined,Ee,undefined,false,undefined,!1,void 0,void 0,void 0)}(Vue); +var VueformMultiselect=function(e){"use strict";function t(e){return null==e}function a(a,l,n){const{object:r,valueProp:i,mode:o}=e.toRefs(a),u=e.getCurrentInstance().proxy,s=n.iv,c=e=>r.value||t(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],d=e=>t(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function l(t){return e.customRef((()=>({get:t,set:()=>{}})))}function n(t,a){const{value:n,modelValue:r,mode:i,valueProp:o}=e.toRefs(t),u=e.ref("single"!==i.value?[]:{}),s=l((()=>void 0!==r.value?r.value:n.value)),c=e.computed((()=>"single"===i.value?u.value[o.value]:u.value.map((e=>e[o.value])))),d=l((()=>"single"!==i.value?u.value.map((e=>e[o.value])).join(","):u.value[o.value]));return{iv:u,internalValue:u,ev:s,externalValue:s,textValue:d,plainValue:c}}function r(t,a,l){const{regex:n}=e.toRefs(t),r=e.getCurrentInstance().proxy,i=l.isOpen,o=l.open,u=e.ref(null);return e.watch(u,(e=>{!i.value&&e&&o(),a.emit("search-change",e,r)})),{search:u,clearSearch:()=>{u.value=""},handleSearchInput:e=>{u.value=e.target.value},handleKeypress:e=>{if(n.value){let t=n.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(n.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=n.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}a.emit("paste",e,r)}}}function i(t,a,l){const{groupSelect:n,mode:r,groups:i,disabledProp:o}=e.toRefs(t),u=e.ref(null),s=e=>{void 0===e||null!==e&&e[o.value]||i.value&&e&&e.group&&("single"===r.value||!n.value)||(u.value=e)};return{pointer:u,setPointer:s,clearPointer:()=>{s(null)}}}function o(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/æ/g,"ae").replace(/œ/g,"oe").replace(/ø/g,"o").replace(/\p{Diacritic}/gu,"")}function u(a,n,r){const{options:i,mode:u,trackBy:s,limit:c,hideSelected:d,createTag:p,createOption:v,label:f,appendNewTag:h,appendNewOption:m,multipleLabel:g,object:b,loading:y,delay:w,resolveOnLoad:_,minChars:O,filterResults:x,clearOnSearch:S,clearOnSelect:L,valueProp:T,allowAbsent:k,groupLabel:E,canDeselect:P,max:q,strict:R,closeOnSelect:C,closeOnDeselect:A,groups:B,reverse:D,infinite:I,groupOptions:j,groupHideEmpty:V,groupSelect:M,onCreate:W,disabledProp:$,searchStart:H,searchFilter:N}=e.toRefs(a),F=e.getCurrentInstance().proxy,z=r.iv,U=r.ev,G=r.search,K=r.clearSearch,X=r.update,Y=r.pointer,J=r.setPointer,Q=r.clearPointer,Z=r.focus,ee=r.deactivate,te=r.close,ae=r.localize,le=e.ref([]),ne=e.ref([]),re=e.ref(!1),ie=e.ref(null),oe=e.ref(I.value&&-1===c.value?10:c.value),ue=e.computed({get:()=>ne.value,set:e=>ne.value=e}),se=l((()=>p.value||v.value||!1)),ce=l((()=>void 0!==h.value?h.value:void 0===m.value||m.value)),de=e.computed((()=>{if(B.value){let e=fe.value||[],t=[];return e.forEach((e=>{He(e[j.value]).forEach((a=>{t.push(Object.assign({},a,e[$.value]?{[$.value]:!0}:{}))}))})),t}{let e=He(ne.value||[]);return le.value.length&&(e=e.concat(le.value)),e}})),pe=e.computed((()=>{let e=de.value;return D.value&&(e=e.reverse()),_e.value.length&&(e=_e.value.concat(e)),$e(e)})),ve=e.computed((()=>{let e=pe.value;return oe.value>0&&(e=e.slice(0,oe.value)),e})),fe=e.computed((()=>{if(!B.value)return[];let e=[],t=ne.value||[];return le.value.length&&e.push({[E.value]:" ",[j.value]:[...le.value],__CREATE__:!0}),e.concat(t)})),he=e.computed((()=>{let e=[...fe.value].map((e=>({...e})));return _e.value.length&&(e[0]&&e[0].__CREATE__?e[0][j.value]=[..._e.value,...e[0][j.value]]:e=[{[E.value]:" ",[j.value]:[..._e.value],__CREATE__:!0}].concat(e)),e})),me=e.computed((()=>{if(!B.value)return[];let e=he.value;return We((e||[]).map(((e,t)=>{const a=He(e[j.value]);return{...e,index:t,group:!0,[j.value]:$e(a,!1).map((t=>Object.assign({},t,e[$.value]?{[$.value]:!0}:{}))),__VISIBLE__:$e(a).map((t=>Object.assign({},t,e[$.value]?{[$.value]:!0}:{})))}})))})),ge=e.computed((()=>{switch(u.value){case"single":return!t(z.value[T.value]);case"multiple":case"tags":return!t(z.value)&&z.value.length>0}})),be=e.computed((()=>void 0!==g.value?g.value(z.value,F):z.value&&z.value.length>1?`${z.value.length} options selected`:"1 option selected")),ye=l((()=>!de.value.length&&!re.value&&!_e.value.length)),we=l((()=>de.value.length>0&&0==ve.value.length&&(G.value&&B.value||!B.value))),_e=e.computed((()=>!1!==se.value&&G.value?-1!==Ve(G.value)?[]:[{[T.value]:G.value,[Oe.value[0]]:G.value,[f.value]:G.value,__CREATE__:!0}]:[])),Oe=e.computed((()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[f.value])),xe=l((()=>{switch(u.value){case"single":return null;case"multiple":case"tags":return[]}})),Se=l((()=>y.value||re.value)),Le=e=>{switch("object"!=typeof e&&(e=je(e)),u.value){case"single":X(e);break;case"multiple":case"tags":X(z.value.concat(e))}n.emit("select",ke(e),e,F)},Te=e=>{switch("object"!=typeof e&&(e=je(e)),u.value){case"single":Pe();break;case"tags":case"multiple":X(Array.isArray(e)?z.value.filter((t=>-1===e.map((e=>e[T.value])).indexOf(t[T.value]))):z.value.filter((t=>t[T.value]!=e[T.value])))}n.emit("deselect",ke(e),e,F)},ke=e=>b.value?e:e[T.value],Ee=e=>{Te(e)},Pe=()=>{X(xe.value),n.emit("clear",F)},qe=e=>{if(void 0!==e.group)return"single"!==u.value&&(Ie(e[j.value])&&e[j.value].length);switch(u.value){case"single":return!t(z.value)&&z.value[T.value]==e[T.value];case"tags":case"multiple":return!t(z.value)&&-1!==z.value.map((e=>e[T.value])).indexOf(e[T.value])}},Re=e=>!0===e[$.value],Ce=()=>!(void 0===q||-1===q.value||!ge.value&&q.value>0)&&z.value.length>=q.value,Ae=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,u.value){case"single":if(e&&qe(e))return P.value&&Te(e),void(A.value&&(Q(),te()));e&&Be(e),L.value&&K(),C.value&&(Q(),te()),e&&Le(e);break;case"multiple":if(e&&qe(e))return Te(e),void(A.value&&(Q(),te()));if(Ce())return void n.emit("max",F);e&&(Be(e),Le(e)),L.value&&K(),d.value&&Q(),C.value&&te();break;case"tags":if(e&&qe(e))return Te(e),void(A.value&&(Q(),te()));if(Ce())return void n.emit("max",F);e&&Be(e),L.value&&K(),e&&Le(e),d.value&&Q(),C.value&&te()}C.value||Z()},Be=e=>{void 0===je(e[T.value])&&se.value&&(n.emit("tag",e[T.value],F),n.emit("option",e[T.value],F),n.emit("create",e[T.value],F),ce.value&&Me(e),K())},De=e=>void 0===e.find((e=>!qe(e)&&!e[$.value])),Ie=e=>void 0===e.find((e=>!qe(e))),je=e=>de.value[de.value.map((e=>String(e[T.value]))).indexOf(String(e))],Ve=e=>de.value.findIndex((t=>Oe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Me=e=>{le.value.push(e)},We=e=>V.value?e.filter((e=>G.value?e.__VISIBLE__.length:e[j.value].length)):e.filter((e=>!G.value||e.__VISIBLE__.length)),$e=(e,t=!0)=>{let a=e;if(G.value&&x.value){let e=N.value;e||(e=(e,t,a)=>Oe.value.some((a=>{let l=o(ae(e[a]),R.value);return H.value?l.startsWith(o(t,R.value)):-1!==l.indexOf(o(t,R.value))}))),a=a.filter((t=>e(t,G.value,F)))}return d.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(u.value)&&d.value&&qe(e))(e)))),a},He=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[T.value]:e,[Oe.value[0]]:a,[f.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[T.value]:e,[Oe.value[0]]:e,[f.value]:e})),t},Ne=()=>{t(U.value)||(z.value=Ue(U.value))},Fe=e=>(re.value=!0,new Promise(((t,a)=>{i.value(G.value,F).then((t=>{ne.value=t||[],"function"==typeof e&&e(t),re.value=!1})).catch((e=>{console.error(e),ne.value=[],re.value=!1})).finally((()=>{t()}))}))),ze=()=>{if(ge.value)if("single"===u.value){let e=je(z.value[T.value]);if(void 0!==e){let t=e[f.value];z.value[f.value]=t,b.value&&(U.value[f.value]=t)}}else z.value.forEach(((e,t)=>{let a=je(z.value[t][T.value]);if(void 0!==a){let e=a[f.value];z.value[t][f.value]=e,b.value&&(U.value[t][f.value]=e)}}))},Ue=e=>t(e)?"single"===u.value?{}:[]:b.value?e:"single"===u.value?je(e)||(k.value?{[f.value]:e,[T.value]:e,[Oe.value[0]]:e}:{}):e.filter((e=>!!je(e)||k.value)).map((e=>je(e)||{[f.value]:e,[T.value]:e,[Oe.value[0]]:e})),Ge=()=>{ie.value=e.watch(G,(e=>{e.length{e==G.value&&i.value(G.value,F).then((t=>{e!=G.value&&G.value||(ne.value=t,Y.value=ve.value.filter((e=>!0!==e[$.value]))[0]||null,re.value=!1)})).catch((e=>{console.error(e)}))}),w.value))}),{flush:"sync"})};if("single"!==u.value&&!t(U.value)&&!Array.isArray(U.value))throw new Error(`v-model must be an array when using "${u.value}" mode`);return i&&"function"==typeof i.value?_.value?Fe(Ne):1==b.value&&Ne():(ne.value=i.value,Ne()),w.value>-1&&Ge(),e.watch(w,((e,t)=>{ie.value&&ie.value(),e>=0&&Ge()})),e.watch(U,(e=>{if(t(e))X(Ue(e),!1);else switch(u.value){case"single":(b.value?e[T.value]!=z.value[T.value]:e!=z.value[T.value])&&X(Ue(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(b.value?e.map((e=>e[T.value])):e,z.value.map((e=>e[T.value])))||X(Ue(e),!1)}}),{deep:!0}),e.watch(i,((e,t)=>{"function"==typeof a.options?_.value&&(!t||e&&e.toString()!==t.toString())&&Fe():(ne.value=a.options,Object.keys(z.value).length||Ne(),ze())})),e.watch(f,ze),e.watch(c,((e,t)=>{oe.value=I.value&&-1===e?10:e})),{resolvedOptions:ue,pfo:pe,fo:ve,filteredOptions:ve,hasSelected:ge,multipleLabelText:be,eo:de,extendedOptions:de,eg:fe,extendedGroups:fe,fg:me,filteredGroups:me,noOptions:ye,noResults:we,resolving:re,busy:Se,offset:oe,select:Le,deselect:Te,remove:Ee,selectAll:()=>{"single"!==u.value&&Le(ve.value.filter((e=>!e.disabled&&!qe(e))))},clear:Pe,isSelected:qe,isDisabled:Re,isMax:Ce,getOption:je,handleOptionClick:e=>{if(!Re(e))return W.value&&!qe(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=W.value(e,F))instanceof Promise)?(re.value=!0,void e.then((e=>{re.value=!1,Ae(e)}))):void Ae(e)},handleGroupClick:e=>{if(!Re(e)&&"single"!==u.value&&M.value){switch(u.value){case"multiple":case"tags":De(e[j.value])?Te(e[j.value]):Le(e[j.value].filter((e=>-1===z.value.map((e=>e[T.value])).indexOf(e[T.value]))).filter((e=>!e[$.value])).filter(((e,t)=>z.value.length+1+t<=q.value||-1===q.value))),d.value&&Y.value&&J(me.value.filter((e=>!e[$.value]))[Y.value.index])}C.value&&ee()}},handleTagRemove:(e,t)=>{0===t.button?Ee(e):t.preventDefault()},refreshOptions:e=>{Fe(e)},resolveOptions:Fe,refreshLabels:ze}}function s(t,a,n){const{valueProp:r,showOptions:i,searchable:o,groupLabel:u,groups:s,mode:c,groupSelect:d,disabledProp:p,groupOptions:v}=e.toRefs(t),f=n.fo,h=n.fg,m=n.handleOptionClick,g=n.handleGroupClick,b=n.search,y=n.pointer,w=n.setPointer,_=n.clearPointer,O=n.multiselect,x=n.isOpen,S=e.computed((()=>f.value.filter((e=>!e[p.value])))),L=e.computed((()=>h.value.filter((e=>!e[p.value])))),T=l((()=>"single"!==c.value&&d.value)),k=l((()=>y.value&&y.value.group)),E=e.computed((()=>V(y.value))),P=e.computed((()=>{const e=k.value?y.value:V(y.value),t=L.value.map((e=>e[u.value])).indexOf(e[u.value]);let a=L.value[t-1];return void 0===a&&(a=R.value),a})),q=e.computed((()=>{let e=L.value.map((e=>e.label)).indexOf(k.value?y.value[u.value]:V(y.value)[u.value])+1;return L.value.length<=e&&(e=0),L.value[e]})),R=e.computed((()=>[...L.value].slice(-1)[0])),C=e.computed((()=>y.value.__VISIBLE__.filter((e=>!e[p.value]))[0])),A=e.computed((()=>{const e=E.value.__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])-1]})),B=e.computed((()=>{const e=V(y.value).__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])+1]})),D=e.computed((()=>[...P.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),I=e.computed((()=>[...R.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),j=()=>{w(S.value[0]||null)},V=e=>L.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[r.value])).indexOf(e[r.value]))),M=()=>{let e=O.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;s.value&&(t=k.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{o.value&&(e.length&&i.value?j():_())})),e.watch(x,(t=>{if(t&&O&&O.value){let t=O.value.querySelectorAll("[data-selected]")[0];if(!t)return;let a=t.parentElement.parentElement;e.nextTick((()=>{a.scrollTop=t.offsetTop}))}})),{pointer:y,canPointGroups:T,isPointed:e=>!(!y.value||!(!e.group&&y.value[r.value]===e[r.value]||void 0!==e.group&&y.value[u.value]===e[u.value]))||void 0,setPointerFirst:j,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(k.value?g(y.value):m(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&T.value?L.value[0].__CREATE__?S.value[0]:L.value[0]:S.value[0])||null);else if(s.value&&T.value){let e=k.value?C.value:B.value;void 0===e&&(e=q.value,e.__CREATE__&&(e=e[v.value][0])),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])+1;S.value.length<=e&&(e=0),w(S.value[e]||null)}e.nextTick((()=>{M()}))},backwardPointer:()=>{if(null===y.value){let e=S.value[S.value.length-1];s.value&&T.value&&(e=I.value,void 0===e&&(e=R.value)),w(e||null)}else if(s.value&&T.value){let e=k.value?D.value:A.value;void 0===e&&(e=k.value?P.value:E.value,e.__CREATE__&&(e=D.value,void 0===e&&(e=P.value))),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])-1;e<0&&(e=S.value.length-1),w(S.value[e]||null)}e.nextTick((()=>{M()}))}}}function c(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function d(e){return e instanceof c(e).Element||e instanceof Element}function p(e){return e instanceof c(e).HTMLElement||e instanceof HTMLElement}function v(e){return"undefined"!=typeof ShadowRoot&&(e instanceof c(e).ShadowRoot||e instanceof ShadowRoot)}var f=Math.max,h=Math.min,m=Math.round;function g(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function b(){return!/^((?!chrome|android).)*safari/i.test(g())}function y(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&p(e)&&(n=e.offsetWidth>0&&m(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&m(l.height)/e.offsetHeight||1);var i=(d(e)?c(e):window).visualViewport,o=!b()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,v=l.width/n,f=l.height/r;return{width:v,height:f,top:s,right:u+v,bottom:s+f,left:u,x:u,y:s}}function w(e){var t=c(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _(e){return e?(e.nodeName||"").toLowerCase():null}function O(e){return((d(e)?e.ownerDocument:e.document)||window.document).documentElement}function x(e){return y(O(e)).left+w(e).scrollLeft}function S(e){return c(e).getComputedStyle(e)}function L(e){var t=S(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function T(e,t,a){void 0===a&&(a=!1);var l,n,r=p(t),i=p(t)&&function(e){var t=e.getBoundingClientRect(),a=m(t.width)/e.offsetWidth||1,l=m(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=O(t),u=y(e,i,a),s={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!a)&&(("body"!==_(t)||L(o))&&(s=(l=t)!==c(l)&&p(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:w(l)),p(t)?((d=y(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):o&&(d.x=x(o))),{x:u.left+s.scrollLeft-d.x,y:u.top+s.scrollTop-d.y,width:u.width,height:u.height}}function k(e){var t=y(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function E(e){return"html"===_(e)?e:e.assignedSlot||e.parentNode||(v(e)?e.host:null)||O(e)}function P(e){return["html","body","#document"].indexOf(_(e))>=0?e.ownerDocument.body:p(e)&&L(e)?e:P(E(e))}function q(e,t){var a;void 0===t&&(t=[]);var l=P(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=c(l),i=n?[r].concat(r.visualViewport||[],L(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(q(E(i)))}function R(e){return["table","td","th"].indexOf(_(e))>=0}function C(e){return p(e)&&"fixed"!==S(e).position?e.offsetParent:null}function A(e){for(var t=c(e),a=C(e);a&&R(a)&&"static"===S(a).position;)a=C(a);return a&&("html"===_(a)||"body"===_(a)&&"static"===S(a).position)?t:a||function(e){var t=/firefox/i.test(g());if(/Trident/i.test(g())&&p(e)&&"fixed"===S(e).position)return null;var a=E(e);for(v(a)&&(a=a.host);p(a)&&["html","body"].indexOf(_(a))<0;){var l=S(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var B="top",D="bottom",I="right",j="left",V="auto",M=[B,D,I,j],W="start",$="end",H="clippingParents",N="viewport",F="popper",z="reference",U=M.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+$])}),[]),G=[].concat(M,[V]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+$])}),[]),K=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function X(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function Y(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function J(e,t,a){return t===N?Y(function(e,t){var a=c(e),l=O(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=b();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+x(e),y:u}}(e,a)):d(t)?function(e,t){var a=y(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):Y(function(e){var t,a=O(e),l=w(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=f(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=f(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+x(e),u=-l.scrollTop;return"rtl"===S(n||a).direction&&(o+=f(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(O(e)))}function Q(e){var t=q(E(e)),a=["absolute","fixed"].indexOf(S(e).position)>=0&&p(e)?A(e):e;return d(a)?t.filter((function(e){return d(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&v(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==_(e)})):[]}function Z(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ae(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?Z(n):null,i=n?ee(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case B:t={x:o,y:a.y-l.height};break;case D:t={x:o,y:a.y+a.height};break;case I:t={x:a.x+a.width,y:u};break;case j:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?te(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case W:t[s]=t[s]-(a[c]/2-l[c]/2);break;case $:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function le(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,i=l.strategy,o=void 0===i?e.strategy:i,u=l.boundary,s=void 0===u?H:u,c=l.rootBoundary,p=void 0===c?N:c,v=l.elementContext,m=void 0===v?F:v,g=l.altBoundary,b=void 0!==g&&g,w=l.padding,_=void 0===w?0:w,x=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof _?_:(a=_,M.reduce((function(e,t){return e[t]=a,e}),{}))),S=m===F?z:F,L=e.rects.popper,T=e.elements[b?S:m],k=function(e,t,a,l){var n="clippingParents"===t?Q(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=J(e,a,l);return t.top=f(n.top,t.top),t.right=h(n.right,t.right),t.bottom=h(n.bottom,t.bottom),t.left=f(n.left,t.left),t}),J(e,i,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(d(T)?T:T.contextElement||O(e.elements.popper),s,p,o),E=y(e.elements.reference),P=ae({reference:E,element:L,strategy:"absolute",placement:r}),q=Y(Object.assign({},L,P)),R=m===F?q:E,C={top:k.top-R.top+x.top,bottom:R.bottom-k.bottom+x.bottom,left:k.left-R.left+x.left,right:R.right-k.right+x.right},A=e.modifiersData.offset;if(m===F&&A){var j=A[r];Object.keys(C).forEach((function(e){var t=[I,D].indexOf(e)>=0?1:-1,a=[B,D].indexOf(e)>=0?"y":"x";C[e]+=j[a]*t}))}return C}var ne={placement:"bottom",modifiers:[],strategy:"absolute"};function re(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,he,Oe):de(v?_e:ge,he,v?Oe:be);S[x]=xe,R[x]=xe-he}t.modifiersData[l]=R}},requiresIfExists:["offset"]},ve={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ve[e]}))}var he={start:"end",end:"start"};function me(e){return e.replace(/start|end/g,(function(e){return he[e]}))}function ge(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,i=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?G:u,c=ee(l),d=c?o?U:U.filter((function(e){return ee(e)===c})):M,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=le(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[Z(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,i=a.altAxis,o=void 0===i||i,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,m=t.options.placement,g=Z(m),b=u||(g===m||!f?[fe(m)]:function(e){if(Z(e)===V)return[];var t=fe(e);return[me(e),t,me(t)]}(m)),y=[m].concat(b).reduce((function(e,a){return e.concat(Z(a)===V?ge(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),w=t.rects.reference,_=t.rects.popper,O=new Map,x=!0,S=y[0],L=0;L=0,q=P?"width":"height",R=le(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?I:j:E?D:B;w[q]>_[q]&&(C=fe(C));var A=fe(C),M=[];if(r&&M.push(R[k]<=0),o&&M.push(R[C]<=0,R[A]<=0),M.every((function(e){return e}))){S=T,x=!1;break}O.set(T,M)}if(x)for(var $=function(e){var t=y.find((function(t){var a=O.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},H=f?3:1;H>0;H--){if("break"===$(H))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(t,a,n){const{disabled:r,appendTo:i,appendToBody:o,openDirection:u}=e.toRefs(t),s=e.getCurrentInstance().proxy,c=n.multiselect,d=n.dropdown,p=e.ref(!1),v=e.ref(null),f=e.ref(null),h=l((()=>i.value||o.value)),m=l((()=>"top"===u.value&&"bottom"===f.value||"bottom"===u.value&&"top"!==f.value?"bottom":"top")),g=()=>{if(!v.value)return;let e=parseInt(window.getComputedStyle(d.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(d.value).borderBottomWidth.replace("px",""));v.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===m.value?e:t)]}}]}))),v.value.update()},b=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return e.onMounted((()=>{h.value&&(v.value=ce(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[pe,be,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){f.value=e.placement}}]}))})),e.onBeforeUnmount((()=>{h.value&&v.value&&(v.value.destroy(),v.value=null)})),{popper:v,isOpen:p,open:()=>{p.value||r.value||(p.value=!0,a.emit("open",s),h.value&&e.nextTick((()=>{g()})))},close:()=>{p.value&&(p.value=!1,a.emit("close",s))},placement:m,updatePopper:g}}function we(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e.toRefs(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,h=e.ref(!1),m=e.ref(!1),g=l((()=>r.value||i.value?-1:0)),b=()=>{r.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{i.value||(h.value=!0,e&&s())},w=()=>{h.value=!1,setTimeout((()=>{h.value||(c(),o.value&&d())}),1)};return{tabindex:g,isActive:h,mouseClicked:m,blur:b,focus:()=>{r.value&&!i.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(m.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{m.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{m.value=!1}),0)}}}function _e(t,a,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:h}=e.toRefs(t),m=e.getCurrentInstance().proxy,g=n.iv,b=n.update,y=n.deselect,w=n.search,_=n.setPointer,O=n.selectPointer,x=n.backwardPointer,S=n.forwardPointer,L=n.multiselect,T=n.wrapper,k=n.tags,E=n.isOpen,P=n.open,q=n.blur,R=n.fo,C=l((()=>v.value||f.value||!1)),A=l((()=>void 0!==i.value?i.value:void 0!==p.value?p.value:["enter"])),B=()=>{"tags"===r.value&&!s.value&&C.value&&u.value&&!d.value&&_(R.value[R.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,l;switch(a.emit("keydown",e,m),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...L.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==k.value)),l=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===g.value.length)return;let a=g.value.filter((e=>!e.disabled&&!1!==e.remove));a.length&&y(a[a.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==l&&void 0!==l)return b([...g.value].filter(((e,t)=>t!==l))),void(l===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?k.value.querySelector("input").focus():T.value.focus()));if(-1===A.value.indexOf("enter")&&C.value)return;B(),O();break;case" ":if(!C.value&&!u.value)return e.preventDefault(),B(),void O();if(!C.value)return!1;if(-1===A.value.indexOf("space")&&C.value)return;e.preventDefault(),B(),O();break;case"Tab":case";":case",":if(-1===A.value.indexOf(e.key.toLowerCase())||!C.value)return;B(),O(),e.preventDefault();break;case"Escape":q();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;E.value||P(),x();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;E.value||P(),S();break;case"ArrowLeft":if(u.value&&k.value&&k.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),-1===l?t[t.length-1].focus():l>0&&t[l-1].focus();break;case"ArrowRight":if(-1===l||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),t.length>l+1?t[l+1].focus():u.value?k.value.querySelector("input").focus():u.value||T.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,m)},preparePointer:B}}function Oe(t,a,n){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e.toRefs(t),s=n.isOpen,c=n.isPointed,d=n.isSelected,p=n.isDisabled,v=n.isActive,f=n.canPointGroups,h=n.resolving,m=n.fo,g=n.placement,b=l((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),y=l((()=>!!(s.value&&o.value&&(!h.value||h.value&&m.value.length))));return{classList:e.computed((()=>{const e=b.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(y.value&&"top"===g.value?e.containerOpenTop:[]).concat(y.value&&"top"!==g.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===g.value?e.dropdownTop:[]).concat(s.value&&o.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===g.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function xe(t,a,n){const{limit:r,infinite:i}=e.toRefs(t),o=n.isOpen,u=n.offset,s=n.search,c=n.pfo,d=n.eo,p=e.ref(null),v=e.shallowRef(null),f=l((()=>u.value{const{isIntersecting:a,target:l}=t[0];if(a){const t=l.offsetParent,a=t.scrollTop;u.value+=-1==r.value?10:r.value,e.nextTick((()=>{t.scrollTop=a}))}},m=()=>{o.value&&u.value{i.value&&m()})),e.watch(s,(()=>{i.value&&(u.value=r.value,m())}),{flush:"post"}),e.watch(d,(()=>{i.value&&m()}),{immediate:!1,flush:"post"}),e.onMounted((()=>{window&&window.IntersectionObserver&&(p.value=new IntersectionObserver(h))})),{hasMore:f,infiniteLoader:v}}function Se(t,a,n){const{placeholder:r,id:i,valueProp:o,label:u,mode:s,groupLabel:c,aria:d,searchable:p}=e.toRefs(t),v=n.pointer,f=n.iv,h=n.hasSelected,m=n.multipleLabelText,g=e.ref(null),b=l((()=>(i.value?i.value+"-":"")+"assist")),y=l((()=>(i.value?i.value+"-":"")+"multiselect-options")),w=l((()=>{if(v.value){let e=i.value?`${i.value}-`:"";return e+=(v.value.group?"multiselect-group":"multiselect-option")+"-",e+=v.value.group?v.value.index:v.value[o.value],e}})),_=l((()=>r.value)),O=l((()=>"single"!==s.value)),x=e.computed((()=>"single"===s.value&&h.value?f.value[u.value]:"multiple"===s.value&&h.value?m.value:"tags"===s.value&&h.value?f.value.map((e=>e[u.value])).join(", "):"")),S=e.computed((()=>{let e={...d.value};return p.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${b.value} ${e["aria-labelledby"]}`:b.value,x.value&&e["aria-label"]&&(e["aria-label"]=`${x.value}, ${e["aria-label"]}`)),e}));return e.onMounted((()=>{if(i.value&&document&&document.querySelector){let e=document.querySelector(`[for="${i.value}"]`);g.value=e?e.innerText:null}})),{arias:S,ariaLabel:x,ariaAssist:b,ariaControls:y,ariaPlaceholder:_,ariaMultiselectable:O,ariaActiveDescendant:w,ariaOptionId:e=>`${i.value?i.value+"-":""}multiselect-option-${e[o.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${i.value?i.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Le(t,a,l){const{locale:n,fallbackLocale:r}=e.toRefs(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Te(t,a,l){return{multiselect:e.shallowRef(null),wrapper:e.shallowRef(null),tags:e.shallowRef(null),input:e.shallowRef(null),dropdown:e.shallowRef(null)}}function ke(e,t,a,l,n,r,i,o,u,s){"boolean"!=typeof i&&(u=o,o=i,i=!1);const c="function"==typeof a?a.options:a;let d;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=d):t&&(d=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),d)if(c.functional){const e=c.render;c.render=function(t,a){return d.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,d):[d]}return a}const Ee={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Te,Le,n,i,ye,r,a,we,u,xe,s,_e,Oe,Se]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};var Pe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"multiselect",class:e.classList.container,attrs:{id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut,keyup:e.handleKeyup,keydown:e.handleKeydown}},[a("div",e._b({ref:"wrapper",class:e.classList.wrapper,attrs:{tabindex:e.tabindex,"aria-controls":e.searchable?void 0:e.ariaControls,"aria-placeholder":e.searchable?void 0:e.ariaPlaceholder,"aria-expanded":e.searchable?void 0:e.isOpen,"aria-activedescendant":e.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:e.ariaMultiselectable,role:e.searchable?void 0:"combobox"},on:{mousedown:e.handleMousedown}},"div",e.searchable?{}:e.arias,!1),["tags"!==e.mode&&e.searchable&&!e.disabled?[a("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1))]:e._e(),e._v(" "),"tags"==e.mode?[a("div",{class:e.classList.tags,attrs:{"data-tags":""}},[e._l(e.iv,(function(t,l,n){return e._t("tag",(function(){return[a("span",{key:n,class:[e.classList.tag,t.disabled?e.classList.tagDisabled:null],attrs:{tabindex:"-1","aria-label":e.ariaTagLabel(e.localize(t[e.label]))},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagWrapper},[e._v(e._s(e.localize(t[e.label])))]),e._v(" "),e.disabled||t.disabled?e._e():a("span",{class:e.classList.tagRemove,on:{click:function(a){return a.stopPropagation(),e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagRemoveIcon})])])]}),{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),a("div",{ref:"tags",class:e.classList.tagsSearchWrapper},[a("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?a("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",(function(){return[a("div",{class:e.classList.singleLabel},[a("span",{class:e.classList.singleLabelText},[e._v(e._s(e.localize(e.iv[e.label])))])])]}),{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",(function(){return[a("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})]}),{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",(function(){return[a("div",{class:e.classList.placeholder,attrs:{"aria-hidden":"true"}},[e._v("\n "+e._s(e.placeholder)+"\n ")])]}))],e._v(" "),e.loading||e.resolving?e._t("spinner",(function(){return[a("span",{class:e.classList.spinner,attrs:{"aria-hidden":"true"}})]})):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",(function(){return[a("span",{class:e.classList.clear,attrs:{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎"},on:{click:e.clear,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clear.apply(null,arguments)}}},[a("span",{class:e.classList.clearIcon})])]}),{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",(function(){return[a("span",{class:e.classList.caret,attrs:{"aria-hidden":"true"},on:{click:e.handleCaretClick}})]}),{handleCaretClick:e.handleCaretClick,isOpen:e.isOpen}):e._e()],2),e._v(" "),a("Teleport",{attrs:{to:e.appendTo||"body",disabled:!e.appendToBody&&!e.appendTo}},[a("div",{ref:"dropdown",class:e.classList.dropdown,attrs:{id:e.id?e.id+"-dropdown":void 0,tabindex:"-1"},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),a("ul",{class:e.classList.options,attrs:{id:e.ariaControls,role:"listbox"}},[e.groups?e._l(e.fg,(function(t,l,n){return a("li",{key:n,class:e.classList.group,attrs:{id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),"aria-selected":e.isSelected(t),role:"option"}},[t.__CREATE__?e._e():a("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(a){return e.setPointer(t,l)},click:function(a){return e.handleGroupClick(t)}}},[e._t("grouplabel",(function(){return[a("span",{domProps:{innerHTML:e._s(e.localize(t[e.groupLabel]))}})]}),{group:t,isSelected:e.isSelected,isPointed:e.isPointed})],2),e._v(" "),a("ul",{class:e.classList.groupOptions,attrs:{"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),role:"group"}},e._l(t.__VISIBLE__,(function(l,n,r){return a("li",{key:r,class:e.classList.option(l,t),attrs:{"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[e.label])),role:"option"},on:{mouseenter:function(t){return e.setPointer(l)},click:function(t){return e.handleOptionClick(l)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(l[e.label])))])]}),{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,l,n){return a("li",{key:n,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[e.label])),role:"option"},on:{mouseenter:function(a){return e.setPointer(t)},click:function(a){return e.handleOptionClick(t)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(t[e.label])))])]}),{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",(function(){return[a("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.localize(e.noOptionsText))}})]})):e._e(),e._v(" "),e.noResults?e._t("noresults",(function(){return[a("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.localize(e.noResultsText))}})]})):e._e(),e._v(" "),e.infinite&&e.hasMore?a("div",{ref:"infiniteLoader",class:e.classList.inifinite},[e._t("infinite",(function(){return[a("span",{class:e.classList.inifiniteSpinner})]}))],2):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2)]),e._v(" "),e.required?a("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?a("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,l){return a("input",{key:l,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),e.searchable&&e.hasSelected?a("div",{class:e.classList.assist,attrs:{id:e.ariaAssist,"aria-hidden":"true"}},[e._v("\n "+e._s(e.ariaLabel)+"\n ")]):e._e(),e._v(" "),a("div",{class:e.classList.spacer})],2)};Pe._withStripped=!0;return ke({render:Pe,staticRenderFns:[]},undefined,Ee,undefined,false,undefined,!1,void 0,void 0,void 0)}(Vue); diff --git a/dist/multiselect.vue2.js b/dist/multiselect.vue2.js index 4636a3a..2e1fea5 100644 --- a/dist/multiselect.vue2.js +++ b/dist/multiselect.vue2.js @@ -1356,7 +1356,7 @@ function usePointer (props, context, dep) }); watch(isOpen, (val) => { - if (val && multiselect?.value) { + if (val && multiselect && multiselect.value) { let firstSelected = multiselect.value.querySelectorAll(`[data-selected]`)[0]; if (!firstSelected) { @@ -4324,7 +4324,7 @@ function resolveDeps (props, context, features, deps = {}) { ]) }, beforeMount() { - if (this.$root.constructor?.version?.match(/^2\./) || this.vueVersionMs === 2) { + if ((this.$root.constructor && this.$root.constructor.version && this.$root.constructor.version.match(/^2\./)) || this.vueVersionMs === 2) { if (!this.$options.components.Teleport) { this.$options.components.Teleport = { render() { diff --git a/dist/multiselect.vue2.min.js b/dist/multiselect.vue2.min.js index 47252ab..ea2fa9a 100644 --- a/dist/multiselect.vue2.min.js +++ b/dist/multiselect.vue2.min.js @@ -1 +1 @@ -import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as n,watch as r,nextTick as i,onMounted as o,onBeforeUnmount as u,shallowRef as s}from"vue";function c(e){return null==e}function d(a,l,n){const{object:r,valueProp:i,mode:o}=e(a),u=t().proxy,s=n.iv,d=e=>r.value||c(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],p=e=>c(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=p(e);const a=d(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function p(e){return a((()=>({get:e,set:()=>{}})))}function v(t,a){const{value:r,modelValue:i,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=p((()=>void 0!==i.value?i.value:r.value)),d=n((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),v=p((()=>"single"!==o.value?s.value.map((e=>e[u.value])).join(","):s.value[u.value]));return{iv:s,internalValue:s,ev:c,externalValue:c,textValue:v,plainValue:d}}function f(a,n,i){const{regex:o}=e(a),u=t().proxy,s=i.isOpen,c=i.open,d=l(null);return r(d,(e=>{!s.value&&e&&c(),n.emit("search-change",e,u)})),{search:d,clearSearch:()=>{d.value=""},handleSearchInput:e=>{d.value=e.target.value},handleKeypress:e=>{if(o.value){let t=o.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(o.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=o.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}n.emit("paste",e,u)}}}function h(t,a,n){const{groupSelect:r,mode:i,groups:o,disabledProp:u}=e(t),s=l(null),c=e=>{void 0===e||null!==e&&e[u.value]||o.value&&e&&e.group&&("single"===i.value||!r.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:()=>{c(null)}}}function g(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/æ/g,"ae").replace(/œ/g,"oe").replace(/ø/g,"o").replace(/\p{Diacritic}/gu,"")}function m(a,i,o){const{options:u,mode:s,trackBy:d,limit:v,hideSelected:f,createTag:h,createOption:m,label:b,appendNewTag:y,appendNewOption:_,multipleLabel:O,object:w,loading:x,delay:S,resolveOnLoad:L,minChars:T,filterResults:k,clearOnSearch:E,clearOnSelect:P,valueProp:q,allowAbsent:A,groupLabel:C,canDeselect:B,max:D,strict:j,closeOnSelect:R,closeOnDeselect:I,groups:V,reverse:M,infinite:W,groupOptions:$,groupHideEmpty:H,groupSelect:N,onCreate:F,disabledProp:z,searchStart:G,searchFilter:U}=e(a),K=t().proxy,X=o.iv,Y=o.ev,J=o.search,Q=o.clearSearch,Z=o.update,ee=o.pointer,te=o.setPointer,ae=o.clearPointer,le=o.focus,ne=o.deactivate,re=o.close,ie=o.localize,oe=l([]),ue=l([]),se=l(!1),ce=l(null),de=l(W.value&&-1===v.value?10:v.value),pe=n({get:()=>ue.value,set:e=>ue.value=e}),ve=p((()=>h.value||m.value||!1)),fe=p((()=>void 0!==y.value?y.value:void 0===_.value||_.value)),he=n((()=>{if(V.value){let e=be.value||[],t=[];return e.forEach((e=>{Ge(e[$.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=Ge(ue.value||[]);return oe.value.length&&(e=e.concat(oe.value)),e}})),ge=n((()=>{let e=he.value;return M.value&&(e=e.reverse()),Le.value.length&&(e=Le.value.concat(e)),ze(e)})),me=n((()=>{let e=ge.value;return de.value>0&&(e=e.slice(0,de.value)),e})),be=n((()=>{if(!V.value)return[];let e=[],t=ue.value||[];return oe.value.length&&e.push({[C.value]:" ",[$.value]:[...oe.value],__CREATE__:!0}),e.concat(t)})),ye=n((()=>{let e=[...be.value].map((e=>({...e})));return Le.value.length&&(e[0]&&e[0].__CREATE__?e[0][$.value]=[...Le.value,...e[0][$.value]]:e=[{[C.value]:" ",[$.value]:[...Le.value],__CREATE__:!0}].concat(e)),e})),_e=n((()=>{if(!V.value)return[];let e=ye.value;return Fe((e||[]).map(((e,t)=>{const a=Ge(e[$.value]);return{...e,index:t,group:!0,[$.value]:ze(a,!1).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{}))),__VISIBLE__:ze(a).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{})))}})))})),Oe=n((()=>{switch(s.value){case"single":return!c(X.value[q.value]);case"multiple":case"tags":return!c(X.value)&&X.value.length>0}})),we=n((()=>void 0!==O.value?O.value(X.value,K):X.value&&X.value.length>1?`${X.value.length} options selected`:"1 option selected")),xe=p((()=>!he.value.length&&!se.value&&!Le.value.length)),Se=p((()=>he.value.length>0&&0==me.value.length&&(J.value&&V.value||!V.value))),Le=n((()=>!1!==ve.value&&J.value?-1!==He(J.value)?[]:[{[q.value]:J.value,[Te.value[0]]:J.value,[b.value]:J.value,__CREATE__:!0}]:[])),Te=n((()=>d.value?Array.isArray(d.value)?d.value:[d.value]:[b.value])),ke=p((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Ee=p((()=>x.value||se.value)),Pe=e=>{switch("object"!=typeof e&&(e=$e(e)),s.value){case"single":Z(e);break;case"multiple":case"tags":Z(X.value.concat(e))}i.emit("select",Ae(e),e,K)},qe=e=>{switch("object"!=typeof e&&(e=$e(e)),s.value){case"single":Be();break;case"tags":case"multiple":Z(Array.isArray(e)?X.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):X.value.filter((t=>t[q.value]!=e[q.value])))}i.emit("deselect",Ae(e),e,K)},Ae=e=>w.value?e:e[q.value],Ce=e=>{qe(e)},Be=()=>{Z(ke.value),i.emit("clear",K)},De=e=>{if(void 0!==e.group)return"single"!==s.value&&(We(e[$.value])&&e[$.value].length);switch(s.value){case"single":return!c(X.value)&&X.value[q.value]==e[q.value];case"tags":case"multiple":return!c(X.value)&&-1!==X.value.map((e=>e[q.value])).indexOf(e[q.value])}},je=e=>!0===e[z.value],Re=()=>!(void 0===D||-1===D.value||!Oe.value&&D.value>0)&&X.value.length>=D.value,Ie=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&De(e))return B.value&&qe(e),void(I.value&&(ae(),re()));e&&Ve(e),P.value&&Q(),R.value&&(ae(),re()),e&&Pe(e);break;case"multiple":if(e&&De(e))return qe(e),void(I.value&&(ae(),re()));if(Re())return void i.emit("max",K);e&&(Ve(e),Pe(e)),P.value&&Q(),f.value&&ae(),R.value&&re();break;case"tags":if(e&&De(e))return qe(e),void(I.value&&(ae(),re()));if(Re())return void i.emit("max",K);e&&Ve(e),P.value&&Q(),e&&Pe(e),f.value&&ae(),R.value&&re()}R.value||le()},Ve=e=>{void 0===$e(e[q.value])&&ve.value&&(i.emit("tag",e[q.value],K),i.emit("option",e[q.value],K),i.emit("create",e[q.value],K),fe.value&&Ne(e),Q())},Me=e=>void 0===e.find((e=>!De(e)&&!e[z.value])),We=e=>void 0===e.find((e=>!De(e))),$e=e=>he.value[he.value.map((e=>String(e[q.value]))).indexOf(String(e))],He=e=>he.value.findIndex((t=>Te.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Ne=e=>{oe.value.push(e)},Fe=e=>H.value?e.filter((e=>J.value?e.__VISIBLE__.length:e[$.value].length)):e.filter((e=>!J.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(J.value&&k.value){let e=U.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=g(ie(e[a]),j.value);return G.value?l.startsWith(g(t,j.value)):-1!==l.indexOf(g(t,j.value))}))),a=a.filter((t=>e(t,J.value,K)))}return f.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&f.value&&De(e))(e)))),a},Ge=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[q.value]:e,[Te.value[0]]:a,[b.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[q.value]:e,[Te.value[0]]:e,[b.value]:e})),t},Ue=()=>{c(Y.value)||(X.value=Ye(Y.value))},Ke=e=>(se.value=!0,new Promise(((t,a)=>{u.value(J.value,K).then((t=>{ue.value=t||[],"function"==typeof e&&e(t),se.value=!1})).catch((e=>{console.error(e),ue.value=[],se.value=!1})).finally((()=>{t()}))}))),Xe=()=>{if(Oe.value)if("single"===s.value){let e=$e(X.value[q.value]);if(void 0!==e){let t=e[b.value];X.value[b.value]=t,w.value&&(Y.value[b.value]=t)}}else X.value.forEach(((e,t)=>{let a=$e(X.value[t][q.value]);if(void 0!==a){let e=a[b.value];X.value[t][b.value]=e,w.value&&(Y.value[t][b.value]=e)}}))},Ye=e=>c(e)?"single"===s.value?{}:[]:w.value?e:"single"===s.value?$e(e)||(A.value?{[b.value]:e,[q.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!$e(e)||A.value)).map((e=>$e(e)||{[b.value]:e,[q.value]:e,[Te.value[0]]:e})),Je=()=>{ce.value=r(J,(e=>{e.length{e==J.value&&u.value(J.value,K).then((t=>{e!=J.value&&J.value||(ue.value=t,ee.value=me.value.filter((e=>!0!==e[z.value]))[0]||null,se.value=!1)})).catch((e=>{console.error(e)}))}),S.value))}),{flush:"sync"})};if("single"!==s.value&&!c(Y.value)&&!Array.isArray(Y.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?L.value?Ke(Ue):1==w.value&&Ue():(ue.value=u.value,Ue()),S.value>-1&&Je(),r(S,((e,t)=>{ce.value&&ce.value(),e>=0&&Je()})),r(Y,(e=>{if(c(e))Z(Ye(e),!1);else switch(s.value){case"single":(w.value?e[q.value]!=X.value[q.value]:e!=X.value[q.value])&&Z(Ye(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(w.value?e.map((e=>e[q.value])):e,X.value.map((e=>e[q.value])))||Z(Ye(e),!1)}}),{deep:!0}),r(u,((e,t)=>{"function"==typeof a.options?L.value&&(!t||e&&e.toString()!==t.toString())&&Ke():(ue.value=a.options,Object.keys(X.value).length||Ue(),Xe())})),r(b,Xe),r(v,((e,t)=>{de.value=W.value&&-1===e?10:e})),{resolvedOptions:pe,pfo:ge,fo:me,filteredOptions:me,hasSelected:Oe,multipleLabelText:we,eo:he,extendedOptions:he,eg:be,extendedGroups:be,fg:_e,filteredGroups:_e,noOptions:xe,noResults:Se,resolving:se,busy:Ee,offset:de,select:Pe,deselect:qe,remove:Ce,selectAll:()=>{"single"!==s.value&&Pe(me.value.filter((e=>!e.disabled&&!De(e))))},clear:Be,isSelected:De,isDisabled:je,isMax:Re,getOption:$e,handleOptionClick:e=>{if(!je(e))return F.value&&!De(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=F.value(e,K))instanceof Promise)?(se.value=!0,void e.then((e=>{se.value=!1,Ie(e)}))):void Ie(e)},handleGroupClick:e=>{if(!je(e)&&"single"!==s.value&&N.value){switch(s.value){case"multiple":case"tags":Me(e[$.value])?qe(e[$.value]):Pe(e[$.value].filter((e=>-1===X.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[z.value])).filter(((e,t)=>X.value.length+1+t<=D.value||-1===D.value))),f.value&&ee.value&&te(_e.value.filter((e=>!e[z.value]))[ee.value.index])}R.value&&ne()}},handleTagRemove:(e,t)=>{0===t.button?Ce(e):t.preventDefault()},refreshOptions:e=>{Ke(e)},resolveOptions:Ke,refreshLabels:Xe}}function b(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:d,mode:v,groupSelect:f,disabledProp:h,groupOptions:g}=e(t),m=l.fo,b=l.fg,y=l.handleOptionClick,_=l.handleGroupClick,O=l.search,w=l.pointer,x=l.setPointer,S=l.clearPointer,L=l.multiselect,T=l.isOpen,k=n((()=>m.value.filter((e=>!e[h.value])))),E=n((()=>b.value.filter((e=>!e[h.value])))),P=p((()=>"single"!==v.value&&f.value)),q=p((()=>w.value&&w.value.group)),A=n((()=>$(w.value))),C=n((()=>{const e=q.value?w.value:$(w.value),t=E.value.map((e=>e[c.value])).indexOf(e[c.value]);let a=E.value[t-1];return void 0===a&&(a=D.value),a})),B=n((()=>{let e=E.value.map((e=>e.label)).indexOf(q.value?w.value[c.value]:$(w.value)[c.value])+1;return E.value.length<=e&&(e=0),E.value[e]})),D=n((()=>[...E.value].slice(-1)[0])),j=n((()=>w.value.__VISIBLE__.filter((e=>!e[h.value]))[0])),R=n((()=>{const e=A.value.__VISIBLE__.filter((e=>!e[h.value]));return e[e.map((e=>e[o.value])).indexOf(w.value[o.value])-1]})),I=n((()=>{const e=$(w.value).__VISIBLE__.filter((e=>!e[h.value]));return e[e.map((e=>e[o.value])).indexOf(w.value[o.value])+1]})),V=n((()=>[...C.value.__VISIBLE__.filter((e=>!e[h.value]))].slice(-1)[0])),M=n((()=>[...D.value.__VISIBLE__.filter((e=>!e[h.value]))].slice(-1)[0])),W=()=>{x(k.value[0]||null)},$=e=>E.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[o.value])).indexOf(e[o.value]))),H=()=>{let e=L.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;d.value&&(t=q.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{s.value&&(e.length&&u.value?W():S())})),r(T,(e=>{if(e&&L?.value){let e=L.value.querySelectorAll("[data-selected]")[0];if(!e)return;let t=e.parentElement.parentElement;i((()=>{t.scrollTop=e.offsetTop}))}})),{pointer:w,canPointGroups:P,isPointed:e=>!(!w.value||!(!e.group&&w.value[o.value]===e[o.value]||void 0!==e.group&&w.value[c.value]===e[c.value]))||void 0,setPointerFirst:W,selectPointer:()=>{w.value&&!0!==w.value[h.value]&&(q.value?_(w.value):y(w.value))},forwardPointer:()=>{if(null===w.value)x((d.value&&P.value?E.value[0].__CREATE__?k.value[0]:E.value[0]:k.value[0])||null);else if(d.value&&P.value){let e=q.value?j.value:I.value;void 0===e&&(e=B.value,e.__CREATE__&&(e=e[g.value][0])),x(e||null)}else{let e=k.value.map((e=>e[o.value])).indexOf(w.value[o.value])+1;k.value.length<=e&&(e=0),x(k.value[e]||null)}i((()=>{H()}))},backwardPointer:()=>{if(null===w.value){let e=k.value[k.value.length-1];d.value&&P.value&&(e=M.value,void 0===e&&(e=D.value)),x(e||null)}else if(d.value&&P.value){let e=q.value?V.value:R.value;void 0===e&&(e=q.value?C.value:A.value,e.__CREATE__&&(e=V.value,void 0===e&&(e=C.value))),x(e||null)}else{let e=k.value.map((e=>e[o.value])).indexOf(w.value[o.value])-1;e<0&&(e=k.value.length-1),x(k.value[e]||null)}i((()=>{H()}))}}}function y(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function _(e){return e instanceof y(e).Element||e instanceof Element}function O(e){return e instanceof y(e).HTMLElement||e instanceof HTMLElement}function w(e){return"undefined"!=typeof ShadowRoot&&(e instanceof y(e).ShadowRoot||e instanceof ShadowRoot)}var x=Math.max,S=Math.min,L=Math.round;function T(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function k(){return!/^((?!chrome|android).)*safari/i.test(T())}function E(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&O(e)&&(n=e.offsetWidth>0&&L(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&L(l.height)/e.offsetHeight||1);var i=(_(e)?y(e):window).visualViewport,o=!k()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,d=l.height/r;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function P(e){var t=y(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(e){return e?(e.nodeName||"").toLowerCase():null}function A(e){return((_(e)?e.ownerDocument:e.document)||window.document).documentElement}function C(e){return E(A(e)).left+P(e).scrollLeft}function B(e){return y(e).getComputedStyle(e)}function D(e){var t=B(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function j(e,t,a){void 0===a&&(a=!1);var l,n,r=O(t),i=O(t)&&function(e){var t=e.getBoundingClientRect(),a=L(t.width)/e.offsetWidth||1,l=L(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=A(t),u=E(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==q(t)||D(o))&&(s=(l=t)!==y(l)&&O(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:P(l)),O(t)?((c=E(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=C(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function R(e){var t=E(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function I(e){return"html"===q(e)?e:e.assignedSlot||e.parentNode||(w(e)?e.host:null)||A(e)}function V(e){return["html","body","#document"].indexOf(q(e))>=0?e.ownerDocument.body:O(e)&&D(e)?e:V(I(e))}function M(e,t){var a;void 0===t&&(t=[]);var l=V(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=y(l),i=n?[r].concat(r.visualViewport||[],D(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(M(I(i)))}function W(e){return["table","td","th"].indexOf(q(e))>=0}function $(e){return O(e)&&"fixed"!==B(e).position?e.offsetParent:null}function H(e){for(var t=y(e),a=$(e);a&&W(a)&&"static"===B(a).position;)a=$(a);return a&&("html"===q(a)||"body"===q(a)&&"static"===B(a).position)?t:a||function(e){var t=/firefox/i.test(T());if(/Trident/i.test(T())&&O(e)&&"fixed"===B(e).position)return null;var a=I(e);for(w(a)&&(a=a.host);O(a)&&["html","body"].indexOf(q(a))<0;){var l=B(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var N="top",F="bottom",z="right",G="left",U="auto",K=[N,F,z,G],X="start",Y="end",J="clippingParents",Q="viewport",Z="popper",ee="reference",te=K.reduce((function(e,t){return e.concat([t+"-"+X,t+"-"+Y])}),[]),ae=[].concat(K,[U]).reduce((function(e,t){return e.concat([t,t+"-"+X,t+"-"+Y])}),[]),le=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ne(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ie(e,t,a){return t===Q?re(function(e,t){var a=y(e),l=A(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=k();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+C(e),y:u}}(e,a)):_(t)?function(e,t){var a=E(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):re(function(e){var t,a=A(e),l=P(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=x(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=x(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+C(e),u=-l.scrollTop;return"rtl"===B(n||a).direction&&(o+=x(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(A(e)))}function oe(e){var t=M(I(e)),a=["absolute","fixed"].indexOf(B(e).position)>=0&&O(e)?H(e):e;return _(a)?t.filter((function(e){return _(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&w(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==q(e)})):[]}function ue(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function ce(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function de(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ue(n):null,i=n?se(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case N:t={x:o,y:a.y-l.height};break;case F:t={x:o,y:a.y+a.height};break;case z:t={x:a.x+a.width,y:u};break;case G:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ce(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case X:t[s]=t[s]-(a[c]/2-l[c]/2);break;case Y:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function pe(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,i=l.strategy,o=void 0===i?e.strategy:i,u=l.boundary,s=void 0===u?J:u,c=l.rootBoundary,d=void 0===c?Q:c,p=l.elementContext,v=void 0===p?Z:p,f=l.altBoundary,h=void 0!==f&&f,g=l.padding,m=void 0===g?0:g,b=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof m?m:(a=m,K.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===Z?ee:Z,O=e.rects.popper,w=e.elements[h?y:v],L=function(e,t,a,l){var n="clippingParents"===t?oe(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=ie(e,a,l);return t.top=x(n.top,t.top),t.right=S(n.right,t.right),t.bottom=S(n.bottom,t.bottom),t.left=x(n.left,t.left),t}),ie(e,i,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(_(w)?w:w.contextElement||A(e.elements.popper),s,d,o),T=E(e.elements.reference),k=de({reference:T,element:O,strategy:"absolute",placement:r}),P=re(Object.assign({},O,k)),q=v===Z?P:T,C={top:L.top-q.top+b.top,bottom:q.bottom-L.bottom+b.bottom,left:L.left-q.left+b.left,right:q.right-L.right+b.right},B=e.modifiersData.offset;if(v===Z&&B){var D=B[r];Object.keys(C).forEach((function(e){var t=[z,F].indexOf(e)>=0?1:-1,a=[N,F].indexOf(e)>=0?"y":"x";C[e]+=D[a]*t}))}return C}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function fe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(Oe,fe,we):_e(v?Oe:ge,fe,v?we:me);w[O]=xe,q[O]=xe-fe}t.modifiersData[l]=q}},requiresIfExists:["offset"]},we={left:"right",right:"left",bottom:"top",top:"bottom"};function xe(e){return e.replace(/left|right|bottom|top/g,(function(e){return we[e]}))}var Se={start:"end",end:"start"};function Le(e){return e.replace(/start|end/g,(function(e){return Se[e]}))}function Te(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,i=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?ae:u,c=se(l),d=c?o?te:te.filter((function(e){return se(e)===c})):K,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=pe(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[ue(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ke={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,i=a.altAxis,o=void 0===i||i,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=ue(g),b=u||(m===g||!f?[xe(g)]:function(e){if(ue(e)===U)return[];var t=xe(e);return[Le(e),t,Le(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(ue(a)===U?Te(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),_=t.rects.reference,O=t.rects.popper,w=new Map,x=!0,S=y[0],L=0;L=0,q=P?"width":"height",A=pe(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?z:G:E?F:N;_[q]>O[q]&&(C=xe(C));var B=xe(C),D=[];if(r&&D.push(A[k]<=0),o&&D.push(A[C]<=0,A[B]<=0),D.every((function(e){return e}))){S=T,x=!1;break}w.set(T,D)}if(x)for(var j=function(e){var t=y.find((function(t){var a=w.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},R=f?3:1;R>0;R--){if("break"===j(R))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ee(a,n,r){const{disabled:s,appendTo:c,appendToBody:d,openDirection:v}=e(a),f=t().proxy,h=r.multiselect,g=r.dropdown,m=l(!1),b=l(null),y=l(null),_=p((()=>c.value||d.value)),O=p((()=>"top"===v.value&&"bottom"===y.value||"bottom"===v.value&&"top"!==y.value?"bottom":"top")),w=()=>{if(!b.value)return;let e=parseInt(window.getComputedStyle(g.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(g.value).borderBottomWidth.replace("px",""));b.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===O.value?e:t)]}}]}))),b.value.update()},x=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return o((()=>{_.value&&(b.value=ye(h.value,g.value,{strategy:x(h.value)?"fixed":void 0,placement:v.value,modifiers:[Oe,ke,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){y.value=e.placement}}]}))})),u((()=>{_.value&&b.value&&(b.value.destroy(),b.value=null)})),{popper:b,isOpen:m,open:()=>{m.value||s.value||(m.value=!0,n.emit("open",f),_.value&&i((()=>{w()})))},close:()=>{m.value&&(m.value=!1,n.emit("close",f))},placement:O,updatePopper:w}}function Pe(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,v=n.isOpen,f=n.wrapper,h=n.tags,g=l(!1),m=l(!1),b=p((()=>r.value||i.value?-1:0)),y=()=>{r.value&&u.value.blur(),f.value.blur()},_=(e=!0)=>{i.value||(g.value=!0,e&&s())},O=()=>{g.value=!1,setTimeout((()=>{g.value||(c(),o.value&&d())}),1)};return{tabindex:b,isActive:g,mouseClicked:m,blur:y,focus:()=>{r.value&&!i.value&&u.value.focus()},activate:_,deactivate:O,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||_(m.value)},handleFocusOut:()=>{O()},handleCaretClick:()=>{O(),y()},handleMousedown:e=>{m.value=!0,v.value&&(e.target.isEqualNode(f.value)||e.target.isEqualNode(h.value))?setTimeout((()=>{O()}),0):v.value||!document.activeElement.isEqualNode(f.value)&&!document.activeElement.isEqualNode(u.value)||_(),setTimeout((()=>{m.value=!1}),0)}}}function qe(a,l,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:v,createTag:f,createOption:h,reverse:g}=e(a),m=t().proxy,b=n.iv,y=n.update,_=n.deselect,O=n.search,w=n.setPointer,x=n.selectPointer,S=n.backwardPointer,L=n.forwardPointer,T=n.multiselect,k=n.wrapper,E=n.tags,P=n.isOpen,q=n.open,A=n.blur,C=n.fo,B=p((()=>f.value||h.value||!1)),D=p((()=>void 0!==i.value?i.value:void 0!==v.value?v.value:["enter"])),j=()=>{"tags"===r.value&&!s.value&&B.value&&u.value&&!d.value&&w(C.value[C.value.map((e=>e[c.value])).indexOf(O.value)])};return{handleKeydown:e=>{let t,a;switch(l.emit("keydown",e,m),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...T.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==E.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(O.value))return;if(0===b.value.length)return;let l=b.value.filter((e=>!e.disabled&&!1!==e.remove));l.length&&_(l[l.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==a&&void 0!==a)return y([...b.value].filter(((e,t)=>t!==a))),void(a===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?E.value.querySelector("input").focus():k.value.focus()));if(-1===D.value.indexOf("enter")&&B.value)return;j(),x();break;case" ":if(!B.value&&!u.value)return e.preventDefault(),j(),void x();if(!B.value)return!1;if(-1===D.value.indexOf("space")&&B.value)return;e.preventDefault(),j(),x();break;case"Tab":case";":case",":if(-1===D.value.indexOf(e.key.toLowerCase())||!B.value)return;j(),x(),e.preventDefault();break;case"Escape":A();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;P.value||q(),S();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;P.value||q(),L();break;case"ArrowLeft":if(u.value&&E.value&&E.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!b.value||!b.value.length)return;e.preventDefault(),-1===a?t[t.length-1].focus():a>0&&t[a-1].focus();break;case"ArrowRight":if(-1===a||e.shiftKey||"tags"!==r.value||!b.value||!b.value.length)return;e.preventDefault(),t.length>a+1?t[a+1].focus():u.value?E.value.querySelector("input").focus():u.value||k.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,m)},preparePointer:j}}function Ae(t,a,l){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,d=l.isSelected,v=l.isDisabled,f=l.isActive,h=l.canPointGroups,g=l.resolving,m=l.fo,b=l.placement,y=p((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),_=p((()=>!!(s.value&&o.value&&(!g.value||g.value&&m.value.length))));return{classList:n((()=>{const e=y.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(_.value&&"top"===b.value?e.containerOpenTop:[]).concat(_.value&&"top"!==b.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===b.value?e.dropdownTop:[]).concat(s.value&&o.value&&_.value?[]:e.dropdownHidden),options:[e.options].concat("top"===b.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&h.value?a.push(v(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):v(t)&&a.push(e.groupLabelDisabled),h.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(v(t)?e.optionSelectedDisabled:e.optionSelected):(v(t)||a&&v(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:_}}function Ce(t,a,n){const{limit:u,infinite:c}=e(t),d=n.isOpen,v=n.offset,f=n.search,h=n.pfo,g=n.eo,m=l(null),b=s(null),y=p((()=>v.value{const{isIntersecting:t,target:a}=e[0];if(t){const e=a.offsetParent,t=e.scrollTop;v.value+=-1==u.value?10:u.value,i((()=>{e.scrollTop=t}))}},O=()=>{d.value&&v.value{c.value&&O()})),r(f,(()=>{c.value&&(v.value=u.value,O())}),{flush:"post"}),r(g,(()=>{c.value&&O()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(m.value=new IntersectionObserver(_))})),{hasMore:y,infiniteLoader:b}}function Be(t,a,r){const{placeholder:i,id:u,valueProp:s,label:c,mode:d,groupLabel:v,aria:f,searchable:h}=e(t),g=r.pointer,m=r.iv,b=r.hasSelected,y=r.multipleLabelText,_=l(null),O=p((()=>(u.value?u.value+"-":"")+"assist")),w=p((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=p((()=>{if(g.value){let e=u.value?`${u.value}-`:"";return e+=(g.value.group?"multiselect-group":"multiselect-option")+"-",e+=g.value.group?g.value.index:g.value[s.value],e}})),S=p((()=>i.value)),L=p((()=>"single"!==d.value)),T=n((()=>"single"===d.value&&b.value?m.value[c.value]:"multiple"===d.value&&b.value?y.value:"tags"===d.value&&b.value?m.value.map((e=>e[c.value])).join(", "):"")),k=n((()=>{let e={...f.value};return h.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${O.value} ${e["aria-labelledby"]}`:O.value,T.value&&e["aria-label"]&&(e["aria-label"]=`${T.value}, ${e["aria-label"]}`)),e}));return o((()=>{if(u.value&&document&&document.querySelector){let e=document.querySelector(`[for="${u.value}"]`);_.value=e?e.innerText:null}})),{arias:k,ariaLabel:T,ariaAssist:O,ariaControls:w,ariaPlaceholder:S,ariaMultiselectable:L,ariaActiveDescendant:x,ariaOptionId:e=>`${u.value?u.value+"-":""}multiselect-option-${e[s.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${u.value?u.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function De(t,a,l){const{locale:n,fallbackLocale:r}=e(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function je(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}function Re(e,t,a,l,n,r,i,o,u,s){"boolean"!=typeof i&&(u=o,o=i,i=!1);const c="function"==typeof a?a.options:a;let d;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=d):t&&(d=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),d)if(c.functional){const e=c.render;c.render=function(t,a){return d.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,d):[d]}return a}const Ie={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[je,De,v,h,Ee,f,d,Pe,m,Ce,b,qe,Ae,Be]),beforeMount(){(this.$root.constructor?.version?.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};var Ve=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"multiselect",class:e.classList.container,attrs:{id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut,keyup:e.handleKeyup,keydown:e.handleKeydown}},[a("div",e._b({ref:"wrapper",class:e.classList.wrapper,attrs:{tabindex:e.tabindex,"aria-controls":e.searchable?void 0:e.ariaControls,"aria-placeholder":e.searchable?void 0:e.ariaPlaceholder,"aria-expanded":e.searchable?void 0:e.isOpen,"aria-activedescendant":e.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:e.ariaMultiselectable,role:e.searchable?void 0:"combobox"},on:{mousedown:e.handleMousedown}},"div",e.searchable?{}:e.arias,!1),["tags"!==e.mode&&e.searchable&&!e.disabled?[a("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1))]:e._e(),e._v(" "),"tags"==e.mode?[a("div",{class:e.classList.tags,attrs:{"data-tags":""}},[e._l(e.iv,(function(t,l,n){return e._t("tag",(function(){return[a("span",{key:n,class:[e.classList.tag,t.disabled?e.classList.tagDisabled:null],attrs:{tabindex:"-1","aria-label":e.ariaTagLabel(e.localize(t[e.label]))},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagWrapper},[e._v(e._s(e.localize(t[e.label])))]),e._v(" "),e.disabled||t.disabled?e._e():a("span",{class:e.classList.tagRemove,on:{click:function(a){return a.stopPropagation(),e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagRemoveIcon})])])]}),{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),a("div",{ref:"tags",class:e.classList.tagsSearchWrapper},[a("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?a("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",(function(){return[a("div",{class:e.classList.singleLabel},[a("span",{class:e.classList.singleLabelText},[e._v(e._s(e.localize(e.iv[e.label])))])])]}),{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",(function(){return[a("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})]}),{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",(function(){return[a("div",{class:e.classList.placeholder,attrs:{"aria-hidden":"true"}},[e._v("\n "+e._s(e.placeholder)+"\n ")])]}))],e._v(" "),e.loading||e.resolving?e._t("spinner",(function(){return[a("span",{class:e.classList.spinner,attrs:{"aria-hidden":"true"}})]})):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",(function(){return[a("span",{class:e.classList.clear,attrs:{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎"},on:{click:e.clear,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clear.apply(null,arguments)}}},[a("span",{class:e.classList.clearIcon})])]}),{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",(function(){return[a("span",{class:e.classList.caret,attrs:{"aria-hidden":"true"},on:{click:e.handleCaretClick}})]}),{handleCaretClick:e.handleCaretClick,isOpen:e.isOpen}):e._e()],2),e._v(" "),a("Teleport",{attrs:{to:e.appendTo||"body",disabled:!e.appendToBody&&!e.appendTo}},[a("div",{ref:"dropdown",class:e.classList.dropdown,attrs:{id:e.id?e.id+"-dropdown":void 0,tabindex:"-1"},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),a("ul",{class:e.classList.options,attrs:{id:e.ariaControls,role:"listbox"}},[e.groups?e._l(e.fg,(function(t,l,n){return a("li",{key:n,class:e.classList.group,attrs:{id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),"aria-selected":e.isSelected(t),role:"option"}},[t.__CREATE__?e._e():a("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(a){return e.setPointer(t,l)},click:function(a){return e.handleGroupClick(t)}}},[e._t("grouplabel",(function(){return[a("span",{domProps:{innerHTML:e._s(e.localize(t[e.groupLabel]))}})]}),{group:t,isSelected:e.isSelected,isPointed:e.isPointed})],2),e._v(" "),a("ul",{class:e.classList.groupOptions,attrs:{"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),role:"group"}},e._l(t.__VISIBLE__,(function(l,n,r){return a("li",{key:r,class:e.classList.option(l,t),attrs:{"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[e.label])),role:"option"},on:{mouseenter:function(t){return e.setPointer(l)},click:function(t){return e.handleOptionClick(l)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(l[e.label])))])]}),{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,l,n){return a("li",{key:n,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[e.label])),role:"option"},on:{mouseenter:function(a){return e.setPointer(t)},click:function(a){return e.handleOptionClick(t)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(t[e.label])))])]}),{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",(function(){return[a("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.localize(e.noOptionsText))}})]})):e._e(),e._v(" "),e.noResults?e._t("noresults",(function(){return[a("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.localize(e.noResultsText))}})]})):e._e(),e._v(" "),e.infinite&&e.hasMore?a("div",{ref:"infiniteLoader",class:e.classList.inifinite},[e._t("infinite",(function(){return[a("span",{class:e.classList.inifiniteSpinner})]}))],2):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2)]),e._v(" "),e.required?a("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?a("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,l){return a("input",{key:l,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),e.searchable&&e.hasSelected?a("div",{class:e.classList.assist,attrs:{id:e.ariaAssist,"aria-hidden":"true"}},[e._v("\n "+e._s(e.ariaLabel)+"\n ")]):e._e(),e._v(" "),a("div",{class:e.classList.spacer})],2)};Ve._withStripped=!0;const Me=Re({render:Ve,staticRenderFns:[]},undefined,Ie,undefined,false,undefined,!1,void 0,void 0,void 0);export{Me as default}; +import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as n,watch as r,nextTick as i,onMounted as o,onBeforeUnmount as u,shallowRef as s}from"vue";function c(e){return null==e}function d(a,l,n){const{object:r,valueProp:i,mode:o}=e(a),u=t().proxy,s=n.iv,d=e=>r.value||c(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],p=e=>c(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=p(e);const a=d(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function p(e){return a((()=>({get:e,set:()=>{}})))}function v(t,a){const{value:r,modelValue:i,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=p((()=>void 0!==i.value?i.value:r.value)),d=n((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),v=p((()=>"single"!==o.value?s.value.map((e=>e[u.value])).join(","):s.value[u.value]));return{iv:s,internalValue:s,ev:c,externalValue:c,textValue:v,plainValue:d}}function f(a,n,i){const{regex:o}=e(a),u=t().proxy,s=i.isOpen,c=i.open,d=l(null);return r(d,(e=>{!s.value&&e&&c(),n.emit("search-change",e,u)})),{search:d,clearSearch:()=>{d.value=""},handleSearchInput:e=>{d.value=e.target.value},handleKeypress:e=>{if(o.value){let t=o.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(o.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=o.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}n.emit("paste",e,u)}}}function h(t,a,n){const{groupSelect:r,mode:i,groups:o,disabledProp:u}=e(t),s=l(null),c=e=>{void 0===e||null!==e&&e[u.value]||o.value&&e&&e.group&&("single"===i.value||!r.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:()=>{c(null)}}}function g(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/æ/g,"ae").replace(/œ/g,"oe").replace(/ø/g,"o").replace(/\p{Diacritic}/gu,"")}function m(a,i,o){const{options:u,mode:s,trackBy:d,limit:v,hideSelected:f,createTag:h,createOption:m,label:b,appendNewTag:y,appendNewOption:_,multipleLabel:O,object:w,loading:x,delay:S,resolveOnLoad:L,minChars:T,filterResults:k,clearOnSearch:E,clearOnSelect:P,valueProp:q,allowAbsent:A,groupLabel:C,canDeselect:B,max:D,strict:j,closeOnSelect:R,closeOnDeselect:I,groups:V,reverse:M,infinite:W,groupOptions:$,groupHideEmpty:H,groupSelect:N,onCreate:F,disabledProp:z,searchStart:G,searchFilter:U}=e(a),K=t().proxy,X=o.iv,Y=o.ev,J=o.search,Q=o.clearSearch,Z=o.update,ee=o.pointer,te=o.setPointer,ae=o.clearPointer,le=o.focus,ne=o.deactivate,re=o.close,ie=o.localize,oe=l([]),ue=l([]),se=l(!1),ce=l(null),de=l(W.value&&-1===v.value?10:v.value),pe=n({get:()=>ue.value,set:e=>ue.value=e}),ve=p((()=>h.value||m.value||!1)),fe=p((()=>void 0!==y.value?y.value:void 0===_.value||_.value)),he=n((()=>{if(V.value){let e=be.value||[],t=[];return e.forEach((e=>{Ge(e[$.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=Ge(ue.value||[]);return oe.value.length&&(e=e.concat(oe.value)),e}})),ge=n((()=>{let e=he.value;return M.value&&(e=e.reverse()),Le.value.length&&(e=Le.value.concat(e)),ze(e)})),me=n((()=>{let e=ge.value;return de.value>0&&(e=e.slice(0,de.value)),e})),be=n((()=>{if(!V.value)return[];let e=[],t=ue.value||[];return oe.value.length&&e.push({[C.value]:" ",[$.value]:[...oe.value],__CREATE__:!0}),e.concat(t)})),ye=n((()=>{let e=[...be.value].map((e=>({...e})));return Le.value.length&&(e[0]&&e[0].__CREATE__?e[0][$.value]=[...Le.value,...e[0][$.value]]:e=[{[C.value]:" ",[$.value]:[...Le.value],__CREATE__:!0}].concat(e)),e})),_e=n((()=>{if(!V.value)return[];let e=ye.value;return Fe((e||[]).map(((e,t)=>{const a=Ge(e[$.value]);return{...e,index:t,group:!0,[$.value]:ze(a,!1).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{}))),__VISIBLE__:ze(a).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{})))}})))})),Oe=n((()=>{switch(s.value){case"single":return!c(X.value[q.value]);case"multiple":case"tags":return!c(X.value)&&X.value.length>0}})),we=n((()=>void 0!==O.value?O.value(X.value,K):X.value&&X.value.length>1?`${X.value.length} options selected`:"1 option selected")),xe=p((()=>!he.value.length&&!se.value&&!Le.value.length)),Se=p((()=>he.value.length>0&&0==me.value.length&&(J.value&&V.value||!V.value))),Le=n((()=>!1!==ve.value&&J.value?-1!==He(J.value)?[]:[{[q.value]:J.value,[Te.value[0]]:J.value,[b.value]:J.value,__CREATE__:!0}]:[])),Te=n((()=>d.value?Array.isArray(d.value)?d.value:[d.value]:[b.value])),ke=p((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Ee=p((()=>x.value||se.value)),Pe=e=>{switch("object"!=typeof e&&(e=$e(e)),s.value){case"single":Z(e);break;case"multiple":case"tags":Z(X.value.concat(e))}i.emit("select",Ae(e),e,K)},qe=e=>{switch("object"!=typeof e&&(e=$e(e)),s.value){case"single":Be();break;case"tags":case"multiple":Z(Array.isArray(e)?X.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):X.value.filter((t=>t[q.value]!=e[q.value])))}i.emit("deselect",Ae(e),e,K)},Ae=e=>w.value?e:e[q.value],Ce=e=>{qe(e)},Be=()=>{Z(ke.value),i.emit("clear",K)},De=e=>{if(void 0!==e.group)return"single"!==s.value&&(We(e[$.value])&&e[$.value].length);switch(s.value){case"single":return!c(X.value)&&X.value[q.value]==e[q.value];case"tags":case"multiple":return!c(X.value)&&-1!==X.value.map((e=>e[q.value])).indexOf(e[q.value])}},je=e=>!0===e[z.value],Re=()=>!(void 0===D||-1===D.value||!Oe.value&&D.value>0)&&X.value.length>=D.value,Ie=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&De(e))return B.value&&qe(e),void(I.value&&(ae(),re()));e&&Ve(e),P.value&&Q(),R.value&&(ae(),re()),e&&Pe(e);break;case"multiple":if(e&&De(e))return qe(e),void(I.value&&(ae(),re()));if(Re())return void i.emit("max",K);e&&(Ve(e),Pe(e)),P.value&&Q(),f.value&&ae(),R.value&&re();break;case"tags":if(e&&De(e))return qe(e),void(I.value&&(ae(),re()));if(Re())return void i.emit("max",K);e&&Ve(e),P.value&&Q(),e&&Pe(e),f.value&&ae(),R.value&&re()}R.value||le()},Ve=e=>{void 0===$e(e[q.value])&&ve.value&&(i.emit("tag",e[q.value],K),i.emit("option",e[q.value],K),i.emit("create",e[q.value],K),fe.value&&Ne(e),Q())},Me=e=>void 0===e.find((e=>!De(e)&&!e[z.value])),We=e=>void 0===e.find((e=>!De(e))),$e=e=>he.value[he.value.map((e=>String(e[q.value]))).indexOf(String(e))],He=e=>he.value.findIndex((t=>Te.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Ne=e=>{oe.value.push(e)},Fe=e=>H.value?e.filter((e=>J.value?e.__VISIBLE__.length:e[$.value].length)):e.filter((e=>!J.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(J.value&&k.value){let e=U.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=g(ie(e[a]),j.value);return G.value?l.startsWith(g(t,j.value)):-1!==l.indexOf(g(t,j.value))}))),a=a.filter((t=>e(t,J.value,K)))}return f.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&f.value&&De(e))(e)))),a},Ge=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[q.value]:e,[Te.value[0]]:a,[b.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[q.value]:e,[Te.value[0]]:e,[b.value]:e})),t},Ue=()=>{c(Y.value)||(X.value=Ye(Y.value))},Ke=e=>(se.value=!0,new Promise(((t,a)=>{u.value(J.value,K).then((t=>{ue.value=t||[],"function"==typeof e&&e(t),se.value=!1})).catch((e=>{console.error(e),ue.value=[],se.value=!1})).finally((()=>{t()}))}))),Xe=()=>{if(Oe.value)if("single"===s.value){let e=$e(X.value[q.value]);if(void 0!==e){let t=e[b.value];X.value[b.value]=t,w.value&&(Y.value[b.value]=t)}}else X.value.forEach(((e,t)=>{let a=$e(X.value[t][q.value]);if(void 0!==a){let e=a[b.value];X.value[t][b.value]=e,w.value&&(Y.value[t][b.value]=e)}}))},Ye=e=>c(e)?"single"===s.value?{}:[]:w.value?e:"single"===s.value?$e(e)||(A.value?{[b.value]:e,[q.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!$e(e)||A.value)).map((e=>$e(e)||{[b.value]:e,[q.value]:e,[Te.value[0]]:e})),Je=()=>{ce.value=r(J,(e=>{e.length{e==J.value&&u.value(J.value,K).then((t=>{e!=J.value&&J.value||(ue.value=t,ee.value=me.value.filter((e=>!0!==e[z.value]))[0]||null,se.value=!1)})).catch((e=>{console.error(e)}))}),S.value))}),{flush:"sync"})};if("single"!==s.value&&!c(Y.value)&&!Array.isArray(Y.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?L.value?Ke(Ue):1==w.value&&Ue():(ue.value=u.value,Ue()),S.value>-1&&Je(),r(S,((e,t)=>{ce.value&&ce.value(),e>=0&&Je()})),r(Y,(e=>{if(c(e))Z(Ye(e),!1);else switch(s.value){case"single":(w.value?e[q.value]!=X.value[q.value]:e!=X.value[q.value])&&Z(Ye(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(w.value?e.map((e=>e[q.value])):e,X.value.map((e=>e[q.value])))||Z(Ye(e),!1)}}),{deep:!0}),r(u,((e,t)=>{"function"==typeof a.options?L.value&&(!t||e&&e.toString()!==t.toString())&&Ke():(ue.value=a.options,Object.keys(X.value).length||Ue(),Xe())})),r(b,Xe),r(v,((e,t)=>{de.value=W.value&&-1===e?10:e})),{resolvedOptions:pe,pfo:ge,fo:me,filteredOptions:me,hasSelected:Oe,multipleLabelText:we,eo:he,extendedOptions:he,eg:be,extendedGroups:be,fg:_e,filteredGroups:_e,noOptions:xe,noResults:Se,resolving:se,busy:Ee,offset:de,select:Pe,deselect:qe,remove:Ce,selectAll:()=>{"single"!==s.value&&Pe(me.value.filter((e=>!e.disabled&&!De(e))))},clear:Be,isSelected:De,isDisabled:je,isMax:Re,getOption:$e,handleOptionClick:e=>{if(!je(e))return F.value&&!De(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=F.value(e,K))instanceof Promise)?(se.value=!0,void e.then((e=>{se.value=!1,Ie(e)}))):void Ie(e)},handleGroupClick:e=>{if(!je(e)&&"single"!==s.value&&N.value){switch(s.value){case"multiple":case"tags":Me(e[$.value])?qe(e[$.value]):Pe(e[$.value].filter((e=>-1===X.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[z.value])).filter(((e,t)=>X.value.length+1+t<=D.value||-1===D.value))),f.value&&ee.value&&te(_e.value.filter((e=>!e[z.value]))[ee.value.index])}R.value&&ne()}},handleTagRemove:(e,t)=>{0===t.button?Ce(e):t.preventDefault()},refreshOptions:e=>{Ke(e)},resolveOptions:Ke,refreshLabels:Xe}}function b(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:d,mode:v,groupSelect:f,disabledProp:h,groupOptions:g}=e(t),m=l.fo,b=l.fg,y=l.handleOptionClick,_=l.handleGroupClick,O=l.search,w=l.pointer,x=l.setPointer,S=l.clearPointer,L=l.multiselect,T=l.isOpen,k=n((()=>m.value.filter((e=>!e[h.value])))),E=n((()=>b.value.filter((e=>!e[h.value])))),P=p((()=>"single"!==v.value&&f.value)),q=p((()=>w.value&&w.value.group)),A=n((()=>$(w.value))),C=n((()=>{const e=q.value?w.value:$(w.value),t=E.value.map((e=>e[c.value])).indexOf(e[c.value]);let a=E.value[t-1];return void 0===a&&(a=D.value),a})),B=n((()=>{let e=E.value.map((e=>e.label)).indexOf(q.value?w.value[c.value]:$(w.value)[c.value])+1;return E.value.length<=e&&(e=0),E.value[e]})),D=n((()=>[...E.value].slice(-1)[0])),j=n((()=>w.value.__VISIBLE__.filter((e=>!e[h.value]))[0])),R=n((()=>{const e=A.value.__VISIBLE__.filter((e=>!e[h.value]));return e[e.map((e=>e[o.value])).indexOf(w.value[o.value])-1]})),I=n((()=>{const e=$(w.value).__VISIBLE__.filter((e=>!e[h.value]));return e[e.map((e=>e[o.value])).indexOf(w.value[o.value])+1]})),V=n((()=>[...C.value.__VISIBLE__.filter((e=>!e[h.value]))].slice(-1)[0])),M=n((()=>[...D.value.__VISIBLE__.filter((e=>!e[h.value]))].slice(-1)[0])),W=()=>{x(k.value[0]||null)},$=e=>E.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[o.value])).indexOf(e[o.value]))),H=()=>{let e=L.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;d.value&&(t=q.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{s.value&&(e.length&&u.value?W():S())})),r(T,(e=>{if(e&&L&&L.value){let e=L.value.querySelectorAll("[data-selected]")[0];if(!e)return;let t=e.parentElement.parentElement;i((()=>{t.scrollTop=e.offsetTop}))}})),{pointer:w,canPointGroups:P,isPointed:e=>!(!w.value||!(!e.group&&w.value[o.value]===e[o.value]||void 0!==e.group&&w.value[c.value]===e[c.value]))||void 0,setPointerFirst:W,selectPointer:()=>{w.value&&!0!==w.value[h.value]&&(q.value?_(w.value):y(w.value))},forwardPointer:()=>{if(null===w.value)x((d.value&&P.value?E.value[0].__CREATE__?k.value[0]:E.value[0]:k.value[0])||null);else if(d.value&&P.value){let e=q.value?j.value:I.value;void 0===e&&(e=B.value,e.__CREATE__&&(e=e[g.value][0])),x(e||null)}else{let e=k.value.map((e=>e[o.value])).indexOf(w.value[o.value])+1;k.value.length<=e&&(e=0),x(k.value[e]||null)}i((()=>{H()}))},backwardPointer:()=>{if(null===w.value){let e=k.value[k.value.length-1];d.value&&P.value&&(e=M.value,void 0===e&&(e=D.value)),x(e||null)}else if(d.value&&P.value){let e=q.value?V.value:R.value;void 0===e&&(e=q.value?C.value:A.value,e.__CREATE__&&(e=V.value,void 0===e&&(e=C.value))),x(e||null)}else{let e=k.value.map((e=>e[o.value])).indexOf(w.value[o.value])-1;e<0&&(e=k.value.length-1),x(k.value[e]||null)}i((()=>{H()}))}}}function y(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function _(e){return e instanceof y(e).Element||e instanceof Element}function O(e){return e instanceof y(e).HTMLElement||e instanceof HTMLElement}function w(e){return"undefined"!=typeof ShadowRoot&&(e instanceof y(e).ShadowRoot||e instanceof ShadowRoot)}var x=Math.max,S=Math.min,L=Math.round;function T(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function k(){return!/^((?!chrome|android).)*safari/i.test(T())}function E(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&O(e)&&(n=e.offsetWidth>0&&L(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&L(l.height)/e.offsetHeight||1);var i=(_(e)?y(e):window).visualViewport,o=!k()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,d=l.height/r;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function P(e){var t=y(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(e){return e?(e.nodeName||"").toLowerCase():null}function A(e){return((_(e)?e.ownerDocument:e.document)||window.document).documentElement}function C(e){return E(A(e)).left+P(e).scrollLeft}function B(e){return y(e).getComputedStyle(e)}function D(e){var t=B(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function j(e,t,a){void 0===a&&(a=!1);var l,n,r=O(t),i=O(t)&&function(e){var t=e.getBoundingClientRect(),a=L(t.width)/e.offsetWidth||1,l=L(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=A(t),u=E(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==q(t)||D(o))&&(s=(l=t)!==y(l)&&O(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:P(l)),O(t)?((c=E(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=C(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function R(e){var t=E(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function I(e){return"html"===q(e)?e:e.assignedSlot||e.parentNode||(w(e)?e.host:null)||A(e)}function V(e){return["html","body","#document"].indexOf(q(e))>=0?e.ownerDocument.body:O(e)&&D(e)?e:V(I(e))}function M(e,t){var a;void 0===t&&(t=[]);var l=V(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=y(l),i=n?[r].concat(r.visualViewport||[],D(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(M(I(i)))}function W(e){return["table","td","th"].indexOf(q(e))>=0}function $(e){return O(e)&&"fixed"!==B(e).position?e.offsetParent:null}function H(e){for(var t=y(e),a=$(e);a&&W(a)&&"static"===B(a).position;)a=$(a);return a&&("html"===q(a)||"body"===q(a)&&"static"===B(a).position)?t:a||function(e){var t=/firefox/i.test(T());if(/Trident/i.test(T())&&O(e)&&"fixed"===B(e).position)return null;var a=I(e);for(w(a)&&(a=a.host);O(a)&&["html","body"].indexOf(q(a))<0;){var l=B(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var N="top",F="bottom",z="right",G="left",U="auto",K=[N,F,z,G],X="start",Y="end",J="clippingParents",Q="viewport",Z="popper",ee="reference",te=K.reduce((function(e,t){return e.concat([t+"-"+X,t+"-"+Y])}),[]),ae=[].concat(K,[U]).reduce((function(e,t){return e.concat([t,t+"-"+X,t+"-"+Y])}),[]),le=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ne(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ie(e,t,a){return t===Q?re(function(e,t){var a=y(e),l=A(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=k();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+C(e),y:u}}(e,a)):_(t)?function(e,t){var a=E(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):re(function(e){var t,a=A(e),l=P(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=x(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=x(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+C(e),u=-l.scrollTop;return"rtl"===B(n||a).direction&&(o+=x(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(A(e)))}function oe(e){var t=M(I(e)),a=["absolute","fixed"].indexOf(B(e).position)>=0&&O(e)?H(e):e;return _(a)?t.filter((function(e){return _(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&w(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==q(e)})):[]}function ue(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function ce(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function de(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ue(n):null,i=n?se(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case N:t={x:o,y:a.y-l.height};break;case F:t={x:o,y:a.y+a.height};break;case z:t={x:a.x+a.width,y:u};break;case G:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ce(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case X:t[s]=t[s]-(a[c]/2-l[c]/2);break;case Y:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function pe(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,i=l.strategy,o=void 0===i?e.strategy:i,u=l.boundary,s=void 0===u?J:u,c=l.rootBoundary,d=void 0===c?Q:c,p=l.elementContext,v=void 0===p?Z:p,f=l.altBoundary,h=void 0!==f&&f,g=l.padding,m=void 0===g?0:g,b=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof m?m:(a=m,K.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===Z?ee:Z,O=e.rects.popper,w=e.elements[h?y:v],L=function(e,t,a,l){var n="clippingParents"===t?oe(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=ie(e,a,l);return t.top=x(n.top,t.top),t.right=S(n.right,t.right),t.bottom=S(n.bottom,t.bottom),t.left=x(n.left,t.left),t}),ie(e,i,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(_(w)?w:w.contextElement||A(e.elements.popper),s,d,o),T=E(e.elements.reference),k=de({reference:T,element:O,strategy:"absolute",placement:r}),P=re(Object.assign({},O,k)),q=v===Z?P:T,C={top:L.top-q.top+b.top,bottom:q.bottom-L.bottom+b.bottom,left:L.left-q.left+b.left,right:q.right-L.right+b.right},B=e.modifiersData.offset;if(v===Z&&B){var D=B[r];Object.keys(C).forEach((function(e){var t=[z,F].indexOf(e)>=0?1:-1,a=[N,F].indexOf(e)>=0?"y":"x";C[e]+=D[a]*t}))}return C}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function fe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(Oe,fe,we):_e(v?Oe:ge,fe,v?we:me);w[O]=xe,q[O]=xe-fe}t.modifiersData[l]=q}},requiresIfExists:["offset"]},we={left:"right",right:"left",bottom:"top",top:"bottom"};function xe(e){return e.replace(/left|right|bottom|top/g,(function(e){return we[e]}))}var Se={start:"end",end:"start"};function Le(e){return e.replace(/start|end/g,(function(e){return Se[e]}))}function Te(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,i=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?ae:u,c=se(l),d=c?o?te:te.filter((function(e){return se(e)===c})):K,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=pe(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[ue(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ke={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,i=a.altAxis,o=void 0===i||i,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=ue(g),b=u||(m===g||!f?[xe(g)]:function(e){if(ue(e)===U)return[];var t=xe(e);return[Le(e),t,Le(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(ue(a)===U?Te(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),_=t.rects.reference,O=t.rects.popper,w=new Map,x=!0,S=y[0],L=0;L=0,q=P?"width":"height",A=pe(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?z:G:E?F:N;_[q]>O[q]&&(C=xe(C));var B=xe(C),D=[];if(r&&D.push(A[k]<=0),o&&D.push(A[C]<=0,A[B]<=0),D.every((function(e){return e}))){S=T,x=!1;break}w.set(T,D)}if(x)for(var j=function(e){var t=y.find((function(t){var a=w.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},R=f?3:1;R>0;R--){if("break"===j(R))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ee(a,n,r){const{disabled:s,appendTo:c,appendToBody:d,openDirection:v}=e(a),f=t().proxy,h=r.multiselect,g=r.dropdown,m=l(!1),b=l(null),y=l(null),_=p((()=>c.value||d.value)),O=p((()=>"top"===v.value&&"bottom"===y.value||"bottom"===v.value&&"top"!==y.value?"bottom":"top")),w=()=>{if(!b.value)return;let e=parseInt(window.getComputedStyle(g.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(g.value).borderBottomWidth.replace("px",""));b.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===O.value?e:t)]}}]}))),b.value.update()},x=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return o((()=>{_.value&&(b.value=ye(h.value,g.value,{strategy:x(h.value)?"fixed":void 0,placement:v.value,modifiers:[Oe,ke,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){y.value=e.placement}}]}))})),u((()=>{_.value&&b.value&&(b.value.destroy(),b.value=null)})),{popper:b,isOpen:m,open:()=>{m.value||s.value||(m.value=!0,n.emit("open",f),_.value&&i((()=>{w()})))},close:()=>{m.value&&(m.value=!1,n.emit("close",f))},placement:O,updatePopper:w}}function Pe(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,v=n.isOpen,f=n.wrapper,h=n.tags,g=l(!1),m=l(!1),b=p((()=>r.value||i.value?-1:0)),y=()=>{r.value&&u.value.blur(),f.value.blur()},_=(e=!0)=>{i.value||(g.value=!0,e&&s())},O=()=>{g.value=!1,setTimeout((()=>{g.value||(c(),o.value&&d())}),1)};return{tabindex:b,isActive:g,mouseClicked:m,blur:y,focus:()=>{r.value&&!i.value&&u.value.focus()},activate:_,deactivate:O,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||_(m.value)},handleFocusOut:()=>{O()},handleCaretClick:()=>{O(),y()},handleMousedown:e=>{m.value=!0,v.value&&(e.target.isEqualNode(f.value)||e.target.isEqualNode(h.value))?setTimeout((()=>{O()}),0):v.value||!document.activeElement.isEqualNode(f.value)&&!document.activeElement.isEqualNode(u.value)||_(),setTimeout((()=>{m.value=!1}),0)}}}function qe(a,l,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:v,createTag:f,createOption:h,reverse:g}=e(a),m=t().proxy,b=n.iv,y=n.update,_=n.deselect,O=n.search,w=n.setPointer,x=n.selectPointer,S=n.backwardPointer,L=n.forwardPointer,T=n.multiselect,k=n.wrapper,E=n.tags,P=n.isOpen,q=n.open,A=n.blur,C=n.fo,B=p((()=>f.value||h.value||!1)),D=p((()=>void 0!==i.value?i.value:void 0!==v.value?v.value:["enter"])),j=()=>{"tags"===r.value&&!s.value&&B.value&&u.value&&!d.value&&w(C.value[C.value.map((e=>e[c.value])).indexOf(O.value)])};return{handleKeydown:e=>{let t,a;switch(l.emit("keydown",e,m),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...T.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==E.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(O.value))return;if(0===b.value.length)return;let l=b.value.filter((e=>!e.disabled&&!1!==e.remove));l.length&&_(l[l.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==a&&void 0!==a)return y([...b.value].filter(((e,t)=>t!==a))),void(a===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?E.value.querySelector("input").focus():k.value.focus()));if(-1===D.value.indexOf("enter")&&B.value)return;j(),x();break;case" ":if(!B.value&&!u.value)return e.preventDefault(),j(),void x();if(!B.value)return!1;if(-1===D.value.indexOf("space")&&B.value)return;e.preventDefault(),j(),x();break;case"Tab":case";":case",":if(-1===D.value.indexOf(e.key.toLowerCase())||!B.value)return;j(),x(),e.preventDefault();break;case"Escape":A();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;P.value||q(),S();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;P.value||q(),L();break;case"ArrowLeft":if(u.value&&E.value&&E.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!b.value||!b.value.length)return;e.preventDefault(),-1===a?t[t.length-1].focus():a>0&&t[a-1].focus();break;case"ArrowRight":if(-1===a||e.shiftKey||"tags"!==r.value||!b.value||!b.value.length)return;e.preventDefault(),t.length>a+1?t[a+1].focus():u.value?E.value.querySelector("input").focus():u.value||k.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,m)},preparePointer:j}}function Ae(t,a,l){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,d=l.isSelected,v=l.isDisabled,f=l.isActive,h=l.canPointGroups,g=l.resolving,m=l.fo,b=l.placement,y=p((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),_=p((()=>!!(s.value&&o.value&&(!g.value||g.value&&m.value.length))));return{classList:n((()=>{const e=y.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(_.value&&"top"===b.value?e.containerOpenTop:[]).concat(_.value&&"top"!==b.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===b.value?e.dropdownTop:[]).concat(s.value&&o.value&&_.value?[]:e.dropdownHidden),options:[e.options].concat("top"===b.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&h.value?a.push(v(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):v(t)&&a.push(e.groupLabelDisabled),h.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(v(t)?e.optionSelectedDisabled:e.optionSelected):(v(t)||a&&v(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:_}}function Ce(t,a,n){const{limit:u,infinite:c}=e(t),d=n.isOpen,v=n.offset,f=n.search,h=n.pfo,g=n.eo,m=l(null),b=s(null),y=p((()=>v.value{const{isIntersecting:t,target:a}=e[0];if(t){const e=a.offsetParent,t=e.scrollTop;v.value+=-1==u.value?10:u.value,i((()=>{e.scrollTop=t}))}},O=()=>{d.value&&v.value{c.value&&O()})),r(f,(()=>{c.value&&(v.value=u.value,O())}),{flush:"post"}),r(g,(()=>{c.value&&O()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(m.value=new IntersectionObserver(_))})),{hasMore:y,infiniteLoader:b}}function Be(t,a,r){const{placeholder:i,id:u,valueProp:s,label:c,mode:d,groupLabel:v,aria:f,searchable:h}=e(t),g=r.pointer,m=r.iv,b=r.hasSelected,y=r.multipleLabelText,_=l(null),O=p((()=>(u.value?u.value+"-":"")+"assist")),w=p((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=p((()=>{if(g.value){let e=u.value?`${u.value}-`:"";return e+=(g.value.group?"multiselect-group":"multiselect-option")+"-",e+=g.value.group?g.value.index:g.value[s.value],e}})),S=p((()=>i.value)),L=p((()=>"single"!==d.value)),T=n((()=>"single"===d.value&&b.value?m.value[c.value]:"multiple"===d.value&&b.value?y.value:"tags"===d.value&&b.value?m.value.map((e=>e[c.value])).join(", "):"")),k=n((()=>{let e={...f.value};return h.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${O.value} ${e["aria-labelledby"]}`:O.value,T.value&&e["aria-label"]&&(e["aria-label"]=`${T.value}, ${e["aria-label"]}`)),e}));return o((()=>{if(u.value&&document&&document.querySelector){let e=document.querySelector(`[for="${u.value}"]`);_.value=e?e.innerText:null}})),{arias:k,ariaLabel:T,ariaAssist:O,ariaControls:w,ariaPlaceholder:S,ariaMultiselectable:L,ariaActiveDescendant:x,ariaOptionId:e=>`${u.value?u.value+"-":""}multiselect-option-${e[s.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${u.value?u.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function De(t,a,l){const{locale:n,fallbackLocale:r}=e(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function je(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}function Re(e,t,a,l,n,r,i,o,u,s){"boolean"!=typeof i&&(u=o,o=i,i=!1);const c="function"==typeof a?a.options:a;let d;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=d):t&&(d=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),d)if(c.functional){const e=c.render;c.render=function(t,a){return d.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,d):[d]}return a}const Ie={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[je,De,v,h,Ee,f,d,Pe,m,Ce,b,qe,Ae,Be]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};var Ve=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"multiselect",class:e.classList.container,attrs:{id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut,keyup:e.handleKeyup,keydown:e.handleKeydown}},[a("div",e._b({ref:"wrapper",class:e.classList.wrapper,attrs:{tabindex:e.tabindex,"aria-controls":e.searchable?void 0:e.ariaControls,"aria-placeholder":e.searchable?void 0:e.ariaPlaceholder,"aria-expanded":e.searchable?void 0:e.isOpen,"aria-activedescendant":e.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:e.ariaMultiselectable,role:e.searchable?void 0:"combobox"},on:{mousedown:e.handleMousedown}},"div",e.searchable?{}:e.arias,!1),["tags"!==e.mode&&e.searchable&&!e.disabled?[a("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1))]:e._e(),e._v(" "),"tags"==e.mode?[a("div",{class:e.classList.tags,attrs:{"data-tags":""}},[e._l(e.iv,(function(t,l,n){return e._t("tag",(function(){return[a("span",{key:n,class:[e.classList.tag,t.disabled?e.classList.tagDisabled:null],attrs:{tabindex:"-1","aria-label":e.ariaTagLabel(e.localize(t[e.label]))},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagWrapper},[e._v(e._s(e.localize(t[e.label])))]),e._v(" "),e.disabled||t.disabled?e._e():a("span",{class:e.classList.tagRemove,on:{click:function(a){return a.stopPropagation(),e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagRemoveIcon})])])]}),{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),a("div",{ref:"tags",class:e.classList.tagsSearchWrapper},[a("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?a("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",(function(){return[a("div",{class:e.classList.singleLabel},[a("span",{class:e.classList.singleLabelText},[e._v(e._s(e.localize(e.iv[e.label])))])])]}),{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",(function(){return[a("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})]}),{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",(function(){return[a("div",{class:e.classList.placeholder,attrs:{"aria-hidden":"true"}},[e._v("\n "+e._s(e.placeholder)+"\n ")])]}))],e._v(" "),e.loading||e.resolving?e._t("spinner",(function(){return[a("span",{class:e.classList.spinner,attrs:{"aria-hidden":"true"}})]})):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",(function(){return[a("span",{class:e.classList.clear,attrs:{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎"},on:{click:e.clear,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clear.apply(null,arguments)}}},[a("span",{class:e.classList.clearIcon})])]}),{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",(function(){return[a("span",{class:e.classList.caret,attrs:{"aria-hidden":"true"},on:{click:e.handleCaretClick}})]}),{handleCaretClick:e.handleCaretClick,isOpen:e.isOpen}):e._e()],2),e._v(" "),a("Teleport",{attrs:{to:e.appendTo||"body",disabled:!e.appendToBody&&!e.appendTo}},[a("div",{ref:"dropdown",class:e.classList.dropdown,attrs:{id:e.id?e.id+"-dropdown":void 0,tabindex:"-1"},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),a("ul",{class:e.classList.options,attrs:{id:e.ariaControls,role:"listbox"}},[e.groups?e._l(e.fg,(function(t,l,n){return a("li",{key:n,class:e.classList.group,attrs:{id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),"aria-selected":e.isSelected(t),role:"option"}},[t.__CREATE__?e._e():a("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(a){return e.setPointer(t,l)},click:function(a){return e.handleGroupClick(t)}}},[e._t("grouplabel",(function(){return[a("span",{domProps:{innerHTML:e._s(e.localize(t[e.groupLabel]))}})]}),{group:t,isSelected:e.isSelected,isPointed:e.isPointed})],2),e._v(" "),a("ul",{class:e.classList.groupOptions,attrs:{"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),role:"group"}},e._l(t.__VISIBLE__,(function(l,n,r){return a("li",{key:r,class:e.classList.option(l,t),attrs:{"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[e.label])),role:"option"},on:{mouseenter:function(t){return e.setPointer(l)},click:function(t){return e.handleOptionClick(l)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(l[e.label])))])]}),{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,l,n){return a("li",{key:n,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[e.label])),role:"option"},on:{mouseenter:function(a){return e.setPointer(t)},click:function(a){return e.handleOptionClick(t)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(t[e.label])))])]}),{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",(function(){return[a("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.localize(e.noOptionsText))}})]})):e._e(),e._v(" "),e.noResults?e._t("noresults",(function(){return[a("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.localize(e.noResultsText))}})]})):e._e(),e._v(" "),e.infinite&&e.hasMore?a("div",{ref:"infiniteLoader",class:e.classList.inifinite},[e._t("infinite",(function(){return[a("span",{class:e.classList.inifiniteSpinner})]}))],2):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2)]),e._v(" "),e.required?a("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?a("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,l){return a("input",{key:l,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),e.searchable&&e.hasSelected?a("div",{class:e.classList.assist,attrs:{id:e.ariaAssist,"aria-hidden":"true"}},[e._v("\n "+e._s(e.ariaLabel)+"\n ")]):e._e(),e._v(" "),a("div",{class:e.classList.spacer})],2)};Ve._withStripped=!0;const Me=Re({render:Ve,staticRenderFns:[]},undefined,Ie,undefined,false,undefined,!1,void 0,void 0,void 0);export{Me as default}; diff --git a/package.json b/package.json index 1788992..1a90f91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vueform/multiselect", - "version": "2.6.8", + "version": "2.6.9", "private": false, "description": "Vue 3 multiselect component with single select, multiselect and tagging options.", "license": "MIT",