-
Notifications
You must be signed in to change notification settings - Fork 0
/
6372.84ea662920afc9cd.js
1 lines (1 loc) · 5.1 KB
/
6372.84ea662920afc9cd.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[6372],{36372:(F,h,n)=>{n.r(h),n.d(h,{BtcOrderLookupComponent:()=>J});var p=n(36895),t=n(94650),i=n(24006),f=n(83700),u=n(72506),l=n(44143),v=n(77579),C=n(71884),g=n(63900),E=n(44671),I=n(60515);let O=(()=>{class e{constructor(){this.container=(0,t.f3M)(i.gN,{optional:!0}),this.control=(0,t.f3M)(i.a5,{optional:!0}),this.refresh$=new v.x,this.valueChanges=this.refresh$.pipe((0,C.x)(),function x(){return(0,g.w)(E.y)}())}ngDoCheck(){var o,r;this.refresh$.next((null===(o=this.control)||void 0===o?void 0:o.valueChanges)||(null===(r=this.container)||void 0===r?void 0:r.valueChanges)||I.E)}}return e.\u0275fac=function(o){return new(o||e)},e.\u0275dir=t.lG2({type:e,selectors:[["","valueChanges",""]],outputs:{valueChanges:"valueChanges"},standalone:!0}),e})();var m=n(80529),y=n(88001),k=n(50494),L=n(54004),a=n(97582),d=n(87067);let B=(()=>{class e{}return(0,a.gn)([(0,d.C)()],e.prototype,"data",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"errorCode",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"objectError",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"status",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"success",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"traceId",void 0),e})();var D=n(49557);const T={headers:new m.WM({"Content-Type":"application/json"})};let Z=(()=>{class e{constructor(o,r,c){this.http=o,this.appConfig=r,this._recaptchaService=c}checkOrderExist(o){return this._recaptchaService.getRecaptchaToken$().pipe((0,g.w)(r=>this.http.post(this.appConfig.apiB2cUrl+"b2c-ticket/check-order-exist",JSON.stringify({orderId:o,recaptcha:r}),T)),(0,L.U)(r=>(0,k.yE)(B,r,{excludeExtraneousValues:!0})))}}return e.\u0275fac=function(o){return new(o||e)(t.LFG(m.eN),t.LFG(y.qB),t.LFG(D.K))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function N(e,s){1&e&&t._UZ(0,"cf-input-hint",12),2&e&&t.Q6J("hint","M\xe3 \u0111\u01a1n h\xe0ng kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function A(e,s){1&e&&t._UZ(0,"cf-input-hint",12),2&e&&t.Q6J("hint","M\xe3 \u0111\u01a1n h\xe0ng kh\xf4ng ch\xednh x\xe1c")}let J=(()=>{class e{constructor(o,r){this.cfIconRegister=o,this.CheckOrderExistSvc=r,this.isOrderIdCorrect=!0,this.isLoading=!1,this.form=(0,t.f3M)(i.qu).nonNullable.group({orderId:["",i.kI.required]}),o.registerIcons([u.YwC])}orderIdChanges(o){o&&!this.isOrderIdCorrect&&(this.isOrderIdCorrect=!0)}submit(){if(this.form.markAllAsTouched(),this.form.invalid||this.isLoading)return;const o=this.form.value.orderId;this.isLoading=!0,this.CheckOrderExistSvc.checkOrderExist(o).subscribe({next:r=>{var c;this.isOrderIdCorrect=r.data&&(null===(c=r.data)||void 0===c?void 0:c.isExist),this.isOrderIdCorrect&&window.open(`${window.location.origin}/order/${o}`,"_top")},error:r=>{console.error("Error checking order:",r)},complete:()=>{this.isLoading=!1}})}}return e.\u0275fac=function(o){return new(o||e)(t.Y36(u.KNP),t.Y36(Z))},e.\u0275cmp=t.Xpm({type:e,selectors:[["btc-order-lookup"]],standalone:!0,features:[t.jDz],decls:15,vars:5,consts:[[1,"max-w-[764px]","p-10","rounded-lg","bg-white","md:flex-col","flex","gap-10","w-full","mx-auto","h-screen","!h-[100svh]","justify-center","items-center",3,"formGroup"],["src","/assets/images/b2c/search-order-lookup.svg","alt","search-order-lookup",1,"w-[300px]","h-[300px]","md:w-[160px]","md:h-[160px]"],[1,"flex","flex-col","gap-10","items-center","justify-center","text-center","w-full"],[1,"flex","gap-x-[10px]"],["src","/assets/images/b2c/flight-minimum.svg"],[1,"text-heading-md","uppercase","font-bold","text-red-4"],[1,"w-full","flex","text-start","flex-1"],[1,"w-full",3,"status"],["cfHeadIcon","","icon","ticket","size","small"],["cf-input","","size","medium","placeholder","Nh\u1eadp m\xe3 \u0111\u01a1n h\xe0ng","formControlName","orderId",3,"valueChanges"],["cfHint","",3,"hint",4,"ngIf"],["cf-button","","type","solid",1,"min-w-[100px]","justify-center","bg-neutral-white","w-full",3,"disabled","click"],["cfHint","",3,"hint"]],template:function(o,r){1&o&&(t.TgZ(0,"form",0),t._UZ(1,"img",1),t.TgZ(2,"div",2)(3,"div",3),t._UZ(4,"img",4),t.TgZ(5,"div",5),t._uU(6,"tra c\u1ee9u \u0111\u01a1n h\xe0ng"),t.qZA()(),t.TgZ(7,"div",6)(8,"cf-input-group",7),t._UZ(9,"cf-icon",8),t.TgZ(10,"input",9),t.NdJ("valueChanges",function(U){return r.orderIdChanges(U)}),t.qZA(),t.YNc(11,N,1,1,"cf-input-hint",10),t.YNc(12,A,1,1,"cf-input-hint",10),t.qZA()(),t.TgZ(13,"button",11),t.NdJ("click",function(){return r.submit()}),t._uU(14," Ti\u1ebfp t\u1ee5c "),t.qZA()()()),2&o&&(t.Q6J("formGroup",r.form),t.xp6(8),t.Q6J("status",r.form.controls.orderId.invalid&&(r.form.controls.orderId.dirty||r.form.controls.orderId.touched)||!r.isOrderIdCorrect?"error":"default"),t.xp6(3),t.Q6J("ngIf",r.form.controls.orderId.hasError("required")&&(r.form.controls.orderId.touched||r.form.controls.orderId.dirty)),t.xp6(1),t.Q6J("ngIf",!(r.form.controls.orderId.hasError("required")&&(r.form.controls.orderId.touched||r.form.controls.orderId.dirty)||r.isOrderIdCorrect)),t.xp6(1),t.Q6J("disabled",r.isLoading))},dependencies:[p.ez,p.O5,f.N8,f.Xq,u.AxE,u.Sm8,i.UX,i._Y,i.Fj,i.JJ,i.JL,i.sg,i.u,l.j$,l.ND,l.BN,l.v2,O],styles:["[_nghost-%COMP%]{display:block}"]}),e})()}}]);