-
Notifications
You must be signed in to change notification settings - Fork 0
/
4760.66209c88a4c5c021.js
1 lines (1 loc) · 46.6 KB
/
4760.66209c88a4c5c021.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[4760],{14760:(Po,q,l)=>{l.r(q),l.d(q,{PromotionManagePageComponent:()=>Mo});var c=l(36895),u=l(24006),y=l(83700),b=l(27898),f=l(88516),g=l(72506),h=l(44143),N=l(74713),F=l(48373),v=l(67460),x=l(72853),J=l(19123),M=l(4155),o=l(94650),C=l(97579),B=l(28490);function O(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Nh\u1eadp m\xe3 khuy\u1ebfn m\xe3i")}function V(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ch\u1ecdn h\xe3ng bay")}function Y(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ch\u1ecdn ngu\u1ed3n")}function H(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Nh\u1eadp m\xf4 t\u1ea3")}function L(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ch\u01b0a ch\u1ecdn ng\xe0y b\u1eaft \u0111\u1ea7u")}function z(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ng\xe0y ph\u1ea3i theo \u0111\u1ecbnh d\u1ea1ng dd/MM/yyyy")}function j(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ch\u01b0a ch\u1ecdn ng\xe0y k\u1ebft th\xfac")}function K(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ng\xe0y k\u1ebft th\xfac ph\u1ea3i l\u1edbn h\u01a1n ng\xe0y \u0111i")}function G(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ng\xe0y ph\u1ea3i theo \u0111\u1ecbnh d\u1ea1ng dd/MM/yyyy")}function R(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ch\u01b0a ch\u1ecdn ng\xe0y b\u1eaft \u0111\u1ea7u")}function $(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ng\xe0y ph\u1ea3i theo \u0111\u1ecbnh d\u1ea1ng dd/MM/yyyy")}function X(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ch\u01b0a ch\u1ecdn ng\xe0y k\u1ebft th\xfac")}function W(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ng\xe0y k\u1ebft th\xfac ph\u1ea3i l\u1edbn h\u01a1n ng\xe0y \u0111i")}function oo(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ng\xe0y ph\u1ea3i theo \u0111\u1ecbnh d\u1ea1ng dd/MM/yyyy")}function to(n,s){if(1&n){const e=o.EpF();o.TgZ(0,"cf-checkbox",20),o.NdJ("checkChange",function(r){o.CHM(e);const a=o.oxw();return o.KtG(a.issuedTimeSameDepartureTime(r))}),o.TgZ(1,"div",21),o._uU(2," L\u1ea5y th\u1eddi gian xu\u1ea5t v\xe9 l\xe0m th\u1eddi gian bay? "),o.qZA()()}if(2&n){const e=o.oxw();o.Q6J("checked",e.isIssuedTimeSameDepartureTime)}}function eo(n,s){1&n&&o._UZ(0,"cf-hint",51),2&n&&o.Q6J("hint","Ch\u01b0a ch\u1ecdn \u0111i\u1ec3m \u0111i")}function no(n,s){1&n&&o._UZ(0,"cf-hint",51),2&n&&o.Q6J("hint","Ch\u01b0a ch\u1ecdn \u0111i\u1ec3m \u0111\u1ebfn")}function ro(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Ch\u1ecdn h\xe3ng bay")}function io(n,s){1&n&&o._UZ(0,"cf-input-hint",51),2&n&&o.Q6J("hint","Nh\u1eadp s\u1ed1 l\u01b0\u1ee3ng h\xe0nh kh\xe1ch")}function ao(n,s){if(1&n){const e=o.EpF();o.TgZ(0,"button",52),o.NdJ("click",function(){o.CHM(e);const r=o.oxw();return o.KtG(r.ok())}),o._uU(1," X\xe1c nh\u1eadn "),o.qZA()}}const U=function(n){return[n]},S=function(){return[]};let Q=(()=>{class n{constructor(e,t,r,a,i,p){this._iconRegister=e,this.ref=t,this._fb=r,this._locationService=a,this._promotionService=i,this._modal=p,this.isIssuedTimeSameDepartureTime=!1,this.isEditMode=!1,this.optionsAirline=[{code:"VJ",name:"VJ-Vietjet Air"},{code:"QH",name:"QH-Bamboo Airways"},{code:"VN",name:"VN-Vietnam Airline"},{code:"GDS",name:"GDS"}],this.sourcePromoOptions=[{code:"AIRLINE",name:"H\xe3ng h\xe0ng kh\xf4ng"},{code:"GMBR",name:"GMBR"}],this.optionsPassengerTypes=[{code:"ALL",name:"T\u1ea5t c\u1ea3"},{code:"ADT",name:"ADT-Ng\u01b0\u1eddi l\u1edbn"},{code:"CHD",name:"CHD-Tr\u1ebb em"}],this.dataLocation=[],this.positionSearchCustom=(E,P)=>{const T=this.removeAccents(E.Code.toLowerCase()),_=this.removeAccents(E.CityName.toLowerCase()),d=this.removeAccents(E.AirportName.toLowerCase()),m=this.removeAccents(P.toLowerCase());return T.includes(m)||_.includes(m)||d.includes(m)},e.registerIcons([g.UNF]),t.data&&t.data.promotion?(this.isEditMode=!0,this.promotion=t.data.promotion,this.canEdit=t.data.canEdit):this.canCreate=!0,this.initLocation()}ngOnInit(){var e;this.promotionForm=this._fb.group(this.isEditMode?{promotionCode:[this.promotion.promotionCode,u.kI.required],airline:[this.promotion.airline,u.kI.required],description:[this.promotion.description,u.kI.required],startIssuedDate:[this.promotion.startIssuedDate,u.kI.required],endIssuedDate:[this.promotion.endIssuedDate,u.kI.required],startDepartureDate:[this.promotion.startDepartureDate,u.kI.required],endDepartureDate:[this.promotion.endDepartureDate,u.kI.required],startPoint:[this.promotion.startPoint],endPoint:[this.promotion.endPoint],journeyType:[this.promotion.journeyType,u.kI.required],passengerTypes:[this.promotion.passengerTypes],numOfPassenger:[this.promotion.numOfPassenger],priority:[this.promotion.priority,u.kI.required],autoSuggest:[1==this.promotion.autoSuggest?"YES":"NO",u.kI.required],state:[this.promotion.state,u.kI.required],sourcePromo:[null===(e=this.promotion)||void 0===e?void 0:e.sourcePromo,u.kI.required]}:{promotionCode:["",u.kI.required],airline:["",u.kI.required],description:["",u.kI.required],startIssuedDate:["",u.kI.required],endIssuedDate:["",u.kI.required],startDepartureDate:["",u.kI.required],endDepartureDate:["",u.kI.required],startPoint:[""],endPoint:[""],journeyType:["ROUND_TRIP",u.kI.required],passengerTypes:["ALL"],numOfPassenger:[0],priority:["NORMAL",u.kI.required],autoSuggest:["YES",u.kI.required],state:["ACTIVE",u.kI.required],sourcePromo:["",u.kI.required]})}initLocation(){this.dataLocation=this._locationService.getAllOption(),this.dataLocation=[{Code:"",CityName:"T\u1ea5t c\u1ea3",AirportName:""}].concat(this.dataLocation)}priorityChange(e){this.promotionForm.controls.priority.setValue(e?"HIGH":"NORMAL")}issuedTimeSameDepartureTime(e){this.isIssuedTimeSameDepartureTime=e,e?(this.promotionForm.controls.startDepartureDate.removeValidators(u.kI.required),this.promotionForm.controls.endDepartureDate.removeValidators(u.kI.required)):(this.promotionForm.controls.startDepartureDate.addValidators(u.kI.required),this.promotionForm.controls.endDepartureDate.addValidators(u.kI.required)),this.promotionForm.controls.startDepartureDate.updateValueAndValidity(),this.promotionForm.controls.endDepartureDate.updateValueAndValidity()}journeyTypeChange(e){}suggestChange(e){this.promotionForm.controls.autoSuggest.setValue("YES"===e)}activeChange(e){this.promotionForm.controls.state.setValue(e)}startIssuedDate(e){e&&(this.minEndIssuedDate=new f.Ao(e.getFullYear(),e.getMonth()+1,e.getDate()))}resetRangeDate(e,t){e.setValue(""),t.setValue("")}onDateSelection(e,t,r,a){t.value||r.value?t.value&&!r.value&&e&&e.getTime()>=t.value.getTime()?(r.setValue(e),a.close(),this.startDate=t.value):(r.setValue(null),t.setValue(e)):t.setValue(e)}removeAccents(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\u0111/g,"d").replace(/\u0110/g,"D")}close(){this._modal.open(v.V0,{title:this.isEditMode?"H\u1ee7y vi\u1ec7c ch\u1ec9nh s\u1eeda m\xe3?":"H\u1ee7y vi\u1ec7c th\xeam m\xe3?",body:this.isEditMode?"Th\xf4ng tin m\xe3 khuy\u1ebfn m\xe3i ch\u01b0a \u0111\u01b0\u1ee3c l\u01b0u l\u1ea1i. B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n h\u1ee7y vi\u1ec7c ch\u1ec9nh s\u1eeda m\xe3?":"Th\xf4ng tin m\xe3 khuy\u1ebfn m\xe3i ch\u01b0a \u0111\u01b0\u1ee3c l\u01b0u l\u1ea1i. B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n h\u1ee7y vi\u1ec7c th\xeam m\xe3?"}).afterClosed$.subscribe({next:t=>{t.data&&this.ref.close(!1)}})}ok(){this.promotionForm.valid?this._modal.open(v.V0,{title:this.isEditMode?"X\xe1c nh\u1eadn ch\u1ec9nh s\u1eeda m\xe3 khuy\u1ebfn m\xe3i":"X\xe1c nh\u1eadn th\xeam m\xe3 khuy\u1ebfn m\xe3i",body:this.isEditMode?"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n ch\u1ec9nh s\u1eeda khuy\u1ebfn m\xe3i n\xe0y kh\xf4ng":"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n th\xeam m\xe3 khuy\u1ebfn m\xe3i n\xe0y kh\xf4ng."}).afterClosed$.subscribe({next:t=>{if(t.data){const r=(0,c.p6)(this.isIssuedTimeSameDepartureTime?this.promotionForm.controls.startIssuedDate.value:this.promotionForm.controls.startDepartureDate.value,"dd/MM/yyyy","vi-VN"),a=(0,c.p6)(this.isIssuedTimeSameDepartureTime?this.promotionForm.controls.endIssuedDate.value:this.promotionForm.controls.endDepartureDate.value,"dd/MM/yyyy","vi-VN"),i={promoCode:this.promotionForm.controls.promotionCode.value,airline:this.promotionForm.controls.airline.value,description:this.promotionForm.controls.description.value,startIssuedDay:(0,c.p6)(this.promotionForm.controls.startIssuedDate.value,"dd/MM/yyyy","vi-VN"),endIssuedDay:(0,c.p6)(this.promotionForm.controls.endIssuedDate.value,"dd/MM/yyyy","vi-VN"),startFlyDay:r,endFlyDay:a,startPoint:this.promotionForm.controls.startPoint.value,endPoint:this.promotionForm.controls.endPoint.value,journeyType:this.promotionForm.controls.journeyType.value,paxType:this.promotionForm.controls.passengerTypes.value,paxNum:this.promotionForm.controls.numOfPassenger.value,priority:this.promotionForm.controls.priority.value,autoSuggest:"YES"===this.promotionForm.controls.autoSuggest.value,status:this.promotionForm.controls.state.value,sourcePromo:this.promotionForm.controls.sourcePromo.value||M.bd.AIRLINE};this.isEditMode?this._promotionService.editPromotion(this.promotion.id,i).subscribe({next:p=>{this.ref.close(!0)}}):this._promotionService.createPromotion(i).subscribe({next:p=>{this.ref.close(!0)}})}}}):this.promotionForm.markAllAsTouched()}}return n.\u0275fac=function(e){return new(e||n)(o.Y36(g.KNP),o.Y36(C.gb),o.Y36(u.qu),o.Y36(B._),o.Y36(M.q),o.Y36(C.oE))},n.\u0275cmp=o.Xpm({type:n,selectors:[["add-promotion-modal"]],standalone:!0,features:[o.jDz],decls:153,vars:94,consts:[[1,"w-[772px]","flex","flex-col","rounded-lg","bg-neutral-white"],[1,"flex","justify-between","items-center","px-6","py-[13px]","border-b","border-b-neutral-gray-1"],[1,"text-heading-xs","text-neutral-black"],["size","small","icon","close",1,"text-neutral-gray-4","cursor-pointer",3,"click"],[1,"flex","flex-col","py-4","px-4"],[1,"text-body-sm","overflow-y-auto","h-[70vh]"],[1,"flex","flex-col"],[1,"text-heading-sm"],[1,"text-neutral-gray-3"],[1,"py-4"],[1,"flex","flex-col","gap-y-2"],[1,"flex","gap-x-2"],[1,"",3,"status"],["cfLabel","",1,"text-espressive-sm","text-black","mb-1.5"],["cf-input","","size","medium","placeholder","Nh\u1eadp m\xe3 khuy\u1ebfn m\xe3i",3,"formControl"],["cfHint","",3,"hint",4,"ngIf"],["textField","name","valueField","code","placeholder","Ch\u1ecdn h\xe3ng bay",1,"w-[!260px]",3,"status","data","allowSearch","formControl"],["textField","name","valueField","code","placeholder","Ch\u1ecdn ngu\u1ed3n",1,"w-[!260px]",3,"status","data","allowSearch","formControl"],[1,"!w-full",3,"status"],["cf-input","","size","medium","placeholder","Nh\u1eadp m\xf4 t\u1ea3",3,"formControl"],["size","medium",3,"checked","checkChange"],[1,"text-espressive-md","text-neutral-gray-5"],[1,"flex","flex-col","mt-2"],[1,"flex","grow-[327]"],[1,"grow","!w-auto",3,"status"],["cfHeadIcon","","icon","calendar","size","small"],["cfDatepickerViewer","","type","text","size","medium","cf-input","","placeholder","Ch\u1ecdn ng\xe0y xu\u1ea5t \u0111\u1ea7u",3,"formControl","input","ngModelChange","click"],["type","text","outsideDays","hidden","cfDatepicker","",1,"w-0","m-0","mr-2","bottom-0",3,"secondaryCalendar","displayMonths","rangeSelection","fromDate","startDate","toDate","reset","dateSelect"],["dateRange","cfDatepicker"],["cfDatepickerViewer","","type","text","size","medium","cf-input","","placeholder","Ch\u1ecdn ng\xe0y xu\u1ea5t cu\u1ed1i",3,"minDate","formControl","input","click"],[1,"py-4","flex","flex-col","gap-y-2"],["cfDatepickerViewer","","type","text","size","medium","cf-input","","placeholder","Ch\u1ecdn ng\xe0y bay \u0111\u1ea7u",3,"formControl","input","ngModelChange","click"],["dateDepartureRange","cfDatepicker"],["cfDatepickerViewer","","type","text","size","medium","cf-input","","placeholder","Ch\u1ecdn ng\xe0y bay cu\u1ed1i",3,"minDate","formControl","input","click"],["size","medium",3,"checked","checkChange",4,"ngIf"],[1,"flex","items-center","gap-x-8",3,"formControl"],["size","medium",3,"value"],["textField","CityName","valueField","Code","placeholder","T\u1eeb?",1,"grow-[293]","!max-w-none",3,"status","customSearch","excludes","formControl","data","selectedChange"],["startPoint",""],["cfHeadIcon","","icon","commute","size","small"],["textField","CityName","valueField","Code","placeholder","\u0110\u1ebfn",1,"grow-[293]","!max-w-none",3,"status","customSearch","excludes","formControl","data"],["endPoint",""],[1,"flex","w-full","gap-x-2"],["textField","name","valueField","code","placeholder","Ch\u1ecdn lo\u1ea1i h\xe0nh kh\xe1ch",1,"!w-1/2","!max-w-none",3,"status","data","allowSearch","formControl"],[1,"!w-1/2",3,"status"],["type","number","cf-input","","size","medium","placeholder","Nh\u1eadp s\u1ed1 l\u01b0\u1ee3ng h\xe0nh kh\xe1ch",3,"formControl"],[1,"my-4"],[1,"flex","justify-between","items-center","py-4","px-4","border-t","border-t-neutral-gray-1"],[1,"flex","gap-x-4"],["cf-button","","size","medium","type","secondary",3,"click"],["cf-button","","size","medium","type","solid","color","primary-1",3,"click",4,"ngIf"],["cfHint","",3,"hint"],["cf-button","","size","medium","type","solid","color","primary-1",3,"click"]],template:function(e,t){if(1&e){const r=o.EpF();o.TgZ(0,"div",0)(1,"div",1)(2,"div",2),o._uU(3,"T\u1ea1o m\xe3 khuy\u1ec5n m\xe3i"),o.qZA(),o.TgZ(4,"cf-icon",3),o.NdJ("click",function(){return t.close()}),o.qZA()(),o.TgZ(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7),o._uU(9,"Th\xf4ng tin m\xe3"),o.qZA(),o.TgZ(10,"div",8),o._uU(11,"Th\xf4ng tin m\xe3 khuy\u1ebfn m\xe3i v\xe0 h\xe3ng bay t\u01b0\u01a1ng \u1ee9ng"),o.qZA()(),o.TgZ(12,"div",9)(13,"div",10)(14,"div",11)(15,"cf-input-group",12)(16,"label",13),o._uU(17," M\xe3 khuy\u1ebfn m\xe3i "),o.qZA(),o._UZ(18,"input",14),o.YNc(19,O,1,1,"cf-input-hint",15),o.qZA(),o.TgZ(20,"cf-select",16)(21,"label",13)(22,"span"),o._uU(23,"H\xe3ng bay"),o.qZA()(),o.YNc(24,V,1,1,"cf-input-hint",15),o.qZA(),o.TgZ(25,"cf-select",17)(26,"label",13),o._uU(27," Ngu\u1ed3n "),o.qZA(),o.YNc(28,Y,1,1,"cf-input-hint",15),o.qZA()(),o.TgZ(29,"cf-input-group",18)(30,"label",13),o._uU(31," M\xf4 t\u1ea3 "),o.qZA(),o._UZ(32,"input",19),o.YNc(33,H,1,1,"cf-input-hint",15),o.qZA(),o.TgZ(34,"cf-checkbox",20),o.NdJ("checkChange",function(i){return t.priorityChange(i)}),o.TgZ(35,"div",21),o._uU(36," \u0110\u1eb7t l\xe0m m\xe3 khuy\u1ebfn m\xe3i \u01b0u ti\xean c\u1ee7a h\xe3ng bay? "),o.qZA()()()(),o.TgZ(37,"div",22)(38,"div",7),o._uU(39,"Th\u1eddi gian xu\u1ea5t v\xe9"),o.qZA(),o.TgZ(40,"div",8),o._uU(41,"\u0110i\u1ec1u ki\u1ec7n th\u1eddi gian xu\u1ea5t v\xe9 \u0111\u1ec3 \u0111\u01b0\u1ee3c \xe1p d\u1ee5ng m\xe3 khuy\u1ebfn m\xe3i"),o.qZA()(),o.TgZ(42,"div",9)(43,"div",23)(44,"cf-input-group",24),o._UZ(45,"cf-icon",25),o.TgZ(46,"label",13),o._uU(47,"Ng\xe0y xu\u1ea5t \u0111\u1ea7u"),o.qZA(),o.TgZ(48,"input",26),o.NdJ("input",function(){o.CHM(r);const i=o.MAs(52);return o.KtG(i.close())})("ngModelChange",function(i){return t.startIssuedDate(i)})("click",function(){o.CHM(r);const i=o.MAs(52);return o.KtG(i.open())}),o.qZA(),o.YNc(49,L,1,1,"cf-input-hint",15),o.YNc(50,z,1,1,"cf-input-hint",15),o.qZA(),o.TgZ(51,"input",27,28),o.NdJ("reset",function(){return t.resetRangeDate(t.promotionForm.controls.startIssuedDate,t.promotionForm.controls.endIssuedDate)})("dateSelect",function(i){o.CHM(r);const p=o.MAs(52);return o.KtG(t.onDateSelection(i,t.promotionForm.controls.startIssuedDate,t.promotionForm.controls.endIssuedDate,p))}),o.qZA(),o.TgZ(53,"cf-input-group",24),o._UZ(54,"cf-icon",25),o.TgZ(55,"label",13),o._uU(56,"Ng\xe0y xu\u1ea5t cu\u1ed1i"),o.qZA(),o.TgZ(57,"input",29),o.NdJ("input",function(){o.CHM(r);const i=o.MAs(52);return o.KtG(i.close())})("click",function(){o.CHM(r);const i=o.MAs(52);return o.KtG(i.open())}),o.qZA(),o.YNc(58,j,1,1,"cf-input-hint",15),o.YNc(59,K,1,1,"cf-input-hint",15),o.YNc(60,G,1,1,"cf-input-hint",15),o.qZA()()(),o.TgZ(61,"div",22)(62,"div",7),o._uU(63,"Th\u1eddi gian bay"),o.qZA(),o.TgZ(64,"div",8),o._uU(65,"\u0110i\u1ec1u ki\u1ec7n th\u1eddi gian bay (kh\u1edfi h\xe0nh) \u0111\u1ec3 \u0111\u01b0\u1ee3c \xe1p d\u1ee5ng m\xe3 khuy\u1ebfn m\xe3i"),o.qZA()(),o.TgZ(66,"div",30)(67,"div",23)(68,"cf-input-group",24),o._UZ(69,"cf-icon",25),o.TgZ(70,"label",13),o._uU(71,"Ng\xe0y bay \u0111\u1ea7u"),o.qZA(),o.TgZ(72,"input",31),o.NdJ("input",function(){o.CHM(r);const i=o.MAs(76);return o.KtG(i.close())})("ngModelChange",function(i){return t.startIssuedDate(i)})("click",function(){o.CHM(r);const i=o.MAs(76);return o.KtG(i.open())}),o.qZA(),o.YNc(73,R,1,1,"cf-input-hint",15),o.YNc(74,$,1,1,"cf-input-hint",15),o.qZA(),o.TgZ(75,"input",27,32),o.NdJ("reset",function(){return t.resetRangeDate(t.promotionForm.controls.startDepartureDate,t.promotionForm.controls.endDepartureDate)})("dateSelect",function(i){o.CHM(r);const p=o.MAs(76);return o.KtG(t.onDateSelection(i,t.promotionForm.controls.startDepartureDate,t.promotionForm.controls.endDepartureDate,p))}),o.qZA(),o.TgZ(77,"cf-input-group",24),o._UZ(78,"cf-icon",25),o.TgZ(79,"label",13),o._uU(80,"Ng\xe0y bay cu\u1ed1i"),o.qZA(),o.TgZ(81,"input",33),o.NdJ("input",function(){o.CHM(r);const i=o.MAs(76);return o.KtG(i.close())})("click",function(){o.CHM(r);const i=o.MAs(76);return o.KtG(i.open())}),o.qZA(),o.YNc(82,X,1,1,"cf-input-hint",15),o.YNc(83,W,1,1,"cf-input-hint",15),o.YNc(84,oo,1,1,"cf-input-hint",15),o.qZA()(),o.TgZ(85,"div"),o.YNc(86,to,3,1,"cf-checkbox",34),o.qZA()(),o.TgZ(87,"div",22)(88,"div",7),o._uU(89,"H\xe0nh tr\xecnh"),o.qZA(),o.TgZ(90,"div",8),o._uU(91,"\u0110i\u1ec1u ki\u1ec7n h\xe0nh tr\xecnh v\xe0 h\xe0nh kh\xe1ch \u0111\u1ec3 \u0111\u01b0\u1ee3c \xe1p d\u1ee5ng m\xe3 khuy\u1ebfn m\xe3i"),o.qZA()(),o.TgZ(92,"div",30)(93,"div")(94,"cf-radio-group",35)(95,"cf-radio",36),o._uU(96,"T\u1ea5t c\u1ea3"),o.qZA(),o.TgZ(97,"cf-radio",36),o._uU(98,"M\u1ed9t chi\u1ec1u"),o.qZA(),o.TgZ(99,"cf-radio",36),o._uU(100,"Kh\u1ee9 h\u1ed3i"),o.qZA()()(),o.TgZ(101,"div",11)(102,"cf-select",37,38),o.NdJ("selectedChange",function(){o.CHM(r);const i=o.MAs(109);return o.KtG(i.onFocus())}),o._UZ(104,"cf-icon",39),o.TgZ(105,"label",13),o._uU(106,"\u0110i\u1ec3m \u0111i"),o.qZA(),o.YNc(107,eo,1,1,"cf-hint",15),o.qZA(),o.TgZ(108,"cf-select",40,41),o._UZ(110,"cf-icon",39),o.TgZ(111,"label",13),o._uU(112,"\u0110i\u1ec3m \u0111\u1ebfn"),o.qZA(),o.YNc(113,no,1,1,"cf-hint",15),o.qZA()(),o.TgZ(114,"div",42)(115,"cf-select",43)(116,"label",13)(117,"span"),o._uU(118,"Lo\u1ea1i h\xe0nh kh\xe1ch"),o.qZA()(),o.YNc(119,ro,1,1,"cf-input-hint",15),o.qZA(),o.TgZ(120,"cf-input-group",44)(121,"label",13),o._uU(122," S\u1ed1 l\u01b0\u1ee3ng h\xe0nh kh\xe1ch "),o.qZA(),o._UZ(123,"input",45),o.YNc(124,io,1,1,"cf-input-hint",15),o.qZA()()(),o.TgZ(125,"div",22)(126,"div",7),o._uU(127,"Cho ph\xe9p t\u1ef1 \u0111\u1ed9ng \xe1p d\u1ee5ng m\xe3 khuy\u1ebfn m\xe3i"),o.qZA(),o.TgZ(128,"div",8),o._uU(129,"M\xe3 khuy\u1ebfn m\xe3i s\u1ebd \u0111\u01b0\u1ee3c t\u1ef1 \u0111\u1ed9ng \xe1p d\u1ee5ng khi t\xecm ki\u1ebfm n\u1ebfu ph\xf9 h\u1ee3p v\xe0 \u0111\u01b0\u1ee3c cho ph\xe9p"),o.qZA()(),o.TgZ(130,"div",46)(131,"cf-radio-group",35)(132,"cf-radio",36),o._uU(133,"Cho ph\xe9p"),o.qZA(),o.TgZ(134,"cf-radio",36),o._uU(135,"Kh\xf4ng cho ph\xe9p"),o.qZA()()(),o.TgZ(136,"div",22)(137,"div",7),o._uU(138,"Cho ph\xe9p ho\u1ea1t \u0111\u1ed9ng"),o.qZA(),o.TgZ(139,"div",8),o._uU(140,"Ch\u1ec9 \u0111\u1ecbnh m\xe3 khuy\u1ebfn m\xe3i c\xf3 hi\u1ec7u l\u1ef1c trong h\u1ec7 th\u1ed1ng hay kh\xf4ng (tr\u1eeb tr\u01b0\u1eddng h\u1ee3p v\u01b0\u1ee3t qu\xe1 th\u1eddi h\u1ea1n xu\u1ea5t v\xe9)"),o.qZA()(),o.TgZ(141,"div",46)(142,"cf-radio-group",35)(143,"cf-radio",36),o._uU(144,"Ho\u1ea1t \u0111\u1ed9ng"),o.qZA(),o.TgZ(145,"cf-radio",36),o._uU(146,"Ng\u1eebng ho\u1ea1t \u0111\u1ed9ng"),o.qZA()()()()(),o.TgZ(147,"div",47),o._UZ(148,"div"),o.TgZ(149,"div",48)(150,"button",49),o.NdJ("click",function(){return t.close()}),o._uU(151," H\u1ee7y b\u1ecf "),o.qZA(),o.YNc(152,ao,2,0,"button",50),o.qZA()()()}2&e&&(o.xp6(15),o.Q6J("status",t.promotionForm.controls.promotionCode.invalid&&(t.promotionForm.controls.promotionCode.dirty||t.promotionForm.controls.promotionCode.touched)?"error":"default"),o.xp6(3),o.Q6J("formControl",t.promotionForm.controls.promotionCode),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.promotionCode.errors?null:t.promotionForm.controls.promotionCode.errors.required)&&(t.promotionForm.controls.promotionCode.dirty||t.promotionForm.controls.promotionCode.touched)),o.xp6(1),o.Q6J("status",t.promotionForm.controls.airline.invalid&&(t.promotionForm.controls.airline.dirty||t.promotionForm.controls.airline.touched)?"error":"default")("data",t.optionsAirline)("allowSearch",!1)("formControl",t.promotionForm.controls.airline)("allowSearch",!0),o.xp6(4),o.Q6J("ngIf",t.promotionForm.controls.airline.hasError("required")&&t.promotionForm.controls.airline.touched),o.xp6(1),o.Q6J("status",t.promotionForm.controls.sourcePromo.invalid&&(t.promotionForm.controls.sourcePromo.dirty||t.promotionForm.controls.sourcePromo.touched)?"error":"default")("data",t.sourcePromoOptions)("allowSearch",!1)("formControl",t.promotionForm.controls.sourcePromo)("allowSearch",!0),o.xp6(3),o.Q6J("ngIf",t.promotionForm.controls.sourcePromo.hasError("required")&&t.promotionForm.controls.sourcePromo.touched),o.xp6(1),o.Q6J("status",t.promotionForm.controls.description.invalid&&(t.promotionForm.controls.description.dirty||t.promotionForm.controls.description.touched)?"error":"default"),o.xp6(3),o.Q6J("formControl",t.promotionForm.controls.description),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.description.errors?null:t.promotionForm.controls.description.errors.required)&&(t.promotionForm.controls.description.dirty||t.promotionForm.controls.description.touched)),o.xp6(1),o.Q6J("checked","HIGH"===t.promotionForm.controls.priority.value),o.xp6(10),o.Q6J("status",t.promotionForm.controls.startIssuedDate.invalid&&(t.promotionForm.controls.startIssuedDate.dirty||t.promotionForm.controls.startIssuedDate.touched)?"error":"default"),o.xp6(4),o.Q6J("formControl",t.promotionForm.controls.startIssuedDate),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.startIssuedDate.errors?null:t.promotionForm.controls.startIssuedDate.errors.required)&&(t.promotionForm.controls.startIssuedDate.dirty||t.promotionForm.controls.startIssuedDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.startIssuedDate.errors||null==t.promotionForm.controls.startIssuedDate.errors.ngbDate?null:t.promotionForm.controls.startIssuedDate.errors.ngbDate.invalid)&&(t.promotionForm.controls.startIssuedDate.dirty||t.promotionForm.controls.startIssuedDate.touched)),o.xp6(1),o.Q6J("secondaryCalendar","lunar")("displayMonths",2)("rangeSelection",!0)("fromDate",t.promotionForm.controls.startIssuedDate.value)("startDate",t.startDate)("toDate",t.promotionForm.controls.endIssuedDate.value),o.xp6(2),o.Q6J("status",t.promotionForm.controls.endIssuedDate.invalid&&(t.promotionForm.controls.endIssuedDate.dirty||t.promotionForm.controls.endIssuedDate.touched)?"error":"default"),o.xp6(4),o.Q6J("minDate",t.minEndIssuedDate)("formControl",t.promotionForm.controls.endIssuedDate),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.endIssuedDate.errors?null:t.promotionForm.controls.endIssuedDate.errors.required)&&(t.promotionForm.controls.endIssuedDate.dirty||t.promotionForm.controls.endIssuedDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.endIssuedDate.errors||null==t.promotionForm.controls.endIssuedDate.errors.ngbDate?null:t.promotionForm.controls.endIssuedDate.errors.ngbDate.minDate)&&(t.promotionForm.controls.endIssuedDate.dirty||t.promotionForm.controls.endIssuedDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.endIssuedDate.errors||null==t.promotionForm.controls.endIssuedDate.errors.ngbDate?null:t.promotionForm.controls.endIssuedDate.errors.ngbDate.invalid)&&(t.promotionForm.controls.endIssuedDate.dirty||t.promotionForm.controls.endIssuedDate.touched)),o.xp6(8),o.Q6J("status",t.promotionForm.controls.startDepartureDate.invalid&&(t.promotionForm.controls.startDepartureDate.dirty||t.promotionForm.controls.startDepartureDate.touched)?"error":"default"),o.xp6(4),o.Q6J("formControl",t.promotionForm.controls.startDepartureDate),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.startDepartureDate.errors?null:t.promotionForm.controls.startDepartureDate.errors.required)&&(t.promotionForm.controls.startDepartureDate.dirty||t.promotionForm.controls.startDepartureDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.startDepartureDate.errors||null==t.promotionForm.controls.startDepartureDate.errors.ngbDate?null:t.promotionForm.controls.startDepartureDate.errors.ngbDate.invalid)&&(t.promotionForm.controls.startDepartureDate.dirty||t.promotionForm.controls.startDepartureDate.touched)),o.xp6(1),o.Q6J("secondaryCalendar","lunar")("displayMonths",2)("rangeSelection",!0)("fromDate",t.promotionForm.controls.startDepartureDate.value)("startDate",t.startDate)("toDate",t.promotionForm.controls.endDepartureDate.value),o.xp6(2),o.Q6J("status",t.promotionForm.controls.endDepartureDate.invalid&&(t.promotionForm.controls.endDepartureDate.dirty||t.promotionForm.controls.endDepartureDate.touched)?"error":"default"),o.xp6(4),o.Q6J("minDate",t.minEndIssuedDate)("formControl",t.promotionForm.controls.endDepartureDate),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.endDepartureDate.errors?null:t.promotionForm.controls.endDepartureDate.errors.required)&&(t.promotionForm.controls.endDepartureDate.dirty||t.promotionForm.controls.endDepartureDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.endDepartureDate.errors||null==t.promotionForm.controls.endDepartureDate.errors.ngbDate?null:t.promotionForm.controls.endDepartureDate.errors.ngbDate.minDate)&&(t.promotionForm.controls.endDepartureDate.dirty||t.promotionForm.controls.endDepartureDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.endDepartureDate.errors||null==t.promotionForm.controls.endDepartureDate.errors.ngbDate?null:t.promotionForm.controls.endDepartureDate.errors.ngbDate.invalid)&&(t.promotionForm.controls.endDepartureDate.dirty||t.promotionForm.controls.endDepartureDate.touched)),o.xp6(2),o.Q6J("ngIf",!t.isEditMode),o.xp6(8),o.Q6J("formControl",t.promotionForm.controls.journeyType),o.xp6(1),o.Q6J("value","ALL"),o.xp6(2),o.Q6J("value","ONE_WAY"),o.xp6(2),o.Q6J("value","ROUND_TRIP"),o.xp6(3),o.ekj("!grow-269",t.promotionForm.controls.returnDate),o.Q6J("status",t.promotionForm.controls.startPoint.invalid&&(t.promotionForm.controls.startPoint.dirty||t.promotionForm.controls.startPoint.touched)?"error":"default")("customSearch",t.positionSearchCustom)("excludes",""!==t.promotionForm.controls.endPoint.value?o.VKq(88,U,t.promotionForm.controls.endPoint.value):o.DdM(90,S))("formControl",t.promotionForm.controls.startPoint)("data",t.dataLocation),o.xp6(5),o.Q6J("ngIf",(null==t.promotionForm.controls.startPoint.errors?null:t.promotionForm.controls.startPoint.errors.required)&&(t.promotionForm.controls.startPoint.dirty||t.promotionForm.controls.startPoint.touched)),o.xp6(1),o.ekj("!grow-269",t.promotionForm.controls.returnDate),o.Q6J("status",t.promotionForm.controls.endPoint.invalid&&(t.promotionForm.controls.endPoint.dirty||t.promotionForm.controls.endPoint.touched)?"error":"default")("customSearch",t.positionSearchCustom)("excludes",""!==t.promotionForm.controls.startPoint.value?o.VKq(91,U,t.promotionForm.controls.startPoint.value):o.DdM(93,S))("formControl",t.promotionForm.controls.endPoint)("data",t.dataLocation),o.xp6(5),o.Q6J("ngIf",(null==t.promotionForm.controls.endPoint.errors?null:t.promotionForm.controls.endPoint.errors.required)&&(t.promotionForm.controls.endPoint.dirty||t.promotionForm.controls.endPoint.touched)),o.xp6(2),o.Q6J("status",t.promotionForm.controls.passengerTypes.invalid&&(t.promotionForm.controls.passengerTypes.dirty||t.promotionForm.controls.passengerTypes.touched)?"error":"default")("data",t.optionsPassengerTypes)("allowSearch",!1)("formControl",t.promotionForm.controls.passengerTypes)("allowSearch",!0),o.xp6(4),o.Q6J("ngIf",t.promotionForm.controls.passengerTypes.hasError("required")&&t.promotionForm.controls.passengerTypes.touched),o.xp6(1),o.Q6J("status",t.promotionForm.controls.numOfPassenger.invalid&&(t.promotionForm.controls.numOfPassenger.dirty||t.promotionForm.controls.numOfPassenger.touched)?"error":"default"),o.xp6(3),o.Q6J("formControl",t.promotionForm.controls.numOfPassenger),o.xp6(1),o.Q6J("ngIf",(null==t.promotionForm.controls.numOfPassenger.errors?null:t.promotionForm.controls.numOfPassenger.errors.required)&&(t.promotionForm.controls.numOfPassenger.dirty||t.promotionForm.controls.numOfPassenger.touched)),o.xp6(7),o.Q6J("formControl",t.promotionForm.controls.autoSuggest),o.xp6(1),o.Q6J("value","YES"),o.xp6(2),o.Q6J("value","NO"),o.xp6(8),o.Q6J("formControl",t.promotionForm.controls.state),o.xp6(1),o.Q6J("value","ACTIVE"),o.xp6(2),o.Q6J("value","INACTIVE"),o.xp6(7),o.Q6J("ngIf",t.canEdit||t.canCreate))},dependencies:[c.ez,c.O5,g.AxE,g.Sm8,y.N8,y.Xq,u.u5,u.Fj,u.wV,u.JJ,u.UX,u.oH,h.j$,h.ND,h.BN,h.v2,b.u,N.q,f.Cs,f.hI,J.o,J.T,x.m],styles:["*[_ngcontent-%COMP%]{scrollbar-width:auto;scrollbar-color:#c7c7c7 #ffffff}*[_ngcontent-%COMP%]::-webkit-scrollbar{width:12px}*[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#ffffff}*[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:#c7c7c7;border-radius:10px;border:3px solid #ffffff}"]}),n})();var A=l(40899),uo=l(82761),so=l(62733);function lo(n,s){1&n&&o._UZ(0,"cf-input-hint",36),2&n&&o.Q6J("hint","Ch\u01b0a ch\u1ecdn ng\xe0y b\u1eaft \u0111\u1ea7u")}function co(n,s){1&n&&o._UZ(0,"cf-input-hint",36),2&n&&o.Q6J("hint","Ng\xe0y ph\u1ea3i theo \u0111\u1ecbnh d\u1ea1ng dd/MM/yyyy")}function mo(n,s){1&n&&o._UZ(0,"cf-input-hint",36),2&n&&o.Q6J("hint","Ch\u01b0a ch\u1ecdn ng\xe0y k\u1ebft th\xfac")}function po(n,s){1&n&&o._UZ(0,"cf-input-hint",36),2&n&&o.Q6J("hint","Ng\xe0y k\u1ebft th\xfac ph\u1ea3i l\u1edbn h\u01a1n ng\xe0y \u0111i")}function ho(n,s){1&n&&o._UZ(0,"cf-input-hint",36),2&n&&o.Q6J("hint","Ng\xe0y ph\u1ea3i theo \u0111\u1ecbnh d\u1ea1ng dd/MM/yyyy")}function go(n,s){if(1&n){const e=o.EpF();o.TgZ(0,"button",37),o.NdJ("click",function(){o.CHM(e);const r=o.oxw();return o.KtG(r.addPromotion())}),o._uU(1," Th\xeam m\xe3 khuy\u1ebfn m\xe3i "),o.qZA()}}function fo(n,s){1&n&&(o.TgZ(0,"td",46)(1,"div",47),o._uU(2," \u01afu ti\xean "),o.qZA()())}function _o(n,s){1&n&&(o.TgZ(0,"td",46)(1,"div",48),o._uU(2," Th\xf4ng th\u01b0\u1eddng "),o.qZA()())}function Eo(n,s){if(1&n){const e=o.EpF();o.TgZ(0,"cf-select",49),o.NdJ("ngModelChange",function(r){o.CHM(e);const a=o.oxw().$implicit;return o.KtG(a.state=r)})("selectedChange",function(r){o.CHM(e);const a=o.oxw().$implicit,i=o.oxw();return o.KtG(i.stateChange(r,a))}),o.qZA()}if(2&n){const e=o.oxw().$implicit,t=o.oxw();o.Q6J("data",t.stateOptionToEdit)("ngModel",e.state)("textField","name")("valueField","value")}}function Do(n,s){if(1&n&&o._uU(0),2&n){const e=o.oxw().$implicit;o.Oqu(e.state)}}function yo(n,s){if(1&n){const e=o.EpF();o.TgZ(0,"button",50),o.NdJ("click",function(){o.CHM(e);const r=o.oxw().$implicit,a=o.oxw();return o.KtG(a.edit(r))}),o._uU(1,"Chi ti\u1ebft"),o.qZA()}}function Fo(n,s){if(1&n&&(o.TgZ(0,"tr",38)(1,"td",39),o._uU(2),o.qZA(),o.TgZ(3,"td",39),o._UZ(4,"img",40),o.qZA(),o.TgZ(5,"td",39),o._uU(6),o.qZA(),o.TgZ(7,"td",39),o._uU(8),o.ALo(9,"date"),o.qZA(),o.TgZ(10,"td",39),o._uU(11),o.ALo(12,"date"),o.qZA(),o.TgZ(13,"td",39),o._uU(14),o.ALo(15,"date"),o.qZA(),o.TgZ(16,"td",39),o._uU(17),o.ALo(18,"date"),o.qZA(),o.TgZ(19,"td",39),o._uU(20),o.qZA(),o.TgZ(21,"td",39),o._uU(22),o.qZA(),o.TgZ(23,"td",39),o._uU(24),o.qZA(),o.TgZ(25,"td",39),o._uU(26),o.qZA(),o.TgZ(27,"td",39),o._uU(28),o.qZA(),o.YNc(29,fo,3,0,"td",41),o.YNc(30,_o,3,0,"td",41),o.TgZ(31,"td",39),o._uU(32),o.qZA(),o.TgZ(33,"td",39),o.YNc(34,Eo,1,4,"cf-select",42),o.YNc(35,Do,1,1,"ng-template",null,43,o.W1O),o.qZA(),o.TgZ(37,"td",44),o.YNc(38,yo,2,0,"button",45),o.qZA()()),2&n){const e=s.$implicit,t=o.MAs(36),r=o.oxw();o.xp6(2),o.Oqu(e.promotionCode),o.xp6(2),o.s9C("src",e.airlineLogo,o.LSH),o.xp6(2),o.Oqu(e.description),o.xp6(2),o.Oqu(o.xi3(9,18,e.startIssuedDate,"dd/MM/yyyy")),o.xp6(3),o.Oqu(o.xi3(12,21,e.endIssuedDate,"dd/MM/yyyy")),o.xp6(3),o.Oqu(o.xi3(15,24,e.startDepartureDate,"dd/MM/yyyy")),o.xp6(3),o.Oqu(o.xi3(18,27,e.endDepartureDate,"dd/MM/yyyy")),o.xp6(3),o.Oqu(""===e.startPoint?"T\u1ea5t c\u1ea3":e.startPoint),o.xp6(2),o.Oqu(""===e.endPoint?"T\u1ea5t c\u1ea3":e.endPoint),o.xp6(2),o.Oqu(e.journeyText),o.xp6(2),o.Oqu("ALL"===e.passengerTypes?"T\u1ea5t c\u1ea3":e.passengerTypes),o.xp6(2),o.Oqu(e.numOfPassenger),o.xp6(1),o.Q6J("ngIf","HIGH"===e.priority),o.xp6(1),o.Q6J("ngIf","NORMAL"===e.priority),o.xp6(2),o.Oqu(e.autoSuggest?"Cho ph\xe9p":"Kh\xf4ng cho ph\xe9p"),o.xp6(2),o.Q6J("ngIf",r.canEdit)("ngIfElse",t),o.xp6(4),o.Q6J("ngIf",r.canEdit)}}const Co=function(){return{num:25}},Ao=function(){return{num:50}},To=function(){return{num:75}},Zo=function(){return{num:100}},vo=function(n,s,e,t){return[n,s,e,t]};let Mo=(()=>{class n{constructor(e,t,r,a,i,p,E,P){this._router=t,this._modalService=r,this._fb=a,this._promotionSevice=i,this._flightDataService=p,this._modal=E,this._permissionService=P,this.listOfData=[],this.pageSize=25,this.currentPage=1,this.dateSelectOption=[],this.stateOption=[],this.airlineSelectOption=[],this.prioritySelectOption=[],this.stateOptionToEdit=[{name:"Ho\u1ea1t \u0111\u1ed9ng",value:"ACTIVE"},{name:"Ng\u1eebng ho\u1ea1t \u0111\u1ed9ng",value:"INACTIVE"}],this.showAddPromotion=this._permissionService.hasPermission(A.or.CreateFlightPromotion),this.canEdit=this._permissionService.hasPermission(A.or.EditFlightPromotion),this.sortChange=(d,m)=>{let Z=m.map(D=>D);for(let D=0;D<d.length;D++){const w=d[D];"airline"===w.key&&(Z=Z.sort("ascend"===w.sort?(I,k)=>this.increaseAlphabetSort(I.airline,k.airline):(I,k)=>this.decreaseAlphabetSort(I.airline,k.airline)))}return Z},this.searchChange=(d,m)=>m,this.increaseAlphabetSort=(d,m)=>d<m?-1:d>m?1:0,this.decreaseAlphabetSort=(d,m)=>d>m?-1:d<m?1:0,e.registerIcons([]);const T=new Date;T.setDate(1);const _=new Date;_.setMonth(_.getMonth()+1),_.setDate(0),this.searchForm=a.group({dateType:["ISSUED_DAY",u.kI.required],fromDate:[T,u.kI.required],toDate:[_,u.kI.required],airline:[""],searchText:[""],state:["ALL"],priority:["ALL"],hidePromoExpired:[!1]}),this.dateSelectOption=[{name:"Th\u1eddi gian xu\u1ea5t v\xe9",value:"ISSUED_DAY"},{name:"Th\u1eddi gian bay",value:"FLY_DAY"}],this.airlineSelectOption=[{name:"T\u1ea5t c\u1ea3 h\xe3ng bay",value:""},{name:"Vietnam Airline",value:"VN"},{name:"Bamboo Airways",value:"QH"},{name:"Vietjet Air",value:"VJ"}],this.stateOption=[{name:"T\u1ea5t c\u1ea3",value:"ALL"},{name:"Ho\u1ea1t \u0111\xf4ng",value:"ACTIVE"},{name:"Ng\u1eebng ho\u1ea1t \u0111\u1ed9ng",value:"INACTIVE"}],this.prioritySelectOption=[{name:"T\u1ea5t c\u1ea3",value:"ALL"},{name:"C\xf3",value:"YES"},{name:"Kh\xf4ng",value:"NO"}]}ngOnInit(){this.search()}hidePromotionChange(e){this.searchForm.controls.hidePromoExpired.setValue(e)}fromDateChange(e){e&&(this.minToDate=new f.Ao(e.getFullYear(),e.getMonth()+1,e.getDate()))}resetRangeDate(e,t){e.setValue(""),t.setValue("")}onDateSelection(e,t,r,a){t.value||r.value?t.value&&!r.value&&e&&e.getTime()>=t.value.getTime()?(r.setValue(e),a.close(),this.startDate=t.value):(r.setValue(null),t.setValue(e)):t.setValue(e)}search(){this._promotionSevice.getAllPromotionForManage({airline:this.searchForm.controls.airline.value,dayType:this.searchForm.controls.dateType.value,fromDay:(0,c.p6)(this.searchForm.controls.fromDate.value,"dd/MM/yyyy","vi-VN"),toDay:(0,c.p6)(this.searchForm.controls.toDate.value,"dd/MM/yyyy","vi-VN"),priority:this.searchForm.controls.priority.value,searchText:this.searchForm.controls.searchText.value,hidePromoExpired:this.searchForm.controls.hidePromoExpired.value,status:this.searchForm.controls.state.value}).subscribe({next:e=>{this.listOfData=e.data.map(t=>{let r="T\u1ea5t c\u1ea3";return"ONE_WAY"===t.journeyType&&(r="M\u1ed9t chi\u1ec1u"),"ROUND_TRIP"===t.journeyType&&(r="Kh\u1ee9 h\u1ed3i"),{id:t.id,promotionCode:t.promoCode,airline:t.airline,airlineLogo:this._flightDataService.getAirlineLogoByCode(t.airline),description:t.description,startIssuedDate:new Date(1e3*t.startIssuedDay),endIssuedDate:new Date(1e3*t.endIssuedDay),endDepartureDate:new Date(1e3*t.endFlyDay),startDepartureDate:new Date(1e3*t.startFlyDay),startPoint:t.startPoint,endPoint:t.endPoint,journeyType:t.journeyType,journeyText:r,passengerTypes:t.paxType,numOfPassenger:t.paxNum,priority:t.priority,autoSuggest:t.autoSuggest,state:t.status,sourcePromo:t.sourcePromo}})}}),this.listOfData=[]}checkChange(e){this.pageSize=parseInt(e)}addPromotion(){this._modalService.open(Q,null).afterClosed$.subscribe({next:t=>{t.data&&this.search()}})}edit(e){this._modalService.open(Q,{promotion:e,canEdit:this._permissionService.hasPermission(A.or.EditFlightPromotion)}).afterClosed$.subscribe({next:r=>{r.data&&this.search()}})}stateChange(e,t){this._modal.open(v.V0,{title:"ACTIVE"===e.value?"M\u1edf l\u1ea1i m\xe3 khuy\u1ebfn m\xe3i n\xe0y?":"V\xf4 hi\u1ec7u h\xf3a m\xe3 khuy\u1ebfn m\xe3i n\xe0y?",body:"ACTIVE"===e.value?"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n cho ph\xe9p m\xe3 khuy\u1ebfn m\xe3i n\xe0y ho\u1ea1t \u0111\u1ed9ng l\u1ea1i?":"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n v\xf4 hi\u1ec7u h\xf3a m\xe3 khuy\u1ebfn m\xe3i n\xe0y?"}).afterClosed$.subscribe({next:a=>{a.data?this._promotionSevice.editPromotion(t.id,{promoCode:t.promotionCode,airline:t.airline,description:t.description,startIssuedDay:(0,c.p6)(t.startIssuedDate,"dd/MM/yyyy","vi-VN"),endIssuedDay:(0,c.p6)(t.endIssuedDate,"dd/MM/yyyy","vi-VN"),startFlyDay:(0,c.p6)(t.startDepartureDate,"dd/MM/yyyy","vi-VN"),endFlyDay:(0,c.p6)(t.endDepartureDate,"dd/MM/yyyy","vi-VN"),startPoint:t.startPoint,endPoint:t.endPoint,journeyType:t.journeyType,paxType:t.passengerTypes,paxNum:t.numOfPassenger,priority:t.priority,autoSuggest:t.autoSuggest,status:e.value,sourcePromo:t.sourcePromo}).subscribe({next:i=>{this.search()}}):t.state="ACTIVE"===e.value?"INACTIVE":"ACTIVE"}})}delete(e){}}return n.\u0275fac=function(e){return new(e||n)(o.Y36(g.KNP),o.Y36(uo.F0),o.Y36(C.oE),o.Y36(u.qu),o.Y36(M.q),o.Y36(so.G),o.Y36(C.oE),o.Y36(A.$A))},n.\u0275cmp=o.Xpm({type:n,selectors:[["promotion-manage-page"]],standalone:!0,features:[o.jDz],decls:88,vars:46,consts:[[1,"flex","flex-col","py-4","px-[30px]","bg-white","w-full"],[1,"flex","gap-x-[17px]"],[1,"flex","flex-col","grow","gap-y-4"],[1,"flex","w-full","justify-center","gap-x-4"],["size","small","textField","name","valueField","value",1,"grow-[180]",3,"formControl","data","allowSearch"],["cfLabel",""],[1,"flex","grow-[327]"],[1,"grow","!w-auto",3,"status"],["cfHeadIcon","","icon","calendar","size","small"],["cfDatepickerViewer","","type","text","size","small","cf-input","","placeholder","Ch\u1ecdn ng\xe0y b\u1eaft \u0111\u1ea7u",3,"formControl","input","ngModelChange","click"],["cfHint","",3,"hint",4,"ngIf"],["type","text","outsideDays","hidden","cfDatepicker","",1,"w-0","m-0","mr-2","bottom-0",3,"secondaryCalendar","displayMonths","rangeSelection","fromDate","startDate","toDate","reset","dateSelect"],["dateRange","cfDatepicker"],["cfDatepickerViewer","","type","text","size","small","cf-input","","placeholder","Ch\u1ecdn ng\xe0y k\u1ebft th\xfac",3,"minDate","formControl","input","click"],["textField","name","valueField","value","size","small",1,"grow-[180]",3,"formControl","data","allowSearch"],[1,"flex","justify-center","gap-x-2","items-center"],[1,"!w-full"],["cfHeadIcon","","icon","search","size","small"],["size","medium","cf-input","","placeholder","T\xecm ki\u1ebfm trong danh s\xe1ch k\u1ebft qu\u1ea3...",3,"formControl"],["tableSearchInput",""],[1,"flex","flex-col","justify-end","w-[168px]","shrink-0"],["cf-button","","type","secondary","size","medium",1,"justify-center",3,"click"],["cfHeadIcon","","icon","search","size","small",1,"mr-2"],[1,"flex","justify-start","mt-4"],["size","medium",3,"checkChange"],[1,"py-4","px-[30px]","rounded-lg"],[1,"bg-neutral-white","rounded-lg","shadow-cf-md"],[1,"p-4","flex","justify-between","items-center"],[1,"text-heading-sm"],["cf-button","","type","secondary",3,"click",4,"ngIf"],[1,"",3,"fnSort","fnSearch","pageSizeList","listData","pageSize"],["managerTable",""],["cf-thead",""],["cf-th","",1,"whitespace-nowrap"],["cf-th","",1,"whitespace-nowrap",3,"sortName"],["ngFor","",3,"ngForOf"],["cfHint","",3,"hint"],["cf-button","","type","secondary",3,"click"],[1,"border-b","border-neutral-gray-1"],["cf-td","",1,"py-2","px-3","text-body-sm"],[1,"w-12","h-6","object-contain",3,"src"],["cf-td","","class","py-2 px-3 text-body-sm flex justify-center",4,"ngIf"],["class","w-[170px]",3,"data","ngModel","textField","valueField","ngModelChange","selectedChange",4,"ngIf","ngIfElse"],["statusTemplate",""],["cf-td","",1,"py-2","px-3","flex","justify-end","gap-x-2"],["cf-button","","size","small","type","secondary","class","whitespace-nowrap",3,"click",4,"ngIf"],["cf-td","",1,"py-2","px-3","text-body-sm","flex","justify-center"],[1,"flex","py-1","px-2","w-fit","items-center","justify-center","bg-secondary-6-1","rounded","text-espressive-md","text-secondary-6-4"],[1,"flex","py-1","px-2","w-fit","items-center","justify-center","bg-neutral-gray-2","whitespace-nowrap","rounded","text-espressive-md","text-neutral-gray-6"],[1,"w-[170px]",3,"data","ngModel","textField","valueField","ngModelChange","selectedChange"],["cf-button","","size","small","type","secondary",1,"whitespace-nowrap",3,"click"]],template:function(e,t){if(1&e){const r=o.EpF();o.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"cf-select",4)(5,"label",5),o._uU(6,"T\xecm theo"),o.qZA()(),o.TgZ(7,"div",6)(8,"cf-input-group",7),o._UZ(9,"cf-icon",8),o.TgZ(10,"label",5),o._uU(11,"Ng\xe0y b\u1eaft \u0111\u1ea7u"),o.qZA(),o.TgZ(12,"input",9),o.NdJ("input",function(){o.CHM(r);const i=o.MAs(16);return o.KtG(i.close())})("ngModelChange",function(i){return t.fromDateChange(i)})("click",function(){o.CHM(r);const i=o.MAs(16);return o.KtG(i.open())}),o.qZA(),o.YNc(13,lo,1,1,"cf-input-hint",10),o.YNc(14,co,1,1,"cf-input-hint",10),o.qZA(),o.TgZ(15,"input",11,12),o.NdJ("reset",function(){return t.resetRangeDate(t.searchForm.controls.fromDate,t.searchForm.controls.toDate)})("dateSelect",function(i){o.CHM(r);const p=o.MAs(16);return o.KtG(t.onDateSelection(i,t.searchForm.controls.fromDate,t.searchForm.controls.toDate,p))}),o.qZA(),o.TgZ(17,"cf-input-group",7),o._UZ(18,"cf-icon",8),o.TgZ(19,"label",5),o._uU(20,"Ng\xe0y k\u1ebft th\xfac"),o.qZA(),o.TgZ(21,"input",13),o.NdJ("input",function(){o.CHM(r);const i=o.MAs(16);return o.KtG(i.close())})("click",function(){o.CHM(r);const i=o.MAs(16);return o.KtG(i.open())}),o.qZA(),o.YNc(22,mo,1,1,"cf-input-hint",10),o.YNc(23,po,1,1,"cf-input-hint",10),o.YNc(24,ho,1,1,"cf-input-hint",10),o.qZA()(),o.TgZ(25,"cf-select",14)(26,"label",5),o._uU(27,"H\xe3ng bay"),o.qZA()(),o.TgZ(28,"cf-select",14)(29,"label",5),o._uU(30,"\u01afu ti\xean"),o.qZA()(),o.TgZ(31,"cf-select",14)(32,"label",5),o._uU(33,"Tr\u1ea1ng th\xe1i"),o.qZA()()(),o.TgZ(34,"div",15)(35,"cf-input-group",16),o._UZ(36,"cf-icon",17)(37,"input",18,19),o.qZA()()(),o.TgZ(39,"div",20)(40,"button",21),o.NdJ("click",function(){return t.search()}),o._UZ(41,"cf-icon",22),o._uU(42," T\xecm ki\u1ebfm "),o.qZA()()(),o.TgZ(43,"div",23)(44,"cf-checkbox",24),o.NdJ("checkChange",function(i){return t.hidePromotionChange(i)}),o._uU(45,"\u1ea8n m\xe3 khuy\u1ebfn m\xe3i h\u1ebft hi\u1ec7u l\u1ef1c"),o.qZA()()(),o.TgZ(46,"div",25)(47,"div",26)(48,"div",27)(49,"div",28),o._uU(50,"Qu\u1ea3n l\xfd m\xe3 khuy\u1ebfn m\xe3i"),o.qZA(),o.YNc(51,go,2,0,"button",29),o.qZA(),o.TgZ(52,"cf-table",30,31)(54,"thead",32)(55,"th",33),o._uU(56,"M\xe3 KM"),o.qZA(),o.TgZ(57,"th",34),o._uU(58,"H\xe3ng"),o.qZA(),o.TgZ(59,"th",33),o._uU(60,"M\xf4 t\u1ea3"),o.qZA(),o.TgZ(61,"th",33),o._uU(62,"Ng\xe0y xu\u1ea5t \u0111\u1ea7u"),o.qZA(),o.TgZ(63,"th",33),o._uU(64,"Ng\xe0y xu\u1ea5t cu\u1ed5i"),o.qZA(),o.TgZ(65,"th",33),o._uU(66,"Ng\xe0y bay \u0111\u1ea7u"),o.qZA(),o.TgZ(67,"th",33),o._uU(68,"Ng\xe0y bay cu\u1ed1i"),o.qZA(),o.TgZ(69,"th",33),o._uU(70,"\u0110i\u1ec3m \u0111i"),o.qZA(),o.TgZ(71,"th",33),o._uU(72,"\u0110i\u1ec3m \u0111\u1ebfn"),o.qZA(),o.TgZ(73,"th",33),o._uU(74,"Lo\u1ea1i h\xe0nh tr\xecnh"),o.qZA(),o.TgZ(75,"th",33),o._uU(76,"Lo\u1ea1i h\xe0nh kh\xe1ch"),o.qZA(),o.TgZ(77,"th",33),o._uU(78,"S\u1ed1 h\xe0nh kh\xe1ch"),o.qZA(),o.TgZ(79,"th",33),o._uU(80,"\u01afu ti\xean"),o.qZA(),o.TgZ(81,"th",33),o._uU(82,"T\u1ef1 \u0111\u1ed9ng \xe1p d\u1ee5ng"),o.qZA(),o.TgZ(83,"th",33),o._uU(84,"Tr\u1ea1ng th\xe1i"),o.qZA(),o._UZ(85,"th",33),o.qZA(),o.TgZ(86,"tbody"),o.YNc(87,Fo,39,30,"ng-template",35),o.qZA()()()()}if(2&e){const r=o.MAs(53);o.xp6(4),o.Q6J("formControl",t.searchForm.controls.dateType)("data",t.dateSelectOption)("allowSearch",!1),o.xp6(4),o.Q6J("status",t.searchForm.controls.fromDate.invalid&&(t.searchForm.controls.fromDate.dirty||t.searchForm.controls.fromDate.touched)?"error":"default"),o.xp6(4),o.Q6J("formControl",t.searchForm.controls.fromDate),o.xp6(1),o.Q6J("ngIf",(null==t.searchForm.controls.fromDate.errors?null:t.searchForm.controls.fromDate.errors.required)&&(t.searchForm.controls.fromDate.dirty||t.searchForm.controls.fromDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.searchForm.controls.fromDate.errors||null==t.searchForm.controls.fromDate.errors.ngbDate?null:t.searchForm.controls.fromDate.errors.ngbDate.invalid)&&(t.searchForm.controls.fromDate.dirty||t.searchForm.controls.fromDate.touched)),o.xp6(1),o.Q6J("secondaryCalendar","lunar")("displayMonths",2)("rangeSelection",!0)("fromDate",t.searchForm.controls.fromDate.value)("startDate",t.startDate)("toDate",t.searchForm.controls.toDate.value),o.xp6(2),o.Q6J("status",t.searchForm.controls.toDate.invalid&&(t.searchForm.controls.toDate.dirty||t.searchForm.controls.toDate.touched)?"error":"default"),o.xp6(4),o.Q6J("minDate",t.minToDate)("formControl",t.searchForm.controls.toDate),o.xp6(1),o.Q6J("ngIf",(null==t.searchForm.controls.toDate.errors?null:t.searchForm.controls.toDate.errors.required)&&(t.searchForm.controls.toDate.dirty||t.searchForm.controls.toDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.searchForm.controls.toDate.errors||null==t.searchForm.controls.toDate.errors.ngbDate?null:t.searchForm.controls.toDate.errors.ngbDate.minDate)&&(t.searchForm.controls.toDate.dirty||t.searchForm.controls.toDate.touched)),o.xp6(1),o.Q6J("ngIf",(null==t.searchForm.controls.toDate.errors||null==t.searchForm.controls.toDate.errors.ngbDate?null:t.searchForm.controls.toDate.errors.ngbDate.invalid)&&(t.searchForm.controls.toDate.dirty||t.searchForm.controls.toDate.touched)),o.xp6(1),o.Q6J("formControl",t.searchForm.controls.airline)("data",t.airlineSelectOption)("allowSearch",!1),o.xp6(3),o.Q6J("formControl",t.searchForm.controls.priority)("data",t.prioritySelectOption)("allowSearch",!1),o.xp6(3),o.Q6J("formControl",t.searchForm.controls.state)("data",t.stateOption)("allowSearch",!1),o.xp6(6),o.Q6J("formControl",t.searchForm.controls.searchText),o.xp6(14),o.Q6J("ngIf",t.showAddPromotion),o.xp6(1),o.Q6J("fnSort",t.sortChange)("fnSearch",t.searchChange)("pageSizeList",o.l5B(41,vo,o.DdM(37,Co),o.DdM(38,Ao),o.DdM(39,To),o.DdM(40,Zo)))("listData",t.listOfData)("pageSize",t.pageSize),o.xp6(5),o.Q6J("sortName","airline"),o.xp6(30),o.Q6J("ngForOf",r.partOfdata)}},dependencies:[c.ez,c.sg,c.O5,c.uU,g.AxE,g.Sm8,y.N8,y.Xq,F.rC,F.E_,F.zs,F.qS,N.q,h.j$,h.ND,h.BN,h.v2,f.Cs,f.hI,u.u5,u.Fj,u.JJ,u.On,u.UX,u.oH,b.u],encapsulation:2}),n})()}}]);