@citizenplane/pimp 9.7.14 → 9.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pimp.es.js +2 -2
- package/dist/pimp.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/CpMultiselect.vue +3 -2
package/dist/pimp.es.js
CHANGED
|
@@ -23805,7 +23805,7 @@ const fC = {
|
|
|
23805
23805
|
trackBy: { default: void 0 },
|
|
23806
23806
|
withoutTypeahead: { type: Boolean }
|
|
23807
23807
|
},
|
|
23808
|
-
emits: ["search", "clear", "update:modelValue", "overlayShown", "overlayHidden"
|
|
23808
|
+
emits: ["search", "clear", "update:modelValue", "overlayShown", "overlayHidden"],
|
|
23809
23809
|
setup(t, { emit: e }) {
|
|
23810
23810
|
const n = t, i = e, r = S({
|
|
23811
23811
|
get() {
|
|
@@ -23828,7 +23828,7 @@ const fC = {
|
|
|
23828
23828
|
option: { class: "cpMultiselect__optionWrapper" },
|
|
23829
23829
|
loader: { class: "cpMultiselect__hidden" }
|
|
23830
23830
|
})), a = ne(null), d = ne(""), l = S(() => !n.withoutTypeahead), u = S(() => a.value?.overlayVisible), c = S(() => ({ "cpMultiselect__dropdownIcon--isRotated": u.value })), p = S(() => n.multiple ? !r.value?.length : !0), h = S(() => n.multiple ? !1 : n.isClearable && !vC(r.value)), f = (I) => i("search", I.query), m = () => r.value = null, g = () => i("overlayShown"), $ = () => i("overlayHidden"), b = (I) => {
|
|
23831
|
-
typeof I == "string" && (d.value = I, i("
|
|
23831
|
+
typeof I == "string" && (d.value = I, I === "" && i("search", I));
|
|
23832
23832
|
}, x = () => a.value && a.value.$el?.querySelector("input") || null, w = () => {
|
|
23833
23833
|
const I = x();
|
|
23834
23834
|
I && I.select();
|
package/dist/pimp.umd.js
CHANGED
|
@@ -842,7 +842,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
842
842
|
inset-inline-end: calc(dt('autocomplete.padding.x') + dt('autocomplete.dropdown.width'));
|
|
843
843
|
}
|
|
844
844
|
`,j$={root:{position:"relative"}},R$={root:function(e){var n=e.instance;return e.props,["p-autocomplete p-component p-inputwrapper",{"p-invalid":n.$invalid,"p-focus":n.focused,"p-inputwrapper-filled":n.$filled||X(n.inputValue),"p-inputwrapper-focus":n.focused,"p-autocomplete-open":n.overlayVisible,"p-autocomplete-fluid":n.$fluid}]},pcInputText:"p-autocomplete-input",inputMultiple:function(e){var n=e.instance,o=e.props;return["p-autocomplete-input-multiple",{"p-variant-filled":n.$variant==="filled","p-disabled":o.disabled}]},chipItem:function(e){var n=e.instance,o=e.i;return["p-autocomplete-chip-item",{"p-focus":n.focusedMultipleOptionIndex===o}]},pcChip:"p-autocomplete-chip",chipIcon:"p-autocomplete-chip-icon",inputChip:"p-autocomplete-input-chip",loader:"p-autocomplete-loader",dropdown:"p-autocomplete-dropdown",overlay:"p-autocomplete-overlay p-component",listContainer:"p-autocomplete-list-container",list:"p-autocomplete-list",optionGroup:"p-autocomplete-option-group",option:function(e){var n=e.instance,o=e.option,i=e.i,s=e.getItemOptions;return["p-autocomplete-option",{"p-autocomplete-option-selected":n.isSelected(o),"p-focus":n.focusedOptionIndex===n.getOptionIndex(i,s),"p-disabled":n.isOptionDisabled(o)}]},emptyMessage:"p-autocomplete-empty-message"},F$=le.extend({name:"autocomplete",style:A$,classes:R$,inlineStyles:j$}),H$={name:"BaseAutoComplete",extends:vc,props:{suggestions:{type:Array,default:null},optionLabel:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"14rem"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},multiple:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:[String,Object],default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputId:{type:String,default:null},inputStyle:{type:Object,default:null},inputClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelClass:{type:[String,Object],default:null},overlayStyle:{type:Object,default:null},overlayClass:{type:[String,Object],default:null},dropdownIcon:{type:String,default:null},dropdownClass:{type:[String,Object],default:null},loader:{type:String,default:null},loadingIcon:{type:String,default:null},removeTokenIcon:{type:String,default:null},chipIcon:{type:String,default:null},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},showEmptyMessage:{type:Boolean,default:!0},tabindex:{type:Number,default:0},typeahead:{type:Boolean,default:!0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:F$,provide:function(){return{$pcAutoComplete:this,$parentInstance:this}}};function kc(t,e,n){return(e=z$(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function z$(t){var e=Z$(t,"string");return Wn(e)=="symbol"?e:e+""}function Z$(t,e){if(Wn(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(Wn(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wn(t){"@babel/helpers - typeof";return Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wn(t)}function Ic(t){return G$(t)||K$(t)||U$(t)||W$()}function W$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
845
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U$(t,e){if(t){if(typeof t=="string")return Hs(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hs(t,e):void 0}}function K$(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function G$(t){if(Array.isArray(t))return Hs(t)}function Hs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}var Oc={name:"AutoComplete",extends:H$,inheritAttrs:!1,emits:["change","focus","blur","item-select","item-unselect","option-select","option-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],inject:{$pcFluid:{default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,dirty:!1,startRangeIndex:-1,data:function(){return{clicked:!1,focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}},watch:{suggestions:function(){this.searching&&(this.show(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1,!this.showEmptyMessage&&this.visibleOptions.length===0&&this.hide()),this.autoUpdateModel()}},mounted:function(){this.autoUpdateModel()},updated:function(){this.overlayVisible&&this.alignOverlay()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(_n.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,n){return this.virtualScrollerDisabled?e:n&&n(e).index},getOptionLabel:function(e){return this.optionLabel?sn(e,this.optionLabel):e},getOptionValue:function(e){return e},getOptionRenderKey:function(e,n){return(this.dataKey?sn(e,this.dataKey):this.getOptionLabel(e))+"_"+n},getPTOptions:function(e,n,o,i){return this.ptm(i,{context:{option:e,index:o,selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(o,n),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return this.optionDisabled?sn(e,this.optionDisabled):!1},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return sn(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return sn(e,this.optionGroupChildren)},getAriaPosInset:function(e){var n=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter(function(o){return n.isOptionGroup(o)}).length:e)+1},show:function(e){this.$emit("before-show"),this.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&<(this.multiple?this.$refs.focusInput:this.$refs.focusInput.$el)},hide:function(e){var n=this,o=function(){var s;n.$emit("before-hide"),n.dirty=e,n.overlayVisible=!1,n.clicked=!1,n.focusedOptionIndex=-1,e&<(n.multiple?n.$refs.focusInput:(s=n.$refs.focusInput)===null||s===void 0?void 0:s.$el)};setTimeout(function(){o()},0)},onFocus:function(e){this.disabled||(!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,this.focused=!0,this.overlayVisible&&(this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.scrollInView(this.focusedOptionIndex)),this.$emit("focus",e))},onBlur:function(e){var n,o;this.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e),(n=(o=this.formField).onBlur)===null||n===void 0||n.call(o)},onKeyDown:function(e){if(this.disabled){e.preventDefault();return}switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;case"Backspace":this.onBackspaceKey(e);break}this.clicked=!1},onInput:function(e){var n=this;if(this.typeahead){this.searchTimeout&&clearTimeout(this.searchTimeout);var o=e.target.value;this.multiple||this.updateModel(e,o),o.length===0?(this.hide(),this.$emit("clear")):o.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout(function(){n.search(e,o,"input")},this.delay)):this.hide()}},onChange:function(e){var n=this;if(this.forceSelection){var o=!1;if(this.visibleOptions&&!this.multiple){var i,s=this.multiple?this.$refs.focusInput.value:(i=this.$refs.focusInput)===null||i===void 0||(i=i.$el)===null||i===void 0?void 0:i.value,a=this.visibleOptions.find(function(d){return n.isOptionMatched(d,s||"")});a!==void 0&&(o=!0,!this.isSelected(a)&&this.onOptionSelect(e,a))}if(!o){if(this.multiple)this.$refs.focusInput.value="";else{var l,c=(l=this.$refs.focusInput)===null||l===void 0?void 0:l.$el;c&&(c.value="")}this.$emit("clear"),!this.multiple&&this.updateModel(e,null)}}},onMultipleContainerFocus:function(){this.disabled||(this.focused=!0)},onMultipleContainerBlur:function(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown:function(e){if(this.disabled){e.preventDefault();return}switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e);break}},onContainerClick:function(e){this.clicked=!0,!(this.disabled||this.searching||this.loading||this.isDropdownClicked(e))&&(!this.overlay||!this.overlay.contains(e.target))&<(this.multiple?this.$refs.focusInput:this.$refs.focusInput.$el)},onDropdownClick:function(e){var n=void 0;if(this.overlayVisible)this.hide(!0);else{var o=this.multiple?this.$refs.focusInput:this.$refs.focusInput.$el;lt(o),n=o.value,this.dropdownMode==="blank"?this.search(e,"","dropdown"):this.dropdownMode==="current"&&this.search(e,n,"dropdown")}this.$emit("dropdown-click",{originalEvent:e,query:n})},onOptionSelect:function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=this.getOptionValue(n);this.multiple?(this.$refs.focusInput.value="",this.isSelected(n)||this.updateModel(e,[].concat(Ic(this.d_value||[]),[i]))):this.updateModel(e,i),this.$emit("item-select",{originalEvent:e,value:n}),this.$emit("option-select",{originalEvent:e,value:n}),o&&this.hide(!0)},onOptionMouseMove:function(e,n){this.focusOnHover&&this.changeFocusedOptionIndex(e,n)},onOptionSelectRange:function(e){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(o===-1&&(o=this.findNearestSelectedOptionIndex(i,!0)),i===-1&&(i=this.findNearestSelectedOptionIndex(o)),o!==-1&&i!==-1){var s=Math.min(o,i),a=Math.max(o,i),l=this.visibleOptions.slice(s,a+1).filter(function(c){return n.isValidOption(c)}).map(function(c){return n.getOptionValue(c)});this.updateModel(e,l)}},onOverlayClick:function(e){T$.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){switch(e.code){case"Escape":this.onEscapeKey(e);break}},onArrowDownKey:function(e){if(this.overlayVisible){var n=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.clicked?this.findFirstOptionIndex():this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,n),this.changeFocusedOptionIndex(e,n),e.preventDefault()}},onArrowUpKey:function(e){if(this.overlayVisible)if(e.altKey)this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var n=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.clicked?this.findLastOptionIndex():this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,n,this.startRangeIndex),this.changeFocusedOptionIndex(e,n),e.preventDefault()}},onArrowLeftKey:function(e){var n=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(zt(n.value)&&this.$filled?(lt(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.d_value.length):e.stopPropagation())},onArrowRightKey:function(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey:function(e){var n=e.currentTarget,o=n.value.length,i=e.metaKey||e.ctrlKey,s=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&i&&this.onOptionSelectRange(e,s,this.startRangeIndex),n.setSelectionRange(0,e.shiftKey?o:0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey:function(e){var n=e.currentTarget,o=n.value.length,i=e.metaKey||e.ctrlKey,s=this.findLastOptionIndex();this.multiple&&e.shiftKey&&i&&this.onOptionSelectRange(e,this.startRangeIndex,s),n.setSelectionRange(e.shiftKey?0:o,o),this.focusedOptionIndex=-1,e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.typeahead?this.overlayVisible?(this.focusedOptionIndex!==-1&&(this.multiple&&e.shiftKey?(this.onOptionSelectRange(e,this.focusedOptionIndex),e.preventDefault()):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),this.hide()):(this.focusedOptionIndex=-1,this.onArrowDownKey(e)):this.multiple&&(e.target.value.trim()&&(this.updateModel(e,[].concat(Ic(this.d_value||[]),[e.target.value.trim()])),this.$refs.focusInput.value=""),e.preventDefault())},onSpaceKey:function(e){!this.autoOptionFocus&&this.focusedOptionIndex!==-1&&this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},onBackspaceKey:function(e){if(this.multiple){if(X(this.d_value)&&!this.$refs.focusInput.value){var n=this.d_value[this.d_value.length-1],o=this.d_value.slice(0,-1);this.writeValue(o,e),this.$emit("item-unselect",{originalEvent:e,value:n}),this.$emit("option-unselect",{originalEvent:e,value:n})}e.stopPropagation()}},onArrowLeftKeyOnMultiple:function(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple:function(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.d_value.length-1&&(this.focusedMultipleOptionIndex=-1,lt(this.$refs.focusInput))},onBackspaceKeyOnMultiple:function(e){this.focusedMultipleOptionIndex!==-1&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter:function(e){_n.set("overlay",e,this.$primevue.config.zIndex.overlay),Li(e,{position:"absolute",top:"0"}),this.alignOverlay(),this.$attrSelector&&e.setAttribute(this.$attrSelector,"")},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){_n.clear(e)},alignOverlay:function(){var e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput.$el;this.appendTo==="self"?F0(this.overlay,e):(this.overlay.style.minWidth=xr(e)+"px",ta(this.overlay,e))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.overlayVisible&&e.overlay&&e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener,!0))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener,!0),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new d$(this.$refs.container,function(){e.overlayVisible&&e.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!ua()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked:function(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked:function(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.focusInput.$el},isDropdownClicked:function(e){return this.$refs.dropdownButton?e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.contains(e.target):!1},isOptionMatched:function(e,n){var o;return this.isValidOption(e)&&((o=this.getOptionLabel(e))===null||o===void 0?void 0:o.toLocaleLowerCase(this.searchLocale))===n.toLocaleLowerCase(this.searchLocale)},isValidOption:function(e){return X(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,n){return T0(e,n,this.equalityKey)},isSelected:function(e){var n=this,o=this.getOptionValue(e);return this.multiple?(this.d_value||[]).some(function(i){return n.isEquals(i,o)}):this.isEquals(this.d_value,this.getOptionValue(e))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex(function(n){return e.isValidOption(n)})},findLastOptionIndex:function(){var e=this;return $o(this.visibleOptions,function(n){return e.isValidOption(n)})},findNextOptionIndex:function(e){var n=this,o=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(i){return n.isValidOption(i)}):-1;return o>-1?o+e+1:e},findPrevOptionIndex:function(e){var n=this,o=e>0?$o(this.visibleOptions.slice(0,e),function(i){return n.isValidOption(i)}):-1;return o>-1?o:e},findSelectedOptionIndex:function(){var e=this;return this.$filled?this.visibleOptions.findIndex(function(n){return e.isValidSelectedOption(n)}):-1},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search:function(e,n,o){n!=null&&(o==="input"&&n.trim().length===0||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:n})))},removeOption:function(e,n){var o=this,i=this.d_value[n],s=this.d_value.filter(function(a,l){return l!==n}).map(function(a){return o.getOptionValue(a)});this.updateModel(e,s),this.$emit("item-unselect",{originalEvent:e,value:i}),this.$emit("option-unselect",{originalEvent:e,value:i}),this.dirty=!0,lt(this.multiple?this.$refs.focusInput:this.$refs.focusInput.$el)},changeFocusedOptionIndex:function(e,n){this.focusedOptionIndex!==n&&(this.focusedOptionIndex=n,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[n],!1))},scrollInView:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;this.$nextTick(function(){var o=n!==-1?"".concat(e.$id,"_").concat(n):e.focusedOptionId,i=ln(e.list,'li[id="'.concat(o,'"]'));i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(n!==-1?n:e.focusedOptionIndex)})},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.$filled&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel:function(e,n){this.writeValue(n,e),this.$emit("change",{originalEvent:e,value:n})},flatOptions:function(e){var n=this;return(e||[]).reduce(function(o,i,s){o.push({optionGroup:i,group:!0,index:s});var a=n.getOptionGroupChildren(i);return a&&a.forEach(function(l){return o.push(l)}),o},[])},overlayRef:function(e){this.overlay=e},listRef:function(e,n){this.list=e,n&&n(e)},virtualScrollerRef:function(e){this.virtualScroller=e},findNextSelectedOptionIndex:function(e){var n=this,o=this.$filled&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(i){return n.isValidSelectedOption(i)}):-1;return o>-1?o+e+1:-1},findPrevSelectedOptionIndex:function(e){var n=this,o=this.$filled&&e>0?$o(this.visibleOptions.slice(0,e),function(i){return n.isValidSelectedOption(i)}):-1;return o>-1?o:-1},findNearestSelectedOptionIndex:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=-1;return this.$filled&&(n?(o=this.findPrevSelectedOptionIndex(e),o=o===-1?this.findNextSelectedOptionIndex(e):o):(o=this.findNextSelectedOptionIndex(e),o=o===-1?this.findPrevSelectedOptionIndex(e):o)),o>-1?o:e}},computed:{visibleOptions:function(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue:function(){if(this.$filled)if(Wn(this.d_value)==="object"){var e=this.getOptionLabel(this.d_value);return e??this.d_value}else return this.d_value;else return""},hasSelectedOption:function(){return this.$filled},equalityKey:function(){return this.dataKey},searchResultMessageText:function(){return X(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.$filled?this.selectionMessageText.replaceAll("{0}",this.multiple?this.d_value.length:"1"):this.emptySelectionMessageText},listAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.listLabel:void 0},focusedOptionId:function(){return this.focusedOptionIndex!==-1?"".concat(this.$id,"_").concat(this.focusedOptionIndex):null},focusedMultipleOptionId:function(){return this.focusedMultipleOptionIndex!==-1?"".concat(this.$id,"_multiple_option_").concat(this.focusedMultipleOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter(function(n){return!e.isOptionGroup(n)}).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions},panelId:function(){return this.$id+"_panel"},containerDataP:function(){return xn({fluid:this.$fluid})},overlayDataP:function(){return xn(kc({},"portal-"+this.appendTo,"portal-"+this.appendTo))},inputMultipleDataP:function(){return xn(kc({invalid:this.$invalid,disabled:this.disabled,focus:this.focused,fluid:this.$fluid,filled:this.$variant==="filled",empty:!this.$filled},this.size,this.size))}},components:{InputText:bc,VirtualScroller:Sc,Portal:Ds,ChevronDownIcon:gc,SpinnerIcon:Fs,Chip:Cc},directives:{ripple:pc}};function er(t){"@babel/helpers - typeof";return er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},er(t)}function Mc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function Tc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Mc(Object(n),!0).forEach(function(o){Y$(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Y$(t,e,n){return(e=q$(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q$(t){var e=J$(t,"string");return er(e)=="symbol"?e:e+""}function J$(t,e){if(er(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(er(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var X$=["data-p"],Q$=["aria-activedescendant","data-p-has-dropdown","data-p"],eC=["id","aria-label","aria-setsize","aria-posinset"],tC=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-invalid"],nC=["data-p-has-dropdown"],oC=["disabled","aria-expanded","aria-controls"],rC=["id","data-p"],iC=["id","aria-label"],sC=["id"],aC=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove","data-p-selected","data-p-focused","data-p-disabled"];function lC(t,e,n,o,i,s){var a=r.resolveComponent("InputText"),l=r.resolveComponent("Chip"),c=r.resolveComponent("SpinnerIcon"),d=r.resolveComponent("VirtualScroller"),u=r.resolveComponent("Portal"),p=r.resolveDirective("ripple");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:t.cx("root"),style:t.sx("root"),onClick:e[11]||(e[11]=function(){return s.onContainerClick&&s.onContainerClick.apply(s,arguments)}),"data-p":s.containerDataP},t.ptmi("root")),[t.multiple?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(a,{key:0,ref:"focusInput",id:t.inputId,type:"text",name:t.$formName,class:r.normalizeClass([t.cx("pcInputText"),t.inputClass]),style:r.normalizeStyle(t.inputStyle),defaultValue:s.inputValue,placeholder:t.placeholder,tabindex:t.disabled?-1:t.tabindex,fluid:t.$fluid,disabled:t.disabled,size:t.size,invalid:t.invalid,variant:t.variant,autocomplete:"off",role:"combobox","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":i.overlayVisible,"aria-controls":s.panelId,"aria-activedescendant":i.focused?s.focusedOptionId:void 0,onFocus:s.onFocus,onBlur:s.onBlur,onKeydown:s.onKeyDown,onInput:s.onInput,onChange:s.onChange,unstyled:t.unstyled,"data-p-has-dropdown":t.dropdown,pt:t.ptm("pcInputText")},null,8,["id","name","class","style","defaultValue","placeholder","tabindex","fluid","disabled","size","invalid","variant","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","onFocus","onBlur","onKeydown","onInput","onChange","unstyled","data-p-has-dropdown","pt"])),t.multiple?(r.openBlock(),r.createElementBlock("ul",r.mergeProps({key:1,ref:"multiContainer",class:t.cx("inputMultiple"),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":i.focused?s.focusedMultipleOptionId:void 0,onFocus:e[5]||(e[5]=function(){return s.onMultipleContainerFocus&&s.onMultipleContainerFocus.apply(s,arguments)}),onBlur:e[6]||(e[6]=function(){return s.onMultipleContainerBlur&&s.onMultipleContainerBlur.apply(s,arguments)}),onKeydown:e[7]||(e[7]=function(){return s.onMultipleContainerKeyDown&&s.onMultipleContainerKeyDown.apply(s,arguments)}),"data-p-has-dropdown":t.dropdown,"data-p":s.inputMultipleDataP},t.ptm("inputMultiple")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.d_value,function(h,f){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:"".concat(f,"_").concat(s.getOptionLabel(h)),id:t.$id+"_multiple_option_"+f,class:t.cx("chipItem",{i:f}),role:"option","aria-label":s.getOptionLabel(h),"aria-selected":!0,"aria-setsize":t.d_value.length,"aria-posinset":f+1},{ref_for:!0},t.ptm("chipItem")),[r.renderSlot(t.$slots,"chip",r.mergeProps({class:t.cx("pcChip"),value:h,index:f,removeCallback:function(y){return s.removeOption(y,f)}},{ref_for:!0},t.ptm("pcChip")),function(){return[r.createVNode(l,{class:r.normalizeClass(t.cx("pcChip")),label:s.getOptionLabel(h),removeIcon:t.chipIcon||t.removeTokenIcon,removable:"",unstyled:t.unstyled,onRemove:function(y){return s.removeOption(y,f)},"data-p-focused":i.focusedMultipleOptionIndex===f,pt:t.ptm("pcChip")},{removeicon:r.withCtx(function(){return[r.renderSlot(t.$slots,t.$slots.chipicon?"chipicon":"removetokenicon",{class:r.normalizeClass(t.cx("chipIcon")),index:f,removeCallback:function(y){return s.removeOption(y,f)}})]}),_:2},1032,["class","label","removeIcon","unstyled","onRemove","data-p-focused","pt"])]})],16,eC)}),128)),r.createElementVNode("li",r.mergeProps({class:t.cx("inputChip"),role:"option"},t.ptm("inputChip")),[r.createElementVNode("input",r.mergeProps({ref:"focusInput",id:t.inputId,type:"text",style:t.inputStyle,class:t.inputClass,placeholder:t.placeholder,tabindex:t.disabled?-1:t.tabindex,disabled:t.disabled,autocomplete:"off",role:"combobox","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":i.overlayVisible,"aria-controls":t.$id+"_list","aria-activedescendant":i.focused?s.focusedOptionId:void 0,"aria-invalid":t.invalid||void 0,onFocus:e[0]||(e[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:e[1]||(e[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:e[2]||(e[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)}),onInput:e[3]||(e[3]=function(){return s.onInput&&s.onInput.apply(s,arguments)}),onChange:e[4]||(e[4]=function(){return s.onChange&&s.onChange.apply(s,arguments)})},t.ptm("input")),null,16,tC)],16)],16,Q$)):r.createCommentVNode("",!0),i.searching||t.loading?r.renderSlot(t.$slots,t.$slots.loader?"loader":"loadingicon",{key:2,class:r.normalizeClass(t.cx("loader"))},function(){return[t.loader||t.loadingIcon?(r.openBlock(),r.createElementBlock("i",r.mergeProps({key:0,class:["pi-spin",t.cx("loader"),t.loader,t.loadingIcon],"aria-hidden":"true","data-p-has-dropdown":t.dropdown},t.ptm("loader")),null,16,nC)):(r.openBlock(),r.createBlock(c,r.mergeProps({key:1,class:t.cx("loader"),spin:"","aria-hidden":"true","data-p-has-dropdown":t.dropdown},t.ptm("loader")),null,16,["class","data-p-has-dropdown"]))]}):r.createCommentVNode("",!0),r.renderSlot(t.$slots,t.$slots.dropdown?"dropdown":"dropdownbutton",{toggleCallback:function(f){return s.onDropdownClick(f)}},function(){return[t.dropdown?(r.openBlock(),r.createElementBlock("button",r.mergeProps({key:0,ref:"dropdownButton",type:"button",class:[t.cx("dropdown"),t.dropdownClass],disabled:t.disabled,"aria-haspopup":"listbox","aria-expanded":i.overlayVisible,"aria-controls":s.panelId,onClick:e[8]||(e[8]=function(){return s.onDropdownClick&&s.onDropdownClick.apply(s,arguments)})},t.ptm("dropdown")),[r.renderSlot(t.$slots,"dropdownicon",{class:r.normalizeClass(t.dropdownIcon)},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.dropdownIcon?"span":"ChevronDownIcon"),r.mergeProps({class:t.dropdownIcon},t.ptm("dropdownIcon")),null,16,["class"]))]})],16,oC)):r.createCommentVNode("",!0)]}),t.typeahead?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:3,role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.searchResultMessageText),17)):r.createCommentVNode("",!0),r.createVNode(u,{appendTo:t.appendTo},{default:r.withCtx(function(){return[r.createVNode(r.Transition,r.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},t.ptm("transition")),{default:r.withCtx(function(){return[i.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.overlayRef,id:s.panelId,class:[t.cx("overlay"),t.panelClass,t.overlayClass],style:Tc(Tc({},t.panelStyle),t.overlayStyle),onClick:e[9]||(e[9]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:e[10]||(e[10]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)}),"data-p":s.overlayDataP},t.ptm("overlay")),[r.renderSlot(t.$slots,"header",{value:t.d_value,suggestions:s.visibleOptions}),r.createElementVNode("div",r.mergeProps({class:t.cx("listContainer"),style:{"max-height":s.virtualScrollerDisabled?t.scrollHeight:""}},t.ptm("listContainer")),[r.createVNode(d,r.mergeProps({ref:s.virtualScrollerRef},t.virtualScrollerOptions,{style:{height:t.scrollHeight},items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:t.ptm("virtualScroller")}),r.createSlots({content:r.withCtx(function(h){var f=h.styleClass,m=h.contentRef,y=h.items,g=h.getItemOptions,$=h.contentStyle,C=h.itemSize;return[r.createElementVNode("ul",r.mergeProps({ref:function(v){return s.listRef(v,m)},id:t.$id+"_list",class:[t.cx("list"),f],style:$,role:"listbox","aria-label":s.listAriaLabel},t.ptm("list")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y,function(b,v){return r.openBlock(),r.createElementBlock(r.Fragment,{key:s.getOptionRenderKey(b,s.getOptionIndex(v,g))},[s.isOptionGroup(b)?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,id:t.$id+"_"+s.getOptionIndex(v,g),style:{height:C?C+"px":void 0},class:t.cx("optionGroup"),role:"option"},{ref_for:!0},t.ptm("optionGroup")),[r.renderSlot(t.$slots,"optiongroup",{option:b.optionGroup,index:s.getOptionIndex(v,g)},function(){return[r.createTextVNode(r.toDisplayString(s.getOptionGroupLabel(b.optionGroup)),1)]})],16,sC)):r.withDirectives((r.openBlock(),r.createElementBlock("li",r.mergeProps({key:1,id:t.$id+"_"+s.getOptionIndex(v,g),style:{height:C?C+"px":void 0},class:t.cx("option",{option:b,i:v,getItemOptions:g}),role:"option","aria-label":s.getOptionLabel(b),"aria-selected":s.isSelected(b),"aria-disabled":s.isOptionDisabled(b),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(v,g)),onClick:function(O){return s.onOptionSelect(O,b)},onMousemove:function(O){return s.onOptionMouseMove(O,s.getOptionIndex(v,g))},"data-p-selected":s.isSelected(b),"data-p-focused":i.focusedOptionIndex===s.getOptionIndex(v,g),"data-p-disabled":s.isOptionDisabled(b)},{ref_for:!0},s.getPTOptions(b,g,v,"option")),[r.renderSlot(t.$slots,"option",{option:b,index:s.getOptionIndex(v,g)},function(){return[r.createTextVNode(r.toDisplayString(s.getOptionLabel(b)),1)]})],16,aC)),[[p]])],64)}),128)),t.showEmptyMessage&&(!y||y&&y.length===0)?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,class:t.cx("emptyMessage"),role:"option"},t.ptm("emptyMessage")),[r.renderSlot(t.$slots,"empty",{},function(){return[r.createTextVNode(r.toDisplayString(s.searchResultMessageText),1)]})],16)):r.createCommentVNode("",!0)],16,iC)]}),_:2},[t.$slots.loader?{name:"loader",fn:r.withCtx(function(h){var f=h.options;return[r.renderSlot(t.$slots,"loader",{options:f})]}),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),r.renderSlot(t.$slots,"footer",{value:t.d_value,suggestions:s.visibleOptions}),r.createElementVNode("span",r.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.selectedMessageText),17)],16,rC)):r.createCommentVNode("",!0)]}),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo"])],16,X$)}Oc.render=lC;const dC={class:"baseSelectClearButton",type:"button"},cC=r.defineComponent({__name:"BaseSelectClearButton",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("button",dC,[r.createVNode(gn,{size:"12",type:"x"})]))}}),Qr=E(r.defineComponent({__name:"TransitionExpand",setup(t){const e=i=>{i.style.height="auto"},n=i=>{const{width:s}=getComputedStyle(i);i.style.width=s,i.style.position="absolute",i.style.visibility="hidden",i.style.height="auto";const{height:a}=getComputedStyle(i);i.style.width="",i.style.position="",i.style.visibility="",i.style.height="0",getComputedStyle(i).height,requestAnimationFrame(()=>i.style.height=a)},o=i=>{const{height:s}=getComputedStyle(i);i.style.height=s,requestAnimationFrame(()=>{i.style.height="0"})};return(i,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"expand",onEnter:n,onAfterEnter:e,onLeave:o},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"default",{},void 0,!0)]),_:3}))}}),[["__scopeId","data-v-246f87a7"]]),uC=t=>t!==null&&typeof t=="object",pC=t=>uC(t)?Reflect.ownKeys(t).length===0&&t.constructor===Object:!0,hC={class:"cpMultiselect"},fC={class:"cpMultiselect__empty"},mC={class:"cpMultiselect__option",type:"button"},yC={key:0,class:"cpMultiselect__prefix"},gC=["disabled"],$C={key:0,class:"cpMultiselect__error"},CC=r.defineComponent({__name:"CpMultiselect",props:{appendTo:{default:"body"},disabled:{type:Boolean},emptyMessage:{default:"No results found"},errorMessage:{default:""},forceSelection:{type:Boolean},isClearable:{type:Boolean},isInvalid:{type:Boolean},isLoading:{type:Boolean},label:{default:""},modelValue:{default:null},multiple:{type:Boolean},name:{default:""},optionDisabled:{type:[String,Function],default:"disabled"},optionLabel:{default:void 0},options:{default:()=>[]},placeholder:{default:""},required:{type:Boolean},size:{default:"md"},trackBy:{default:void 0},withoutTypeahead:{type:Boolean}},emits:["search","clear","update:modelValue","overlayShown","overlayHidden","searchChange"],setup(t,{emit:e}){const n=t,o=e,i=r.computed({get(){return n.modelValue},set(x){typeof x!="string"&&o("update:modelValue",x)}}),s=r.computed(()=>({cpMultiselect__input:!0,"cpMultiselect__input--isSingle":!n.multiple})),a=r.computed(()=>({root:{class:`cpMultiselect__select cpMultiselect__select--${n.size}`},inputmultiple:{class:"cpMultiselect__tags"},dropdown:{class:"cpMultiselect__toggle"},inputchip:{class:"cpMultiselect__inputWrapper"},overlay:{class:`cpMultiselect__overlay ${d.value?"":"cpMultiselect__overlay--isHidden"}`},listcontainer:{class:"cpMultiselect__listWrapper"},list:{class:"cpMultiselect__list"},option:{class:"cpMultiselect__optionWrapper"},loader:{class:"cpMultiselect__hidden"}})),l=r.ref(null),c=r.ref(""),d=r.computed(()=>!n.withoutTypeahead),u=r.computed(()=>l.value?.overlayVisible),p=r.computed(()=>({"cpMultiselect__dropdownIcon--isRotated":u.value})),h=r.computed(()=>n.multiple?!i.value?.length:!0),f=r.computed(()=>n.multiple?!1:n.isClearable&&!pC(i.value)),m=x=>o("search",x.query),y=()=>i.value=null,g=()=>o("overlayShown"),$=()=>o("overlayHidden"),C=x=>{typeof x=="string"&&(c.value=x,o("searchChange",x))},b=()=>l.value&&l.value.$el?.querySelector("input")||null,v=()=>{const x=b();x&&x.select()},w=()=>{const x=b();x&&(x.focus(),x.select())},O=()=>{N(),v()},T=()=>{N(),w()},N=()=>{u.value?l.value?.hide():l.value?.show()},A=x=>{},P=()=>{l.value&&(l.value.alignOverlay=D)},D=()=>{const x=l.value?.$el;!l.value?.overlay||!x||(l.value.overlay.style.width=`${xr(x)}px`,ta(l.value.overlay,x))};return r.onMounted(()=>P()),(x,I)=>{const V=r.resolveComponent("cp-badge"),R=r.resolveComponent("cp-loader"),F=r.resolveComponent("cp-icon");return r.openBlock(),r.createElementBlock("div",hC,[x.label?(r.openBlock(),r.createBlock(zn,{key:0,class:"cpMultiselect__label","is-invalid":x.isInvalid,required:x.required},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(x.label),1)]),_:1},8,["is-invalid","required"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Oc),{ref_key:"multiselect",ref:l,modelValue:i.value,"onUpdate:modelValue":[I[0]||(I[0]=B=>i.value=B),A],"append-to":x.appendTo,"auto-option-focus":"","data-key":x.trackBy,disabled:x.disabled,"force-selection":x.forceSelection,"input-class":s.value,invalid:x.isInvalid,multiple:x.multiple,name:x.name,"option-disabled":x.optionDisabled,"option-label":x.optionLabel,placeholder:x.placeholder,pt:a.value,suggestions:x.options,typeahead:d.value,onClick:O,onComplete:m,onHide:$,onKeydown:[r.withKeys(N,["enter"]),I[1]||(I[1]=r.withKeys(r.withModifiers(()=>{},["stop"]),["esc"]))],onShow:g,onValueChange:C},r.createSlots({empty:r.withCtx(()=>[r.renderSlot(x.$slots,"empty",{},()=>[r.createElementVNode("div",fC,r.toDisplayString(x.emptyMessage),1)])]),chip:r.withCtx(({value:B,removeCallback:Z})=>[r.renderSlot(x.$slots,"tag",{option:B,remove:Z},()=>[r.createVNode(V,{class:"cpMultiselect__tag","is-clearable":"",size:"sm",onOnClear:Z},{"leading-icon":r.withCtx(()=>[r.renderSlot(x.$slots,"tag-leading-icon",{option:B})]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(B.name),1)]),_:2},1032,["onOnClear"])])]),option:r.withCtx(({option:B})=>[r.renderSlot(x.$slots,"option",{option:B},()=>[r.createElementVNode("button",mC,r.toDisplayString(B.name),1)])]),_:2},[d.value?{name:"dropdown",fn:r.withCtx(()=>[h.value?(r.openBlock(),r.createElementBlock("div",yC,[r.renderSlot(x.$slots,"prefix")])):r.createCommentVNode("",!0),x.isLoading?(r.openBlock(),r.createBlock(R,{key:1,class:"cpMultiselect__loader",color:"#B2B2BD"})):(r.openBlock(),r.createElementBlock("button",{key:2,class:"cpMultiselect__toggle",disabled:x.disabled,type:"button",onClick:r.withModifiers(T,["stop"])},[r.createVNode(F,{class:r.normalizeClass(["cpMultiselect__dropdownIcon",p.value]),type:"chevron-down"},null,8,["class"])],8,gC)),f.value?(r.openBlock(),r.createBlock(cC,{key:3,class:"cpMultiselect__clear",onClick:y})):r.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["modelValue","append-to","data-key","disabled","force-selection","input-class","invalid","multiple","name","option-disabled","option-label","placeholder","pt","suggestions","typeahead"]),r.createVNode(Qr,{mode:"out-in"},{default:r.withCtx(()=>[x.isInvalid?(r.openBlock(),r.createElementBlock("p",$C,r.toDisplayString(x.errorMessage),1)):r.createCommentVNode("",!0)]),_:1})])}}}),vC=r.defineComponent({__name:"CpPartnerBadge",props:{size:{default:yn.MD},type:{default:Hn.THIRDPARTY}},setup(t){const e=t,n=r.computed(()=>{switch(e.type){case Hn.OTA:return{classModifier:"isOta",icon:Ms};case Hn.AIRLINE:return{classModifier:"isAirline",icon:Os};case Hn.SUPPLIER:return{classModifier:"isSupplier",icon:Ts};case Hn.THIRDPARTY:default:return{classModifier:"isThirdParty",icon:Ls}}}),o=r.computed(()=>[`cpPartnerBadge--${e.size}`,`cpPartnerBadge--${n.value.classModifier}`]);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cpPartnerBadge",o.value])},[r.renderSlot(i.$slots,"icon",{},()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.value.icon),{class:"cpPartnerBadge__icon"}))])],2))}}),bC=["for"],wC=["id","autofocus","checked","disabled","name","value","onInput"],xC={class:"cpRadio__content"},_C={class:"cpRadio__information"},SC={class:"cpRadio__label"},kC={key:0,class:"cpRadio__description"},IC={key:0,class:"cpRadio__additionalData"},OC=r.defineComponent({__name:"CpRadio",props:{autofocus:{type:Boolean,default:!1},color:{default:Jr.BLUE},groupName:{default:""},modelValue:{},options:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.useId(),s=d=>o("update:modelValue",d),a=d=>`${i}${d}`,l=d=>d===n.modelValue,c=({value:d,disabled:u})=>[{"cpRadio--isActive":l(d),"cpRadio--isDisabled":u},`cpRadio--is${qe(n.color)}`];return(d,u)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.options,({label:p,value:h,description:f,additionalData:m,disabled:y},g)=>(r.openBlock(),r.createElementBlock("label",{key:a(g),class:r.normalizeClass(["cpRadio",c({value:h,disabled:y})]),for:a(g)},[r.createElementVNode("input",{id:a(g),autofocus:d.autofocus,checked:l(h),disabled:y,name:d.groupName,type:"radio",value:h,onInput:$=>s(h)},null,40,wC),r.createElementVNode("span",xC,[r.createElementVNode("span",_C,[r.createElementVNode("span",SC,r.toDisplayString(p),1),f?(r.openBlock(),r.createElementBlock("span",kC,r.toDisplayString(f),1)):r.createCommentVNode("",!0)]),m?(r.openBlock(),r.createElementBlock("span",IC,r.toDisplayString(m),1)):r.createCommentVNode("",!0)])],10,bC))),128))]))}}),MC={class:"cpSelect__container"},TC=["id","autocomplete","disabled","name","required","value"],LC=["disabled"],EC=["value"],NC=["id"],VC=["id"],PC=r.defineComponent({__name:"CpSelect",props:{autocomplete:{default:"on"},defaultValue:{default:"Select an option"},disabled:{type:Boolean,default:!1},errorMessage:{default:""},help:{default:""},hideDefaultValue:{type:Boolean,default:!1},isInvalid:{type:Boolean,default:!1},label:{default:""},modelValue:{default:""},name:{default:void 0},options:{},required:{type:Boolean,default:!1},size:{default:yn.MD},tooltip:{default:""}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.useId(),s=r.useId(),a=r.useId(),l=r.computed(()=>qe(n.label)),c=r.computed(()=>[`cpSelect--${n.size}`,{"cpSelect--isInvalid":n.isInvalid,"cpSelect--isDisabled":n.disabled}]),d=r.computed(()=>n.help?.length&&!u.value),u=r.computed(()=>n.isInvalid&&n.errorMessage.length),p=h=>{const f=h.target;o("update:modelValue",f.value)};return(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cpSelect",c.value])},[h.label?(r.openBlock(),r.createBlock(zn,{key:0,class:"cpSelect__label",for:r.unref(i),"is-invalid":h.isInvalid,required:h.required,tooltip:h.tooltip},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(l.value),1)]),_:1},8,["for","is-invalid","required","tooltip"])):r.createCommentVNode("",!0),r.createElementVNode("div",MC,[r.createElementVNode("select",{id:r.unref(i),autocomplete:h.autocomplete,class:"cpSelect__inner",disabled:h.disabled,name:h.name,required:h.required,value:h.modelValue,onInput:p},[r.createElementVNode("option",{disabled:h.hideDefaultValue,value:""},r.toDisplayString(h.defaultValue),9,LC),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.options,(m,y)=>(r.openBlock(),r.createElementBlock("option",{key:y,value:m.value},r.toDisplayString(m.label),9,EC))),128))],40,TC)]),r.createVNode(Qr,{mode:"out-in"},{default:r.withCtx(()=>[u.value?(r.openBlock(),r.createElementBlock("p",{key:0,id:r.unref(a),class:"cpSelect__error"},r.toDisplayString(h.errorMessage),9,NC)):d.value?(r.openBlock(),r.createElementBlock("p",{key:1,id:r.unref(s),class:"cpSelect__help"},r.toDisplayString(h.help),9,VC)):r.createCommentVNode("",!0)]),_:1})],2))}});/**
|
|
845
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U$(t,e){if(t){if(typeof t=="string")return Hs(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hs(t,e):void 0}}function K$(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function G$(t){if(Array.isArray(t))return Hs(t)}function Hs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}var Oc={name:"AutoComplete",extends:H$,inheritAttrs:!1,emits:["change","focus","blur","item-select","item-unselect","option-select","option-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],inject:{$pcFluid:{default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,dirty:!1,startRangeIndex:-1,data:function(){return{clicked:!1,focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}},watch:{suggestions:function(){this.searching&&(this.show(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1,!this.showEmptyMessage&&this.visibleOptions.length===0&&this.hide()),this.autoUpdateModel()}},mounted:function(){this.autoUpdateModel()},updated:function(){this.overlayVisible&&this.alignOverlay()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(_n.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,n){return this.virtualScrollerDisabled?e:n&&n(e).index},getOptionLabel:function(e){return this.optionLabel?sn(e,this.optionLabel):e},getOptionValue:function(e){return e},getOptionRenderKey:function(e,n){return(this.dataKey?sn(e,this.dataKey):this.getOptionLabel(e))+"_"+n},getPTOptions:function(e,n,o,i){return this.ptm(i,{context:{option:e,index:o,selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(o,n),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return this.optionDisabled?sn(e,this.optionDisabled):!1},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return sn(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return sn(e,this.optionGroupChildren)},getAriaPosInset:function(e){var n=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter(function(o){return n.isOptionGroup(o)}).length:e)+1},show:function(e){this.$emit("before-show"),this.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&<(this.multiple?this.$refs.focusInput:this.$refs.focusInput.$el)},hide:function(e){var n=this,o=function(){var s;n.$emit("before-hide"),n.dirty=e,n.overlayVisible=!1,n.clicked=!1,n.focusedOptionIndex=-1,e&<(n.multiple?n.$refs.focusInput:(s=n.$refs.focusInput)===null||s===void 0?void 0:s.$el)};setTimeout(function(){o()},0)},onFocus:function(e){this.disabled||(!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,this.focused=!0,this.overlayVisible&&(this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.scrollInView(this.focusedOptionIndex)),this.$emit("focus",e))},onBlur:function(e){var n,o;this.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e),(n=(o=this.formField).onBlur)===null||n===void 0||n.call(o)},onKeyDown:function(e){if(this.disabled){e.preventDefault();return}switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;case"Backspace":this.onBackspaceKey(e);break}this.clicked=!1},onInput:function(e){var n=this;if(this.typeahead){this.searchTimeout&&clearTimeout(this.searchTimeout);var o=e.target.value;this.multiple||this.updateModel(e,o),o.length===0?(this.hide(),this.$emit("clear")):o.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout(function(){n.search(e,o,"input")},this.delay)):this.hide()}},onChange:function(e){var n=this;if(this.forceSelection){var o=!1;if(this.visibleOptions&&!this.multiple){var i,s=this.multiple?this.$refs.focusInput.value:(i=this.$refs.focusInput)===null||i===void 0||(i=i.$el)===null||i===void 0?void 0:i.value,a=this.visibleOptions.find(function(d){return n.isOptionMatched(d,s||"")});a!==void 0&&(o=!0,!this.isSelected(a)&&this.onOptionSelect(e,a))}if(!o){if(this.multiple)this.$refs.focusInput.value="";else{var l,c=(l=this.$refs.focusInput)===null||l===void 0?void 0:l.$el;c&&(c.value="")}this.$emit("clear"),!this.multiple&&this.updateModel(e,null)}}},onMultipleContainerFocus:function(){this.disabled||(this.focused=!0)},onMultipleContainerBlur:function(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown:function(e){if(this.disabled){e.preventDefault();return}switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e);break}},onContainerClick:function(e){this.clicked=!0,!(this.disabled||this.searching||this.loading||this.isDropdownClicked(e))&&(!this.overlay||!this.overlay.contains(e.target))&<(this.multiple?this.$refs.focusInput:this.$refs.focusInput.$el)},onDropdownClick:function(e){var n=void 0;if(this.overlayVisible)this.hide(!0);else{var o=this.multiple?this.$refs.focusInput:this.$refs.focusInput.$el;lt(o),n=o.value,this.dropdownMode==="blank"?this.search(e,"","dropdown"):this.dropdownMode==="current"&&this.search(e,n,"dropdown")}this.$emit("dropdown-click",{originalEvent:e,query:n})},onOptionSelect:function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=this.getOptionValue(n);this.multiple?(this.$refs.focusInput.value="",this.isSelected(n)||this.updateModel(e,[].concat(Ic(this.d_value||[]),[i]))):this.updateModel(e,i),this.$emit("item-select",{originalEvent:e,value:n}),this.$emit("option-select",{originalEvent:e,value:n}),o&&this.hide(!0)},onOptionMouseMove:function(e,n){this.focusOnHover&&this.changeFocusedOptionIndex(e,n)},onOptionSelectRange:function(e){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(o===-1&&(o=this.findNearestSelectedOptionIndex(i,!0)),i===-1&&(i=this.findNearestSelectedOptionIndex(o)),o!==-1&&i!==-1){var s=Math.min(o,i),a=Math.max(o,i),l=this.visibleOptions.slice(s,a+1).filter(function(c){return n.isValidOption(c)}).map(function(c){return n.getOptionValue(c)});this.updateModel(e,l)}},onOverlayClick:function(e){T$.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){switch(e.code){case"Escape":this.onEscapeKey(e);break}},onArrowDownKey:function(e){if(this.overlayVisible){var n=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.clicked?this.findFirstOptionIndex():this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,n),this.changeFocusedOptionIndex(e,n),e.preventDefault()}},onArrowUpKey:function(e){if(this.overlayVisible)if(e.altKey)this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var n=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.clicked?this.findLastOptionIndex():this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,n,this.startRangeIndex),this.changeFocusedOptionIndex(e,n),e.preventDefault()}},onArrowLeftKey:function(e){var n=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(zt(n.value)&&this.$filled?(lt(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.d_value.length):e.stopPropagation())},onArrowRightKey:function(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey:function(e){var n=e.currentTarget,o=n.value.length,i=e.metaKey||e.ctrlKey,s=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&i&&this.onOptionSelectRange(e,s,this.startRangeIndex),n.setSelectionRange(0,e.shiftKey?o:0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey:function(e){var n=e.currentTarget,o=n.value.length,i=e.metaKey||e.ctrlKey,s=this.findLastOptionIndex();this.multiple&&e.shiftKey&&i&&this.onOptionSelectRange(e,this.startRangeIndex,s),n.setSelectionRange(e.shiftKey?0:o,o),this.focusedOptionIndex=-1,e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.typeahead?this.overlayVisible?(this.focusedOptionIndex!==-1&&(this.multiple&&e.shiftKey?(this.onOptionSelectRange(e,this.focusedOptionIndex),e.preventDefault()):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),this.hide()):(this.focusedOptionIndex=-1,this.onArrowDownKey(e)):this.multiple&&(e.target.value.trim()&&(this.updateModel(e,[].concat(Ic(this.d_value||[]),[e.target.value.trim()])),this.$refs.focusInput.value=""),e.preventDefault())},onSpaceKey:function(e){!this.autoOptionFocus&&this.focusedOptionIndex!==-1&&this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},onBackspaceKey:function(e){if(this.multiple){if(X(this.d_value)&&!this.$refs.focusInput.value){var n=this.d_value[this.d_value.length-1],o=this.d_value.slice(0,-1);this.writeValue(o,e),this.$emit("item-unselect",{originalEvent:e,value:n}),this.$emit("option-unselect",{originalEvent:e,value:n})}e.stopPropagation()}},onArrowLeftKeyOnMultiple:function(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple:function(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.d_value.length-1&&(this.focusedMultipleOptionIndex=-1,lt(this.$refs.focusInput))},onBackspaceKeyOnMultiple:function(e){this.focusedMultipleOptionIndex!==-1&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter:function(e){_n.set("overlay",e,this.$primevue.config.zIndex.overlay),Li(e,{position:"absolute",top:"0"}),this.alignOverlay(),this.$attrSelector&&e.setAttribute(this.$attrSelector,"")},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){_n.clear(e)},alignOverlay:function(){var e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput.$el;this.appendTo==="self"?F0(this.overlay,e):(this.overlay.style.minWidth=xr(e)+"px",ta(this.overlay,e))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.overlayVisible&&e.overlay&&e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener,!0))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener,!0),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new d$(this.$refs.container,function(){e.overlayVisible&&e.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!ua()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked:function(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked:function(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.focusInput.$el},isDropdownClicked:function(e){return this.$refs.dropdownButton?e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.contains(e.target):!1},isOptionMatched:function(e,n){var o;return this.isValidOption(e)&&((o=this.getOptionLabel(e))===null||o===void 0?void 0:o.toLocaleLowerCase(this.searchLocale))===n.toLocaleLowerCase(this.searchLocale)},isValidOption:function(e){return X(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,n){return T0(e,n,this.equalityKey)},isSelected:function(e){var n=this,o=this.getOptionValue(e);return this.multiple?(this.d_value||[]).some(function(i){return n.isEquals(i,o)}):this.isEquals(this.d_value,this.getOptionValue(e))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex(function(n){return e.isValidOption(n)})},findLastOptionIndex:function(){var e=this;return $o(this.visibleOptions,function(n){return e.isValidOption(n)})},findNextOptionIndex:function(e){var n=this,o=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(i){return n.isValidOption(i)}):-1;return o>-1?o+e+1:e},findPrevOptionIndex:function(e){var n=this,o=e>0?$o(this.visibleOptions.slice(0,e),function(i){return n.isValidOption(i)}):-1;return o>-1?o:e},findSelectedOptionIndex:function(){var e=this;return this.$filled?this.visibleOptions.findIndex(function(n){return e.isValidSelectedOption(n)}):-1},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search:function(e,n,o){n!=null&&(o==="input"&&n.trim().length===0||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:n})))},removeOption:function(e,n){var o=this,i=this.d_value[n],s=this.d_value.filter(function(a,l){return l!==n}).map(function(a){return o.getOptionValue(a)});this.updateModel(e,s),this.$emit("item-unselect",{originalEvent:e,value:i}),this.$emit("option-unselect",{originalEvent:e,value:i}),this.dirty=!0,lt(this.multiple?this.$refs.focusInput:this.$refs.focusInput.$el)},changeFocusedOptionIndex:function(e,n){this.focusedOptionIndex!==n&&(this.focusedOptionIndex=n,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[n],!1))},scrollInView:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;this.$nextTick(function(){var o=n!==-1?"".concat(e.$id,"_").concat(n):e.focusedOptionId,i=ln(e.list,'li[id="'.concat(o,'"]'));i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(n!==-1?n:e.focusedOptionIndex)})},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.$filled&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel:function(e,n){this.writeValue(n,e),this.$emit("change",{originalEvent:e,value:n})},flatOptions:function(e){var n=this;return(e||[]).reduce(function(o,i,s){o.push({optionGroup:i,group:!0,index:s});var a=n.getOptionGroupChildren(i);return a&&a.forEach(function(l){return o.push(l)}),o},[])},overlayRef:function(e){this.overlay=e},listRef:function(e,n){this.list=e,n&&n(e)},virtualScrollerRef:function(e){this.virtualScroller=e},findNextSelectedOptionIndex:function(e){var n=this,o=this.$filled&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(i){return n.isValidSelectedOption(i)}):-1;return o>-1?o+e+1:-1},findPrevSelectedOptionIndex:function(e){var n=this,o=this.$filled&&e>0?$o(this.visibleOptions.slice(0,e),function(i){return n.isValidSelectedOption(i)}):-1;return o>-1?o:-1},findNearestSelectedOptionIndex:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=-1;return this.$filled&&(n?(o=this.findPrevSelectedOptionIndex(e),o=o===-1?this.findNextSelectedOptionIndex(e):o):(o=this.findNextSelectedOptionIndex(e),o=o===-1?this.findPrevSelectedOptionIndex(e):o)),o>-1?o:e}},computed:{visibleOptions:function(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue:function(){if(this.$filled)if(Wn(this.d_value)==="object"){var e=this.getOptionLabel(this.d_value);return e??this.d_value}else return this.d_value;else return""},hasSelectedOption:function(){return this.$filled},equalityKey:function(){return this.dataKey},searchResultMessageText:function(){return X(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.$filled?this.selectionMessageText.replaceAll("{0}",this.multiple?this.d_value.length:"1"):this.emptySelectionMessageText},listAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.listLabel:void 0},focusedOptionId:function(){return this.focusedOptionIndex!==-1?"".concat(this.$id,"_").concat(this.focusedOptionIndex):null},focusedMultipleOptionId:function(){return this.focusedMultipleOptionIndex!==-1?"".concat(this.$id,"_multiple_option_").concat(this.focusedMultipleOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter(function(n){return!e.isOptionGroup(n)}).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions},panelId:function(){return this.$id+"_panel"},containerDataP:function(){return xn({fluid:this.$fluid})},overlayDataP:function(){return xn(kc({},"portal-"+this.appendTo,"portal-"+this.appendTo))},inputMultipleDataP:function(){return xn(kc({invalid:this.$invalid,disabled:this.disabled,focus:this.focused,fluid:this.$fluid,filled:this.$variant==="filled",empty:!this.$filled},this.size,this.size))}},components:{InputText:bc,VirtualScroller:Sc,Portal:Ds,ChevronDownIcon:gc,SpinnerIcon:Fs,Chip:Cc},directives:{ripple:pc}};function er(t){"@babel/helpers - typeof";return er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},er(t)}function Mc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function Tc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Mc(Object(n),!0).forEach(function(o){Y$(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Y$(t,e,n){return(e=q$(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q$(t){var e=J$(t,"string");return er(e)=="symbol"?e:e+""}function J$(t,e){if(er(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(er(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var X$=["data-p"],Q$=["aria-activedescendant","data-p-has-dropdown","data-p"],eC=["id","aria-label","aria-setsize","aria-posinset"],tC=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-invalid"],nC=["data-p-has-dropdown"],oC=["disabled","aria-expanded","aria-controls"],rC=["id","data-p"],iC=["id","aria-label"],sC=["id"],aC=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove","data-p-selected","data-p-focused","data-p-disabled"];function lC(t,e,n,o,i,s){var a=r.resolveComponent("InputText"),l=r.resolveComponent("Chip"),c=r.resolveComponent("SpinnerIcon"),d=r.resolveComponent("VirtualScroller"),u=r.resolveComponent("Portal"),p=r.resolveDirective("ripple");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:t.cx("root"),style:t.sx("root"),onClick:e[11]||(e[11]=function(){return s.onContainerClick&&s.onContainerClick.apply(s,arguments)}),"data-p":s.containerDataP},t.ptmi("root")),[t.multiple?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(a,{key:0,ref:"focusInput",id:t.inputId,type:"text",name:t.$formName,class:r.normalizeClass([t.cx("pcInputText"),t.inputClass]),style:r.normalizeStyle(t.inputStyle),defaultValue:s.inputValue,placeholder:t.placeholder,tabindex:t.disabled?-1:t.tabindex,fluid:t.$fluid,disabled:t.disabled,size:t.size,invalid:t.invalid,variant:t.variant,autocomplete:"off",role:"combobox","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":i.overlayVisible,"aria-controls":s.panelId,"aria-activedescendant":i.focused?s.focusedOptionId:void 0,onFocus:s.onFocus,onBlur:s.onBlur,onKeydown:s.onKeyDown,onInput:s.onInput,onChange:s.onChange,unstyled:t.unstyled,"data-p-has-dropdown":t.dropdown,pt:t.ptm("pcInputText")},null,8,["id","name","class","style","defaultValue","placeholder","tabindex","fluid","disabled","size","invalid","variant","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","onFocus","onBlur","onKeydown","onInput","onChange","unstyled","data-p-has-dropdown","pt"])),t.multiple?(r.openBlock(),r.createElementBlock("ul",r.mergeProps({key:1,ref:"multiContainer",class:t.cx("inputMultiple"),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":i.focused?s.focusedMultipleOptionId:void 0,onFocus:e[5]||(e[5]=function(){return s.onMultipleContainerFocus&&s.onMultipleContainerFocus.apply(s,arguments)}),onBlur:e[6]||(e[6]=function(){return s.onMultipleContainerBlur&&s.onMultipleContainerBlur.apply(s,arguments)}),onKeydown:e[7]||(e[7]=function(){return s.onMultipleContainerKeyDown&&s.onMultipleContainerKeyDown.apply(s,arguments)}),"data-p-has-dropdown":t.dropdown,"data-p":s.inputMultipleDataP},t.ptm("inputMultiple")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.d_value,function(h,f){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:"".concat(f,"_").concat(s.getOptionLabel(h)),id:t.$id+"_multiple_option_"+f,class:t.cx("chipItem",{i:f}),role:"option","aria-label":s.getOptionLabel(h),"aria-selected":!0,"aria-setsize":t.d_value.length,"aria-posinset":f+1},{ref_for:!0},t.ptm("chipItem")),[r.renderSlot(t.$slots,"chip",r.mergeProps({class:t.cx("pcChip"),value:h,index:f,removeCallback:function(y){return s.removeOption(y,f)}},{ref_for:!0},t.ptm("pcChip")),function(){return[r.createVNode(l,{class:r.normalizeClass(t.cx("pcChip")),label:s.getOptionLabel(h),removeIcon:t.chipIcon||t.removeTokenIcon,removable:"",unstyled:t.unstyled,onRemove:function(y){return s.removeOption(y,f)},"data-p-focused":i.focusedMultipleOptionIndex===f,pt:t.ptm("pcChip")},{removeicon:r.withCtx(function(){return[r.renderSlot(t.$slots,t.$slots.chipicon?"chipicon":"removetokenicon",{class:r.normalizeClass(t.cx("chipIcon")),index:f,removeCallback:function(y){return s.removeOption(y,f)}})]}),_:2},1032,["class","label","removeIcon","unstyled","onRemove","data-p-focused","pt"])]})],16,eC)}),128)),r.createElementVNode("li",r.mergeProps({class:t.cx("inputChip"),role:"option"},t.ptm("inputChip")),[r.createElementVNode("input",r.mergeProps({ref:"focusInput",id:t.inputId,type:"text",style:t.inputStyle,class:t.inputClass,placeholder:t.placeholder,tabindex:t.disabled?-1:t.tabindex,disabled:t.disabled,autocomplete:"off",role:"combobox","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":i.overlayVisible,"aria-controls":t.$id+"_list","aria-activedescendant":i.focused?s.focusedOptionId:void 0,"aria-invalid":t.invalid||void 0,onFocus:e[0]||(e[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:e[1]||(e[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:e[2]||(e[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)}),onInput:e[3]||(e[3]=function(){return s.onInput&&s.onInput.apply(s,arguments)}),onChange:e[4]||(e[4]=function(){return s.onChange&&s.onChange.apply(s,arguments)})},t.ptm("input")),null,16,tC)],16)],16,Q$)):r.createCommentVNode("",!0),i.searching||t.loading?r.renderSlot(t.$slots,t.$slots.loader?"loader":"loadingicon",{key:2,class:r.normalizeClass(t.cx("loader"))},function(){return[t.loader||t.loadingIcon?(r.openBlock(),r.createElementBlock("i",r.mergeProps({key:0,class:["pi-spin",t.cx("loader"),t.loader,t.loadingIcon],"aria-hidden":"true","data-p-has-dropdown":t.dropdown},t.ptm("loader")),null,16,nC)):(r.openBlock(),r.createBlock(c,r.mergeProps({key:1,class:t.cx("loader"),spin:"","aria-hidden":"true","data-p-has-dropdown":t.dropdown},t.ptm("loader")),null,16,["class","data-p-has-dropdown"]))]}):r.createCommentVNode("",!0),r.renderSlot(t.$slots,t.$slots.dropdown?"dropdown":"dropdownbutton",{toggleCallback:function(f){return s.onDropdownClick(f)}},function(){return[t.dropdown?(r.openBlock(),r.createElementBlock("button",r.mergeProps({key:0,ref:"dropdownButton",type:"button",class:[t.cx("dropdown"),t.dropdownClass],disabled:t.disabled,"aria-haspopup":"listbox","aria-expanded":i.overlayVisible,"aria-controls":s.panelId,onClick:e[8]||(e[8]=function(){return s.onDropdownClick&&s.onDropdownClick.apply(s,arguments)})},t.ptm("dropdown")),[r.renderSlot(t.$slots,"dropdownicon",{class:r.normalizeClass(t.dropdownIcon)},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.dropdownIcon?"span":"ChevronDownIcon"),r.mergeProps({class:t.dropdownIcon},t.ptm("dropdownIcon")),null,16,["class"]))]})],16,oC)):r.createCommentVNode("",!0)]}),t.typeahead?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:3,role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.searchResultMessageText),17)):r.createCommentVNode("",!0),r.createVNode(u,{appendTo:t.appendTo},{default:r.withCtx(function(){return[r.createVNode(r.Transition,r.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},t.ptm("transition")),{default:r.withCtx(function(){return[i.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.overlayRef,id:s.panelId,class:[t.cx("overlay"),t.panelClass,t.overlayClass],style:Tc(Tc({},t.panelStyle),t.overlayStyle),onClick:e[9]||(e[9]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:e[10]||(e[10]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)}),"data-p":s.overlayDataP},t.ptm("overlay")),[r.renderSlot(t.$slots,"header",{value:t.d_value,suggestions:s.visibleOptions}),r.createElementVNode("div",r.mergeProps({class:t.cx("listContainer"),style:{"max-height":s.virtualScrollerDisabled?t.scrollHeight:""}},t.ptm("listContainer")),[r.createVNode(d,r.mergeProps({ref:s.virtualScrollerRef},t.virtualScrollerOptions,{style:{height:t.scrollHeight},items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:t.ptm("virtualScroller")}),r.createSlots({content:r.withCtx(function(h){var f=h.styleClass,m=h.contentRef,y=h.items,g=h.getItemOptions,$=h.contentStyle,C=h.itemSize;return[r.createElementVNode("ul",r.mergeProps({ref:function(v){return s.listRef(v,m)},id:t.$id+"_list",class:[t.cx("list"),f],style:$,role:"listbox","aria-label":s.listAriaLabel},t.ptm("list")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y,function(b,v){return r.openBlock(),r.createElementBlock(r.Fragment,{key:s.getOptionRenderKey(b,s.getOptionIndex(v,g))},[s.isOptionGroup(b)?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,id:t.$id+"_"+s.getOptionIndex(v,g),style:{height:C?C+"px":void 0},class:t.cx("optionGroup"),role:"option"},{ref_for:!0},t.ptm("optionGroup")),[r.renderSlot(t.$slots,"optiongroup",{option:b.optionGroup,index:s.getOptionIndex(v,g)},function(){return[r.createTextVNode(r.toDisplayString(s.getOptionGroupLabel(b.optionGroup)),1)]})],16,sC)):r.withDirectives((r.openBlock(),r.createElementBlock("li",r.mergeProps({key:1,id:t.$id+"_"+s.getOptionIndex(v,g),style:{height:C?C+"px":void 0},class:t.cx("option",{option:b,i:v,getItemOptions:g}),role:"option","aria-label":s.getOptionLabel(b),"aria-selected":s.isSelected(b),"aria-disabled":s.isOptionDisabled(b),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(v,g)),onClick:function(O){return s.onOptionSelect(O,b)},onMousemove:function(O){return s.onOptionMouseMove(O,s.getOptionIndex(v,g))},"data-p-selected":s.isSelected(b),"data-p-focused":i.focusedOptionIndex===s.getOptionIndex(v,g),"data-p-disabled":s.isOptionDisabled(b)},{ref_for:!0},s.getPTOptions(b,g,v,"option")),[r.renderSlot(t.$slots,"option",{option:b,index:s.getOptionIndex(v,g)},function(){return[r.createTextVNode(r.toDisplayString(s.getOptionLabel(b)),1)]})],16,aC)),[[p]])],64)}),128)),t.showEmptyMessage&&(!y||y&&y.length===0)?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,class:t.cx("emptyMessage"),role:"option"},t.ptm("emptyMessage")),[r.renderSlot(t.$slots,"empty",{},function(){return[r.createTextVNode(r.toDisplayString(s.searchResultMessageText),1)]})],16)):r.createCommentVNode("",!0)],16,iC)]}),_:2},[t.$slots.loader?{name:"loader",fn:r.withCtx(function(h){var f=h.options;return[r.renderSlot(t.$slots,"loader",{options:f})]}),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),r.renderSlot(t.$slots,"footer",{value:t.d_value,suggestions:s.visibleOptions}),r.createElementVNode("span",r.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.selectedMessageText),17)],16,rC)):r.createCommentVNode("",!0)]}),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo"])],16,X$)}Oc.render=lC;const dC={class:"baseSelectClearButton",type:"button"},cC=r.defineComponent({__name:"BaseSelectClearButton",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("button",dC,[r.createVNode(gn,{size:"12",type:"x"})]))}}),Qr=E(r.defineComponent({__name:"TransitionExpand",setup(t){const e=i=>{i.style.height="auto"},n=i=>{const{width:s}=getComputedStyle(i);i.style.width=s,i.style.position="absolute",i.style.visibility="hidden",i.style.height="auto";const{height:a}=getComputedStyle(i);i.style.width="",i.style.position="",i.style.visibility="",i.style.height="0",getComputedStyle(i).height,requestAnimationFrame(()=>i.style.height=a)},o=i=>{const{height:s}=getComputedStyle(i);i.style.height=s,requestAnimationFrame(()=>{i.style.height="0"})};return(i,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"expand",onEnter:n,onAfterEnter:e,onLeave:o},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"default",{},void 0,!0)]),_:3}))}}),[["__scopeId","data-v-246f87a7"]]),uC=t=>t!==null&&typeof t=="object",pC=t=>uC(t)?Reflect.ownKeys(t).length===0&&t.constructor===Object:!0,hC={class:"cpMultiselect"},fC={class:"cpMultiselect__empty"},mC={class:"cpMultiselect__option",type:"button"},yC={key:0,class:"cpMultiselect__prefix"},gC=["disabled"],$C={key:0,class:"cpMultiselect__error"},CC=r.defineComponent({__name:"CpMultiselect",props:{appendTo:{default:"body"},disabled:{type:Boolean},emptyMessage:{default:"No results found"},errorMessage:{default:""},forceSelection:{type:Boolean},isClearable:{type:Boolean},isInvalid:{type:Boolean},isLoading:{type:Boolean},label:{default:""},modelValue:{default:null},multiple:{type:Boolean},name:{default:""},optionDisabled:{type:[String,Function],default:"disabled"},optionLabel:{default:void 0},options:{default:()=>[]},placeholder:{default:""},required:{type:Boolean},size:{default:"md"},trackBy:{default:void 0},withoutTypeahead:{type:Boolean}},emits:["search","clear","update:modelValue","overlayShown","overlayHidden"],setup(t,{emit:e}){const n=t,o=e,i=r.computed({get(){return n.modelValue},set(x){typeof x!="string"&&o("update:modelValue",x)}}),s=r.computed(()=>({cpMultiselect__input:!0,"cpMultiselect__input--isSingle":!n.multiple})),a=r.computed(()=>({root:{class:`cpMultiselect__select cpMultiselect__select--${n.size}`},inputmultiple:{class:"cpMultiselect__tags"},dropdown:{class:"cpMultiselect__toggle"},inputchip:{class:"cpMultiselect__inputWrapper"},overlay:{class:`cpMultiselect__overlay ${d.value?"":"cpMultiselect__overlay--isHidden"}`},listcontainer:{class:"cpMultiselect__listWrapper"},list:{class:"cpMultiselect__list"},option:{class:"cpMultiselect__optionWrapper"},loader:{class:"cpMultiselect__hidden"}})),l=r.ref(null),c=r.ref(""),d=r.computed(()=>!n.withoutTypeahead),u=r.computed(()=>l.value?.overlayVisible),p=r.computed(()=>({"cpMultiselect__dropdownIcon--isRotated":u.value})),h=r.computed(()=>n.multiple?!i.value?.length:!0),f=r.computed(()=>n.multiple?!1:n.isClearable&&!pC(i.value)),m=x=>o("search",x.query),y=()=>i.value=null,g=()=>o("overlayShown"),$=()=>o("overlayHidden"),C=x=>{typeof x=="string"&&(c.value=x,x===""&&o("search",x))},b=()=>l.value&&l.value.$el?.querySelector("input")||null,v=()=>{const x=b();x&&x.select()},w=()=>{const x=b();x&&(x.focus(),x.select())},O=()=>{N(),v()},T=()=>{N(),w()},N=()=>{u.value?l.value?.hide():l.value?.show()},A=x=>{},P=()=>{l.value&&(l.value.alignOverlay=D)},D=()=>{const x=l.value?.$el;!l.value?.overlay||!x||(l.value.overlay.style.width=`${xr(x)}px`,ta(l.value.overlay,x))};return r.onMounted(()=>P()),(x,I)=>{const V=r.resolveComponent("cp-badge"),R=r.resolveComponent("cp-loader"),F=r.resolveComponent("cp-icon");return r.openBlock(),r.createElementBlock("div",hC,[x.label?(r.openBlock(),r.createBlock(zn,{key:0,class:"cpMultiselect__label","is-invalid":x.isInvalid,required:x.required},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(x.label),1)]),_:1},8,["is-invalid","required"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Oc),{ref_key:"multiselect",ref:l,modelValue:i.value,"onUpdate:modelValue":[I[0]||(I[0]=B=>i.value=B),A],"append-to":x.appendTo,"auto-option-focus":"","data-key":x.trackBy,disabled:x.disabled,"force-selection":x.forceSelection,"input-class":s.value,invalid:x.isInvalid,multiple:x.multiple,name:x.name,"option-disabled":x.optionDisabled,"option-label":x.optionLabel,placeholder:x.placeholder,pt:a.value,suggestions:x.options,typeahead:d.value,onClick:O,onComplete:m,onHide:$,onKeydown:[r.withKeys(N,["enter"]),I[1]||(I[1]=r.withKeys(r.withModifiers(()=>{},["stop"]),["esc"]))],onShow:g,onValueChange:C},r.createSlots({empty:r.withCtx(()=>[r.renderSlot(x.$slots,"empty",{},()=>[r.createElementVNode("div",fC,r.toDisplayString(x.emptyMessage),1)])]),chip:r.withCtx(({value:B,removeCallback:Z})=>[r.renderSlot(x.$slots,"tag",{option:B,remove:Z},()=>[r.createVNode(V,{class:"cpMultiselect__tag","is-clearable":"",size:"sm",onOnClear:Z},{"leading-icon":r.withCtx(()=>[r.renderSlot(x.$slots,"tag-leading-icon",{option:B})]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(B.name),1)]),_:2},1032,["onOnClear"])])]),option:r.withCtx(({option:B})=>[r.renderSlot(x.$slots,"option",{option:B},()=>[r.createElementVNode("button",mC,r.toDisplayString(B.name),1)])]),_:2},[d.value?{name:"dropdown",fn:r.withCtx(()=>[h.value?(r.openBlock(),r.createElementBlock("div",yC,[r.renderSlot(x.$slots,"prefix")])):r.createCommentVNode("",!0),x.isLoading?(r.openBlock(),r.createBlock(R,{key:1,class:"cpMultiselect__loader",color:"#B2B2BD"})):(r.openBlock(),r.createElementBlock("button",{key:2,class:"cpMultiselect__toggle",disabled:x.disabled,type:"button",onClick:r.withModifiers(T,["stop"])},[r.createVNode(F,{class:r.normalizeClass(["cpMultiselect__dropdownIcon",p.value]),type:"chevron-down"},null,8,["class"])],8,gC)),f.value?(r.openBlock(),r.createBlock(cC,{key:3,class:"cpMultiselect__clear",onClick:y})):r.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["modelValue","append-to","data-key","disabled","force-selection","input-class","invalid","multiple","name","option-disabled","option-label","placeholder","pt","suggestions","typeahead"]),r.createVNode(Qr,{mode:"out-in"},{default:r.withCtx(()=>[x.isInvalid?(r.openBlock(),r.createElementBlock("p",$C,r.toDisplayString(x.errorMessage),1)):r.createCommentVNode("",!0)]),_:1})])}}}),vC=r.defineComponent({__name:"CpPartnerBadge",props:{size:{default:yn.MD},type:{default:Hn.THIRDPARTY}},setup(t){const e=t,n=r.computed(()=>{switch(e.type){case Hn.OTA:return{classModifier:"isOta",icon:Ms};case Hn.AIRLINE:return{classModifier:"isAirline",icon:Os};case Hn.SUPPLIER:return{classModifier:"isSupplier",icon:Ts};case Hn.THIRDPARTY:default:return{classModifier:"isThirdParty",icon:Ls}}}),o=r.computed(()=>[`cpPartnerBadge--${e.size}`,`cpPartnerBadge--${n.value.classModifier}`]);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cpPartnerBadge",o.value])},[r.renderSlot(i.$slots,"icon",{},()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.value.icon),{class:"cpPartnerBadge__icon"}))])],2))}}),bC=["for"],wC=["id","autofocus","checked","disabled","name","value","onInput"],xC={class:"cpRadio__content"},_C={class:"cpRadio__information"},SC={class:"cpRadio__label"},kC={key:0,class:"cpRadio__description"},IC={key:0,class:"cpRadio__additionalData"},OC=r.defineComponent({__name:"CpRadio",props:{autofocus:{type:Boolean,default:!1},color:{default:Jr.BLUE},groupName:{default:""},modelValue:{},options:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.useId(),s=d=>o("update:modelValue",d),a=d=>`${i}${d}`,l=d=>d===n.modelValue,c=({value:d,disabled:u})=>[{"cpRadio--isActive":l(d),"cpRadio--isDisabled":u},`cpRadio--is${qe(n.color)}`];return(d,u)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.options,({label:p,value:h,description:f,additionalData:m,disabled:y},g)=>(r.openBlock(),r.createElementBlock("label",{key:a(g),class:r.normalizeClass(["cpRadio",c({value:h,disabled:y})]),for:a(g)},[r.createElementVNode("input",{id:a(g),autofocus:d.autofocus,checked:l(h),disabled:y,name:d.groupName,type:"radio",value:h,onInput:$=>s(h)},null,40,wC),r.createElementVNode("span",xC,[r.createElementVNode("span",_C,[r.createElementVNode("span",SC,r.toDisplayString(p),1),f?(r.openBlock(),r.createElementBlock("span",kC,r.toDisplayString(f),1)):r.createCommentVNode("",!0)]),m?(r.openBlock(),r.createElementBlock("span",IC,r.toDisplayString(m),1)):r.createCommentVNode("",!0)])],10,bC))),128))]))}}),MC={class:"cpSelect__container"},TC=["id","autocomplete","disabled","name","required","value"],LC=["disabled"],EC=["value"],NC=["id"],VC=["id"],PC=r.defineComponent({__name:"CpSelect",props:{autocomplete:{default:"on"},defaultValue:{default:"Select an option"},disabled:{type:Boolean,default:!1},errorMessage:{default:""},help:{default:""},hideDefaultValue:{type:Boolean,default:!1},isInvalid:{type:Boolean,default:!1},label:{default:""},modelValue:{default:""},name:{default:void 0},options:{},required:{type:Boolean,default:!1},size:{default:yn.MD},tooltip:{default:""}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.useId(),s=r.useId(),a=r.useId(),l=r.computed(()=>qe(n.label)),c=r.computed(()=>[`cpSelect--${n.size}`,{"cpSelect--isInvalid":n.isInvalid,"cpSelect--isDisabled":n.disabled}]),d=r.computed(()=>n.help?.length&&!u.value),u=r.computed(()=>n.isInvalid&&n.errorMessage.length),p=h=>{const f=h.target;o("update:modelValue",f.value)};return(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cpSelect",c.value])},[h.label?(r.openBlock(),r.createBlock(zn,{key:0,class:"cpSelect__label",for:r.unref(i),"is-invalid":h.isInvalid,required:h.required,tooltip:h.tooltip},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(l.value),1)]),_:1},8,["for","is-invalid","required","tooltip"])):r.createCommentVNode("",!0),r.createElementVNode("div",MC,[r.createElementVNode("select",{id:r.unref(i),autocomplete:h.autocomplete,class:"cpSelect__inner",disabled:h.disabled,name:h.name,required:h.required,value:h.modelValue,onInput:p},[r.createElementVNode("option",{disabled:h.hideDefaultValue,value:""},r.toDisplayString(h.defaultValue),9,LC),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.options,(m,y)=>(r.openBlock(),r.createElementBlock("option",{key:y,value:m.value},r.toDisplayString(m.label),9,EC))),128))],40,TC)]),r.createVNode(Qr,{mode:"out-in"},{default:r.withCtx(()=>[u.value?(r.openBlock(),r.createElementBlock("p",{key:0,id:r.unref(a),class:"cpSelect__error"},r.toDisplayString(h.errorMessage),9,NC)):d.value?(r.openBlock(),r.createElementBlock("p",{key:1,id:r.unref(s),class:"cpSelect__help"},r.toDisplayString(h.help),9,VC)):r.createCommentVNode("",!0)]),_:1})],2))}});/**
|
|
846
846
|
* anime.js - ESM
|
|
847
847
|
* @version v4.1.3
|
|
848
848
|
* @author Julian Garnier
|
package/package.json
CHANGED
|
@@ -94,7 +94,6 @@ interface Emits {
|
|
|
94
94
|
(e: 'update:modelValue', value: Record<string, unknown> | Record<string, unknown>[] | string[] | null): void
|
|
95
95
|
(e: 'overlayShown'): void
|
|
96
96
|
(e: 'overlayHidden'): void
|
|
97
|
-
(e: 'searchChange', value: string | object): void
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
interface Props {
|
|
@@ -197,7 +196,9 @@ const handleOverlayHidden = () => emit('overlayHidden')
|
|
|
197
196
|
const handleValueChange = (newValue: string | object) => {
|
|
198
197
|
if (typeof newValue !== 'string') return
|
|
199
198
|
searchQuery.value = newValue
|
|
200
|
-
|
|
199
|
+
|
|
200
|
+
// NOTE: because @complete is not triggered when the input is cleared
|
|
201
|
+
if (newValue === '') emit('search', newValue)
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
const getInputElement = () => {
|