1import{a as j}from"./chunk-Z2LD5HMU.js";import{a as $}from"./chunk-H7HGRFC7.js";import{a as R}from"./chunk-OML77F6J.js";import{c as s}from"./chunk-M3FNJVTS.js";import"./chunk-RIRWM3ET.js";import{d as F,g as V,m as A}from"./chunk-3QSKYTJH.js";import"./chunk-HPNYYDN7.js";import"./chunk-GRJHFI3D.js";import"./chunk-FP4KXJ4T.js";import{t as D}from"./chunk-XDA64Y5H.js";import{Fb as S,Hb as O,Jb as k,Kb as x,L as E,Lb as f,Qb as r,Ra as w,Rb as a,Sb as h,Tb as M,Ub as b,W as l,Xa as c,Yb as C,Zb as m,aa as u,ba as _,i as v,kb as y,lc as p,m as g,ma as P,mc as T,nc as I}from"./chunk-CZW7ZMZR.js";import"./chunk-EL2NI3EA.js";var U=(t,d)=>d._id;function B(t,d){if(t&1){let e=M();r(0,"div",10),C("click",function(){u(e);let n=m().$implicit,o=m();return _(o.selectCarImage(n))}),h(1,"img",11),a()}if(t&2){let e=d.$implicit;c(),b("src",e,w)}}function N(t,d){if(t&1){let e=M();r(0,"div",7),C("click",function(){let n=u(e).$implicit,o=m();return _(o.selectModel(n))}),r(1,"h2"),p(2),a(),r(3,"div",8),x(4,B,2,1,"div",9,k),a()()}if(t&2){let e=d.$implicit;c(2),T(e.name),c(2),f(e.imageURL)}}function Y(t,d){if(t&1&&(r(0,"div",5)(1,"h2"),p(2),a()()),t&2){let e=m();c(2),I("Selected Model: ",e.selectedModel().name)}}var ie=(()=>{class t{modelService=l($);editService=l(j);authService=l(R);route=l(F);router=l(V);authData=s(this.authService.getAuthData());makeId=s(this.route.params.pipe(g(e=>e.makeId)));carsModel=s(this.authService.getAuthData().pipe(E(e=>{let i=this.makeId();return e.authToken&&i?this.modelService.getModel(e.authToken).pipe(g(n=>(n.resultData||[]).filter(o=>o.make_id?._id===i))):v([])})),{initialValue:[]});selectedModel=P(null);ngOnInit(){}selectModel(e){this.selectedModel.set(e)}selectCarImage(e){let i=e.carType,n=e._id,o=this.authData();o?.userId&&o?.authToken&&this.updateEmailProfile(o.userId,i,n,o.authToken)}updateEmailProfile(e,i,n,o){let z={carType:i,model_id:n};this.editService.updateUserProfile(e,z,o).subscribe({next:()=>{this.router.navigate(["/"]).then(()=>{window.location.reload()})},error:L=>{console.error("Error updating profile:",L)}})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-model"]],decls:9,vars:1,consts:[[1,"container"],[1,"center"],[1,"title"],[1,"car-container"],[1,"car"],[1,"selected-model-details"],[1,"empty"],[1,"car",3,"click"],[1,"image-container"],[1,"image"],[1,"image",3,"click"],["alt","Car Image",3,"src"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"div",1)(2,"div",2),p(3,"Select Your Car Model"),a()(),r(4,"div",3),x(5,N,6,1,"div",4,U),a(),S(7,Y,3,1,"div",5),a(),h(8,"div",6)),i&2&&(c(5),f(n.carsModel()),c(2),O(n.selectedModel()?7:-1))},dependencies:[D,A],styles:["body[_ngcontent-%COMP%], html[_ngcontent-%COMP%]{margin:0;padding:0;font-family:Arial,sans-serif}.center[_ngcontent-%COMP%]{text-align:center}.title[_ngcontent-%COMP%]{font-size:20px;font-weight:700;margin-bottom:20px;color:#988a8a}.container[_ngcontent-%COMP%]{max-width:100%;padding:10px;box-sizing:border-box}.car-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px}.car[_ngcontent-%COMP%]{flex:1 1 calc(16.666% - 10px);max-width:calc(16.666% - 10px);background-color:var(--color-bg);padding:10px;border-radius:8px;display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer}.image-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.image[_ngcontent-%COMP%]{width:80px;height:80px;overflow:hidden;border-radius:5px}.image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}@media only screen and (max-width:767px){.container[_ngcontent-%COMP%]{padding:5px}.car-container[_ngcontent-%COMP%]{gap:5px}.car[_ngcontent-%COMP%]{flex:1 1 calc(25% - 5px);max-width:calc(25% - 5px);padding:5px;border-radius:4px}.car[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:12px;margin:3px 0}.image[_ngcontent-%COMP%]{width:50px;height:50px;border-radius:3px}.empty[_ngcontent-%COMP%]{margin-bottom:25%}}"],changeDetection:0})}return t})();export{ie as ModelComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.