import{b as ye}from"./chunk-32TAN2WD.js";import{a as fe,b as be,c as Ie}from"./chunk-HGZRUCDN.js";import{b as ge}from"./chunk-U62COGMS.js";import{a as de,b as he,d as me,f as _e,i as Ce,j as ve,l as we}from"./chunk-ZAUYFBHZ.js";import{C as ce,a as O,g as pe,n as re}from"./chunk-Z4R7HYSO.js";import{Bb as C,Cc as A,Da as d,Db as r,Ec as ie,Fc as I,Gb as W,Gc as L,Hb as G,Ib as V,Ja as T,Jb as M,La as k,Ma as j,Oc as te,Pb as H,Pc as ne,Qa as U,Qc as oe,Ra as m,Rb as F,Rc as ae,Sc as le,X as x,Y as R,Yb as J,Z as N,Zb as X,Zc as se,_a as w,_b as Y,aa as P,ec as S,fa as c,ga as u,gb as p,gc as y,hb as _,ib as f,jc as Z,ma as v,mh as ue,nb as q,nh as E,ob as z,pb as $,sa as K,sc as ee,tb as b,ua as Q,xc as B}from"./chunk-WSBGJRUM.js";import{i as g}from"./chunk-PMOLICDQ.js";var Me=["inputtext"],Se=["container"],Oe=(e,o,a,i)=>({"p-inputchips p-component p-input-wrapper":!0,"p-disabled":e,"p-focus":o,"p-inputwrapper-filled":a,"p-inputwrapper-focus":i}),Ee=e=>({"p-chips-clearable":e}),De=e=>({"p-inputchips-chip-item":!0,"p-focus":e}),Te=e=>({$implicit:e}),$e=e=>({removeItem:e});function Fe(e,o){e&1&&$(0);}function Be(e,o){e&1&&$(0);}function Ae(e,o){if(e&1){let a=b();_(0,"TimesCircleIcon",16),C("click",function(n){c(a);let t=r(4).index,l=r();return u(l.removeItem(n,t));}),f();}e&2&&(p("styleClass","p-chips-token-icon"),w("data-pc-section","removeTokenIcon")("aria-hidden",!0));}function Le(e,o){}function Re(e,o){e&1&&m(0,Le,0,0,"ng-template");}function Ne(e,o){if(e&1){let a=b();_(0,"span",17),C("click",function(n){c(a);let t=r(4).index,l=r();return u(l.removeItem(n,t));}),m(1,Re,1,0,null,11),f();}if(e&2){let a=r(5);w("data-pc-section","removeTokenIcon")("aria-hidden",!0),d(),p("ngTemplateOutlet",a.removeTokenIconTemplate)("ngTemplateOutletContext",y(4,$e,a.removeItem.bind(a)));}}function Pe(e,o){if(e&1&&(q(0),m(1,Ae,1,3,"TimesCircleIcon",14)(2,Ne,2,6,"span",15),z()),e&2){let a=r(4);d(),p("ngIf",!a.removeTokenIconTemplate),d(),p("ngIf",a.removeTokenIconTemplate);}}function Ke(e,o){if(e&1&&m(0,Pe,3,2,"ng-container",9),e&2){let a=r(3);p("ngIf",!a.disabled);}}function Qe(e,o){if(e&1){let a=b();_(0,"p-chip",13),C("onRemove",function(n){c(a);let t=r().index,l=r();return u(l.removeItem(n,t));}),m(1,Be,1,0,"ng-container",11)(2,Ke,1,1,"ng-template",null,3,ee),f();}if(e&2){let a=r().$implicit,i=r();p("label",i.field?i.resolveFieldData(a,i.field):a)("removeIcon",i.chipIcon),d(),p("ngTemplateOutlet",i.itemTemplate)("ngTemplateOutletContext",y(4,Te,a));}}function je(e,o){if(e&1){let a=b();_(0,"li",10,2),C("click",function(n){let t=c(a).$implicit,l=r();return u(l.onItemClick(n,t));})("contextmenu",function(n){let t=c(a).$implicit,l=r();return u(l.onItemContextMenu(n,t));}),m(2,Fe,1,0,"ng-container",11)(3,Qe,4,6,"p-chip",12),f();}if(e&2){let a=o.$implicit,i=o.index,n=r();p("ngClass",y(11,De,n.focusedIndex===i)),w("id",n.id+"_chips_item_"+i)("ariaLabel",a)("aria-selected",!0)("aria-setsize",n.value.length)("aria-posinset",i+1)("data-p-focused",n.focusedIndex===i)("data-pc-section","token"),d(2),p("ngTemplateOutlet",n.itemTemplate)("ngTemplateOutletContext",y(13,Te,a)),d(),p("ngIf",!n.itemTemplate);}}function Ue(e,o){if(e&1){let a=b();_(0,"TimesIcon",16),C("click",function(){c(a);let n=r(2);return u(n.clear());}),f();}e&2&&p("styleClass","p-chips-clear-icon");}function qe(e,o){}function ze(e,o){e&1&&m(0,qe,0,0,"ng-template");}function We(e,o){if(e&1){let a=b();_(0,"span",19),C("click",function(){c(a);let n=r(2);return u(n.clear());}),m(1,ze,1,0,null,20),f();}if(e&2){let a=r(2);d(),p("ngTemplateOutlet",a.clearIconTemplate);}}function Ge(e,o){if(e&1&&(_(0,"li"),m(1,Ue,1,1,"TimesIcon",14)(2,We,2,1,"span",18),f()),e&2){let a=r();d(),p("ngIf",!a.clearIconTemplate),d(),p("ngIf",a.clearIconTemplate);}}var He=({dt:e})=>`
.p-inputchips {
    display: inline-flex;
}

.p-inputchips-input {
    margin: 0;
    list-style-type: none;
    cursor: text;
    overflow: hidden;
    display: flex;
    position: relative;
    align-items: center;
    flex-wrap: wrap;
    padding: calc(${e("inputchips.padding.y")} / 2) ${e("inputchips.padding.x")};
    gap: calc(${e("inputchips.padding.y")} / 2);
    color: ${e("inputchips.color")};
    background: ${e("inputchips.background")};
    border: 1px solid ${e("inputchips.border.color")};
    border-radius: ${e("inputchips.border.radius")};
    width: 100%;
    transition: background ${e("inputchips.transition.duration")}, color ${e("inputchips.transition.duration")}, border-color ${e("inputchips.transition.duration")}, outline-color ${e("inputchips.transition.duration")}, box-shadow ${e("inputchips.transition.duration")};
    outline-color: transparent;
    box-shadow: ${e("inputchips.shadow")};
}

.p-inputchips:not(.p-disabled):hover .p-inputchips-input {
    border-color: ${e("inputchips.hover.border.color")};
}

.p-inputchips:not(.p-disabled).p-focus .p-inputchips-input {
    border-color: ${e("inputchips.focus.border.color")};
    box-shadow: ${e("inputchips.focus.ring.shadow")};
    outline: ${e("inputchips.focus.ring.width")} ${e("inputchips.focus.ring.style")} ${e("inputchips.focus.ring.color")};
    outline-offset: ${e("inputchips.focus.ring.offset")};
}

.p-inputchips.p-invalid .p-inputchips-input {
    border-color: ${e("inputchips.invalid.border.color")};
}

.p-variant-filled.p-inputchips-input {
    background: ${e("inputchips.filled.background")};
}

.p-inputchips:not(.p-disabled).p-focus .p-variant-filled.p-inputchips-input  {
    background: ${e("inputchips.filled.focus.background")};
}

.p-inputchips.p-disabled .p-inputchips-input {
    opacity: 1;
    background: ${e("inputchips.disabled.background")};
    color: ${e("inputchips.disabled.color")};
}

.p-inputchips-chip.p-chip {
    padding-top: calc(${e("inputchips.padding.y")} / 2);
    padding-bottom: calc(${e("inputchips.padding.y")} / 2);
    border-radius: ${e("inputchips.chip.border.radius")};
    transition: background ${e("inputchips.transition.duration")}, color ${e("inputchips.transition.duration")};
}

.p-inputchips-chip-item.p-focus .p-inputchips-chip {
    background: ${e("inputchips.chip.focus.background")};
    color: ${e("inputchips.chip.focus.color")};
}

.p-inputchips-input:has(.p-inputchips-chip) {
    padding-left: calc(${e("inputchips.padding.y")} / 2);
    padding-right: calc(${e("inputchips.padding.y")} / 2);
}

.p-inputchips-input-item {
    flex: 1 1 auto;
    display: inline-flex;
    padding-top: calc(${e("inputchips.padding.y")} / 2);
    padding-bottom: calc(${e("inputchips.padding.y")} / 2);
}

.p-inputchips-input-item input {
    border: 0 none;
    outline: 0 none;
    background: transparent;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    width: 100%;
    font-family: inherit;
    font-feature-settings: inherit;
    font-size: 1rem;
    color: inherit;
}

.p-inputchips-input-item input::placeholder {
    color: ${e("inputchips.placeholder.color")};
}

/* For PrimeNG */

.p-chips-clear-icon {
    position: absolute;
    top: 50%;
    margin-top: -0.5rem;
    cursor: pointer;
    right: ${e("inputchips.padding.x")};
}
`,Je={root:({instance:e,props:o})=>["p-inputchips p-component p-inputwrapper",{"p-disabled":o.disabled,"p-invalid":o.invalid,"p-focus":e.focused,"p-inputwrapper-filled":o.modelValue&&o.modelValue.length||e.inputValue&&e.inputValue.length,"p-inputwrapper-focus":e.focused}],input:({props:e,instance:o})=>["p-inputchips-input",{"p-variant-filled":e.variant?e.variant==="filled":o.config.inputStyle==="filled"||o.config.inputVariant==="filled"}],chipItem:({state:e,index:o})=>["p-inputchips-chip-item",{"p-focus":e.focusedIndex===o}],pcChip:"p-inputchips-chip",chipIcon:"p-inputchips-chip-icon",inputItem:"p-inputchips-input-item"},xe=(()=>{let o=class o extends de{name="inputchips";theme=He;classes=Je;};g(o,"\u0275fac",(()=>{let i;return function(t){return(i||(i=K(o)))(t||o);};})()),g(o,"\u0275prov",R({token:o,factory:o.ɵfac}));let e=o;return e;})();var Xe={provide:O,useExisting:x(()=>D),multi:!0},D=(()=>{let o=class o extends me{el;cd;config;style;styleClass;disabled;field;placeholder;max;maxLength;ariaLabel;ariaLabelledBy;tabindex;inputId;allowDuplicate=!0;caseSensitiveDuplication=!0;inputStyle;inputStyleClass;chipIcon;addOnTab;addOnBlur;separator;showClear=!1;autofocus;variant="outlined";onAdd=new v();onRemove=new v();onFocus=new v();onBlur=new v();onChipClick=new v();onChipContextMenu=new v();onClear=new v();inputViewChild;containerViewChild;templates;itemTemplate;removeTokenIconTemplate;clearIconTemplate;value;onModelChange=()=>{};onModelTouched=()=>{};valueChanged;id=ge();focused;focusedIndex;filled;_componentStyle=P(xe);get focusedOptionId(){return this.focusedIndex!==null?`${this.id}_chips_item_${this.focusedIndex}`:null;}get isMaxedOut(){return this.max&&this.value&&this.max===this.value.length;}constructor(i,n,t){super(),this.el=i,this.cd=n,this.config=t,console.log("Deprecated since v18. Use AutoComplete component instead with its typeahead property.");}ngAfterContentInit(){this.templates.forEach(i=>{switch(i.getType()){case"item":this.itemTemplate=i.template;break;case"removetokenicon":this.removeTokenIconTemplate=i.template;break;case"clearicon":this.clearIconTemplate=i.template;break;default:this.itemTemplate=i.template;break;}}),this.updateFilledState();}onWrapperClick(){this.inputViewChild?.nativeElement.focus();}onContainerFocus(){this.focused=!0;}onContainerBlur(){this.focusedIndex=-1,this.focused=!1;}onContainerKeyDown(i){switch(i.code){case"ArrowLeft":this.onArrowLeftKeyOn();break;case"ArrowRight":this.onArrowRightKeyOn();break;case"Backspace":this.onBackspaceKeyOn(i);break;case"Space":this.focusedIndex!==null&&this.value&&this.value.length>0&&this.onItemClick(i,this.value[this.focusedIndex]);break;default:break;}}onArrowLeftKeyOn(){this.inputViewChild.nativeElement.value.length===0&&this.value&&this.value.length>0&&(this.focusedIndex=this.focusedIndex===null?this.value.length-1:this.focusedIndex-1,this.focusedIndex<0&&(this.focusedIndex=0));}onArrowRightKeyOn(){this.inputViewChild.nativeElement.value.length===0&&this.value&&this.value.length>0&&(this.focusedIndex===this.value.length-1?(this.focusedIndex=null,this.inputViewChild?.nativeElement.focus()):this.focusedIndex++);}onBackspaceKeyOn(i){this.focusedIndex!==null&&this.removeItem(i,this.focusedIndex);}onInput(){this.updateFilledState(),this.focusedIndex=null;}onPaste(i){this.disabled||(this.separator&&((i.clipboardData||this.document.defaultView.clipboardData).getData("Text").split(this.separator).forEach(t=>{this.addItem(i,t,!0);}),this.inputViewChild.nativeElement.value=""),this.updateFilledState());}updateFilledState(){!this.value||this.value.length===0?this.filled=this.inputViewChild&&this.inputViewChild.nativeElement&&this.inputViewChild.nativeElement.value!="":this.filled=!0;}onItemClick(i,n){this.onChipClick.emit({originalEvent:i,value:n});}onItemContextMenu(i,n){this.onChipContextMenu.emit({originalEvent:i,value:n});}writeValue(i){this.value=i,this.updateMaxedOut(),this.updateFilledState(),this.cd.markForCheck();}registerOnChange(i){this.onModelChange=i;}registerOnTouched(i){this.onModelTouched=i;}setDisabledState(i){this.disabled=i,this.cd.markForCheck();}resolveFieldData(i,n){if(i&&n){if(n.indexOf(".")==-1)return i[n];{let s=n.split("."),h=i;for(var t=0,l=s.length;t<l;++t)h=h[s[t]];return h;}}else return null;}onInputFocus(i){this.focused=!0,this.focusedIndex=null,this.onFocus.emit(i);}onInputBlur(i){this.focused=!1,this.focusedIndex=null,this.addOnBlur&&this.inputViewChild.nativeElement.value&&this.addItem(i,this.inputViewChild.nativeElement.value,!1),this.onModelTouched(),this.onBlur.emit(i);}removeItem(i,n){if(this.disabled)return;let t=this.value[n];this.value=this.value.filter((l,s)=>s!=n),this.focusedIndex=null,this.inputViewChild.nativeElement.focus(),this.onModelChange(this.value),this.onRemove.emit({originalEvent:i,value:t}),this.updateFilledState(),this.updateMaxedOut();}addItem(i,n,t){if(this.value=this.value||[],n&&n.trim().length){let l=this.caseSensitiveDuplication?this.value.includes(n):this.value.some(s=>s.toLowerCase()===n.toLowerCase());(this.allowDuplicate||!l)&&!this.isMaxedOut&&(this.value=[...this.value,n],this.onModelChange(this.value),this.onAdd.emit({originalEvent:i,value:n}));}this.updateFilledState(),this.updateMaxedOut(),this.inputViewChild.nativeElement.value="",t&&i.preventDefault();}clear(){this.value=null,this.updateFilledState(),this.onModelChange(this.value),this.updateMaxedOut(),this.onClear.emit();}onKeyDown(i){let n=i.target.value;switch(i.code){case"Backspace":n.length===0&&this.value&&this.value.length>0&&(this.focusedIndex!==null?this.removeItem(i,this.focusedIndex):this.removeItem(i,this.value.length-1));break;case"Enter":case"NumpadEnter":n&&n.trim().length&&!this.isMaxedOut&&this.addItem(i,n,!0);break;case"Tab":this.addOnTab&&n&&n.trim().length&&!this.isMaxedOut&&(this.addItem(i,n,!0),i.preventDefault());break;case"ArrowLeft":n.length===0&&this.value&&this.value.length>0&&this.containerViewChild?.nativeElement.focus();break;case"ArrowRight":i.stopPropagation();break;default:this.separator&&(this.separator===i.key||i.key.match(this.separator))&&this.addItem(i,n,!0);break;}}updateMaxedOut(){this.inputViewChild&&this.inputViewChild.nativeElement&&(this.isMaxedOut?(this.inputViewChild.nativeElement.blur(),this.inputViewChild.nativeElement.disabled=!0):(this.disabled&&this.inputViewChild.nativeElement.blur(),this.inputViewChild.nativeElement.disabled=this.disabled||!1));}};g(o,"\u0275fac",function(n){return new(n||o)(T(Q),T(ie),T(he));}),g(o,"\u0275cmp",k({type:o,selectors:[["p-chips"]],contentQueries:function(n,t,l){if(n&1&&W(l,ue,4),n&2){let s;V(s=M())&&(t.templates=s);}},viewQuery:function(n,t){if(n&1&&G(Me,5)(Se,5),n&2){let l;V(l=M())&&(t.inputViewChild=l.first),V(l=M())&&(t.containerViewChild=l.first);}},hostAttrs:[1,"p-element","p-inputwrapper"],hostVars:6,hostBindings:function(n,t){n&2&&H("p-inputwrapper-filled",t.filled)("p-inputwrapper-focus",t.focused)("p-chips-clearable",t.showClear);},inputs:{style:"style",styleClass:"styleClass",disabled:[2,"disabled","disabled",I],field:"field",placeholder:"placeholder",max:[2,"max","max",L],maxLength:"maxLength",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",tabindex:[2,"tabindex","tabindex",L],inputId:"inputId",allowDuplicate:[2,"allowDuplicate","allowDuplicate",I],caseSensitiveDuplication:[2,"caseSensitiveDuplication","caseSensitiveDuplication",I],inputStyle:"inputStyle",inputStyleClass:"inputStyleClass",chipIcon:"chipIcon",addOnTab:[2,"addOnTab","addOnTab",I],addOnBlur:[2,"addOnBlur","addOnBlur",I],separator:"separator",showClear:[2,"showClear","showClear",I],autofocus:[2,"autofocus","autofocus",I],variant:"variant"},outputs:{onAdd:"onAdd",onRemove:"onRemove",onFocus:"onFocus",onBlur:"onBlur",onChipClick:"onChipClick",onChipContextMenu:"onChipContextMenu",onClear:"onClear"},features:[S([Xe,xe]),U],decls:8,vars:31,consts:[["container",""],["inputtext",""],["token",""],["removeicon",""],[3,"ngClass","ngStyle"],["tabindex","-1","role","listbox",1,"p-inputchips-input",3,"click","focus","blur","keydown"],["role","option",3,"ngClass","click","contextmenu",4,"ngFor","ngForOf"],["role","option",1,"p-inputchips-input-item",3,"ngClass"],["type","text","pAutoFocus","",1,"test",3,"keydown","input","paste","focus","blur","disabled","ngStyle","autofocus"],[4,"ngIf"],["role","option",3,"click","contextmenu","ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","p-inputchips-chip","removable","",3,"label","removeIcon","onRemove",4,"ngIf"],["removable","",1,"p-inputchips-chip",3,"onRemove","label","removeIcon"],[3,"styleClass","click",4,"ngIf"],["class","p-chips-token-icon",3,"click",4,"ngIf"],[3,"click","styleClass"],[1,"p-chips-token-icon",3,"click"],["class","p-chips-clear-icon",3,"click",4,"ngIf"],[1,"p-chips-clear-icon",3,"click"],[4,"ngTemplateOutlet"]],template:function(n,t){if(n&1){let l=b();_(0,"div",4)(1,"ul",5,0),C("click",function(){return c(l),u(t.onWrapperClick());})("focus",function(){return c(l),u(t.onContainerFocus());})("blur",function(){return c(l),u(t.onContainerBlur());})("keydown",function(h){return c(l),u(t.onContainerKeyDown(h));}),m(3,je,4,15,"li",6),_(4,"li",7)(5,"input",8,1),C("keydown",function(h){return c(l),u(t.onKeyDown(h));})("input",function(){return c(l),u(t.onInput());})("paste",function(h){return c(l),u(t.onPaste(h));})("focus",function(h){return c(l),u(t.onInputFocus(h));})("blur",function(h){return c(l),u(t.onInputBlur(h));}),f()(),m(7,Ge,3,2,"li",9),f()();}n&2&&(F(t.styleClass),p("ngClass",Z(24,Oe,t.disabled,t.focused,t.value&&t.value.length||(t.inputViewChild==null?null:t.inputViewChild.nativeElement.value)&&(t.inputViewChild==null?null:t.inputViewChild.nativeElement.value.length),t.focused))("ngStyle",t.style),w("data-pc-name","chips")("data-pc-section","root"),d(),w("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("aria-activedescendant",t.focused?t.focusedOptionId:void 0)("aria-orientation","horizontal")("data-pc-section","container"),d(2),p("ngForOf",t.value),d(),p("ngClass",y(29,Ee,t.showClear&&!t.disabled)),w("data-pc-section","inputToken"),d(),F(t.inputStyleClass),p("disabled",t.disabled||t.isMaxedOut)("ngStyle",t.inputStyle)("autofocus",t.autofocus),w("id",t.inputId)("maxlength",t.maxLength)("placeholder",t.value&&t.value.length?null:t.placeholder)("tabindex",t.tabindex),d(2),p("ngIf",t.value!=null&&t.filled&&!t.disabled&&t.showClear));},dependencies:[se,te,ne,oe,le,ae,we,E,ve,Ce,fe,_e,Ie,be],encapsulation:2,changeDetection:0}));let e=o;return e;})(),ke=(()=>{let o=class o{};g(o,"\u0275fac",function(n){return new(n||o)();}),g(o,"\u0275mod",j({type:o})),g(o,"\u0275inj",N({imports:[D,E,E]}));let e=o;return e;})();var Ei=(()=>{let o=class o{inputId=B.required();availableItems=B([]);selectedItems=A([]);placeholder=A("Th\xEAm th\u1EBB m\u1EDBi");separator;ngOnInit(){ye()&&(this.separator=",",this.placeholder.set("D\xF9ng d\u1EA5u ph\u1EA9u (,) \u0111\u1EC3 th\xEAm th\u1EBB"));}propagateChange=i=>{};writeValue(i){this.selectedItems.set(i);}registerOnChange(i){this.propagateChange=i;}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedItems());}};g(o,"\u0275fac",function(n){return new(n||o)();}),g(o,"\u0275cmp",k({type:o,selectors:[["my-select-tags"]],inputs:{inputId:[1,"inputId"],availableItems:[1,"availableItems"],selectedItems:[1,"selectedItems"],placeholder:[1,"placeholder"]},outputs:{selectedItems:"selectedItemsChange",placeholder:"placeholderChange"},features:[S([{provide:O,useExisting:x(()=>o),multi:!0}])],decls:1,vars:6,consts:[[3,"ngModelChange","ngModel","placeholder","inputId","allowDuplicate","caseSensitiveDuplication","separator"]],template:function(n,t){n&1&&(_(0,"p-chips",0),Y("ngModelChange",function(s){return X(t.selectedItems,s)||(t.selectedItems=s),s;}),C("ngModelChange",function(){return t.onModelChange();}),f()),n&2&&(J("ngModel",t.selectedItems),p("placeholder",t.placeholder())("inputId",t.inputId())("allowDuplicate",!1)("caseSensitiveDuplication",!1)("separator",t.separator));},dependencies:[ke,D,ce,pe,re],encapsulation:2}));let e=o;return e;})();export{Ei as a};/**i18n:3907c1bc44ea3b180445250ac6c616b106e81f719372623351dcd73c005dc65a*///# sourceMappingURL=chunk-4AIWBLTM.js.map