-
Notifications
You must be signed in to change notification settings - Fork 0
/
2982.00aab588ee9f771e.js
1 lines (1 loc) · 202 KB
/
2982.00aab588ee9f771e.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[2982],{2982:(ct,G,_)=>{_.r(G),_.d(G,{QuotationModalComponent:()=>Fe,SearchFlightResultPageComponent:()=>Nn});var S=_(36895),M=_(24006),L=_(83700),O=_(88516),C=_(72506),Pe=_(19010),ut=_(24513),$=_(67460),Ie=_(53041),P=_(76978),dt=_(65441),A=_(27361),x=_(88001),R=_(40899);const w=r=>!["Kh\xf4ng","0 kg","0 KG","0 Kg"].includes(r);var Ee=_(17489),m=_(15439),K=_(77296),Ae=_(61135),ht=_(77579),Ne=_(82722),ee=_(28746),Q=_(39646),Y=_(46590),q=_(54004),B=_(15861),J=_(37094),we=_(27898),e=_(94650);let gt=(()=>{class r{constructor(){this.percent=0,this.text="",this.circumference=60*Math.PI}ngOnInit(){}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=e.Xpm({type:r,selectors:[["cf-progress"]],inputs:{percent:"percent",text:"text"},standalone:!0,features:[e.jDz],decls:15,vars:4,consts:[[1,"flex","justify-center","flex-col","items-center"],[1,"flex","items-center","justify-center","overflow-hidden","rounded-full"],[1,"w-20","h-20"],["stroke-width","5","stroke","currentColor","fill","transparent","r","30","cx","40","cy","40",1,"text-neutral-gray-1"],["stroke-width","5","stroke-linecap","round","stroke","currentColor","fill","transparent","r","30","cx","40","cy","40",1,"text-secondary-5-4"],[1,"absolute","text-body-md","text-secondary-5-4"],[1,"text-body-md","text-secondary-5-4"],[1,"dot-one"],[1,"dot-two"],[1,"dot-three"]],template:function(t,i){1&t&&(e.TgZ(0,"div",0)(1,"div",1),e.O4$(),e.TgZ(2,"svg",2),e._UZ(3,"circle",3)(4,"circle",4),e.qZA(),e.kcU(),e.TgZ(5,"span",5),e._uU(6),e.qZA()(),e.TgZ(7,"div",6),e._uU(8),e.TgZ(9,"span",7),e._uU(10," ."),e.qZA(),e.TgZ(11,"span",8),e._uU(12," ."),e.qZA(),e.TgZ(13,"span",9),e._uU(14," ."),e.qZA()()()),2&t&&(e.xp6(4),e.uIk("stroke-dasharray",i.circumference)("stroke-dashoffset",i.circumference-i.percent/100*i.circumference),e.xp6(2),e.hij("",i.percent,"%"),e.xp6(2),e.hij("",i.text," "))},styles:["span[class^=dot-][_ngcontent-%COMP%]{opacity:0}.dot-one[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_dot-one 2s infinite linear}.dot-two[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_dot-two 2s infinite linear}.dot-three[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_dot-three 2s infinite linear}@keyframes _ngcontent-%COMP%_dot-one{0%{opacity:0}15%{opacity:0}25%{opacity:1}to{opacity:1}}@keyframes _ngcontent-%COMP%_dot-two{0%{opacity:0}25%{opacity:0}50%{opacity:1}to{opacity:1}}@keyframes _ngcontent-%COMP%_dot-three{0%{opacity:0}50%{opacity:0}75%{opacity:1}to{opacity:1}}"]}),r})();var ae,Ze=_(19123),te=_(48373),ie=_(62331);const U=typeof window<"u"?null===(ae=window.navigator)||void 0===ae?void 0:ae.userAgent:void 0,pt=(null==U?void 0:U.includes("AppleWebKit"))&&!(null!=U&&U.includes("Chrome"));function ne(r){const l=[];for(let t=0,i=r.length;t<i;t++)l.push(r[t]);return l}function Me(r,l){return`data:${l};base64,${r}`}function Re(r,l,t){return se.apply(this,arguments)}function se(){return(se=(0,B.Z)(function*(r,l,t){const i=yield fetch(r,l);if(404===i.status)throw new Error(`Resource "${i.url}" not found`);const a=yield i.blob();return new Promise((n,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{n(t({res:i,result:o.result}))}catch(c){s(c)}},o.readAsDataURL(a)})})).apply(this,arguments)}const le={};function Be(r,l,t){return ce.apply(this,arguments)}function ce(){return(ce=(0,B.Z)(function*(r,l,t){const i=function bt(r,l,t){let i=r.replace(/\?.*/,"");return t&&(i=r),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),l?`[${l}]${i}`:i}(r,l,t.includeQueryParams);if(null!=le[i])return le[i];let a;t.cacheBust&&(r+=(/\?/.test(r)?"&":"?")+(new Date).getTime());try{const n=yield Re(r,t.fetchRequestInit,({res:s,result:o})=>(l||(l=s.headers.get("Content-Type")||""),function yt(r){return r.split(/,/)[1]}(o)));a=Me(n,l)}catch(n){a=t.imagePlaceholder||"";let s=`Failed to fetch resource: ${r}`;n&&(s="string"==typeof n?n:n.message),s&&console.warn(s)}return le[i]=a,a})).apply(this,arguments)}const Le="application/font-woff",He="image/jpeg",St={woff:Le,woff2:Le,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:He,jpeg:He,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qe(r){const l=function xt(r){const l=/\.([^./]*?)$/g.exec(r);return l?l[1]:""}(r).toLowerCase();return St[l]||""}const Oe=/url\((['"]?)([^'"]+?)\1\)/g,Dt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ft=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ue(){return(ue=(0,B.Z)(function*(r,l,t,i,a){try{const n=t?function mt(r,l){if(r.match(/^[a-z]+:\/\//i))return r;if(r.match(/^\/\//))return window.location.protocol+r;if(r.match(/^[a-z]+:/i))return r;const t=document.implementation.createHTMLDocument(),i=t.createElement("base"),a=t.createElement("a");return t.head.appendChild(i),t.body.appendChild(a),l&&(i.href=l),a.href=r,a.href}(l,t):l,s=Qe(l);let o;return o=a?Me(yield a(n),s):yield Be(n,s,i),r.replace(function kt(r){const l=r.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${l})(['"]?\\))`,"g")}(l),`$1${o}$3`)}catch{}return r})).apply(this,arguments)}function Je(r){return-1!==r.search(Oe)}function de(){return de=(0,B.Z)(function*(r,l,t){if(!Je(r))return r;const i=function Et(r,{preferredFontFormat:l}){return l?r.replace(Ft,t=>{for(;;){const[i,,a]=Dt.exec(t)||[];if(!a)return"";if(a===l)return`src: ${i};`}}):r}(r,t);return function Pt(r){const l=[];return r.replace(Oe,(t,i,a)=>(l.push(a),t)),l.filter(t=>!function Ct(r){return-1!==r.search(/^(data:)/)}(t))}(i).reduce((n,s)=>n.then(o=>function It(r,l,t,i,a){return ue.apply(this,arguments)}(o,s,l,t)),Promise.resolve(i))}),de.apply(this,arguments)}const Ue={};function Ye(r){return he.apply(this,arguments)}function he(){return(he=(0,B.Z)(function*(r){let l=Ue[r];return null!=l||(l={url:r,cssText:yield(yield fetch(r)).text()},Ue[r]=l),l})).apply(this,arguments)}function qe(r,l){return ge.apply(this,arguments)}function ge(){return ge=(0,B.Z)(function*(r,l){let t=r.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,n=(t.match(/url\([^)]+\)/g)||[]).map(function(){var s=(0,B.Z)(function*(o){let c=o.replace(i,"$1");return c.startsWith("https://")||(c=new URL(c,r.url).href),Re(c,l.fetchRequestInit,({result:d})=>(t=t.replace(o,`url(${d})`),[o,d]))});return function(o){return s.apply(this,arguments)}}());return Promise.all(n).then(()=>t)}),ge.apply(this,arguments)}function je(r){if(null==r)return[];const l=[];let i=r.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=a.exec(i);if(null===c)break;l.push(c[0])}i=i.replace(a,"");const n=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let c=n.exec(i);if(null===c){if(c=o.exec(i),null===c)break;n.lastIndex=o.lastIndex}else o.lastIndex=n.lastIndex;l.push(c[0])}return l}function pe(){return(pe=(0,B.Z)(function*(r,l){const t=[],i=[];return r.forEach(a=>{if("cssRules"in a)try{ne(a.cssRules||[]).forEach((n,s)=>{if(n.type===CSSRule.IMPORT_RULE){let o=s+1;const d=Ye(n.href).then(u=>qe(u,l)).then(u=>je(u).forEach(h=>{try{a.insertRule(h,h.startsWith("@import")?o+=1:a.cssRules.length)}catch(g){console.error("Error inserting rule from remote css",{rule:h,error:g})}})).catch(u=>{console.error("Error loading remote css",u.toString())});i.push(d)}})}catch(n){const s=r.find(o=>null==o.href)||document.styleSheets[0];null!=a.href&&i.push(Ye(a.href).then(o=>qe(o,l)).then(o=>je(o).forEach(c=>{s.insertRule(c,a.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",n)}}),Promise.all(i).then(()=>(r.forEach(a=>{if("cssRules"in a)try{ne(a.cssRules||[]).forEach(n=>{t.push(n)})}catch(n){console.error(`Error while reading CSS rules from ${a.href}`,n)}}),t))})).apply(this,arguments)}function me(){return me=(0,B.Z)(function*(r,l){if(null==r.ownerDocument)throw new Error("Provided element is not within a Document");const t=ne(r.ownerDocument.styleSheets),i=yield function Nt(r,l){return pe.apply(this,arguments)}(t,l);return function wt(r){return r.filter(l=>l.type===CSSRule.FONT_FACE_RULE).filter(l=>Je(l.style.getPropertyValue("src")))}(i)}),me.apply(this,arguments)}function fe(){return fe=(0,B.Z)(function*(r,l){let t=yield function Zt(r,l){return me.apply(this,arguments)}(r,l);return l.includeFontSrc&&(t=t.filter(a=>{var n;return null===(n=l.includeFontSrc)||void 0===n?void 0:n.some(s=>a.cssText.includes(s))})),(yield Promise.all(t.map(a=>function At(r,l,t){return de.apply(this,arguments)}(a.cssText,a.parentStyleSheet?a.parentStyleSheet.href:null,l)))).join("\n")}),fe.apply(this,arguments)}function $e(r){return xe.apply(this,arguments)}function xe(){return(xe=(0,B.Z)(function*(r,l={}){return function Ge(r,l){return fe.apply(this,arguments)}(r,l)})).apply(this,arguments)}var Ke=_(51948),Ve=_(94327),Rt=_(47822),Bt=_(25650),ze=_(74710),De=_(4128),W=_(88996),We=_(49770),Xe=_(44143),j=_(97579),et=_(82761),tt=_(61027);function Lt(r,l){if(1&r&&(e.ynx(0),e.TgZ(1,"div",16)(2,"div",17),e._UZ(3,"img",18),e.TgZ(4,"span",19),e._uU(5),e.qZA()(),e._UZ(6,"cf-input-number",20),e.TgZ(7,"span",21),e._uU(8,"\u0111"),e.qZA()(),e.BQk()),2&r){const t=l.$implicit,i=e.oxw();let a,n;e.xp6(3),e.Q6J("src",null==(a=i.getSurchargeItem(t))?null:a.logo,e.LSH),e.xp6(2),e.Oqu("GDS"===(null==(n=i.getSurchargeItem(t))?null:n.airline)?"1A, 1G":null==(n=i.getSurchargeItem(t))?null:n.airline),e.xp6(1),e.Q6J("placeholder","0")("negative",!1)("formControl",i.getFormControlInSurcharges(t))}}function Ht(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div")(1,"cf-checkbox",22),e.NdJ("checkChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.checkChange(a))}),e._uU(2," \u0110\u1eb7t l\xe0m m\u1ee9c ph\xed ph\u1ee5 thu m\u1eb7c \u0111\u1ecbnh "),e.qZA()()}if(2&r){const t=e.oxw();e.xp6(1),e.Q6J("checked",t.hasDefaultConfig)}}function Qt(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.gotoSettings())}),e._UZ(1,"cf-icon",11),e.qZA()}}function Ot(r,l){1&r&&e._UZ(0,"cf-spinner")}let it=(()=>{class r{constructor(t,i,a,n,s,o,c,d,u,h,g){this.ref=i,this.fb=a,this.bottomSheetRefDialog=n,this.bottomSheetData=s,this.bottomSheetRef=o,this._modal=c,this._route=d,this._generalService=u,this._toastService=h,this._permissionService=g,this.hasDefaultConfig=!1,this.isUpdateSurchargeFee=this._permissionService.hasPermission(R.or.CreateOrUpdateSurchargeFeeConfig)&&this._permissionService.hasPermission(R.or.ViewSurchargeFeeConfig),this.surchargeConfigs=[],this.isLoading=!1,this.isChangeConfig=!1,t.registerIcons([C.UNF,C.Xzk]),this.surcharges=i?i.data.surcharges:s.surcharges,this.surchargeConfigs=i?i.data.surchargeConfigs:s.surchargeConfigs}ngOnInit(){this.initFormGroup(),this.formGroup.valueChanges.subscribe(()=>{this.isChangeConfig=!0})}initFormGroup(){this.formGroup=this.fb.group({surcharges:this.fb.array(this.surcharges.map(t=>this.fb.group({airline:[t.airline],surchargePrice:[t.surchargePrice]})))})}onSubmit(){let i={};this.formGroup.value.surcharges.forEach(a=>{i[a.airline]=a.surchargePrice}),this.surcharges=this.surcharges.map(a=>(a.surchargePrice=i[a.airline],a)),this.saveConfig(()=>this.ref.close(this.surcharges))}onMobileSubmit(){let i={};this.formGroup.value.surcharges.forEach(a=>{i[a.airline]=a.surchargePrice}),this.surcharges=this.surcharges.map(a=>(a.surchargePrice=i[a.airline],a)),this.saveConfig(()=>this.bottomSheetRef.dismiss(this.surcharges))}saveConfig(t){var i;if(this.hasDefaultConfig){const a=(null===(i=this.surchargeConfigs)||void 0===i?void 0:i.map(n=>{const s=this.surcharges.find(o=>o.airline===n.airline);return Object.assign(Object.assign({},n),{amount:s?s.surchargePrice:n.amount})}))||[];this.isLoading=!0,this._generalService.updateSurchargeFeeConfig(a).pipe((0,ee.x)(()=>{this.isLoading=!1,t()})).subscribe({next:n=>{var s,o;if(n.success)this._toastService.add({severity:"success",summary:"C\u1eadp nh\u1eadt th\xe0nh c\xf4ng",detail:"C\u1eadp nh\u1eadt th\xf4ng tin c\u1ea5u h\xecnh th\xe0nh c\xf4ng!",sticky:!1});else{const c=null===(o=null===(s=n.objectError)||void 0===s?void 0:s.errorDescription)||void 0===o?void 0:o.vi;this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:c||"Kh\xf4ng th\u1ec3 c\u1eadp nh\u1eadt c\u1ea5u h\xecnh m\u1edbi. Vui l\xf2ng th\u1eed l\u1ea1i!",sticky:!0})}},error:()=>{this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:"Kh\xf4ng th\u1ec3 c\u1eadp nh\u1eadt c\u1ea5u h\xecnh m\u1edbi. Vui l\xf2ng th\u1eed l\u1ea1i!",sticky:!0})}})}else t()}onClose(){this.ref.close(!1)}getSurchargesForms(){return this.formGroup.controls.surcharges}getSurchargeItem(t){return this.surcharges.find(i=>i.airline===t.value.airline)}getFormControlInSurcharges(t){return t.controls.surchargePrice}checkChange(t){this.hasDefaultConfig=t}gotoSettings(){const t=()=>{this.bottomSheetRefDialog&&this.bottomSheetRefDialog.closeAll(),this._modal.closeAllModals(),this._route.navigate(["admin/general"])};this.isChangeConfig?this._modal.open($.V0,{title:"H\u1ee7y b\u1ecf thay \u0111\u1ed5i?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n h\u1ee7y b\u1ecf thay \u0111\u1ed5i v\xe0 d\u1eebng vi\u1ec7c ch\u1ec9nh s\u1eeda? H\xe0nh \u0111\u1ed9ng n\xe0y kh\xf4ng th\u1ec3 ho\xe0n t\xe1c.",okText:"C\xf3, h\u1ee7y b\u1ecf",cancelText:"Kh\xf4ng, ti\u1ebfp t\u1ee5c",isSecondary:!0}).afterClosed$.subscribe({next:a=>{a.data&&t()}}):t()}}return r.\u0275fac=function(t){return new(t||r)(e.Y36(C.KNP),e.Y36(j.gb,8),e.Y36(M.qu),e.Y36(J.a2,8),e.Y36(J.Rr,8),e.Y36(J.Zu,8),e.Y36(j.oE),e.Y36(et.F0),e.Y36(tt.m),e.Y36(ie.BX),e.Y36(R.$A))},r.\u0275cmp=e.Xpm({type:r,selectors:[["cf-surcharge-modal"]],hostAttrs:[1,"md:w-full"],standalone:!0,features:[e.jDz],decls:21,vars:5,consts:[[1,"w-[400px]","bg-white","rounded-lg","md:w-full"],[1,"flex","justify-between","items-center","px-6","py-[13px]","md:hidden"],[1,"text-heading-sm","text-neutral-black"],["size","medium","icon","close",1,"text-neutral-gray-4","cursor-pointer",3,"click"],[1,"px-6","py-4","md:w-full","md:p-4","md:pt-5"],[1,"max-h-[500px]","overflow-y-auto",3,"formGroup"],[1,"flex","flex-col","gap-y-3"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"items-center","hidden","md:flex","mt-6","gap-x-4"],["cf-button","","size","medium","type","secondary",1,"bg-white",3,"click"],["size","small","icon","settings"],["cf-button","","size","medium",1,"hidden","justify-center","items-center","md:flex","w-full",3,"click"],[1,"flex","justify-between","items-center","py-4","px-6","md:hidden"],["cf-button","","size","medium","type","secondary","class","bg-white",3,"click",4,"ngIf"],["cf-button","","size","medium",3,"click"],[1,"w-full","h-10","flex","justify-between","border","border-neutral-gray-1","rounded"],[1,"w-[130px]","shrink-0","flex","gap-x-2","border-r","border-neutral-gray-1","py-2.5","px-4"],[1,"h-5","w-10","object-contain",3,"src"],[1,"text-body-md"],["size","medium",1,"pl-4",3,"placeholder","negative","formControl"],[1,"text-body-md-short","px-3","py-2"],["size","medium",3,"checked","checkChange"]],template:function(t,i){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._uU(3,"Ch\u1ec9nh ph\xed ph\u1ee5 thu"),e.qZA(),e.TgZ(4,"cf-icon",3),e.NdJ("click",function(){return i.onClose()}),e.qZA()(),e.TgZ(5,"div",4)(6,"form",5)(7,"div",6),e.YNc(8,Lt,9,5,"ng-container",7),e.YNc(9,Ht,3,1,"div",8),e.qZA()(),e.TgZ(10,"div",9)(11,"button",10),e.NdJ("click",function(){return i.gotoSettings()}),e._UZ(12,"cf-icon",11),e.qZA(),e.TgZ(13,"button",12),e.NdJ("click",function(){return i.onMobileSubmit()}),e._uU(14,"X\xe1c nh\u1eadn"),e.qZA()()(),e.TgZ(15,"div",13)(16,"div"),e.YNc(17,Qt,2,0,"button",14),e.qZA(),e.TgZ(18,"button",15),e.NdJ("click",function(){return i.onSubmit()}),e._uU(19," C\u1eadp nh\u1eadt "),e.qZA()()(),e.YNc(20,Ot,1,0,"cf-spinner",8)),2&t&&(e.xp6(6),e.Q6J("formGroup",i.formGroup),e.xp6(2),e.Q6J("ngForOf",i.getSurchargesForms().controls),e.xp6(1),e.Q6J("ngIf",i.isUpdateSurchargeFee),e.xp6(8),e.Q6J("ngIf",i.isUpdateSurchargeFee),e.xp6(3),e.Q6J("ngIf",i.isLoading))},dependencies:[S.ez,S.sg,S.O5,M.u5,M._Y,M.JJ,M.JL,C.AxE,C.Sm8,L.N8,L.Xq,Xe.j$,Xe.lt,M.UX,M.oH,M.sg,we.u,$.OR],encapsulation:2}),r})();const Jt=["quotationGraphic"],Ut=["quotationGraphicPDF"],at=function(r,l,t){return{listTicket:r,paddingBottomHeight:l,isShowHeader:t}};function Yt(r,l){if(1&r&&(e.TgZ(0,"div",null,2),e.GkF(2,3),e.qZA()),2&r){const t=l.$implicit;e.oxw();const i=e.MAs(5);e.xp6(2),e.Q6J("ngTemplateOutlet",i)("ngTemplateOutletContext",e.kEZ(2,at,t.listTicket,t.paddingBottomHeight,t.isShowHeader))}}function qt(r,l){if(1&r&&(e.TgZ(0,"div",null,4),e.GkF(2,3),e.qZA()),2&r){const t=l.$implicit;e.oxw();const i=e.MAs(5);e.xp6(2),e.Q6J("ngTemplateOutlet",i)("ngTemplateOutletContext",e.kEZ(2,at,t.listTicket,t.paddingBottomHeight,t.isShowHeader))}}function jt(r,l){if(1&r&&e._UZ(0,"img",20),2&r){const t=e.oxw(3);e.Q6J("src",t.agentInfo.logoUrl,e.LSH)}}function Gt(r,l){1&r&&(e.O4$(),e.TgZ(0,"svg",21),e._UZ(1,"path",22),e.TgZ(2,"defs")(3,"linearGradient",23),e._UZ(4,"stop",24)(5,"stop",25),e.qZA()()())}function $t(r,l){if(1&r&&(e.TgZ(0,"div",26)(1,"div",27),e._uU(2,"\u0110\u1ecba ch\u1ec9:"),e.qZA(),e.TgZ(3,"div",28),e._uU(4),e.qZA()()),2&r){const t=e.oxw(3);e.xp6(4),e.Oqu(t.agentInfo.address)}}function Kt(r,l){if(1&r&&(e.TgZ(0,"div",26)(1,"div",27),e._uU(2,"Email:"),e.qZA(),e.TgZ(3,"div",28),e._uU(4),e.qZA()()),2&r){const t=e.oxw(3);e.xp6(4),e.Oqu(t.agentInfo.email)}}function Vt(r,l){if(1&r&&(e.TgZ(0,"div",26)(1,"div",27),e._uU(2,"Website:"),e.qZA(),e.TgZ(3,"div",28),e._uU(4),e.qZA()()),2&r){const t=e.oxw(3);e.xp6(4),e.Oqu(t.agentInfo.website)}}function zt(r,l){if(1&r&&(e.TgZ(0,"div",26)(1,"div",27),e._uU(2,"Hotline:"),e.qZA(),e.TgZ(3,"div",28),e._uU(4),e.qZA()()),2&r){const t=e.oxw(3);e.xp6(4),e.Oqu(t.agentInfo.phone)}}function Wt(r,l){if(1&r&&(e.TgZ(0,"div",11)(1,"div",12)(2,"div"),e.YNc(3,jt,1,1,"img",13),e.YNc(4,Gt,6,0,"svg",14),e.qZA(),e.TgZ(5,"div",15)(6,"div",16),e._uU(7,"Ph\xf2ng v\xe9"),e.qZA(),e.TgZ(8,"div",17),e._uU(9),e.qZA()()(),e.TgZ(10,"div",18),e.YNc(11,$t,5,1,"div",19),e.YNc(12,Kt,5,1,"div",19),e.YNc(13,Vt,5,1,"div",19),e.YNc(14,zt,5,1,"div",19),e.qZA()()),2&r){const t=e.oxw(2);e.xp6(3),e.Q6J("ngIf",t.agentInfo.logoUrl),e.xp6(1),e.Q6J("ngIf",!t.agentInfo.logoUrl),e.xp6(5),e.Oqu(t.agentInfo.displayName),e.xp6(2),e.Q6J("ngIf",t.agentInfo.address),e.xp6(1),e.Q6J("ngIf",t.agentInfo.email),e.xp6(1),e.Q6J("ngIf",t.agentInfo.website),e.xp6(1),e.Q6J("ngIf",t.agentInfo.phone)}}function Xt(r,l){if(1&r&&(e.TgZ(0,"div",29)(1,"div",30)(2,"div",31),e._uU(3),e.qZA()(),e.TgZ(4,"div",32),e._uU(5),e.ALo(6,"date"),e.qZA()()),2&r){const t=e.oxw(2);e.xp6(3),e.AsE(" C\xe1c chuy\u1ebfn bay ch\u1eb7ng ",t.journey.startPointName," - ",t.journey.endPointName," "),e.xp6(2),e.hij(" ",e.xi3(6,3,t.journey.departDateQuotation,"EEEE, d MMMM, yyyy")," ")}}function ei(r,l){1&r&&(e.TgZ(0,"div",33)(1,"div",34),e._uU(2,"H\xe3ng bay"),e.qZA(),e.TgZ(3,"div",35),e._uU(4,"C\u1ea5t c\xe1nh"),e.qZA(),e.TgZ(5,"div",35),e._uU(6,"H\u1ea1 c\xe1nh"),e.qZA(),e.TgZ(7,"div",35),e._uU(8,"Chuy\u1ebfn bay"),e.qZA(),e.TgZ(9,"div",35),e._uU(10,"S\u1ed1 \u0111i\u1ec3m d\u1eebng"),e.qZA(),e.TgZ(11,"div",36),e._uU(12,"T\u1ed5ng chi ph\xed"),e.qZA()())}function ti(r,l){1&r&&(e.TgZ(0,"div",50),e._uU(1,"Bay th\u1eb3ng"),e.qZA())}function ii(r,l){if(1&r&&(e.TgZ(0,"div"),e._uU(1),e.TgZ(2,"span",51),e._uU(3,"\u0111i\u1ec3m d\u1eebng"),e.qZA()()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.hij("",t.stopStatus," ")}}function ai(r,l){if(1&r&&(e.TgZ(0,"div",52),e._uU(1),e.ALo(2,"number"),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.netPrice+t.surcharge)," \u0111 ")}}function ni(r,l){if(1&r&&(e.TgZ(0,"div",52),e._uU(1),e.ALo(2,"number"),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.totalPrice+t.surcharge)," \u0111 ")}}function ri(r,l){if(1&r&&(e.TgZ(0,"div",53),e._uU(1),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.AsE("",t.cabin," (",t.fareClass,")")}}function oi(r,l){if(1&r&&(e.TgZ(0,"div",54),e._UZ(1,"cf-icon",55),e.TgZ(2,"span"),e._uU(3),e.qZA()()),2&r){const t=e.oxw().$implicit;e.xp6(3),e.hij("Li\xean danh (do ",t.operatingName," \u0111i\u1ec1u h\xe0nh)")}}function si(r,l){if(1&r&&(e.TgZ(0,"div",37)(1,"div",38)(2,"div",39)(3,"div",40),e._UZ(4,"img",41)(5,"img",42),e.qZA(),e.TgZ(6,"div",43),e._uU(7),e.ALo(8,"date"),e.qZA(),e.TgZ(9,"div",43),e._uU(10),e.ALo(11,"date"),e.qZA(),e.TgZ(12,"div",43),e._uU(13),e.qZA(),e.TgZ(14,"div",43),e.YNc(15,ti,2,0,"div",44),e.YNc(16,ii,4,1,"div",45),e.qZA(),e.TgZ(17,"div",46),e.YNc(18,ai,3,3,"div",47),e.YNc(19,ni,3,3,"div",47),e.YNc(20,ri,2,2,"div",48),e.qZA()(),e.YNc(21,oi,4,1,"div",49),e.qZA()()),2&r){const t=l.$implicit,i=e.oxw(2);e.ekj("h-[64px]",!t.isJointBenture)("h-[88px]",t.isJointBenture),e.xp6(5),e.Q6J("src",t.airlineLogo,e.LSH),e.xp6(2),e.hij(" ",e.xi3(8,14,t.departure.localTime,"HH:mm")," "),e.xp6(3),e.hij(" ",e.xi3(11,17,t.arrival.localTime,"HH:mm")," "),e.xp6(3),e.hij(" ",t.flightNumber," "),e.xp6(2),e.Q6J("ngIf",0===t.stopStatus),e.xp6(1),e.Q6J("ngIf",0!==t.stopStatus),e.xp6(2),e.Q6J("ngIf",t.showNetPrice),e.xp6(1),e.Q6J("ngIf",!t.showNetPrice),e.xp6(1),e.Q6J("ngIf",!i.isHiddenCabin),e.xp6(1),e.Q6J("ngIf",t.isJointBenture)}}function li(r,l){if(1&r&&(e.TgZ(0,"div",5),e.YNc(1,Wt,15,7,"div",6),e.YNc(2,Xt,7,6,"div",7),e.YNc(3,ei,13,0,"div",8),e.YNc(4,si,22,20,"div",9),e._UZ(5,"div",10),e.qZA()),2&r){const t=l.listTicket,i=l.paddingBottomHeight,a=l.isShowHeader;e.xp6(1),e.Q6J("ngIf",a),e.xp6(1),e.Q6J("ngIf",a),e.xp6(1),e.Q6J("ngIf",a),e.xp6(1),e.Q6J("ngForOf",t),e.xp6(1),e.Udp("padding-bottom",i,"px")}}let ci=(()=>{class r{get listTicket(){return this._listTicket}set listTicket(t){this._listTicket=t,this.initImageListTicketGroup(),this.initPdfListTicketGroup()}constructor(t){this.listTicketGroup=[],this.listPdfTicketGroup=[],this.A4_HEIGHT=1063,this.A4_PADDING_BOTTOM=16,this.HEADER_HEIGHT=285,this.CONTENT_HEIGHT=this.A4_HEIGHT-this.HEADER_HEIGHT-this.A4_PADDING_BOTTOM,this.PDF_CONTENT_HEIGHT=this.A4_HEIGHT-2*this.A4_PADDING_BOTTOM,this.ONE_BASIC_TICKET_HEIGHT=64,this.ONE_BENTURE_TICKET_HEIGHT=88,t.registerIcons([C.B2I])}initImageListTicketGroup(){this.listTicketGroup=[];let t=0,i=[];this.listTicket.forEach(a=>{let n=0;n=a.isJointBenture?this.ONE_BENTURE_TICKET_HEIGHT:this.ONE_BASIC_TICKET_HEIGHT,t+n<=this.CONTENT_HEIGHT?(i.push(a),t+=n):(this.listTicketGroup.push({listTicket:i.map(s=>s),paddingBottomHeight:this.CONTENT_HEIGHT-t,isShowHeader:!0}),i=[],t=n,i.push(a))}),i.length>0&&this.listTicketGroup.push({listTicket:i.map(a=>a),paddingBottomHeight:this.CONTENT_HEIGHT-t,isShowHeader:!0}),this.listTicketGroup.forEach(a=>{let n=301;a.listTicket.forEach(s=>{n+=s.isJointBenture?this.ONE_BENTURE_TICKET_HEIGHT:this.ONE_BASIC_TICKET_HEIGHT})})}initPdfListTicketGroup(){this.listPdfTicketGroup=[];let t=0,i=[];this.listTicket.forEach(a=>{let n=0;n=a.isJointBenture?this.ONE_BENTURE_TICKET_HEIGHT:this.ONE_BASIC_TICKET_HEIGHT,t+n<=(0==this.listPdfTicketGroup.length?this.CONTENT_HEIGHT:this.PDF_CONTENT_HEIGHT)?(i.push(a),t+=n):(this.listPdfTicketGroup.push({listTicket:i.map(s=>s),paddingBottomHeight:(0==this.listPdfTicketGroup.length?this.CONTENT_HEIGHT:this.PDF_CONTENT_HEIGHT)-t,isShowHeader:0==this.listPdfTicketGroup.length}),i=[],t=n,i.push(a))}),i.length>0&&this.listPdfTicketGroup.push({listTicket:i.map(a=>a),paddingBottomHeight:(0==this.listPdfTicketGroup.length?this.CONTENT_HEIGHT:this.PDF_CONTENT_HEIGHT)-t,isShowHeader:0==this.listPdfTicketGroup.length}),this.listPdfTicketGroup.forEach((a,n)=>{let s=0===n?301:32;a.listTicket.forEach(o=>{s+=o.isJointBenture?this.ONE_BENTURE_TICKET_HEIGHT:this.ONE_BASIC_TICKET_HEIGHT})})}getChildNodes(){}getNativeElement(){return this.quotationGraphic}getPDFNativeElement(){return this.quotationGraphicPDF}}return r.\u0275fac=function(t){return new(t||r)(e.Y36(C.KNP))},r.\u0275cmp=e.Xpm({type:r,selectors:[["cf-quotation-graphic"]],viewQuery:function(t,i){if(1&t&&(e.Gf(Jt,5),e.Gf(Ut,5)),2&t){let a;e.iGM(a=e.CRH())&&(i.quotationGraphic=a),e.iGM(a=e.CRH())&&(i.quotationGraphicPDF=a)}},inputs:{listTicket:"listTicket",journey:"journey",agentInfo:"agentInfo",isHiddenCabin:"isHiddenCabin",cabinName:"cabinName"},standalone:!0,features:[e.jDz],decls:6,vars:2,consts:[[4,"ngFor","ngForOf"],["quotationTemplate",""],["quotationGraphic",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["quotationGraphicPDF",""],[1,"w-[752px]","bg-neutral-white","p-4","!whitespace-nowrap"],["class","w-full p-4 rounded bg-gradient-to-r from-[#013f51] from-10% via-[#006885] via-30% to-[#006885] to-90% flex items-center gap-x-8 mb-6 h-[132px]",4,"ngIf"],["class","w-full rounded-tl-lg rounded-tr-lg border border-b-0 border-neutral-gray-1 p-4",4,"ngIf"],["class","flex gap-x-[1px]",4,"ngIf"],["class","w-full last:rounded-bl-lg last:rounded-br-lg",3,"h-[64px]","h-[88px]",4,"ngFor","ngForOf"],[1,"w-full"],[1,"w-full","p-4","rounded","bg-gradient-to-r","from-[#013f51]","from-10%","via-[#006885]","via-30%","to-[#006885]","to-90%","flex","items-center","gap-x-8","mb-6","h-[132px]"],[1,"flex","items-center","gap-x-3"],["class","w-10 h-10 object-cover rounded-full",3,"src",4,"ngIf"],["width","32","height","20","viewBox","0 0 32 20","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],[1,"flex","flex-col","gap-y-1","text-white"],[1,"text-body-sm","opacity-80"],[1,"text-heading-xs"],[1,"flex","flex-col","gap-y-1"],["class","flex gap-x-3",4,"ngIf"],[1,"w-10","h-10","object-cover","rounded-full",3,"src"],["width","32","height","20","viewBox","0 0 32 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M19.7391 0H22.0007H31.3757C31.9958 0 32.1782 0.406859 31.8134 0.924681C31.8134 0.924681 30.3543 2.84802 29.0775 4.21654C27.6549 5.69603 25.5391 7.43443 25.5391 7.43443C25.0649 7.84129 24.153 8.17418 23.5328 8.17418H21.9643H19.7026H12.4069H10.1453H0.770366C0.150235 8.17418 -0.0321566 7.76732 0.332627 7.2495C0.332627 7.2495 1.79176 5.32616 3.0685 3.95763C4.49115 2.47814 6.60689 0.739744 6.60689 0.739744C7.08111 0.332885 7.99307 0 8.6132 0H10.1818H12.4434H19.7391ZM19.5931 11.8258H21.8548H31.2297C31.8498 11.8258 32.0322 12.2327 31.6674 12.7505C31.6674 12.7505 30.2083 14.6739 28.9316 16.0424C27.5089 17.5219 25.3932 19.2603 25.3932 19.2603C24.919 19.6671 24.007 20 23.3869 20H21.8183H19.5566H12.261H9.99933H0.624402C0.0042704 20 -0.178121 19.5932 0.186662 19.0753C0.186662 19.0753 1.64579 17.152 2.92254 15.7835C4.34519 14.304 6.46093 12.5656 6.46093 12.5656C6.93515 12.1587 7.84711 11.8258 8.46724 11.8258H10.0358H12.2975H19.5931Z","fill","url(#paint0_linear_1633_21678)"],["id","paint0_linear_1633_21678","x1","16","y1","-4.91341e-07","x2","26.3657","y2","20.0517","gradientUnits","userSpaceOnUse"],["stop-color","#E03C31"],["offset","1","stop-color","#F6C543"],[1,"flex","gap-x-3"],[1,"w-[55px]","text-neutral-gray-1","text-espressive-md"],[1,"text-white","text-body-md","whitespace-nowrap"],[1,"w-full","rounded-tl-lg","rounded-tr-lg","border","border-b-0","border-neutral-gray-1","p-4"],[1,"flex","items-center","gap-x-4"],[1,"text-heading-sm","text-neutral-gray-6"],[1,"text-body-sm","text-secondary-3-4"],[1,"flex","gap-x-[1px]"],[1,"w-[88px]","bg-neutral-gray-2","text-express-sm","text-center","py-3"],[1,"w-[104px]","bg-neutral-gray-2","text-express-sm","text-center","py-3"],[1,"flex-1","bg-neutral-gray-2","text-express-sm","text-right","py-3","pr-3"],[1,"w-full","last:rounded-bl-lg","last:rounded-br-lg"],[1,"border","border-neutral-gray-1","border-t-0"],[1,"flex"],[1,"w-[88px]","flex","justify-center","py-4"],["src","data:image/svg+xml",1,"hidden"],[1,"h-8","w-16","object-contain",3,"src"],[1,"w-[104px]","flex","justify-center","items-center","text-heading-sm","text-center","py-4"],["class","",4,"ngIf"],[4,"ngIf"],[1,"text-right","flex-1","flex","flex-col","justify-center","py-4","pr-3"],["class","text-heading-sm",4,"ngIf"],["class","text-express-sm text-neutral-gray-6",4,"ngIf"],["class","pb-2 px-3 text-body-sm text-neutral-gray-4 flex items-center gap-x-2",4,"ngIf"],[1,""],[1,"text-express-sm","text-neutral-gray-4"],[1,"text-heading-sm"],[1,"text-express-sm","text-neutral-gray-6"],[1,"pb-2","px-3","text-body-sm","text-neutral-gray-4","flex","items-center","gap-x-2"],["icon","circle_information","size","small"]],template:function(t,i){1&t&&(e.TgZ(0,"div"),e.YNc(1,Yt,3,6,"div",0),e.qZA(),e.TgZ(2,"div"),e.YNc(3,qt,3,6,"div",0),e.qZA(),e.YNc(4,li,6,6,"ng-template",null,1,e.W1O)),2&t&&(e.xp6(1),e.Q6J("ngForOf",i.listTicketGroup),e.xp6(2),e.Q6J("ngForOf",i.listPdfTicketGroup))},dependencies:[S.ez,S.sg,S.O5,S.tP,S.JJ,S.uU,C.AxE,C.Sm8],encapsulation:2,changeDetection:0}),r})();var ui=_(64425),di=_(80529),nt=_(9381),hi=_(2225),gi=_(50223);const pi=["quotationGraphicRef"];function mi(r,l){if(1&r&&e._UZ(0,"img",81),2&r){const t=e.oxw();e.Q6J("src",t.agentInfo.logoUrl,e.LSH)}}function fi(r,l){1&r&&(e.O4$(),e.TgZ(0,"svg",82),e._UZ(1,"path",83),e.TgZ(2,"defs")(3,"linearGradient",84),e._UZ(4,"stop",85)(5,"stop",86),e.qZA()()())}function _i(r,l){if(1&r&&(e.TgZ(0,"div",87)(1,"div",88),e._uU(2,"\u0110\u1ecba ch\u1ec9:"),e.qZA(),e.TgZ(3,"div",89),e._uU(4),e.qZA()()),2&r){const t=e.oxw();e.xp6(4),e.Oqu(t.agentInfo.address)}}function vi(r,l){if(1&r&&(e.TgZ(0,"div",87)(1,"div",88),e._uU(2,"Email:"),e.qZA(),e.TgZ(3,"div",89),e._uU(4),e.qZA()()),2&r){const t=e.oxw();e.xp6(4),e.Oqu(t.agentInfo.email)}}function Ti(r,l){if(1&r&&(e.TgZ(0,"div",87)(1,"div",88),e._uU(2,"Website:"),e.qZA(),e.TgZ(3,"div",89),e._uU(4),e.qZA()()),2&r){const t=e.oxw();e.xp6(4),e.Oqu(t.agentInfo.website)}}function yi(r,l){if(1&r&&(e.TgZ(0,"div",87)(1,"div",88),e._uU(2,"Hotline:"),e.qZA(),e.TgZ(3,"div",89),e._uU(4),e.qZA()()),2&r){const t=e.oxw();e.xp6(4),e.Oqu(t.agentInfo.phone)}}function Ci(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"button",90),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.onEditHeader())}),e._UZ(1,"cf-icon",91),e._uU(2," Ch\u1ec9nh s\u1eeda "),e.qZA()}}function bi(r,l){1&r&&(e.TgZ(0,"div",103),e._uU(1,"Bay th\u1eb3ng"),e.qZA())}function Si(r,l){if(1&r&&(e.TgZ(0,"div"),e._uU(1),e.TgZ(2,"span",104),e._uU(3,"\u0111i\u1ec3m d\u1eebng"),e.qZA()()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.hij("",t.stopStatus," ")}}function xi(r,l){if(1&r&&(e.TgZ(0,"div",105),e._uU(1),e.ALo(2,"number"),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.netPrice+(t.surcharge||0))," \u0111 ")}}function Di(r,l){if(1&r&&(e.TgZ(0,"div",105),e._uU(1),e.ALo(2,"number"),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.totalPrice+(t.surcharge||0))," \u0111 ")}}function Fi(r,l){if(1&r&&(e.TgZ(0,"div",106),e._uU(1),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.AsE(" ",t.cabin," (",t.fareClass,") ")}}function ki(r,l){if(1&r&&(e.TgZ(0,"tr",107)(1,"td",108)(2,"div",109),e._UZ(3,"cf-icon",9),e._uU(4),e.qZA()()()),2&r){const t=e.oxw().$implicit;e.xp6(4),e.hij(" Li\xean danh (do ",t.operatingName," \u0111i\u1ec1u h\xe0nh) ")}}const Pi=function(r){return{"border-b border-neutral-gray-1":r}};function Ii(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"tr",92)(1,"td",93)(2,"cf-checkbox",34),e.NdJ("checkChange",function(a){const s=e.CHM(t).$implicit,o=e.oxw();return e.KtG(o.onSelectedTicket(s,a))}),e.qZA()(),e.TgZ(3,"td",93),e._UZ(4,"img",94),e.qZA(),e.TgZ(5,"td",95)(6,"div",96),e._uU(7),e.ALo(8,"date"),e.qZA()(),e.TgZ(9,"td",95)(10,"div",96),e._uU(11),e.ALo(12,"date"),e.qZA()(),e.TgZ(13,"td",97),e._uU(14),e.qZA(),e.TgZ(15,"td",97),e.YNc(16,bi,2,0,"div",98),e.YNc(17,Si,4,1,"div",44),e.qZA(),e.TgZ(18,"td",99)(19,"div",66),e.YNc(20,xi,3,3,"div",100),e.YNc(21,Di,3,3,"div",100),e.YNc(22,Fi,2,2,"div",101),e.qZA()()(),e.YNc(23,ki,5,1,"tr",102)}if(2&r){const t=l.$implicit,i=e.oxw();e.Q6J("ngClass",e.VKq(18,Pi,!t.isJointBenture)),e.xp6(2),e.Q6J("checked",t.selected),e.xp6(2),e.Q6J("src","assets/airline-logo/"+t.airline+".png",e.LSH),e.xp6(3),e.hij(" ",e.xi3(8,12,t.departure.localTime,"HH:mm")," "),e.xp6(4),e.hij(" ",e.xi3(12,15,t.arrival.localTime,"HH:mm")," "),e.xp6(3),e.hij(" ",t.flightNumber," "),e.xp6(2),e.Q6J("ngIf",0===t.stopStatus),e.xp6(1),e.Q6J("ngIf",0!==t.stopStatus),e.xp6(3),e.Q6J("ngIf",t.showNetPrice),e.xp6(1),e.Q6J("ngIf",!t.showNetPrice),e.xp6(1),e.Q6J("ngIf",!i.isHiddenCabin),e.xp6(1),e.Q6J("ngIf",t.isJointBenture)}}function Ei(r,l){1&r&&e._UZ(0,"cf-spinner")}function Ai(r,l){if(1&r&&e._UZ(0,"img",81),2&r){const t=e.oxw();e.Q6J("src",t.agentInfo.logoUrl,e.LSH)}}function Ni(r,l){1&r&&(e.O4$(),e.TgZ(0,"svg",110),e._UZ(1,"path",111),e.TgZ(2,"defs")(3,"linearGradient",112),e._UZ(4,"stop",85)(5,"stop",86),e.qZA()()())}function wi(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",113),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.onEditHeaderMobile())}),e._UZ(1,"cf-icon",114),e.TgZ(2,"div",115),e._uU(3," Ch\u1ec9nh s\u1eeda "),e.qZA()()}}function Zi(r,l){1&r&&(e.TgZ(0,"div",116),e._uU(1," \u0110\u1ecba ch\u1ec9: "),e.qZA())}function Mi(r,l){1&r&&(e.TgZ(0,"div",116),e._uU(1," Email: "),e.qZA())}function Ri(r,l){1&r&&(e.TgZ(0,"div",116),e._uU(1," Website: "),e.qZA())}function Bi(r,l){1&r&&(e.TgZ(0,"div",116),e._uU(1," Hotline: "),e.qZA())}function Li(r,l){if(1&r&&(e.TgZ(0,"div",117),e._uU(1),e.qZA()),2&r){const t=e.oxw();e.xp6(1),e.hij(" ",t.agentInfo.address," ")}}function Hi(r,l){if(1&r&&(e.TgZ(0,"div",118),e._uU(1),e.qZA()),2&r){const t=e.oxw();e.xp6(1),e.hij(" ",t.agentInfo.email," ")}}function Qi(r,l){if(1&r&&(e.TgZ(0,"div",118),e._uU(1),e.qZA()),2&r){const t=e.oxw();e.xp6(1),e.hij(" ",t.agentInfo.website," ")}}function Oi(r,l){if(1&r&&(e.TgZ(0,"div",118),e._uU(1),e.qZA()),2&r){const t=e.oxw();e.xp6(1),e.hij(" ",t.agentInfo.phone," ")}}function Ji(r,l){1&r&&(e.TgZ(0,"div",128),e._uU(1,"Bay th\u1eb3ng"),e.qZA())}function Ui(r,l){if(1&r&&(e.TgZ(0,"div",128),e._uU(1),e.qZA()),2&r){const t=e.oxw(2).$implicit;e.xp6(1),e.hij(" ",t.stopStatus," \u0111i\u1ec3m d\u1eebng")}}function Yi(r,l){if(1&r&&(e.TgZ(0,"div",144),e._UZ(1,"cf-icon",145),e.TgZ(2,"div",146),e._uU(3),e.qZA()()),2&r){const t=e.oxw(2).$implicit;e.xp6(3),e.hij(" Li\xean danh (do ",t.operatingName," \u0111i\u1ec1u h\xe0nh) ")}}function qi(r,l){if(1&r&&(e.TgZ(0,"div",147),e._uU(1),e.ALo(2,"replace"),e.ALo(3,"number"),e.qZA()),2&r){const t=e.oxw(2).$implicit;e.xp6(1),e.hij(" ",e.Dn7(2,1,e.lcZ(3,5,t.promotionalPrice),",",".")," \u0111")}}function ji(r,l){if(1&r&&(e.TgZ(0,"div",148),e._uU(1),e.ALo(2,"number"),e.qZA()),2&r){const t=e.oxw(2).$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.netPrice+(t.surcharge||0))," \u0111")}}function Gi(r,l){if(1&r&&(e.TgZ(0,"div",148),e._uU(1),e.ALo(2,"number"),e.qZA()),2&r){const t=e.oxw(2).$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.totalPrice+(t.surcharge||0))," \u0111")}}function $i(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",120)(1,"div",121)(2,"div",122)(3,"div",123),e._UZ(4,"img",124),e.TgZ(5,"div",125)(6,"div",126)(7,"div",127),e._uU(8),e.ALo(9,"date"),e.qZA(),e.TgZ(10,"div",128),e._uU(11),e.qZA()(),e.TgZ(12,"div",129)(13,"div",128),e._uU(14),e.qZA(),e.TgZ(15,"div",130),e._UZ(16,"div",131)(17,"div",132),e.qZA(),e.YNc(18,Ji,2,0,"div",133),e.YNc(19,Ui,2,1,"div",133),e.qZA(),e.TgZ(20,"div",126)(21,"div",127),e._uU(22),e.ALo(23,"date"),e.qZA(),e.TgZ(24,"div",128),e._uU(25),e.qZA()()()(),e.TgZ(26,"div",134)(27,"div",135),e._uU(28),e.qZA(),e._UZ(29,"div",136),e.TgZ(30,"div",137),e._uU(31),e.qZA()(),e.YNc(32,Yi,4,1,"div",138),e.qZA(),e.TgZ(33,"div",139)(34,"div",140)(35,"cf-checkbox",141),e.NdJ("checkChange",function(a){e.CHM(t);const n=e.oxw().$implicit,s=e.oxw();return e.KtG(s.onSelectedTicket(n,a))}),e.qZA(),e.YNc(36,qi,4,7,"div",142),e.YNc(37,ji,3,3,"div",143),e.YNc(38,Gi,3,3,"div",143),e.qZA()()()()}if(2&r){const t=e.oxw().$implicit;e.xp6(4),e.Q6J("src",t.mobileAirlineLogo,e.LSH),e.xp6(4),e.Oqu(e.xi3(9,16,t.startTime,"HH:mm")),e.xp6(3),e.Oqu(t.startPoint),e.xp6(3),e.Oqu(t.durationStr),e.xp6(4),e.Q6J("ngIf",0===t.stopStatus),e.xp6(1),e.Q6J("ngIf",t.stopStatus>0),e.xp6(3),e.Oqu(e.xi3(23,19,t.endTime,"HH:mm")),e.xp6(3),e.Oqu(t.endPoint),e.xp6(3),e.Oqu(t.operatingName),e.xp6(3),e.AsE("",t.cabinName," (",t.fareClass,") "),e.xp6(1),e.Q6J("ngIf",t.isJointBenture),e.xp6(3),e.Q6J("checked",t.selected),e.xp6(1),e.Q6J("ngIf",t.promotionalPrice),e.xp6(1),e.Q6J("ngIf",t.showNetPrice),e.xp6(1),e.Q6J("ngIf",!t.showNetPrice)}}function Ki(r,l){if(1&r&&(e.ynx(0),e.YNc(1,$i,39,22,"div",119),e.BQk()),2&r){const t=l.index,i=e.oxw();e.xp6(1),e.Q6J("ngIf",t<i.ticketInfiniteScrollCount)}}function Vi(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",149)(1,"cf-radio-group",150),e.NdJ("ngModelChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.formatType=a)}),e.TgZ(2,"cf-radio",41),e._uU(3,"PDF"),e.qZA(),e.TgZ(4,"cf-radio",41),e._uU(5,"\u1ea2nh JPEG"),e.qZA(),e.TgZ(6,"cf-radio",41),e._uU(7,"SMS"),e.qZA()(),e.TgZ(8,"button",151),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(),n=e.MAs(130),s=e.MAs(132);return e.KtG(a.onMobileShare(n,s))}),e._uU(9,"X\xe1c nh\u1eadn"),e.qZA()()}if(2&r){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.formatType),e.xp6(1),e.Q6J("value","PDF"),e.xp6(2),e.Q6J("value","JPEG"),e.xp6(2),e.Q6J("value","SMS")}}function zi(r,l){1&r&&(e.TgZ(0,"div",154),e._uU(1,"L\u01b0u \xfd: Gi\u1edbi h\u1ea1n xu\u1ea5t h\xecnh l\xe0 10 h\xecnh"),e.qZA())}function Wi(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",149)(1,"div",152),e._uU(2,"\u0110\xe3 x\u1eed l\xfd b\xe1o gi\xe1 th\xe0nh c\xf4ng"),e.qZA(),e.YNc(3,zi,2,0,"div",153),e.TgZ(4,"button",151),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.webShareCall())}),e._uU(5,"Chia s\u1ebb"),e.qZA()()}if(2&r){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.isLimitImage)}}function Xi(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",149)(1,"div",152),e._uU(2,"\u0110\xe3 x\u1eed l\xfd b\xe1o gi\xe1 th\xe0nh c\xf4ng"),e.qZA(),e.TgZ(3,"button",151),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.webSharePDFCall())}),e._uU(4,"Chia s\u1ebb"),e.qZA()()}}function ea(r,l){if(1&r&&(e.TgZ(0,"div",155),e._UZ(1,"cf-progress",156),e.qZA()),2&r){const t=e.oxw();e.xp6(1),e.Q6J("text","\u0110ang x\u1eed l\xfd")("percent",t.progressPercent)}}let Fe=(()=>{class r{constructor(t,i,a,n,s,o,c,d,u,h,g,p,T){var v;this.ref=i,this.bottomSheetData=a,this._bottomSheetService=n,this.clipboard=s,this.http=o,this._modal=c,this._toastService=d,this._mobileDetectService=u,this._generalService=h,this._permissionService=g,this._userService=p,this._urlToBase64=T,this.listTicket=[],this.listTicketSelected=[],this.listTicketSelectedLength=0,this.setOfChecked=new Set,this.formatType="JPEG",this.isDowloading=!1,this.isMobileDownloading=!1,this.isCopied=!1,this.pageSize=25,this.pageSizeList=[{num:25},{num:50},{num:70},{num:100}],this.checked=!0,this.agentInfo={address:"193/25 Nguy\u1ec5n \u0110\xecnh Ch\xednh, P.11, Q.Ph\xfa Nhu\u1eadn, TP.HCM",email:"[email protected]",website:"https://giacmobayre.vn",phone:"0915522425",phoneArea:"+84",displayName:"Gi\u1ea5c m\u01a1 bay r\u1ebb",logoUrl:"",footerAttention:""},this.isHiddenCabin=!1,this.isHiddenNetPrice=!1,this.isLoadBookingFace=this._permissionService.hasPermission(R.or.ViewInfoBookingFaceConfig),this.isLoadSurchargeFee=this._permissionService.hasPermission(R.or.ViewSurchargeFeeConfig),this.surchargeConfigs=[],this.listTicketDisplay=[],this.images=[],this.canvas=[],this.isLimitImage=!pt,this.progressImageMap=new Map,this.PROGRESS_DEFAULT=10,this.progressTotal=0,this.progressCurrent=0,this.progressPercent=this.PROGRESS_DEFAULT,this.sortChange=(b,k)=>this.listTicket,this.searchChange=(b,k)=>this.listTicket,this.TICKET_INFINITE_SCROLL_DEFAULT=10,this.TICKET_INFINITE_OFSET_INCREASE=10,this.ticketInfiniteScrollCount=this.TICKET_INFINITE_SCROLL_DEFAULT,t.registerIcons([C.UNF,C.B2I,C.oFb,C.Rcu,C.iYu]),this.listTicketDisplay=i?i.data.listTicketDisplay:a.listTicketDisplay,this.surcharges=[];let y=new Map;this.listTicketDisplay.forEach(b=>{["GDS","BSP","AIR_1G"].includes(b.provider)?y.set("GDS",{airline:"GDS",logo:"assets/icons/airline-default.svg",operatingName:b.operatingName,surchargePrice:0}):y.set(b.provider,{airline:b.provider,logo:b.airlineLogo,operatingName:b.operatingName,surchargePrice:0})}),this.surcharges=[...y.values()];const D=localStorage.getItem("agentInfoConfig");D&&(this.agentInfo=JSON.parse(D));const F=localStorage.getItem("surchargeConfigs");F&&"undefined"!==F&&(this.surchargeConfigs=JSON.parse(F)),this.surcharges.forEach(b=>{let k;k=["GDS","BSP","AIR_1G"].includes(b.airline)?this.surchargeConfigs.find(f=>"GDS"===f.airline):this.surchargeConfigs.find(f=>f.airline===b.airline),k&&(b.surchargePrice=k.amount)}),this.listTicket=this.listTicketDisplay.filter(b=>b.segments.length).map(b=>{let k;return k=["GDS","BSP","AIR_1G"].includes(b.provider)?this.surchargeConfigs.find(f=>"GDS"===f.airline):this.surchargeConfigs.find(f=>f.airline===b.provider),Object.assign(Object.assign({},b),{surcharge:k?k.amount:0,isJointBenture:!["VN","QH","VJ","VU"].includes(b.operating),selected:!0})}),this.listTicketSelectedLength=this.listTicket.length,this.isLoadBookingFace&&this.getAgentInfo(),this.isLoadSurchargeFee&&this.getSurchargeFeeConfig(),this.journey=i?i.data.journey:a.journey,this.currentLeg=i?i.data.currentLeg:a.currentLeg,this.canEditHeader=i?i.data.canEditHeader:a.canEditHeader,this.isHiddenNetPrice=i?i.data.isHiddenNetPrice:a.isHiddenNetPrice,this.isHiddenCabin=i?i.data.isHiddenCabin:a.isHiddenCabin,this.currentUser=JSON.parse(null!==(v=localStorage.getItem("currentUser"))&&void 0!==v?v:"").data,this.updateListTicketSelected(),this.fileName=`baogia_${this.journey.startPoint}-${this.journey.endPoint}_${(0,S.p6)(this.journey.departDateQuotation,"ddMMyyyy","vi-VN")}`}optimizeAirlineLogo(){const t=new Map,i=this.listTicket.map(n=>({airline:n.airline,logo:`assets/airline-logo/${n.airline}_xsmall.png`})).filter((n,s,o)=>o.findIndex(c=>c.airline===n.airline)===s),a=i.map(n=>Be("/"+n.logo,Qe(n.logo),{}));(0,De.D)(a).subscribe({next:n=>{for(let s=0;s<i.length;s++)t.set(i[s].airline,n[s]);this.listTicket.forEach(s=>{s.airlineLogoBase64=t.get(s.airline),s.airlineLogoBase64||(s.airlineLogoBase64=s.airlineLogo)})}})}getAgentInfo(){this._generalService.getBookingFaceConfig({sourceFlow:"SEARCH",bookingCode:""}).subscribe({next:i=>{i.success&&i.data&&(this.agentInfo=Object.assign({},i.data),(0,Ke.t)(i.data,this.agentInfo)||localStorage.setItem("agentInfoConfig",JSON.stringify(this.agentInfo)),this.agentInfo.logoUrl&&this._urlToBase64.urlToBase64(`${this.agentInfo.logoUrl}?${(new Date).getTime()}`).subscribe(a=>{this.agentInfo.logoUrl=a},a=>{console.error("Error:",a)}))}})}getSurchargeFeeConfig(){this._generalService.getSurchargeFeeConfig().subscribe({next:t=>{t.success&&t.data&&((0,Ke.t)(t.data,this.surchargeConfigs)||(localStorage.setItem("surchargeConfigs",JSON.stringify(t.data)),this.surchargeConfigs=t.data,this.surcharges.forEach(i=>{const a=this.surchargeConfigs.find(n=>n.airline===i.airline);a&&(i.surchargePrice=a.amount)}),this.listTicket.forEach(i=>{const a=this.surchargeConfigs.find(n=>n.airline===i.provider);i.surcharge=a?a.amount:0})))}})}allCheckSet(t){this.listTicket.forEach(i=>{i.selected=t}),this.updateListTicketSelected()}onClose(){this.ref.close(!1)}onSelectedTicket(t,i){t.selected=i,this.updateListTicketSelected()}updateListTicketSelected(){this.listTicketSelectedLength=this.listTicket.filter(t=>t.selected).length||0,this.checked=!this.listTicket.some(t=>!t.selected)}onFormatChange(t){this.formatType=t}onShare(t,i){if(this.listTicketSelected=this.listTicket.filter(a=>a.selected),this.listTicketSelected.length)switch(this.formatType){case"PDF":const a=this.quotationGraphicRef.getPDFNativeElement();this.exportPdf(a,i);break;case"JPEG":const n=this.quotationGraphicRef.getNativeElement();this.exportJpeg(n,t);break;case"SMS":this.exportSms()}else this._toastService.add({severity:"error",summary:"Th\u1ea5t b\u1ea1i",detail:"C\u1ea7n ch\u1ecdn \xedt nh\u1ea5t 1 chuy\u1ebfn bay \u0111\u1ec3 chia s\u1ebb.",sticky:!0})}onMobileOk(t){if(this.listTicketSelected=this.listTicket.filter(a=>a.selected),!this.listTicketSelected.length)return void this._toastService.add({severity:"error",summary:"Th\u1ea5t b\u1ea1i",detail:"C\u1ea7n ch\u1ecdn \xedt nh\u1ea5t 1 chuy\u1ebfn bay \u0111\u1ec3 chia s\u1ebb.",sticky:!0});const i=this._bottomSheetService.open(t,{headerTitle:"Ch\u1ecdn form chia s\u1ebb",rightButtonIcon:"close",rightButtonIconClass:"text-neutral-gray-4",leftButtonIcon:""});i.containerInstance._rightButtonClick.subscribe(a=>i.dismiss())}onMobileShare(t,i){this._bottomSheetService.dismiss(),this.onShare(t,i)}webShareCall(){(0,W.D)(navigator.share({files:this.isLimitImage?this.images.filter((t,i)=>i<=9):this.images})).subscribe({next:t=>console.log(t),error:t=>console.log(t)})}webSharePDFCall(){console.log(this.pdf.type),(0,W.D)(navigator.share({files:[this.pdf]})).subscribe({next:t=>console.log(t),error:t=>console.log(t)})}exportJpeg(t,i){var a=this;this._mobileDetectService.isMobile()?this.isMobileDownloading=!0:this.isDowloading=!0,setTimeout(()=>{const n=this._mobileDetectService.mobileSubject.value?.8:1,s=[];var o;(0,W.D)($e(t.first.nativeElement,{includeFontSrc:["Roboto-Medium.ttf","Lexend.ttf","Roboto-Regular.ttf"]})).subscribe({next:(o=(0,B.Z)(function*(c){t.forEach((d,u)=>{s.push((0,We.P)(()=>(0,ze.C0)(d.nativeElement,{width:752,height:1063,scale:n,font:{cssText:c},progress:(h,g)=>{a.caculateProgress(u,h,g,t.length)}})))}),(0,De.D)(s).subscribe({next:d=>{if(a.resetProgress(),a._mobileDetectService.mobileSubject.value)if(a.images=d.map((u,h)=>new File([u],`${a.fileName}${h}.png`,{type:u.type})),navigator.canShare)if(navigator.canShare({files:a.images})){const u=a._bottomSheetService.open(i,{headerTitle:"Chia s\u1ebb"});u.containerInstance._rightButtonClick.subscribe(h=>u.dismiss())}else a.saveZip(d);else a.saveZip(d);else 1===d.length?Ve.saveAs(d[0],`${a.fileName}.jpeg`):a.saveZip(d);a._toastService.add({severity:"success",summary:"Th\xe0nh c\xf4ng",detail:"T\u1ea1o file b\xe1o gi\xe1 th\xe0nh c\xf4ng. Vui l\xf2ng ki\u1ec3m tra k\u1ebft qu\u1ea3.",sticky:!1}),a._mobileDetectService.isMobile()?a.isMobileDownloading=!1:a.isDowloading=!1,a.ref&&a.onClose()},error:d=>{a.resetProgress(),a._mobileDetectService.isMobile()?a.isMobileDownloading=!1:a.isDowloading=!1,a._toastService.add({severity:"error",summary:"Th\u1ea5t b\u1ea1i",detail:"T\u1ea1o file b\xe1o gi\xe1 th\u1ea5t b\u1ea1i. Vui l\xf2ng th\u1eed l\u1ea1i.",sticky:!0}),a.ref&&a.onClose()}})}),function(d){return o.apply(this,arguments)})})})}caculateProgress(t,i,a,n){if(this.progressImageMap.set(t,{current:i,total:a}),this.progressImageMap.size===n){this.progressTotal=0,this.progressCurrent=0,this.progressImageMap.forEach(o=>this.progressCurrent+=o.current),this.progressImageMap.forEach(o=>this.progressTotal+=o.total);const s=Math.floor(this.progressCurrent/this.progressTotal*100);s>this.PROGRESS_DEFAULT&&(this.progressPercent=s)}}resetProgress(){this.progressTotal=0,this.progressCurrent=0,this.progressPercent=this.PROGRESS_DEFAULT,this.progressImageMap.clear()}exportPdf(t,i){var a=this;this._mobileDetectService.isMobile()?this.isMobileDownloading=!0:this.isDowloading=!0,setTimeout(()=>{const s=[];var o;(0,W.D)($e(t.first.nativeElement,{includeFontSrc:["Roboto-Medium.ttf","Lexend.ttf","Roboto-Regular.ttf"]})).subscribe({next:(o=(0,B.Z)(function*(c){t.forEach((d,u)=>{s.push((0,We.P)(()=>(0,ze.E_)(d.nativeElement,{width:752,height:1063,scale:1,font:{cssText:c},progress:(h,g)=>{a.caculateProgress(u,h,g,t.length)}})))}),(0,De.D)(s).subscribe({next:d=>{a.resetProgress();const u=new Rt.ZP({orientation:"portrait",unit:"px",format:[752,1*a.quotationGraphicRef.A4_HEIGHT],compress:!0});if(d.forEach(function(){var h=(0,B.Z)(function*(g,p){u.addImage(g,"PNG",0,0,752,1*a.quotationGraphicRef.A4_HEIGHT,"","FAST"),p!==d.length-1&&u.addPage()});return function(g,p){return h.apply(this,arguments)}}()),a._mobileDetectService.mobileSubject.value){const h=u.output("blob");if(a.pdf=new File([h],`${a.fileName}.pdf`,{type:h.type}),navigator.canShare)if(navigator.canShare({files:[a.pdf]})){const g=a._bottomSheetService.open(i,{headerTitle:"Chia s\u1ebb"});g.containerInstance._rightButtonClick.subscribe(p=>g.dismiss())}else u.save(`${a.fileName}.pdf`);else u.save(`${a.fileName}.pdf`)}else u.save(`${a.fileName}.pdf`);a._toastService.add({severity:"success",summary:"Th\xe0nh c\xf4ng",detail:"T\u1ea1o file b\xe1o gi\xe1 th\xe0nh c\xf4ng. Vui l\xf2ng ki\u1ec3m tra k\u1ebft qu\u1ea3.",sticky:!1}),a._mobileDetectService.isMobile()?a.isMobileDownloading=!1:a.isDowloading=!1,a.ref&&a.onClose()},error:d=>{a.resetProgress(),a._mobileDetectService.isMobile()?a.isMobileDownloading=!1:a.isDowloading=!1,a._toastService.add({severity:"error",summary:"Th\u1ea5t b\u1ea1i",detail:"T\u1ea1o file b\xe1o gi\xe1 th\u1ea5t b\u1ea1i. Vui l\xf2ng th\u1eed l\u1ea1i.",sticky:!0})}})}),function(d){return o.apply(this,arguments)})})})}exportSms(){const t=this.proccessingSmsData();this.clipboard.copy(t),this._toastService.add({severity:"success",summary:"Th\xe0nh c\xf4ng",detail:"\u0110\xe3 copy th\xf4ng tin b\xe1o gi\xe1 th\xe0nh c\xf4ng.",sticky:!1})}proccessingSmsData(){const t={startPoint:this.journey.startPoint,startPointName:this.journey.startPointName,endPoint:this.journey.endPoint,endPointName:this.journey.endPointName,departDate:this.journey.departDate,flightOptions:this.listTicketSelected.map(a=>({flightNumber:a.segments.map(n=>n.airline+n.flightNumber).join(" -> "),departureTime:m(a.departure.localTime).format("HH:mm"),totalPrice:(a.showNetPrice?a.netPrice:a.totalPrice)+a.surcharge,checkedBag:a.checkedBag&&"Kh\xf4ng"!=a.checkedBag?`(${a.checkedBag})`:""}))};let i="";return i+=`C\xe1c chuy\u1ebfn bay t\u1eeb ${t.startPointName} (${t.startPoint}) -> ${t.endPointName} (${t.endPoint})\r\n`,i+=`${t.departDate}\r\n`,i+="(VJ: VietJet Air; QH: Bamboo Airways; VN: Vietnam Airlines; VU: Vietravel Airlines; VN6*: Pacific Airlines)\r\n",t.flightOptions.forEach(a=>{i+=`${a.flightNumber} \t${a.departureTime} \t${new Intl.NumberFormat("vi-VN").format(a.totalPrice)} ${a.checkedBag}\r\n`}),i}saveZip(t){if(!t)return;const i=new Bt,a=i.folder(this.fileName);t.forEach((n,s)=>{null==a||a.file(`${this.fileName}(${s+1}).jpeg`,n)}),i.generateAsync({type:"blob"}).then(n=>{Ve.saveAs(n,`${this.fileName}.zip`)})}addonSurcharge(){this._modal.open(it,{surcharges:this.surcharges,surchargeConfigs:this.surchargeConfigs}).afterClosed$.subscribe({next:i=>{if(i.data){this.surcharges=i.data;let a={};this.surcharges.forEach(n=>{a[n.airline]=n.surchargePrice}),this.listTicket=this.listTicket.map(n=>Object.assign(Object.assign({},n),{surcharge:["GDS","BSP","AIR_1G"].includes(n.provider)?a.GDS:a[n.provider]})),this.listTicketSelected=this.listTicketSelected.map(n=>Object.assign(Object.assign({},n),{surcharge:["GDS","BSP","AIR_1G"].includes(n.provider)?a.GDS:a[n.provider]}))}}})}addonSurchargeMobile(){const t=this._bottomSheetService.open(it,{headerTitle:"Ch\u1ec9nh ph\xed ph\u1ee5 thu",rightButtonIcon:"close",rightButtonIconClass:"text-neutral-gray-4",data:{surcharges:this.surcharges,surchargeConfigs:this.surchargeConfigs}});t.containerInstance._rightButtonClick.subscribe(i=>t.dismiss()),t.afterDismissed().subscribe({next:i=>{if(i){this.surcharges=i;let a={};this.surcharges.forEach(n=>{a[n.airline]=n.surchargePrice}),this.listTicket=this.listTicket.map(n=>Object.assign(Object.assign({},n),{surcharge:["GDS","BSP","AIR_1G"].includes(n.provider)?a.GDS:a[n.provider]})),this.listTicketSelected=this.listTicketSelected.map(n=>Object.assign(Object.assign({},n),{surcharge:["GDS","BSP","AIR_1G"].includes(n.provider)?a.GDS:a[n.provider]}))}}})}onShowNetPrice(){this.isHiddenNetPrice=!this.isHiddenNetPrice,this.listTicket=this.listTicket.map(t=>Object.assign(Object.assign({},t),{showNetPrice:!t.showNetPrice}))}onHiddenFare(){this.isHiddenCabin=!this.isHiddenCabin}onEditHeader(){this._modal.open(P.W3,{agentInfo:this.agentInfo}).afterClosed$.subscribe({next:i=>{i.data&&(this.agentInfo=Object.assign(Object.assign({},this.agentInfo),{address:i.data.address,email:i.data.email,website:i.data.website,phone:i.data.phone}))}})}onEditHeaderMobile(){const t=this._bottomSheetService.open(P.W3,{headerTitle:"Ch\u1ec9nh s\u1eeda th\xf4ng tin header",rightButtonIcon:"",leftButtonIcon:"close",leftButtonIconClass:"text-neutral-gray-4",containerFullHeigh:!0,data:{agentInfo:this.agentInfo}});t.containerInstance._leftButtonClick.subscribe(i=>t.dismiss()),t.afterDismissed().subscribe(i=>{i&&(this.agentInfo=Object.assign(Object.assign({},this.agentInfo),{address:i.address,email:i.email,website:i.website,phone:i.phone}))})}onMobileScrollDown(){this.ticketInfiniteScrollCount+=this.TICKET_INFINITE_OFSET_INCREASE}}return r.\u0275fac=function(t){return new(t||r)(e.Y36(C.KNP),e.Y36(j.gb,8),e.Y36(J.Rr,8),e.Y36(J.a2,8),e.Y36(ui.TU),e.Y36(di.eN),e.Y36(j.oE),e.Y36(ie.BX),e.Y36(nt.L),e.Y36(tt.m),e.Y36(R.$A),e.Y36(hi.KD),e.Y36(gi.B))},r.\u0275cmp=e.Xpm({type:r,selectors:[["quotation-modal"]],viewQuery:function(t,i){if(1&t&&e.Gf(pi,5),2&t){let a;e.iGM(a=e.CRH())&&(i.quotationGraphicRef=a.first)}},hostAttrs:[1,"md:w-full","relative"],standalone:!0,features:[e.jDz],decls:140,vars:64,consts:[[1,"w-[80vw]","h-[600px]","rounded-lg","bg-neutral-white","overflow-hidden","md:hidden"],[1,"w-full","h-full","flex","flex-col","max-h-[600px]"],[1,"flex","justify-between","items-center","px-6","py-[13px]","border-b","border-neutral-gray-1"],[1,"text-heading-sm","text-neutral-black"],["size","medium","icon","close",1,"text-neutral-gray-4","cursor-pointer",3,"click"],[1,"flex-auto","w-full","h-full","overflow-auto","py-4","px-6"],[1,"w-full","h-full","flex","flex-col","gap-y-6"],[1,"flex","justify-between"],[1,"text-heading-sm","text-neutral-gray-6","flex","items-center","gap-x-2"],["icon","circle_information","size","small"],[1,"flex","gap-x-4"],["size","medium",3,"checked","click"],[1,"w-full","p-4","rounded","bg-gradient-to-r","from-[#013f51]","from-10%","via-[#006885]","via-30%","to-[#006885]","to-90%","flex","justify-between","items-center","gap-x-8"],[1,"flex","items-center","gap-x-8"],[1,"flex","items-center","gap-x-3"],["class","w-10 h-10 object-cover rounded-full",3,"src",4,"ngIf"],["width","32","height","20","viewBox","0 0 32 20","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],[1,"flex","flex-col","gap-y-1","text-white"],[1,"text-body-sm","opacity-80"],[1,"text-heading-xs"],[1,"flex","flex-col","gap-y-1"],["class","flex gap-x-3",4,"ngIf"],["cf-button","","size","small","class","min-w-[114px] justify-center bg-white text-neutral-gray-6","type","secondary",3,"click",4,"ngIf"],[1,"bg-neutral-white","rounded-lg","shadow-cf-md"],[1,"p-4","flex","justify-between","items-center"],[1,"flex","items-center","gap-x-4"],[1,"text-neutral-gray-6","text-espressive-lg"],[1,"text-body-md","text-secondary-3-4","font-medium"],["cf-button","","type","secondary",3,"click"],["icon","add","size","small",1,"mr-2.5"],[1,"",3,"fnSort","fnSearch","pageSizeList","listData","pageSize"],["managerTable",""],["cf-thead",""],["cf-th",""],["size","medium",3,"checked","checkChange"],[1,"text-espressive-semibold-sm","p-3","text-right"],["ngFor","",3,"ngForOf"],[1,"p-6"],[1,"flex","justify-between","items-center"],[1,"text-body-lg"],[1,"flex","items-center","gap-x-8",3,"ngModel","ngModelChange"],["size","medium",3,"value"],["cf-button","","size","medium",3,"click"],["icon","export","size","small",1,"mr-2.5"],[4,"ngIf"],["infinite-scroll","",1,"hidden","md:flex","flex-col","p-4","w-full","gap-y-4","bg-neutral-gray-1","h-full","overflow-y-auto",3,"infiniteScrollDistance","infiniteScrollThrottle","scrollWindow","fromRoot","alwaysCallback","scrolled"],[1,"rounded","pt-3","pr-4","pb-3","pl-4","flex","flex-col","gap-4","items-start","justify-center","self-stretch","shrink-0","relative","w-full",2,"background","linear-gradient(90deg,rgba(0, 0, 0, 0.4) 0%,rgba(0, 0, 0, 0) 100%),linear-gradient(to left, #006885, #006885)"],[1,"flex","flex-row","gap-3","items-center","justify-start","self-stretch","shrink-0","relative"],[1,"flex","flex-row","gap-3.5","w-10","items-center","justify-start","shrink-0","h-5","relative"],["class","self-stretch flex-1 relative overflow-visible","width","32","height","20","viewBox","0 0 32 20","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],[1,"flex","flex-col","gap-1","items-start","justify-start","flex-1","relative"],[1,"text-neutral-white","opacity-80","text-left","relative","text-body-sm"],[1,"text-neutral-white","text-left","relative","text-heading-xs"],[1,"flex","flex-row","gap-0","items-start","justify-start","shrink-0","relative"],["class","bg-neutral-white rounded border-solid border-neutral-gray-3 border pt-2 pr-3 pb-2 pl-3 flex flex-row gap-2 items-center justify-center shrink-0 h-8 relative",3,"click",4,"ngIf"],[1,"flex","flex-row","gap-8","items-center","justify-start","self-stretch","shrink-0","relative"],[1,"flex","flex-row","gap-3","items-start","justify-start","shrink-0","relative","w-full"],[1,"flex","flex-col","gap-1","items-start","justify-start","shrink-0","relative"],["class","text-neutral-gray-2 text-left relative text-espressive-md-short",4,"ngIf"],[1,"flex","flex-col","gap-1","items-start","justify-start","shrink-0","relative","!flex-auto"],["class","text-neutral-white text-left relative text-body-md-short line-clamp-1",4,"ngIf"],["class","text-neutral-white text-left relative text-body-md-short",4,"ngIf"],[1,"flex","flex-col","gap-0","items-start","justify-start","self-stretch","shrink-0","relative"],[1,"flex","flex-row","gap-2","items-center","justify-start","self-stretch","shrink-0","relative"],[1,"text-neutral-gray-6","text-left","relative","text-heading-sm"],[1,"text-secondary-3-4","text-left","relative","self-stretch","text-espressive-md-short"],[1,"flex","flex-col"],[1,"flex","flex-row","gap-2","items-center","justify-start","shrink-0","w-full","relative"],[1,"text-neutral-gray-6-brandcolor","text-left","relative","flex-1","text-body-md-long"],["cf-button","","type","secondary","size","small",1,"bg-neutral-white",3,"click"],[1,"flex","justify-between","items-center","mt-3"],[1,"flex","flex-col","gap-y-3","mt-3","pb-16"],[4,"ngFor","ngForOf"],["formatSelectBottomSheet",""],["mobileConfirmShare",""],["mobilePdfConfirmShare",""],[1,"hidden","md:flex","justify-end","items-center","p-4","fixed","bottom-0","right-0","w-full","bg-neutral-white","shadow-cf-lg",2,"-webkit-transform","translateZ(0)"],["cf-button","","size","medium",1,"w-full","justify-center",3,"click"],[1,"absolute","bottom-[10000px]",3,"listTicket","cabinName","isHiddenCabin","journey","agentInfo"],["quotationGraphicRef",""],["class","fixed top-0 left-0 w-screen !w-[100svw] h-screen !h-[100svh] flex justify-center items-center bg-neutral-white opacity-95",4,"ngIf"],[1,"w-10","h-10","object-cover","rounded-full",3,"src"],["width","32","height","20","viewBox","0 0 32 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M19.7391 0H22.0007H31.3757C31.9958 0 32.1782 0.406859 31.8134 0.924681C31.8134 0.924681 30.3543 2.84802 29.0775 4.21654C27.6549 5.69603 25.5391 7.43443 25.5391 7.43443C25.0649 7.84129 24.153 8.17418 23.5328 8.17418H21.9643H19.7026H12.4069H10.1453H0.770366C0.150235 8.17418 -0.0321566 7.76732 0.332627 7.2495C0.332627 7.2495 1.79176 5.32616 3.0685 3.95763C4.49115 2.47814 6.60689 0.739744 6.60689 0.739744C7.08111 0.332885 7.99307 0 8.6132 0H10.1818H12.4434H19.7391ZM19.5931 11.8258H21.8548H31.2297C31.8498 11.8258 32.0322 12.2327 31.6674 12.7505C31.6674 12.7505 30.2083 14.6739 28.9316 16.0424C27.5089 17.5219 25.3932 19.2603 25.3932 19.2603C24.919 19.6671 24.007 20 23.3869 20H21.8183H19.5566H12.261H9.99933H0.624402C0.0042704 20 -0.178121 19.5932 0.186662 19.0753C0.186662 19.0753 1.64579 17.152 2.92254 15.7835C4.34519 14.304 6.46093 12.5656 6.46093 12.5656C6.93515 12.1587 7.84711 11.8258 8.46724 11.8258H10.0358H12.2975H19.5931Z","fill","url(#paint0_linear_1633_21678)"],["id","paint0_linear_1633_21678","x1","16","y1","-4.91341e-07","x2","26.3657","y2","20.0517","gradientUnits","userSpaceOnUse"],["stop-color","#E03C31"],["offset","1","stop-color","#F6C543"],[1,"flex","gap-x-3"],[1,"w-[55px]","text-neutral-gray-1","text-espressive-md"],[1,"text-white","text-body-md"],["cf-button","","size","small","type","secondary",1,"min-w-[114px]","justify-center","bg-white","text-neutral-gray-6",3,"click"],["icon","edit_alt","size","small",1,"mr-2.5"],[3,"ngClass"],[1,"py-2","px-3"],[1,"w-20","h-10","object-contain",3,"src"],[1,"py-2","px-3","text-body-sm"],[1,"text-heading-sm"],[1,"py-2","px-3","text-heading-sm"],["class","",4,"ngIf"],[1,"py-2","px-3","text-right"],["class","text-heading-md",4,"ngIf"],["class","text-express-sm text-neutral-gray-6",4,"ngIf"],["class","border-b border-neutral-gray-1",4,"ngIf"],[1,""],[1,"text-espressive-sm","text-neutral-gray-4"],[1,"text-heading-md"],[1,"text-express-sm","text-neutral-gray-6"],[1,"border-b","border-neutral-gray-1"],["colspan","7",1,"py-2","px-3.5"],[1,"text-body-sm","text-neutral-gray-4","flex","items-center","gap-x-3"],["width","32","height","20","viewBox","0 0 32 20","fill","none","xmlns","http://www.w3.org/2000/svg",1,"self-stretch","flex-1","relative","overflow-visible"],["fill-rule","evenodd","clip-rule","evenodd","d","M19.7391 0H22.0007H31.3757C31.9958 0 32.1782 0.406859 31.8134 0.924681C31.8134 0.924681 30.3543 2.84802 29.0775 4.21654C27.6549 5.69603 25.5391 7.43443 25.5391 7.43443C25.0649 7.84129 24.153 8.17418 23.5328 8.17418H21.9643H19.7026H12.4069H10.1453H0.770366C0.150235 8.17418 -0.0321566 7.76732 0.332627 7.2495C0.332627 7.2495 1.79176 5.32616 3.0685 3.95763C4.49115 2.47814 6.60689 0.739744 6.60689 0.739744C7.08111 0.332885 7.99307 0 8.6132 0H10.1818H12.4434H19.7391ZM19.5931 11.8248H21.8548H31.2297C31.8498 11.8248 32.0322 12.2317 31.6674 12.7495C31.6674 12.7495 30.2083 14.6728 28.9316 16.0414C27.5089 17.5209 25.3932 19.2593 25.3932 19.2593C24.919 19.6661 24.007 19.999 23.3869 19.999H21.8183H19.5566H12.261H9.99933H0.624402C0.00427041 19.999 -0.178121 19.5921 0.186662 19.0743C0.186662 19.0743 1.64579 17.151 2.92254 15.7825C4.34519 14.303 6.46093 12.5646 6.46093 12.5646C6.93515 12.1577 7.84711 11.8248 8.46724 11.8248H10.0358H12.2975H19.5931Z","fill","url(#paint0_linear_966_27592)"],["id","paint0_linear_966_27592","x1","16","y1","-4.91317e-07","x2","26.3648","y2","20.0511","gradientUnits","userSpaceOnUse"],[1,"bg-neutral-white","rounded","border-solid","border-neutral-gray-3","border","pt-2","pr-3","pb-2","pl-3","flex","flex-row","gap-2","items-center","justify-center","shrink-0","h-8","relative",3,"click"],["icon","edit_alt","size","small"],[1,"text-neutral-gray-6","text-left","relative","text-button-md"],[1,"text-neutral-gray-2","text-left","relative","text-espressive-md-short"],[1,"text-neutral-white","text-left","relative","text-body-md-short","line-clamp-1"],[1,"text-neutral-white","text-left","relative","text-body-md-short"],["class","bg-white rounded-[4px] flex flex-col shadow-md md:rounded-lg flex-shrink-0",4,"ngIf"],[1,"bg-white","rounded-[4px]","flex","flex-col","shadow-md","md:rounded-lg","flex-shrink-0"],[1,"flex"],[1,"flex","flex-col","justify-between","pt-8","pl-3","grow","w-full","md:pt-3","md:pb-3","md:gap-y-3","md:justify-start"],[1,"hidden","md:flex","gap-x-3","items-center"],[1,"w-[36px]","h-[36px]","object-contain",3,"src"],[1,"flex","gap-x-4","items-center"],[1,"flex","flex-col","items-center"],[1,"text-heading-xs","text-neutral-gray-6"],[1,"text-espressive-xs","text-neutral-gray-4"],[1,"flex","flex-col","items-center","gap-y-1"],[1,"flex","items-center","justify-center"],[1,"h-0","border-b","border-b-neutral-gray-4","w-[64px]"],[1,"w-1","h-1","border-[2px]","border-t-neutral-gray-4","border-r-neutral-gray-4","border-b-transparent","border-l-transparent","rotate-45"],["class","text-espressive-xs text-neutral-gray-4",4,"ngIf"],[1,"items-center","hidden","md:flex"],[1,"text-espressive-sm","text-neutral-gray-6","whitespace-nowrap"],[1,"border-r","border-r-neutral-gray-2","h-4","mx-1"],[1,"text-espressive-xs","text-neutral-gray-4","whitespace-nowrap"],["class","hidden text-espressive-sm text-secondary-3-4 md:flex gap-x-1 items-center",4,"ngIf"],[1,"flex-col","justify-between","py-3","pr-3","pl-2","border-l","border-neutral-gray-1","hidden","md:flex"],[1,"flex","flex-col","items-end","min-w-[82px]"],["size","medium",1,"mb-2","-mr-2",3,"checked","checkChange"],["class","visible line-through text-neutral-gray-4 text-body-sm whitespace-nowrap",4,"ngIf"],["class","text-heading-xs text-neutral-gray-6 whitespace-nowrap",4,"ngIf"],[1,"hidden","text-espressive-sm","text-secondary-3-4","md:flex","gap-x-1","items-center"],["icon","circle_information","size","small",1,"text-neutral-gray-4"],[1,"text-neutral-gray-4","text-left","relative","text-espressive-xs"],[1,"visible","line-through","text-neutral-gray-4","text-body-sm","whitespace-nowrap"],[1,"text-heading-xs","text-neutral-gray-6","whitespace-nowrap"],[1,"pt-5","p-4","flex","flex-col","w-full"],[1,"flex","flex-col","gap-y-4",3,"ngModel","ngModelChange"],["cf-button","",1,"w-full","justify-center","mt-6",3,"click"],[1,"flex","justify-center","text-body-md"],["class","flex justify-center text-body-sm",4,"ngIf"],[1,"flex","justify-center","text-body-sm"],[1,"fixed","top-0","left-0","w-screen","!w-[100svw]","h-screen","!h-[100svh]","flex","justify-center","items-center","bg-neutral-white","opacity-95"],[3,"text","percent"]],template:function(t,i){if(1&t){const a=e.EpF();e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e._uU(4),e.qZA(),e.TgZ(5,"cf-icon",4),e.NdJ("click",function(){return i.onClose()}),e.qZA()(),e.TgZ(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),e._UZ(10,"cf-icon",9),e._uU(11," T\xf9y ch\u1ec9nh hi\u1ec3n th\u1ecb "),e.qZA(),e.TgZ(12,"div",10)(13,"cf-checkbox",11),e.NdJ("click",function(){return i.onShowNetPrice()}),e._uU(14," Hi\u1ec3n th\u1ecb gi\xe1 Net "),e.qZA(),e.TgZ(15,"cf-checkbox",11),e.NdJ("click",function(){return i.onHiddenFare()}),e._uU(16," \u1ea8n h\u1ea1ng gh\u1ebf "),e.qZA()()(),e.TgZ(17,"div",12)(18,"div",13)(19,"div",14)(20,"div"),e.YNc(21,mi,1,1,"img",15),e.YNc(22,fi,6,0,"svg",16),e.qZA(),e.TgZ(23,"div",17)(24,"div",18),e._uU(25,"Ph\xf2ng v\xe9"),e.qZA(),e.TgZ(26,"div",19),e._uU(27),e.qZA()()(),e.TgZ(28,"div",20),e.YNc(29,_i,5,1,"div",21),e.YNc(30,vi,5,1,"div",21),e.YNc(31,Ti,5,1,"div",21),e.YNc(32,yi,5,1,"div",21),e.qZA()(),e.TgZ(33,"div"),e.YNc(34,Ci,3,0,"button",22),e.qZA()(),e.TgZ(35,"div",23)(36,"div",24)(37,"div")(38,"div",25)(39,"div",26),e._uU(40),e.qZA()(),e.TgZ(41,"div",27),e._uU(42),e.ALo(43,"date"),e.qZA()(),e.TgZ(44,"button",28),e.NdJ("click",function(){return i.addonSurcharge()}),e._UZ(45,"cf-icon",29),e._uU(46," Ch\u1ec9nh ph\xed ph\u1ee5 thu "),e.qZA()(),e.TgZ(47,"cf-table",30,31)(49,"thead",32)(50,"th",33)(51,"cf-checkbox",34),e.NdJ("checkChange",function(s){return i.allCheckSet(s)}),e.qZA()(),e.TgZ(52,"th",33),e._uU(53,"H\xe3ng bay"),e.qZA(),e.TgZ(54,"th",33),e._uU(55,"C\u1ea5t c\xe1nh"),e.qZA(),e.TgZ(56,"th",33),e._uU(57,"H\u1ea1 c\xe1nh"),e.qZA(),e.TgZ(58,"th",33),e._uU(59,"Chuy\u1ebfn bay"),e.qZA(),e.TgZ(60,"th",33),e._uU(61,"S\u1ed1 \u0111i\u1ec3m d\u1eebng"),e.qZA(),e.TgZ(62,"th",35),e._uU(63,"T\u1ed5ng chi ph\xed"),e.qZA()(),e.TgZ(64,"tbody"),e.YNc(65,Ii,24,20,"ng-template",36),e.qZA()()()()(),e.TgZ(66,"div",37)(67,"div",38)(68,"div",10)(69,"div",39),e._uU(70,"\u0110\u1ecbnh d\u1ea1ng:"),e.qZA(),e.TgZ(71,"cf-radio-group",40),e.NdJ("ngModelChange",function(s){return i.formatType=s}),e.TgZ(72,"cf-radio",41),e._uU(73,"PDF"),e.qZA(),e.TgZ(74,"cf-radio",41),e._uU(75,"\u1ea2nh JPEG"),e.qZA(),e.TgZ(76,"cf-radio",41),e._uU(77,"SMS"),e.qZA()()(),e.TgZ(78,"button",42),e.NdJ("click",function(){return i.onShare()}),e._UZ(79,"cf-icon",43),e._uU(80," Ho\xe0n th\xe0nh "),e.qZA()()()()(),e.YNc(81,Ei,1,0,"cf-spinner",44),e.TgZ(82,"div",45),e.NdJ("scrolled",function(){return i.onMobileScrollDown()}),e.TgZ(83,"div",46)(84,"div",47)(85,"div",48),e.YNc(86,Ai,1,1,"img",15),e.YNc(87,Ni,6,0,"svg",49),e.qZA(),e.TgZ(88,"div",50)(89,"div",51),e._uU(90," Ph\xf2ng v\xe9 "),e.qZA(),e.TgZ(91,"div",52),e._uU(92),e.qZA()(),e.TgZ(93,"div",53),e.YNc(94,wi,4,0,"div",54),e.qZA()(),e.TgZ(95,"div",55)(96,"div",56)(97,"div",57),e.YNc(98,Zi,2,0,"div",58),e.YNc(99,Mi,2,0,"div",58),e.YNc(100,Ri,2,0,"div",58),e.YNc(101,Bi,2,0,"div",58),e.qZA(),e.TgZ(102,"div",59),e.YNc(103,Li,2,1,"div",60),e.YNc(104,Hi,2,1,"div",61),e.YNc(105,Qi,2,1,"div",61),e.YNc(106,Oi,2,1,"div",61),e.qZA()()()(),e.TgZ(107,"div",62)(108,"div",63)(109,"div",64),e._uU(110),e.qZA()(),e.TgZ(111,"div",65),e._uU(112),e.ALo(113,"date"),e.qZA()(),e.TgZ(114,"div",66)(115,"div",67)(116,"div",68),e._uU(117),e.qZA(),e.TgZ(118,"button",69),e.NdJ("click",function(){return i.addonSurchargeMobile()}),e._UZ(119,"cf-icon",29),e._uU(120," Ch\u1ec9nh ph\xed ph\u1ee5 thu "),e.qZA()(),e.TgZ(121,"div",70)(122,"div",68),e._uU(123),e.qZA(),e.TgZ(124,"cf-checkbox",34),e.NdJ("checkChange",function(s){return i.allCheckSet(s)}),e.qZA()(),e.TgZ(125,"div",71),e.YNc(126,Ki,2,1,"ng-container",72),e.qZA()(),e.YNc(127,Vi,10,4,"ng-template",null,73,e.W1O),e.YNc(129,Wi,6,1,"ng-template",null,74,e.W1O),e.YNc(131,Xi,5,0,"ng-template",null,75,e.W1O),e.qZA(),e.TgZ(133,"div",76)(134,"button",77),e.NdJ("click",function(){e.CHM(a);const s=e.MAs(128);return e.KtG(i.onMobileOk(s))}),e._uU(135," Ho\xe0n th\xe0nh "),e.qZA()(),e._UZ(136,"cf-quotation-graphic",78,79)(138,"cf-toast"),e.YNc(139,ea,2,2,"div",80)}if(2&t){const a=e.MAs(48);e.xp6(4),e.lnq("Chia s\u1ebb c\xe1c chuy\u1ebfn bay ",i.journey.startPoint," - ",i.journey.endPoint,", ",i.journey.departDate,""),e.xp6(9),e.Q6J("checked",i.isHiddenNetPrice),e.xp6(2),e.Q6J("checked",i.isHiddenCabin),e.xp6(6),e.Q6J("ngIf",i.agentInfo.logoUrl),e.xp6(1),e.Q6J("ngIf",!i.agentInfo.logoUrl),e.xp6(5),e.Oqu(i.agentInfo.displayName),e.xp6(2),e.Q6J("ngIf",i.agentInfo.address),e.xp6(1),e.Q6J("ngIf",i.agentInfo.email),e.xp6(1),e.Q6J("ngIf",i.agentInfo.website),e.xp6(1),e.Q6J("ngIf",i.agentInfo.phone),e.xp6(2),e.Q6J("ngIf",i.canEditHeader),e.xp6(6),e.AsE(" C\xe1c chuy\u1ebfn bay ch\u1eb7ng ",i.journey.startPointName," - ",i.journey.endPointName," "),e.xp6(2),e.hij(" ",e.xi3(43,58,i.journey.departDateQuotation,"EEEE, d MMMM, yyyy")," "),e.xp6(5),e.Q6J("fnSort",i.sortChange)("fnSearch",i.searchChange)("pageSizeList",i.pageSizeList)("listData",i.listTicket)("pageSize",i.pageSize),e.xp6(4),e.Q6J("checked",i.checked),e.xp6(14),e.Q6J("ngForOf",a.partOfdata),e.xp6(6),e.Q6J("ngModel",i.formatType),e.xp6(1),e.Q6J("value","PDF"),e.xp6(2),e.Q6J("value","JPEG"),e.xp6(2),e.Q6J("value","SMS"),e.xp6(5),e.Q6J("ngIf",i.isDowloading),e.xp6(1),e.Q6J("infiniteScrollDistance",2)("infiniteScrollThrottle",300)("scrollWindow",!1)("fromRoot",!0)("alwaysCallback",!0),e.xp6(4),e.Q6J("ngIf",i.agentInfo.logoUrl),e.xp6(1),e.Q6J("ngIf",!i.agentInfo.logoUrl),e.xp6(5),e.hij(" ",i.agentInfo.displayName," "),e.xp6(2),e.Q6J("ngIf",i.canEditHeader),e.xp6(4),e.Q6J("ngIf",i.agentInfo.address),e.xp6(1),e.Q6J("ngIf",i.agentInfo.email),e.xp6(1),e.Q6J("ngIf",i.agentInfo.website),e.xp6(1),e.Q6J("ngIf",i.agentInfo.phone),e.xp6(2),e.Q6J("ngIf",i.agentInfo.address),e.xp6(1),e.Q6J("ngIf",i.agentInfo.email),e.xp6(1),e.Q6J("ngIf",i.agentInfo.website),e.xp6(1),e.Q6J("ngIf",i.agentInfo.phone),e.xp6(4),e.AsE(" C\xe1c chuy\u1ebfn bay ch\u1eb7ng ",i.journey.startPointName," - ",i.journey.endPointName," "),e.xp6(2),e.hij(" ",e.xi3(113,61,i.journey.departDateQuotation,"EEEE, d MMMM, yyyy")," "),e.xp6(5),e.hij(" ",i.listTicket.length," k\u1ebft qu\u1ea3 "),e.xp6(6),e.hij("\u0110\xe3 ch\u1ecdn: ",i.listTicketSelectedLength,""),e.xp6(1),e.Q6J("checked",i.checked),e.xp6(2),e.Q6J("ngForOf",i.listTicket),e.xp6(10),e.Q6J("listTicket",i.listTicketSelected)("cabinName",i.cabinName)("isHiddenCabin",i.isHiddenCabin)("journey",i.journey)("agentInfo",i.agentInfo),e.xp6(3),e.Q6J("ngIf",i.isMobileDownloading)}},dependencies:[S.ez,S.mk,S.sg,S.O5,S.JJ,S.uU,M.u5,M.JJ,M.On,C.AxE,C.Sm8,we.u,Ze.o,Ze.T,L.N8,L.Xq,$.OR,te.rC,te.E_,te.zs,ci,ie.hj,P.AS,K.Rq,K.Ry,gt],encapsulation:2}),r})();var ta=_(13138),ia=_(3803),aa=_(17997),na=_(62733),ra=_(28490),oa=_(3401),sa=_(77492),la=_(46779),ca=_(42678),ua=_(9497);function da(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"button",50),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.researchFlight())}),e._UZ(1,"cf-icon",51),e.TgZ(2,"div",52),e._uU(3," T\xecm chuy\u1ebfn bay "),e.qZA()()}if(2&r){const t=e.oxw();e.Q6J("disabled",t.searchFlightLoading)}}function ha(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",53)(1,"div",54)(2,"div",55),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.addMultiRoute())}),e._UZ(3,"cf-icon",56),e.TgZ(4,"div",57),e._uU(5,"Th\xeam ch\u1eb7ng m\u1edbi"),e.qZA()(),e.TgZ(6,"div",58),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.removeAllDataMultiRoute())}),e._UZ(7,"cf-icon",59),e.TgZ(8,"div",60),e._uU(9,"X\xf3a t\u1ea5t c\u1ea3"),e.qZA()()(),e.TgZ(10,"button",61),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.researchFlight())}),e._UZ(11,"cf-icon",51),e.TgZ(12,"div",52),e._uU(13," T\xecm chuy\u1ebfn bay "),e.qZA()()()}if(2&r){const t=e.oxw();e.xp6(10),e.Q6J("disabled",t.searchFlightLoading)}}function ga(r,l){if(1&r&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.hij(" - ",e.xi3(2,1,t.toDate,"dd/MM"),"")}}function pa(r,l){1&r&&(e.TgZ(0,"span"),e._uU(1,"T\u1eeb "),e.qZA())}function ma(r,l){if(1&r&&(e.TgZ(0,"span"),e.YNc(1,pa,2,0,"span",41),e._uU(2),e.ALo(3,"number"),e.qZA()),2&r){const t=e.oxw().$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.toDate&&i.flightTypeSearch===i.FlightTypeSearch.RoundTrip),e.xp6(1),e.hij("",e.lcZ(3,2,t.price)," \u0111")}}function fa(r,l){1&r&&(e.TgZ(0,"span"),e._uU(1,"Xem gi\xe1"),e.qZA())}function _a(r,l){if(1&r&&(e.TgZ(0,"li"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&r){const t=e.oxw(2).$implicit;e.xp6(1),e.AsE("Gi\xe1 r\u1ebb ",t.airlineMinPrice,": ",e.lcZ(2,2,t.price)," \u0111")}}function va(r,l){if(1&r&&(e.TgZ(0,"ul")(1,"li"),e._uU(2),e.qZA(),e.TgZ(3,"li"),e._uU(4),e.qZA(),e.YNc(5,_a,3,4,"li",41),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.dayInfo.holiday),e.xp6(2),e.AsE("",t.dayInfo.dateFormat," (",t.dayInfo.lunarDate,")"),e.xp6(1),e.Q6J("ngIf",t.price)}}const rt=function(r,l){return{"bg-red-1":r,"opacity-50 pointer-events-none":l}},X=function(r){return{"text-primary-1-4":r}};function Ta(r,l){if(1&r){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",69),e.NdJ("click",function(){const n=e.CHM(t).$implicit,s=e.oxw(2);return e.KtG(s.onSelectDateBar(n.key,n.fromDate,n.toDate))}),e.TgZ(2,"div",70)(3,"div",71)(4,"span"),e._uU(5),e.ALo(6,"date"),e.qZA(),e.YNc(7,ga,3,4,"span",41),e.qZA(),e.TgZ(8,"div",72),e.YNc(9,ma,4,4,"span",41),e.YNc(10,fa,2,0,"span",41),e.qZA()()(),e.YNc(11,va,6,4,"ng-template",null,73,e.W1O),e.BQk()}if(2&r){const t=l.$implicit,i=e.MAs(12),a=e.oxw(2);e.xp6(1),e.Q6J("ngClass",e.WLB(13,rt,t.selected,!t.active||a.isprogress))("id",t.key)("cfTooltip",i)("placement","topCenter"),e.xp6(2),e.Q6J("ngClass",e.VKq(16,X,t.selected)),e.xp6(2),e.Oqu(e.xi3(6,10,t.fromDate,"dd/MM")),e.xp6(2),e.Q6J("ngIf",t.toDate&&a.flightTypeSearch===a.FlightTypeSearch.RoundTrip),e.xp6(1),e.Q6J("ngClass",e.VKq(18,X,t.selected)),e.xp6(1),e.Q6J("ngIf",t.price),e.xp6(1),e.Q6J("ngIf",!t.price)}}function ya(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",62)(1,"div",63)(2,"div",64),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.onPreviousDate())}),e._UZ(3,"cf-icon",65),e.qZA(),e.TgZ(4,"div",66),e.NdJ("scroll",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.onScrollMultiDateBar(a))}),e.YNc(5,Ta,13,20,"ng-container",67),e.qZA(),e.TgZ(6,"div",64),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.onNextDate())}),e._UZ(7,"cf-icon",68),e.qZA()()()}if(2&r){const t=e.oxw();e.xp6(5),e.Q6J("ngForOf",t.multiDateBar)}}function Ca(r,l){if(1&r&&(e.TgZ(0,"div",74),e._UZ(1,"div",75),e.qZA()),2&r){const t=e.oxw();e.xp6(1),e.Udp("width",t.progress+"%")}}function ba(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"app-sort-flight",76),e.NdJ("sortChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.onSortChange(a))}),e.qZA()}if(2&r){const t=e.oxw();e.Q6J("disableSort",t.searchFlightLoading)("sortDefault",t.sortDefault)}}function Sa(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"app-sort-flight-combo",77),e.NdJ("sortChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.onSortChangeCombo(a))}),e.qZA()}if(2&r){const t=e.oxw();e.Q6J("sortDefault",t.sortDefaultCombo)("tabDetail",t.tabComboDetail)}}function xa(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"app-switch-mode",78),e.NdJ("modeChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.modeChange(a))}),e.qZA()}if(2&r){const t=e.oxw();e.Q6J("modeView",t.currentMode)("disableAgencyMode",t.searchFlightLoading)}}function Da(r,l){if(1&r&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.hij(" - ",e.xi3(2,1,t.toDate,"dd/MM"),"")}}function Fa(r,l){1&r&&(e.TgZ(0,"span"),e._uU(1,"T\u1eeb "),e.qZA())}function ka(r,l){if(1&r&&(e.TgZ(0,"span"),e.YNc(1,Fa,2,0,"span",41),e._uU(2),e.ALo(3,"number"),e.qZA()),2&r){const t=e.oxw().$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.toDate&&i.flightTypeSearch===i.FlightTypeSearch.RoundTrip),e.xp6(1),e.hij("",e.lcZ(3,2,t.price)," \u0111")}}function Pa(r,l){1&r&&(e.TgZ(0,"span"),e._uU(1,"Xem gi\xe1"),e.qZA())}function Ia(r,l){if(1&r&&(e.TgZ(0,"li"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&r){const t=e.oxw(2).$implicit;e.xp6(1),e.AsE("Gi\xe1 r\u1ebb ",t.airlineMinPrice,": ",e.lcZ(2,2,t.price)," \u0111")}}function Ea(r,l){if(1&r&&(e.TgZ(0,"ul")(1,"li"),e._uU(2),e.qZA(),e.TgZ(3,"li"),e._uU(4),e.qZA(),e.YNc(5,Ia,3,4,"li",41),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.dayInfo.holiday),e.xp6(2),e.AsE("",t.dayInfo.dateFormat," (",t.dayInfo.lunarDate,")"),e.xp6(1),e.Q6J("ngIf",t.price)}}function Aa(r,l){if(1&r){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",84),e.NdJ("click",function(){const n=e.CHM(t).$implicit,s=e.oxw(2);return e.KtG(s.onSelectDateBar(n.key,n.fromDate,n.toDate))}),e.TgZ(2,"div",70)(3,"div",71)(4,"span"),e._uU(5),e.ALo(6,"date"),e.qZA(),e.YNc(7,Da,3,4,"span",41),e.qZA(),e.TgZ(8,"div",72),e.YNc(9,ka,4,4,"span",41),e.YNc(10,Pa,2,0,"span",41),e.qZA()()(),e.YNc(11,Ea,6,4,"ng-template",null,73,e.W1O),e.BQk()}if(2&r){const t=l.$implicit,i=e.MAs(12),a=e.oxw(2);e.xp6(1),e.Q6J("ngClass",e.WLB(12,rt,t.selected,!t.active||a.isprogress))("id",t.key+"-mobile")("cfTooltip",i),e.xp6(2),e.Q6J("ngClass",e.VKq(15,X,t.selected)),e.xp6(2),e.Oqu(e.xi3(6,9,t.fromDate,"dd/MM")),e.xp6(2),e.Q6J("ngIf",t.toDate&&a.flightTypeSearch===a.FlightTypeSearch.RoundTrip),e.xp6(1),e.Q6J("ngClass",e.VKq(17,X,t.selected)),e.xp6(1),e.Q6J("ngIf",t.price),e.xp6(1),e.Q6J("ngIf",!t.price)}}function Na(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",79)(1,"div",80)(2,"div",81),e.NdJ("scroll",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.onScrollMultiDateBar(a))}),e.YNc(3,Aa,13,19,"ng-container",67),e.qZA()(),e.TgZ(4,"div",82),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.onDatePickerClick())}),e._UZ(5,"cf-icon",83),e.qZA()()}if(2&r){const t=e.oxw();e.xp6(3),e.Q6J("ngForOf",t.multiDateBar)}}function wa(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",85),e._UZ(1,"cf-icon",86),e.TgZ(2,"div",87)(3,"div",88),e._uU(4,"Kh\xf4ng t\xecm th\u1ea5y c\xe1c chuy\u1ebfn bay QH - Bamboo Airways?"),e.qZA(),e.TgZ(5,"div",60),e._uU(6,"C\xf3 th\u1ec3 b\u1ea1n \u0111\xe3 nh\u1eadp m\xe3 khuy\u1ebfn m\xe3i kh\xf4ng h\u1ee3p l\u1ec7 \u0111\u1ed1i v\u1edbi h\xe3ng Bamboo Airways. Vui l\xf2ng ki\u1ec3m tra v\xe0 th\u1eed l\u1ea1i!"),e.qZA()(),e.TgZ(7,"cf-icon",89),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.isShowBambooPromotionError=!1)}),e.qZA()()}}function Za(r,l){if(1&r&&(e.TgZ(0,"div",94)(1,"div",95),e._uU(2),e.qZA(),e.TgZ(3,"div",96)(4,"div",97),e._uU(5),e.qZA(),e.TgZ(6,"div",98),e._uU(7),e.qZA(),e.TgZ(8,"div",99),e._uU(9),e.qZA()()()),2&r){const t=l.active,i=e.oxw(),a=i.index,n=i.$implicit;e.xp6(1),e.ekj("!text-primary-2-4",t)("!bg-primary-2-1",t),e.xp6(1),e.hij(" ",a+1," "),e.xp6(3),e.AsE("",n.startPoint," - ",n.endPoint," "),e.xp6(2),e.hij(" ",n.departDate,""),e.xp6(2),e.hij(" ",n.mobileDepartDate,"")}}function Ma(r,l){if(1&r&&(e.TgZ(0,"cf-tab",92),e.YNc(1,Za,10,9,"ng-template",null,93,e.W1O),e.qZA()),2&r){const t=l.$implicit,i=e.MAs(2),a=e.oxw(2);e.Q6J("active",t.leg===a.currentLeg)("title",i)}}function Ra(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"cf-tabset",90),e.NdJ("selectedIndexChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.tabChangeIndex(a))}),e.YNc(1,Ma,3,2,"cf-tab",91),e.qZA()}if(2&r){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.tabData)}}function Ba(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"app-sort-flight-combo",100),e.NdJ("sortChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.onSortChangeCombo(a))}),e.qZA()}if(2&r){const t=e.oxw();e.Q6J("sortDefault",t.sortDefaultCombo)("tabDetail",t.tabComboDetail)}}const ot=function(r){return{"text-neutral-gray-2":r}};function La(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"button",105),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.onRegisterBookingHunter())}),e._UZ(1,"cf-icon",106),e.TgZ(2,"span"),e._uU(3,"S\u0103n v\xe9"),e.qZA()()}if(2&r){const t=e.oxw(2);e.Q6J("disabled",t.searchFlightLoading),e.xp6(1),e.Q6J("ngClass",e.VKq(2,ot,t.searchFlightLoading))}}function Ha(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"button",105),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.onQuotation(a.currentLeg))}),e._UZ(1,"cf-icon",107),e.TgZ(2,"span"),e._uU(3,"B\xe1o gi\xe1"),e.qZA()()}if(2&r){const t=e.oxw(2);e.Q6J("disabled",t.searchFlightLoading),e.xp6(1),e.Q6J("ngClass",e.VKq(2,ot,t.searchFlightLoading))}}function Qa(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",101)(1,"app-switch-mode",78),e.NdJ("modeChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.modeChange(a))}),e.qZA(),e.TgZ(2,"div",102),e.YNc(3,La,4,4,"button",103),e.YNc(4,Ha,4,4,"button",103),e.TgZ(5,"app-sort-flight",104),e.NdJ("sortChange",function(a){e.CHM(t);const n=e.oxw();return e.KtG(n.onSortChange(a))}),e.qZA()()()}if(2&r){const t=e.oxw();e.xp6(1),e.Q6J("modeView",t.currentMode)("disableAgencyMode",t.searchFlightLoading),e.xp6(2),e.Q6J("ngIf",t.huntBookingFlag),e.xp6(1),e.Q6J("ngIf",t.showQuotation&&"retail"===t.currentMode),e.xp6(1),e.Q6J("sortDefault",t.sortDefault)("disableSort",t.searchFlightLoading)}}function Oa(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"ticket-item-combo",115),e.NdJ("ticketSelected",function(a){e.CHM(t);const n=e.oxw().$implicit,s=e.oxw(3);return e.KtG(s.chooseComboTicket(a,n))})("ticketComboShare",function(a){e.CHM(t);const n=e.oxw().$implicit,s=e.oxw(3);return e.KtG(s.onShareCombo(a,n))})("verifyFlight",function(a){e.CHM(t);const n=e.oxw(),s=n.$implicit,o=n.index,c=e.oxw(3);return e.KtG(c.onVerifyFlight(a,s,o))}),e.qZA()}if(2&r){const t=e.oxw().$implicit,i=e.oxw(3);e.Q6J("ticket",t)("listFareRule",i.listFareRule)("loading",i.isVerifyComboProgress)}}function Ja(r,l){if(1&r&&(e.ynx(0),e.YNc(1,Oa,1,3,"ticket-item-combo",114),e.BQk()),2&r){const t=l.$implicit,i=l.index,a=e.oxw(3);e.xp6(1),e.Q6J("ngIf",i<a.ticketInfiniteScrollCount&&!t.soldOut)}}function Ua(r,l){1&r&&(e.TgZ(0,"div",116),e._uU(1,"C\xe1c chuy\u1ebfn bay h\u1ebft ch\u1ed7 "),e.qZA())}function Ya(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"ticket-item-combo",118),e.NdJ("ticketComboShare",function(a){e.CHM(t);const n=e.oxw().$implicit,s=e.oxw(3);return e.KtG(s.onShareCombo(a,n))}),e.qZA()}if(2&r){const t=e.oxw().$implicit,i=e.oxw(3);e.Q6J("ticket",t)("listFareRule",i.listFareRule)}}function qa(r,l){if(1&r&&(e.ynx(0),e.YNc(1,Ya,1,2,"ticket-item-combo",117),e.BQk()),2&r){const t=l.$implicit,i=l.index,a=e.oxw(3);e.xp6(1),e.Q6J("ngIf",i<a.ticketInfiniteScrollCount&&t.soldOut)}}function ja(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",111),e.NdJ("scrolled",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.onScrollDown())}),e.YNc(1,Ja,2,1,"ng-container",112),e.YNc(2,Ua,2,0,"div",113),e.YNc(3,qa,2,1,"ng-container",112),e.qZA()}if(2&r){const t=e.oxw(2);e.Q6J("infiniteScrollDistance",1)("infiniteScrollThrottle",300)("infiniteScrollContainer",".main-scroll-bar")("scrollWindow",!1)("fromRoot",!0)("alwaysCallback",!0),e.xp6(1),e.Q6J("ngForOf",t.listTicketComboDisplay)("ngForTrackBy",t.ticketTrackByFn),e.xp6(1),e.Q6J("ngIf",t.hasOutOfSeatComboDisplay()),e.xp6(1),e.Q6J("ngForOf",t.listTicketComboDisplay)("ngForTrackBy",t.ticketTrackByFn)}}function Ga(r,l){1&r&&(e.ynx(0),e._UZ(1,"ticket-item-skeleton")(2,"ticket-item-skeleton")(3,"ticket-item-skeleton")(4,"ticket-item-skeleton"),e.BQk())}function $a(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",121),e._UZ(1,"img",122),e.TgZ(2,"div",123),e._uU(3,"Kh\xf4ng c\xf3 chuy\u1ebfn bay n\xe0o ph\xf9 h\u1ee3p"),e.qZA(),e.TgZ(4,"div",124),e._uU(5," Vui l\xf2ng s\u1eeda \u0111\u1ed5i b\u1ed9 l\u1ecdc cho ph\xf9 h\u1ee3p ho\u1eb7c ch\u1ecdn n\xfat b\xean d\u01b0\u1edbi \u0111\u1ec3 h\u1ee7y vi\u1ec7c l\u1ecdc. "),e.qZA(),e.TgZ(6,"button",125),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.onResetFilter())}),e._uU(7," H\u1ee7y l\u1ecdc chuy\u1ebfn bay "),e.qZA()()}2&r&&(e.xp6(6),e.Q6J("type","solid"))}function Ka(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",121),e._UZ(1,"img",122),e.TgZ(2,"div",123),e._uU(3,"Kh\xf4ng c\xf3 chuy\u1ebfn bay n\xe0o"),e.qZA(),e.TgZ(4,"div",127),e._uU(5," Vui l\xf2ng s\u1eeda \u0111\u1ed5i b\u1ed9 l\u1ecdc ho\u1eb7c thay \u0111\u1ed5i t\xecm ki\u1ebfm c\u1ee7a b\u1ea1n. "),e.qZA(),e.TgZ(6,"button",128),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4),n=e.MAs(14);return e.KtG(a.onChangeSearch(n))}),e._UZ(7,"cf-icon",129),e._uU(8," Thay \u0111\u1ed5i t\xecm ki\u1ebfm "),e.qZA()()}2&r&&(e.xp6(6),e.Q6J("type","secondary"))}function Va(r,l){if(1&r&&e.YNc(0,Ka,9,1,"div",126),2&r){const t=e.oxw(3);e.Q6J("ngIf",!t.searchFlightData.flightOptions.length)}}function za(r,l){if(1&r&&(e.YNc(0,$a,8,1,"div",119),e.YNc(1,Va,1,1,"ng-template",null,120,e.W1O)),2&r){const t=e.MAs(2),i=e.oxw(2);e.Q6J("ngIf",!i.listTicketComboDisplay.length)("ngIfElse",t)}}function Wa(r,l){if(1&r&&(e.ynx(0),e.YNc(1,ja,4,11,"div",108),e.YNc(2,Ga,5,0,"ng-container",109),e.YNc(3,za,3,2,"ng-template",null,110,e.W1O),e.BQk()),2&r){const t=e.MAs(4),i=e.oxw();e.xp6(1),e.Q6J("ngIf",!i.searchFlightLoading),e.xp6(1),e.Q6J("ngIf",i.searchFlightLoading)("ngIfElse",t)}}function Xa(r,l){1&r&&(e.ynx(0),e.TgZ(1,"div",131),e._UZ(2,"ticket-item-skeleton")(3,"ticket-item-skeleton")(4,"ticket-item-skeleton")(5,"ticket-item-skeleton"),e.qZA(),e.BQk())}function en(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",121),e._UZ(1,"img",122),e.TgZ(2,"div",123),e._uU(3,"Kh\xf4ng c\xf3 chuy\u1ebfn bay n\xe0o"),e.qZA(),e.TgZ(4,"div",127),e._uU(5," Vui l\xf2ng s\u1eeda \u0111\u1ed5i b\u1ed9 l\u1ecdc ho\u1eb7c thay \u0111\u1ed5i t\xecm ki\u1ebfm c\u1ee7a b\u1ea1n. "),e.qZA(),e.TgZ(6,"button",128),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3),n=e.MAs(14);return e.KtG(a.onChangeSearch(n))}),e._UZ(7,"cf-icon",129),e._uU(8," Thay \u0111\u1ed5i t\xecm ki\u1ebfm "),e.qZA()()}2&r&&(e.xp6(6),e.Q6J("type","secondary"))}function tn(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"app-ticket-item",134),e.NdJ("onReselectClick",function(a){e.CHM(t);const n=e.oxw(7);return e.KtG(n.reselect(a))}),e.qZA()}if(2&r){const t=e.oxw().$implicit,i=e.oxw(6);e.Q6J("ticket",t)("listFareRule",i.listFareRule)("mobileSelected",!0)("listFareRuleClasses",i.listFareRuleClasses)}}function an(r,l){if(1&r&&(e.ynx(0),e.YNc(1,tn,1,4,"app-ticket-item",133),e.BQk()),2&r){const t=l.$implicit;e.xp6(1),e.Q6J("ngIf",t)}}function nn(r,l){if(1&r&&(e.ynx(0),e.YNc(1,an,2,1,"ng-container",67),e.BQk()),2&r){const t=e.oxw(5);e.xp6(1),e.Q6J("ngForOf",t.listTicketDisplaySelectedMobile)}}function rn(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"app-ticket-item",136),e.NdJ("ticketSelected",function(a){e.CHM(t);const n=e.oxw(6);return e.KtG(n.chooseTicket(a))}),e.qZA()}if(2&r){const t=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ticket",t)("listFareRule",i.listFareRule)("listFareRuleClasses",i.listFareRuleClasses)}}function on(r,l){if(1&r&&(e.ynx(0),e.YNc(1,rn,1,3,"app-ticket-item",135),e.BQk()),2&r){const t=l.$implicit,i=l.index,a=e.oxw(5);e.xp6(1),e.Q6J("ngIf",i<a.ticketInfiniteScrollCount&&t.seatRemain>0)}}function sn(r,l){1&r&&(e.TgZ(0,"div",116),e._uU(1,"C\xe1c chuy\u1ebfn bay h\u1ebft ch\u1ed7"),e.qZA())}function ln(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"app-ticket-item",136),e.NdJ("ticketSelected",function(a){e.CHM(t);const n=e.oxw(6);return e.KtG(n.chooseTicket(a))}),e.qZA()}if(2&r){const t=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ticket",t)("listFareRule",i.listFareRule)("listFareRuleClasses",i.listFareRuleClasses)}}function cn(r,l){if(1&r&&(e.ynx(0),e.YNc(1,ln,1,3,"app-ticket-item",135),e.BQk()),2&r){const t=l.$implicit,i=l.index,a=e.oxw(5);e.xp6(1),e.Q6J("ngIf",i<a.ticketInfiniteScrollCount&&0===t.seatRemain)}}function un(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",111),e.NdJ("scrolled",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.onScrollDown())}),e.YNc(1,nn,2,1,"ng-container",41),e.YNc(2,on,2,1,"ng-container",112),e.YNc(3,sn,2,0,"div",113),e.YNc(4,cn,2,1,"ng-container",112),e.qZA()}if(2&r){const t=e.oxw(4);e.Q6J("infiniteScrollDistance",1)("infiniteScrollThrottle",300)("infiniteScrollContainer",".main-scroll-bar")("scrollWindow",!1)("fromRoot",!0)("alwaysCallback",!0),e.xp6(1),e.Q6J("ngIf",t.isMobile),e.xp6(1),e.Q6J("ngForOf",t.listTicketDisplay)("ngForTrackBy",t.ticketTrackByFn),e.xp6(1),e.Q6J("ngIf",t.hasOutOfSeatDisplay()),e.xp6(1),e.Q6J("ngForOf",t.listTicketDisplay)("ngForTrackBy",t.ticketTrackByFn)}}function dn(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",121),e._UZ(1,"img",122),e.TgZ(2,"div",123),e._uU(3,"Kh\xf4ng c\xf3 chuy\u1ebfn bay n\xe0o ph\xf9 h\u1ee3p"),e.qZA(),e.TgZ(4,"div",124),e._uU(5," Vui l\xf2ng s\u1eeda \u0111\u1ed5i b\u1ed9 l\u1ecdc cho ph\xf9 h\u1ee3p ho\u1eb7c ch\u1ecdn n\xfat b\xean d\u01b0\u1edbi \u0111\u1ec3 h\u1ee7y vi\u1ec7c l\u1ecdc. "),e.qZA(),e.TgZ(6,"button",125),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.onResetFilter())}),e._uU(7," H\u1ee7y l\u1ecdc chuy\u1ebfn bay "),e.qZA()()}2&r&&(e.xp6(6),e.Q6J("type","solid"))}function hn(r,l){if(1&r&&(e.YNc(0,un,5,12,"div",108),e.YNc(1,dn,8,1,"div",126)),2&r){const t=e.oxw(3);e.Q6J("ngIf",t.listTicketDisplay.length),e.xp6(1),e.Q6J("ngIf",!t.listTicketDisplay.length)}}function gn(r,l){if(1&r&&(e.YNc(0,en,9,1,"div",119),e.YNc(1,hn,2,2,"ng-template",null,132,e.W1O)),2&r){const t=e.MAs(2),i=e.oxw(2);e.Q6J("ngIf",i.isSearchRetailEmpty)("ngIfElse",t)}}function pn(r,l){if(1&r&&(e.ynx(0),e.YNc(1,Xa,6,0,"ng-container",109),e.YNc(2,gn,3,2,"ng-template",null,130,e.W1O),e.BQk()),2&r){const t=e.MAs(3),i=e.oxw();e.xp6(1),e.Q6J("ngIf",i.searchFlightLoading)("ngIfElse",t)}}function mn(r,l){1&r&&(e.ynx(0),e.TgZ(1,"div",131),e._UZ(2,"ticket-item-skeleton")(3,"ticket-item-skeleton")(4,"ticket-item-skeleton")(5,"ticket-item-skeleton"),e.qZA(),e.BQk())}function fn(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",121),e._UZ(1,"img",122),e.TgZ(2,"div",123),e._uU(3,"Kh\xf4ng c\xf3 chuy\u1ebfn bay n\xe0o"),e.qZA(),e.TgZ(4,"div",127),e._uU(5," Vui l\xf2ng s\u1eeda \u0111\u1ed5i b\u1ed9 l\u1ecdc ho\u1eb7c thay \u0111\u1ed5i t\xecm ki\u1ebfm c\u1ee7a b\u1ea1n. "),e.qZA(),e.TgZ(6,"button",128),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3),n=e.MAs(14);return e.KtG(a.onChangeSearch(n))}),e._UZ(7,"cf-icon",129),e._uU(8," Thay \u0111\u1ed5i t\xecm ki\u1ebfm "),e.qZA()()}2&r&&(e.xp6(6),e.Q6J("type","secondary"))}function _n(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"agent-ticket-item",140),e.NdJ("onReselectClick",function(a){e.CHM(t);const n=e.oxw(6);return e.KtG(n.reselect(a))})("ticketSelected",function(a){e.CHM(t);const n=e.oxw(6);return e.KtG(n.chooseAgentTicket(a))}),e.qZA()}if(2&r){const t=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ticket",t)("listFareRule",i.listFareRule)("mobileSelected",!0)("listFareRuleClasses",i.listFareRuleClasses)}}function vn(r,l){if(1&r&&(e.ynx(0),e.YNc(1,_n,1,4,"agent-ticket-item",139),e.BQk()),2&r){const t=l.$implicit;e.xp6(1),e.Q6J("ngIf",t)}}function Tn(r,l){if(1&r&&(e.ynx(0),e.YNc(1,vn,2,1,"ng-container",67),e.BQk()),2&r){const t=e.oxw(4);e.xp6(1),e.Q6J("ngForOf",t.listTicketDisplaySelectedAgentMobile)}}function yn(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"agent-ticket-item",136),e.NdJ("ticketSelected",function(a){e.CHM(t);const n=e.oxw(6);return e.KtG(n.chooseAgentTicket(a))}),e.qZA()}if(2&r){const t=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ticket",t)("listFareRule",i.listFareRule)("listFareRuleClasses",i.listFareRuleClasses)}}function Cn(r,l){if(1&r&&(e.ynx(0),e.YNc(1,yn,1,3,"agent-ticket-item",135),e.BQk()),2&r){const t=l.$implicit,i=l.index,a=e.oxw(5);e.xp6(1),e.Q6J("ngIf",i<a.ticketInfiniteScrollCount&&!a.hasOutOfSeatAgentDisplay(t))}}function bn(r,l){1&r&&(e.TgZ(0,"div",116),e._uU(1,"C\xe1c chuy\u1ebfn bay h\u1ebft ch\u1ed7"),e.qZA())}function Sn(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"agent-ticket-item",136),e.NdJ("ticketSelected",function(a){e.CHM(t);const n=e.oxw(6);return e.KtG(n.chooseAgentTicket(a))}),e.qZA()}if(2&r){const t=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ticket",t)("listFareRule",i.listFareRule)("listFareRuleClasses",i.listFareRuleClasses)}}function xn(r,l){if(1&r&&(e.ynx(0),e.YNc(1,Sn,1,3,"agent-ticket-item",135),e.BQk()),2&r){const t=l.$implicit,i=l.index,a=e.oxw(5);e.xp6(1),e.Q6J("ngIf",i<a.ticketInfiniteScrollCount&&a.hasOutOfSeatAgentDisplay(t))}}function Dn(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",111),e.NdJ("scrolled",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.onScrollDown())}),e.YNc(1,Cn,2,1,"ng-container",112),e.YNc(2,bn,2,0,"div",113),e.YNc(3,xn,2,1,"ng-container",112),e.qZA()}if(2&r){const t=e.oxw(4);e.Q6J("infiniteScrollDistance",1)("infiniteScrollThrottle",300)("infiniteScrollContainer",".main-scroll-bar")("scrollWindow",!1)("fromRoot",!0)("alwaysCallback",!0),e.xp6(1),e.Q6J("ngForOf",t.listTicketAgentDisplay)("ngForTrackBy",t.ticketTrackByFn),e.xp6(1),e.Q6J("ngIf",t.hasOutOfSeatAgentDisplay()),e.xp6(1),e.Q6J("ngForOf",t.listTicketAgentDisplay)("ngForTrackBy",t.ticketTrackByFn)}}function Fn(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"div",121),e._UZ(1,"img",122),e.TgZ(2,"div",123),e._uU(3,"Kh\xf4ng c\xf3 chuy\u1ebfn bay n\xe0o ph\xf9 h\u1ee3p"),e.qZA(),e.TgZ(4,"div",124),e._uU(5," Vui l\xf2ng s\u1eeda \u0111\u1ed5i b\u1ed9 l\u1ecdc cho ph\xf9 h\u1ee3p ho\u1eb7c ch\u1ecdn n\xfat b\xean d\u01b0\u1edbi \u0111\u1ec3 h\u1ee7y vi\u1ec7c l\u1ecdc. "),e.qZA(),e.TgZ(6,"button",125),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.onResetFilter())}),e._uU(7," H\u1ee7y l\u1ecdc chuy\u1ebfn bay "),e.qZA()()}2&r&&(e.xp6(6),e.Q6J("type","solid"))}function kn(r,l){if(1&r&&(e.YNc(0,Tn,2,1,"ng-container",41),e.YNc(1,Dn,4,11,"div",108),e.YNc(2,Fn,8,1,"div",126)),2&r){const t=e.oxw(3);e.Q6J("ngIf",t.isMobile),e.xp6(1),e.Q6J("ngIf",t.listTicketAgentDisplay.length),e.xp6(1),e.Q6J("ngIf",!t.listTicketAgentDisplay.length)}}function Pn(r,l){if(1&r&&(e.YNc(0,fn,9,1,"div",119),e.YNc(1,kn,3,3,"ng-template",null,138,e.W1O)),2&r){const t=e.MAs(2),i=e.oxw(2);e.Q6J("ngIf",i.isSearchAgentEmpty)("ngIfElse",t)}}function In(r,l){if(1&r&&(e.ynx(0),e.YNc(1,mn,6,0,"ng-container",109),e.YNc(2,Pn,3,2,"ng-template",null,137,e.W1O),e.BQk()),2&r){const t=e.MAs(3),i=e.oxw();e.xp6(1),e.Q6J("ngIf",i.searchFlightAgentLoading)("ngIfElse",t)}}function En(r,l){if(1&r){const t=e.EpF();e.TgZ(0,"cf-icon",141),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.onShare())}),e.qZA()}}function An(r,l){if(1&r&&(e.TgZ(0,"div",44)(1,"div",45),e._uU(2,"T\u1ed5ng chi ph\xed:"),e.qZA(),e.TgZ(3,"div",142),e._uU(4),e.ALo(5,"replace"),e.ALo(6,"number"),e.qZA()()),2&r){const t=e.oxw();e.xp6(4),e.hij(" ",e.Dn7(5,1,e.lcZ(6,5,t.totalPrice||0),",",".")," \u0111 ")}}let Nn=(()=>{class r{constructor(t,i,a,n,s,o,c,d,u,h,g,p,T,v,y,D,F){this._dataProvider=t,this._ticketSelectedDataProvider=i,this._searchFlightService=a,this._flightDataService=n,this._locationDataService=s,this.cfIconRegister=o,this._router=c,this._modal=d,this._searchInputService=u,this._permissionService=h,this._mobileDetectService=g,this._bottomSheetService=p,this._eventLogService=T,this._userService=v,this._requestDataService=y,this._systemService=D,this._searchMinFareDataProvider=F,this.tabData=[],this.tabComboDetail={cheapest:{price:0,durationStr:""},best:{price:0,durationStr:""},fastest:{price:0,durationStr:""}},this.listTicketSelected=[],this.ticketSelectedNumber=0,this.currentMode="retail",this.searchFlightLoading=!1,this.searchFlightAgentLoading=!1,this.searchFlightEmpty=!1,this.isSearchRetailEmpty=!1,this.isSearchAgentEmpty=!1,this.ticketDisplayState=new Ae.X({showNetPrice:!1,showSalePrice:!1,hideFareClass:!1,showDuration:!0,showTotalComboPrice:!1,showDiscountFare:!0}),this.destroy$=new ht.x,this.currentLeg=0,this.lastLeg=0,this.listTicket=[],this.listTicketAgent=[],this.listTicketCombo=[],this.airlineList=[],this.fareclassList=[],this.selectedFare={value:""},this.planModelList=[],this.departureTimeList=[],this.arrivalTimeList=[],this.departTimeComboList=[],this.arriveTimeComboList=[],this.bookingSystemList=[],this.minFareClss="",this.numberOfPassenger={adult:0,child:0,infant:0},this.sortDefault="min_price",this.sortState="min_price",this.sortDefaultCombo="best",this.sortStateCombo="best",this.isFirstTake=!0,this.showQuotation=this._permissionService.hasPermission(R.or.CreateFlightTicketQuote),this.showSharedFlight=this._permissionService.hasPermission(R.or.CanShareFlightSelected),this.isShowBambooPromotionError=!1,this.TICKET_INFINITE_SCROLL_DEFAULT=10,this.TICKET_INFINITE_OFSET_INCREASE=10,this.ticketInfiniteScrollCount=this.TICKET_INFINITE_SCROLL_DEFAULT,this.canEditHeader=this._permissionService.hasPermission(R.or.EditShareFlightSelectedHeader),this.huntBookingFlag=this._permissionService.hasPermission(R.or.CanMonitorHuntFareTicket),this.isShareFlight=!1,this.isHiddenTotalCharge=!1,this.durationFilter=[0,50],this.minDuration=0,this.maxDuration=50,this.priceFilter=[0,0],this.minPrice=0,this.maxPrice=0,this.filterStateInit={showAirline:[],direct:this._searchInputService.isDirectFlight,oneRoute:!1,moreRoute:!1,departTime:[],arriveTime:[],fareclass:[],bookingSystem:[],plane:[],comboTime:{departStartTime:{from:0,to:1440},arriveStartTime:{from:0,to:1440},departEndTime:{from:0,to:1440},arriveEndTime:{from:0,to:1440}},comboDuration:{from:0,to:100},comboPrice:{from:void 0,to:void 0},lccFare:!1,ndcFare:!1,privateFare:!1},this.isMobile=!1,this.progress=0,this.isprogress=!1,this.hoursDifferenceAllowed=3,this.isVerifyComboProgress=!1,this.totalPriceCombo=0,this.hasAirportInternational=!1,this.discountPercentageDetail=new Map,this.searchMinFaresResult=[],this.listDateSearchMinFares=[],this.multiDateBar=[],this.FlightTypeSearch=A.jX,this.flightTypeSearch=A.jX.RoundTrip,this.multiFilghtType=A.jX.MultiWay,this.previousScrollLeft=0,this.itemWidth=114,this.scrollAmount=3*this.itemWidth,o.registerIcons([C.bHT,C.D5L,C.TM4,C.gll,C.TOh,C.KYu,C.tLH,C.IIV,C.gEm,C.D7,C.a04,C.Xlt,C.$S,C.okA,C.B2I,C.s5C,C._hx,C.YvC,C.YwC,C.rJw,C.toh,C.wvd]),u.patchForm(),this.initMinFareOption(),this.initDateSearchMinFare(),this.generateRangeDateBar(),F.searchMinFareData&&F.searchMinFareData.length>0&&(this.searchMinFaresResult=F.searchMinFareData||[],this.searchMinFaresResult.forEach(b=>{b.data instanceof Map||(b.data=new Map(Object.entries(b.data)))}),this.mappingMinFares(0))}ngAfterViewInit(){setTimeout(()=>{const i=m(this._dataProvider.searchInputData.journey[0].departDate).format("YYYY-MM-DD");this.scrollDate(i)},0)}scrollDate(t){let i;i=this._mobileDetectService.isMobile()?document.getElementById(t+"-mobile"):document.getElementById(t),i&&i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}ngOnInit(){this.hasAirportInternational=this._searchInputService.hasAirportInternational,this.checkMobile(),this.ticketFilterState=new Ae.X(this.filterStateInit),this.ticketDisplayState.pipe((0,Ne.R)(this.destroy$)).subscribe({next:()=>this.loadTicketDisplay()}),this.ticketFilterState.pipe((0,Ne.R)(this.destroy$)).subscribe({next:()=>{"combo"===this.currentMode?this.loadComboTicketFilter():this.loadTicketFilter()}}),this.bindingTypeSearch(),this.loadNumberOfPassenger(),this.searchFlight(),this.loadTabData(),this.loadTicketSelectedData(),this._searchInputService.navigateDatepicker$.subscribe({next:t=>{t&&this.onNavigateDatepicker(t)}})}initMinFareOption(){this.minFareOptionConfig={minPrice:new Map,airlineMinPrice:[{airline:x.QK.VJ,airlineName:"Vietjet Air",color:"#E03C31",selected:!0},{airline:x.QK.VN,airlineName:"Vietnam Airlines",color:"#2E5EAA",selected:!0}],isRangeMinFare:"ROUND_TRIP"===this._searchInputService.flightType,showMinPrice:!0,showLunarDate:!0}}initDateSearchMinFare(t=new Date){this.listDateSearchMinFares=[];const i=m(t).format("YYYY-MM-DD"),a=m(t).add(1,"month").startOf("month").format("YYYY-MM-DD");this.listDateSearchMinFares.push(i),this.listDateSearchMinFares.push(a)}startProgressBar(){this.isprogress=!0,this.interval=setInterval(()=>{if(this.progress<99){const t=25*Math.random();this.progress+=t,this.progress>100&&(this.progress=99)}else clearInterval(this.interval)},1500)}ngOnDestroy(){this._searchInputService.reset(),this.destroy$.next(),this.destroy$.complete(),this.clearTimer(),this._searchMinFareDataProvider.removeSearchMinFareData()}checkMobile(){this._mobileDetectService.mobileSubject.subscribe(t=>this.isMobile=t)}modeChange(t){this.currentMode=t,this.ticketInfiniteScrollCount=this.TICKET_INFINITE_SCROLL_DEFAULT}initMultiSystem(t){this.bookingSystemList=t.has(x.QK.GDS)||t.has(x.QK.BSP)||t.has(x.QK.AIR_1G)?[{code:"DOMESTIC",name:"C\xe1c h\xe3ng n\u1ed9i \u0111\u1ecba",isActive:!1,isDisable:!1},{code:x.QK.BSP,name:"H\u1ec7 th\u1ed1ng 1A",isActive:!1,isDisable:!1},{code:x.QK.AIR_1G,name:"H\u1ec7 th\u1ed1ng 1G",isActive:!1,isDisable:!1},{code:x.QK.FLY_ONE,name:"C\xe1c h\xe3ng LCC",isActive:!1,isDisable:!1}]:[]}initFilterAirline(){var t,i,a;let n=[{name:"Early Morning",code:"early_morning",start:"00:00",end:"06:00",isActive:!1,disable:!1,startTime:0,endTime:360,totalAvailable:0},{name:"Morning",code:"morning",start:"06:00",end:"12:00",isActive:!1,disable:!1,startTime:360,endTime:720,totalAvailable:0},{name:"Afternoon",code:"afternoon",start:"12:00",end:"18:00",isActive:!1,disable:!1,startTime:720,endTime:1080,totalAvailable:0},{name:"Evening",code:"evening",start:"18:00",end:"24:00",isActive:!1,disable:!1,startTime:1080,endTime:1440,totalAvailable:0}],s=[{name:"Early Morning",code:"early_morning",start:"00:00",end:"06:00",isActive:!1,disable:!1,startTime:0,endTime:360,totalAvailable:0},{name:"Morning",code:"morning",start:"06:00",end:"12:00",isActive:!1,disable:!1,startTime:360,endTime:720,totalAvailable:0},{name:"Afternoon",code:"afternoon",start:"12:00",end:"18:00",isActive:!1,disable:!1,startTime:720,endTime:1080,totalAvailable:0},{name:"Evening",code:"evening",start:"18:00",end:"24:00",isActive:!1,disable:!1,startTime:1080,endTime:1440,totalAvailable:0}],o=[];null!==(t=this.searchFlightData.flightOptions)&&void 0!==t&&t.length&&"COMBO"!==this.searchFlightData.flightOptions[0].type&&(o=this.searchFlightData.flightOptions.flatMap(g=>g.journeys).map(g=>({airline:g.airline,airlineName:g.airlineName})).filter((g,p,T)=>T.findIndex(v=>v.airline===g.airline)===p));let c=new Map,d=Number.MAX_SAFE_INTEGER,u=new Set,h=new Map;!(null===(i=this.searchFlightData.flightOptions)||void 0===i)&&i.length&&this.searchFlightData.flightOptions.forEach(g=>{u.add(g.provider),"COMBO"!==this.searchFlightData.flightOptions[0].type&&g.journeys.forEach(p=>p.fareOptions.forEach(T=>{T.fareInfos.forEach(v=>{var y,D,F,b,k,f,I;T.getTotalAmount()<d&&(d=T.getTotalAmount(),v.cabin&&!(null===(y=v.cabin)||void 0===y)&&y.name&&(this.minFareClss=v.cabin.name.toUpperCase())),c.set(null===(F=null===(D=v.cabin)||void 0===D?void 0:D.name)||void 0===F?void 0:F.toUpperCase(),Object.assign(Object.assign({},v.cabin),{description:null===(k=null===(b=v.cabin)||void 0===b?void 0:b.description)||void 0===k?void 0:k.toUpperCase(),name:null===(I=null===(f=v.cabin)||void 0===f?void 0:f.name)||void 0===I?void 0:I.toUpperCase(),isActive:!1,isDisable:!1}))}),p.segments.forEach(v=>{h.set(v.modelAirplane,{code:v.modelAirplane,name:v.modelAirplaneName||v.modelAirplane,isActive:!1,isDisable:!1})}),n.forEach(v=>{const y=m(p.departure.localTime).toDate(),D=60*y.getHours()+y.getMinutes();D>=v.startTime&&D<=v.endTime&&(v.totalAvailable=++v.totalAvailable)}),s.forEach(v=>{const y=m(p.arrival.localTime).toDate(),D=60*y.getHours()+y.getMinutes();D>=v.startTime&&D<=v.endTime&&(v.totalAvailable=++v.totalAvailable)})}))}),this.initMultiSystem(u),this.fareclassList=[...c.values()].filter(g=>g.name).map(g=>g),this.selectedFare.value=(null===(a=this.fareclassList.find(g=>g.isActive))||void 0===a?void 0:a.name)||"",this.planModelList=[...h.values()],this._dataProvider.searchInputData.journey.length>1&&(this.departTimeComboList=this._dataProvider.searchInputData.journey.map(g=>({departCode:`${this._locationDataService.getCityNameByCode(g.startPoint)} (${g.startPoint})`,departTime:g.departDate})),this.arriveTimeComboList=this._dataProvider.searchInputData.journey.reverse().map(g=>({departCode:`${this._locationDataService.getCityNameByCode(g.startPoint)} (${g.startPoint})`,departTime:g.departDate}))),1===this._dataProvider.searchInputData.journey.length&&(this.departTimeComboList=this._dataProvider.searchInputData.journey.map(g=>({departCode:`${this._locationDataService.getCityNameByCode(g.startPoint)} (${g.startPoint})`,departTime:g.departDate})),this.arriveTimeComboList=this._dataProvider.searchInputData.journey.map(g=>({departCode:`${this._locationDataService.getCityNameByCode(g.endPoint)} (${g.endPoint})`,departTime:g.departDate}))),this.airlineList=o.map(g=>({code:g.airline,name:g.airlineName||g.airline,actived:!1})),this.airlineList.filter(g=>g.actived).length===this.airlineList.length?this.airlineList.forEach(g=>g.actived=!1):0!==this.airlineList.filter(g=>g.actived).length&&this.ticketFilterState.next(Object.assign(Object.assign({},this.ticketFilterState.value),{showAirline:this.airlineList.filter(g=>g.actived).map(g=>g.code)}))}initComboFilter(){var t,i;let a=new Set;null===(t=this.searchFlightData.flightOptions)||void 0===t||t.forEach(o=>{a.add(o.provider)}),this.initMultiSystem(a);let n=[];n=null===(i=this.searchFlightData.flightOptions)||void 0===i?void 0:i.flatMap(o=>o.comboInfo).flatMap(o=>[{airline:o.departJourneys[0].airline,airlineName:o.departJourneys[0].airlineName},{airline:o.arriveJourneys[0].airline,airlineName:o.arriveJourneys[0].airlineName}]).filter((o,c,d)=>d.findIndex(u=>u.airline===o.airline)===c),this.airlineList=n.map(o=>({code:o.airline,name:o.airlineName||o.airline,actived:!1})),this.departTimeComboList=this._dataProvider.searchInputData.journey.map(o=>({departCode:`${this._locationDataService.getCityNameByCode(o.startPoint)} (${o.startPoint})`,departTime:o.departDate})),this.arriveTimeComboList=this._dataProvider.searchInputData.journey.reverse().map(o=>({departCode:`${this._locationDataService.getCityNameByCode(o.startPoint)} (${o.startPoint})`,departTime:o.departDate}));const s=this.listTicketCombo.map(o=>o.departOptions[0].totalPrice+o.arriveOptions[0].totalPrice);this.priceFilter=[Math.min(...s),Math.max(...s)],this.minPrice=this.priceFilter[0],this.maxPrice=this.priceFilter[1]}checkQHPromotionError(){this.isShowBambooPromotionError=!(this.airlineList.find(t=>"QH"===t.code)||!this._dataProvider.searchInputData.promotion.find(t=>"QH"===t.airline)||!this._dataProvider.searchInputData.journey.find(t=>t.airline.includes("QH")||t.airline.includes("qh")))}filterChange(t){this.ticketFilterState.next(Object.assign(Object.assign({},this.ticketFilterState.value),t))}displayChange(t){this.ticketDisplayState.next(Object.assign(Object.assign({},this.ticketDisplayState.value),t))}loadNumberOfPassenger(){this.numberOfPassenger={adult:this._dataProvider.searchInputData.adult,child:this._dataProvider.searchInputData.child,infant:this._dataProvider.searchInputData.infant}}onScrollDown(){this.ticketInfiniteScrollCount+=this.TICKET_INFINITE_OFSET_INCREASE}loadTabData(){this.tabData=this._dataProvider.searchInputData.journey.map((t,i)=>({startPoint:t.startPoint,endPoint:t.endPoint,departDate:(0,S.p6)(t.departDate,"EEEE","vi-VN")+", ng\xe0y "+(0,S.p6)(t.departDate,"dd/MM/yyyy","vi-VN"),departDateQuotation:t.departDate,mobileDepartDate:(0,S.p6)(t.departDate,"EEEEEE-dd/MM","vi-VN"),active:0===i,leg:i})),this.lastLeg=this.tabData.length-1,this.currentLeg>this.lastLeg&&(this.currentLeg=this.lastLeg)}loadTicketSelectedData(){this.listTicketSelected=this._dataProvider.searchInputData.journey.map((t,i)=>({startPoint:this._locationDataService.getCityNameByCode(t.startPoint),endPoint:this._locationDataService.getCityNameByCode(t.endPoint),departDate:(0,S.p6)(t.departDate,"EEEE, dd/MM/yyyy","vi-VN"),startCode:t.startPoint,endCode:t.endPoint,airlineLogo:"",provider:"",airline:"",airlineName:"",operating:"",operatingName:"",flight:"",startTime:new Date((new Date).setHours(0,0,0,0)),endTime:new Date((new Date).setHours(0,0,0,0)),expireTime:(new Date).getMilliseconds(),duration:"",highlight:0===i,selected:!1,actived:!1,numOfStop:0,totalPrice:0,totalDiscountFarePrice:0,hasDiscountFare:!1,journeyKey:"",journeyFareClass:"",fareOptionKey:"",lccFare:!1,sessionId:"",segments:[],bookingType:"b2c",leg:i,isHiddenTotalCharge:!1,bagCharge:0,seatCharge:0,comboRefs:[]})),this.listTicketDisplaySelectedMobile=this._dataProvider.searchInputData.journey.map(t=>{}),this.listTicketDisplaySelectedAgentMobile=this._dataProvider.searchInputData.journey.map(t=>{})}tabChangeIndex(t){this.currentLeg=t,this.autoInactivePreview(),this.loadTicketFilter()}chooseTicket(t){const i=()=>{this.getFareRuleClass(t.airline,t.fareClass,t.fareType),this.listTicketSelected[t.leg].airlineLogo=t.airlineLogo,this.listTicketSelected[t.leg].provider=t.provider,this.listTicketSelected[t.leg].airline=t.airline,this.listTicketSelected[t.leg].airlineName=t.airlineName,this.listTicketSelected[t.leg].operating=t.operating,this.listTicketSelected[t.leg].operatingName=t.operatingName,this.listTicketSelected[t.leg].flight=t.flightNumber,this.listTicketSelected[t.leg].startTime=t.startTime,this.listTicketSelected[t.leg].endTime=t.endTime,this.listTicketSelected[t.leg].duration=t.durationStr,this.listTicketSelected[t.leg].expireTime=t.expireTime,this.listTicketSelected[t.leg].numOfStop=t.stopStatus,this.listTicketSelected[t.leg].selected=!0,this.listTicketSelected[t.leg].bookingType="b2c",this.listTicketSelected[t.leg].totalPrice=t.ticketDetail.totalCharge,this.listTicketSelected[t.leg].totalDiscountFarePrice=t.ticketDetail.totallDiscountFareCharge,this.listTicketSelected[t.leg].hasDiscountFare=t.hasDiscountFare,this.listTicketSelected[t.leg].sessionId=t.sessionKey||"",this.listTicketSelected[t.leg].journeyKey=t.journeyKey,this.listTicketSelected[t.leg].journeyFareClass=t.journeyFareClass,this.listTicketSelected[t.leg].lccFare=t.lccFare,this.listTicketSelected[t.leg].fareOptionKey=t.fareOptionKey,this.listTicketSelected[t.leg].segments=t.segments,this.listTicketSelected[t.leg].actived=!0,this.listTicketSelected[t.leg].leg=t.leg,this.listTicketSelected[t.leg].ticketPrice=t.ticketDetail,this.listTicketSelected[t.leg].fareRule=this.listFareRule.find(n=>{var s,o;return n.airline===t.airline&&(null===(s=n.fareClass)||void 0===s?void 0:s.toLowerCase())===(null===(o=t.fareType)||void 0===o?void 0:o.toLowerCase())})||null,this.listTicketSelected[t.leg].handBag=t.handBag,this.listTicketSelected[t.leg].checkedBag=t.checkedBag,this.listTicketSelected[t.leg].isHiddenTotalCharge=0===t.ticketDetail.totalCharge&&"VN"===t.airline&&"agency"===this.currentMode,this.listTicketDisplaySelectedMobile[t.leg]=t,this.caculateTotalPrice(),this.caculateTicketSelectedNumber(),this.moveToNextJourney(),this.checkShareFlight(),this.showTotalCharge()};if(this.listTicketSelected.every(a=>!a.journeyKey))i();else{const{startTime:a,endTime:n}=this.listTicketSelected[t.leg];this.listTicketSelected[t.leg].startTime=t.startTime,this.listTicketSelected[t.leg].endTime=t.endTime;for(const[s,o]of this.listTicketSelected.entries())if(s>0){const c=this.listTicketSelected[s-1];if((o.startTime.getTime()-c.endTime.getTime())/36e5<=this.hoursDifferenceAllowed)return this._modal.open(P.bK,{}),this.listTicketSelected[t.leg].startTime=a,void(this.listTicketSelected[t.leg].endTime=n);i()}}}checkShareFlight(){var t;this.isShareFlight=null===(t=this.listTicketSelected)||void 0===t?void 0:t.some(i=>i.segments.length)}autoInactivePreview(){this.listTicketSelected.forEach(t=>{t.highlight=t.leg===this.currentLeg,t.actived=!!t.journeyKey})}convertComboTicketToTicketSelectedVM(t,i,a){const n=Ee.cloneDeep(this.listTicketSelected[i]);return n.airlineLogo=t.airlineLogo,n.provider=t.provider,n.airline=t.airline,n.airlineName=t.airlineName,n.flight=t.flightNumber,n.startTime=t.departureDate,n.endTime=t.returnDate,n.expireTime=t.expireTime,n.duration=t.durationStr,n.numOfStop=t.numOfStop,n.selected=!0,n.bookingType="combo",n.totalPrice=t.ticketPrice.totalCharge,n.totalDiscountFarePrice=t.ticketPrice.totallDiscountFareCharge,n.hasDiscountFare=a.hasDiscountFare,n.journeyKey=t.journeyKey,n.fareOptionKey=t.fareOptionKey,n.actived=!0,n.leg=i,n.ticketPrice=t.ticketPrice,n.fareRule={airline:t.airline,fareClass:"VN"===t.airline?t.fareClass||"":t.fareType||"",rules:[]},n.handBag=t.handBaggage||"",n.checkedBag=t.checkedBaggage||"",n.isHiddenTotalCharge=!1,n.journeyFareClass=t.journeyFareClass||"",n.sessionId="",n.segments=t.segments.map(s=>({segmentKey:s.key,fareClass:s.fareClass,airline:s.airline,airlineName:s.airlineName,airlineLogo:this._flightDataService.getAirlineLogoByCode(s.airline),operating:s.operating,operatingName:s.operatingName,jetCode:s.modelAirplane,startCode:s.startPoint,endCode:s.endPoint,startPoint:s.startPointName,endPoint:s.endPointName,departDate:s.startDate,arrivalDate:s.endDate,flightNumber:s.flightNumber,modelAirplane:s.modelAirplane,modelAirplaneName:s.modelAirplaneName,stopPoint:s.stopPoint,duration:"",handBag:s.handBaggage,checkedBag:s.checkedBaggage})),n.comboRefs=t.comboRefs,n}chooseComboTicket(t,i){var a;const n=null===(a=t[0].comboRefs)||void 0===a?void 0:a.find(s=>s.key===t[1].fareOptionKey);t.forEach((s,o)=>{this.listTicketSelected[o]=this.convertComboTicketToTicketSelectedVM(s,o,i),this.listTicketSelected[o].sessionId=(null==n?void 0:n.sessionId)||""}),this.caculateTotalPrice(),this.moveToNextJourney()}chooseAgentTicket(t){var i,a;this.listTicketSelected[t.leg].airlineLogo=t.airlineLogo,this.listTicketSelected[t.leg].provider=t.provider,this.listTicketSelected[t.leg].airline=t.airline,this.listTicketSelected[t.leg].airlineName=t.airlineName,this.listTicketSelected[t.leg].operating=t.operating,this.listTicketSelected[t.leg].operatingName=t.operatingName,this.listTicketSelected[t.leg].flight=t.segmentsDisplay[0].flightNumber,this.listTicketSelected[t.leg].startTime=t.departure.localTime,this.listTicketSelected[t.leg].endTime=t.arrival.localTime,this.listTicketSelected[t.leg].expireTime=t.expireTime,this.listTicketSelected[t.leg].duration=t.durationStr,this.listTicketSelected[t.leg].numOfStop=t.numOfStop,this.listTicketSelected[t.leg].ticketPrice=t.ticketDetail,this.listTicketSelected[t.leg].selected=!0,this.listTicketSelected[t.leg].bookingType="b2b",this.listTicketSelected[t.leg].fareRule=t.fareRule,this.listTicketSelected[t.leg].journeyFareClass=(null===(i=null==t?void 0:t.fareRule)||void 0===i?void 0:i.fareClass)||"";const n=t.segmentsDisplay.flatMap(s=>{var o;const c=s.fareClasses.find(d=>d.isSelected);return c?(this.listTicketSelected[t.leg].ticketPrice=c.ticketPriceDetail,(null===(o=c.ticketPriceDetail)||void 0===o?void 0:o.totalCharge)||0):0}).reduce((s,o)=>s+o,0);this.listTicketSelected[t.leg].totalPrice=n,this.listTicketSelected[t.leg].journeyKey=t.journeyKey,this.listTicketSelected[t.leg].isHiddenTotalCharge=0===n&&"VN"===t.airline&&"agency"===this.currentMode,this.listTicketSelected[t.leg].fareOptionKey=null===(a=t.segmentsDisplay[0].fareClasses.find(s=>s.isSelected))||void 0===a?void 0:a.fareOptionKey,this.listTicketSelected[t.leg].segments=t.segmentDetails.map((s,o)=>{var c,d;return{segmentKey:s.segmentKey,fareClass:"VJ"===t.airline||"QH"===t.airline?null===(c=t.segmentsDisplay[0].fareClasses.find(u=>u.isSelected))||void 0===c?void 0:c.fareClass:null===(d=t.segmentsDisplay[o].fareClasses.find(u=>u.isSelected))||void 0===d?void 0:d.fareClass,airline:s.airline,airlineName:s.airlineName,airlineLogo:this._flightDataService.getAirlineLogoByCode(s.airline),operating:s.operating,operatingName:s.operatingName,jetCode:s.jetCode,startCode:s.startCode,endCode:s.endCode,startPoint:s.startPoint,endPoint:s.endPoint,departDate:s.departDate,arrivalDate:s.arrivalDate,flightNumber:s.flightNumber,modelAirplane:s.modelAirplane,modelAirplaneName:s.modelAirplaneName,stopPoint:s.stopPoint,duration:s.durationStr,handBag:"",checkedBag:""}}),this.listTicketDisplaySelectedAgentMobile[t.leg]=t,this.autoInactivePreview(),this.caculateTotalPrice(),this.caculateTicketSelectedNumber(),this.moveToNextJourney(),this.showTotalCharge(),this.checkShareFlight()}showTotalCharge(){this.isHiddenTotalCharge=this.listTicketSelected.some(t=>t.isHiddenTotalCharge)}reselect(t){this.listTicketSelected[t].airlineLogo="",this.listTicketSelected[t].airline="",this.listTicketSelected[t].journeyKey="",this.listTicketSelected[t].flight="",this.listTicketSelected[t].startTime=new Date,this.listTicketSelected[t].endTime=new Date,this.listTicketSelected[t].duration="",this.listTicketSelected[t].numOfStop=-1,this.listTicketSelected[t].selected=!1,this.listTicketSelected[t].totalPrice=0,this.listTicketSelected[t].segments=[],this.listTicketSelected[t].isHiddenTotalCharge=!1,this.listTicketDisplaySelectedMobile[t]=void 0,this.listTicketDisplaySelectedAgentMobile[t]=void 0,this.tabChangeIndex(t),this.caculateTotalPrice(),this.caculateTicketSelectedNumber(),this.checkShareFlight(),this.showTotalCharge(),this.ticketInfiniteScrollCount+=1}caculateTotalPrice(){var t,i;this.totalPrice=this.listTicketSelected.map(a=>a.totalPrice).reduce((a,n)=>a+n),this.totalDiscountFareCharge=this.listTicketSelected.map(a=>a.totalDiscountFarePrice).reduce((a,n)=>a+n),this.totalPriceCombo=(null===(i=null===(t=this.listTicketSelected[0].comboRefs)||void 0===t?void 0:t.find(a=>a.key===this.listTicketSelected[1].fareOptionKey))||void 0===i?void 0:i.totalAllPaxPriceCombo)||0}caculateTicketSelectedNumber(){this.ticketSelectedNumber=this.listTicketSelected.filter(t=>t.selected).length}moveToNextJourney(){const t=this.listTicketSelected.findIndex(i=>!i.selected);if(-1==t)if(this.isMobile){const i=this.listTicketSelected.some(n=>n.provider.toUpperCase()===x.QK.IVS),a=this._bottomSheetService.open(P.GM,{headerTitle:"X\xe1c nh\u1eadn chuy\u1ebfn bay \u0111\xe3 ch\u1ecdn",rightButtonIcon:"close",leftButtonIcon:"share",containerFullHeigh:!0,rightButtonIconClass:"text-neutral-gray-4",data:{ticketsSelected:this.listTicketSelected,totalPrice:this.totalPrice,totalPriceCombo:this.totalPriceCombo,hasIVSProvider:i}});a.containerInstance._leftButtonClick.subscribe(n=>{const s=this._bottomSheetService.open(P.eP,{headerTitle:"Chia s\u1ebb c\xe1c chuy\u1ebfn bay l\u1ef1a ch\u1ecdn",leftButtonIcon:"",leftButtonIconClass:"text-neutral-gray-4",rightButtonIcon:"close",containerFullHeigh:!0,data:{ticketsSelected:this.listTicketSelected,canEditHeader:this.canEditHeader,totalPrice:this.listTicketSelected.map(o=>o.totalPrice).reduce((o,c)=>o+c),isHiddenTotalCharge:this.isHiddenTotalCharge}});s.containerInstance._rightButtonClick.subscribe(o=>s.dismiss())}),a.afterDismissed().subscribe(n=>{n?(this._ticketSelectedDataProvider.ticketSelectedData=this.listTicketSelected,this._eventLogService.captureConfirmFlyBook(),this._router.navigate(["/admin/passenger-info"])):(this._eventLogService.captureConfirmFlyCancle(),"combo"===this.currentMode?(this.reselect(0),this.reselect(1)):this.reselect(this.currentLeg),this.checkShareFlight())})}else{const i=this.listTicketSelected.some(n=>n.provider.toUpperCase()===x.QK.IVS);this._modal.open(P.u9,{ticketsSelected:this.listTicketSelected,totalPrice:this.totalPrice,totalPriceCombo:this.totalPriceCombo,totalDiscountFareCharge:this.totalDiscountFareCharge,enabledBooking:[R.or.CanBookingFlightTicket,R.or.CanIssuedFlightTicket].some(n=>this._permissionService.hasPermission(n)),showSharedFlight:this.showSharedFlight,hasIVSProvider:i}).afterClosed$.subscribe({next:n=>{"backdropClick"===n.type||0==n.data?(this._eventLogService.captureConfirmFlyCancle(),"combo"===this.currentMode?(this.reselect(0),this.reselect(1)):this.reselect(this.currentLeg),this.checkShareFlight()):(this._ticketSelectedDataProvider.ticketSelectedData=this.listTicketSelected,this._eventLogService.captureConfirmFlyBook(),this._router.navigate(["/admin/passenger-info"]))}})}else this.tabChangeIndex(t)}searchFlight(){var t,i,a,n;this._mobileDetectService.collapseSidebarSubject.next(!0),this.startProgressBar();const s=this._dataProvider.searchInputData.promotion.find(d=>"VJ"===d.airline),o=this._dataProvider.searchInputData.promotion.find(d=>"QH"===d.airline),c=this._dataProvider.searchInputData.promotion.find(d=>"VN"===d.airline);this.isSearchRetailEmpty=!1,this.searchFlightLoading=!0,this._searchFlightService.searchFlight({agentPromotion:this._dataProvider.searchInputData.agentPromotion,adultCount:this.numberOfPassenger.adult,childCount:this.numberOfPassenger.child,infantCount:this.numberOfPassenger.infant,promoCodeVJ:s?s.code:"",promoCodeQH:o?o.code:"",promoCodeVN:c?c.code:"",flightsRequest:this._dataProvider.searchInputData.journey.map((d,u)=>({providers:d.airline,startPoint:d.startPoint,leg:u,endPoint:d.endPoint,departDate:(0,S.p6)(d.departDate,"yyyy-MM-dd","vi-VN")})),cabin:(null===(i=null===(t=this._searchInputService.cabinList)||void 0===t?void 0:t.find(d=>d.actived))||void 0===i?void 0:i.value)||"",paxType:(null===(n=null===(a=this._searchInputService.paxTypeList)||void 0===a?void 0:a.find(d=>d.actived))||void 0===n?void 0:n.value)||""},this._dataProvider.searchInputData.type).pipe((0,ee.x)(()=>{this.progress=100,setTimeout(()=>{this.isprogress=!1},1e3),this.searchFlightLoading=!1})).subscribe({next:d=>{var u,h,g,p,T,v,y,D,F;this.searchFlightData=d.data,!(null===(u=d.data)||void 0===u)&&u.discountPercentageDetail&&(this.discountPercentageDetail=new Map(Object.entries(null===(h=d.data)||void 0===h?void 0:h.discountPercentageDetail))),null!==(g=this.searchFlightData)&&void 0!==g&&g.flightOptions&&d.success&&null!==(p=this.searchFlightData)&&void 0!==p&&p.flightOptions.length||(this.isSearchRetailEmpty=!0),!(null===(T=this.searchFlightData)||void 0===T)&&T.flightOptions&&!(null===(v=this.searchFlightData)||void 0===v)&&v.flightOptions.length&&"COMBO"===(null===(y=this.searchFlightData)||void 0===y?void 0:y.flightOptions[0].type)&&(this.currentMode="combo"),this.listFareRule=null===(D=d.data)||void 0===D?void 0:D.fareRules,this.listFareRuleClasses=null===(F=d.data)||void 0===F?void 0:F.fareRuleClasses;try{this.convertAllTicket()}catch(b){console.log(b),this._searchFlightService.sendErrorDataSearch(JSON.stringify(d),b.message+b.stack,this._userService.currentUserSubject.value.data.displayName).subscribe({next:()=>console.log("Send error data success"),error(k){console.log("Send error data fail")}})}this.loadTicketDisplay(),"combo"===this.currentMode?this.initComboFilter():this.initFilterAirline(),this.checkQHPromotionError(),this.loadTicketFilter(),this.loadComboTicketFilter(),this.initTicketExpireTimer()},error:()=>{this.isSearchRetailEmpty=!0}})}getDiscountPercentConfig(t){let i;return this.discountPercentageDetail.has(t)&&(i=this.discountPercentageDetail.get(t)),i}syncDelayPoint(t){for(let i=0;i<t.length-1;i++)t[i+1].delay=t[i].delay,t[i].delay=0;return t}convertAllTicket(){var t,i,a;if(this.searchFlightData)if("combo"!==this.currentMode){let n=0;this.listTicket=null===(t=this.searchFlightData.flightOptions)||void 0===t?void 0:t.flatMap(s=>s.journeys.flatMap(o=>{if(!o.fareOptions)return[];["VN"].includes(null==s?void 0:s.provider)&&"VN"===o.airline&&(o.segments=this.syncDelayPoint(o.segments));const c=o.fareOptions.map(h=>{var g,p,T,v,y,D,F,b,k,f;n++;let I={handBag:"",checkedBag:""},N="";["VN"].includes(null==s?void 0:s.provider)&&"VN"===o.airline&&h.comboRefKey===h.key&&h.comboRefs&&h.comboRefs.length&&(N=h.comboRefs[0].sessionId,h.fareAmountBreakdowns=h.comboRefs[0].fareAmountBreakdowns),this._searchInputService.checkProvider(s.provider,x.QK.BSP)||this._searchInputService.checkProvider(s.provider,x.QK.AIR_1G)?(I.handBag=(null===(g=h.fareInfos[0])||void 0===g?void 0:g.carryOnBags)||"",I.checkedBag=(null===(p=h.fareInfos[0])||void 0===p?void 0:p.checkedBags)||""):I=this.getFareRuleClass(o.airline,h.fareInfos[0].fareClass,null===(T=h.fareInfos[0].fareType)||void 0===T?void 0:T.code);const Z=this.getDiscountPercentConfig(h.key);return{indexForTracking:n,sessionKey:N,provider:s.provider,airline:o.airline,airlineLogo:this._flightDataService.getAirlineLogoByCode(o.operating),mobileAirlineLogo:["VJ","VN","QH"].includes(o.operating)?"assets/airline-logo/"+o.operating+"_small.png":"assets/airline-logo/"+o.operating+".png",airlineName:o.airlineName,flightNumber:`${o.airline} ${o.segments[0].flightNumber}`,operating:o.operating,operatingName:o.operatingName,stopStatus:o.numOfStops,duration:o.duration,durationStr:o.getDurationString(),startPoint:o.departure.airport.code,endPoint:o.arrival.airport.code,startTime:m(o.departure.localTime).toDate(),endTime:m(o.arrival.localTime).toDate(),expireTime:o.expireTime,totalPrice:h.getTotalAmount(),get totalDiscountFarePrice(){return this.totalPrice-h.getDiscountByBaseFare("ADULT",o.airline,Z&&Z.adtPercentage||0,Z&&Z.adtAmount||0)},netPrice:h.getNetAmount(this.numberOfPassenger.adult,this.numberOfPassenger.child),serviceFee:h.getServiceFee(),promotionalPrice:0!==h.getDiscount()?h.getTotalAmount()+h.getDiscount():void 0,currency:h.currency?h.currency.code:"VN\u0110",fareClass:h.fareInfos[0].fareClass,fareType:null===(v=h.fareInfos[0].fareType)||void 0===v?void 0:v.code,journeyFareClass:h.journeyFareClass,handBag:w(I.handBag)?I.handBag:"",checkedBag:w(I.checkedBag)?I.checkedBag:"",seatRemain:h.fareInfos[0].seatRemain,cabin:null===(y=h.fareInfos[0].cabin)||void 0===y?void 0:y.description,cabinName:(null===(F=null===(D=h.fareInfos[0].cabin)||void 0===D?void 0:D.name)||void 0===F?void 0:F.toLowerCase())||"null",isLowestFare:!1,isLowestFareAvailable:!1,leg:o.leg,departure:{scheduleTime:m(1e3*o.departure.scheduleTime).toDate(),airport:o.departure.airport.code,localTime:m(o.departure.localTime).toDate()},arrival:{scheduleTime:m(1e3*o.arrival.scheduleTime).toDate(),airport:o.arrival.airport.code,localTime:m(o.arrival.localTime).toDate()},journeyKey:o.key,fareOptionKey:h.key,segments:o.segments.map((E,st)=>{var ke;const lt=E.getDelayString();return{segmentKey:E.key,fareClass:h.fareInfos[st].fareClass,fareType:(null===(ke=h.fareInfos[st].fareType)||void 0===ke?void 0:ke.description)||"",airline:E.airline,airlineName:E.airlineName,mobileAirlineLogo:["VJ","VN","QH"].includes(E.operating)?"assets/airline-logo/"+E.operating+"_small.png":"assets/airline-logo/"+E.operating+".png",operating:E.operating,operatingName:E.operatingName,airlineLogo:this._flightDataService.getAirlineLogoByCode(E.operating),jetCode:"N/A",startCode:E.departure.airport.code,endCode:E.arrival.airport.code,startPoint:this._locationDataService.getCityNameByCode(E.departure.airport.code),endPoint:this._locationDataService.getCityNameByCode(E.arrival.airport.code),departDate:m(E.departure.localTime).toDate(),arrivalDate:m(E.arrival.localTime).toDate(),flightNumber:E.flightNumber,duration:E.getDurationString(),modelAirplane:E.modelAirplane,modelAirplaneName:E.modelAirplaneName,delay:E.getDelayString(),stopPoint:lt?`D\u1eebng t\u1ea1i: ${this._locationDataService.getAirportNameByCode(E.departure.airport.code)} (${E.departure.airport.code}). Th\u1eddi gian d\u1eebng: ${lt}`:"",handBag:w(I.handBag)?I.handBag:"",checkedBag:w(I.checkedBag)?I.checkedBag:""}}),showSalePrice:this.ticketDisplayState.value.showSalePrice,showNetPrice:this.ticketDisplayState.value.showNetPrice,hasDiscountFare:!!Z,showDiscountFare:this.ticketDisplayState.value.showDiscountFare,hideFareClass:this.ticketDisplayState.value.hideFareClass,showDuration:this.ticketDisplayState.value.showDuration,ticketDetail:this.getTicketDetail(h,o.airline,Z),lccFare:h.lccFare,ndcFare:h.ndcFare,privateFare:h.privateFare,refundableFare:h.refundableFare,paxType:null!==(f=null===(k=null===(b=this._dataProvider.searchInputData)||void 0===b?void 0:b.journey[0])||void 0===k?void 0:k.paxType)&&void 0!==f?f:"",ndcTimeLimit$:h.ndcFare?h.ndcTimeLimitCountDown$():(0,Q.of)(0),isDisabledTicket$:h.ndcFare?h.ndcTimeLimitCountDown$().pipe((0,Y.d)(0),(0,q.U)(E=>E<6e4)):(0,Q.of)(!1),food:!1}}),d=Ee.groupBy(c,"cabinName");for(const h of Object.keys(d)){const p=Math.min(...d[h].map(T=>T.totalPrice));c.filter(T=>T.cabinName===h).forEach(T=>{T.isLowestFare=T.totalPrice===p})}const u=Math.min(...c.filter(h=>h.seatRemain).map(h=>h.totalPrice));return c.forEach(h=>{h.isLowestFareAvailable=h.totalPrice===u}),c})).sort((s,o)=>s.totalPrice-o.totalPrice).sort((s,o)=>s.stopStatus-o.stopStatus),this.listTicketAgent=null===(i=this.searchFlightData.flightOptions)||void 0===i?void 0:i.filter(s=>!["GDS"].includes(s.provider)).flatMap((s,o)=>this.convertAgentTicket(s,o)).sort((s,o)=>s.numOfStop-o.numOfStop)}else this.listTicketCombo=null===(a=this.searchFlightData.flightOptions)||void 0===a?void 0:a.filter(n=>n.comboInfo.arriveJourneys[0].fareOptions).map((n,s)=>this.convertComboTicket(n,s))}convertComboTicket(t,i){var a,n;let s={handBag:"",checkedBag:""};if("GDS"===t.provider)return{indexForTracking:i,provider:t.provider,showTotalPrice:this.ticketDisplayState.value.showTotalComboPrice,departOptions:t.comboInfo.departJourneys.map((o,c)=>{var d,u,h;const g=this.getDiscountPercentConfig(o.fareOptions[0].key);return{selected:0===c,airline:o.airline,airlineLogo:this._flightDataService.getAirlineLogoByCode(o.airline),operating:o.operating,operatingName:o.operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(o.airline)?"assets/airline-logo/"+o.airline+"_small.png":"assets/airline-logo/"+o.airline+".png",airlineName:o.airlineName,departureDate:m(o.departure.localTime).toDate(),returnDate:m(o.arrival.localTime).toDate(),durationStr:o.getDurationString(),duration:o.duration,startPoint:o.departure.airport.code,startPointName:this._locationDataService.getCityNameByCode(o.departure.airport.code),endPointName:this._locationDataService.getCityNameByCode(o.arrival.airport.code),endPoint:o.arrival.airport.code,expireTime:o.expireTime,flightNumber:`${o.airline} ${o.segments[0].flightNumber}`,totalPrice:o.fareOptions[0].getTotalAmount(),totalDiscountFarePrice:0,totalAllPaxPrice:o.fareOptions[0].getTotalAmountAllPax(this.numberOfPassenger.adult,this.numberOfPassenger.child),stops:o.getStopList().map(p=>Object.assign(Object.assign({},p),{country:this._locationDataService.getCityNameByCode(p.airport)})),numOfStop:o.numOfStops,stopOvernight:o.stopOvernight,returnDateTooltip:"H\u1ea1 c\xe1nh ng\xe0y "+(0,S.p6)(new Date(o.arrival.localTime),"dd/MM/yyyy","vi-VN"),ticketPrice:this.getTicketDetail(o.fareOptions[0],o.airline,g),provider:t.provider,fareOptionKey:o.fareOptions[0].key,journeyKey:o.key,comboRefs:[],segments:o.segments.map((p,T)=>{var v;const y=p.getDelayString();return{airline:p.airline,airlineSystem:p.airline,airlineName:p.airlineName,airlineLogo:this._flightDataService.getAirlineLogoByCode(p.airline),operating:p.operating,operatingName:p.operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(p.airline)?"assets/airline-logo/"+p.airline+"_small.png":"assets/airline-logo/"+p.airline+".png",flightNumber:`${p.flightNumber}`,startDate:m(p.departure.localTime).toDate(),startPoint:p.departure.airport.code,startPointName:this._locationDataService.getCityNameByCode(p.departure.airport.code),endDate:m(p.arrival.localTime).toDate(),endPoint:p.arrival.airport.code,endPointName:this._locationDataService.getCityNameByCode(p.arrival.airport.code),rules:[],modelAirplane:p.modelAirplane,modelAirplaneName:p.modelAirplaneName,key:p.key,durationStr:p.getDurationString(),delay:y,stopPoint:y?`D\u1eebng t\u1ea1i: ${this._locationDataService.getAirportNameByCode(p.departure.airport.code)} (${p.departure.airport.code}). Th\u1eddi gian d\u1eebng: ${y}`:"",fareClass:o.fareOptions[0].fareInfos[T].fareClass,fareType:null===(v=o.fareOptions[0].fareInfos[T].fareType)||void 0===v?void 0:v.description,handBaggage:w(s.handBag)?s.handBag:"",checkedBaggage:w(s.checkedBag)?s.checkedBag:"",food:!1}}),lccFare:o.fareOptions[0].lccFare,ndcFare:o.fareOptions[0].ndcFare,privateFare:o.fareOptions[0].privateFare,refundableFare:o.fareOptions[0].refundableFare,ndcTimeLimit$:o.fareOptions[0].ndcFare?o.fareOptions[0].ndcTimeLimitCountDown$():(0,Q.of)(0),isDisabledTicket$:o.fareOptions[0].ndcFare?o.fareOptions[0].ndcTimeLimitCountDown$().pipe((0,Y.d)(0),(0,q.U)(p=>p<6e4)):(0,Q.of)(!1),paxType:null!==(h=null===(u=null===(d=this._dataProvider.searchInputData)||void 0===d?void 0:d.journey[0])||void 0===u?void 0:u.paxType)&&void 0!==h?h:"",handBaggage:w(s.handBag)?s.handBag:"",checkedBaggage:w(s.checkedBag)?s.checkedBag:"",food:!1}}),arriveOptions:t.comboInfo.arriveJourneys.map((o,c)=>{var d,u,h;const g=this.getDiscountPercentConfig(o.fareOptions[0].key);return{selected:0===c,airline:o.airline,airlineLogo:this._flightDataService.getAirlineLogoByCode(o.airline),operating:o.operating,operatingName:o.operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(o.airline)?"assets/airline-logo/"+o.airline+"_small.png":"assets/airline-logo/"+o.airline+".png",airlineName:o.airlineName,departureDate:m(o.departure.localTime).toDate(),returnDate:m(o.arrival.localTime).toDate(),durationStr:o.getDurationString(),duration:o.duration,startPoint:o.departure.airport.code,startPointName:this._locationDataService.getCityNameByCode(o.departure.airport.code),endPointName:this._locationDataService.getCityNameByCode(o.arrival.airport.code),endPoint:o.arrival.airport.code,expireTime:o.expireTime,flightNumber:`${o.airline} ${o.segments[0].flightNumber}`,totalPrice:0,totalDiscountFarePrice:0,totalAllPaxPrice:0,stops:o.getStopList().map(p=>Object.assign(Object.assign({},p),{country:this._locationDataService.getCityNameByCode(p.airport)})),numOfStop:o.numOfStops,stopOvernight:o.stopOvernight,returnDateTooltip:"H\u1ea1 c\xe1nh ng\xe0y "+(0,S.p6)(new Date(o.arrival.localTime),"dd/MM/yyyy","vi-VN"),ticketPrice:this.getTicketDetail(new Ie.YY,o.airline,g),provider:t.provider,fareOptionKey:o.fareOptions[0].key,journeyKey:o.key,comboRefs:[],segments:o.segments.map((p,T)=>{var v;const y=p.getDelayString();return{airline:p.airline,airlineSystem:p.airline,airlineName:p.airlineName,airlineLogo:this._flightDataService.getAirlineLogoByCode(p.airline),operating:p.operating,operatingName:p.operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(p.airline)?"assets/airline-logo/"+p.airline+"_small.png":"assets/airline-logo/"+p.airline+".png",flightNumber:`${p.flightNumber}`,startDate:m(p.departure.localTime).toDate(),startPoint:p.departure.airport.code,startPointName:this._locationDataService.getCityNameByCode(p.departure.airport.code),endDate:m(p.arrival.localTime).toDate(),endPoint:p.arrival.airport.code,endPointName:this._locationDataService.getCityNameByCode(p.arrival.airport.code),rules:[],modelAirplane:p.modelAirplane,modelAirplaneName:p.modelAirplaneName,key:p.key,durationStr:p.getDurationString(),delay:y,stopPoint:y?`D\u1eebng t\u1ea1i: ${this._locationDataService.getAirportNameByCode(p.departure.airport.code)} (${p.departure.airport.code}). Th\u1eddi gian d\u1eebng: ${y}`:"",fareClass:o.fareOptions[0].fareInfos[T].fareClass,fareType:null===(v=o.fareOptions[0].fareInfos[T].fareType)||void 0===v?void 0:v.description,handBaggage:w(s.handBag)?s.handBag:"",checkedBaggage:w(s.checkedBag)?s.checkedBag:"",food:!1}}),lccFare:o.fareOptions[0].lccFare,ndcFare:o.fareOptions[0].ndcFare,privateFare:o.fareOptions[0].privateFare,refundableFare:o.fareOptions[0].refundableFare,paxType:null!==(h=null===(u=null===(d=this._dataProvider.searchInputData)||void 0===d?void 0:d.journey[0])||void 0===u?void 0:u.paxType)&&void 0!==h?h:"",ndcTimeLimit$:o.fareOptions[0].ndcFare?o.fareOptions[0].ndcTimeLimitCountDown$():(0,Q.of)(0),isDisabledTicket$:o.fareOptions[0].ndcFare?o.fareOptions[0].ndcTimeLimitCountDown$().pipe((0,Y.d)(0),(0,q.U)(p=>p<6e4)):(0,Q.of)(!1),verifyState:"UNCHECKED",handBaggage:w(s.handBag)?s.handBag:"",checkedBaggage:w(s.checkedBag)?s.checkedBag:"",food:!1}}),score:t.comboInfo.score,bestChoice:t.comboInfo.bestChoice,fastest:t.comboInfo.fastest,cheapest:t.comboInfo.cheapest,soldOut:!1,hasDiscountFare:!1,showDiscountFare:this.ticketDisplayState.value.showDiscountFare};{const o=t.comboInfo.departJourneys[0].fareOptions.every(u=>!u.fareInfos[0].seatRemain)||t.comboInfo.arriveJourneys[0].fareOptions.every(u=>!u.fareInfos[0].seatRemain),c=t.comboInfo.departJourneys[0].fareOptions.some(u=>u.comboRefs);this._searchInputService.checkProvider(t.provider,x.QK.VN)&&"VN"===t.comboInfo.departJourneys[0].airline&&(t.comboInfo.departJourneys[0].segments=this.syncDelayPoint(t.comboInfo.departJourneys[0].segments)),this._searchInputService.checkProvider(t.provider,x.QK.VN)&&"VN"===t.comboInfo.arriveJourneys[0].airline&&(t.comboInfo.arriveJourneys[0].segments=this.syncDelayPoint(t.comboInfo.arriveJourneys[0].segments));const d=this.getDiscountPercentConfig(null===(n=null===(a=t.comboInfo.lowestComboOption)||void 0===a?void 0:a.lowestDepartOption)||void 0===n?void 0:n.fareOptionKey);return{indexForTracking:"VN"!==t.provider||c?i:-1,provider:t.provider,showTotalPrice:this.ticketDisplayState.value.showTotalComboPrice,hasDiscountFare:!!d,showDiscountFare:this.ticketDisplayState.value.showDiscountFare,departOptions:t.comboInfo.departJourneys[0].fareOptions.map((u,h)=>{var g,p,T,v,y,D,F,b,k;return this._searchInputService.checkProvider(t.provider,x.QK.BSP)||this._searchInputService.checkProvider(t.provider,x.QK.AIR_1G)?(s.handBag=(null===(g=u.fareInfos[0])||void 0===g?void 0:g.carryOnBags)||"",s.checkedBag=(null===(p=u.fareInfos[0])||void 0===p?void 0:p.checkedBags)||""):s=this.getFareRuleClass(t.comboInfo.departJourneys[0].airline,u.fareInfos[0].fareClass,null===(T=u.fareInfos[0].fareType)||void 0===T?void 0:T.code),{selected:0===h,airline:t.comboInfo.departJourneys[0].airline,airlineLogo:this._flightDataService.getAirlineLogoByCode(t.comboInfo.departJourneys[0].airline),operating:t.comboInfo.departJourneys[0].operating,operatingName:t.comboInfo.departJourneys[0].operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(t.comboInfo.departJourneys[0].airline)?"assets/airline-logo/"+t.comboInfo.departJourneys[0].airline+"_small.png":"assets/airline-logo/"+t.comboInfo.departJourneys[0].airline+".png",airlineName:t.comboInfo.departJourneys[0].airlineName,departureDate:m(t.comboInfo.departJourneys[0].departure.localTime).toDate(),returnDate:m(t.comboInfo.departJourneys[0].arrival.localTime).toDate(),durationStr:t.comboInfo.departJourneys[0].getDurationString(),duration:t.comboInfo.departJourneys[0].duration,startPoint:t.comboInfo.departJourneys[0].departure.airport.code,startPointName:this._locationDataService.getCityNameByCode(t.comboInfo.departJourneys[0].departure.airport.code),endPointName:this._locationDataService.getCityNameByCode(t.comboInfo.departJourneys[0].arrival.airport.code),endPoint:t.comboInfo.departJourneys[0].arrival.airport.code,expireTime:t.comboInfo.departJourneys[0].expireTime,flightNumber:`${t.comboInfo.departJourneys[0].airline} ${t.comboInfo.departJourneys[0].segments[0].flightNumber}`,totalPrice:u.getTotalAmount(),totalDiscountFarePrice:u.getTotalAmount()-u.getDiscountByBaseFare("ADULT",t.comboInfo.departJourneys[0].airline,d&&d.adtPercentage||0,d&&d.adtAmount||0),totalAllPaxPrice:u.getTotalAmountAllPax(this.numberOfPassenger.adult,this.numberOfPassenger.child),stops:t.comboInfo.departJourneys[0].getStopList().map(f=>Object.assign(Object.assign({},f),{country:this._locationDataService.getCityNameByCode(f.airport)})),numOfStop:t.comboInfo.departJourneys[0].numOfStops,stopOvernight:t.comboInfo.departJourneys[0].stopOvernight,fareClass:u.fareInfos[0].fareClass,fareType:u.fareInfos[0].fareType.code,seatRemain:u.fareInfos[0].seatRemain,journeyFareClass:u.journeyFareClass,cabin:null===(v=u.fareInfos[0].cabin)||void 0===v?void 0:v.code,cabinName:null===(D=null===(y=u.fareInfos[0].cabin)||void 0===y?void 0:y.name)||void 0===D?void 0:D.toLowerCase(),returnDateTooltip:"H\u1ea1 c\xe1nh ng\xe0y "+(0,S.p6)(new Date(t.comboInfo.departJourneys[0].arrival.localTime),"dd/MM/yyyy","vi-VN"),ticketPrice:this.getTicketDetail(u,t.comboInfo.departJourneys[0].airline,d),provider:t.provider,fareOptionKey:u.key,journeyKey:t.comboInfo.departJourneys[0].key,comboRefKey:u.comboRefKey,comboRefs:t.comboInfo.arriveJourneys[0].fareOptions.map(f=>{var I;const N=null===(I=u.comboRefs)||void 0===I?void 0:I.find(Z=>Z.key[0]===f.key);return{key:f.key,sessionId:N?N.sessionId:"",verifyState:N&&N.sessionId?"CHECKED":"UNCHECKED",totalPriceCombo:N?N.getTotalAmount():0,totalAllPaxPriceCombo:N?N.getTotalAmountAllPax(this.numberOfPassenger.adult,this.numberOfPassenger.child):0,ticketPrice:N?this.getTicketDetail(N,t.comboInfo.departJourneys[0].airline,d):null}}),segments:t.comboInfo.departJourneys[0].segments.map((f,I)=>{var N;const Z=f.getDelayString();return{airline:f.airline,airlineSystem:f.airline,airlineName:f.airlineName,airlineLogo:this._flightDataService.getAirlineLogoByCode(f.airline),operating:f.operating,operatingName:f.operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(f.airline)?"assets/airline-logo/"+f.airline+"_small.png":"assets/airline-logo/"+f.airline+".png",flightNumber:`${f.flightNumber}`,startDate:m(f.departure.localTime).toDate(),startPoint:f.departure.airport.code,startPointName:this._locationDataService.getCityNameByCode(f.departure.airport.code),endDate:m(f.arrival.localTime).toDate(),endPoint:f.arrival.airport.code,endPointName:this._locationDataService.getCityNameByCode(f.arrival.airport.code),rules:[],modelAirplane:f.modelAirplane,modelAirplaneName:f.modelAirplaneName,key:f.key,durationStr:f.getDurationString(),delay:Z,stopPoint:Z?`D\u1eebng t\u1ea1i: ${this._locationDataService.getAirportNameByCode(f.departure.airport.code)} (${f.departure.airport.code}). Th\u1eddi gian d\u1eebng: ${Z}`:"",fareClass:u.fareInfos[I].fareClass,fareType:null===(N=u.fareInfos[I].fareType)||void 0===N?void 0:N.description,handBaggage:w(s.handBag)?s.handBag:"",checkedBaggage:w(s.checkedBag)?s.checkedBag:"",food:!1}}),lccFare:u.lccFare,ndcFare:u.ndcFare,privateFare:u.privateFare,refundableFare:u.refundableFare,ndcTimeLimit$:u.ndcFare?u.ndcTimeLimitCountDown$():(0,Q.of)(0),isDisabledTicket$:u.ndcFare?u.ndcTimeLimitCountDown$().pipe((0,Y.d)(0),(0,q.U)(f=>f<6e4)):(0,Q.of)(!1),paxType:null!==(k=null===(b=null===(F=this._dataProvider.searchInputData)||void 0===F?void 0:F.journey[0])||void 0===b?void 0:b.paxType)&&void 0!==k?k:"",handBaggage:w(s.handBag)?s.handBag:"",checkedBaggage:w(s.checkedBag)?s.checkedBag:"",food:!1}}),arriveOptions:t.comboInfo.arriveJourneys[0].fareOptions.map((u,h)=>{var g,p,T,v,y,D,F,b,k;return this._searchInputService.checkProvider(t.provider,x.QK.BSP)||this._searchInputService.checkProvider(t.provider,x.QK.AIR_1G)?(s.handBag=(null===(g=u.fareInfos[0])||void 0===g?void 0:g.carryOnBags)||"",s.checkedBag=(null===(p=u.fareInfos[0])||void 0===p?void 0:p.checkedBags)||""):s=this.getFareRuleClass(t.comboInfo.departJourneys[0].airline,u.fareInfos[0].fareClass,null===(T=u.fareInfos[0].fareType)||void 0===T?void 0:T.code),{selected:0===h,airline:t.comboInfo.arriveJourneys[0].airline,airlineLogo:this._flightDataService.getAirlineLogoByCode(t.comboInfo.arriveJourneys[0].airline),operating:t.comboInfo.arriveJourneys[0].operating,operatingName:t.comboInfo.arriveJourneys[0].operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(t.comboInfo.arriveJourneys[0].airline)?"assets/airline-logo/"+t.comboInfo.arriveJourneys[0].airline+"_small.png":"assets/airline-logo/"+t.comboInfo.arriveJourneys[0].airline+".png",airlineName:t.comboInfo.arriveJourneys[0].airlineName,departureDate:m(t.comboInfo.arriveJourneys[0].departure.localTime).toDate(),returnDate:m(t.comboInfo.arriveJourneys[0].arrival.localTime).toDate(),durationStr:t.comboInfo.arriveJourneys[0].getDurationString(),duration:t.comboInfo.arriveJourneys[0].duration,startPoint:t.comboInfo.arriveJourneys[0].departure.airport.code,startPointName:this._locationDataService.getCityNameByCode(t.comboInfo.arriveJourneys[0].departure.airport.code),endPointName:this._locationDataService.getCityNameByCode(t.comboInfo.arriveJourneys[0].arrival.airport.code),endPoint:t.comboInfo.arriveJourneys[0].arrival.airport.code,expireTime:t.comboInfo.arriveJourneys[0].expireTime,flightNumber:`${t.comboInfo.arriveJourneys[0].airline} ${t.comboInfo.arriveJourneys[0].segments[0].flightNumber}`,totalPrice:u.getTotalAmount(),totalDiscountFarePrice:u.getTotalAmount()-u.getDiscountByBaseFare("ADULT",t.comboInfo.departJourneys[0].airline,d&&d.adtPercentage||0,d&&d.adtAmount||0),totalAllPaxPrice:u.getTotalAmountAllPax(this.numberOfPassenger.adult,this.numberOfPassenger.child),stops:t.comboInfo.arriveJourneys[0].getStopList().map(f=>Object.assign(Object.assign({},f),{country:this._locationDataService.getCityNameByCode(f.airport)})),numOfStop:t.comboInfo.arriveJourneys[0].numOfStops,stopOvernight:t.comboInfo.arriveJourneys[0].stopOvernight,fareClass:u.fareInfos[0].fareClass,fareType:u.fareInfos[0].fareType.code,seatRemain:u.fareInfos[0].seatRemain,journeyFareClass:u.journeyFareClass,cabin:null===(v=u.fareInfos[0].cabin)||void 0===v?void 0:v.code,cabinName:null===(D=null===(y=u.fareInfos[0].cabin)||void 0===y?void 0:y.name)||void 0===D?void 0:D.toLowerCase(),returnDateTooltip:"H\u1ea1 c\xe1nh ng\xe0y "+(0,S.p6)(new Date(t.comboInfo.arriveJourneys[0].arrival.localTime),"dd/MM/yyyy","vi-VN"),ticketPrice:this.getTicketDetail(u,t.comboInfo.arriveJourneys[0].airline,d),provider:t.provider,fareOptionKey:u.key,journeyKey:t.comboInfo.arriveJourneys[0].key,comboRefKey:u.comboRefKey,comboRefs:[],segments:t.comboInfo.arriveJourneys[0].segments.map((f,I)=>{var N;const Z=f.getDelayString();return{airline:f.airline,airlineSystem:f.airline,airlineName:f.airlineName,airlineLogo:this._flightDataService.getAirlineLogoByCode(f.airline),operating:f.operating,operatingName:f.operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(f.airline)?"assets/airline-logo/"+f.airline+"_small.png":"assets/airline-logo/"+f.airline+".png",flightNumber:`${f.flightNumber}`,startDate:m(f.departure.localTime).toDate(),startPoint:f.departure.airport.code,startPointName:this._locationDataService.getCityNameByCode(f.departure.airport.code),endDate:m(f.arrival.localTime).toDate(),endPoint:f.arrival.airport.code,endPointName:this._locationDataService.getCityNameByCode(f.arrival.airport.code),rules:[],modelAirplane:f.modelAirplane,modelAirplaneName:f.modelAirplaneName,key:f.key,durationStr:f.getDurationString(),delay:Z,stopPoint:Z?`D\u1eebng t\u1ea1i: ${this._locationDataService.getAirportNameByCode(f.departure.airport.code)} (${f.departure.airport.code}). Th\u1eddi gian d\u1eebng: ${Z}`:"",fareClass:u.fareInfos[I].fareClass,fareType:null===(N=u.fareInfos[I].fareType)||void 0===N?void 0:N.description,handBaggage:w(s.handBag)?s.handBag:"",checkedBaggage:w(s.checkedBag)?s.checkedBag:"",food:!1}}),lccFare:u.lccFare,ndcFare:u.ndcFare,privateFare:u.privateFare,refundableFare:u.refundableFare,ndcTimeLimit$:u.ndcFare?u.ndcTimeLimitCountDown$():(0,Q.of)(0),isDisabledTicket$:u.ndcFare?u.ndcTimeLimitCountDown$().pipe((0,Y.d)(0),(0,q.U)(f=>f<6e4)):(0,Q.of)(!1),paxType:null!==(k=null===(b=null===(F=this._dataProvider.searchInputData)||void 0===F?void 0:F.journey[0])||void 0===b?void 0:b.paxType)&&void 0!==k?k:"",handBaggage:w(s.handBag)?s.handBag:"",checkedBaggage:w(s.checkedBag)?s.checkedBag:"",food:!1}}),score:t.comboInfo.score,bestChoice:t.comboInfo.bestChoice,fastest:t.comboInfo.fastest,cheapest:t.comboInfo.cheapest,soldOut:o}}}convertAgentTicket(t,i,a=""){return t.journeys.flatMap((n,s)=>(t.provider===x.QK.VN&&"VN"===n.airline&&(n.segments=this.syncDelayPoint(n.segments)),{indexForTracking:`${a}_${i}_${s}`,provider:t.provider,airline:n.airline,airlineName:this._flightDataService.getAirlineNameByCode(n.airline),airlineLogo:this._flightDataService.getAirlineLogoByCode(n.airline),mobileAirlineLogo:["VJ","VN","QH"].includes(n.airline)?"assets/airline-logo/"+n.airline+"_small.png":"assets/airline-logo/"+n.airline+".png",operating:n.operating,operatingName:n.operatingName,flightNumber:`${n.airline} ${n.segments[0].flightNumber}`,departure:{scheduleTime:m(1e3*n.departure.scheduleTime).toDate(),airport:n.departure.airport.code,localTime:m(n.departure.localTime).toDate()},arrival:{scheduleTime:m(1e3*n.arrival.scheduleTime).toDate(),airport:n.arrival.airport.code,localTime:m(n.arrival.localTime).toDate()},startPoint:n.departure.airport.code,endPoint:n.arrival.airport.code,duration:n.duration,expireTime:n.expireTime,durationStr:n.getDurationString(),numOfStop:n.numOfStops,numberOfSegment:n.segments.length,leg:n.leg,journeyKey:n.key,lookupSeatReamin:"VN"===n.airline,fareRule:this.listFareRule.find(o=>o.airline===n.airline)||null,segmentDetails:n.segments.map((o,c,d)=>{const u=o.getDelayString();return{segmentKey:o.key,airline:o.airline,airlineName:this._flightDataService.getAirlineNameByCode(o.airline),airlineLogo:this._flightDataService.getAirlineLogoByCode(n.airline),mobileAirlineLogo:["VJ","VN","QH"].includes(o.airline)?"assets/airline-logo/"+o.airline+"_small.png":"assets/airline-logo/"+o.airline+".png",jetCode:"N/A",startCode:o.departure.airport.code,endCode:o.arrival.airport.code,startPoint:this._locationDataService.getCityNameByCode(o.departure.airport.code),endPoint:this._locationDataService.getCityNameByCode(o.arrival.airport.code),departDate:m(o.departure.localTime).toDate(),arrivalDate:m(o.arrival.localTime).toDate(),flightNumber:o.flightNumber,duration:o.duration,durationStr:o.getDurationString(),modelAirplane:o.modelAirplane,modelAirplaneName:o.modelAirplaneName,operating:o.operating,operatingName:o.operatingName,handBag:"",checkedBag:"",stopPoint:u?`D\u1eebng t\u1ea1i: ${this._locationDataService.getAirportNameByCode(o.departure.airport.code)} (${o.departure.airport.code}). Th\u1eddi gian d\u1eebng: ${u}`:""}}),segmentsDisplay:n.segments.map(o=>({airline:o.airline,airlineLogo:this._flightDataService.getAirlineLogoByCode(o.airline),flightNumber:`${o.airline} ${o.flightNumber}`,jetCode:"N/A",operating:o.operating,startPoint:o.departure.airport.code,endPoint:o.arrival.airport.code,segmentKey:o.key,fareClasses:n.fareOptions.map(c=>{const d=this.getDiscountPercentConfig(c.key||"");return{totalPrice:c.getTotalAmount(),isExistPrice:!0,currency:c.currency?c.currency.code:"VN\u0110",segmentIndex:o.index,fareType:c.fareInfos[0].fareType.description,seatRemain:c.fareInfos[0].seatRemain,fareClass:c.fareInfos[0].fareClass,isSelected:!1,fareOptionKey:c.key,ticketPriceDetail:this.getTicketDetail(c,n.airline,d)}}),departure:{scheduleTime:m(1e3*o.departure.scheduleTime).toDate(),airport:o.departure.airport.code,localTime:m(o.departure.localTime).toDate()},arrival:{scheduleTime:m(1e3*o.arrival.scheduleTime).toDate(),airport:o.arrival.airport.code,localTime:m(o.arrival.localTime).toDate()}}))}))}ticketTrackByFn(t,i){return i.indexForTracking}getRandomInt(t,i){return Math.floor(Math.random()*(i-t+1)+t)}loadTicketDisplay(){this.loadClientTicketDisplay(),this.loadAgentTicketDisplay(),this.loadComboTicketDisplay()}loadClientTicketDisplay(){var t;this.listTicketDisplay=(null!==(t=this.listTicketDisplay)&&void 0!==t&&t.length?this.listTicketDisplay:this.listTicket).filter(i=>i.leg===this.currentLeg).map(i=>Object.assign(Object.assign({},i),{showSalePrice:this.ticketDisplayState.value.showSalePrice,showNetPrice:this.ticketDisplayState.value.showNetPrice,hideFareClass:this.ticketDisplayState.value.hideFareClass,showDuration:this.ticketDisplayState.value.showDuration,showDiscountFare:this.ticketDisplayState.value.showDiscountFare})),console.log(this.listTicketDisplay),this.processSort()}loadAgentTicketDisplay(){this.listTicketAgentDisplay=this.listTicketAgent}loadComboTicketDisplay(){this.listTicketComboDisplay=(this.listTicketComboDisplay?this.listTicketComboDisplay:this.listTicketCombo).map(t=>Object.assign(Object.assign({},t),{showDiscountFare:this.ticketDisplayState.value.showDiscountFare,showTotalPrice:this.ticketDisplayState.value.showTotalComboPrice})),this.loadTabDataCombo(),this.processSortCombo()}loadTabDataCombo(){if(0===this.listTicketCombo.length)return;const t=this.listTicketCombo.sort((n,s)=>n.departOptions[0].duration+n.arriveOptions[0].duration-(s.departOptions[0].duration+s.arriveOptions[0].duration))[0];this.tabComboDetail.fastest.price=t.departOptions[0].totalPrice+t.arriveOptions[0].totalPrice,this.tabComboDetail.fastest.durationStr=t.departOptions[0].durationStr;const i=this.listTicketCombo.sort((n,s)=>n.departOptions[0].totalPrice+n.arriveOptions[0].totalPrice-(s.departOptions[0].totalPrice+s.arriveOptions[0].totalPrice))[0];this.tabComboDetail.cheapest.price=i.departOptions[0].totalPrice+i.arriveOptions[0].totalPrice,this.tabComboDetail.cheapest.durationStr=i.departOptions[0].durationStr;const a=this.listTicketCombo.sort((n,s)=>s.score-n.score)[0];this.tabComboDetail.best.price=a.departOptions[0].totalPrice+a.arriveOptions[0].totalPrice,this.tabComboDetail.best.durationStr=a.departOptions[0].durationStr}loadTicketFilter(){this.listTicketDisplay=this.listTicket.filter(t=>t.leg===this.currentLeg).filter(t=>!(!(this.ticketFilterState.value.lccFare&&t.lccFare||this.ticketFilterState.value.ndcFare&&t.ndcFare||this.ticketFilterState.value.privateFare&&t.privateFare)&&(this.ticketFilterState.value.lccFare||this.ticketFilterState.value.ndcFare||this.ticketFilterState.value.privateFare))).filter(t=>0===this.ticketFilterState.value.showAirline.length||this.ticketFilterState.value.showAirline.includes(t.airline)).filter(t=>!!(!this.ticketFilterState.value.direct&&!this.ticketFilterState.value.oneRoute&&!this.ticketFilterState.value.moreRoute||this.ticketFilterState.value.direct&&0===t.stopStatus||this.ticketFilterState.value.oneRoute&&1===t.stopStatus||this.ticketFilterState.value.moreRoute&&t.stopStatus>1)).filter(t=>{if(0===t.leg){const i=60*t.departure.localTime.getHours()+t.departure.localTime.getMinutes();if(i<this.ticketFilterState.value.comboTime.departStartTime.from||i>this.ticketFilterState.value.comboTime.departStartTime.to)return!1;const a=60*t.arrival.localTime.getHours()+t.arrival.localTime.getMinutes();if(a<this.ticketFilterState.value.comboTime.departEndTime.from||a>this.ticketFilterState.value.comboTime.departEndTime.to)return!1}if(1===t.leg){const i=60*t.departure.localTime.getHours()+t.departure.localTime.getMinutes(),a=60*t.arrival.localTime.getHours()+t.arrival.localTime.getMinutes();if(i<this.ticketFilterState.value.comboTime.arriveStartTime.from||i>this.ticketFilterState.value.comboTime.arriveStartTime.to||a<this.ticketFilterState.value.comboTime.arriveEndTime.from||a>this.ticketFilterState.value.comboTime.arriveEndTime.to)return!1}return!0}).filter(t=>{var i,a;return t.seatRemain?this.ticketFilterState.value.fareclass.length>0&&"GDS"!==t.provider?this.ticketFilterState.value.fareclass.indexOf(null===(i=t.cabinName)||void 0===i?void 0:i.toUpperCase())>=0&&t.isLowestFare:null!==(a=this.ticketFilterState.value.fareclass)&&void 0!==a&&a.length||"GDS"===t.provider?t.isLowestFare:t.isLowestFareAvailable:t}).filter(t=>!(this.ticketFilterState.value.plane.length>0)||t.segments.map(i=>this.ticketFilterState.value.plane.indexOf(i.modelAirplane.toUpperCase())>=0).reduce((i,a)=>i||a,!1)).filter(t=>!(this.ticketFilterState.value.bookingSystem.length>0)||this.ticketFilterState.value.bookingSystem.map(i=>{var a;return"DOMESTIC"===i?[x.QK.VN,x.QK.VJ,x.QK.QH,x.QK.VU].includes(null===(a=t.provider)||void 0===a?void 0:a.toUpperCase()):i===t.provider}).reduce((i,a)=>i||a,!1)).map(t=>Object.assign(Object.assign({},t),{showSalePrice:this.ticketDisplayState.value.showSalePrice,showNetPrice:this.ticketDisplayState.value.showNetPrice,hideFareClass:this.ticketDisplayState.value.hideFareClass,showDuration:this.ticketDisplayState.value.showDuration,showDiscountFare:this.ticketDisplayState.value.showDiscountFare})),this.listTicketAgentDisplay=this.listTicketAgent.filter(t=>t.leg===this.currentLeg).filter(t=>{const i=this.airlineList.map(a=>a.code.toLocaleLowerCase());return 0===i.length||i.includes(t.airline.toLowerCase())}).filter(t=>0===this.ticketFilterState.value.showAirline.length||this.ticketFilterState.value.showAirline.includes(t.airline)).filter(t=>!!(!this.ticketFilterState.value.direct&&!this.ticketFilterState.value.oneRoute&&!this.ticketFilterState.value.moreRoute||this.ticketFilterState.value.direct&&0===t.numOfStop||this.ticketFilterState.value.oneRoute&&1===t.numOfStop||this.ticketFilterState.value.moreRoute&&t.numOfStop>1)).filter(t=>{if(0===t.leg){const i=60*t.departure.localTime.getHours()+t.departure.localTime.getMinutes();if(i<this.ticketFilterState.value.comboTime.departStartTime.from||i>this.ticketFilterState.value.comboTime.departStartTime.to)return!1;const a=60*t.arrival.localTime.getHours()+t.arrival.localTime.getMinutes();if(a<this.ticketFilterState.value.comboTime.departEndTime.from||a>this.ticketFilterState.value.comboTime.departEndTime.to)return!1}if(1===t.leg){const i=60*t.departure.localTime.getHours()+t.departure.localTime.getMinutes(),a=60*t.arrival.localTime.getHours()+t.arrival.localTime.getMinutes();if(i<this.ticketFilterState.value.comboTime.arriveStartTime.from||i>this.ticketFilterState.value.comboTime.arriveStartTime.to||a<this.ticketFilterState.value.comboTime.arriveEndTime.from||a>this.ticketFilterState.value.comboTime.arriveEndTime.to)return!1}return!0}).filter(t=>{if(!this.ticketFilterState.value.plane.length)return!0;const i=t.segmentDetails.map(n=>n.modelAirplane);return!!this.ticketFilterState.value.plane.some(n=>i.includes(n))}),this.listTicketAgentDisplay=[...this.listTicketAgentDisplay],this.processSort(),this.ticketInfiniteScrollCount=this.TICKET_INFINITE_SCROLL_DEFAULT}loadComboTicketFilter(){this.listTicketComboDisplay=this.listTicketCombo.filter(t=>!(!(this.ticketFilterState.value.lccFare&&t.departOptions[0].lccFare||t.arriveOptions[0].lccFare)&&this.ticketFilterState.value.lccFare)).filter(t=>!(!(this.ticketFilterState.value.ndcFare&&t.departOptions[0].ndcFare||t.arriveOptions[0].ndcFare)&&this.ticketFilterState.value.ndcFare)).filter(t=>!(!(this.ticketFilterState.value.privateFare&&t.departOptions[0].privateFare||t.arriveOptions[0].privateFare)&&this.ticketFilterState.value.privateFare)).filter(t=>0===this.ticketFilterState.value.showAirline.length||this.ticketFilterState.value.showAirline.includes(t.departOptions[0].airline)||this.ticketFilterState.value.showAirline.includes(t.arriveOptions[0].airline)).filter(t=>!!(!this.ticketFilterState.value.direct&&!this.ticketFilterState.value.oneRoute&&!this.ticketFilterState.value.moreRoute||this.ticketFilterState.value.direct&&0===t.departOptions[0].numOfStop&&0===t.arriveOptions[0].numOfStop||this.ticketFilterState.value.oneRoute&&1===t.departOptions[0].numOfStop&&1===t.arriveOptions[0].numOfStop||this.ticketFilterState.value.moreRoute&&t.departOptions[0].numOfStop>1&&t.arriveOptions[0].numOfStop>1)).filter(t=>{const i=60*t.departOptions[0].departureDate.getHours()+t.departOptions[0].departureDate.getMinutes(),a=60*t.arriveOptions[0].departureDate.getHours()+t.arriveOptions[0].departureDate.getMinutes(),n=60*t.departOptions[0].returnDate.getHours()+t.departOptions[0].returnDate.getMinutes(),s=60*t.arriveOptions[0].returnDate.getHours()+t.arriveOptions[0].returnDate.getMinutes();return!(i<this.ticketFilterState.value.comboTime.departStartTime.from||i>this.ticketFilterState.value.comboTime.departStartTime.to||a<this.ticketFilterState.value.comboTime.arriveStartTime.from||a>this.ticketFilterState.value.comboTime.arriveStartTime.to||n<this.ticketFilterState.value.comboTime.departEndTime.from||n>this.ticketFilterState.value.comboTime.departEndTime.to||s<this.ticketFilterState.value.comboTime.arriveEndTime.from||s>this.ticketFilterState.value.comboTime.arriveEndTime.to)}).filter(t=>{const i=t.departOptions[0].duration,a=t.arriveOptions[0].duration,n=60*this.ticketFilterState.value.comboDuration.from,s=60*this.ticketFilterState.value.comboDuration.to;return!(i<n||i>s||a<n||a>s)}).filter(t=>!(this.ticketFilterState.value.bookingSystem.length>0)||this.ticketFilterState.value.bookingSystem.map(i=>{var a;return"DOMESTIC"===i?[x.QK.VN,x.QK.VJ,x.QK.QH,x.QK.VU].includes(null===(a=t.provider)||void 0===a?void 0:a.toUpperCase()):i===t.provider}).reduce((i,a)=>i||a,!1)).filter(t=>{if(this.ticketFilterState.value.comboPrice.from&&this.ticketFilterState.value.comboPrice.to){const i=t.departOptions[0].totalPrice+t.arriveOptions[0].totalPrice;return i>=this.ticketFilterState.value.comboPrice.from&&i<=this.ticketFilterState.value.comboPrice.to}return!0}),this.listTicketComboDisplay=[...this.listTicketComboDisplay],this.processSortCombo(),this.ticketInfiniteScrollCount=this.TICKET_INFINITE_SCROLL_DEFAULT}bindingTypeSearch(){switch(this._searchInputService.flightType){case"ONE_WAY":this.flightTypeSearch=A.jX.OneWay,this.minFareOptionConfig=Object.assign(Object.assign({},this.minFareOptionConfig),{isRangeMinFare:!1});break;case"ROUND_TRIP":this.flightTypeSearch=A.jX.RoundTrip,this.minFareOptionConfig=Object.assign(Object.assign({},this.minFareOptionConfig),{isRangeMinFare:!0});break;case"MULTI_WAY":this.flightTypeSearch=A.jX.MultiWay}}numberOfPassengerChange(t){this._searchInputService.numberOfPassengerChange(t),this._searchInputService.suggestPromotion()}airlineFilterChange(t){this._searchInputService.airlineFilterChange(t)}cabinChange(t){this._searchInputService.cabinChange(t)}paxTypeChange(t){this._searchInputService.paxTypeChange(t)}onChangeInputSearch(t){this._searchInputService.suggestPromotion(),this._searchInputService.checkInternationalFlight(),this.updateDateSearchMinFare(t)}updateDateSearchMinFare(t){var i;"AIRPORT"===t&&(this.minFareOptionConfig.minPrice=new Map,this.minFareOptionConfig=Object.assign({},this.minFareOptionConfig),this.listDateSearchMinFares=[]);let n=[],s=new Date;if(s=null===(i=this._searchInputService.searchInputForm.value[0])||void 0===i?void 0:i.departDate,!s&&!this.minFareOptionConfig.minPrice.size&&(this.initDateSearchMinFare(),n=this.listDateSearchMinFares),s){const o=m(new Date(s.getFullYear(),s.getMonth())).format("YYYY-MM-DD");((o,c)=>{const d=o.getFullYear(),u=c.getFullYear(),h=o.getMonth();return 12*(u-d)+(c.getMonth()-h)})(new Date,s)>2?n.push(o):this.generateRangeDateSearchMinFare(o).forEach(d=>{this.listDateSearchMinFares.includes(d)||n.push(d)})}n&&n.length&&this.searchMinFaresApi(n)}onDateTypeChange(t){"DEPART"===t&&this.mappingMinFares(0),"ARRIVE"===t&&this.mappingMinFares(1)}searchMinFaresApi(t){const i=this._searchInputService.getSearchInputData();if(i.startPoint&&i.endPoint){let a=[];this.flightTypeSearch===A.jX.OneWay&&(a=t.map(n=>({departDate:m(new Date(n)).format("YYYY-MM-DD"),endPoint:i.endPoint,leg:0,providers:`${x.QK.VJ},${x.QK.VN}`,startPoint:i.startPoint}))),this.flightTypeSearch===A.jX.RoundTrip&&(a=t.map(n=>({departDate:m(new Date(n)).format("YYYY-MM-DD"),endPoint:i.endPoint,leg:0,providers:`${x.QK.VJ},${x.QK.VN}`,startPoint:i.startPoint})),a.push(...t.map(n=>({departDate:m(new Date(n)).format("YYYY-MM-DD"),endPoint:i.startPoint,leg:1,providers:`${x.QK.VJ},${x.QK.VN}`,startPoint:i.endPoint})))),this._searchFlightService.searchMinFare(a).subscribe({next:n=>{"OK"===n.status&&(n.data.length?(n.data.forEach(s=>{const o=this.searchMinFaresResult.find(c=>c.leg===s.leg);o?Object.entries(s.data).forEach(c=>{o.data.set(c[0],c[1])}):this.searchMinFaresResult.push(Object.assign(Object.assign({},s),{data:new Map(Object.entries(s.data))}))}),this._searchMinFareDataProvider.searchMinFareData=this.searchMinFaresResult,this.mappingMinFares(a[0].leg)):this.minFareOptionConfig=Object.assign({},this.minFareOptionConfig),this._searchInputService.minFareChange$.next(this.minFareOptionConfig))}})}}onNavigateDatepicker(t){let i=[];i.push(t);const a=m(t).subtract(1,"month");a.month()===(new Date).getMonth()?i.push(m(new Date).format("YYYY-MM-DD")):i.push(a.format("YYYY-MM-DD")),i=i.filter(n=>!this.listDateSearchMinFares.includes(n)),i.forEach(n=>{this.listDateSearchMinFares.includes(n)||(this.listDateSearchMinFares.push(n),this.searchMinFaresApi([n]))})}generateRangeDateSearchMinFare(t,i=""){const a=m(i||new Date),n=m(t),s=[];s.push(a.format("YYYY-MM-DD"));const o=a.clone().add(1,"month").startOf("month");for(;o.isBefore(n)||o.isSame(n,"month");)s.push(o.format("YYYY-MM-DD")),o.add(1,"month");return s}onToggleAirline(t){t&&this.mappingMinFares()}mappingMinFares(t=0){if(this.searchMinFaresCurrentLegResult=this.searchMinFaresResult.find(i=>i.leg===t),this.searchMinFaresCurrentLegResult){this.minFareOptionConfig.minPrice=new Map;const i=this.minFareOptionConfig.airlineMinPrice.filter(a=>a.selected).map(a=>a.airline);this.searchMinFaresCurrentLegResult.data.forEach((a,n)=>{const s=a.filter(d=>i.includes(d.key)),o=s.length?s.reduce((d,u)=>u.value<d.value?u:d):null,c=o?this.minFareOptionConfig.airlineMinPrice.find(d=>d.airline===o.key):null;this.minFareOptionConfig.minPrice.set(n,o?{price:Math.ceil(o.value/1e3),originPrice:(null==o?void 0:o.value)||0,airline:(null==c?void 0:c.airline)||o.key,airlineName:(null==c?void 0:c.airlineName)||o.key,color:(null==c?void 0:c.color)||""}:null)}),this.minFareOptionConfig=Object.assign({},this.minFareOptionConfig)}this.mappingMinFareMultiDateBar()}mappingMinFareMultiDateBar(){if(this.searchMinFaresCurrentLegResult){let t=Object.assign(Object.assign({},this.minFareOptionConfig),{minPrice:new Map});const i=this._searchInputService.airlineFilters.filter(n=>n.actived).map(n=>n.value),a=this.minFareOptionConfig.airlineMinPrice.filter(n=>i.includes(n.airline)).map(n=>n.airline);this.searchMinFaresCurrentLegResult.data.forEach((n,s)=>{const o=n.filter(u=>a.includes(u.key)),c=o.length?o.reduce((u,h)=>h.value<u.value?h:u):null,d=c?this.minFareOptionConfig.airlineMinPrice.find(u=>u.airline===c.key):null;t.minPrice.set(s,c?{price:Math.ceil(c.value/1e3),originPrice:(null==c?void 0:c.value)||0,airline:(null==d?void 0:d.airline)||c.key,airlineName:(null==d?void 0:d.airlineName)||c.key,color:(null==d?void 0:d.color)||""}:null)}),this.multiDateBar&&this.multiDateBar.length&&this.multiDateBar.forEach(n=>{if(t.minPrice.has(n.key)){const s=t.minPrice.get(n.key);n.price=(null==s?void 0:s.originPrice)||0}})}}addMultiRoute(){this._searchInputService.addMultiRoute()}removeRoute(t){this._searchInputService.removeRoute(t)}removeAllDataMultiRoute(){this._searchInputService.removeAllDataMultiRoute()}flightTypeChange(t){switch(this.flightTypeSearch=t,t){case A.jX.OneWay:this._searchInputService.flightTypeChange("ONE_WAY");break;case A.jX.RoundTrip:this._searchInputService.flightTypeChange("ROUND_TRIP");break;case A.jX.MultiWay:this._searchInputService.flightTypeChange("MULTI_WAY")}}researchFlight(){let t;this.progress=1,this.totalPrice=0,t=this.flightTypeSearch===A.jX.OneWay?"ONE_WAY":this.flightTypeSearch===A.jX.RoundTrip?"ROUND_TRIP":"MULTI_WAY",this._searchInputService.prepareRequestFlight(t)&&(this.handleLowestPriceResearch(),this.ticketInfiniteScrollCount=this.TICKET_INFINITE_SCROLL_DEFAULT,this.airlineList=[],this.bookingSystemList=[],this.isFirstTake=!0,this.tabData=[],this.modeChange("retail"),this.bindingTypeSearch(),this.loadNumberOfPassenger(),this.onResetFilter(),this.searchFlight(),this.loadTabData(),this.loadTicketSelectedData(),this.resetOptionFilters(),this.checkShareFlight(),this.hasAirportInternational=this._searchInputService.hasAirportInternational)}onQuotation(t){let i=this.tabData[this.currentLeg];i=Object.assign(Object.assign({},i),{startPoint:i.startPoint,startPointName:this._locationDataService.getCityNameByCode(i.startPoint),endPoint:i.endPoint,endPointName:this._locationDataService.getCityNameByCode(i.endPoint)}),this._modal.open(Fe,{isHiddenNetPrice:this.ticketDisplayState.value.showNetPrice,isHiddenCabin:this.ticketDisplayState.value.hideFareClass,listTicketDisplay:this.listTicketDisplay.filter(a=>a.seatRemain>0),journey:i,currentLeg:t,canEditHeader:this._permissionService.hasPermission(R.or.EditFlightTicketQuoteHeader)})}onMobileQuotation(t){let i=this.tabData[this.currentLeg];i=Object.assign(Object.assign({},i),{startPoint:i.startPoint,startPointName:this._locationDataService.getCityNameByCode(i.startPoint),endPoint:i.endPoint,endPointName:this._locationDataService.getCityNameByCode(i.endPoint)});const a=this._bottomSheetService.open(Fe,{headerTitle:"Chia s\u1ebb c\xe1c chuy\u1ebfn bay l\u1ef1a ch\u1ecdn",leftButtonIcon:"close",leftButtonIconClass:"text-neutral-gray-4",rightButtonIcon:"",containerFullHeigh:!0,data:{isHiddenNetPrice:this.ticketDisplayState.value.showNetPrice,isHiddenCabin:this.ticketDisplayState.value.hideFareClass,listTicketDisplay:this.listTicketDisplay.filter(n=>n.seatRemain>0),journey:i,currentLeg:t,canEditHeader:this._permissionService.hasPermission(R.or.EditFlightTicketQuoteHeader)}});a.containerInstance._leftButtonClick.subscribe(n=>a.dismiss())}getTicketDetail(t,i,a){const n=[];if(this.numberOfPassenger.adult){const o=t.getTotalAmountByType("ADULT")*this.numberOfPassenger.adult,c=o?t.getDiscountByBaseFare("ADULT",i,a&&a.adtPercentage||0,a&&a.adtAmount||0):0,d=a?o-(c||0)*this.numberOfPassenger.adult:0,u={type:"Ng\u01b0\u1eddi l\u1edbn (ADT)",quantity:this.numberOfPassenger.adult,baseFare:t.getBaseFare("ADULT",i),surCharge:t.getSurCharge("ADULT",i),discountAmount:c,totalFare:o,totalDiscountFare:d};n.push(u)}if(this.numberOfPassenger.child){const o=t.getTotalAmountByType("CHILD")*this.numberOfPassenger.child,c=o?t.getDiscountByBaseFare("CHILD",i,a&&a.chdPercentage||0,a&&a.chdAmount||0):0,d=a?o-(c||0)*this.numberOfPassenger.child:0,u={type:"Tr\u1ebb em (CHD)",quantity:this.numberOfPassenger.child,baseFare:t.getBaseFare("CHILD",i),surCharge:t.getSurCharge("CHILD",i),discountAmount:c,totalFare:o,totalDiscountFare:d};n.push(u)}if(this.numberOfPassenger.infant){const o=t.getTotalAmountByType("INFANT")*this.numberOfPassenger.infant,c=o?t.getDiscountByBaseFare("INFANT",i,a&&a.infPercentage||0,a&&a.infAmount||0):0,d=a?o-(c||0)*this.numberOfPassenger.infant:0,u={type:"Em b\xe9 (INF)",quantity:this.numberOfPassenger.infant,baseFare:t.getBaseFare("INFANT",i),surCharge:t.getSurCharge("INFANT",i),discountAmount:c,totalFare:o,totalDiscountFare:d};n.push(u)}return{totalCharge:n.reduce((o,c)=>o+c.totalFare,0),totallDiscountFareCharge:a&&(a.adtPercentage>0||a.adtAmount>0)?n.reduce((o,c)=>o+c.totalDiscountFare,0):0,details:n}}onShowDetailInfo(t){const i=this.listTicketSelected[t],a={airline:i.airline,airlineName:i.airlineName,airlineLogo:i.airlineLogo,provider:i.provider,journeyKey:i.journeyKey,operating:i.operating,operatingName:i.operatingName,flightNumber:i.flight,journeyName:`Chuy\u1ebfn bay: ${i.startPoint} - ${i.endPoint}`,numOfStop:i.numOfStop,departureDate:m(i.startTime).format("HH:mm DD/MM/YYYY"),startPoint:i.startCode,startPointName:i.startPoint,endPoint:i.endCode,endPointName:i.endPoint,price:i.totalPrice,handBag:"Kh\xf4ng",segments:i.segments.map((n,s)=>({airline:n.airline,airlineSystem:n.airline,airlineName:n.airlineName,airlineLogo:n.airlineLogo,operating:n.operating,operatingName:n.operatingName,mobileAirlineLogo:["VJ","VN","QH"].includes(n.operating)?"assets/airline-logo/"+n.operating+"_small.png":"assets/airline-logo/"+n.operating+".png",flightNumber:n.airline+n.flightNumber,startTime:m(n.departDate).format("HH:mm"),startDate:m(n.departDate).format("DD/MM/YYYY"),startPoint:n.startCode,startPointName:n.startPoint,startAirport:this._locationDataService.getAirportNameByCode(n.startPoint),endTime:m(n.arrivalDate).format("HH:mm"),endDate:m(n.arrivalDate).format("DD/MM/YYYY"),endPoint:n.endCode,endPointName:n.endPoint,endAirport:this._locationDataService.getAirportNameByCode(n.endPoint),stopPoint:n.stopPoint,modelAirplane:n.modelAirplane,rules:[{name:"Th\u1eddi gian bay",value:n.duration},{name:"Lo\u1ea1i m\xe1y bay",value:n.modelAirplane},{name:"H\u1ea1ng ch\u1ed7",value:n.fareType+(n.fareClass?`(${n.fareClass})`:"N/A")},{name:"H\xe0nh l\xfd k\xfd g\u1eedi",value:i.checkedBag||"N/A"},{name:"H\xe0nh l\xfd x\xe1ch tay",value:i.handBag||"N/A"}]})),ticketPrice:i.ticketPrice,fareRule:i.fareRule};this.isMobile?this._bottomSheetService.open(P._8,{containerFullHeigh:!0,headerTitle:"Th\xf4ng tin chuy\u1ebfn bay",leftButtonIcon:"arrow_left",rightButtonIcon:"",data:{hasDiscountFare:i.hasDiscountFare}}):this._modal.open(P.Zk,{flightInfo:a,hasDiscountFare:i.hasDiscountFare})}getFareRuleClass(t,i,a){let n;n=["QH","VJ"].includes(t)?this.listFareRuleClasses.find(c=>{var d;return t===c.airline&&(null==a?void 0:a.toLocaleUpperCase())===(null===(d=c.fareClass)||void 0===d?void 0:d.toLocaleUpperCase())})||null:["VN"].includes(t)?this.listFareRuleClasses.find(c=>{var d;return t===c.airline&&(null==i?void 0:i.toLocaleUpperCase())===(null===(d=c.fareClass)||void 0===d?void 0:d.toLocaleUpperCase())})||null:{airline:t,fareClass:i,rules:[{name:"H\xe0nh l\xfd x\xe1ch tay",value:"",cate:"HAND_BAGGAGE"},{name:"H\xe0nh l\xfd k\xfd g\u1eedi",value:"",cate:"CHECKED_BAGGAGE"}]};const s=(null==n?void 0:n.rules.find(c=>"HAND_BAGGAGE"===c.cate))||null,o=(null==n?void 0:n.rules.find(c=>"CHECKED_BAGGAGE"===c.cate))||null;return{handBag:(null==s?void 0:s.value)||"",checkedBag:(null==o?void 0:o.value)||""}}onSortChange(t){this.sortState=t,this.processSort(),this.ticketInfiniteScrollCount=this.TICKET_INFINITE_SCROLL_DEFAULT}onSortChangeCombo(t){this.sortStateCombo=t,this.processSortCombo(),this.ticketInfiniteScrollCount=this.TICKET_INFINITE_SCROLL_DEFAULT}processSort(){var t,i;switch(this.sortState){case"min_price":this.listTicketDisplay.sort(this.ticketDisplayState.value.showNetPrice?(a,n)=>a.netPrice-n.netPrice:(a,n)=>a.totalPrice-n.totalPrice);break;case"max_price":this.listTicketDisplay.sort(this.ticketDisplayState.value.showNetPrice?(a,n)=>n.netPrice-a.netPrice:(a,n)=>n.totalPrice-a.totalPrice);break;case"min_flight":this.listTicketDisplay.sort((a,n)=>a.duration-n.duration),this.listTicketAgentDisplay.sort((a,n)=>a.duration-n.duration);break;case"max_flight":this.listTicketDisplay.sort((a,n)=>n.duration-a.duration),this.listTicketAgentDisplay.sort((a,n)=>n.duration-a.duration);break;case"earliest_departure":this.listTicketDisplay.sort((a,n)=>a.departure.localTime.getTime()-n.departure.localTime.getTime()),this.listTicketAgentDisplay.sort((a,n)=>a.departure.localTime.getTime()-n.departure.localTime.getTime());break;case"late_departure":this.listTicketDisplay.sort((a,n)=>n.departure.localTime.getTime()-a.departure.localTime.getTime()),this.listTicketAgentDisplay.sort((a,n)=>n.departure.localTime.getTime()-a.departure.localTime.getTime());break;case"earliest_arrival":this.listTicketDisplay.sort((a,n)=>a.arrival.localTime.getTime()-n.arrival.localTime.getTime()),this.listTicketAgentDisplay.sort((a,n)=>a.arrival.localTime.getTime()-n.arrival.localTime.getTime());break;case"late_arrival":this.listTicketDisplay.sort((a,n)=>n.arrival.localTime.getTime()-a.arrival.localTime.getTime()),this.listTicketAgentDisplay.sort((a,n)=>n.arrival.localTime.getTime()-a.arrival.localTime.getTime())}null===(t=this.listTicketDisplay)||void 0===t||t.sort((a,n)=>Number(0===a.seatRemain)-Number(0===n.seatRemain)),null===(i=this.listTicketAgentDisplay)||void 0===i||i.sort((a,n)=>{const s=a.segmentsDisplay.some(c=>c.fareClasses.every(d=>!d.seatRemain))?0:1;return(n.segmentsDisplay.some(c=>c.fareClasses.every(d=>!d.seatRemain))?0:1)-s})}processSortCombo(){const t=this.listTicketComboDisplay.filter(a=>-1!==a.indexForTracking),i=this.listTicketComboDisplay.filter(a=>-1===a.indexForTracking);switch(this.sortStateCombo){case"min_price":t.sort((a,n)=>a.departOptions[0].totalPrice+a.arriveOptions[0].totalPrice-(n.departOptions[0].totalPrice+n.arriveOptions[0].totalPrice));break;case"max_price":t.sort((a,n)=>n.departOptions[0].totalPrice+n.arriveOptions[0].totalPrice-(a.departOptions[0].totalPrice+a.arriveOptions[0].totalPrice));break;case"best":t.sort((a,n)=>n.score-a.score);break;case"fastest":t.sort((a,n)=>a.departOptions[0].duration+a.arriveOptions[0].duration-(n.departOptions[0].duration+n.arriveOptions[0].duration));break;case"max_flight":t.sort((a,n)=>n.departOptions[0].duration+n.arriveOptions[0].duration-(a.departOptions[0].duration+a.arriveOptions[0].duration));break;case"earliest_departure":t.sort((a,n)=>a.departOptions[0].departureDate.getTime()-n.departOptions[0].departureDate.getTime());break;case"late_departure":t.sort((a,n)=>n.departOptions[0].departureDate.getTime()-a.departOptions[0].departureDate.getTime());break;case"earliest_arrival":t.sort((a,n)=>a.arriveOptions[0].departureDate.getTime()-n.arriveOptions[0].departureDate.getTime());break;case"late_arrival":t.sort((a,n)=>n.arriveOptions[0].departureDate.getTime()-a.arriveOptions[0].departureDate.getTime())}this.listTicketComboDisplay=[...t,...i]}onShare(){this._modal.open(P.eP,{ticketsSelected:this.listTicketSelected.filter(t=>t.journeyKey),canEditHeader:this.canEditHeader,totalPrice:this.totalPrice,totalPriceCombo:this.totalPriceCombo,isHiddenTotalCharge:this.isHiddenTotalCharge})}onShareCombo(t,i){var a,n;const s=t.map((c,d)=>this.convertComboTicketToTicketSelectedVM(c,d,i)),o=s.map(c=>c.totalPrice).reduce((c,d)=>c+d)||0;if(this.totalPriceCombo=(null===(n=null===(a=s[0].comboRefs)||void 0===a?void 0:a.find(c=>c.key===s[1].fareOptionKey))||void 0===n?void 0:n.totalAllPaxPriceCombo)||0,this.isMobile){const c=this._bottomSheetService.open(P.eP,{headerTitle:"Chia s\u1ebb c\xe1c chuy\u1ebfn bay l\u1ef1a ch\u1ecdn",leftButtonIcon:"close",leftButtonIconClass:"text-neutral-gray-4",rightButtonIcon:"",containerFullHeigh:!0,data:{ticketsSelected:s,canEditHeader:this.canEditHeader,totalPrice:s.map(d=>d.totalPrice).reduce((d,u)=>d+u),totalPriceCombo:this.totalPriceCombo,isHiddenTotalCharge:this.isHiddenTotalCharge}});c.containerInstance._leftButtonClick.subscribe(d=>c.dismiss())}else this._modal.open(P.eP,{ticketsSelected:s,canEditHeader:this.canEditHeader,totalPrice:o,totalPriceCombo:this.totalPriceCombo,isHiddenTotalCharge:this.isHiddenTotalCharge})}onChangeSearch(t){t.focusFirstStartPoint()}onResetFilter(){this.ticketFilterState.next(Object.assign(Object.assign({},this.filterStateInit),{direct:this._searchInputService.isDirectFlight}))}resetOptionFilters(){this.fareclassList=[],this.selectedFare.value=""}initTicketExpireTimer(){var t,i,a;this.clearTimer();let n=Number.MAX_SAFE_INTEGER;0!==(null===(t=this.searchFlightData.flightOptions)||void 0===t?void 0:t.length)&&(null!==(i=this.searchFlightData.flightOptions)&&void 0!==i&&i.length&&"COMBO"!==this.searchFlightData.flightOptions[0].type?this.searchFlightData.flightOptions.forEach(s=>{s.journeys.forEach(o=>{o.expireTime<n&&(n=o.expireTime)})}):!(null===(a=this.searchFlightData.flightOptions)||void 0===a)&&a.length&&"COMBO"===this.searchFlightData.flightOptions[0].type&&this.searchFlightData.flightOptions.forEach(s=>{s.comboInfo.arriveJourneys.forEach(o=>{o.expireTime<n&&(n=o.expireTime)}),s.comboInfo.departJourneys.forEach(o=>{o.expireTime<n&&(n=o.expireTime)})}),n&&n!==Number.MAX_SAFE_INTEGER&&this._systemService.getCurrentTimeEpoch().subscribe({next:s=>{"OK"===s.status&&(this.ticketExpireTimer=setTimeout(()=>{this._modal.open($.V0,{title:"C\u1eadp nh\u1eadt th\xf4ng tin m\u1edbi nh\u1ea5t",body:"Th\u1eed l\u1ea1i k\u1ebft qu\u1ea3 t\xecm ki\u1ebfm v\u1edbi th\xf4ng tin, chi ph\xed v\xe0 ch\u1ed7 tr\u1ed1ng m\u1edbi nh\u1ea5t.",okText:"T\u1ea3i l\u1ea1i",hasCancel:!1}).afterClosed$.subscribe({next:c=>{c.data&&this.researchFlight()}})},1e3*(n-s.data.timeStamp)))}}))}clearTimer(){clearTimeout(this.ticketExpireTimer)}hasOutOfSeatDisplay(){return this.listTicketDisplay.some(t=>0===t.seatRemain)}hasOutOfSeatComboDisplay(){return this.listTicketComboDisplay.some(t=>t.soldOut)}hasOutOfSeatAgentDisplay(t){return t?t.segmentsDisplay.some(i=>i.fareClasses.every(a=>!a.seatRemain)):this.listTicketAgentDisplay.some(i=>i.segmentsDisplay.some(a=>a.fareClasses.every(n=>!n.seatRemain)))}onRegisterBookingHunter(){this._requestDataService.sourceEvent="SEARCH_RESULT",this._router.navigate(["admin/request-booking-hunter"],{state:{isEntryPointSearch:!0}})}onVerifyFlight(t,i,a){var n,s;if("CHECKED"===((null===(n=t[0].comboRefs.find(u=>u.key===t[1].fareOptionKey))||void 0===n?void 0:n.verifyState)||"UNCHECKED"))return;const c=null===(s=t[0].comboRefs)||void 0===s?void 0:s.find(u=>u.key===t[1].fareOptionKey);c&&(c.verifyState="IN_PROGRESS"),this.isVerifyComboProgress=!0;const d={flights:t.map(u=>({fareOptionKey:u.fareOptionKey,journeyKey:u.journeyKey,serviceFeeInfo:null})),provider:t[0].provider,checkMinPrice:!1};this._searchFlightService.verifyFlightCombo(d).pipe((0,ee.x)(()=>this.isVerifyComboProgress=!1)).subscribe({next:u=>{if("OK"===u.status){const h=u.data[0].comboRefs.find(p=>p.key[0]===(null==c?void 0:c.key));h&&(u.data[1].fareAmountBreakdowns=null==h?void 0:h.fareAmountBreakdowns),c&&(c.sessionId=(null==h?void 0:h.sessionId)||"",c.verifyState="CHECKED",c.totalPriceCombo=(null==h?void 0:h.getTotalAmount())||0,c.totalAllPaxPriceCombo=(null==h?void 0:h.getTotalAmountAllPax(this.numberOfPassenger.adult,this.numberOfPassenger.child))||0,c.ticketPrice=h?this.getTicketDetail(h,t[0].airline):null,this.listTicketComboDisplay[a]=Object.assign({},this.listTicketComboDisplay[a]))}else c&&(c.verifyState="FAIL")},error:()=>{c&&(c.verifyState="INVALID")}})}handleLowestPriceResearch(){var t,i;const a=this._dataProvider.searchInputData.journey[0].departDate,n=m(a).format("YYYY-MM-DD");if(this.multiDateBar.findIndex(o=>o.key===n)<0&&(n>this.multiDateBar[this.multiDateBar.length-1].key&&this.addDateBar(a),n<this.multiDateBar[0].key&&this.subtractDateBar()),this.multiDateBar.forEach(o=>{o.selected=n===o.key,o.active=o.key>=m(new Date).format("YYYY-MM-DD")}),"ROUND_TRIP"===this._searchInputService.flightType){const o=null===(t=this._dataProvider.searchInputData.journey[1])||void 0===t?void 0:t.departDate;if(o){const c=null===(i=this._dataProvider.searchInputData.journey[0])||void 0===i?void 0:i.departDate,d=m(c),h=m(o).diff(d,"days");this.multiDateBar.forEach(g=>{g.toDate=m(g.fromDate).add(h,"days").toDate()})}}this.mappingMinFareMultiDateBar(),setTimeout(()=>{this.scrollDate(n)},0)}mappingMinFareMultiBar(){let t=new Map;this._searchMinFareDataProvider&&this._searchMinFareDataProvider.searchMinFareData&&this._searchMinFareDataProvider.searchMinFareData[0]&&(t=new Map(Object.entries(this._searchMinFareDataProvider.searchMinFareData[0].data))),t&&this.multiDateBar.forEach(i=>{if(t.has(i.key)){const a=t.get(i.key);if(a){const n=a.length?a.reduce((s,o)=>o.value<s.value?o:s):null;i.price=n.value}}})}generateRangeDateBar(){var t;let i;if(this.multiDateBar=[],this._searchMinFareDataProvider.searchMinFareData&&this._searchMinFareDataProvider.searchMinFareData[0]&&(i=new Map(Object.entries(this._searchMinFareDataProvider.searchMinFareData[0].data))),"ONE_WAY"===this._searchInputService.flightType){const a=this._dataProvider.searchInputData.journey[0].departDate;this.getDaysInMonth(new Date(a)).forEach(s=>{const o=m(s).format("YYYY-MM-DD"),c=o===m(a).format("YYYY-MM-DD"),d=o>=m(new Date).format("YYYY-MM-DD"),u=(0,O.$j)(s);if(i&&i.has(o)){const h=i.get(o),g=h.length?h.reduce((p,T)=>T.value<p.value?T:p):null;this.multiDateBar.push(g?{key:m(s).format("YYYY-MM-DD"),fromDate:s,toDate:null,price:(null==g?void 0:g.value)||0,airlineMinPrice:(null==g?void 0:g.key)||"",active:d,selected:c,dayInfo:{holiday:u.holiday,lunarDate:`ng\xe0y ${u.lunarDate.date}/${u.lunarDate.month} \xe2m l\u1ecbch`,dateFormat:u.dateFormat}}:{key:m(s).format("YYYY-MM-DD"),fromDate:s,toDate:null,price:0,airlineMinPrice:"",active:d,selected:c,dayInfo:{holiday:u.holiday,lunarDate:`ng\xe0y ${u.lunarDate.date}/${u.lunarDate.month} \xe2m l\u1ecbch`,dateFormat:u.dateFormat}})}else this.multiDateBar.push({key:m(s).format("YYYY-MM-DD"),fromDate:s,toDate:null,price:0,airlineMinPrice:"",active:d,selected:c,dayInfo:{holiday:u.holiday,lunarDate:`ng\xe0y ${u.lunarDate.date}/${u.lunarDate.month} \xe2m l\u1ecbch`,dateFormat:u.dateFormat}})})}else{const a=this._dataProvider.searchInputData.journey[0].departDate,n=null===(t=this._dataProvider.searchInputData.journey[1])||void 0===t?void 0:t.departDate,s=m(a),c=m(n).diff(s,"days");this.getDaysInMonth(new Date(a)).forEach(u=>{const h=m(u).format("YYYY-MM-DD"),g=h===m(a).format("YYYY-MM-DD"),p=h>=m(new Date).format("YYYY-MM-DD"),T=(0,O.$j)(u);if(i&&i.has(h)){const v=i.get(h),y=v.length?v.reduce((D,F)=>F.value<D.value?F:D):null;this.multiDateBar.push(y?{key:m(u).format("YYYY-MM-DD"),fromDate:u,toDate:m(u).add(c,"days").toDate(),price:null==y?void 0:y.value,airlineMinPrice:(null==y?void 0:y.key)||"",active:p,selected:g,dayInfo:{holiday:T.holiday,lunarDate:`ng\xe0y ${T.lunarDate.date}/${T.lunarDate.month} \xe2m l\u1ecbch`,dateFormat:T.dateFormat}}:{key:m(u).format("YYYY-MM-DD"),fromDate:u,toDate:m(u).add(c,"days").toDate(),price:0,airlineMinPrice:"",active:p,selected:g,dayInfo:{holiday:T.holiday,lunarDate:`ng\xe0y ${T.lunarDate.date}/${T.lunarDate.month} \xe2m l\u1ecbch`,dateFormat:T.dateFormat}})}else this.multiDateBar.push({key:m(u).format("YYYY-MM-DD"),fromDate:u,toDate:m(u).add(c,"days").toDate(),price:0,airlineMinPrice:"",active:p,selected:g,dayInfo:{holiday:T.holiday,lunarDate:`ng\xe0y ${T.lunarDate.date}/${T.lunarDate.month} \xe2m l\u1ecbch`,dateFormat:T.dateFormat}})})}}getDaysInMonth(t){const i=t.getFullYear(),a=t.getMonth(),n=m(new Date(i,a,1)).subtract(6,"days").toDate(),s=m(new Date(i,a+2,0)).add(6,"days").toDate();let o=[];for(let c=n;c<=s;c.setDate(c.getDate()+1))c>=new Date&&o.push(new Date(c));return o}onPreviousDate(){this.addScrollElement("PREVIOUS"),this.mappingMinFareMultiBar();const t=document.querySelector("#mutli-date-bar");t&&t.scrollBy({left:-this.scrollAmount,behavior:"smooth"})}onNextDate(){this.addScrollElement("NEXT"),this.mappingMinFareMultiBar();const t=document.querySelector("#mutli-date-bar");t&&t.scrollBy({left:this.scrollAmount,behavior:"smooth"})}onScrollMultiDateBar(t){const a=t.target.scrollLeft;a>=this.previousScrollLeft?(this.addScrollElement("NEXT"),this.mappingMinFareMultiBar()):a<this.previousScrollLeft&&(this.addScrollElement("PREVIOUS"),this.mappingMinFareMultiBar()),this.previousScrollLeft=a}addScrollElement(t){let i;if(i=this._mobileDetectService.isMobile()?document.querySelector("#mutli-date-bar-mobile"):document.querySelector("#mutli-date-bar"),"NEXT"===t){const a=null==i?void 0:i.scrollLeft,n=null==i?void 0:i.scrollWidth,s=null==i?void 0:i.clientWidth;a&&n&&s&&a+s>=n-6*this.itemWidth&&this.addDateBar()}"PREVIOUS"===t&&i&&i.scrollLeft<=6*this.itemWidth&&this.subtractDateBar()}subtractDateBar(t){const i=this.multiDateBar[0].fromDate,a=this.multiDateBar[0].toDate;let n=12;if(t){const s=new Date(i).getTime()-new Date(t).getTime();s>0&&(n+=Math.ceil(Math.abs(s)/864e5))}for(let s=1;s<=n;s++){const o=m(i).subtract(s,"days").toDate(),c=(0,O.$j)(o),d={key:m(i).subtract(s,"days").format("YYYY-MM-DD"),fromDate:o,toDate:a?m(a).subtract(s,"days").toDate():null,price:0,airlineMinPrice:"",active:!0,selected:!1,dayInfo:{holiday:c.holiday,lunarDate:`ng\xe0y ${c.lunarDate.date}/${c.lunarDate.month} \xe2m l\u1ecbch`,dateFormat:c.dateFormat}};if(d.key<m(new Date).format("YYYY-MM-DD"))break;this.multiDateBar.unshift(Object.assign(Object.assign({},d),{active:d.key>=m(new Date).format("YYYY-MM-DD")}))}}addDateBar(t){const i=this.multiDateBar[this.multiDateBar.length-1].fromDate,a=this.multiDateBar[this.multiDateBar.length-1].toDate;let n=12;if(t){const s=new Date(t).getTime()-new Date(i).getTime();s>0&&(n+=Math.ceil(Math.abs(s)/864e5))}for(let s=1;s<=n;s++){const o=m(i).add(s,"days").toDate(),c=(0,O.$j)(o);this.multiDateBar.push({key:m(i).add(s,"days").format("YYYY-MM-DD"),fromDate:o,toDate:a?m(a).add(s,"days").toDate():null,price:0,airlineMinPrice:"",active:!0,selected:!1,dayInfo:{holiday:c.holiday,lunarDate:`ng\xe0y ${c.lunarDate.date}/${c.lunarDate.month} \xe2m l\u1ecbch`,dateFormat:c.dateFormat}})}}onSelectDateBar(t,i,a){this.multiDateBar.forEach(o=>{o.selected=o.key===t}),this.scrollDate(t);const n=this._dataProvider.searchInputData.journey,s=[];this._searchInputService.searchInputForm.at(0).controls.departDate.setValue(i),n.forEach(o=>{0===o.leg&&(o.departDate=i)}),s.push(i),this.flightTypeSearch===A.jX.RoundTrip&&a&&(this._searchInputService.searchInputForm.at(0).controls.returnDate.setValue(a),n.forEach(o=>{1===o.leg&&(o.departDate=a)}),s.push(a)),this._dataProvider.searchInputData=Object.assign(Object.assign({},this._dataProvider.searchInputData),{journey:n}),this._searchInputService.selectedDateBar$.next(s),this.researchFlight()}onDatePickerClick(){if(this._mobileDetectService.mobileSubject.value){const t=this._bottomSheetService.open(P.Mp,{headerTitle:"T\xf9y ch\u1ec9nh th\u1eddi gian",leftButtonIcon:"close",leftButtonIconClass:"text-neutral-gray-4",rightButtonIcon:"",containerFullHeigh:!0,data:{formArray:this._searchInputService.searchInputForm,minFareOptionConfig:this.minFareOptionConfig}});t.containerInstance._leftButtonClick.subscribe(i=>t.dismiss()),t.afterDismissed().subscribe({next:i=>{var a,n;if(i){this.researchFlight();const s=[],o=this._searchInputService.searchInputForm.at(0).value.departDate;s.push(o);const c=null===(n=null===(a=this._searchInputService.searchInputForm.at(0))||void 0===a?void 0:a.value)||void 0===n?void 0:n.returnDate;c&&s.push(c),this._searchInputService.selectedDateBar$.next(s)}}})}}}return r.\u0275fac=function(t){return new(t||r)(e.Y36(ta.R),e.Y36(ia.h),e.Y36(Ie.t7),e.Y36(na.G),e.Y36(ra._),e.Y36(C.KNP),e.Y36(et.F0),e.Y36(j.oE),e.Y36(oa.vQ),e.Y36(R.$A),e.Y36(nt.L),e.Y36(J.a2),e.Y36(sa.x),e.Y36(la.r),e.Y36(ca.FH),e.Y36(ua.o),e.Y36(aa.W))},r.\u0275cmp=e.Xpm({type:r,selectors:[["search-flight-result-page"]],standalone:!0,features:[e.jDz],decls:55,vars:83,consts:[[1,"h-full","w-full","flex","flex-col"],[1,"bg-neutral-white","shadow-cf-md","md:hidden"],[1,"py-4","px-[30px]","w-full"],[1,"flex","items-center","justify-between","mb-4"],[3,"flightType","flightTypeSearchChange"],[1,"flex","items-center","justify-end","gap-x-4"],[3,"adultNumber","childNumber","infantNumber","numberOfPassengerChange"],[3,"airlineList","airlineFilterChange"],[3,"promotionGroupList"],[3,"cabinList","actived","cabinChange"],[3,"paxTypeList","actived","paxTypeChange"],[1,"flex","gap-x-2"],[1,"grow",3,"formArray","minFareOptionConfig","removeRoute","dataChange","toggleAirline","dateTypeChange","navigateDatepicker"],["searchFlightEl",""],["cf-button","","size","medium","class","w-[168px] !py-[7px] !h-auto !max-h-14","type","secondary",3,"disabled","click",4,"ngIf"],["class","flex items-center justify-between mb-[9px]",4,"ngIf"],["class","w-full border-t border-t-neutral-gray-1",4,"ngIf"],["class","h-1 w-full",4,"ngIf"],[1,"flex-col","w-full","hidden","md:flex","sticky","top-0","z-[5]"],[1,"px-4","pt-3","pb-2","hidden","md:block","bg-white"],[3,"currentMode","onReseachFlight","onFlightTypeChange","onQuotation"],[1,"pl-4","pt-0","hidden","md:block","bg-white","shadow-cf-md"],[1,"flex","items-center","gap-x-2","overflow-y-auto","pr-4","pb-3"],[3,"disableSort","sortDefault","sortChange",4,"ngIf"],[3,"sortDefault","tabDetail","sortChange",4,"ngIf"],[3,"currentMode","airlineList","hasAirportInternational","ticketFilter","ticketDisplay","fareclassList","planeModelList","selectedFare","departureTimeList","arrivalTimeList","durationFilter","minDuration","maxDuration","departTimeComboList","arriveTimeComboList","minFareClss","priceFilter","minPrice","maxPrice","bookingSystemList","ticketFilterChange","ticketDisplayChange"],[3,"modeView","disableAgencyMode","modeChange",4,"ngIf"],[3,"airlineList","ticketFilter","ticketFilterChange"],[3,"ticketFilter","ticketFilterChange"],["class","w-full border-t border-t-neutral-gray-1 overflow-hidden bg-neutral-white hidden md:flex",4,"ngIf"],[1,"flex-auto","h-full","flex","py-6","px-[30px]","md:p-4"],[1,"w-[222px]","pr-[30px]","flex-shrink-0","md:hidden"],[3,"currentMode","airlineList","hasAirportInternational","ticketFilter","ticketDisplay","fareclassList","planeModelList","departureTimeList","minFareClss","priceFilter","minPrice","maxPrice","departTimeComboList","arriveTimeComboList","durationFilter","minDuration","maxDuration","bookingSystemList","selectedFare","arrivalTimeList","ticketFilterChange","ticketDisplayChange"],[1,"flex","flex-col","grow","gap-y-6","md:w-full"],["class","py-3 px-4 flex items-center gap-x-2 bg-functional-1-1 rounded",4,"ngIf"],["class","md:overflow-y-auto md:hidden",3,"selectedIndexChange",4,"ngIf"],["class","md:hidden",3,"sortDefault","tabDetail","sortChange",4,"ngIf"],[1,"flex","flex-nowrap","gap-x-4","md:gap-x-0"],[1,"flex","flex-col","grow","gap-y-4","md:w-full"],["class","flex justify-between items-center md:hidden",4,"ngIf"],[1,"flex","flex-col","gap-y-3","md:mb-16"],[4,"ngIf"],[1,"mt-[56px]","w-[302px]","flex-shrink-0","rounded","h-fit","md:hidden","sticky","top-0"],[1,"bg-neutral-white"],[1,"flex","justify-between","items-center","py-3","px-4"],[1,"text-espressive-sm","text-neutral-black"],["class","cursor-pointer","icon","share","size","small",3,"click",4,"ngIf"],[3,"ticketsSelected","reselect","showDetail"],["class","flex justify-between items-center py-3 px-4",4,"ngIf"],[1,"hidden","md:block",3,"ticketSelectedNumber","ticketsSelected","totalPrice","reselect","showDetail","share"],["cf-button","","size","medium","type","secondary",1,"w-[168px]","!py-[7px]","!h-auto","!max-h-14",3,"disabled","click"],["icon","search","size","small",1,"mr-2.5"],[1,"whitespace-nowrap"],[1,"flex","items-center","justify-between","mb-[9px]"],[1,"flex","items-center","gap-x-10","mt-[19px]"],[1,"flex","items-center","text-secondary-1-5","cursor-pointer",3,"click"],["icon","plus","size","small",1,"mr-2.5"],[1,"text-heading-xs"],[1,"flex","items-center","text-neutral-black","cursor-pointer",3,"click"],["icon","rotate_left","size","small",1,"mr-2.5"],[1,"text-body-md"],["cf-button","","size","medium","type","secondary",1,"w-[168px]","mt-[25px]","!max-h-14",3,"disabled","click"],[1,"w-full","border-t","border-t-neutral-gray-1"],[1,"flex","items-center"],[1,"p-4","cursor-pointer",3,"click"],["size","medium","icon","chevron_left"],["id","mutli-date-bar",1,"flex","items-center","overflow-auto","no-scrollbar",3,"scroll"],[4,"ngFor","ngForOf"],["size","medium","icon","chevron_right"],[1,"group","py-2","cursor-pointer",3,"ngClass","id","cfTooltip","placement","click"],[1,"h-10","border-l","border-l-neutral-gray-2","flex","flex-col","items-center","justify-center","min-w-[114px]","py-4"],[1,"text-body-md-short",3,"ngClass"],[1,"text-body-sm","text-neutral-gray-4",3,"ngClass"],["dateBarTemplate",""],[1,"h-1","w-full"],[1,"h-1","bg-primary-1-4","transition-all","ease-out","duration-1000"],[3,"disableSort","sortDefault","sortChange"],[3,"sortDefault","tabDetail","sortChange"],[3,"modeView","disableAgencyMode","modeChange"],[1,"w-full","border-t","border-t-neutral-gray-1","overflow-hidden","bg-neutral-white","hidden","md:flex"],[1,"flex","items-center","overflow-auto"],["id","mutli-date-bar-mobile",1,"flex","items-center","overflow-auto","no-scrollbar",3,"scroll"],[1,"p-4","cursor-pointer","flex","justify-center","items-center","shadow-cf-lg",3,"click"],["size","medium","icon","calendar"],[1,"group","py-2","cursor-pointer",3,"ngClass","id","cfTooltip","click"],[1,"py-3","px-4","flex","items-center","gap-x-2","bg-functional-1-1","rounded"],["icon","circle_information","size","small",1,"text-functional-1-3"],[1,"flex","flex-col","grow","text-neutral-gray-6"],[1,"text-espressive-md"],["size","small","icon","close",1,"text-neutral-gray-4","cursor-pointer",3,"click"],[1,"md:overflow-y-auto","md:hidden",3,"selectedIndexChange"],["class","w-1/4 grow-0 md:w-fit",3,"active","title",4,"ngFor","ngForOf"],[1,"w-1/4","grow-0","md:w-fit",3,"active","title"],["titleTemplate",""],[1,"flex","gap-x-4","items-center","md:-mx-1","md:-my-1.5"],[1,"flex","justify-center","items-center","w-8","h-8","rounded-full","bg-neutral-gray-1","text-neutral-gray-4","text-heading-sm","md:w-6","md:h-6","md:text-espressive-sm"],[1,"flex","flex-col"],[1,"text-heading-sm","whitespace-nowrap"],[1,"text-body-sm","md:hidden","text-neutral-gray-5","whitespace-nowrap"],[1,"text-body-sm","hidden","md:block","text-neutral-gray-5","whitespace-nowrap"],[1,"md:hidden",3,"sortDefault","tabDetail","sortChange"],[1,"flex","justify-between","items-center","md:hidden"],[1,"flex","gap-x-3"],["cf-button","","size","medium","type","secondary","class","bg-white flex gap-x-2",3,"disabled","click",4,"ngIf"],[1,"md:hidden",3,"sortDefault","disableSort","sortChange"],["cf-button","","size","medium","type","secondary",1,"bg-white","flex","gap-x-2",3,"disabled","click"],["icon","ticket","size","small",1,"text-heading-xs","text-neutral-black","mr-1.5",3,"ngClass"],["icon","document","size","small",1,"text-heading-xs","text-neutral-black","mr-1.5",3,"ngClass"],["class","flex flex-col gap-y-3","infinite-scroll","",3,"infiniteScrollDistance","infiniteScrollThrottle","infiniteScrollContainer","scrollWindow","fromRoot","alwaysCallback","scrolled",4,"ngIf"],[4,"ngIf","ngIfElse"],["elseLoadingTemp",""],["infinite-scroll","",1,"flex","flex-col","gap-y-3",3,"infiniteScrollDistance","infiniteScrollThrottle","infiniteScrollContainer","scrollWindow","fromRoot","alwaysCallback","scrolled"],[4,"ngFor","ngForOf","ngForTrackBy"],["class","text-heading-md",4,"ngIf"],[3,"ticket","listFareRule","loading","ticketSelected","ticketComboShare","verifyFlight",4,"ngIf"],[3,"ticket","listFareRule","loading","ticketSelected","ticketComboShare","verifyFlight"],[1,"text-heading-md"],[3,"ticket","listFareRule","ticketComboShare",4,"ngIf"],[3,"ticket","listFareRule","ticketComboShare"],["class","empty flex items-center mt-20 flex-col",4,"ngIf","ngIfElse"],["elseEmptyTemp",""],[1,"empty","flex","items-center","mt-20","flex-col"],["src","assets/images/empty_result.png","alt","empty",1,"w-[160px]","h-160px","object-contain"],[1,"text-heading-md","mt-[30px]"],[1,"text-body-md","mt-2","text-center"],["cf-button","","color","primary-1","size","medium",1,"w-[200px]","mt-6","justify-center",3,"type","click"],["class","empty flex items-center mt-20 flex-col",4,"ngIf"],[1,"text-body-md","mt-2"],["cf-button","","size","medium",1,"w-[200px]","mt-6","justify-center","bg-white",3,"type","click"],["icon","search","size","small",1,"mr-2"],["elseSearchFlightTemplate",""],[1,"min-w-[676px]","md:min-w-fit","flex","flex-col","gap-y-3"],["elseSearchResultsTemplate",""],[3,"ticket","listFareRule","mobileSelected","listFareRuleClasses","onReselectClick",4,"ngIf"],[3,"ticket","listFareRule","mobileSelected","listFareRuleClasses","onReselectClick"],[3,"ticket","listFareRule","listFareRuleClasses","ticketSelected",4,"ngIf"],[3,"ticket","listFareRule","listFareRuleClasses","ticketSelected"],["elseSearchFlightAgentTemp",""],["elseSearchResultsAgentTemp",""],[3,"ticket","listFareRule","mobileSelected","listFareRuleClasses","onReselectClick","ticketSelected",4,"ngIf"],[3,"ticket","listFareRule","mobileSelected","listFareRuleClasses","onReselectClick","ticketSelected"],["icon","share","size","small",1,"cursor-pointer",3,"click"],[1,"text-heading-md","text-neutral-black"]],template:function(t,i){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div")(5,"cf-flight-type-selector",4),e.NdJ("flightTypeSearchChange",function(n){return i.flightTypeChange(n)}),e.qZA()(),e.TgZ(6,"div",5)(7,"cf-number-of-passenger",6),e.NdJ("numberOfPassengerChange",function(n){return i.numberOfPassengerChange(n)}),e.qZA(),e.TgZ(8,"cf-airline-filter",7),e.NdJ("airlineFilterChange",function(n){return i.airlineFilterChange(n)}),e.qZA(),e._UZ(9,"cf-voucher-selector",8),e.TgZ(10,"cf-cabin-selector",9),e.NdJ("cabinChange",function(n){return i.cabinChange(n)}),e.qZA(),e.TgZ(11,"cf-pax-type-selector",10),e.NdJ("paxTypeChange",function(n){return i.paxTypeChange(n)}),e.qZA()()(),e.TgZ(12,"div",11)(13,"cf-search-flight-input",12,13),e.NdJ("removeRoute",function(n){return i.removeRoute(n)})("dataChange",function(n){return i.onChangeInputSearch(n)})("toggleAirline",function(n){return i.onToggleAirline(n)})("dateTypeChange",function(n){return i.onDateTypeChange(n)})("navigateDatepicker",function(n){return i.onNavigateDatepicker(n)}),e.qZA(),e.YNc(15,da,4,1,"button",14),e.qZA(),e.YNc(16,ha,14,1,"div",15),e.qZA(),e.YNc(17,ya,8,1,"div",16),e.YNc(18,Ca,2,2,"div",17),e.qZA(),e.TgZ(19,"div",18)(20,"div",19)(21,"mobile-search-input",20),e.NdJ("onReseachFlight",function(){return i.researchFlight()})("onFlightTypeChange",function(n){return i.flightTypeChange(n)})("onQuotation",function(){return i.onMobileQuotation(i.currentLeg)}),e.qZA()(),e.TgZ(22,"div",21)(23,"div",22),e.YNc(24,ba,1,2,"app-sort-flight",23),e.YNc(25,Sa,1,2,"app-sort-flight-combo",24),e.TgZ(26,"app-filter-flight",25),e.NdJ("ticketFilterChange",function(n){return i.filterChange(n)})("ticketDisplayChange",function(n){return i.displayChange(n)}),e.qZA(),e.YNc(27,xa,1,2,"app-switch-mode",26),e.TgZ(28,"airline-filter-bottom-sheet",27),e.NdJ("ticketFilterChange",function(n){return i.filterChange(n)}),e.qZA(),e.TgZ(29,"stop-number-filter-bottom-sheet",28),e.NdJ("ticketFilterChange",function(n){return i.filterChange(n)}),e.qZA()()()(),e.YNc(30,Na,6,1,"div",29),e.TgZ(31,"div",30)(32,"div",31)(33,"app-filter-flight",32),e.NdJ("ticketFilterChange",function(n){return i.filterChange(n)})("ticketDisplayChange",function(n){return i.displayChange(n)}),e.qZA()(),e.TgZ(34,"div",33),e.YNc(35,wa,8,0,"div",34),e.YNc(36,Ra,2,1,"cf-tabset",35),e.YNc(37,Ba,1,2,"app-sort-flight-combo",36),e.TgZ(38,"div",37)(39,"div",38),e.YNc(40,Qa,6,6,"div",39),e.TgZ(41,"div",40),e.YNc(42,Wa,5,3,"ng-container",41),e.YNc(43,pn,4,2,"ng-container",41),e.YNc(44,In,4,2,"ng-container",41),e.qZA()(),e.TgZ(45,"div",42)(46,"div",43)(47,"div",44)(48,"div",45),e._uU(49,"Chuy\u1ebfn bay c\u1ee7a b\u1ea1n"),e.qZA(),e.YNc(50,En,1,0,"cf-icon",46),e.qZA(),e.TgZ(51,"div")(52,"ticket-selected",47),e.NdJ("reselect",function(n){return i.reselect(n)})("showDetail",function(n){return i.onShowDetailInfo(n)}),e.qZA()(),e.YNc(53,An,7,7,"div",48),e.qZA()()()()()(),e.TgZ(54,"ticket-selected-bottom-sheet",49),e.NdJ("reselect",function(n){return i.reselect(n)})("showDetail",function(n){return i.onShowDetailInfo(n)})("share",function(){return i.onShare()}),e.qZA()),2&t&&(e.xp6(5),e.Q6J("flightType",i.flightTypeSearch),e.xp6(2),e.Q6J("adultNumber",i._searchInputService.numberOfPassenger.adult)("childNumber",i._searchInputService.numberOfPassenger.child)("infantNumber",i._searchInputService.numberOfPassenger.infant),e.xp6(1),e.Q6J("airlineList",i._searchInputService.airlineFilters),e.xp6(1),e.Q6J("promotionGroupList",i._searchInputService.promotionGroupFilters),e.xp6(1),e.Q6J("cabinList",i._searchInputService.cabinList)("actived",i._searchInputService.hasAirportInternational),e.xp6(1),e.Q6J("paxTypeList",i._searchInputService.paxTypeList)("actived",i._searchInputService.hasAirportInternational),e.xp6(2),e.Q6J("formArray",i._searchInputService.searchInputForm)("minFareOptionConfig",i.minFareOptionConfig),e.xp6(2),e.Q6J("ngIf",i.flightTypeSearch!==i.multiFilghtType),e.xp6(1),e.Q6J("ngIf",i.flightTypeSearch===i.multiFilghtType),e.xp6(1),e.Q6J("ngIf",i.multiDateBar.length&&i.minFareOptionConfig),e.xp6(1),e.Q6J("ngIf",i.isprogress),e.xp6(3),e.Q6J("currentMode",i.currentMode),e.xp6(3),e.Q6J("ngIf","combo"!==i.currentMode),e.xp6(1),e.Q6J("ngIf","combo"===i.currentMode),e.xp6(1),e.Q6J("currentMode",i.currentMode)("airlineList",i.airlineList)("hasAirportInternational",i.hasAirportInternational)("ticketFilter",i.ticketFilterState.value)("ticketDisplay",i.ticketDisplayState.value)("fareclassList",i.fareclassList)("planeModelList",i.planModelList)("selectedFare",i.selectedFare)("departureTimeList",i.departureTimeList)("arrivalTimeList",i.arrivalTimeList)("durationFilter",i.durationFilter)("minDuration",i.minDuration)("maxDuration",i.maxDuration)("departTimeComboList",i.departTimeComboList)("arriveTimeComboList",i.arriveTimeComboList)("minFareClss",i.minFareClss)("priceFilter",i.priceFilter)("minPrice",i.minPrice)("maxPrice",i.maxPrice)("bookingSystemList",i.bookingSystemList)("priceFilter",i.priceFilter),e.xp6(1),e.Q6J("ngIf","combo"!==i.currentMode),e.xp6(1),e.Q6J("airlineList",i.airlineList)("ticketFilter",i.ticketFilterState.value),e.xp6(1),e.Q6J("ticketFilter",i.ticketFilterState.value),e.xp6(1),e.Q6J("ngIf",i.multiDateBar.length&&i.minFareOptionConfig),e.xp6(3),e.Q6J("currentMode",i.currentMode)("airlineList",i.airlineList)("hasAirportInternational",i.hasAirportInternational)("ticketFilter",i.ticketFilterState.value)("ticketDisplay",i.ticketDisplayState.value)("fareclassList",i.fareclassList)("planeModelList",i.planModelList)("departureTimeList",i.departureTimeList)("minFareClss",i.minFareClss)("priceFilter",i.priceFilter)("minPrice",i.minPrice)("maxPrice",i.maxPrice)("departTimeComboList",i.departTimeComboList)("arriveTimeComboList",i.arriveTimeComboList)("priceFilter",i.priceFilter)("durationFilter",i.durationFilter)("minDuration",i.minDuration)("maxDuration",i.maxDuration)("bookingSystemList",i.bookingSystemList)("selectedFare",i.selectedFare)("arrivalTimeList",i.arrivalTimeList),e.xp6(1),e.ekj("!gap-y-4","combo"===i.currentMode),e.xp6(1),e.Q6J("ngIf",i.isShowBambooPromotionError),e.xp6(1),e.Q6J("ngIf",i.tabData.length>1&&"combo"!==i.currentMode),e.xp6(1),e.Q6J("ngIf","combo"===i.currentMode),e.xp6(3),e.Q6J("ngIf","combo"!==i.currentMode),e.xp6(2),e.Q6J("ngIf","combo"===i.currentMode),e.xp6(1),e.Q6J("ngIf","retail"===i.currentMode),e.xp6(1),e.Q6J("ngIf","agency"===i.currentMode),e.xp6(1),e.ekj("!mt-0","combo"===i.currentMode),e.xp6(5),e.Q6J("ngIf",i.showSharedFlight&&i.isShareFlight),e.xp6(2),e.Q6J("ticketsSelected",i.listTicketSelected),e.xp6(1),e.Q6J("ngIf",!i.isHiddenTotalCharge),e.xp6(1),e.Q6J("ticketSelectedNumber",i.ticketSelectedNumber)("ticketsSelected",i.listTicketSelected)("totalPrice",i.totalPrice))},dependencies:[L.N8,L.Xq,Pe.Q,Pe.F,P.qx,S.ez,S.mk,S.sg,S.O5,S.JJ,S.uU,P.ZZ,P.kx,P.Vz,P.AS,C.AxE,C.Sm8,P.bM,P.IA,A.DA,A.z6,A.h4,A.uX,A.t3,M.u5,M.UX,K.Rq,K.Ry,dt.MobileSearchInputComponent,P.xq,P.m0,P.a7,P.wv,P.wH,P.Fr,A.qB,A.P_,ut.Lk],encapsulation:2}),r})()},3803:(ct,G,_)=>{_.d(G,{h:()=>M});var S=_(94650);let M=(()=>{class L{get ticketSelectedData(){return JSON.parse(sessionStorage.getItem("ticketSelectedData"))}set ticketSelectedData(C){sessionStorage.setItem("ticketSelectedData",JSON.stringify(C))}}return L.\u0275fac=function(C){return new(C||L)},L.\u0275prov=S.Yz7({token:L,factory:L.\u0275fac,providedIn:"root"}),L})()}}]);