From e07dad60cf924a711902c0220243578c67ffed35 Mon Sep 17 00:00:00 2001 From: Adam Berecz Date: Sat, 23 Nov 2024 17:14:58 +0100 Subject: [PATCH] chore: cl, version, build --- CHANGELOG.md | 7 +++++++ dist/multiselect.global.js | 2 +- dist/multiselect.js | 11 ++++++++--- dist/multiselect.min.js | 2 +- dist/multiselect.mjs | 11 ++++++++--- dist/multiselect.vue2.global.js | 2 +- dist/multiselect.vue2.js | 11 ++++++++--- dist/multiselect.vue2.min.js | 2 +- package.json | 2 +- 9 files changed, 36 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56f2967..f7cefa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## v2.6.11 + +> `2024-11-23` + +### 🐞 Bug Fixes + - Don't throw error when endpoint type `options` is undefined + ## v2.6.10 > `2024-09-16` diff --git a/dist/multiselect.global.js b/dist/multiselect.global.js index 5af540e..da4736d 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,"")}const u=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!u(e[n],t[n]))return!1}return!0};function s(a,n,r){const{options:o,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:m,appendNewTag:h,appendNewOption:g,multipleLabel:b,object:y,loading:w,delay:O,resolveOnLoad:x,minChars:k,filterResults:S,clearOnSearch:C,clearOnSelect:L,valueProp:E,allowAbsent:B,groupLabel:T,canDeselect:V,max:_,strict:q,closeOnSelect:P,closeOnDeselect:N,groups:D,reverse:A,infinite:R,groupOptions:I,groupHideEmpty:j,groupSelect:M,onCreate:z,disabledProp:$,searchStart:W,searchFilter:H}=e.toRefs(a),F=e.getCurrentInstance().proxy,K=r.iv,G=r.ev,U=r.search,X=r.clearSearch,Y=r.update,J=r.pointer,Q=r.setPointer,Z=r.clearPointer,ee=r.focus,te=r.deactivate,ae=r.close,le=r.localize,ne=e.ref([]),re=e.ref([]),oe=e.ref(!1),ie=e.ref(null),ue=e.ref(R.value&&-1===d.value?10:d.value),se=e.computed({get:()=>re.value,set:e=>re.value=e}),ce=l((()=>v.value||f.value||!1)),de=l((()=>void 0!==h.value?h.value:void 0===g.value||g.value)),pe=e.computed((()=>{if(D.value){let e=me.value||[],t=[];return e.forEach((e=>{We(e[I.value]).forEach((a=>{t.push(Object.assign({},a,e[$.value]?{[$.value]:!0}:{}))}))})),t}{let e=We(re.value||[]);return ne.value.length&&(e=e.concat(ne.value)),e}})),ve=e.computed((()=>{let e=pe.value;return A.value&&(e=e.reverse()),xe.value.length&&(e=xe.value.concat(e)),$e(e)})),fe=e.computed((()=>{let e=ve.value;return ue.value>0&&(e=e.slice(0,ue.value)),e})),me=e.computed((()=>{if(!D.value)return[];let e=[],t=re.value||[];return ne.value.length&&e.push({[T.value]:" ",[I.value]:[...ne.value],__CREATE__:!0}),e.concat(t)})),he=e.computed((()=>{let e=[...me.value].map((e=>({...e})));return xe.value.length&&(e[0]&&e[0].__CREATE__?e[0][I.value]=[...xe.value,...e[0][I.value]]:e=[{[T.value]:" ",[I.value]:[...xe.value],__CREATE__:!0}].concat(e)),e})),ge=e.computed((()=>{if(!D.value)return[];let e=he.value;return ze((e||[]).map(((e,t)=>{const a=We(e[I.value]);return{...e,index:t,group:!0,[I.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}:{})))}})))})),be=e.computed((()=>{switch(s.value){case"single":return!t(K.value[E.value]);case"multiple":case"tags":return!t(K.value)&&K.value.length>0}})),ye=e.computed((()=>void 0!==b.value?b.value(K.value,F):K.value&&K.value.length>1?`${K.value.length} options selected`:"1 option selected")),we=l((()=>!pe.value.length&&!oe.value&&!xe.value.length)),Oe=l((()=>pe.value.length>0&&0==fe.value.length&&(U.value&&D.value||!D.value))),xe=e.computed((()=>!1!==ce.value&&U.value?-1!==je(U.value)?[]:[{[E.value]:U.value,[ke.value[0]]:U.value,[m.value]:U.value,__CREATE__:!0}]:[])),ke=e.computed((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[m.value])),Se=l((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Ce=l((()=>w.value||oe.value)),Le=e=>{switch("object"!=typeof e&&(e=Ie(e)),s.value){case"single":Y(e);break;case"multiple":case"tags":Y(K.value.concat(e))}n.emit("select",Be(e),e,F)},Ee=e=>{switch("object"!=typeof e&&(e=Ie(e)),s.value){case"single":Ve();break;case"tags":case"multiple":Y(Array.isArray(e)?K.value.filter((t=>-1===e.map((e=>e[E.value])).indexOf(t[E.value]))):K.value.filter((t=>t[E.value]!=e[E.value])))}n.emit("deselect",Be(e),e,F)},Be=e=>y.value?e:e[E.value],Te=e=>{Ee(e)},Ve=()=>{Y(Se.value),n.emit("clear",F)},_e=e=>{if(void 0!==e.group)return"single"!==s.value&&(Re(e[I.value])&&e[I.value].length);switch(s.value){case"single":return!t(K.value)&&(K.value[E.value]==e[E.value]||"object"==typeof K.value[E.value]&&"object"==typeof e[E.value]&&u(K.value[E.value],e[E.value]));case"tags":case"multiple":return!t(K.value)&&-1!==K.value.map((e=>e[E.value])).indexOf(e[E.value])}},qe=e=>!0===e[$.value],Pe=()=>!(void 0===_||-1===_.value||!be.value&&_.value>0)&&K.value.length>=_.value,Ne=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&_e(e))return V.value&&Ee(e),void(N.value&&(Z(),ae()));e&&De(e),L.value&&X(),P.value&&(Z(),ae()),e&&Le(e);break;case"multiple":if(e&&_e(e))return Ee(e),void(N.value&&(Z(),ae()));if(Pe())return void n.emit("max",F);e&&(De(e),Le(e)),L.value&&X(),p.value&&Z(),P.value&&ae();break;case"tags":if(e&&_e(e))return Ee(e),void(N.value&&(Z(),ae()));if(Pe())return void n.emit("max",F);e&&De(e),L.value&&X(),e&&Le(e),p.value&&Z(),P.value&&ae()}P.value||ee()},De=e=>{void 0===Ie(e[E.value])&&ce.value&&(n.emit("tag",e[E.value],F),n.emit("option",e[E.value],F),n.emit("create",e[E.value],F),de.value&&Me(e),X())},Ae=e=>void 0===e.find((e=>!_e(e)&&!e[$.value])),Re=e=>void 0===e.find((e=>!_e(e))),Ie=e=>pe.value[pe.value.map((e=>String(e[E.value]))).indexOf(String(e))],je=e=>pe.value.findIndex((t=>ke.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Me=e=>{ne.value.push(e)},ze=e=>j.value?e.filter((e=>U.value?e.__VISIBLE__.length:e[I.value].length)):e.filter((e=>!U.value||e.__VISIBLE__.length)),$e=(e,t=!0)=>{let a=e;if(U.value&&S.value){let e=H.value;e||(e=(e,t,a)=>ke.value.some((a=>{let l=i(le(e[a]),q.value);return W.value?l.startsWith(i(t,q.value)):-1!==l.indexOf(i(t,q.value))}))),a=a.filter((t=>e(t,U.value,F)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&_e(e))(e)))),a},We=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{[E.value]:e,[ke.value[0]]:a,[m.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[E.value]:e,[ke.value[0]]:e,[m.value]:e})),t},He=()=>{t(G.value)||(K.value=Ge(G.value))},Fe=e=>(oe.value=!0,new Promise(((t,a)=>{o.value(U.value,F).then((t=>{re.value=t||[],"function"==typeof e&&e(t),oe.value=!1})).catch((e=>{console.error(e),re.value=[],oe.value=!1})).finally((()=>{t()}))}))),Ke=()=>{if(be.value)if("single"===s.value){let e=Ie(K.value[E.value]);if(void 0!==e){let t=e[m.value];K.value[m.value]=t,y.value&&(G.value[m.value]=t)}}else K.value.forEach(((e,t)=>{let a=Ie(K.value[t][E.value]);if(void 0!==a){let e=a[m.value];K.value[t][m.value]=e,y.value&&(G.value[t][m.value]=e)}}))},Ge=e=>t(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?Ie(e)||(B.value?{[m.value]:e,[E.value]:e,[ke.value[0]]:e}:{}):e.filter((e=>!!Ie(e)||B.value)).map((e=>Ie(e)||{[m.value]:e,[E.value]:e,[ke.value[0]]:e})),Ue=()=>{ie.value=e.watch(U,(e=>{e.length{e==U.value&&o.value(U.value,F).then((t=>{e!=U.value&&U.value||(re.value=t,J.value=fe.value.filter((e=>!0!==e[$.value]))[0]||null,oe.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!t(G.value)&&!Array.isArray(G.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return o&&"function"==typeof o.value?x.value?Fe(He):1==y.value&&He():(re.value=o.value,He()),O.value>-1&&Ue(),e.watch(O,((e,t)=>{ie.value&&ie.value(),e>=0&&Ue()})),e.watch(G,(e=>{if(t(e))Y(Ge(e),!1);else switch(s.value){case"single":(y.value?e[E.value]!=K.value[E.value]:e!=K.value[E.value])&&Y(Ge(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[E.value])):e,K.value.map((e=>e[E.value])))||Y(Ge(e),!1)}}),{deep:!0}),e.watch(o,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Fe():(re.value=a.options,Object.keys(K.value).length||He(),Ke())})),e.watch(m,Ke),e.watch(d,((e,t)=>{ue.value=R.value&&-1===e?10:e})),{resolvedOptions:se,pfo:ve,fo:fe,filteredOptions:fe,hasSelected:be,multipleLabelText:ye,eo:pe,extendedOptions:pe,eg:me,extendedGroups:me,fg:ge,filteredGroups:ge,noOptions:we,noResults:Oe,resolving:oe,busy:Ce,offset:ue,select:Le,deselect:Ee,remove:Te,selectAll:()=>{"single"!==s.value&&Le(fe.value.filter((e=>!e.disabled&&!_e(e))))},clear:Ve,isSelected:_e,isDisabled:qe,isMax:Pe,getOption:Ie,handleOptionClick:e=>{if(!qe(e))return z.value&&!_e(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=z.value(e,F))instanceof Promise)?(oe.value=!0,void e.then((e=>{oe.value=!1,Ne(e)}))):void Ne(e)},handleGroupClick:e=>{if(!qe(e)&&"single"!==s.value&&M.value){switch(s.value){case"multiple":case"tags":Ae(e[I.value])?Ee(e[I.value]):Le(e[I.value].filter((e=>-1===K.value.map((e=>e[E.value])).indexOf(e[E.value]))).filter((e=>!e[$.value])).filter(((e,t)=>K.value.length+1+t<=_.value||-1===_.value))),p.value&&J.value&&Q(ge.value.filter((e=>!e[$.value]))[J.value.index])}P.value&&te()}},handleTagRemove:(e,t)=>{0===t.button?Te(e):t.preventDefault()},refreshOptions:e=>{Fe(e)},resolveOptions:Fe,refreshLabels:Ke}}function c(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,O=n.clearPointer,x=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=x.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():O())})),e.watch(k,(t=>{if(t&&x&&x.value){let t=x.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 d(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function p(e){return e instanceof d(e).Element||e instanceof Element}function v(e){return e instanceof d(e).HTMLElement||e instanceof HTMLElement}function f(e){return"undefined"!=typeof ShadowRoot&&(e instanceof d(e).ShadowRoot||e instanceof ShadowRoot)}var m=Math.max,h=Math.min,g=Math.round;function b(){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 y(){return!/^((?!chrome|android).)*safari/i.test(b())}function w(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&v(e)&&(n=e.offsetWidth>0&&g(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&g(l.height)/e.offsetHeight||1);var o=(p(e)?d(e):window).visualViewport,i=!y()&&a,u=(l.left+(i&&o?o.offsetLeft:0))/n,s=(l.top+(i&&o?o.offsetTop:0))/r,c=l.width/n,f=l.height/r;return{width:c,height:f,top:s,right:u+c,bottom:s+f,left:u,x:u,y:s}}function O(e){var t=d(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(e){return e?(e.nodeName||"").toLowerCase():null}function k(e){return((p(e)?e.ownerDocument:e.document)||window.document).documentElement}function S(e){return w(k(e)).left+O(e).scrollLeft}function C(e){return d(e).getComputedStyle(e)}function L(e){var t=C(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function E(e,t,a){void 0===a&&(a=!1);var l,n,r=v(t),o=v(t)&&function(e){var t=e.getBoundingClientRect(),a=g(t.width)/e.offsetWidth||1,l=g(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),i=k(t),u=w(e,o,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==x(t)||L(i))&&(s=(l=t)!==d(l)&&v(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:O(l)),v(t)?((c=w(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=S(i))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function B(e){var t=w(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 T(e){return"html"===x(e)?e:e.assignedSlot||e.parentNode||(f(e)?e.host:null)||k(e)}function V(e){return["html","body","#document"].indexOf(x(e))>=0?e.ownerDocument.body:v(e)&&L(e)?e:V(T(e))}function _(e,t){var a;void 0===t&&(t=[]);var l=V(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=d(l),o=n?[r].concat(r.visualViewport||[],L(l)?l:[]):l,i=t.concat(o);return n?i:i.concat(_(T(o)))}function q(e){return["table","td","th"].indexOf(x(e))>=0}function P(e){return v(e)&&"fixed"!==C(e).position?e.offsetParent:null}function N(e){for(var t=d(e),a=P(e);a&&q(a)&&"static"===C(a).position;)a=P(a);return a&&("html"===x(a)||"body"===x(a)&&"static"===C(a).position)?t:a||function(e){var t=/firefox/i.test(b());if(/Trident/i.test(b())&&v(e)&&"fixed"===C(e).position)return null;var a=T(e);for(f(a)&&(a=a.host);v(a)&&["html","body"].indexOf(x(a))<0;){var l=C(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 D="top",A="bottom",R="right",I="left",j="auto",M=[D,A,R,I],z="start",$="end",W="clippingParents",H="viewport",F="popper",K="reference",G=M.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+$])}),[]),U=[].concat(M,[j]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+$])}),[]),X=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Y(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 J(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Q(e,t,a){return t===H?J(function(e,t){var a=d(e),l=k(e),n=a.visualViewport,r=l.clientWidth,o=l.clientHeight,i=0,u=0;if(n){r=n.width,o=n.height;var s=y();(s||!s&&"fixed"===t)&&(i=n.offsetLeft,u=n.offsetTop)}return{width:r,height:o,x:i+S(e),y:u}}(e,a)):p(t)?function(e,t){var a=w(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):J(function(e){var t,a=k(e),l=O(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=m(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=m(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),i=-l.scrollLeft+S(e),u=-l.scrollTop;return"rtl"===C(n||a).direction&&(i+=m(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:o,x:i,y:u}}(k(e)))}function Z(e){var t=_(T(e)),a=["absolute","fixed"].indexOf(C(e).position)>=0&&v(e)?N(e):e;return p(a)?t.filter((function(e){return p(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&f(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 ee(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function ae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function le(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ee(n):null,o=n?te(n):null,i=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case D:t={x:i,y:a.y-l.height};break;case A:t={x:i,y:a.y+a.height};break;case R:t={x:a.x+a.width,y:u};break;case I:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ae(r):null;if(null!=s){var c="y"===s?"height":"width";switch(o){case z: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 ne(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?W:u,c=l.rootBoundary,d=void 0===c?H:c,v=l.elementContext,f=void 0===v?F:v,g=l.altBoundary,b=void 0!==g&&g,y=l.padding,O=void 0===y?0:y,x=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof O?O:(a=O,M.reduce((function(e,t){return e[t]=a,e}),{}))),S=f===F?K:F,C=e.rects.popper,L=e.elements[b?S:f],E=function(e,t,a,l){var n="clippingParents"===t?Z(e):[].concat(t),r=[].concat(n,[a]),o=r[0],i=r.reduce((function(t,a){var n=Q(e,a,l);return t.top=m(n.top,t.top),t.right=h(n.right,t.right),t.bottom=h(n.bottom,t.bottom),t.left=m(n.left,t.left),t}),Q(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}(p(L)?L:L.contextElement||k(e.elements.popper),s,d,i),B=w(e.elements.reference),T=le({reference:B,element:C,strategy:"absolute",placement:r}),V=J(Object.assign({},C,T)),_=f===F?V:B,q={top:E.top-_.top+x.top,bottom:_.bottom-E.bottom+x.bottom,left:E.left-_.left+x.left,right:_.right-E.right+x.right},P=e.modifiersData.offset;if(f===F&&P){var N=P[r];Object.keys(q).forEach((function(e){var t=[R,A].indexOf(e)>=0?1:-1,a=[D,A].indexOf(e)>=0?"y":"x";q[e]+=N[a]*t}))}return q}var re={placement:"bottom",modifiers:[],strategy:"absolute"};function oe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(Oe,me,xe):pe(v?Oe:ge,me,v?xe:be);S[k]=ke,_[k]=ke-me}t.modifiersData[l]=_}},requiresIfExists:["offset"]},fe={left:"right",right:"left",bottom:"top",top:"bottom"};function me(e){return e.replace(/left|right|bottom|top/g,(function(e){return fe[e]}))}var he={start:"end",end:"start"};function ge(e){return e.replace(/start|end/g,(function(e){return he[e]}))}function be(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?U:u,c=te(l),d=c?i?G:G.filter((function(e){return te(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]=ne(e,{placement:a,boundary:n,rootBoundary:r,padding:o})[ee(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ye={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=ee(h),b=u||(g===h||!f?[me(h)]:function(e){if(ee(e)===j)return[];var t=me(e);return[ge(e),t,ge(t)]}(h)),y=[h].concat(b).reduce((function(e,a){return e.concat(ee(a)===j?be(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:m}):a)}),[]),w=t.rects.reference,O=t.rects.popper,x=new Map,k=!0,S=y[0],C=0;C=0,V=T?"width":"height",_=ne(t,{placement:L,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),q=T?B?R:I:B?A:D;w[V]>O[V]&&(q=me(q));var P=me(q),N=[];if(r&&N.push(_[E]<=0),i&&N.push(_[q]<=0,_[P]<=0),N.every((function(e){return e}))){S=L,k=!1;break}x.set(L,N)}if(k)for(var M=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"},$=f?3:1;$>0;$--){if("break"===M($))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(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=de(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[ve,ye,{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 Oe(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,O=n.setPointer,x=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&&O(_.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(),x();break;case" ":if(!q.value&&!u.value)return e.preventDefault(),N(),void x();if(!q.value)return!1;if(-1===P.value.indexOf("space")&&q.value)return;e.preventDefault(),N(),x();break;case"Tab":case";":case",":if(-1===P.value.indexOf(e.key.toLowerCase())||!q.value)return;N(),x(),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 ke(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 Se(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 Ce(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}})),O=l((()=>r.value)),x=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:O,ariaMultiselectable:x,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 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 Ee(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 Be={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,[Ee,Le,n,o,we,r,a,Oe,s,Se,c,xe,ke,Ce]),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 Te=["id","dir"],Ve=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],_e=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],qe=["onKeyup","aria-label"],Pe=["onClick"],Ne=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],De=["innerHTML"],Ae=["id"],Re=["id"],Ie=["id","aria-label","aria-selected"],je=["data-pointed","onMouseenter","onClick"],Me=["innerHTML"],ze=["aria-label"],$e=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],We=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],He=["innerHTML"],Fe=["innerHTML"],Ke=["value"],Ge=["name","value"],Ue=["name","value"],Xe=["id"];return Be.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,_e)):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,Pe))],42,qe))])))),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,Ne)):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,De)])):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,Ve),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,Me)]))],42,je)),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,$e)))),128))],10,ze)],10,Ie)))),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,We)))),128))],10,Re),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,He)])):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,Fe)])):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,Ae)],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,Ke)):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,Ge)):(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,Ue)))),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,Xe)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Create height for empty input "),e.createElementVNode("div",{class:e.normalizeClass(t.classList.spacer)},null,2)],42,Te)},Be.__file="src/Multiselect.vue",Be}(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,"")}const u=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!u(e[n],t[n]))return!1}return!0};function s(a,n,r){const{options:o,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:m,appendNewTag:h,appendNewOption:g,multipleLabel:b,object:y,loading:w,delay:O,resolveOnLoad:x,minChars:k,filterResults:S,clearOnSearch:C,clearOnSelect:L,valueProp:E,allowAbsent:B,groupLabel:T,canDeselect:V,max:_,strict:q,closeOnSelect:P,closeOnDeselect:N,groups:A,reverse:D,infinite:R,groupOptions:I,groupHideEmpty:j,groupSelect:M,onCreate:z,disabledProp:$,searchStart:W,searchFilter:H}=e.toRefs(a),F=e.getCurrentInstance().proxy,K=r.iv,G=r.ev,U=r.search,X=r.clearSearch,Y=r.update,J=r.pointer,Q=r.setPointer,Z=r.clearPointer,ee=r.focus,te=r.deactivate,ae=r.close,le=r.localize,ne=e.ref([]),re=e.ref([]),oe=e.ref(!1),ie=e.ref(null),ue=e.ref(R.value&&-1===d.value?10:d.value),se=e.computed({get:()=>re.value,set:e=>re.value=e}),ce=l((()=>v.value||f.value||!1)),de=l((()=>void 0!==h.value?h.value:void 0===g.value||g.value)),pe=e.computed((()=>{if(A.value){let e=me.value||[],t=[];return e.forEach((e=>{We(e[I.value]).forEach((a=>{t.push(Object.assign({},a,e[$.value]?{[$.value]:!0}:{}))}))})),t}{let e=We(re.value||[]);return ne.value.length&&(e=e.concat(ne.value)),e}})),ve=e.computed((()=>{let e=pe.value;return D.value&&(e=e.reverse()),xe.value.length&&(e=xe.value.concat(e)),$e(e)})),fe=e.computed((()=>{let e=ve.value;return ue.value>0&&(e=e.slice(0,ue.value)),e})),me=e.computed((()=>{if(!A.value)return[];let e=[],t=re.value||[];return ne.value.length&&e.push({[T.value]:" ",[I.value]:[...ne.value],__CREATE__:!0}),e.concat(t)})),he=e.computed((()=>{let e=[...me.value].map((e=>({...e})));return xe.value.length&&(e[0]&&e[0].__CREATE__?e[0][I.value]=[...xe.value,...e[0][I.value]]:e=[{[T.value]:" ",[I.value]:[...xe.value],__CREATE__:!0}].concat(e)),e})),ge=e.computed((()=>{if(!A.value)return[];let e=he.value;return ze((e||[]).map(((e,t)=>{const a=We(e[I.value]);return{...e,index:t,group:!0,[I.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}:{})))}})))})),be=e.computed((()=>{switch(s.value){case"single":return!t(K.value[E.value]);case"multiple":case"tags":return!t(K.value)&&K.value.length>0}})),ye=e.computed((()=>void 0!==b.value?b.value(K.value,F):K.value&&K.value.length>1?`${K.value.length} options selected`:"1 option selected")),we=l((()=>!pe.value.length&&!oe.value&&!xe.value.length)),Oe=l((()=>pe.value.length>0&&0==fe.value.length&&(U.value&&A.value||!A.value))),xe=e.computed((()=>!1!==ce.value&&U.value?-1!==je(U.value)?[]:[{[E.value]:U.value,[ke.value[0]]:U.value,[m.value]:U.value,__CREATE__:!0}]:[])),ke=e.computed((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[m.value])),Se=l((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Ce=l((()=>w.value||oe.value)),Le=e=>{switch("object"!=typeof e&&(e=Ie(e)),s.value){case"single":Y(e);break;case"multiple":case"tags":Y(K.value.concat(e))}n.emit("select",Be(e),e,F)},Ee=e=>{switch("object"!=typeof e&&(e=Ie(e)),s.value){case"single":Ve();break;case"tags":case"multiple":Y(Array.isArray(e)?K.value.filter((t=>-1===e.map((e=>e[E.value])).indexOf(t[E.value]))):K.value.filter((t=>t[E.value]!=e[E.value])))}n.emit("deselect",Be(e),e,F)},Be=e=>y.value?e:e[E.value],Te=e=>{Ee(e)},Ve=()=>{Y(Se.value),n.emit("clear",F)},_e=e=>{if(void 0!==e.group)return"single"!==s.value&&(Re(e[I.value])&&e[I.value].length);switch(s.value){case"single":return!t(K.value)&&(K.value[E.value]==e[E.value]||"object"==typeof K.value[E.value]&&"object"==typeof e[E.value]&&u(K.value[E.value],e[E.value]));case"tags":case"multiple":return!t(K.value)&&-1!==K.value.map((e=>e[E.value])).indexOf(e[E.value])}},qe=e=>!0===e[$.value],Pe=()=>!(void 0===_||-1===_.value||!be.value&&_.value>0)&&K.value.length>=_.value,Ne=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&_e(e))return V.value&&Ee(e),void(N.value&&(Z(),ae()));e&&Ae(e),L.value&&X(),P.value&&(Z(),ae()),e&&Le(e);break;case"multiple":if(e&&_e(e))return Ee(e),void(N.value&&(Z(),ae()));if(Pe())return void n.emit("max",F);e&&(Ae(e),Le(e)),L.value&&X(),p.value&&Z(),P.value&&ae();break;case"tags":if(e&&_e(e))return Ee(e),void(N.value&&(Z(),ae()));if(Pe())return void n.emit("max",F);e&&Ae(e),L.value&&X(),e&&Le(e),p.value&&Z(),P.value&&ae()}P.value||ee()},Ae=e=>{void 0===Ie(e[E.value])&&ce.value&&(n.emit("tag",e[E.value],F),n.emit("option",e[E.value],F),n.emit("create",e[E.value],F),de.value&&Me(e),X())},De=e=>void 0===e.find((e=>!_e(e)&&!e[$.value])),Re=e=>void 0===e.find((e=>!_e(e))),Ie=e=>pe.value[pe.value.map((e=>String(e[E.value]))).indexOf(String(e))],je=e=>pe.value.findIndex((t=>ke.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Me=e=>{ne.value.push(e)},ze=e=>j.value?e.filter((e=>U.value?e.__VISIBLE__.length:e[I.value].length)):e.filter((e=>!U.value||e.__VISIBLE__.length)),$e=(e,t=!0)=>{let a=e;if(U.value&&S.value){let e=H.value;e||(e=(e,t,a)=>ke.value.some((a=>{let l=i(le(e[a]),q.value);return W.value?l.startsWith(i(t,q.value)):-1!==l.indexOf(i(t,q.value))}))),a=a.filter((t=>e(t,U.value,F)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&_e(e))(e)))),a},We=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{[E.value]:e,[ke.value[0]]:a,[m.value]:a}}))),t=t&&Array.isArray(t)?t.map((e=>"object"==typeof e?e:{[E.value]:e,[ke.value[0]]:e,[m.value]:e})):[],t},He=()=>{t(G.value)||(K.value=Ge(G.value))},Fe=e=>(oe.value=!0,new Promise(((t,a)=>{o.value(U.value,F).then((t=>{re.value=t||[],"function"==typeof e&&e(t),oe.value=!1})).catch((e=>{console.error(e),re.value=[],oe.value=!1})).finally((()=>{t()}))}))),Ke=()=>{if(be.value)if("single"===s.value){let e=Ie(K.value[E.value]);if(void 0!==e){let t=e[m.value];K.value[m.value]=t,y.value&&(G.value[m.value]=t)}}else K.value.forEach(((e,t)=>{let a=Ie(K.value[t][E.value]);if(void 0!==a){let e=a[m.value];K.value[t][m.value]=e,y.value&&(G.value[t][m.value]=e)}}))},Ge=e=>t(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?Ie(e)||(B.value?{[m.value]:e,[E.value]:e,[ke.value[0]]:e}:{}):e.filter((e=>!!Ie(e)||B.value)).map((e=>Ie(e)||{[m.value]:e,[E.value]:e,[ke.value[0]]:e})),Ue=()=>{ie.value=e.watch(U,(e=>{e.length{e==U.value&&o.value(U.value,F).then((t=>{e!=U.value&&U.value||(re.value=t,J.value=fe.value.filter((e=>!0!==e[$.value]))[0]||null,oe.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!t(G.value)&&!Array.isArray(G.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return o&&"function"==typeof o.value?x.value?Fe(He):1==y.value&&He():(re.value=o.value,He()),O.value>-1&&Ue(),e.watch(O,((e,t)=>{ie.value&&ie.value(),e>=0&&Ue()})),e.watch(G,(e=>{if(t(e))Y(Ge(e),!1);else switch(s.value){case"single":(y.value?e[E.value]!=K.value[E.value]:e!=K.value[E.value])&&Y(Ge(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[E.value])):e,K.value.map((e=>e[E.value])))||Y(Ge(e),!1)}}),{deep:!0}),e.watch(o,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Fe():(re.value=a.options,Object.keys(K.value).length||He(),Ke())})),e.watch(m,Ke),e.watch(d,((e,t)=>{ue.value=R.value&&-1===e?10:e})),{resolvedOptions:se,pfo:ve,fo:fe,filteredOptions:fe,hasSelected:be,multipleLabelText:ye,eo:pe,extendedOptions:pe,eg:me,extendedGroups:me,fg:ge,filteredGroups:ge,noOptions:we,noResults:Oe,resolving:oe,busy:Ce,offset:ue,select:Le,deselect:Ee,remove:Te,selectAll:()=>{"single"!==s.value&&Le(fe.value.filter((e=>!e.disabled&&!_e(e))))},clear:Ve,isSelected:_e,isDisabled:qe,isMax:Pe,getOption:Ie,handleOptionClick:e=>{if(!qe(e))return z.value&&!_e(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=z.value(e,F))instanceof Promise)?(oe.value=!0,void e.then((e=>{oe.value=!1,Ne(e)}))):void Ne(e)},handleGroupClick:e=>{if(!qe(e)&&"single"!==s.value&&M.value){switch(s.value){case"multiple":case"tags":De(e[I.value])?Ee(e[I.value]):Le(e[I.value].filter((e=>-1===K.value.map((e=>e[E.value])).indexOf(e[E.value]))).filter((e=>!e[$.value])).filter(((e,t)=>K.value.length+1+t<=_.value||-1===_.value))),p.value&&J.value&&Q(ge.value.filter((e=>!e[$.value]))[J.value.index])}P.value&&te()}},handleTagRemove:(e,t)=>{0===t.button?Te(e):t.preventDefault()},refreshOptions:e=>{Fe(e)},resolveOptions:Fe,refreshLabels:Ke}}function c(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,O=n.clearPointer,x=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]})),A=e.computed((()=>[...T.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),D=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=x.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():O())})),e.watch(k,(t=>{if(t&&x&&x.value){let t=x.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=D.value,void 0===e&&(e=_.value)),w(e||null)}else if(s.value&&L.value){let e=E.value?A.value:P.value;void 0===e&&(e=E.value?T.value:B.value,e.__CREATE__&&(e=A.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 d(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function p(e){return e instanceof d(e).Element||e instanceof Element}function v(e){return e instanceof d(e).HTMLElement||e instanceof HTMLElement}function f(e){return"undefined"!=typeof ShadowRoot&&(e instanceof d(e).ShadowRoot||e instanceof ShadowRoot)}var m=Math.max,h=Math.min,g=Math.round;function b(){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 y(){return!/^((?!chrome|android).)*safari/i.test(b())}function w(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&v(e)&&(n=e.offsetWidth>0&&g(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&g(l.height)/e.offsetHeight||1);var o=(p(e)?d(e):window).visualViewport,i=!y()&&a,u=(l.left+(i&&o?o.offsetLeft:0))/n,s=(l.top+(i&&o?o.offsetTop:0))/r,c=l.width/n,f=l.height/r;return{width:c,height:f,top:s,right:u+c,bottom:s+f,left:u,x:u,y:s}}function O(e){var t=d(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(e){return e?(e.nodeName||"").toLowerCase():null}function k(e){return((p(e)?e.ownerDocument:e.document)||window.document).documentElement}function S(e){return w(k(e)).left+O(e).scrollLeft}function C(e){return d(e).getComputedStyle(e)}function L(e){var t=C(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function E(e,t,a){void 0===a&&(a=!1);var l,n,r=v(t),o=v(t)&&function(e){var t=e.getBoundingClientRect(),a=g(t.width)/e.offsetWidth||1,l=g(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),i=k(t),u=w(e,o,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==x(t)||L(i))&&(s=(l=t)!==d(l)&&v(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:O(l)),v(t)?((c=w(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=S(i))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function B(e){var t=w(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 T(e){return"html"===x(e)?e:e.assignedSlot||e.parentNode||(f(e)?e.host:null)||k(e)}function V(e){return["html","body","#document"].indexOf(x(e))>=0?e.ownerDocument.body:v(e)&&L(e)?e:V(T(e))}function _(e,t){var a;void 0===t&&(t=[]);var l=V(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=d(l),o=n?[r].concat(r.visualViewport||[],L(l)?l:[]):l,i=t.concat(o);return n?i:i.concat(_(T(o)))}function q(e){return["table","td","th"].indexOf(x(e))>=0}function P(e){return v(e)&&"fixed"!==C(e).position?e.offsetParent:null}function N(e){for(var t=d(e),a=P(e);a&&q(a)&&"static"===C(a).position;)a=P(a);return a&&("html"===x(a)||"body"===x(a)&&"static"===C(a).position)?t:a||function(e){var t=/firefox/i.test(b());if(/Trident/i.test(b())&&v(e)&&"fixed"===C(e).position)return null;var a=T(e);for(f(a)&&(a=a.host);v(a)&&["html","body"].indexOf(x(a))<0;){var l=C(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 A="top",D="bottom",R="right",I="left",j="auto",M=[A,D,R,I],z="start",$="end",W="clippingParents",H="viewport",F="popper",K="reference",G=M.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+$])}),[]),U=[].concat(M,[j]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+$])}),[]),X=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Y(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 J(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Q(e,t,a){return t===H?J(function(e,t){var a=d(e),l=k(e),n=a.visualViewport,r=l.clientWidth,o=l.clientHeight,i=0,u=0;if(n){r=n.width,o=n.height;var s=y();(s||!s&&"fixed"===t)&&(i=n.offsetLeft,u=n.offsetTop)}return{width:r,height:o,x:i+S(e),y:u}}(e,a)):p(t)?function(e,t){var a=w(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):J(function(e){var t,a=k(e),l=O(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=m(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=m(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),i=-l.scrollLeft+S(e),u=-l.scrollTop;return"rtl"===C(n||a).direction&&(i+=m(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:o,x:i,y:u}}(k(e)))}function Z(e){var t=_(T(e)),a=["absolute","fixed"].indexOf(C(e).position)>=0&&v(e)?N(e):e;return p(a)?t.filter((function(e){return p(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&f(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 ee(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function ae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function le(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ee(n):null,o=n?te(n):null,i=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case A:t={x:i,y:a.y-l.height};break;case D:t={x:i,y:a.y+a.height};break;case R:t={x:a.x+a.width,y:u};break;case I:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ae(r):null;if(null!=s){var c="y"===s?"height":"width";switch(o){case z: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 ne(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?W:u,c=l.rootBoundary,d=void 0===c?H:c,v=l.elementContext,f=void 0===v?F:v,g=l.altBoundary,b=void 0!==g&&g,y=l.padding,O=void 0===y?0:y,x=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof O?O:(a=O,M.reduce((function(e,t){return e[t]=a,e}),{}))),S=f===F?K:F,C=e.rects.popper,L=e.elements[b?S:f],E=function(e,t,a,l){var n="clippingParents"===t?Z(e):[].concat(t),r=[].concat(n,[a]),o=r[0],i=r.reduce((function(t,a){var n=Q(e,a,l);return t.top=m(n.top,t.top),t.right=h(n.right,t.right),t.bottom=h(n.bottom,t.bottom),t.left=m(n.left,t.left),t}),Q(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}(p(L)?L:L.contextElement||k(e.elements.popper),s,d,i),B=w(e.elements.reference),T=le({reference:B,element:C,strategy:"absolute",placement:r}),V=J(Object.assign({},C,T)),_=f===F?V:B,q={top:E.top-_.top+x.top,bottom:_.bottom-E.bottom+x.bottom,left:E.left-_.left+x.left,right:_.right-E.right+x.right},P=e.modifiersData.offset;if(f===F&&P){var N=P[r];Object.keys(q).forEach((function(e){var t=[R,D].indexOf(e)>=0?1:-1,a=[A,D].indexOf(e)>=0?"y":"x";q[e]+=N[a]*t}))}return q}var re={placement:"bottom",modifiers:[],strategy:"absolute"};function oe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(Oe,me,xe):pe(v?Oe:ge,me,v?xe:be);S[k]=ke,_[k]=ke-me}t.modifiersData[l]=_}},requiresIfExists:["offset"]},fe={left:"right",right:"left",bottom:"top",top:"bottom"};function me(e){return e.replace(/left|right|bottom|top/g,(function(e){return fe[e]}))}var he={start:"end",end:"start"};function ge(e){return e.replace(/start|end/g,(function(e){return he[e]}))}function be(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?U:u,c=te(l),d=c?i?G:G.filter((function(e){return te(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]=ne(e,{placement:a,boundary:n,rootBoundary:r,padding:o})[ee(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ye={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=ee(h),b=u||(g===h||!f?[me(h)]:function(e){if(ee(e)===j)return[];var t=me(e);return[ge(e),t,ge(t)]}(h)),y=[h].concat(b).reduce((function(e,a){return e.concat(ee(a)===j?be(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:m}):a)}),[]),w=t.rects.reference,O=t.rects.popper,x=new Map,k=!0,S=y[0],C=0;C=0,V=T?"width":"height",_=ne(t,{placement:L,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),q=T?B?R:I:B?D:A;w[V]>O[V]&&(q=me(q));var P=me(q),N=[];if(r&&N.push(_[E]<=0),i&&N.push(_[q]<=0,_[P]<=0),N.every((function(e){return e}))){S=L,k=!1;break}x.set(L,N)}if(k)for(var M=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"},$=f?3:1;$>0;$--){if("break"===M($))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(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=de(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[ve,ye,{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 Oe(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,O=n.setPointer,x=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&&O(_.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(),x();break;case" ":if(!q.value&&!u.value)return e.preventDefault(),N(),void x();if(!q.value)return!1;if(-1===P.value.indexOf("space")&&q.value)return;e.preventDefault(),N(),x();break;case"Tab":case";":case",":if(-1===P.value.indexOf(e.key.toLowerCase())||!q.value)return;N(),x(),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 ke(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 Se(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 Ce(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}})),O=l((()=>r.value)),x=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:O,ariaMultiselectable:x,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 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 Ee(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 Be={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,[Ee,Le,n,o,we,r,a,Oe,s,Se,c,xe,ke,Ce]),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 Te=["id","dir"],Ve=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],_e=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],qe=["onKeyup","aria-label"],Pe=["onClick"],Ne=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],Ae=["innerHTML"],De=["id"],Re=["id"],Ie=["id","aria-label","aria-selected"],je=["data-pointed","onMouseenter","onClick"],Me=["innerHTML"],ze=["aria-label"],$e=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],We=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],He=["innerHTML"],Fe=["innerHTML"],Ke=["value"],Ge=["name","value"],Ue=["name","value"],Xe=["id"];return Be.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,_e)):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,Pe))],42,qe))])))),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,Ne)):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,Ae)])):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,Ve),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,Me)]))],42,je)),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,$e)))),128))],10,ze)],10,Ie)))),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,We)))),128))],10,Re),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,He)])):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,Fe)])):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,Ke)):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,Ge)):(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,Ue)))),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,Xe)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Create height for empty input "),e.createElementVNode("div",{class:e.normalizeClass(t.classList.spacer)},null,2)],42,Te)},Be.__file="src/Multiselect.vue",Be}(Vue); diff --git a/dist/multiselect.js b/dist/multiselect.js index a4faad4..a8a7e56 100644 --- a/dist/multiselect.js +++ b/dist/multiselect.js @@ -908,9 +908,14 @@ function useOptions (props, context, dep) } // Transforming an plain arrays to an array of objects - uo = uo.map((val) => { - return typeof val === 'object' ? val : { [valueProp.value]: val, [trackBy.value[0]]: val, [label.value]: val} - }); + /* istanbul ignore else */ + if (uo && Array.isArray(uo)) { + uo = uo.map((val) => { + return typeof val === 'object' ? val : { [valueProp.value]: val, [trackBy.value[0]]: val, [label.value]: val} + }); + } else { + uo = []; + } return uo }; diff --git a/dist/multiselect.min.js b/dist/multiselect.min.js index ca7e210..253d89f 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 n,watch as i,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,n){const{object:i,valueProp:r,mode:o}=e(a),u=t().proxy,s=n.iv,c=e=>i.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:i,modelValue:r,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=T((()=>void 0!==r.value?r.value:i.value)),d=n((()=>"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,n,r){const{regex:o}=e(a),u=t().proxy,s=r.isOpen,c=r.open,d=l(null);return i(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 q(t,a,n){const{groupSelect:i,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||!i.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,"")}const C=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!C(e[n],t[n]))return!1}return!0};function A(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:A,groupLabel:B,canDeselect:D,max:j,strict:I,closeOnSelect:R,closeOnDeselect:M,groups:$,reverse:V,infinite:W,groupOptions:H,groupHideEmpty:F,groupSelect:N,onCreate:K,disabledProp:z,searchStart:G,searchFilter:U}=e(a),X=t().proxy,Y=o.iv,J=o.ev,Q=o.search,Z=o.clearSearch,ee=o.update,te=o.pointer,ae=o.setPointer,le=o.clearPointer,ne=o.focus,ie=o.deactivate,re=o.close,oe=o.localize,ue=l([]),se=l([]),ce=l(!1),de=l(null),pe=l(W.value&&-1===d.value?10:d.value),ve=n({get:()=>se.value,set:e=>se.value=e}),fe=T((()=>v.value||f.value||!1)),he=T((()=>void 0!==g.value?g.value:void 0===m.value||m.value)),ge=n((()=>{if($.value){let e=ye.value||[],t=[];return e.forEach((e=>{Ge(e[H.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=Ge(se.value||[]);return ue.value.length&&(e=e.concat(ue.value)),e}})),me=n((()=>{let e=ge.value;return V.value&&(e=e.reverse()),Te.value.length&&(e=Te.value.concat(e)),ze(e)})),be=n((()=>{let e=me.value;return pe.value>0&&(e=e.slice(0,pe.value)),e})),ye=n((()=>{if(!$.value)return[];let e=[],t=se.value||[];return ue.value.length&&e.push({[B.value]:" ",[H.value]:[...ue.value],__CREATE__:!0}),e.concat(t)})),we=n((()=>{let e=[...ye.value].map((e=>({...e})));return Te.value.length&&(e[0]&&e[0].__CREATE__?e[0][H.value]=[...Te.value,...e[0][H.value]]:e=[{[B.value]:" ",[H.value]:[...Te.value],__CREATE__:!0}].concat(e)),e})),Oe=n((()=>{if(!$.value)return[];let e=we.value;return Ke((e||[]).map(((e,t)=>{const a=Ge(e[H.value]);return{...e,index:t,group:!0,[H.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}:{})))}})))})),xe=n((()=>{switch(s.value){case"single":return!S(Y.value[q.value]);case"multiple":case"tags":return!S(Y.value)&&Y.value.length>0}})),Le=n((()=>void 0!==b.value?b.value(Y.value,X):Y.value&&Y.value.length>1?`${Y.value.length} options selected`:"1 option selected")),Se=T((()=>!ge.value.length&&!ce.value&&!Te.value.length)),ke=T((()=>ge.value.length>0&&0==be.value.length&&(Q.value&&$.value||!$.value))),Te=n((()=>!1!==fe.value&&Q.value?-1!==Fe(Q.value)?[]:[{[q.value]:Q.value,[Ee.value[0]]:Q.value,[h.value]:Q.value,__CREATE__:!0}]:[])),Ee=n((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),_e=T((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),qe=T((()=>w.value||ce.value)),Pe=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":ee(e);break;case"multiple":case"tags":ee(Y.value.concat(e))}r.emit("select",Ae(e),e,X)},Ce=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":De();break;case"tags":case"multiple":ee(Array.isArray(e)?Y.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):Y.value.filter((t=>t[q.value]!=e[q.value])))}r.emit("deselect",Ae(e),e,X)},Ae=e=>y.value?e:e[q.value],Be=e=>{Ce(e)},De=()=>{ee(_e.value),r.emit("clear",X)},je=e=>{if(void 0!==e.group)return"single"!==s.value&&(We(e[H.value])&&e[H.value].length);switch(s.value){case"single":return!S(Y.value)&&(Y.value[q.value]==e[q.value]||"object"==typeof Y.value[q.value]&&"object"==typeof e[q.value]&&C(Y.value[q.value],e[q.value]));case"tags":case"multiple":return!S(Y.value)&&-1!==Y.value.map((e=>e[q.value])).indexOf(e[q.value])}},Ie=e=>!0===e[z.value],Re=()=>!(void 0===j||-1===j.value||!xe.value&&j.value>0)&&Y.value.length>=j.value,Me=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&je(e))return D.value&&Ce(e),void(M.value&&(le(),re()));e&&$e(e),_.value&&Z(),R.value&&(le(),re()),e&&Pe(e);break;case"multiple":if(e&&je(e))return Ce(e),void(M.value&&(le(),re()));if(Re())return void r.emit("max",X);e&&($e(e),Pe(e)),_.value&&Z(),p.value&&le(),R.value&&re();break;case"tags":if(e&&je(e))return Ce(e),void(M.value&&(le(),re()));if(Re())return void r.emit("max",X);e&&$e(e),_.value&&Z(),e&&Pe(e),p.value&&le(),R.value&&re()}R.value||ne()},$e=e=>{void 0===He(e[q.value])&&fe.value&&(r.emit("tag",e[q.value],X),r.emit("option",e[q.value],X),r.emit("create",e[q.value],X),he.value&&Ne(e),Z())},Ve=e=>void 0===e.find((e=>!je(e)&&!e[z.value])),We=e=>void 0===e.find((e=>!je(e))),He=e=>ge.value[ge.value.map((e=>String(e[q.value]))).indexOf(String(e))],Fe=e=>ge.value.findIndex((t=>Ee.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Ne=e=>{ue.value.push(e)},Ke=e=>F.value?e.filter((e=>Q.value?e.__VISIBLE__.length:e[H.value].length)):e.filter((e=>!Q.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(Q.value&&k.value){let e=U.value;e||(e=(e,t,a)=>Ee.value.some((a=>{let l=P(oe(e[a]),I.value);return G.value?l.startsWith(P(t,I.value)):-1!==l.indexOf(P(t,I.value))}))),a=a.filter((t=>e(t,Q.value,X)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&je(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,[Ee.value[0]]:a,[h.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[q.value]:e,[Ee.value[0]]:e,[h.value]:e})),t},Ue=()=>{S(J.value)||(Y.value=Je(J.value))},Xe=e=>(ce.value=!0,new Promise(((t,a)=>{u.value(Q.value,X).then((t=>{se.value=t||[],"function"==typeof e&&e(t),ce.value=!1})).catch((e=>{console.error(e),se.value=[],ce.value=!1})).finally((()=>{t()}))}))),Ye=()=>{if(xe.value)if("single"===s.value){let e=He(Y.value[q.value]);if(void 0!==e){let t=e[h.value];Y.value[h.value]=t,y.value&&(J.value[h.value]=t)}}else Y.value.forEach(((e,t)=>{let a=He(Y.value[t][q.value]);if(void 0!==a){let e=a[h.value];Y.value[t][h.value]=e,y.value&&(J.value[t][h.value]=e)}}))},Je=e=>S(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?He(e)||(A.value?{[h.value]:e,[q.value]:e,[Ee.value[0]]:e}:{}):e.filter((e=>!!He(e)||A.value)).map((e=>He(e)||{[h.value]:e,[q.value]:e,[Ee.value[0]]:e})),Qe=()=>{de.value=i(Q,(e=>{e.length{e==Q.value&&u.value(Q.value,X).then((t=>{e!=Q.value&&Q.value||(se.value=t,te.value=be.value.filter((e=>!0!==e[z.value]))[0]||null,ce.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!S(J.value)&&!Array.isArray(J.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?x.value?Xe(Ue):1==y.value&&Ue():(se.value=u.value,Ue()),O.value>-1&&Qe(),i(O,((e,t)=>{de.value&&de.value(),e>=0&&Qe()})),i(J,(e=>{if(S(e))ee(Je(e),!1);else switch(s.value){case"single":(y.value?e[q.value]!=Y.value[q.value]:e!=Y.value[q.value])&&ee(Je(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,Y.value.map((e=>e[q.value])))||ee(Je(e),!1)}}),{deep:!0}),i(u,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Xe():(se.value=a.options,Object.keys(Y.value).length||Ue(),Ye())})),i(h,Ye),i(d,((e,t)=>{pe.value=W.value&&-1===e?10:e})),{resolvedOptions:ve,pfo:me,fo:be,filteredOptions:be,hasSelected:xe,multipleLabelText:Le,eo:ge,extendedOptions:ge,eg:ye,extendedGroups:ye,fg:Oe,filteredGroups:Oe,noOptions:Se,noResults:ke,resolving:ce,busy:qe,offset:pe,select:Pe,deselect:Ce,remove:Be,selectAll:()=>{"single"!==s.value&&Pe(be.value.filter((e=>!e.disabled&&!je(e))))},clear:De,isSelected:je,isDisabled:Ie,isMax:Re,getOption:He,handleOptionClick:e=>{if(!Ie(e))return K.value&&!je(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=K.value(e,X))instanceof Promise)?(ce.value=!0,void e.then((e=>{ce.value=!1,Me(e)}))):void Me(e)},handleGroupClick:e=>{if(!Ie(e)&&"single"!==s.value&&N.value){switch(s.value){case"multiple":case"tags":Ve(e[H.value])?Ce(e[H.value]):Pe(e[H.value].filter((e=>-1===Y.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[z.value])).filter(((e,t)=>Y.value.length+1+t<=j.value||-1===j.value))),p.value&&te.value&&ae(Oe.value.filter((e=>!e[z.value]))[te.value.index])}R.value&&ie()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{Xe(e)},resolveOptions:Xe,refreshLabels:Ye}}function B(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=n((()=>g.value.filter((e=>!e[f.value])))),_=n((()=>m.value.filter((e=>!e[f.value])))),q=T((()=>"single"!==p.value&&v.value)),P=T((()=>O.value&&O.value.group)),C=n((()=>W(O.value))),A=n((()=>{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=n((()=>{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=n((()=>[..._.value].slice(-1)[0])),j=n((()=>O.value.__VISIBLE__.filter((e=>!e[f.value]))[0])),I=n((()=>{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=n((()=>{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=n((()=>[...A.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),$=n((()=>[...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())})),i(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?j.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:I.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 D(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function j(e){return e instanceof D(e).Element||e instanceof Element}function I(e){return e instanceof D(e).HTMLElement||e instanceof HTMLElement}function R(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}var M=Math.max,$=Math.min,V=Math.round;function W(){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 H(){return!/^((?!chrome|android).)*safari/i.test(W())}function F(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,i=1;t&&I(e)&&(n=e.offsetWidth>0&&V(l.width)/e.offsetWidth||1,i=e.offsetHeight>0&&V(l.height)/e.offsetHeight||1);var r=(j(e)?D(e):window).visualViewport,o=!H()&&a,u=(l.left+(o&&r?r.offsetLeft:0))/n,s=(l.top+(o&&r?r.offsetTop:0))/i,c=l.width/n,d=l.height/i;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function N(e){var t=D(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function K(e){return e?(e.nodeName||"").toLowerCase():null}function z(e){return((j(e)?e.ownerDocument:e.document)||window.document).documentElement}function G(e){return F(z(e)).left+N(e).scrollLeft}function U(e){return D(e).getComputedStyle(e)}function X(e){var t=U(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function Y(e,t,a){void 0===a&&(a=!1);var l,n,i=I(t),r=I(t)&&function(e){var t=e.getBoundingClientRect(),a=V(t.width)/e.offsetWidth||1,l=V(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=z(t),u=F(e,r,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(i||!i&&!a)&&(("body"!==K(t)||X(o))&&(s=(l=t)!==D(l)&&I(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:N(l)),I(t)?((c=F(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=G(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function J(e){var t=F(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 Q(e){return"html"===K(e)?e:e.assignedSlot||e.parentNode||(R(e)?e.host:null)||z(e)}function Z(e){return["html","body","#document"].indexOf(K(e))>=0?e.ownerDocument.body:I(e)&&X(e)?e:Z(Q(e))}function ee(e,t){var a;void 0===t&&(t=[]);var l=Z(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),i=D(l),r=n?[i].concat(i.visualViewport||[],X(l)?l:[]):l,o=t.concat(r);return n?o:o.concat(ee(Q(r)))}function te(e){return["table","td","th"].indexOf(K(e))>=0}function ae(e){return I(e)&&"fixed"!==U(e).position?e.offsetParent:null}function le(e){for(var t=D(e),a=ae(e);a&&te(a)&&"static"===U(a).position;)a=ae(a);return a&&("html"===K(a)||"body"===K(a)&&"static"===U(a).position)?t:a||function(e){var t=/firefox/i.test(W());if(/Trident/i.test(W())&&I(e)&&"fixed"===U(e).position)return null;var a=Q(e);for(R(a)&&(a=a.host);I(a)&&["html","body"].indexOf(K(a))<0;){var l=U(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 ne="top",ie="bottom",re="right",oe="left",ue="auto",se=[ne,ie,re,oe],ce="start",de="end",pe="clippingParents",ve="viewport",fe="popper",he="reference",ge=se.reduce((function(e,t){return e.concat([t+"-"+ce,t+"-"+de])}),[]),me=[].concat(se,[ue]).reduce((function(e,t){return e.concat([t,t+"-"+ce,t+"-"+de])}),[]),be=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ye(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 we(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Oe(e,t,a){return t===ve?we(function(e,t){var a=D(e),l=z(e),n=a.visualViewport,i=l.clientWidth,r=l.clientHeight,o=0,u=0;if(n){i=n.width,r=n.height;var s=H();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:i,height:r,x:o+G(e),y:u}}(e,a)):j(t)?function(e,t){var a=F(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):we(function(e){var t,a=z(e),l=N(e),n=null==(t=e.ownerDocument)?void 0:t.body,i=M(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=M(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+G(e),u=-l.scrollTop;return"rtl"===U(n||a).direction&&(o+=M(a.clientWidth,n?n.clientWidth:0)-i),{width:i,height:r,x:o,y:u}}(z(e)))}function xe(e){var t=ee(Q(e)),a=["absolute","fixed"].indexOf(U(e).position)>=0&&I(e)?le(e):e;return j(a)?t.filter((function(e){return j(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&R(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==K(e)})):[]}function Le(e){return e.split("-")[0]}function Se(e){return e.split("-")[1]}function ke(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Te(e){var t,a=e.reference,l=e.element,n=e.placement,i=n?Le(n):null,r=n?Se(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(i){case ne:t={x:o,y:a.y-l.height};break;case ie:t={x:o,y:a.y+a.height};break;case re:t={x:a.x+a.width,y:u};break;case oe:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=i?ke(i):null;if(null!=s){var c="y"===s?"height":"width";switch(r){case ce:t[s]=t[s]-(a[c]/2-l[c]/2);break;case de:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function Ee(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,i=void 0===n?e.placement:n,r=l.strategy,o=void 0===r?e.strategy:r,u=l.boundary,s=void 0===u?pe:u,c=l.rootBoundary,d=void 0===c?ve:c,p=l.elementContext,v=void 0===p?fe: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,se.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===fe?he:fe,w=e.rects.popper,O=e.elements[h?y:v],x=function(e,t,a,l){var n="clippingParents"===t?xe(e):[].concat(t),i=[].concat(n,[a]),r=i[0],o=i.reduce((function(t,a){var n=Oe(e,a,l);return t.top=M(n.top,t.top),t.right=$(n.right,t.right),t.bottom=$(n.bottom,t.bottom),t.left=M(n.left,t.left),t}),Oe(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}(j(O)?O:O.contextElement||z(e.elements.popper),s,d,o),L=F(e.elements.reference),S=Te({reference:L,element:w,strategy:"absolute",placement:i}),k=we(Object.assign({},w,S)),T=v===fe?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===fe&&_){var q=_[i];Object.keys(E).forEach((function(e){var t=[re,ie].indexOf(e)>=0?1:-1,a=[ne,ie].indexOf(e)>=0?"y":"x";E[e]+=q[a]*t}))}return E}var _e={placement:"bottom",modifiers:[],strategy:"absolute"};function qe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(ge,se,me):je(v?ge:pe,se,v?me:ve);x[O]=be,_[O]=be-se}t.modifiersData[l]=_}},requiresIfExists:["offset"]},Re={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e){return e.replace(/left|right|bottom|top/g,(function(e){return Re[e]}))}var $e={start:"end",end:"start"};function Ve(e){return e.replace(/start|end/g,(function(e){return $e[e]}))}function We(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,i=a.rootBoundary,r=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?me:u,c=Se(l),d=c?o?ge:ge.filter((function(e){return Se(e)===c})):se,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]=Ee(e,{placement:a,boundary:n,rootBoundary:i,padding:r})[Le(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var He={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,i=void 0===n||n,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=Le(g),b=u||(m===g||!f?[Me(g)]:function(e){if(Le(e)===ue)return[];var t=Me(e);return[Ve(e),t,Ve(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(Le(a)===ue?We(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=Ee(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),A=q?_?re:oe:_?ie:ne;w[P]>O[P]&&(A=Me(A));var B=Me(A),D=[];if(i&&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 j=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"},I=f?3:1;I>0;I--){if("break"===j(I))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Fe(a,n,i){const{disabled:s,appendTo:c,appendToBody:d,openDirection:p}=e(a),v=t().proxy,f=i.multiselect,h=i.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=De(f.value,h.value,{strategy:x(f.value)?"fixed":void 0,placement:p.value,modifiers:[Ie,He,{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,n.emit("open",v),y.value&&r((()=>{O()})))},close:()=>{g.value&&(g.value=!1,n.emit("close",v))},placement:w,updatePopper:O}}function Ne(t,a,n){const{searchable:i,disabled:r,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,h=l(!1),g=l(!1),m=T((()=>i.value||r.value?-1:0)),b=()=>{i.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:()=>{i.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 Ke(a,l,n){const{mode:i,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=n.iv,b=n.update,y=n.deselect,w=n.search,O=n.setPointer,x=n.selectPointer,L=n.backwardPointer,S=n.forwardPointer,k=n.multiselect,E=n.wrapper,_=n.tags,q=n.isOpen,P=n.open,C=n.blur,A=n.fo,B=T((()=>v.value||f.value||!1)),D=T((()=>void 0!==r.value?r.value:void 0!==p.value?p.value:["enter"])),j=()=>{"tags"===i.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"===i.value&&(t=[...k.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==_.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===i.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;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":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"!==i.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"!==i.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:j}}function ze(t,a,l){const{classes:i,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",...i.value}))),y=T((()=>!!(s.value&&o.value&&(!h.value||h.value&&g.value.length))));return{classList:n((()=>{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 Ge(t,a,n){const{limit:u,infinite:c}=e(t),d=n.isOpen,p=n.offset,v=n.search,f=n.pfo,h=n.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()})),i(v,(()=>{c.value&&(p.value=u.value,w())}),{flush:"post"}),i(h,(()=>{c.value&&w()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(g.value=new IntersectionObserver(y))})),{hasMore:b,infiniteLoader:m}}function Ue(t,a,i){const{placeholder:r,id:u,valueProp:s,label:c,mode:d,groupLabel:p,aria:v,searchable:f}=e(t),h=i.pointer,g=i.iv,m=i.hasSelected,b=i.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=n((()=>"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=n((()=>{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 Xe(t,a,l){const{locale:n,fallbackLocale:i}=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[i.value]?e[i.value]:e&&i.value&&e[i.value.toUpperCase()]?e[i.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Ye(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}var Je={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,[Ye,Xe,E,q,Fe,_,k,Ne,A,Ge,B,Ke,ze,Ue]),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 Qe=["id","dir"],Ze=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],et=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],tt=["onKeyup","aria-label"],at=["onClick"],lt=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],nt=["innerHTML"],it=["id"],rt=["id"],ot=["id","aria-label","aria-selected"],ut=["data-pointed","onMouseenter","onClick"],st=["innerHTML"],ct=["aria-label"],dt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],pt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],vt=["innerHTML"],ft=["innerHTML"],ht=["value"],gt=["name","value"],mt=["name","value"],bt=["id"];Je.render=function(e,t,a,l,n,i){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,et)):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,n)=>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:n,"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,at))],42,tt))])))),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,lt)):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,nt)])):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,Ze),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,n)=>(c(),d("li",{class:p(e.classList.group),key:n,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,st)]))],42,ut)),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,n,i)=>(c(),d("li",{class:p(e.classList.option(l,t)),"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,key:i,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,dt)))),128))],10,ct)],10,ot)))),128)):(c(!0),d(m,{key:1},b(e.fo,((t,l,n)=>(c(),d("li",{class:p(e.classList.option(t)),"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,key:n,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,pt)))),128))],10,rt),e.noOptions?y(e.$slots,"nooptions",{key:0},(()=>[v("div",{class:p(e.classList.noOptions),innerHTML:e.localize(a.noOptionsText)},null,10,vt)])):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,ft)])):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,ht)):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,gt)):(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,mt)))),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,bt)):h("v-if",!0),h(" Create height for empty input "),v("div",{class:p(e.classList.spacer)},null,2)],42,Qe)},Je.__file="src/Multiselect.vue";export{Je as default}; +import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as n,watch as i,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,n){const{object:i,valueProp:r,mode:o}=e(a),u=t().proxy,s=n.iv,c=e=>i.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:i,modelValue:r,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=T((()=>void 0!==r.value?r.value:i.value)),d=n((()=>"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,n,r){const{regex:o}=e(a),u=t().proxy,s=r.isOpen,c=r.open,d=l(null);return i(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 q(t,a,n){const{groupSelect:i,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||!i.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,"")}const C=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!C(e[n],t[n]))return!1}return!0};function A(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:A,groupLabel:B,canDeselect:D,max:j,strict:I,closeOnSelect:R,closeOnDeselect:M,groups:$,reverse:V,infinite:W,groupOptions:H,groupHideEmpty:F,groupSelect:N,onCreate:K,disabledProp:z,searchStart:G,searchFilter:U}=e(a),X=t().proxy,Y=o.iv,J=o.ev,Q=o.search,Z=o.clearSearch,ee=o.update,te=o.pointer,ae=o.setPointer,le=o.clearPointer,ne=o.focus,ie=o.deactivate,re=o.close,oe=o.localize,ue=l([]),se=l([]),ce=l(!1),de=l(null),pe=l(W.value&&-1===d.value?10:d.value),ve=n({get:()=>se.value,set:e=>se.value=e}),fe=T((()=>v.value||f.value||!1)),he=T((()=>void 0!==g.value?g.value:void 0===m.value||m.value)),ge=n((()=>{if($.value){let e=ye.value||[],t=[];return e.forEach((e=>{Ge(e[H.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=Ge(se.value||[]);return ue.value.length&&(e=e.concat(ue.value)),e}})),me=n((()=>{let e=ge.value;return V.value&&(e=e.reverse()),Te.value.length&&(e=Te.value.concat(e)),ze(e)})),be=n((()=>{let e=me.value;return pe.value>0&&(e=e.slice(0,pe.value)),e})),ye=n((()=>{if(!$.value)return[];let e=[],t=se.value||[];return ue.value.length&&e.push({[B.value]:" ",[H.value]:[...ue.value],__CREATE__:!0}),e.concat(t)})),we=n((()=>{let e=[...ye.value].map((e=>({...e})));return Te.value.length&&(e[0]&&e[0].__CREATE__?e[0][H.value]=[...Te.value,...e[0][H.value]]:e=[{[B.value]:" ",[H.value]:[...Te.value],__CREATE__:!0}].concat(e)),e})),Oe=n((()=>{if(!$.value)return[];let e=we.value;return Ke((e||[]).map(((e,t)=>{const a=Ge(e[H.value]);return{...e,index:t,group:!0,[H.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}:{})))}})))})),xe=n((()=>{switch(s.value){case"single":return!S(Y.value[q.value]);case"multiple":case"tags":return!S(Y.value)&&Y.value.length>0}})),Le=n((()=>void 0!==b.value?b.value(Y.value,X):Y.value&&Y.value.length>1?`${Y.value.length} options selected`:"1 option selected")),Se=T((()=>!ge.value.length&&!ce.value&&!Te.value.length)),ke=T((()=>ge.value.length>0&&0==be.value.length&&(Q.value&&$.value||!$.value))),Te=n((()=>!1!==fe.value&&Q.value?-1!==Fe(Q.value)?[]:[{[q.value]:Q.value,[Ee.value[0]]:Q.value,[h.value]:Q.value,__CREATE__:!0}]:[])),Ee=n((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),_e=T((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),qe=T((()=>w.value||ce.value)),Pe=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":ee(e);break;case"multiple":case"tags":ee(Y.value.concat(e))}r.emit("select",Ae(e),e,X)},Ce=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":De();break;case"tags":case"multiple":ee(Array.isArray(e)?Y.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):Y.value.filter((t=>t[q.value]!=e[q.value])))}r.emit("deselect",Ae(e),e,X)},Ae=e=>y.value?e:e[q.value],Be=e=>{Ce(e)},De=()=>{ee(_e.value),r.emit("clear",X)},je=e=>{if(void 0!==e.group)return"single"!==s.value&&(We(e[H.value])&&e[H.value].length);switch(s.value){case"single":return!S(Y.value)&&(Y.value[q.value]==e[q.value]||"object"==typeof Y.value[q.value]&&"object"==typeof e[q.value]&&C(Y.value[q.value],e[q.value]));case"tags":case"multiple":return!S(Y.value)&&-1!==Y.value.map((e=>e[q.value])).indexOf(e[q.value])}},Ie=e=>!0===e[z.value],Re=()=>!(void 0===j||-1===j.value||!xe.value&&j.value>0)&&Y.value.length>=j.value,Me=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&je(e))return D.value&&Ce(e),void(M.value&&(le(),re()));e&&$e(e),_.value&&Z(),R.value&&(le(),re()),e&&Pe(e);break;case"multiple":if(e&&je(e))return Ce(e),void(M.value&&(le(),re()));if(Re())return void r.emit("max",X);e&&($e(e),Pe(e)),_.value&&Z(),p.value&&le(),R.value&&re();break;case"tags":if(e&&je(e))return Ce(e),void(M.value&&(le(),re()));if(Re())return void r.emit("max",X);e&&$e(e),_.value&&Z(),e&&Pe(e),p.value&&le(),R.value&&re()}R.value||ne()},$e=e=>{void 0===He(e[q.value])&&fe.value&&(r.emit("tag",e[q.value],X),r.emit("option",e[q.value],X),r.emit("create",e[q.value],X),he.value&&Ne(e),Z())},Ve=e=>void 0===e.find((e=>!je(e)&&!e[z.value])),We=e=>void 0===e.find((e=>!je(e))),He=e=>ge.value[ge.value.map((e=>String(e[q.value]))).indexOf(String(e))],Fe=e=>ge.value.findIndex((t=>Ee.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Ne=e=>{ue.value.push(e)},Ke=e=>F.value?e.filter((e=>Q.value?e.__VISIBLE__.length:e[H.value].length)):e.filter((e=>!Q.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(Q.value&&k.value){let e=U.value;e||(e=(e,t,a)=>Ee.value.some((a=>{let l=P(oe(e[a]),I.value);return G.value?l.startsWith(P(t,I.value)):-1!==l.indexOf(P(t,I.value))}))),a=a.filter((t=>e(t,Q.value,X)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&je(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,[Ee.value[0]]:a,[h.value]:a}}))),t=t&&Array.isArray(t)?t.map((e=>"object"==typeof e?e:{[q.value]:e,[Ee.value[0]]:e,[h.value]:e})):[],t},Ue=()=>{S(J.value)||(Y.value=Je(J.value))},Xe=e=>(ce.value=!0,new Promise(((t,a)=>{u.value(Q.value,X).then((t=>{se.value=t||[],"function"==typeof e&&e(t),ce.value=!1})).catch((e=>{console.error(e),se.value=[],ce.value=!1})).finally((()=>{t()}))}))),Ye=()=>{if(xe.value)if("single"===s.value){let e=He(Y.value[q.value]);if(void 0!==e){let t=e[h.value];Y.value[h.value]=t,y.value&&(J.value[h.value]=t)}}else Y.value.forEach(((e,t)=>{let a=He(Y.value[t][q.value]);if(void 0!==a){let e=a[h.value];Y.value[t][h.value]=e,y.value&&(J.value[t][h.value]=e)}}))},Je=e=>S(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?He(e)||(A.value?{[h.value]:e,[q.value]:e,[Ee.value[0]]:e}:{}):e.filter((e=>!!He(e)||A.value)).map((e=>He(e)||{[h.value]:e,[q.value]:e,[Ee.value[0]]:e})),Qe=()=>{de.value=i(Q,(e=>{e.length{e==Q.value&&u.value(Q.value,X).then((t=>{e!=Q.value&&Q.value||(se.value=t,te.value=be.value.filter((e=>!0!==e[z.value]))[0]||null,ce.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!S(J.value)&&!Array.isArray(J.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?x.value?Xe(Ue):1==y.value&&Ue():(se.value=u.value,Ue()),O.value>-1&&Qe(),i(O,((e,t)=>{de.value&&de.value(),e>=0&&Qe()})),i(J,(e=>{if(S(e))ee(Je(e),!1);else switch(s.value){case"single":(y.value?e[q.value]!=Y.value[q.value]:e!=Y.value[q.value])&&ee(Je(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,Y.value.map((e=>e[q.value])))||ee(Je(e),!1)}}),{deep:!0}),i(u,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Xe():(se.value=a.options,Object.keys(Y.value).length||Ue(),Ye())})),i(h,Ye),i(d,((e,t)=>{pe.value=W.value&&-1===e?10:e})),{resolvedOptions:ve,pfo:me,fo:be,filteredOptions:be,hasSelected:xe,multipleLabelText:Le,eo:ge,extendedOptions:ge,eg:ye,extendedGroups:ye,fg:Oe,filteredGroups:Oe,noOptions:Se,noResults:ke,resolving:ce,busy:qe,offset:pe,select:Pe,deselect:Ce,remove:Be,selectAll:()=>{"single"!==s.value&&Pe(be.value.filter((e=>!e.disabled&&!je(e))))},clear:De,isSelected:je,isDisabled:Ie,isMax:Re,getOption:He,handleOptionClick:e=>{if(!Ie(e))return K.value&&!je(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=K.value(e,X))instanceof Promise)?(ce.value=!0,void e.then((e=>{ce.value=!1,Me(e)}))):void Me(e)},handleGroupClick:e=>{if(!Ie(e)&&"single"!==s.value&&N.value){switch(s.value){case"multiple":case"tags":Ve(e[H.value])?Ce(e[H.value]):Pe(e[H.value].filter((e=>-1===Y.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[z.value])).filter(((e,t)=>Y.value.length+1+t<=j.value||-1===j.value))),p.value&&te.value&&ae(Oe.value.filter((e=>!e[z.value]))[te.value.index])}R.value&&ie()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{Xe(e)},resolveOptions:Xe,refreshLabels:Ye}}function B(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=n((()=>g.value.filter((e=>!e[f.value])))),_=n((()=>m.value.filter((e=>!e[f.value])))),q=T((()=>"single"!==p.value&&v.value)),P=T((()=>O.value&&O.value.group)),C=n((()=>W(O.value))),A=n((()=>{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=n((()=>{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=n((()=>[..._.value].slice(-1)[0])),j=n((()=>O.value.__VISIBLE__.filter((e=>!e[f.value]))[0])),I=n((()=>{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=n((()=>{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=n((()=>[...A.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),$=n((()=>[...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())})),i(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?j.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:I.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 D(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function j(e){return e instanceof D(e).Element||e instanceof Element}function I(e){return e instanceof D(e).HTMLElement||e instanceof HTMLElement}function R(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}var M=Math.max,$=Math.min,V=Math.round;function W(){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 H(){return!/^((?!chrome|android).)*safari/i.test(W())}function F(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,i=1;t&&I(e)&&(n=e.offsetWidth>0&&V(l.width)/e.offsetWidth||1,i=e.offsetHeight>0&&V(l.height)/e.offsetHeight||1);var r=(j(e)?D(e):window).visualViewport,o=!H()&&a,u=(l.left+(o&&r?r.offsetLeft:0))/n,s=(l.top+(o&&r?r.offsetTop:0))/i,c=l.width/n,d=l.height/i;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function N(e){var t=D(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function K(e){return e?(e.nodeName||"").toLowerCase():null}function z(e){return((j(e)?e.ownerDocument:e.document)||window.document).documentElement}function G(e){return F(z(e)).left+N(e).scrollLeft}function U(e){return D(e).getComputedStyle(e)}function X(e){var t=U(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function Y(e,t,a){void 0===a&&(a=!1);var l,n,i=I(t),r=I(t)&&function(e){var t=e.getBoundingClientRect(),a=V(t.width)/e.offsetWidth||1,l=V(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=z(t),u=F(e,r,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(i||!i&&!a)&&(("body"!==K(t)||X(o))&&(s=(l=t)!==D(l)&&I(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:N(l)),I(t)?((c=F(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=G(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function J(e){var t=F(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 Q(e){return"html"===K(e)?e:e.assignedSlot||e.parentNode||(R(e)?e.host:null)||z(e)}function Z(e){return["html","body","#document"].indexOf(K(e))>=0?e.ownerDocument.body:I(e)&&X(e)?e:Z(Q(e))}function ee(e,t){var a;void 0===t&&(t=[]);var l=Z(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),i=D(l),r=n?[i].concat(i.visualViewport||[],X(l)?l:[]):l,o=t.concat(r);return n?o:o.concat(ee(Q(r)))}function te(e){return["table","td","th"].indexOf(K(e))>=0}function ae(e){return I(e)&&"fixed"!==U(e).position?e.offsetParent:null}function le(e){for(var t=D(e),a=ae(e);a&&te(a)&&"static"===U(a).position;)a=ae(a);return a&&("html"===K(a)||"body"===K(a)&&"static"===U(a).position)?t:a||function(e){var t=/firefox/i.test(W());if(/Trident/i.test(W())&&I(e)&&"fixed"===U(e).position)return null;var a=Q(e);for(R(a)&&(a=a.host);I(a)&&["html","body"].indexOf(K(a))<0;){var l=U(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 ne="top",ie="bottom",re="right",oe="left",ue="auto",se=[ne,ie,re,oe],ce="start",de="end",pe="clippingParents",ve="viewport",fe="popper",he="reference",ge=se.reduce((function(e,t){return e.concat([t+"-"+ce,t+"-"+de])}),[]),me=[].concat(se,[ue]).reduce((function(e,t){return e.concat([t,t+"-"+ce,t+"-"+de])}),[]),be=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ye(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 we(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Oe(e,t,a){return t===ve?we(function(e,t){var a=D(e),l=z(e),n=a.visualViewport,i=l.clientWidth,r=l.clientHeight,o=0,u=0;if(n){i=n.width,r=n.height;var s=H();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:i,height:r,x:o+G(e),y:u}}(e,a)):j(t)?function(e,t){var a=F(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):we(function(e){var t,a=z(e),l=N(e),n=null==(t=e.ownerDocument)?void 0:t.body,i=M(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=M(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+G(e),u=-l.scrollTop;return"rtl"===U(n||a).direction&&(o+=M(a.clientWidth,n?n.clientWidth:0)-i),{width:i,height:r,x:o,y:u}}(z(e)))}function xe(e){var t=ee(Q(e)),a=["absolute","fixed"].indexOf(U(e).position)>=0&&I(e)?le(e):e;return j(a)?t.filter((function(e){return j(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&R(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==K(e)})):[]}function Le(e){return e.split("-")[0]}function Se(e){return e.split("-")[1]}function ke(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Te(e){var t,a=e.reference,l=e.element,n=e.placement,i=n?Le(n):null,r=n?Se(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(i){case ne:t={x:o,y:a.y-l.height};break;case ie:t={x:o,y:a.y+a.height};break;case re:t={x:a.x+a.width,y:u};break;case oe:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=i?ke(i):null;if(null!=s){var c="y"===s?"height":"width";switch(r){case ce:t[s]=t[s]-(a[c]/2-l[c]/2);break;case de:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function Ee(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,i=void 0===n?e.placement:n,r=l.strategy,o=void 0===r?e.strategy:r,u=l.boundary,s=void 0===u?pe:u,c=l.rootBoundary,d=void 0===c?ve:c,p=l.elementContext,v=void 0===p?fe: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,se.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===fe?he:fe,w=e.rects.popper,O=e.elements[h?y:v],x=function(e,t,a,l){var n="clippingParents"===t?xe(e):[].concat(t),i=[].concat(n,[a]),r=i[0],o=i.reduce((function(t,a){var n=Oe(e,a,l);return t.top=M(n.top,t.top),t.right=$(n.right,t.right),t.bottom=$(n.bottom,t.bottom),t.left=M(n.left,t.left),t}),Oe(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}(j(O)?O:O.contextElement||z(e.elements.popper),s,d,o),L=F(e.elements.reference),S=Te({reference:L,element:w,strategy:"absolute",placement:i}),k=we(Object.assign({},w,S)),T=v===fe?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===fe&&_){var q=_[i];Object.keys(E).forEach((function(e){var t=[re,ie].indexOf(e)>=0?1:-1,a=[ne,ie].indexOf(e)>=0?"y":"x";E[e]+=q[a]*t}))}return E}var _e={placement:"bottom",modifiers:[],strategy:"absolute"};function qe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(ge,se,me):je(v?ge:pe,se,v?me:ve);x[O]=be,_[O]=be-se}t.modifiersData[l]=_}},requiresIfExists:["offset"]},Re={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e){return e.replace(/left|right|bottom|top/g,(function(e){return Re[e]}))}var $e={start:"end",end:"start"};function Ve(e){return e.replace(/start|end/g,(function(e){return $e[e]}))}function We(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,i=a.rootBoundary,r=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?me:u,c=Se(l),d=c?o?ge:ge.filter((function(e){return Se(e)===c})):se,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]=Ee(e,{placement:a,boundary:n,rootBoundary:i,padding:r})[Le(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var He={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,i=void 0===n||n,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=Le(g),b=u||(m===g||!f?[Me(g)]:function(e){if(Le(e)===ue)return[];var t=Me(e);return[Ve(e),t,Ve(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(Le(a)===ue?We(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=Ee(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),A=q?_?re:oe:_?ie:ne;w[P]>O[P]&&(A=Me(A));var B=Me(A),D=[];if(i&&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 j=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"},I=f?3:1;I>0;I--){if("break"===j(I))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Fe(a,n,i){const{disabled:s,appendTo:c,appendToBody:d,openDirection:p}=e(a),v=t().proxy,f=i.multiselect,h=i.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=De(f.value,h.value,{strategy:x(f.value)?"fixed":void 0,placement:p.value,modifiers:[Ie,He,{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,n.emit("open",v),y.value&&r((()=>{O()})))},close:()=>{g.value&&(g.value=!1,n.emit("close",v))},placement:w,updatePopper:O}}function Ne(t,a,n){const{searchable:i,disabled:r,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,h=l(!1),g=l(!1),m=T((()=>i.value||r.value?-1:0)),b=()=>{i.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:()=>{i.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 Ke(a,l,n){const{mode:i,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=n.iv,b=n.update,y=n.deselect,w=n.search,O=n.setPointer,x=n.selectPointer,L=n.backwardPointer,S=n.forwardPointer,k=n.multiselect,E=n.wrapper,_=n.tags,q=n.isOpen,P=n.open,C=n.blur,A=n.fo,B=T((()=>v.value||f.value||!1)),D=T((()=>void 0!==r.value?r.value:void 0!==p.value?p.value:["enter"])),j=()=>{"tags"===i.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"===i.value&&(t=[...k.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==_.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===i.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;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":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"!==i.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"!==i.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:j}}function ze(t,a,l){const{classes:i,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",...i.value}))),y=T((()=>!!(s.value&&o.value&&(!h.value||h.value&&g.value.length))));return{classList:n((()=>{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 Ge(t,a,n){const{limit:u,infinite:c}=e(t),d=n.isOpen,p=n.offset,v=n.search,f=n.pfo,h=n.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()})),i(v,(()=>{c.value&&(p.value=u.value,w())}),{flush:"post"}),i(h,(()=>{c.value&&w()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(g.value=new IntersectionObserver(y))})),{hasMore:b,infiniteLoader:m}}function Ue(t,a,i){const{placeholder:r,id:u,valueProp:s,label:c,mode:d,groupLabel:p,aria:v,searchable:f}=e(t),h=i.pointer,g=i.iv,m=i.hasSelected,b=i.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=n((()=>"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=n((()=>{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 Xe(t,a,l){const{locale:n,fallbackLocale:i}=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[i.value]?e[i.value]:e&&i.value&&e[i.value.toUpperCase()]?e[i.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Ye(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}var Je={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,[Ye,Xe,E,q,Fe,_,k,Ne,A,Ge,B,Ke,ze,Ue]),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 Qe=["id","dir"],Ze=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],et=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],tt=["onKeyup","aria-label"],at=["onClick"],lt=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],nt=["innerHTML"],it=["id"],rt=["id"],ot=["id","aria-label","aria-selected"],ut=["data-pointed","onMouseenter","onClick"],st=["innerHTML"],ct=["aria-label"],dt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],pt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],vt=["innerHTML"],ft=["innerHTML"],ht=["value"],gt=["name","value"],mt=["name","value"],bt=["id"];Je.render=function(e,t,a,l,n,i){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,et)):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,n)=>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:n,"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,at))],42,tt))])))),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,lt)):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,nt)])):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,Ze),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,n)=>(c(),d("li",{class:p(e.classList.group),key:n,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,st)]))],42,ut)),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,n,i)=>(c(),d("li",{class:p(e.classList.option(l,t)),"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,key:i,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,dt)))),128))],10,ct)],10,ot)))),128)):(c(!0),d(m,{key:1},b(e.fo,((t,l,n)=>(c(),d("li",{class:p(e.classList.option(t)),"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,key:n,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,pt)))),128))],10,rt),e.noOptions?y(e.$slots,"nooptions",{key:0},(()=>[v("div",{class:p(e.classList.noOptions),innerHTML:e.localize(a.noOptionsText)},null,10,vt)])):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,ft)])):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,ht)):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,gt)):(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,mt)))),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,bt)):h("v-if",!0),h(" Create height for empty input "),v("div",{class:p(e.classList.spacer)},null,2)],42,Qe)},Je.__file="src/Multiselect.vue";export{Je as default}; diff --git a/dist/multiselect.mjs b/dist/multiselect.mjs index a4faad4..a8a7e56 100644 --- a/dist/multiselect.mjs +++ b/dist/multiselect.mjs @@ -908,9 +908,14 @@ function useOptions (props, context, dep) } // Transforming an plain arrays to an array of objects - uo = uo.map((val) => { - return typeof val === 'object' ? val : { [valueProp.value]: val, [trackBy.value[0]]: val, [label.value]: val} - }); + /* istanbul ignore else */ + if (uo && Array.isArray(uo)) { + uo = uo.map((val) => { + return typeof val === 'object' ? val : { [valueProp.value]: val, [trackBy.value[0]]: val, [label.value]: val} + }); + } else { + uo = []; + } return uo }; diff --git a/dist/multiselect.vue2.global.js b/dist/multiselect.vue2.global.js index 4b46772..66c766b 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,"")}const u=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!u(e[n],t[n]))return!1}return!0};function s(a,n,r){const{options:i,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:h,appendNewTag:m,appendNewOption:g,multipleLabel:b,object:y,loading:w,delay:_,resolveOnLoad:O,minChars:x,filterResults:S,clearOnSearch:L,clearOnSelect:k,valueProp:T,allowAbsent:E,groupLabel:P,canDeselect:q,max:R,strict:C,closeOnSelect:A,closeOnDeselect:B,groups:D,reverse:j,infinite:I,groupOptions:V,groupHideEmpty:M,groupSelect:W,onCreate:$,disabledProp:H,searchStart:N,searchFilter:F}=e.toRefs(a),z=e.getCurrentInstance().proxy,U=r.iv,G=r.ev,K=r.search,X=r.clearSearch,Y=r.update,J=r.pointer,Q=r.setPointer,Z=r.clearPointer,ee=r.focus,te=r.deactivate,ae=r.close,le=r.localize,ne=e.ref([]),re=e.ref([]),ie=e.ref(!1),oe=e.ref(null),ue=e.ref(I.value&&-1===d.value?10:d.value),se=e.computed({get:()=>re.value,set:e=>re.value=e}),ce=l((()=>v.value||f.value||!1)),de=l((()=>void 0!==m.value?m.value:void 0===g.value||g.value)),pe=e.computed((()=>{if(D.value){let e=he.value||[],t=[];return e.forEach((e=>{Ne(e[V.value]).forEach((a=>{t.push(Object.assign({},a,e[H.value]?{[H.value]:!0}:{}))}))})),t}{let e=Ne(re.value||[]);return ne.value.length&&(e=e.concat(ne.value)),e}})),ve=e.computed((()=>{let e=pe.value;return j.value&&(e=e.reverse()),Oe.value.length&&(e=Oe.value.concat(e)),He(e)})),fe=e.computed((()=>{let e=ve.value;return ue.value>0&&(e=e.slice(0,ue.value)),e})),he=e.computed((()=>{if(!D.value)return[];let e=[],t=re.value||[];return ne.value.length&&e.push({[P.value]:" ",[V.value]:[...ne.value],__CREATE__:!0}),e.concat(t)})),me=e.computed((()=>{let e=[...he.value].map((e=>({...e})));return Oe.value.length&&(e[0]&&e[0].__CREATE__?e[0][V.value]=[...Oe.value,...e[0][V.value]]:e=[{[P.value]:" ",[V.value]:[...Oe.value],__CREATE__:!0}].concat(e)),e})),ge=e.computed((()=>{if(!D.value)return[];let e=me.value;return $e((e||[]).map(((e,t)=>{const a=Ne(e[V.value]);return{...e,index:t,group:!0,[V.value]:He(a,!1).map((t=>Object.assign({},t,e[H.value]?{[H.value]:!0}:{}))),__VISIBLE__:He(a).map((t=>Object.assign({},t,e[H.value]?{[H.value]:!0}:{})))}})))})),be=e.computed((()=>{switch(s.value){case"single":return!t(U.value[T.value]);case"multiple":case"tags":return!t(U.value)&&U.value.length>0}})),ye=e.computed((()=>void 0!==b.value?b.value(U.value,z):U.value&&U.value.length>1?`${U.value.length} options selected`:"1 option selected")),we=l((()=>!pe.value.length&&!ie.value&&!Oe.value.length)),_e=l((()=>pe.value.length>0&&0==fe.value.length&&(K.value&&D.value||!D.value))),Oe=e.computed((()=>!1!==ce.value&&K.value?-1!==Me(K.value)?[]:[{[T.value]:K.value,[xe.value[0]]:K.value,[h.value]:K.value,__CREATE__:!0}]:[])),xe=e.computed((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),Se=l((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Le=l((()=>w.value||ie.value)),ke=e=>{switch("object"!=typeof e&&(e=Ve(e)),s.value){case"single":Y(e);break;case"multiple":case"tags":Y(U.value.concat(e))}n.emit("select",Ee(e),e,z)},Te=e=>{switch("object"!=typeof e&&(e=Ve(e)),s.value){case"single":qe();break;case"tags":case"multiple":Y(Array.isArray(e)?U.value.filter((t=>-1===e.map((e=>e[T.value])).indexOf(t[T.value]))):U.value.filter((t=>t[T.value]!=e[T.value])))}n.emit("deselect",Ee(e),e,z)},Ee=e=>y.value?e:e[T.value],Pe=e=>{Te(e)},qe=()=>{Y(Se.value),n.emit("clear",z)},Re=e=>{if(void 0!==e.group)return"single"!==s.value&&(Ie(e[V.value])&&e[V.value].length);switch(s.value){case"single":return!t(U.value)&&(U.value[T.value]==e[T.value]||"object"==typeof U.value[T.value]&&"object"==typeof e[T.value]&&u(U.value[T.value],e[T.value]));case"tags":case"multiple":return!t(U.value)&&-1!==U.value.map((e=>e[T.value])).indexOf(e[T.value])}},Ce=e=>!0===e[H.value],Ae=()=>!(void 0===R||-1===R.value||!be.value&&R.value>0)&&U.value.length>=R.value,Be=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&Re(e))return q.value&&Te(e),void(B.value&&(Z(),ae()));e&&De(e),k.value&&X(),A.value&&(Z(),ae()),e&&ke(e);break;case"multiple":if(e&&Re(e))return Te(e),void(B.value&&(Z(),ae()));if(Ae())return void n.emit("max",z);e&&(De(e),ke(e)),k.value&&X(),p.value&&Z(),A.value&&ae();break;case"tags":if(e&&Re(e))return Te(e),void(B.value&&(Z(),ae()));if(Ae())return void n.emit("max",z);e&&De(e),k.value&&X(),e&&ke(e),p.value&&Z(),A.value&&ae()}A.value||ee()},De=e=>{void 0===Ve(e[T.value])&&ce.value&&(n.emit("tag",e[T.value],z),n.emit("option",e[T.value],z),n.emit("create",e[T.value],z),de.value&&We(e),X())},je=e=>void 0===e.find((e=>!Re(e)&&!e[H.value])),Ie=e=>void 0===e.find((e=>!Re(e))),Ve=e=>pe.value[pe.value.map((e=>String(e[T.value]))).indexOf(String(e))],Me=e=>pe.value.findIndex((t=>xe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),We=e=>{ne.value.push(e)},$e=e=>M.value?e.filter((e=>K.value?e.__VISIBLE__.length:e[V.value].length)):e.filter((e=>!K.value||e.__VISIBLE__.length)),He=(e,t=!0)=>{let a=e;if(K.value&&S.value){let e=F.value;e||(e=(e,t,a)=>xe.value.some((a=>{let l=o(le(e[a]),C.value);return N.value?l.startsWith(o(t,C.value)):-1!==l.indexOf(o(t,C.value))}))),a=a.filter((t=>e(t,K.value,z)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&Re(e))(e)))),a},Ne=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,[xe.value[0]]:a,[h.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[T.value]:e,[xe.value[0]]:e,[h.value]:e})),t},Fe=()=>{t(G.value)||(U.value=Ge(G.value))},ze=e=>(ie.value=!0,new Promise(((t,a)=>{i.value(K.value,z).then((t=>{re.value=t||[],"function"==typeof e&&e(t),ie.value=!1})).catch((e=>{console.error(e),re.value=[],ie.value=!1})).finally((()=>{t()}))}))),Ue=()=>{if(be.value)if("single"===s.value){let e=Ve(U.value[T.value]);if(void 0!==e){let t=e[h.value];U.value[h.value]=t,y.value&&(G.value[h.value]=t)}}else U.value.forEach(((e,t)=>{let a=Ve(U.value[t][T.value]);if(void 0!==a){let e=a[h.value];U.value[t][h.value]=e,y.value&&(G.value[t][h.value]=e)}}))},Ge=e=>t(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?Ve(e)||(E.value?{[h.value]:e,[T.value]:e,[xe.value[0]]:e}:{}):e.filter((e=>!!Ve(e)||E.value)).map((e=>Ve(e)||{[h.value]:e,[T.value]:e,[xe.value[0]]:e})),Ke=()=>{oe.value=e.watch(K,(e=>{e.length{e==K.value&&i.value(K.value,z).then((t=>{e!=K.value&&K.value||(re.value=t,J.value=fe.value.filter((e=>!0!==e[H.value]))[0]||null,ie.value=!1)})).catch((e=>{console.error(e)}))}),_.value))}),{flush:"sync"})};if("single"!==s.value&&!t(G.value)&&!Array.isArray(G.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return i&&"function"==typeof i.value?O.value?ze(Fe):1==y.value&&Fe():(re.value=i.value,Fe()),_.value>-1&&Ke(),e.watch(_,((e,t)=>{oe.value&&oe.value(),e>=0&&Ke()})),e.watch(G,(e=>{if(t(e))Y(Ge(e),!1);else switch(s.value){case"single":(y.value?e[T.value]!=U.value[T.value]:e!=U.value[T.value])&&Y(Ge(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[T.value])):e,U.value.map((e=>e[T.value])))||Y(Ge(e),!1)}}),{deep:!0}),e.watch(i,((e,t)=>{"function"==typeof a.options?O.value&&(!t||e&&e.toString()!==t.toString())&&ze():(re.value=a.options,Object.keys(U.value).length||Fe(),Ue())})),e.watch(h,Ue),e.watch(d,((e,t)=>{ue.value=I.value&&-1===e?10:e})),{resolvedOptions:se,pfo:ve,fo:fe,filteredOptions:fe,hasSelected:be,multipleLabelText:ye,eo:pe,extendedOptions:pe,eg:he,extendedGroups:he,fg:ge,filteredGroups:ge,noOptions:we,noResults:_e,resolving:ie,busy:Le,offset:ue,select:ke,deselect:Te,remove:Pe,selectAll:()=>{"single"!==s.value&&ke(fe.value.filter((e=>!e.disabled&&!Re(e))))},clear:qe,isSelected:Re,isDisabled:Ce,isMax:Ae,getOption:Ve,handleOptionClick:e=>{if(!Ce(e))return $.value&&!Re(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=$.value(e,z))instanceof Promise)?(ie.value=!0,void e.then((e=>{ie.value=!1,Be(e)}))):void Be(e)},handleGroupClick:e=>{if(!Ce(e)&&"single"!==s.value&&W.value){switch(s.value){case"multiple":case"tags":je(e[V.value])?Te(e[V.value]):ke(e[V.value].filter((e=>-1===U.value.map((e=>e[T.value])).indexOf(e[T.value]))).filter((e=>!e[H.value])).filter(((e,t)=>U.value.length+1+t<=R.value||-1===R.value))),p.value&&J.value&&Q(ge.value.filter((e=>!e[H.value]))[J.value.index])}A.value&&te()}},handleTagRemove:(e,t)=>{0===t.button?Pe(e):t.preventDefault()},refreshOptions:e=>{ze(e)},resolveOptions:ze,refreshLabels:Ue}}function c(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])))),k=l((()=>"single"!==c.value&&d.value)),T=l((()=>y.value&&y.value.group)),E=e.computed((()=>V(y.value))),P=e.computed((()=>{const e=T.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(T.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])),j=e.computed((()=>[...R.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),I=()=>{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=T.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?I():_())})),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:k,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:I,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(T.value?g(y.value):m(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&k.value?L.value[0].__CREATE__?S.value[0]:L.value[0]:S.value[0])||null);else if(s.value&&k.value){let e=T.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&&k.value&&(e=j.value,void 0===e&&(e=R.value)),w(e||null)}else if(s.value&&k.value){let e=T.value?D.value:A.value;void 0===e&&(e=T.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 d(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function p(e){return e instanceof d(e).Element||e instanceof Element}function v(e){return e instanceof d(e).HTMLElement||e instanceof HTMLElement}function f(e){return"undefined"!=typeof ShadowRoot&&(e instanceof d(e).ShadowRoot||e instanceof ShadowRoot)}var h=Math.max,m=Math.min,g=Math.round;function b(){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 y(){return!/^((?!chrome|android).)*safari/i.test(b())}function w(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&v(e)&&(n=e.offsetWidth>0&&g(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&g(l.height)/e.offsetHeight||1);var i=(p(e)?d(e):window).visualViewport,o=!y()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,f=l.height/r;return{width:c,height:f,top:s,right:u+c,bottom:s+f,left:u,x:u,y:s}}function _(e){var t=d(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function O(e){return e?(e.nodeName||"").toLowerCase():null}function x(e){return((p(e)?e.ownerDocument:e.document)||window.document).documentElement}function S(e){return w(x(e)).left+_(e).scrollLeft}function L(e){return d(e).getComputedStyle(e)}function k(e){var t=L(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=v(t),i=v(t)&&function(e){var t=e.getBoundingClientRect(),a=g(t.width)/e.offsetWidth||1,l=g(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=x(t),u=w(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==O(t)||k(o))&&(s=(l=t)!==d(l)&&v(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:_(l)),v(t)?((c=w(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=S(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function E(e){var t=w(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 P(e){return"html"===O(e)?e:e.assignedSlot||e.parentNode||(f(e)?e.host:null)||x(e)}function q(e){return["html","body","#document"].indexOf(O(e))>=0?e.ownerDocument.body:v(e)&&k(e)?e:q(P(e))}function R(e,t){var a;void 0===t&&(t=[]);var l=q(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=d(l),i=n?[r].concat(r.visualViewport||[],k(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(R(P(i)))}function C(e){return["table","td","th"].indexOf(O(e))>=0}function A(e){return v(e)&&"fixed"!==L(e).position?e.offsetParent:null}function B(e){for(var t=d(e),a=A(e);a&&C(a)&&"static"===L(a).position;)a=A(a);return a&&("html"===O(a)||"body"===O(a)&&"static"===L(a).position)?t:a||function(e){var t=/firefox/i.test(b());if(/Trident/i.test(b())&&v(e)&&"fixed"===L(e).position)return null;var a=P(e);for(f(a)&&(a=a.host);v(a)&&["html","body"].indexOf(O(a))<0;){var l=L(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 D="top",j="bottom",I="right",V="left",M="auto",W=[D,j,I,V],$="start",H="end",N="clippingParents",F="viewport",z="popper",U="reference",G=W.reduce((function(e,t){return e.concat([t+"-"+$,t+"-"+H])}),[]),K=[].concat(W,[M]).reduce((function(e,t){return e.concat([t,t+"-"+$,t+"-"+H])}),[]),X=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Y(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 J(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Q(e,t,a){return t===F?J(function(e,t){var a=d(e),l=x(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=y();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+S(e),y:u}}(e,a)):p(t)?function(e,t){var a=w(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):J(function(e){var t,a=x(e),l=_(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=h(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=h(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+S(e),u=-l.scrollTop;return"rtl"===L(n||a).direction&&(o+=h(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(x(e)))}function Z(e){var t=R(P(e)),a=["absolute","fixed"].indexOf(L(e).position)>=0&&v(e)?B(e):e;return p(a)?t.filter((function(e){return p(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&f(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==O(e)})):[]}function ee(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function ae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function le(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ee(n):null,i=n?te(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case D:t={x:o,y:a.y-l.height};break;case j:t={x:o,y:a.y+a.height};break;case I:t={x:a.x+a.width,y:u};break;case V:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ae(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case $:t[s]=t[s]-(a[c]/2-l[c]/2);break;case H:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function ne(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?N:u,c=l.rootBoundary,d=void 0===c?F:c,v=l.elementContext,f=void 0===v?z:v,g=l.altBoundary,b=void 0!==g&&g,y=l.padding,_=void 0===y?0:y,O=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof _?_:(a=_,W.reduce((function(e,t){return e[t]=a,e}),{}))),S=f===z?U:z,L=e.rects.popper,k=e.elements[b?S:f],T=function(e,t,a,l){var n="clippingParents"===t?Z(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=Q(e,a,l);return t.top=h(n.top,t.top),t.right=m(n.right,t.right),t.bottom=m(n.bottom,t.bottom),t.left=h(n.left,t.left),t}),Q(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}(p(k)?k:k.contextElement||x(e.elements.popper),s,d,o),E=w(e.elements.reference),P=le({reference:E,element:L,strategy:"absolute",placement:r}),q=J(Object.assign({},L,P)),R=f===z?q:E,C={top:T.top-R.top+O.top,bottom:R.bottom-T.bottom+O.bottom,left:T.left-R.left+O.left,right:R.right-T.right+O.right},A=e.modifiersData.offset;if(f===z&&A){var B=A[r];Object.keys(C).forEach((function(e){var t=[I,j].indexOf(e)>=0?1:-1,a=[D,j].indexOf(e)>=0?"y":"x";C[e]+=B[a]*t}))}return C}var re={placement:"bottom",modifiers:[],strategy:"absolute"};function ie(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,he,Oe):pe(v?_e:ge,he,v?Oe:be);S[x]=xe,R[x]=xe-he}t.modifiersData[l]=R}},requiresIfExists:["offset"]},fe={left:"right",right:"left",bottom:"top",top:"bottom"};function he(e){return e.replace(/left|right|bottom|top/g,(function(e){return fe[e]}))}var me={start:"end",end:"start"};function ge(e){return e.replace(/start|end/g,(function(e){return me[e]}))}function be(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?K:u,c=te(l),d=c?o?G:G.filter((function(e){return te(e)===c})):W,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]=ne(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[ee(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ye={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=ee(m),b=u||(g===m||!f?[he(m)]:function(e){if(ee(e)===M)return[];var t=he(e);return[ge(e),t,ge(t)]}(m)),y=[m].concat(b).reduce((function(e,a){return e.concat(ee(a)===M?be(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=ne(t,{placement:k,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?I:V:E?j:D;w[q]>_[q]&&(C=he(C));var A=he(C),B=[];if(r&&B.push(R[T]<=0),o&&B.push(R[C]<=0,R[A]<=0),B.every((function(e){return e}))){S=k,x=!1;break}O.set(k,B)}if(x)for(var W=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"===W(H))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(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=de(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[ve,ye,{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 _e(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 Oe(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,k=n.wrapper,T=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!==T.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?T.value.querySelector("input").focus():k.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&&T.value&&T.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?T.value.querySelector("input").focus():u.value||k.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,m)},preparePointer:B}}function xe(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 Se(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 Le(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 ke(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 Ee(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 Pe={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,ke,n,i,we,r,a,_e,s,Se,c,Oe,xe,Le]),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 qe=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)};qe._withStripped=!0;return Ee({render:qe,staticRenderFns:[]},undefined,Pe,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,"")}const u=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!u(e[n],t[n]))return!1}return!0};function s(a,n,r){const{options:i,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:h,appendNewTag:m,appendNewOption:g,multipleLabel:b,object:y,loading:w,delay:_,resolveOnLoad:O,minChars:x,filterResults:S,clearOnSearch:L,clearOnSelect:k,valueProp:T,allowAbsent:E,groupLabel:P,canDeselect:q,max:R,strict:C,closeOnSelect:A,closeOnDeselect:B,groups:D,reverse:j,infinite:I,groupOptions:V,groupHideEmpty:M,groupSelect:W,onCreate:$,disabledProp:H,searchStart:N,searchFilter:F}=e.toRefs(a),z=e.getCurrentInstance().proxy,U=r.iv,G=r.ev,K=r.search,X=r.clearSearch,Y=r.update,J=r.pointer,Q=r.setPointer,Z=r.clearPointer,ee=r.focus,te=r.deactivate,ae=r.close,le=r.localize,ne=e.ref([]),re=e.ref([]),ie=e.ref(!1),oe=e.ref(null),ue=e.ref(I.value&&-1===d.value?10:d.value),se=e.computed({get:()=>re.value,set:e=>re.value=e}),ce=l((()=>v.value||f.value||!1)),de=l((()=>void 0!==m.value?m.value:void 0===g.value||g.value)),pe=e.computed((()=>{if(D.value){let e=he.value||[],t=[];return e.forEach((e=>{Ne(e[V.value]).forEach((a=>{t.push(Object.assign({},a,e[H.value]?{[H.value]:!0}:{}))}))})),t}{let e=Ne(re.value||[]);return ne.value.length&&(e=e.concat(ne.value)),e}})),ve=e.computed((()=>{let e=pe.value;return j.value&&(e=e.reverse()),Oe.value.length&&(e=Oe.value.concat(e)),He(e)})),fe=e.computed((()=>{let e=ve.value;return ue.value>0&&(e=e.slice(0,ue.value)),e})),he=e.computed((()=>{if(!D.value)return[];let e=[],t=re.value||[];return ne.value.length&&e.push({[P.value]:" ",[V.value]:[...ne.value],__CREATE__:!0}),e.concat(t)})),me=e.computed((()=>{let e=[...he.value].map((e=>({...e})));return Oe.value.length&&(e[0]&&e[0].__CREATE__?e[0][V.value]=[...Oe.value,...e[0][V.value]]:e=[{[P.value]:" ",[V.value]:[...Oe.value],__CREATE__:!0}].concat(e)),e})),ge=e.computed((()=>{if(!D.value)return[];let e=me.value;return $e((e||[]).map(((e,t)=>{const a=Ne(e[V.value]);return{...e,index:t,group:!0,[V.value]:He(a,!1).map((t=>Object.assign({},t,e[H.value]?{[H.value]:!0}:{}))),__VISIBLE__:He(a).map((t=>Object.assign({},t,e[H.value]?{[H.value]:!0}:{})))}})))})),be=e.computed((()=>{switch(s.value){case"single":return!t(U.value[T.value]);case"multiple":case"tags":return!t(U.value)&&U.value.length>0}})),ye=e.computed((()=>void 0!==b.value?b.value(U.value,z):U.value&&U.value.length>1?`${U.value.length} options selected`:"1 option selected")),we=l((()=>!pe.value.length&&!ie.value&&!Oe.value.length)),_e=l((()=>pe.value.length>0&&0==fe.value.length&&(K.value&&D.value||!D.value))),Oe=e.computed((()=>!1!==ce.value&&K.value?-1!==Me(K.value)?[]:[{[T.value]:K.value,[xe.value[0]]:K.value,[h.value]:K.value,__CREATE__:!0}]:[])),xe=e.computed((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),Se=l((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Le=l((()=>w.value||ie.value)),ke=e=>{switch("object"!=typeof e&&(e=Ve(e)),s.value){case"single":Y(e);break;case"multiple":case"tags":Y(U.value.concat(e))}n.emit("select",Ee(e),e,z)},Te=e=>{switch("object"!=typeof e&&(e=Ve(e)),s.value){case"single":qe();break;case"tags":case"multiple":Y(Array.isArray(e)?U.value.filter((t=>-1===e.map((e=>e[T.value])).indexOf(t[T.value]))):U.value.filter((t=>t[T.value]!=e[T.value])))}n.emit("deselect",Ee(e),e,z)},Ee=e=>y.value?e:e[T.value],Pe=e=>{Te(e)},qe=()=>{Y(Se.value),n.emit("clear",z)},Re=e=>{if(void 0!==e.group)return"single"!==s.value&&(Ie(e[V.value])&&e[V.value].length);switch(s.value){case"single":return!t(U.value)&&(U.value[T.value]==e[T.value]||"object"==typeof U.value[T.value]&&"object"==typeof e[T.value]&&u(U.value[T.value],e[T.value]));case"tags":case"multiple":return!t(U.value)&&-1!==U.value.map((e=>e[T.value])).indexOf(e[T.value])}},Ce=e=>!0===e[H.value],Ae=()=>!(void 0===R||-1===R.value||!be.value&&R.value>0)&&U.value.length>=R.value,Be=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&Re(e))return q.value&&Te(e),void(B.value&&(Z(),ae()));e&&De(e),k.value&&X(),A.value&&(Z(),ae()),e&&ke(e);break;case"multiple":if(e&&Re(e))return Te(e),void(B.value&&(Z(),ae()));if(Ae())return void n.emit("max",z);e&&(De(e),ke(e)),k.value&&X(),p.value&&Z(),A.value&&ae();break;case"tags":if(e&&Re(e))return Te(e),void(B.value&&(Z(),ae()));if(Ae())return void n.emit("max",z);e&&De(e),k.value&&X(),e&&ke(e),p.value&&Z(),A.value&&ae()}A.value||ee()},De=e=>{void 0===Ve(e[T.value])&&ce.value&&(n.emit("tag",e[T.value],z),n.emit("option",e[T.value],z),n.emit("create",e[T.value],z),de.value&&We(e),X())},je=e=>void 0===e.find((e=>!Re(e)&&!e[H.value])),Ie=e=>void 0===e.find((e=>!Re(e))),Ve=e=>pe.value[pe.value.map((e=>String(e[T.value]))).indexOf(String(e))],Me=e=>pe.value.findIndex((t=>xe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),We=e=>{ne.value.push(e)},$e=e=>M.value?e.filter((e=>K.value?e.__VISIBLE__.length:e[V.value].length)):e.filter((e=>!K.value||e.__VISIBLE__.length)),He=(e,t=!0)=>{let a=e;if(K.value&&S.value){let e=F.value;e||(e=(e,t,a)=>xe.value.some((a=>{let l=o(le(e[a]),C.value);return N.value?l.startsWith(o(t,C.value)):-1!==l.indexOf(o(t,C.value))}))),a=a.filter((t=>e(t,K.value,z)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&Re(e))(e)))),a},Ne=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,[xe.value[0]]:a,[h.value]:a}}))),t=t&&Array.isArray(t)?t.map((e=>"object"==typeof e?e:{[T.value]:e,[xe.value[0]]:e,[h.value]:e})):[],t},Fe=()=>{t(G.value)||(U.value=Ge(G.value))},ze=e=>(ie.value=!0,new Promise(((t,a)=>{i.value(K.value,z).then((t=>{re.value=t||[],"function"==typeof e&&e(t),ie.value=!1})).catch((e=>{console.error(e),re.value=[],ie.value=!1})).finally((()=>{t()}))}))),Ue=()=>{if(be.value)if("single"===s.value){let e=Ve(U.value[T.value]);if(void 0!==e){let t=e[h.value];U.value[h.value]=t,y.value&&(G.value[h.value]=t)}}else U.value.forEach(((e,t)=>{let a=Ve(U.value[t][T.value]);if(void 0!==a){let e=a[h.value];U.value[t][h.value]=e,y.value&&(G.value[t][h.value]=e)}}))},Ge=e=>t(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?Ve(e)||(E.value?{[h.value]:e,[T.value]:e,[xe.value[0]]:e}:{}):e.filter((e=>!!Ve(e)||E.value)).map((e=>Ve(e)||{[h.value]:e,[T.value]:e,[xe.value[0]]:e})),Ke=()=>{oe.value=e.watch(K,(e=>{e.length{e==K.value&&i.value(K.value,z).then((t=>{e!=K.value&&K.value||(re.value=t,J.value=fe.value.filter((e=>!0!==e[H.value]))[0]||null,ie.value=!1)})).catch((e=>{console.error(e)}))}),_.value))}),{flush:"sync"})};if("single"!==s.value&&!t(G.value)&&!Array.isArray(G.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return i&&"function"==typeof i.value?O.value?ze(Fe):1==y.value&&Fe():(re.value=i.value,Fe()),_.value>-1&&Ke(),e.watch(_,((e,t)=>{oe.value&&oe.value(),e>=0&&Ke()})),e.watch(G,(e=>{if(t(e))Y(Ge(e),!1);else switch(s.value){case"single":(y.value?e[T.value]!=U.value[T.value]:e!=U.value[T.value])&&Y(Ge(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[T.value])):e,U.value.map((e=>e[T.value])))||Y(Ge(e),!1)}}),{deep:!0}),e.watch(i,((e,t)=>{"function"==typeof a.options?O.value&&(!t||e&&e.toString()!==t.toString())&&ze():(re.value=a.options,Object.keys(U.value).length||Fe(),Ue())})),e.watch(h,Ue),e.watch(d,((e,t)=>{ue.value=I.value&&-1===e?10:e})),{resolvedOptions:se,pfo:ve,fo:fe,filteredOptions:fe,hasSelected:be,multipleLabelText:ye,eo:pe,extendedOptions:pe,eg:he,extendedGroups:he,fg:ge,filteredGroups:ge,noOptions:we,noResults:_e,resolving:ie,busy:Le,offset:ue,select:ke,deselect:Te,remove:Pe,selectAll:()=>{"single"!==s.value&&ke(fe.value.filter((e=>!e.disabled&&!Re(e))))},clear:qe,isSelected:Re,isDisabled:Ce,isMax:Ae,getOption:Ve,handleOptionClick:e=>{if(!Ce(e))return $.value&&!Re(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=$.value(e,z))instanceof Promise)?(ie.value=!0,void e.then((e=>{ie.value=!1,Be(e)}))):void Be(e)},handleGroupClick:e=>{if(!Ce(e)&&"single"!==s.value&&W.value){switch(s.value){case"multiple":case"tags":je(e[V.value])?Te(e[V.value]):ke(e[V.value].filter((e=>-1===U.value.map((e=>e[T.value])).indexOf(e[T.value]))).filter((e=>!e[H.value])).filter(((e,t)=>U.value.length+1+t<=R.value||-1===R.value))),p.value&&J.value&&Q(ge.value.filter((e=>!e[H.value]))[J.value.index])}A.value&&te()}},handleTagRemove:(e,t)=>{0===t.button?Pe(e):t.preventDefault()},refreshOptions:e=>{ze(e)},resolveOptions:ze,refreshLabels:Ue}}function c(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])))),k=l((()=>"single"!==c.value&&d.value)),T=l((()=>y.value&&y.value.group)),E=e.computed((()=>V(y.value))),P=e.computed((()=>{const e=T.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(T.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])),j=e.computed((()=>[...R.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),I=()=>{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=T.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?I():_())})),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:k,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:I,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(T.value?g(y.value):m(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&k.value?L.value[0].__CREATE__?S.value[0]:L.value[0]:S.value[0])||null);else if(s.value&&k.value){let e=T.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&&k.value&&(e=j.value,void 0===e&&(e=R.value)),w(e||null)}else if(s.value&&k.value){let e=T.value?D.value:A.value;void 0===e&&(e=T.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 d(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function p(e){return e instanceof d(e).Element||e instanceof Element}function v(e){return e instanceof d(e).HTMLElement||e instanceof HTMLElement}function f(e){return"undefined"!=typeof ShadowRoot&&(e instanceof d(e).ShadowRoot||e instanceof ShadowRoot)}var h=Math.max,m=Math.min,g=Math.round;function b(){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 y(){return!/^((?!chrome|android).)*safari/i.test(b())}function w(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&v(e)&&(n=e.offsetWidth>0&&g(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&g(l.height)/e.offsetHeight||1);var i=(p(e)?d(e):window).visualViewport,o=!y()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,f=l.height/r;return{width:c,height:f,top:s,right:u+c,bottom:s+f,left:u,x:u,y:s}}function _(e){var t=d(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function O(e){return e?(e.nodeName||"").toLowerCase():null}function x(e){return((p(e)?e.ownerDocument:e.document)||window.document).documentElement}function S(e){return w(x(e)).left+_(e).scrollLeft}function L(e){return d(e).getComputedStyle(e)}function k(e){var t=L(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=v(t),i=v(t)&&function(e){var t=e.getBoundingClientRect(),a=g(t.width)/e.offsetWidth||1,l=g(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=x(t),u=w(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==O(t)||k(o))&&(s=(l=t)!==d(l)&&v(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:_(l)),v(t)?((c=w(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=S(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function E(e){var t=w(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 P(e){return"html"===O(e)?e:e.assignedSlot||e.parentNode||(f(e)?e.host:null)||x(e)}function q(e){return["html","body","#document"].indexOf(O(e))>=0?e.ownerDocument.body:v(e)&&k(e)?e:q(P(e))}function R(e,t){var a;void 0===t&&(t=[]);var l=q(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=d(l),i=n?[r].concat(r.visualViewport||[],k(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(R(P(i)))}function C(e){return["table","td","th"].indexOf(O(e))>=0}function A(e){return v(e)&&"fixed"!==L(e).position?e.offsetParent:null}function B(e){for(var t=d(e),a=A(e);a&&C(a)&&"static"===L(a).position;)a=A(a);return a&&("html"===O(a)||"body"===O(a)&&"static"===L(a).position)?t:a||function(e){var t=/firefox/i.test(b());if(/Trident/i.test(b())&&v(e)&&"fixed"===L(e).position)return null;var a=P(e);for(f(a)&&(a=a.host);v(a)&&["html","body"].indexOf(O(a))<0;){var l=L(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 D="top",j="bottom",I="right",V="left",M="auto",W=[D,j,I,V],$="start",H="end",N="clippingParents",F="viewport",z="popper",U="reference",G=W.reduce((function(e,t){return e.concat([t+"-"+$,t+"-"+H])}),[]),K=[].concat(W,[M]).reduce((function(e,t){return e.concat([t,t+"-"+$,t+"-"+H])}),[]),X=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Y(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 J(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Q(e,t,a){return t===F?J(function(e,t){var a=d(e),l=x(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=y();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+S(e),y:u}}(e,a)):p(t)?function(e,t){var a=w(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):J(function(e){var t,a=x(e),l=_(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=h(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=h(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+S(e),u=-l.scrollTop;return"rtl"===L(n||a).direction&&(o+=h(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(x(e)))}function Z(e){var t=R(P(e)),a=["absolute","fixed"].indexOf(L(e).position)>=0&&v(e)?B(e):e;return p(a)?t.filter((function(e){return p(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&f(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==O(e)})):[]}function ee(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function ae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function le(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ee(n):null,i=n?te(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case D:t={x:o,y:a.y-l.height};break;case j:t={x:o,y:a.y+a.height};break;case I:t={x:a.x+a.width,y:u};break;case V:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ae(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case $:t[s]=t[s]-(a[c]/2-l[c]/2);break;case H:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function ne(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?N:u,c=l.rootBoundary,d=void 0===c?F:c,v=l.elementContext,f=void 0===v?z:v,g=l.altBoundary,b=void 0!==g&&g,y=l.padding,_=void 0===y?0:y,O=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof _?_:(a=_,W.reduce((function(e,t){return e[t]=a,e}),{}))),S=f===z?U:z,L=e.rects.popper,k=e.elements[b?S:f],T=function(e,t,a,l){var n="clippingParents"===t?Z(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=Q(e,a,l);return t.top=h(n.top,t.top),t.right=m(n.right,t.right),t.bottom=m(n.bottom,t.bottom),t.left=h(n.left,t.left),t}),Q(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}(p(k)?k:k.contextElement||x(e.elements.popper),s,d,o),E=w(e.elements.reference),P=le({reference:E,element:L,strategy:"absolute",placement:r}),q=J(Object.assign({},L,P)),R=f===z?q:E,C={top:T.top-R.top+O.top,bottom:R.bottom-T.bottom+O.bottom,left:T.left-R.left+O.left,right:R.right-T.right+O.right},A=e.modifiersData.offset;if(f===z&&A){var B=A[r];Object.keys(C).forEach((function(e){var t=[I,j].indexOf(e)>=0?1:-1,a=[D,j].indexOf(e)>=0?"y":"x";C[e]+=B[a]*t}))}return C}var re={placement:"bottom",modifiers:[],strategy:"absolute"};function ie(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,he,Oe):pe(v?_e:ge,he,v?Oe:be);S[x]=xe,R[x]=xe-he}t.modifiersData[l]=R}},requiresIfExists:["offset"]},fe={left:"right",right:"left",bottom:"top",top:"bottom"};function he(e){return e.replace(/left|right|bottom|top/g,(function(e){return fe[e]}))}var me={start:"end",end:"start"};function ge(e){return e.replace(/start|end/g,(function(e){return me[e]}))}function be(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?K:u,c=te(l),d=c?o?G:G.filter((function(e){return te(e)===c})):W,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]=ne(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[ee(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ye={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=ee(m),b=u||(g===m||!f?[he(m)]:function(e){if(ee(e)===M)return[];var t=he(e);return[ge(e),t,ge(t)]}(m)),y=[m].concat(b).reduce((function(e,a){return e.concat(ee(a)===M?be(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=ne(t,{placement:k,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?I:V:E?j:D;w[q]>_[q]&&(C=he(C));var A=he(C),B=[];if(r&&B.push(R[T]<=0),o&&B.push(R[C]<=0,R[A]<=0),B.every((function(e){return e}))){S=k,x=!1;break}O.set(k,B)}if(x)for(var W=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"===W(H))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(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=de(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[ve,ye,{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 _e(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 Oe(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,k=n.wrapper,T=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!==T.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?T.value.querySelector("input").focus():k.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&&T.value&&T.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?T.value.querySelector("input").focus():u.value||k.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,m)},preparePointer:B}}function xe(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 Se(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 Le(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 ke(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 Ee(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 Pe={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,ke,n,i,we,r,a,_e,s,Se,c,Oe,xe,Le]),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 qe=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)};qe._withStripped=!0;return Ee({render:qe,staticRenderFns:[]},undefined,Pe,undefined,false,undefined,!1,void 0,void 0,void 0)}(Vue); diff --git a/dist/multiselect.vue2.js b/dist/multiselect.vue2.js index 3fece9d..ae8c67f 100644 --- a/dist/multiselect.vue2.js +++ b/dist/multiselect.vue2.js @@ -908,9 +908,14 @@ function useOptions (props, context, dep) } // Transforming an plain arrays to an array of objects - uo = uo.map((val) => { - return typeof val === 'object' ? val : { [valueProp.value]: val, [trackBy.value[0]]: val, [label.value]: val} - }); + /* istanbul ignore else */ + if (uo && Array.isArray(uo)) { + uo = uo.map((val) => { + return typeof val === 'object' ? val : { [valueProp.value]: val, [trackBy.value[0]]: val, [label.value]: val} + }); + } else { + uo = []; + } return uo }; diff --git a/dist/multiselect.vue2.min.js b/dist/multiselect.vue2.min.js index 610a366..3c96337 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 p(a,l,n){const{object:r,valueProp:i,mode:o}=e(a),u=t().proxy,s=n.iv,p=e=>r.value||c(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],d=e=>c(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=p(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function d(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=d((()=>void 0!==i.value?i.value:r.value)),p=n((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),v=d((()=>"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:p}}function f(a,n,i){const{regex:o}=e(a),u=t().proxy,s=i.isOpen,c=i.open,p=l(null);return r(p,(e=>{!s.value&&e&&c(),n.emit("search-change",e,u)})),{search:p,clearSearch:()=>{p.value=""},handleSearchInput:e=>{p.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,"")}const m=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!m(e[n],t[n]))return!1}return!0};function b(a,i,o){const{options:u,mode:s,trackBy:p,limit:v,hideSelected:f,createTag:h,createOption:b,label:y,appendNewTag:_,appendNewOption:O,multipleLabel:w,object:x,loading:S,delay:L,resolveOnLoad:k,minChars:T,filterResults:E,clearOnSearch:P,clearOnSelect:q,valueProp:A,allowAbsent:C,groupLabel:B,canDeselect:D,max:j,strict:R,closeOnSelect:I,closeOnDeselect:V,groups:M,reverse:W,infinite:$,groupOptions:H,groupHideEmpty:N,groupSelect:F,onCreate:z,disabledProp:G,searchStart:U,searchFilter:K}=e(a),X=t().proxy,Y=o.iv,J=o.ev,Q=o.search,Z=o.clearSearch,ee=o.update,te=o.pointer,ae=o.setPointer,le=o.clearPointer,ne=o.focus,re=o.deactivate,ie=o.close,oe=o.localize,ue=l([]),se=l([]),ce=l(!1),pe=l(null),de=l($.value&&-1===v.value?10:v.value),ve=n({get:()=>se.value,set:e=>se.value=e}),fe=d((()=>h.value||b.value||!1)),he=d((()=>void 0!==_.value?_.value:void 0===O.value||O.value)),ge=n((()=>{if(M.value){let e=ye.value||[],t=[];return e.forEach((e=>{Ue(e[H.value]).forEach((a=>{t.push(Object.assign({},a,e[G.value]?{[G.value]:!0}:{}))}))})),t}{let e=Ue(se.value||[]);return ue.value.length&&(e=e.concat(ue.value)),e}})),me=n((()=>{let e=ge.value;return W.value&&(e=e.reverse()),ke.value.length&&(e=ke.value.concat(e)),Ge(e)})),be=n((()=>{let e=me.value;return de.value>0&&(e=e.slice(0,de.value)),e})),ye=n((()=>{if(!M.value)return[];let e=[],t=se.value||[];return ue.value.length&&e.push({[B.value]:" ",[H.value]:[...ue.value],__CREATE__:!0}),e.concat(t)})),_e=n((()=>{let e=[...ye.value].map((e=>({...e})));return ke.value.length&&(e[0]&&e[0].__CREATE__?e[0][H.value]=[...ke.value,...e[0][H.value]]:e=[{[B.value]:" ",[H.value]:[...ke.value],__CREATE__:!0}].concat(e)),e})),Oe=n((()=>{if(!M.value)return[];let e=_e.value;return ze((e||[]).map(((e,t)=>{const a=Ue(e[H.value]);return{...e,index:t,group:!0,[H.value]:Ge(a,!1).map((t=>Object.assign({},t,e[G.value]?{[G.value]:!0}:{}))),__VISIBLE__:Ge(a).map((t=>Object.assign({},t,e[G.value]?{[G.value]:!0}:{})))}})))})),we=n((()=>{switch(s.value){case"single":return!c(Y.value[A.value]);case"multiple":case"tags":return!c(Y.value)&&Y.value.length>0}})),xe=n((()=>void 0!==w.value?w.value(Y.value,X):Y.value&&Y.value.length>1?`${Y.value.length} options selected`:"1 option selected")),Se=d((()=>!ge.value.length&&!ce.value&&!ke.value.length)),Le=d((()=>ge.value.length>0&&0==be.value.length&&(Q.value&&M.value||!M.value))),ke=n((()=>!1!==fe.value&&Q.value?-1!==Ne(Q.value)?[]:[{[A.value]:Q.value,[Te.value[0]]:Q.value,[y.value]:Q.value,__CREATE__:!0}]:[])),Te=n((()=>p.value?Array.isArray(p.value)?p.value:[p.value]:[y.value])),Ee=d((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Pe=d((()=>S.value||ce.value)),qe=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":ee(e);break;case"multiple":case"tags":ee(Y.value.concat(e))}i.emit("select",Ce(e),e,X)},Ae=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":De();break;case"tags":case"multiple":ee(Array.isArray(e)?Y.value.filter((t=>-1===e.map((e=>e[A.value])).indexOf(t[A.value]))):Y.value.filter((t=>t[A.value]!=e[A.value])))}i.emit("deselect",Ce(e),e,X)},Ce=e=>x.value?e:e[A.value],Be=e=>{Ae(e)},De=()=>{ee(Ee.value),i.emit("clear",X)},je=e=>{if(void 0!==e.group)return"single"!==s.value&&($e(e[H.value])&&e[H.value].length);switch(s.value){case"single":return!c(Y.value)&&(Y.value[A.value]==e[A.value]||"object"==typeof Y.value[A.value]&&"object"==typeof e[A.value]&&m(Y.value[A.value],e[A.value]));case"tags":case"multiple":return!c(Y.value)&&-1!==Y.value.map((e=>e[A.value])).indexOf(e[A.value])}},Re=e=>!0===e[G.value],Ie=()=>!(void 0===j||-1===j.value||!we.value&&j.value>0)&&Y.value.length>=j.value,Ve=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&je(e))return D.value&&Ae(e),void(V.value&&(le(),ie()));e&&Me(e),q.value&&Z(),I.value&&(le(),ie()),e&&qe(e);break;case"multiple":if(e&&je(e))return Ae(e),void(V.value&&(le(),ie()));if(Ie())return void i.emit("max",X);e&&(Me(e),qe(e)),q.value&&Z(),f.value&&le(),I.value&&ie();break;case"tags":if(e&&je(e))return Ae(e),void(V.value&&(le(),ie()));if(Ie())return void i.emit("max",X);e&&Me(e),q.value&&Z(),e&&qe(e),f.value&&le(),I.value&&ie()}I.value||ne()},Me=e=>{void 0===He(e[A.value])&&fe.value&&(i.emit("tag",e[A.value],X),i.emit("option",e[A.value],X),i.emit("create",e[A.value],X),he.value&&Fe(e),Z())},We=e=>void 0===e.find((e=>!je(e)&&!e[G.value])),$e=e=>void 0===e.find((e=>!je(e))),He=e=>ge.value[ge.value.map((e=>String(e[A.value]))).indexOf(String(e))],Ne=e=>ge.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=>{ue.value.push(e)},ze=e=>N.value?e.filter((e=>Q.value?e.__VISIBLE__.length:e[H.value].length)):e.filter((e=>!Q.value||e.__VISIBLE__.length)),Ge=(e,t=!0)=>{let a=e;if(Q.value&&E.value){let e=K.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=g(oe(e[a]),R.value);return U.value?l.startsWith(g(t,R.value)):-1!==l.indexOf(g(t,R.value))}))),a=a.filter((t=>e(t,Q.value,X)))}return f.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&f.value&&je(e))(e)))),a},Ue=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{[A.value]:e,[Te.value[0]]:a,[y.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[A.value]:e,[Te.value[0]]:e,[y.value]:e})),t},Ke=()=>{c(J.value)||(Y.value=Je(J.value))},Xe=e=>(ce.value=!0,new Promise(((t,a)=>{u.value(Q.value,X).then((t=>{se.value=t||[],"function"==typeof e&&e(t),ce.value=!1})).catch((e=>{console.error(e),se.value=[],ce.value=!1})).finally((()=>{t()}))}))),Ye=()=>{if(we.value)if("single"===s.value){let e=He(Y.value[A.value]);if(void 0!==e){let t=e[y.value];Y.value[y.value]=t,x.value&&(J.value[y.value]=t)}}else Y.value.forEach(((e,t)=>{let a=He(Y.value[t][A.value]);if(void 0!==a){let e=a[y.value];Y.value[t][y.value]=e,x.value&&(J.value[t][y.value]=e)}}))},Je=e=>c(e)?"single"===s.value?{}:[]:x.value?e:"single"===s.value?He(e)||(C.value?{[y.value]:e,[A.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!He(e)||C.value)).map((e=>He(e)||{[y.value]:e,[A.value]:e,[Te.value[0]]:e})),Qe=()=>{pe.value=r(Q,(e=>{e.length{e==Q.value&&u.value(Q.value,X).then((t=>{e!=Q.value&&Q.value||(se.value=t,te.value=be.value.filter((e=>!0!==e[G.value]))[0]||null,ce.value=!1)})).catch((e=>{console.error(e)}))}),L.value))}),{flush:"sync"})};if("single"!==s.value&&!c(J.value)&&!Array.isArray(J.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?k.value?Xe(Ke):1==x.value&&Ke():(se.value=u.value,Ke()),L.value>-1&&Qe(),r(L,((e,t)=>{pe.value&&pe.value(),e>=0&&Qe()})),r(J,(e=>{if(c(e))ee(Je(e),!1);else switch(s.value){case"single":(x.value?e[A.value]!=Y.value[A.value]:e!=Y.value[A.value])&&ee(Je(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]}))})(x.value?e.map((e=>e[A.value])):e,Y.value.map((e=>e[A.value])))||ee(Je(e),!1)}}),{deep:!0}),r(u,((e,t)=>{"function"==typeof a.options?k.value&&(!t||e&&e.toString()!==t.toString())&&Xe():(se.value=a.options,Object.keys(Y.value).length||Ke(),Ye())})),r(y,Ye),r(v,((e,t)=>{de.value=$.value&&-1===e?10:e})),{resolvedOptions:ve,pfo:me,fo:be,filteredOptions:be,hasSelected:we,multipleLabelText:xe,eo:ge,extendedOptions:ge,eg:ye,extendedGroups:ye,fg:Oe,filteredGroups:Oe,noOptions:Se,noResults:Le,resolving:ce,busy:Pe,offset:de,select:qe,deselect:Ae,remove:Be,selectAll:()=>{"single"!==s.value&&qe(be.value.filter((e=>!e.disabled&&!je(e))))},clear:De,isSelected:je,isDisabled:Re,isMax:Ie,getOption:He,handleOptionClick:e=>{if(!Re(e))return z.value&&!je(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=z.value(e,X))instanceof Promise)?(ce.value=!0,void e.then((e=>{ce.value=!1,Ve(e)}))):void Ve(e)},handleGroupClick:e=>{if(!Re(e)&&"single"!==s.value&&F.value){switch(s.value){case"multiple":case"tags":We(e[H.value])?Ae(e[H.value]):qe(e[H.value].filter((e=>-1===Y.value.map((e=>e[A.value])).indexOf(e[A.value]))).filter((e=>!e[G.value])).filter(((e,t)=>Y.value.length+1+t<=j.value||-1===j.value))),f.value&&te.value&&ae(Oe.value.filter((e=>!e[G.value]))[te.value.index])}I.value&&re()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{Xe(e)},resolveOptions:Xe,refreshLabels:Ye}}function y(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:p,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,k=l.isOpen,T=n((()=>m.value.filter((e=>!e[h.value])))),E=n((()=>b.value.filter((e=>!e[h.value])))),P=d((()=>"single"!==v.value&&f.value)),q=d((()=>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(T.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;p.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(k,(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((p.value&&P.value?E.value[0].__CREATE__?T.value[0]:E.value[0]:T.value[0])||null);else if(p.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=T.value.map((e=>e[o.value])).indexOf(w.value[o.value])+1;T.value.length<=e&&(e=0),x(T.value[e]||null)}i((()=>{H()}))},backwardPointer:()=>{if(null===w.value){let e=T.value[T.value.length-1];p.value&&P.value&&(e=M.value,void 0===e&&(e=D.value)),x(e||null)}else if(p.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=T.value.map((e=>e[o.value])).indexOf(w.value[o.value])-1;e<0&&(e=T.value.length-1),x(T.value[e]||null)}i((()=>{H()}))}}}function _(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function O(e){return e instanceof _(e).Element||e instanceof Element}function w(e){return e instanceof _(e).HTMLElement||e instanceof HTMLElement}function x(e){return"undefined"!=typeof ShadowRoot&&(e instanceof _(e).ShadowRoot||e instanceof ShadowRoot)}var S=Math.max,L=Math.min,k=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 E(){return!/^((?!chrome|android).)*safari/i.test(T())}function P(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&w(e)&&(n=e.offsetWidth>0&&k(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&k(l.height)/e.offsetHeight||1);var i=(O(e)?_(e):window).visualViewport,o=!E()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,p=l.height/r;return{width:c,height:p,top:s,right:u+c,bottom:s+p,left:u,x:u,y:s}}function q(e){var t=_(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function A(e){return e?(e.nodeName||"").toLowerCase():null}function C(e){return((O(e)?e.ownerDocument:e.document)||window.document).documentElement}function B(e){return P(C(e)).left+q(e).scrollLeft}function D(e){return _(e).getComputedStyle(e)}function j(e){var t=D(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function R(e,t,a){void 0===a&&(a=!1);var l,n,r=w(t),i=w(t)&&function(e){var t=e.getBoundingClientRect(),a=k(t.width)/e.offsetWidth||1,l=k(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=C(t),u=P(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==A(t)||j(o))&&(s=(l=t)!==_(l)&&w(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:q(l)),w(t)?((c=P(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=B(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function I(e){var t=P(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 V(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(x(e)?e.host:null)||C(e)}function M(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:w(e)&&j(e)?e:M(V(e))}function W(e,t){var a;void 0===t&&(t=[]);var l=M(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=_(l),i=n?[r].concat(r.visualViewport||[],j(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(W(V(i)))}function $(e){return["table","td","th"].indexOf(A(e))>=0}function H(e){return w(e)&&"fixed"!==D(e).position?e.offsetParent:null}function N(e){for(var t=_(e),a=H(e);a&&$(a)&&"static"===D(a).position;)a=H(a);return a&&("html"===A(a)||"body"===A(a)&&"static"===D(a).position)?t:a||function(e){var t=/firefox/i.test(T());if(/Trident/i.test(T())&&w(e)&&"fixed"===D(e).position)return null;var a=V(e);for(x(a)&&(a=a.host);w(a)&&["html","body"].indexOf(A(a))<0;){var l=D(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 F="top",z="bottom",G="right",U="left",K="auto",X=[F,z,G,U],Y="start",J="end",Q="clippingParents",Z="viewport",ee="popper",te="reference",ae=X.reduce((function(e,t){return e.concat([t+"-"+Y,t+"-"+J])}),[]),le=[].concat(X,[K]).reduce((function(e,t){return e.concat([t,t+"-"+Y,t+"-"+J])}),[]),ne=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function re(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 ie(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function oe(e,t,a){return t===Z?ie(function(e,t){var a=_(e),l=C(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=E();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+B(e),y:u}}(e,a)):O(t)?function(e,t){var a=P(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):ie(function(e){var t,a=C(e),l=q(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=S(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=S(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+B(e),u=-l.scrollTop;return"rtl"===D(n||a).direction&&(o+=S(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(C(e)))}function ue(e){var t=W(V(e)),a=["absolute","fixed"].indexOf(D(e).position)>=0&&w(e)?N(e):e;return O(a)?t.filter((function(e){return O(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&x(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==A(e)})):[]}function se(e){return e.split("-")[0]}function ce(e){return e.split("-")[1]}function pe(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?se(n):null,i=n?ce(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case F:t={x:o,y:a.y-l.height};break;case z:t={x:o,y:a.y+a.height};break;case G:t={x:a.x+a.width,y:u};break;case U:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?pe(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case Y:t[s]=t[s]-(a[c]/2-l[c]/2);break;case J:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function ve(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?Q:u,c=l.rootBoundary,p=void 0===c?Z:c,d=l.elementContext,v=void 0===d?ee:d,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,X.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===ee?te:ee,_=e.rects.popper,w=e.elements[h?y:v],x=function(e,t,a,l){var n="clippingParents"===t?ue(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=oe(e,a,l);return t.top=S(n.top,t.top),t.right=L(n.right,t.right),t.bottom=L(n.bottom,t.bottom),t.left=S(n.left,t.left),t}),oe(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}(O(w)?w:w.contextElement||C(e.elements.popper),s,p,o),k=P(e.elements.reference),T=de({reference:k,element:_,strategy:"absolute",placement:r}),E=ie(Object.assign({},_,T)),q=v===ee?E:k,A={top:x.top-q.top+b.top,bottom:q.bottom-x.bottom+b.bottom,left:x.left-q.left+b.left,right:q.right-x.right+b.right},B=e.modifiersData.offset;if(v===ee&&B){var D=B[r];Object.keys(A).forEach((function(e){var t=[G,z].indexOf(e)>=0?1:-1,a=[F,z].indexOf(e)>=0?"y":"x";A[e]+=D[a]*t}))}return A}var fe={placement:"bottom",modifiers:[],strategy:"absolute"};function he(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,fe,we):Oe(v?_e:ge,fe,v?we:me);w[O]=xe,q[O]=xe-fe}t.modifiersData[l]=q}},requiresIfExists:["offset"]},xe={left:"right",right:"left",bottom:"top",top:"bottom"};function Se(e){return e.replace(/left|right|bottom|top/g,(function(e){return xe[e]}))}var Le={start:"end",end:"start"};function ke(e){return e.replace(/start|end/g,(function(e){return Le[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?le:u,c=ce(l),p=c?o?ae:ae.filter((function(e){return ce(e)===c})):X,d=p.filter((function(e){return s.indexOf(e)>=0}));0===d.length&&(d=p);var v=d.reduce((function(t,a){return t[a]=ve(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[se(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var Ee={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,p=a.rootBoundary,d=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=se(g),b=u||(m===g||!f?[Se(g)]:function(e){if(se(e)===K)return[];var t=Se(e);return[ke(e),t,ke(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(se(a)===K?Te(t,{placement:a,boundary:c,rootBoundary:p,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=ve(t,{placement:k,boundary:c,rootBoundary:p,altBoundary:d,padding:s}),C=P?E?G:U:E?z:F;_[q]>O[q]&&(C=Se(C));var B=Se(C),D=[];if(r&&D.push(A[T]<=0),o&&D.push(A[C]<=0,A[B]<=0),D.every((function(e){return e}))){S=k,x=!1;break}w.set(k,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 Pe(a,n,r){const{disabled:s,appendTo:c,appendToBody:p,openDirection:v}=e(a),f=t().proxy,h=r.multiselect,g=r.dropdown,m=l(!1),b=l(null),y=l(null),_=d((()=>c.value||p.value)),O=d((()=>"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=_e(h.value,g.value,{strategy:x(h.value)?"fixed":void 0,placement:v.value,modifiers:[we,Ee,{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 qe(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,p=n.clearSearch,v=n.isOpen,f=n.wrapper,h=n.tags,g=l(!1),m=l(!1),b=d((()=>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&&p())}),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 Ae(a,l,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:p,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,k=n.multiselect,T=n.wrapper,E=n.tags,P=n.isOpen,q=n.open,A=n.blur,C=n.fo,B=d((()=>f.value||h.value||!1)),D=d((()=>void 0!==i.value?i.value:void 0!==v.value?v.value:["enter"])),j=()=>{"tags"===r.value&&!s.value&&B.value&&u.value&&!p.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=[...k.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():T.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||T.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,m)},preparePointer:j}}function Ce(t,a,l){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,p=l.isSelected,v=l.isDisabled,f=l.isActive,h=l.canPointGroups,g=l.resolving,m=l.fo,b=l.placement,y=d((()=>({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}))),_=d((()=>!!(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(p(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(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(p(t)?e.optionSelectedPointed:e.optionPointed):p(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 Be(t,a,n){const{limit:u,infinite:c}=e(t),p=n.isOpen,v=n.offset,f=n.search,h=n.pfo,g=n.eo,m=l(null),b=s(null),y=d((()=>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=()=>{p.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 De(t,a,r){const{placeholder:i,id:u,valueProp:s,label:c,mode:p,groupLabel:v,aria:f,searchable:h}=e(t),g=r.pointer,m=r.iv,b=r.hasSelected,y=r.multipleLabelText,_=l(null),O=d((()=>(u.value?u.value+"-":"")+"assist")),w=d((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=d((()=>{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=d((()=>i.value)),L=d((()=>"single"!==p.value)),k=n((()=>"single"===p.value&&b.value?m.value[c.value]:"multiple"===p.value&&b.value?y.value:"tags"===p.value&&b.value?m.value.map((e=>e[c.value])).join(", "):"")),T=n((()=>{let e={...f.value};return h.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${O.value} ${e["aria-labelledby"]}`:O.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}"]`);_.value=e?e.innerText:null}})),{arias:T,ariaLabel:k,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 je(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 Re(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}function Ie(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 p;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(p=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=p):t&&(p=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),p)if(c.functional){const e=c.render;c.render=function(t,a){return p.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,p):[p]}return a}const Ve={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,[Re,je,v,h,Pe,f,p,qe,b,Be,y,Ae,Ce,De]),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 Me=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)};Me._withStripped=!0;const We=Ie({render:Me,staticRenderFns:[]},undefined,Ve,undefined,false,undefined,!1,void 0,void 0,void 0);export{We 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 p(a,l,n){const{object:r,valueProp:i,mode:o}=e(a),u=t().proxy,s=n.iv,p=e=>r.value||c(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],d=e=>c(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=p(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function d(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=d((()=>void 0!==i.value?i.value:r.value)),p=n((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),v=d((()=>"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:p}}function f(a,n,i){const{regex:o}=e(a),u=t().proxy,s=i.isOpen,c=i.open,p=l(null);return r(p,(e=>{!s.value&&e&&c(),n.emit("search-change",e,u)})),{search:p,clearSearch:()=>{p.value=""},handleSearchInput:e=>{p.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,"")}const m=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!m(e[n],t[n]))return!1}return!0};function b(a,i,o){const{options:u,mode:s,trackBy:p,limit:v,hideSelected:f,createTag:h,createOption:b,label:y,appendNewTag:_,appendNewOption:O,multipleLabel:w,object:x,loading:S,delay:L,resolveOnLoad:k,minChars:T,filterResults:E,clearOnSearch:P,clearOnSelect:q,valueProp:A,allowAbsent:C,groupLabel:B,canDeselect:D,max:j,strict:R,closeOnSelect:I,closeOnDeselect:V,groups:M,reverse:W,infinite:$,groupOptions:H,groupHideEmpty:N,groupSelect:F,onCreate:z,disabledProp:G,searchStart:U,searchFilter:K}=e(a),X=t().proxy,Y=o.iv,J=o.ev,Q=o.search,Z=o.clearSearch,ee=o.update,te=o.pointer,ae=o.setPointer,le=o.clearPointer,ne=o.focus,re=o.deactivate,ie=o.close,oe=o.localize,ue=l([]),se=l([]),ce=l(!1),pe=l(null),de=l($.value&&-1===v.value?10:v.value),ve=n({get:()=>se.value,set:e=>se.value=e}),fe=d((()=>h.value||b.value||!1)),he=d((()=>void 0!==_.value?_.value:void 0===O.value||O.value)),ge=n((()=>{if(M.value){let e=ye.value||[],t=[];return e.forEach((e=>{Ue(e[H.value]).forEach((a=>{t.push(Object.assign({},a,e[G.value]?{[G.value]:!0}:{}))}))})),t}{let e=Ue(se.value||[]);return ue.value.length&&(e=e.concat(ue.value)),e}})),me=n((()=>{let e=ge.value;return W.value&&(e=e.reverse()),ke.value.length&&(e=ke.value.concat(e)),Ge(e)})),be=n((()=>{let e=me.value;return de.value>0&&(e=e.slice(0,de.value)),e})),ye=n((()=>{if(!M.value)return[];let e=[],t=se.value||[];return ue.value.length&&e.push({[B.value]:" ",[H.value]:[...ue.value],__CREATE__:!0}),e.concat(t)})),_e=n((()=>{let e=[...ye.value].map((e=>({...e})));return ke.value.length&&(e[0]&&e[0].__CREATE__?e[0][H.value]=[...ke.value,...e[0][H.value]]:e=[{[B.value]:" ",[H.value]:[...ke.value],__CREATE__:!0}].concat(e)),e})),Oe=n((()=>{if(!M.value)return[];let e=_e.value;return ze((e||[]).map(((e,t)=>{const a=Ue(e[H.value]);return{...e,index:t,group:!0,[H.value]:Ge(a,!1).map((t=>Object.assign({},t,e[G.value]?{[G.value]:!0}:{}))),__VISIBLE__:Ge(a).map((t=>Object.assign({},t,e[G.value]?{[G.value]:!0}:{})))}})))})),we=n((()=>{switch(s.value){case"single":return!c(Y.value[A.value]);case"multiple":case"tags":return!c(Y.value)&&Y.value.length>0}})),xe=n((()=>void 0!==w.value?w.value(Y.value,X):Y.value&&Y.value.length>1?`${Y.value.length} options selected`:"1 option selected")),Se=d((()=>!ge.value.length&&!ce.value&&!ke.value.length)),Le=d((()=>ge.value.length>0&&0==be.value.length&&(Q.value&&M.value||!M.value))),ke=n((()=>!1!==fe.value&&Q.value?-1!==Ne(Q.value)?[]:[{[A.value]:Q.value,[Te.value[0]]:Q.value,[y.value]:Q.value,__CREATE__:!0}]:[])),Te=n((()=>p.value?Array.isArray(p.value)?p.value:[p.value]:[y.value])),Ee=d((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Pe=d((()=>S.value||ce.value)),qe=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":ee(e);break;case"multiple":case"tags":ee(Y.value.concat(e))}i.emit("select",Ce(e),e,X)},Ae=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":De();break;case"tags":case"multiple":ee(Array.isArray(e)?Y.value.filter((t=>-1===e.map((e=>e[A.value])).indexOf(t[A.value]))):Y.value.filter((t=>t[A.value]!=e[A.value])))}i.emit("deselect",Ce(e),e,X)},Ce=e=>x.value?e:e[A.value],Be=e=>{Ae(e)},De=()=>{ee(Ee.value),i.emit("clear",X)},je=e=>{if(void 0!==e.group)return"single"!==s.value&&($e(e[H.value])&&e[H.value].length);switch(s.value){case"single":return!c(Y.value)&&(Y.value[A.value]==e[A.value]||"object"==typeof Y.value[A.value]&&"object"==typeof e[A.value]&&m(Y.value[A.value],e[A.value]));case"tags":case"multiple":return!c(Y.value)&&-1!==Y.value.map((e=>e[A.value])).indexOf(e[A.value])}},Re=e=>!0===e[G.value],Ie=()=>!(void 0===j||-1===j.value||!we.value&&j.value>0)&&Y.value.length>=j.value,Ve=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&je(e))return D.value&&Ae(e),void(V.value&&(le(),ie()));e&&Me(e),q.value&&Z(),I.value&&(le(),ie()),e&&qe(e);break;case"multiple":if(e&&je(e))return Ae(e),void(V.value&&(le(),ie()));if(Ie())return void i.emit("max",X);e&&(Me(e),qe(e)),q.value&&Z(),f.value&&le(),I.value&&ie();break;case"tags":if(e&&je(e))return Ae(e),void(V.value&&(le(),ie()));if(Ie())return void i.emit("max",X);e&&Me(e),q.value&&Z(),e&&qe(e),f.value&&le(),I.value&&ie()}I.value||ne()},Me=e=>{void 0===He(e[A.value])&&fe.value&&(i.emit("tag",e[A.value],X),i.emit("option",e[A.value],X),i.emit("create",e[A.value],X),he.value&&Fe(e),Z())},We=e=>void 0===e.find((e=>!je(e)&&!e[G.value])),$e=e=>void 0===e.find((e=>!je(e))),He=e=>ge.value[ge.value.map((e=>String(e[A.value]))).indexOf(String(e))],Ne=e=>ge.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=>{ue.value.push(e)},ze=e=>N.value?e.filter((e=>Q.value?e.__VISIBLE__.length:e[H.value].length)):e.filter((e=>!Q.value||e.__VISIBLE__.length)),Ge=(e,t=!0)=>{let a=e;if(Q.value&&E.value){let e=K.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=g(oe(e[a]),R.value);return U.value?l.startsWith(g(t,R.value)):-1!==l.indexOf(g(t,R.value))}))),a=a.filter((t=>e(t,Q.value,X)))}return f.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&f.value&&je(e))(e)))),a},Ue=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{[A.value]:e,[Te.value[0]]:a,[y.value]:a}}))),t=t&&Array.isArray(t)?t.map((e=>"object"==typeof e?e:{[A.value]:e,[Te.value[0]]:e,[y.value]:e})):[],t},Ke=()=>{c(J.value)||(Y.value=Je(J.value))},Xe=e=>(ce.value=!0,new Promise(((t,a)=>{u.value(Q.value,X).then((t=>{se.value=t||[],"function"==typeof e&&e(t),ce.value=!1})).catch((e=>{console.error(e),se.value=[],ce.value=!1})).finally((()=>{t()}))}))),Ye=()=>{if(we.value)if("single"===s.value){let e=He(Y.value[A.value]);if(void 0!==e){let t=e[y.value];Y.value[y.value]=t,x.value&&(J.value[y.value]=t)}}else Y.value.forEach(((e,t)=>{let a=He(Y.value[t][A.value]);if(void 0!==a){let e=a[y.value];Y.value[t][y.value]=e,x.value&&(J.value[t][y.value]=e)}}))},Je=e=>c(e)?"single"===s.value?{}:[]:x.value?e:"single"===s.value?He(e)||(C.value?{[y.value]:e,[A.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!He(e)||C.value)).map((e=>He(e)||{[y.value]:e,[A.value]:e,[Te.value[0]]:e})),Qe=()=>{pe.value=r(Q,(e=>{e.length{e==Q.value&&u.value(Q.value,X).then((t=>{e!=Q.value&&Q.value||(se.value=t,te.value=be.value.filter((e=>!0!==e[G.value]))[0]||null,ce.value=!1)})).catch((e=>{console.error(e)}))}),L.value))}),{flush:"sync"})};if("single"!==s.value&&!c(J.value)&&!Array.isArray(J.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?k.value?Xe(Ke):1==x.value&&Ke():(se.value=u.value,Ke()),L.value>-1&&Qe(),r(L,((e,t)=>{pe.value&&pe.value(),e>=0&&Qe()})),r(J,(e=>{if(c(e))ee(Je(e),!1);else switch(s.value){case"single":(x.value?e[A.value]!=Y.value[A.value]:e!=Y.value[A.value])&&ee(Je(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]}))})(x.value?e.map((e=>e[A.value])):e,Y.value.map((e=>e[A.value])))||ee(Je(e),!1)}}),{deep:!0}),r(u,((e,t)=>{"function"==typeof a.options?k.value&&(!t||e&&e.toString()!==t.toString())&&Xe():(se.value=a.options,Object.keys(Y.value).length||Ke(),Ye())})),r(y,Ye),r(v,((e,t)=>{de.value=$.value&&-1===e?10:e})),{resolvedOptions:ve,pfo:me,fo:be,filteredOptions:be,hasSelected:we,multipleLabelText:xe,eo:ge,extendedOptions:ge,eg:ye,extendedGroups:ye,fg:Oe,filteredGroups:Oe,noOptions:Se,noResults:Le,resolving:ce,busy:Pe,offset:de,select:qe,deselect:Ae,remove:Be,selectAll:()=>{"single"!==s.value&&qe(be.value.filter((e=>!e.disabled&&!je(e))))},clear:De,isSelected:je,isDisabled:Re,isMax:Ie,getOption:He,handleOptionClick:e=>{if(!Re(e))return z.value&&!je(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=z.value(e,X))instanceof Promise)?(ce.value=!0,void e.then((e=>{ce.value=!1,Ve(e)}))):void Ve(e)},handleGroupClick:e=>{if(!Re(e)&&"single"!==s.value&&F.value){switch(s.value){case"multiple":case"tags":We(e[H.value])?Ae(e[H.value]):qe(e[H.value].filter((e=>-1===Y.value.map((e=>e[A.value])).indexOf(e[A.value]))).filter((e=>!e[G.value])).filter(((e,t)=>Y.value.length+1+t<=j.value||-1===j.value))),f.value&&te.value&&ae(Oe.value.filter((e=>!e[G.value]))[te.value.index])}I.value&&re()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{Xe(e)},resolveOptions:Xe,refreshLabels:Ye}}function y(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:p,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,k=l.isOpen,T=n((()=>m.value.filter((e=>!e[h.value])))),E=n((()=>b.value.filter((e=>!e[h.value])))),P=d((()=>"single"!==v.value&&f.value)),q=d((()=>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(T.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;p.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(k,(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((p.value&&P.value?E.value[0].__CREATE__?T.value[0]:E.value[0]:T.value[0])||null);else if(p.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=T.value.map((e=>e[o.value])).indexOf(w.value[o.value])+1;T.value.length<=e&&(e=0),x(T.value[e]||null)}i((()=>{H()}))},backwardPointer:()=>{if(null===w.value){let e=T.value[T.value.length-1];p.value&&P.value&&(e=M.value,void 0===e&&(e=D.value)),x(e||null)}else if(p.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=T.value.map((e=>e[o.value])).indexOf(w.value[o.value])-1;e<0&&(e=T.value.length-1),x(T.value[e]||null)}i((()=>{H()}))}}}function _(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function O(e){return e instanceof _(e).Element||e instanceof Element}function w(e){return e instanceof _(e).HTMLElement||e instanceof HTMLElement}function x(e){return"undefined"!=typeof ShadowRoot&&(e instanceof _(e).ShadowRoot||e instanceof ShadowRoot)}var S=Math.max,L=Math.min,k=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 E(){return!/^((?!chrome|android).)*safari/i.test(T())}function P(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&w(e)&&(n=e.offsetWidth>0&&k(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&k(l.height)/e.offsetHeight||1);var i=(O(e)?_(e):window).visualViewport,o=!E()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,p=l.height/r;return{width:c,height:p,top:s,right:u+c,bottom:s+p,left:u,x:u,y:s}}function q(e){var t=_(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function A(e){return e?(e.nodeName||"").toLowerCase():null}function C(e){return((O(e)?e.ownerDocument:e.document)||window.document).documentElement}function B(e){return P(C(e)).left+q(e).scrollLeft}function D(e){return _(e).getComputedStyle(e)}function j(e){var t=D(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function R(e,t,a){void 0===a&&(a=!1);var l,n,r=w(t),i=w(t)&&function(e){var t=e.getBoundingClientRect(),a=k(t.width)/e.offsetWidth||1,l=k(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=C(t),u=P(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==A(t)||j(o))&&(s=(l=t)!==_(l)&&w(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:q(l)),w(t)?((c=P(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=B(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function I(e){var t=P(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 V(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(x(e)?e.host:null)||C(e)}function M(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:w(e)&&j(e)?e:M(V(e))}function W(e,t){var a;void 0===t&&(t=[]);var l=M(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=_(l),i=n?[r].concat(r.visualViewport||[],j(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(W(V(i)))}function $(e){return["table","td","th"].indexOf(A(e))>=0}function H(e){return w(e)&&"fixed"!==D(e).position?e.offsetParent:null}function N(e){for(var t=_(e),a=H(e);a&&$(a)&&"static"===D(a).position;)a=H(a);return a&&("html"===A(a)||"body"===A(a)&&"static"===D(a).position)?t:a||function(e){var t=/firefox/i.test(T());if(/Trident/i.test(T())&&w(e)&&"fixed"===D(e).position)return null;var a=V(e);for(x(a)&&(a=a.host);w(a)&&["html","body"].indexOf(A(a))<0;){var l=D(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 F="top",z="bottom",G="right",U="left",K="auto",X=[F,z,G,U],Y="start",J="end",Q="clippingParents",Z="viewport",ee="popper",te="reference",ae=X.reduce((function(e,t){return e.concat([t+"-"+Y,t+"-"+J])}),[]),le=[].concat(X,[K]).reduce((function(e,t){return e.concat([t,t+"-"+Y,t+"-"+J])}),[]),ne=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function re(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 ie(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function oe(e,t,a){return t===Z?ie(function(e,t){var a=_(e),l=C(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=E();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+B(e),y:u}}(e,a)):O(t)?function(e,t){var a=P(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):ie(function(e){var t,a=C(e),l=q(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=S(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=S(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+B(e),u=-l.scrollTop;return"rtl"===D(n||a).direction&&(o+=S(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(C(e)))}function ue(e){var t=W(V(e)),a=["absolute","fixed"].indexOf(D(e).position)>=0&&w(e)?N(e):e;return O(a)?t.filter((function(e){return O(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&x(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==A(e)})):[]}function se(e){return e.split("-")[0]}function ce(e){return e.split("-")[1]}function pe(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?se(n):null,i=n?ce(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case F:t={x:o,y:a.y-l.height};break;case z:t={x:o,y:a.y+a.height};break;case G:t={x:a.x+a.width,y:u};break;case U:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?pe(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case Y:t[s]=t[s]-(a[c]/2-l[c]/2);break;case J:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function ve(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?Q:u,c=l.rootBoundary,p=void 0===c?Z:c,d=l.elementContext,v=void 0===d?ee:d,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,X.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===ee?te:ee,_=e.rects.popper,w=e.elements[h?y:v],x=function(e,t,a,l){var n="clippingParents"===t?ue(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=oe(e,a,l);return t.top=S(n.top,t.top),t.right=L(n.right,t.right),t.bottom=L(n.bottom,t.bottom),t.left=S(n.left,t.left),t}),oe(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}(O(w)?w:w.contextElement||C(e.elements.popper),s,p,o),k=P(e.elements.reference),T=de({reference:k,element:_,strategy:"absolute",placement:r}),E=ie(Object.assign({},_,T)),q=v===ee?E:k,A={top:x.top-q.top+b.top,bottom:q.bottom-x.bottom+b.bottom,left:x.left-q.left+b.left,right:q.right-x.right+b.right},B=e.modifiersData.offset;if(v===ee&&B){var D=B[r];Object.keys(A).forEach((function(e){var t=[G,z].indexOf(e)>=0?1:-1,a=[F,z].indexOf(e)>=0?"y":"x";A[e]+=D[a]*t}))}return A}var fe={placement:"bottom",modifiers:[],strategy:"absolute"};function he(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,fe,we):Oe(v?_e:ge,fe,v?we:me);w[O]=xe,q[O]=xe-fe}t.modifiersData[l]=q}},requiresIfExists:["offset"]},xe={left:"right",right:"left",bottom:"top",top:"bottom"};function Se(e){return e.replace(/left|right|bottom|top/g,(function(e){return xe[e]}))}var Le={start:"end",end:"start"};function ke(e){return e.replace(/start|end/g,(function(e){return Le[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?le:u,c=ce(l),p=c?o?ae:ae.filter((function(e){return ce(e)===c})):X,d=p.filter((function(e){return s.indexOf(e)>=0}));0===d.length&&(d=p);var v=d.reduce((function(t,a){return t[a]=ve(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[se(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var Ee={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,p=a.rootBoundary,d=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=se(g),b=u||(m===g||!f?[Se(g)]:function(e){if(se(e)===K)return[];var t=Se(e);return[ke(e),t,ke(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(se(a)===K?Te(t,{placement:a,boundary:c,rootBoundary:p,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=ve(t,{placement:k,boundary:c,rootBoundary:p,altBoundary:d,padding:s}),C=P?E?G:U:E?z:F;_[q]>O[q]&&(C=Se(C));var B=Se(C),D=[];if(r&&D.push(A[T]<=0),o&&D.push(A[C]<=0,A[B]<=0),D.every((function(e){return e}))){S=k,x=!1;break}w.set(k,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 Pe(a,n,r){const{disabled:s,appendTo:c,appendToBody:p,openDirection:v}=e(a),f=t().proxy,h=r.multiselect,g=r.dropdown,m=l(!1),b=l(null),y=l(null),_=d((()=>c.value||p.value)),O=d((()=>"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=_e(h.value,g.value,{strategy:x(h.value)?"fixed":void 0,placement:v.value,modifiers:[we,Ee,{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 qe(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,p=n.clearSearch,v=n.isOpen,f=n.wrapper,h=n.tags,g=l(!1),m=l(!1),b=d((()=>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&&p())}),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 Ae(a,l,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:p,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,k=n.multiselect,T=n.wrapper,E=n.tags,P=n.isOpen,q=n.open,A=n.blur,C=n.fo,B=d((()=>f.value||h.value||!1)),D=d((()=>void 0!==i.value?i.value:void 0!==v.value?v.value:["enter"])),j=()=>{"tags"===r.value&&!s.value&&B.value&&u.value&&!p.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=[...k.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():T.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||T.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,m)},preparePointer:j}}function Ce(t,a,l){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,p=l.isSelected,v=l.isDisabled,f=l.isActive,h=l.canPointGroups,g=l.resolving,m=l.fo,b=l.placement,y=d((()=>({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}))),_=d((()=>!!(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(p(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(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(p(t)?e.optionSelectedPointed:e.optionPointed):p(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 Be(t,a,n){const{limit:u,infinite:c}=e(t),p=n.isOpen,v=n.offset,f=n.search,h=n.pfo,g=n.eo,m=l(null),b=s(null),y=d((()=>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=()=>{p.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 De(t,a,r){const{placeholder:i,id:u,valueProp:s,label:c,mode:p,groupLabel:v,aria:f,searchable:h}=e(t),g=r.pointer,m=r.iv,b=r.hasSelected,y=r.multipleLabelText,_=l(null),O=d((()=>(u.value?u.value+"-":"")+"assist")),w=d((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=d((()=>{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=d((()=>i.value)),L=d((()=>"single"!==p.value)),k=n((()=>"single"===p.value&&b.value?m.value[c.value]:"multiple"===p.value&&b.value?y.value:"tags"===p.value&&b.value?m.value.map((e=>e[c.value])).join(", "):"")),T=n((()=>{let e={...f.value};return h.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${O.value} ${e["aria-labelledby"]}`:O.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}"]`);_.value=e?e.innerText:null}})),{arias:T,ariaLabel:k,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 je(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 Re(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}function Ie(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 p;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(p=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=p):t&&(p=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),p)if(c.functional){const e=c.render;c.render=function(t,a){return p.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,p):[p]}return a}const Ve={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,[Re,je,v,h,Pe,f,p,qe,b,Be,y,Ae,Ce,De]),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 Me=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)};Me._withStripped=!0;const We=Ie({render:Me,staticRenderFns:[]},undefined,Ve,undefined,false,undefined,!1,void 0,void 0,void 0);export{We as default}; diff --git a/package.json b/package.json index cc23b4a..bf50347 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vueform/multiselect", - "version": "2.6.10", + "version": "2.6.11", "private": false, "description": "Vue 3 multiselect component with single select, multiselect and tagging options.", "license": "MIT",