1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([[7783,83837],{7783:function(e,t,r){r.r(t),r.d(t,{default:function(){return Vs}});var a={};r.r(a),r.d(a,{NV:function(){return _e},k1:function(){return Ee},fU:function(){return ee},W4:function(){return be},K0:function(){return fe},tr:function(){return me},Ar:function(){return qe},RF:function(){return pe},VU:function(){return W},iJ:function(){return se},Rl:function(){return Ne},rk:function(){return ae},zx:function(){return ne},SE:function(){return we},R$:function(){return G},hu:function(){return $},bY:function(){return J},d9:function(){return Z},re:function(){return Q},n1:function(){return X},T7:function(){return Ie},Zd:function(){return ye},bA:function(){return ve},kr:function(){return he},_J:function(){return de},_N:function(){return ue},yb:function(){return re},Om:function(){return te},zh:function(){return Se},q7:function(){return ie},H3:function(){return Re},pF:function(){return Ve},Ns:function(){return oe},jx:function(){return ge},Fm:function(){return le},OK:function(){return Te},rO:function(){return ce},X0:function(){return Ce},o2:function(){return De},Z1:function(){return j},A2:function(){return M},Wl:function(){return P},fH:function(){return k},SI:function(){return A},gS:function(){return u},zQ:function(){return E},AU:function(){return _},BM:function(){return h},XJ:function(){return q},IE:function(){return D},_H:function(){return T},Nr:function(){return b},hM:function(){return O},YA:function(){return x},Lp:function(){return V},EA:function(){return N},KI:function(){return d},PV:function(){return g},Ee:function(){return p},Pu:function(){return K},Jt:function(){return B},I$:function(){return S},BU:function(){return R},s0:function(){return y},QL:function(){return m},U2:function(){return v},fT:function(){return f},sf:function(){return I},XN:function(){return w},Ih:function(){return L},qY:function(){return H},fk:function(){return z},S9:function(){return U},SY:function(){return C},or:function(){return Oe},Dz:function(){return xe},p:function(){return F},ns:function(){return Y}});var n=r(14590),s=r(20038),i=r(21524);function o(e){const t={};e.tda&&(t.tdaCode=e.tda),e.series&&(t.series={"c-hr":!0}[series]?e.series:e.series.toString().replace(/-/g,"")),e.year&&(t.year=e.year),t.lang=document.documentElement.getAttribute("lang")||"en",t.brandId=1;return{cache:!1,url:(0,i.Sw)(e.zip),parser:"default",dataType:"jsonp",urlParameters:t}}function c(e,t){return{getVehicles:async()=>{const r=function({authKey:e}){return{cache:!1,url:i.b2,parser:"nested",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:e}}}({authKey:t}),a=await e.apiCall(r);if(a)return a},getVehicleHealthReport:async r=>{const a=function({authKey:e,vin:t}){return{cache:!1,url:(0,i.AG)(t),parser:"default",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:e},body:{vin:t}}}({vin:r,authKey:t}),n=await e.apiCall(a);if(n)return n},getVehicleHealthHistory:async r=>{const a=(n={vin:r,authKey:t},{cache:!1,url:(0,i.Go)(n.vin),parser:"nested",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:n.authKey},body:{vin:n.vin}});var n;const s=await e.apiCall(a);if(s)return s},getVehicleMileageHistory:async r=>{const a=function({authKey:e,vin:t}){return{cache:!1,url:(0,i.u7)(t),parser:"nested",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:e},body:{vin:t}}}({vin:r,authKey:t}),n=await e.apiCall(a);if(n)return n},getVehicleMaintenanceSchedule:async(t,r,a)=>{const n=function({vin:e="",lastKnownMileage:t=null,captchaToken:r}){const a={vin:e,lastKnownMileage:t,tokenAttributes:{xauthToken:r,xconsumer:"TDRMT",xreferrer:window.location.origin+"/"}};return{cache:!1,url:i.wN,parser:"nested",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T"},body:a}}({vin:t,lastKnownMileage:r,captchaToken:a}),s=await e.apiCall(n);if(s)return s}
1,getVehicleMaintenanceScheduled:async(t,r,a)=>{const n=function({model:e="",year:t="",captchaToken:r}){const a={model:e,year:t,division:"TOYOTA",tokenAttributes:{xauthToken:r,xconsumer:"TDRMT",xreferrer:window.location.origin+"/"}};return{cache:!1,url:i.a_,parser:"nested",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T"},body:a}}({model:t,year:r,captchaToken:a}),s=await e.apiCall(n);if(s)return s},postMaintenanceScheduleEmail:async t=>{const r=function({requestBody:e}){return{cache:!1,url:i.y_,parser:"default",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","x-client":"TCOM"},body:e}}({requestBody:t}),a=await e.apiCall(r);if(a)return a},getEngineTransmissionDrive:async(t,r,a,n,s,o,c)=>{const l=function({model:e,year:t,lastKnownMileage:r,engine:a,transmission:n,driveType:s,captchaToken:o}){const c={model:e,year:t,lastKnownMileage:r,engine:a,transmission:n,driveType:s,division:"TOYOTA",tokenAttributes:{xauthToken:o,xconsumer:"TDRMT",xreferrer:window.location.origin+"/"}};return{cache:!1,url:i.au,parser:"nested",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T"},body:c}}({model:t,year:r,lastKnownMileage:a,engine:n,transmission:s,driveType:o,captchaToken:c}),d=await e.apiCall(l);if(d)return d},getVehicleDealer:async r=>{const a=function({authKey:e,vin:t}){return{cache:!1,url:(0,i.Jz)(t),parser:"nested-alt",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:e},body:{vin:t}}}({vin:r,authKey:t}),n=await e.apiCall(a);if(n)return n},getVehicleDrivers:async r=>{const a=function({authKey:e,vin:t}){return{cache:!1,url:(0,i.PC)(t),parser:"nested",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:e},body:{vin:t}}}({vin:r,authKey:t}),n=await e.apiCall(a);if(n)return n},getCustomerDcsInfo:async()=>{const r=function({authKey:e}){return{cache:!1,url:i.Ky,parser:"default",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM",authorization:e}}}({authKey:t}),a=await e.apiCall(r);if(a)return a},getCustomerDcsInfoV3:async r=>{const a=function({authKey:e,captchaToken:t}){return{cache:!1,url:i.ZZ,parser:"default",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM",authorization:e,origin:window.location.origin,"x-domain-token":t}}}({authKey:t,captchaToken:r}),n=await e.apiCall(a);if(n)return n},putCustomerUpdatePassword:async(r,a,n,s)=>{const o=function({authKey:e,captchaToken:t,password:r,newPassword:a,otpCode:n}){const s={currentPassword:r,newPassword:a,otp:n};return{cache:!1,url:i.EG,parser:"default",method:"put",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM",authorization:e,"x-domain-token":t,origin:window.location.origin},body:s}}({authKey:t,password:r,newPassword:a,otpCode:n,captchaToken:s}),c=await e.apiCall(o);if(c)return c},postCreateAccount:async t=>{const r=function(e){const t=e;return console.log("!!!!!!!",t),{cache:!1,url:i.ho,parser:"default",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM"},body:t}}(t),a=await e.apiCall(r);if(a)return a},putResetPassword:async t=>{const r=function(e){const t=e;return{cache:!1,url:i.zw,parser:"default",method:"put",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-Client":"TCOM","X-Version":1.6},body:t}}(t),a=await e.apiCall(r);if(a)return a},postCustomerUpdatePersonalInfo:async r=>{const a=function({authKey:e,userData:t}){const r=t;return{cache:!1,url:i.PE,parser:"default",method:"put",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM",authorization:e},body:r}}({authKey:t,userData:r}),n=await e.apiCall(a);if(n)return n},putCustomerUpdatePersonalInfoV4:async(r,a)=>{const n=function({authKey:e,requestBody:t,captchaToken:r}){const a=t;return{cache:!1,url:i.nh,parser:"default",method:"put",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM",authorization:e,origin:window.location.origin,"x-domain-token":r},body:a}}({authKey:t,requestBody:r,captchaToken:a}),s=await e.apiCall(n);if(s)return s},postGenerateOtp:async(r,a)=>{const n=function({authKey:e,requestBody:t,captchaToken:r}){const a=t;return{cache:!1,url:i.o4,parser:"default",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM",authorization:e,"X-DOMAIN-TOKEN":r,origin:window.location.origin},body:a}}({authKey:t,requestBody:r,captchaToken:a}),s=await e.apiCall(n);if(s)return s},patchValidatePassword:async(r,a)=>{const n=function({authKey:e,requestBody:t,captchaToken:r}){const a=t;return{cache:!1,url:i.Ec,parser:"default",method:"PATCH",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM",authorization:e,"x-domain-token":r,origin:window.location.origin},body:a}}({authKey:t,requestBody:a,captchaToken:r}),s=await e.apiCall(n);if(s)return s},patchValidateOtp:async(r,a)=>{const n=function({authKey:e,requestBody:t,captchaToken:r}){const a=t;return{cache:!1,url:i.o4,parser:"default",method:"PATCH",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","X-CLIENT":"TCOM",authorization:e,"x-domain-token":r,origin:window.location.origin},body:a}}({authKey:t,requestBody:a,captchaToken:r}),s=await e.apiCall(n);if(s)return s},getVehicleSubscriptions:async r=>{const a=function({authKey:e,vin:t}){return{cache:!1,url:(0,i.O3)(t),parser:"nested",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:e},body:{vin:t}}}({vin:r,authKey:t}),n=await e.apiCall(a);if(n)return n},getCustomerSubscriptions:async()=>{const r=function({authKey:e}){return{cache:!1,url:i.y6,parser:"nested",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:e}}}({authKey:t}),a=await e.apiCall(r);if(a)return a},getVehicleSelfByVin:async(r,a="third")=>{const n=function({vin:e,serviceType:t,authKey:r}){return{cache:!1,url:(0,i.OO)(e,t),parser:"nested",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:r},body:{vin:e,serviceType:t}}}({vin:r,serviceType:a,authKey:t}),s=await e.apiCall(n);if(s)return s},getMarketingOffers:async(t,r,a)=>{const n=o({zip:t,series:r,year:a}),s=await e.apiCall(n[0]);if(s)return s},getWarningLights:async(t,r)=>{const a=function({model:e,year:t}){return{cache:!1,url:(0,i.V$)(e,t),parser:"default",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8"}}}({model:t,year:r}),n=await e.apiCall(a);if(n)return n},getBz4xVerifyVin:async t=>{const r=function({vin:e}){return{cache:!1,url:(0,i.E5)(e),parser:"default",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8"}}}({vin:t}),a=await e.apiCall(r);if(a)return a},getVehicleRecalls:async t=>{const r=function(e){let t;return e.licensePlate&&e.state&&(t=(0,i.zT)(e.licensePlate,e.state,e.token)),e.vin&&(t=(0,i.jn)(e.vin,e.token)),{cache:!1,url:t,parser:"default",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8"}}}(t),a=await e.apiCall(r);if(a)return a},getCheckEmailAvailability:async t=>{const r=function({email:e}){return{cache:!1,url:(0,i.M9)(e),parser:"default",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","X-BRAND":"T","X-CLIENT":"TCOM"}}}(t),a=await e.apiCall(r);if(a)return a},getOwnersOffers:async t=>{const r=function(e){let t;return e.city&&e.state&&(t=(0,i.vK)(e.city,e.state)),e.zip&&(t=(0,i.i6)(e.zip)),e.dealerCode&&(t=(0,i.$P)(e.dealerCode)),{cache:!1,url:t,parser:"default",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","x-project-token":"TCOM"}}}(t),a=await e.apiCall(r);if(a)return a},getToyotaCare:async(t,r)=>{const a=(s={xauthToken:(n={vin:t,captchaToken:r}).captchaToken,xconsumer:"TDRMT",xreferrer:window.location.origin+"/"},{cache:!1,url:i.LV,parser:"nested",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T"},body:{vin:n.vin,tokenAttributes:s}});var n,s;const o=await e.apiCall(a);if(o)return o},getSafetyCampaigns:async(t,r)=>{const a=function({vin:e,captchaToken:t}){const r={vin:e,tokenAttributes:{xauthToken:t,xconsumer:"TDRMT",xreferrer:window.location.origin+"/"}};return{cache:!1,url:i.Fb,parser:"default",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"TDRMT"},body:r}}({vin:t,captchaToken:r}),n=await e.apiCall(a);if(n)return n},getServiceOpCodes:async()=>{const r=function({authKey:e}){return{cache:!1,url:i.YJ,parser:"nested",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T",authorization:e}}}({authKey:t}),a=await e.apiCall(r);if(a)return a},getPreferredVehicle:async(r,a)=>{const n=function({vhId:e,authKey:t,fitPackage:r}){return{cache:!1,url:(0,i.PY)(e),parser:"default",method:"PATCH",headers:{"Content-Type":"application/json; charset=utf-8","x-brand":"T",authorization:t},body:r}}({vhId:r,authKey:t,fitPackage:a}),s=await e.apiCall(n);if(s)return s},getVehicleSpecification:async(t,r)=>{const a=function(e){const t={xauthToken:e?.token,xconsumer:"TDRMT",xreferrer:window.location.origin+"/"};return{cache:!1,url:i.n0,parser:"default",method:"post",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T"},body:{vin:e?.vhId,tokenAttributes:t}}}({vhId:t,token:r}),n=await e.apiCall(a);if(n)return n},getVehicleDetailedSpecification:async(t,r)=>{const a=(n={vhId:t,captchaToken:r},{cache:!1,url:i.v4,parser:"default",method:"post",dataType:"json",headers:{"x-brand":"T","x-client":"TCOM",Authorization:window?.tcom_v2.login.getToken(),"X-DOMAIN-TOKEN":n?.captchaToken,ORIGIN:window.location.origin,"Content-Type":"application/json"},body:{vin:n?.vhId}});var n;const s=await e.apiCall(a);if(s)return s},getDealerDetails:async t=>{const r=(a=t,{cache:!1,url:(0,i.B7)(a),parser:"default",method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T","x-project-token":"TCOM"}});var a;const n=await e.apiCall(r);if(n)return n}}}var l=r(14644);const d="old-owners-session-initialized",u="to_available_vehicles_changed",h="to_vehicle_changed",g="to_vehicle_by_vin_changed",p="to_vehicle_by_vin_status_changed",m="to_safety_campaigns_changed",f="to_safety_campaigns_status_changed",v="to_safety_campaigns_service_error",y="to_safety_campaigns_captcha_get_token_status_success",I="to_service_op_codes_changed",w="to_service_op_codes_status_changed",C="to_toyota_care_captcha_get_token_status_success",S="to_vehicle_model_year_list_changed",R="to_vehicle_model_year_list_status_changed",q="to_customer_communication_preferences_changed",D="to_customer_communication_preferences_status_changed",T="to_customer_communication_profile_changed",b="to_customer_communication_profile_status_changed",V="to_owner_offers_changed",N="to_owner_offers_status_changed",O="to_jellies_get_images_changed",x="to_jellies_get_images_status_changed",_="to_captcha_get_token_status_success",E="to_captcha_get_token_status_error",M="to_add_vehicle_status_error",A="to_add_vehicle_status_submission_success",k="to_add_vehicle_status_submission_error",P="to_add_vehicle_status_service_error",j="to_add_vehicle_captcha_get_token_status_success",
1L="to_vehicle_specification_status_error",U="to_vehicle_specification_status_submission_success",z="to_vehicle_specification_status_submission_error",H="to_vehicle_specification_status_service_error",B="to_vehicle_detailed_specification_status_submission_success",K="to_vehicle_detailed_specification_status_submission_error",Y="to.config",F="context",G=864e5,W=288e5,$=36e5,J=2628e6,Z=6048e5,X=e=>`owners-data-${e}`,Q=e=>`ownersContextInfo_${e}`,ee=e=>`availableVehicles_${e}`,te=e=>`vehicleHealthReport_${e}`,re=e=>`vehicleHealthHistory_${e}`,ae=(e,t)=>`vehicleMaintenanceSchedule_${e}_${t||"0"}`,ne=e=>`vehicleMaintenanceScheduled_${e}`,se=e=>`vehicleEngineTransmissionDrive_${e}`,ie=e=>`vehicleMileageHistory_${e}`,oe=e=>`vehicleSafetyCampaigns_${e}`,ce=e=>`vehicleSubscriptions_${e}`,le="vehicleServiceOpCodes",de=e=>`vehicleDealer_${e}`,ue=e=>`vehicleDrivers_${e}`,he=e=>`vehicleByVin_${e}`,ge=e=>`vehicleSelfByVin_${e}`,pe=e=>`customerSubscriptions_${e}`,me="customerCommunicationProfile",fe="customerCommunicationPreferences",ve=e=>`dealerOffers_${e}`,ye=e=>`dealerOffers_${e}`,Ie=(e,t)=>`dealerOffers_${e}_${t}`,we=e=>`marketingOffers_${e}`,Ce=e=>`vehicleToyotaCare_${e}`,Se=e=>`vehicleJellies_${e}`,Re="modelYearList",qe=e=>`customerDcsInfo_${e}`,De=e=>`warningLights_${e}`,Te=e=>`vehicleSpecification_${e}`,be=e=>`bz4xVerifyVin_${e}`,Ve=(e,t,r)=>e&&t?`vehicleRecalls_${e}_${t}`:`vehicleRecalls_${r}`,Ne=e=>`dealerDetails_${e}`,Oe="initial",xe="loading",_e="/vehicle/safety-campaigns",Ee="/vehicle/service-op-codes";const Me=e=>{var t=function(...e){const t={};let r=!1,a=0;"boolean"==typeof e[0]&&(r=e[0],a++);const n=e=>{for(const a in e)e.hasOwnProperty(a)&&(r&&"[object Object]"===Object.prototype.toString.call(e[a])?t[a]=merge(t[a],e[a]):t[a]=e[a])};for(;a<e.length;a++)n(e[a]);return t}({},{msgFormat:"string",outFormat:"hex"});e=function(e){try{return(new TextEncoder).encode(e,"utf-8").reduce((prev,curr>=prev+String.fromCharCode(curr)),"").toString()}catch(t){return unescape(encodeURIComponent(e))}}(e);var r=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],n=(e+=String.fromCharCode(128)).length/4+2,s=Math.ceil(n/16),i=[];i.length=s;for(let t=0;t<s;t++){i[t]=[],i[t].length=16;for(let r=0;r<16;r++)i[t][r]=e.charCodeAt(64*t+4*r+0)<<24|e.charCodeAt(64*t+4*r+1)<<16|e.charCodeAt(64*t+4*r+2)<<8|e.charCodeAt(64*t+4*r+3)}var o=8*(e.length-1)/Math.pow(2,32),c=8*(e.length-1)>>>0;i[s-1][14]=Math.floor(o),i[s-1][15]=c;for(let e=0;e<s;e++){var l=[];l.length=64;for(let t=0;t<16;t++)l[t]=i[e][t];for(let e=16;e<64;e++)l[e]=Le(l[e-2])+l[e-7]+je(l[e-15])+l[e-16]>>>0;var d=a[0],u=a[1],h=a[2],g=a[3],p=a[4],m=a[5],f=a[6],v=a[7];for(let e=0;e<64;e++){const t=v+Pe(p)+Ue(p,m,f)+r[e]+l[e],a=ke(d)+ze(d,u,h);v=f,f=m,m=p,p=g+t>>>0,g=h,h=u,u=d,d=t+a>>>0}a[0]=a[0]+d>>>0,a[1]=a[1]+u>>>0,a[2]=a[2]+h>>>0,a[3]=a[3]+g>>>0,a[4]=a[4]+p>>>0,a[5]=a[5]+m>>>0,a[6]=a[6]+f>>>0,a[7]=a[7]+v>>>0}for(let e=0;e<a.length;e++)a[e]=`00000000${a[e].toString(16)}`.slice(-8);const y="hex-w"===t.outFormat?" ":"";return a.join(y)};function Ae(e,t){return t>>>e|t<<32-e}function ke(e){return Ae(2,e)^Ae(13,e)^Ae(22,e)}function Pe(e){return Ae(6,e)^Ae(11,e)^Ae(25,e)}function je(e){return Ae(7,e)^Ae(18,e)^e>>>3}function Le(e){return Ae(17,e)^Ae(19,e)^e>>>10}function Ue(e,t,r){return e&t^~e&r}function ze(e,t,r){return e&t^e&r^t&r}var He=r(92904);const Be={data:{account:{brand:null,username:null,firstName:null,lastName:null,email:null,emailVerified:null,tmsGuid:null,registrationClient:null,roles:[],issuers:[],telep
1honeNumber:null,hasPassword:null,socialIDs:[],createdDateTime:null,loginInfo:{lastLoginTime:null,loginSource:null},signInType:null},customer:{username:null,firstName:null,middleInitial:null,lastName:null,nameSuffix:null,roles:[],customerCentralId:null,guid:null,customerType:null,organizationName:null,handRaiserList:[],enthusiast:null,primaryPhone:{},alternatePhone:null,customerGuidList:[],communicationPermissions:[],postalAddresses:[],primaryEmail:null,multipleAccountsExist:null,multipleEmailsExist:null},customerList:[]},loading:Oe,currentRequestId:null,error:null},Ke=e=>{const t=window.sessionStorage.getItem(F),r=t?JSON.parse(t).persistentInfo:null,a=r?.customerInfo?.username||null,n=r?.customerInfo?.email||null,s=r?.customerInfo?.firstName||null,i=r?.customerInfo?.lastName||null,o=r?.customerInfo?.tmsGuid||null,c=r?.customerInfo?.telephoneNumber||null,l=e?.completedUser||e?.userInfo?.account,d=l?.username,u=l?.email,h=l?.firstName,g=l?.lastName,p=l?.tmsGuid,m=l?.telephoneNumber,f=d||u||a,v=u||n,y=h||s,I=g||i,w=p||o,C=m||c,S=e?.userInfo?.account||{},R=e?.userInfo?.customer||[];return Object.assign({},e,{completeUser:{customer:R,account:{...S,username:f,email:v,firstName:y,lastName:I,tmsGuid:w,telephoneNumber:C}}})},Ye=e=>{let t,a;e.customer.length>0?(t=Me(e.customer[0].customerCentralId),a=e.customer[0].customerType?e.customer[0].customerType:"no_account_type"):(t="null",a="no_account_type"),r.g._dL.page.user_customer_central_id=t,r.g._dL.page.user_has_email_id=e.account.email?"has_email_id":"no_email_id",r.g._dL.page.user_id=e.account.tmsGuid||"null",r.g._dL.page.user_has_account_type=a,r.g._dL.page.user_email_id=e.account.email?Me(e.account.email.toLowerCase().trim()):"null"},Fe=e=>{const t=JSON.parse(window.sessionStorage.getItem(F))||{},r=tcom_v2.login.getToken();t.persistentInfo||(t.persistentInfo={}),t.persistentInfo.customerInfo={firstName:e.completeUser.account?.firstName||null,lastName:e.completeUser.account?.lastName||null,username:e.completeUser.account?.username||null,tmsGuid:e.completeUser.account?.tmsGuid||null,userId:r||null};const a=e.completeUser?.customer[0]?.postalAddresses[0],n=e.completeUser?.customer[0];t.persistentInfo.userInfo={address1:a?a.addressLine1:null,city:a?a.city:null,customer:{alternatePhone:n?n.alternatePhone:{areaCode:null,phoneNo:null,phoneRole:null,phoneType:null},customerId:n?n.customerCentralId:null,customerType:n?n.customerType:null,email:n?n.primaryEmail:null,enthusiast:n?n.enthusiast:null,firstName:n?n.firstName:null,guid:n?n.guid:null,handRaiserList:n?n.handRaiserList:[],lastName:n?n.lastName:null,middleInitial:n?n.middleInitial:null,nameSuffix:n?n.nameSuffix:null,organizationName:n?n.organizationName:null,primaryPhone:n?n.primaryPhone:{areaCode:null,phoneNo:null,phoneRole:null,phoneType:null},roles:n?n.roles:[],tmsguid:e.completeUser.account?.tmsGuid||null,userName:n?n.username:null},state:a?a.state:null,zip:a?a.postalCode:null,registrationClient:e.completeUser?.account?.registrationClient||null,logInCount:(e?.userAuditDataComposite||[])[0]?.logInCount||null},window.sessionStorage.setItem(F,JSON.stringify(t))},Ge=(0,s.zD)("customerDcsInfo/fetchCustomerDcsInfo",async(e,t)=>{try{let r;const a=tcom_v2.login?.getUserInfo()?.userId||"1";return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(qe(a)):r=await t.extra.owners.cache.cacheGet(qe(a),{maxAge:$}),r?(r=Ke(r),Ye(r.completeUser),Fe(r),r.completeUser):(r=await t.extra.owners.api.getCustomerDcsInfo(),r=Ke(r),r?(await t.extra.owners.cache.cacheSet(qe(a),r),Ye(r.completeUser),Fe(r),r.completeUser):t.rejectWithValue({error:"No customerDcsInfo"}))}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.customerDcsInfo.loading;return!t().owners.customerDcsInfo.currentRequestId&&(r!==xe&&void 0)}}),We=(0,s.zD)("customerDcsInfo/fetchCustomerDcsInfoV3",async(e,t)=>{try{let r;const a=tcom_v2.login?.getUserInfo()?.userId||"1";if(!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(qe(a)):r=await t.extra.owners.cache.cacheGet(qe(a),{maxAge:$}),r)return r=Ke(r),Ye(r.completeUser),Fe(r),r.completeUser;{const e=await(0,He.A)();return r=await t.extra.owners.api.getCustomerDcsInfoV3(e),r=Ke(r),r?(await t.extra.owners.cache.cac
1heSet(qe(a),r),Ye(r.completeUser),Fe(r),r.completeUser):t.rejectWithValue({error:"No customerDcsInfo"})}}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.customerDcsInfo.loading;return!t().owners.customerDcsInfo.currentRequestId&&(r!==xe&&void 0)}}),$e=(0,s.Z0)({name:"customerDcsInfo",initialState:Be,reducers:{},extraReducers:e=>{e.addCase(Ge.pending,(e,t)=>{e.loading!==Oe&&"loaded"!==e.loading||(e.loading=xe,e.currentRequestId=t.meta.requestId)}).addCase(Ge.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.data.account=t.payload.account||Be.data.account,e.data.customerList=t.payload.customer||Be.data.customerList,t.payload.customer&&Array.isArray(t.payload.customer)&&t.payload.customer.length>0?e.data.customer=t.payload.customer[0]:e.data.customer=Be.data.customer,e.currentRequestId=null)}).addCase(Ge.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.error=t.payload,e.currentRequestId=null)}).addCase(We.pending,(e,t)=>{e.loading!==Oe&&"loaded"!==e.loading||(e.loading=xe,e.currentRequestId=t.meta.requestId)}).addCase(We.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.data.account=t.payload.account||Be.data.account,e.data.customerList=t.payload.customer||Be.data.customerList,t.payload.customer&&Array.isArray(t.payload.customer)&&t.payload.customer.length>0?e.data.customer=t.payload.customer[0]:e.data.customer=Be.data.customer,e.currentRequestId=null)}).addCase(We.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.error=t.payload,e.currentRequestId=null)})}}),{actions:Je,reducer:Ze}=$e,{}=Je;var Xe=Ze;const Qe=(0,s.zD)("customerSubscriptions/fetchCustomerSubscriptions",async(e,t)=>{try{let r;const a=window?.tcom_v2?.login?.getUserInfo()?.userId;return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(pe(a)):r=await t.extra.owners.cache.cacheGet(pe(a),{maxAge:$}),r||(console.log("OWNERS: REDUX: fetchCustomerSubscriptions API Call",r),r=await t.extra.owners.api.getCustomerSubscriptions(),await t.extra.owners.cache.cacheSet(pe(a),r),r)}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.customerSubscriptions.loading,a=!!e?.refresh&&e.refresh;return!t().owners.customerSubscriptions.currentRequestId&&(r!==xe&&(("loaded"!==r||!0===a)&&void 0))}}),et=(0,s.Z0)({name:"customerSubscriptions",initialState:{data:{},loading:Oe,currentRequestId:null,error:null},reducers:{},extraReducers:e=>{e.addCase(Qe.pending,(e,t)=>{e.loading===xe&&e.currentRequestId!==t.meta.requestId||(e.loading=xe,e.currentRequestId=t.meta.requestId)}),e.addCase(Qe.fulfilled,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="loaded",e.data=t.payload,e.currentRequestId=null)}),e.addCase(Qe.rejected,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="error",e.error=t.error,e.currentRequestId=null)})}}),{actions:tt,reducer:rt}=et,{}=tt;var at=rt;const nt={data:{},loading:Oe,currentRequestId:null,error:null},st=(0,s.zD)("customerUpdatePassword/fetchCustomerUpdatePassword",async(e,t)=>{try{const{password:r,newPassword:a,otpCode:n}=e;let s;const i=await(0,He.A)();return s=await t.extra.owners.api.putCustomerUpdatePassword(r,a,n,i),s}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.customerUpdatePassword.loading;!!e?.refresh&&e.refresh;return!t().owners.customerUpdatePassword.currentRequestId&&(r!==xe&&void 0)}}),it=(0,s.Z0)({name:"customerUpdatePassword",initialState:nt,reducers:{},extraReducers:e=>{e.addCase(st.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(st.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(st.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:ot,reducer:ct}=it,{}=ot;var lt=ct;const dt={data:{},loading:Oe,currentRequestId:null,error:null},ut=(0,s.zD)("customerUpdatePersonalInfo/fetchCustomerUpdatePersonalInfo",async(e,t)=>{try{let r;return r=await t.extra.owners.api.postCustomerUpdatePersonalInfo(e?.userData),r}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.customerUpdatePersonalInfo.loading;return!t().owners.customerUpdatePersonalInfo.currentRequestId&&(r!==xe&&void 0)}}),ht=(0,s.zD)("customerUpdatePersonalInfo/fetchCustomerUpdatePersonalInfoV4",async(e,t)=>{try{let r;const a=await(0,He.A)();return r=await t.extra.owners.api.putCustomerUpdatePersonalInfoV4(e?.requestBody,a),r}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.customerUpdatePersonalInfo.loading;return!t().owners.customerUpdatePersonalInfo.currentRequestId&&(r!==xe&&void 0)}}),gt=(0,s.Z0)({name:"customerUpdatePersonalInfo",initialState:dt,reducers:{},extraReducers:e=>{e.addCase(ut.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(ut.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(ut.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}).addCase(ht.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(ht.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(ht.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:pt,reducer:mt}=gt,{}=pt;var ft=mt;const vt=(0,s.zD)("engineTransmissionDrive/fetchEngineTransmissionDrive",async(e,t)=>{try{let r;const a=!e?.refresh||e.refresh,n=se(`${e.model}_${e.year}_${e.lastKnownMileage}_${e.engine}_${e.transmission}_${e.driveType}`);
1if(a?await t.extra.owners.cache.cacheDeleteItem(n):r=await t.extra.owners.cache.cacheGet(n,{maxAge:J}),r)return r;{const a=await(0,He.A)();return r=await t.extra.owners.api.getEngineTransmissionDrive(e.model,e.year,e.lastKnownMileage,e.engine,e.transmission,e.driveType,a),await t.extra.owners.cache.cacheSet(n,r),r}}catch(e){return console.log("OWNERS: thunkApi engineTransmissionDrive error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.engineTransmissionDrive.loading;!!e?.refresh&&e.refresh;return!t().owners.engineTransmissionDrive.currentRequestId&&(r!==xe&&void 0)}}),yt={data:{},loading:Oe,currentRequestId:null,error:null},It=(0,s.Z0)({name:"engineTransmissionDrive",initialState:yt,reducers:{},extraReducers:e=>{e.addCase(vt.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(vt.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.data=t.payload,e.loading="loaded",e.currentRequestId=null)}),e.addCase(vt.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:wt,reducer:Ct}=It,{}=wt;var St=Ct;const Rt={data:{},loading:Oe,currentRequestId:null,error:null},qt=(0,s.zD)("generateOtp/fetchGenerateOtp",async(e,t)=>{try{let r;const a=await(0,He.A)();return r=await t.extra.owners.api.postGenerateOtp(e?.requestBody,a),console.log("fetchGenerateOtp :: generateOtp",r),r}catch(e){console.log(e)}},{condition:(e,{getState:t})=>{console.log(t()),console.log(t().owners);const r=t().owners.generateOtp.loading;!!e?.refresh&&e.refresh;return!t().owners.generateOtp.currentRequestId&&(r!==xe&&void 0)}}),Dt=(0,s.Z0)({name:"generateOtp",initialState:Rt,reducers:{},extraReducers:e=>{e.addCase(qt.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(qt.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(qt.rejected,(e,t)=>{const{requestId:r}=t.meta;console.log(t.error.stack),console.log(e.loading),e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:Tt,reducer:bt}=Dt,{}=Tt;var Vt=bt;const Nt={data:{},loading:Oe,currentRequestId:null,error:null},Ot=(0,s.zD)("maintenanceScheduleEmail/fetchMaintenanceScheduleEmail",async(e,t)=>{try{const{requestBody:r}=e;let a;return a=await t.extra.owners.api.postMaintenanceScheduleEmail(r),a}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.maintenanceScheduleEmail.loading;!!e?.refresh&&e.refresh;return!t().owners.maintenanceScheduleEmail.currentRequestId&&(r!==xe&&void 0)}}),xt=(0,s.Z0)({name:"maintenanceScheduleEmail",initialState:Nt,reducers:{},extraReducers:e=>{e.addCase(Ot.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(Ot.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(Ot.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:_t,reducer:Et}=xt,{}=_t;var Mt=Et;const At=(0,s.zD)("marketingOffers/fetchMarketingOffers",async(e,t)=>{try{let r,{zip:a,series:n,year:s}=e;return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(we(a)):r=await t.extra.owners.cache.cacheGet(we(a),{maxAge:$}),r||(r=await t.extra.owners.api.getMarketingOffers(a,n,s),await t.extra.owners.cache.cacheSet(we(a),r[0]),r[0])}catch(e){return console.log("OWNERS: thunkApi marketingOffers error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.marketingOffers.loading,a=!!e?.refresh&&e.refresh;return!t().owners.marketingOffers.currentRequestId&&(r!==xe&&(("loaded"!==r||!0===a)&&void 0))}}),kt={byId:{},entities:[],loading:Oe,currentRequestId:null,error:null},Pt=(0,s.Z0)({name:"marketingOffers",initialState:kt,reducers:{},extraReducers:e=>{e.addCase(At.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe;e.currentRequestId=t.meta.requestId}),e.addCase(At.fulfilled,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="loaded",e.currentRequestId=null,e.entities=t.payload)}),e.addCase(At.rejected,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:jt,reducer:Lt}=Pt,{}=jt;var Ut=Lt;
1const zt=(0,s.zD)("ownersOffers/fetchOwnersOffers",async(e,t)=>{try{let r,a;e.zip&&(a=ve(e.zip)),e.dealerCode&&(a=ye(e.dealerCode)),e.city&&e.state&&(a=Ie(e.city,e.state));return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(a):r=await t.extra.owners.cache.cacheGet(a,{maxAge:$}),r||(r=await t.extra.owners.api.getOwnersOffers(e),await t.extra.owners.cache.cacheSet(a,r),r)}catch(e){return console.log("OWNERS: thunkApi ownersOffers error",e),e}},{condition:(e,{getState:t})=>{if(t().owners.ownersOffers.currentRequestId)return!1;const r=t().owners.ownersOffers.loading,a=!e?.refresh||e.refresh;return("loaded"!==r||!0===a)&&void 0}}),Ht={byId:{},entities:[],loading:Oe,currentRequestId:null,error:null},Bt=(0,s.Z0)({name:"ownersOffers",initialState:Ht,reducers:{},extraReducers:e=>{e.addCase(zt.pending,(e,t)=>{e.loading===xe&&e.currentRequestId!==t.meta.requestId||(e.loading=xe,e.currentRequestId=t.meta.requestId,e.error=null)}).addCase(zt.fulfilled,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="loaded",e.currentRequestId=null,e.entities=t.payload,e.error=null)}).addCase(zt.rejected,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:Kt,reducer:Yt}=Bt,{}=Kt;var Ft=Yt;let Gt,Wt;const $t=(0,s.zD)("preferredVehicle/fetchPreferredVehicle",async(e,t)=>{try{let r;const a=e?.dataPackage,n=a.vin?{preferredVehicle:"Y"}:{preferredVehicle:"Y",vehicleId:a.vehicleId,model:a.model,year:a.year};return Wt=a.vin||a.vehicleId,r=await t.extra.owners.api.getPreferredVehicle(Wt,n),r}catch(e){return console.log("OWNERS: thunkApi preferredVehicle error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.preferredVehicle.loading,a=!!e?.refresh&&e.refresh,n=e?.dataPackage,s=n.vin||n.vehicleId;return!!s&&((s!==Gt||!0===a)&&(Gt=s,!t().owners.preferredVehicle.currentRequestId&&(r!==xe&&void 0)))}}),Jt={data:{preferredDealer:{},sellingDealer:{}},loading:Oe,currentRequestId:null,error:null},Zt=(0,s.Z0)({name:"preferredVehicle",initialState:Jt,reducers:{},extraReducers:e=>{e.addCase($t.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase($t.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.data=t.payload,e.loading="loaded",e.currentRequestId=null)}),e.addCase($t.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:Xt,reducer:Qt}=Zt,{}=Xt;var er=Qt;const tr=(0,s.zD)("safetyCampaigns/fetchSafetyCampaigns",async(e,t)=>{try{let r;const a=!!e?.refresh&&e.refresh,n=oe(e.vin);if(a?await t.extra.owners.cache.cacheDeleteItem(n):r=await t.extra.owners.cache.cacheGet(n,{maxAge:W}),r)return r;{const a=await(0,He.A)();return r=await t.extra.owners.api.getSafetyCampaigns(e.vin,a),await t.extra.owners.cache.cacheSet(n,r),r}}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.safetyCampaigns.loading;!!e?.refresh&&e.refresh;return!!e.vin&&(!t().owners.safetyCampaigns.currentRequestId&&(r!==xe&&void 0))}}),rr={entities:{},loading:Oe,currentRequestId:null,error:null},ar=(0,s.Z0)({name:"safetyCampaigns",initialState:rr,reducers:{},extraReducers:e=>{e.addCase(tr.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId,e.error=null}),e.addCase(tr.fulfilled,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="loaded",e.currentRequestId=null,e.entities=t.payload.body)}),e.addCase(tr.rejected,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:nr,reducer:sr}=ar;var ir=sr;const or=(0,s.zD)("serviceOpCodes/fetchServiceOpCodes",async(e,t)=>{try{let r;const a=!!e?.refresh&&e.refresh,n=le;
1return a?await t.extra.owners.cache.cacheDeleteItem(n):r=await t.extra.owners.cache.cacheGet(n,{maxAge:$}),r||(r=await t.extra.owners.api.getServiceOpCodes(),await t.extra.owners.cache.cacheSet(n,r),r)}catch(e){return console.log("OWNERS: REDUX: thunkApi serviceOpCodes error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.serviceOpCodes.loading,a=!!e?.refresh&&e.refresh;return!t().owners.serviceOpCodes.currentRequestId&&(r!==xe&&(("loaded"!==r||!0===a)&&void 0))}}),cr=(0,s.Z0)({name:"serviceOpCodes",initialState:{opCodes:[],loading:Oe,currentRequestId:null,error:null},reducers:{},extraReducers:e=>{e.addCase(or.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(or.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,e.opCodes=t.payload.opCodes,e.error=null)}),e.addCase(or.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:lr,reducer:dr}=cr;var ur=dr;let hr;const gr=(0,s.zD)("toyotaCare/fetchToyotaCare",async(e,t)=>{try{let r;const a=!!e?.refresh&&e.refresh,n=Ce(e.vin);if(a?await t.extra.owners.cache.cacheDeleteItem(n):r=await t.extra.owners.cache.cacheGet(n,{maxAge:J}),r)return r;{const a=await(0,He.A)();return r=await t.extra.owners.api.getToyotaCare(e.vin,a),await t.extra.owners.cache.cacheSet(n,r),r}}catch(e){return console.log("OWNERS: REDUX: thunkApi toyotaCare error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.toyotaCare.loading,a=!!e?.refresh&&e.refresh;return!!e.vin&&((e.vin!==hr||!0===a)&&(hr=e.vin,!t().owners.toyotaCare.currentRequestId&&(r!==xe&&void 0)))}}),pr={byVin:{},entities:[],loading:Oe,currentRequestId:null,error:null},mr=(0,s.Z0)({name:"toyotaCare",initialState:pr,reducers:{},extraReducers:e=>{e.addCase(gr.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(gr.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.byVin[t.payload.toyotaCareServiceInformation.vin]=t.payload,e.entities.push(t.payload)))}).addCase(gr.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}).addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:fr,reducer:vr}=mr;var yr=vr;let Ir;const wr=(0,s.zD)("vehicleDealer/fetchVehicleDealer",async(e,t)=>{try{let r;return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(de(e.vin)):r=await t.extra.owners.cache.cacheGet(de(e.vin),{maxAge:J}),r||(r=await t.extra.owners.api.getVehicleDealer(e.vin),await t.extra.owners.cache.cacheSet(de(e.vin),r),r)}catch(e){return console.log("OWNERS: thunkApi vehicleDealer error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleDealer.loading,a=!!e?.refresh&&e.refresh;return!!e.vin&&((e.vin!==Ir||!0===a)&&(Ir=e.vin,!t().owners.vehicleDealer.currentRequestId&&(r!==xe&&void 0)))}}),Cr={data:{preferredDealer:{},sellingDealer:{}},loading:Oe,currentRequestId:null,error:null},Sr=(0,s.Z0)({name:"vehicleDealer",initialState:Cr,reducers:{},extraReducers:e=>{e.addCase(wr.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(wr.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.data=t.payload,e.loading="loaded",e.currentRequestId=null)}),e.addCase(wr.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:Rr,reducer:qr}=Sr,{}=Rr;var Dr=qr;const Tr=(0,s.zD)("vehicleDrivers/fetchVehicleDrivers",async(e,t)=>
1{try{!!e?.refresh&&await t.extra.owners.cache.cacheDeleteItem(ue(e.vin));const r=await t.extra.owners.cache.cacheGet(ue(e.vin),{maxAge:J});if(r?.length)return r;const a=await t.extra.owners.api.getVehicleDrivers(e.vin);return a?.drivers?.length&&await t.extra.owners.cache.cacheSet(ue(e.vin),a.drivers),a?.drivers}catch(e){return console.log("OWNERS: thunkApi vehicleDrivers error",e),e}},{condition:(e,{getState:t})=>{const r=e?.vin,a=t().owners.vehicleDrivers.currentRequestId[r],n=t().owners.vehicleDrivers.loading[r]===xe;return!!r&&(!(a&&!!!e?.refresh)&&(!n&&void 0))}}),br={data:{},loading:{},currentRequestId:{},error:{}},Vr=(0,s.Z0)({name:"vehicleDrivers",initialState:br,reducers:{},extraReducers:e=>{e.addCase(Tr.pending,(e,t)=>{const r=t.meta.arg.vin,a=t.meta.requestId,n=e.currentRequestId[r];if((e.loading[r]?e.loading[r]:Oe)===xe){if(n===a)return}else e.loading[r]=xe,e.currentRequestId[r]=a}),e.addCase(Tr.fulfilled,(e,t)=>{const r=t.meta.arg.vin,a=t.meta.arg.refresh,n=t.meta.requestId,s=e.loading[r],i=e.currentRequestId[r]===n,o=s===xe,c=t.payload,l=c?.length>0;o&&i&&(e.loading[r]="loaded",e.currentRequestId[r]=null),l?e.data[r]=c:a&&e.data[r]&&(e.loading[r]=Oe,delete e.data[r])}),e.addCase(Tr.rejected,(e,t)=>{const r=e.loading[vin],a=e.currentRequestId[vin]===requestId;r===xe&&a&&(e.loading[vin]="error",e.currentRequestId[vin]=null,e.error[vin]=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:Nr,reducer:Or}=Vr,{}=Nr;var xr=Or;let _r;const Er=(0,s.zD)("vehicleHealthHistory/fetchVehicleHealthHistory",async(e,t)=>{try{let r;return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(re(e.vin)):r=await t.extra.owners.cache.cacheGet(re(e.vin),{maxAge:J}),r||(r=await t.extra.owners.api.getVehicleHealthHistory(e.vin),await t.extra.owners.cache.cacheSet(re(e.vin),r),r)}catch(e){return e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleHealthHistory.loading,a=!!e?.refresh&&e.refresh;return!!e.vin&&((e.vin!==_r||!0===a)&&(_r=e.vin,!t().owners.vehicleHealthHistory.currentRequestId&&(r!==xe&&void 0)))}}),Mr={data:{},loading:Oe,currentRequestId:null,error:null},Ar=(0,s.Z0)({name:"vehicleHealthHistory",initialState:Mr,reducers:{},extraReducers:e=>{e.addCase(Er.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(Er.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.data=t.payload,e.currentRequestId=null)}),e.addCase(Er.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.error=t.error,e.currentRequestId=null)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:kr,reducer:Pr}=Ar,{}=kr;var jr=Pr;let Lr;const Ur=(0,s.zD)("vehicleHealthReport/fetchVehicleHealthReport",async(e,t)=>{try{let r;return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(te(e.vin)):r=await t.extra.owners.cache.cacheGet(te(e.vin),{maxAge:G}),r||(r=await t.extra.owners.api.getVehicleHealthReport(e.vin),r?.data?(await t.extra.owners.cache.cacheSet(te(e.vin),r),r):r?.error?t.rejectWithValue(r.error?.message):t.rejectWithValue("No data"))}catch(e){return console.log("OWNERS: REDUX: thunkApi vehicleHealthReport error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleHealthReport.loading,a=!!e?.refresh&&e.refresh;return!!e.vin&&((e.vin!==Lr||!0===a)&&(Lr=e.vin,!t().owners.vehicleHealthReport.currentRequestId&&(r!==xe&&void 0)))}}),zr={data:{},loading:Oe,currentRequestId:null,error:null},Hr=(0,s.Z0)({name:"vehicleHealthReport",initialState:zr,reducers:{},extraReducers:e=>{e.addCase(Ur.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe;e.currentRequestId=t.meta.requestId,e.error=null,e.data={}}),e.addCase(Ur.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.error=null,e.data=t.payload.data||{},e.currentRequestId=null)}),e.addCase(Ur.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.error=t.error,e.currentRequestId=null,e.data={})}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:Br,reducer:Kr}=Hr,{}=Br;var Yr=Kr;let Fr;
1const Gr=(0,s.zD)("vehicleMaintenanceSchedule/fetchVehicleMaintenanceSchedule",async(e,t)=>{try{let r;if(!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(ae(e.vin,e.lastKnownMileage)):r=await t.extra.owners.cache.cacheGet(ae(e.vin,e.lastKnownMileage),{maxAge:J}),r)return r;{const a=await(0,He.A)();return r=await t.extra.owners.api.getVehicleMaintenanceSchedule(e.vin,e.lastKnownMileage,a),await t.extra.owners.cache.cacheSet(ae(e.vin,e.lastKnownMileage),r),r}}catch(e){return console.log("OWNERS: thunkApi vehicleMaintenanceSchedule error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleMaintenanceSchedule.loading,a=!!e?.refresh&&e.refresh,n=`${e.vin}_${e.lastKnownMileage}`;return!!e.vin&&((n!==Fr||!0===a)&&(Fr=`${e.vin}_${e.lastKnownMileage}`,!t().owners.vehicleMaintenanceSchedule.currentRequestId&&(r!==xe&&void 0)))}}),Wr={data:{scheduleMaintenance:{}},loading:Oe,currentRequestId:null,error:null},$r=(0,s.Z0)({name:"vehicleMaintenanceSchedule",initialState:Wr,reducers:{},extraReducers:e=>{e.addCase(Gr.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(Gr.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.data=t.payload,e.loading="loaded",e.currentRequestId=null)}),e.addCase(Gr.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:Jr,reducer:Zr}=$r,{}=Jr;var Xr=Zr;const Qr=(0,s.zD)("vehicleMaintenanceScheduled/fetchVehicleMaintenanceScheduled",async(e,t)=>{try{let r;if(!e?.refresh||e.refresh?await t.extra.owners.cache.cacheDeleteItem(ne(`${e.model}_${e.year}`)):r=await t.extra.owners.cache.cacheGet(ne(`${e.model}_${e.year}`),{maxAge:J}),r)return r;{const a=await(0,He.A)();return r=await t.extra.owners.api.getVehicleMaintenanceScheduled(e.model,e.year,a),await t.extra.owners.cache.cacheSet(ne(`${e.model}_${e.year}`),r),r}}catch(e){return console.log("OWNERS: thunkApi vehicleMaintenanceScheduled error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleMaintenanceScheduled.loading;!!e?.refresh&&e.refresh;return!t().owners.vehicleMaintenanceScheduled.currentRequestId&&(r!==xe&&void 0)}}),ea={data:{scheduleMaintenance:{}},loading:Oe,currentRequestId:null,error:null},ta=(0,s.Z0)({name:"vehicleMaintenanceScheduled",initialState:ea,reducers:{},extraReducers:e=>{e.addCase(Qr.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(Qr.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.data=t.payload,e.loading="loaded",e.currentRequestId=null)}),e.addCase(Qr.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:ra,reducer:aa}=ta,{}=ra;var na=aa;const sa=(0,s.zD)("vehicleMileageHistory/fetchVehicleMileageHistory",async(e,t)=>{try{let r;return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(ie(e.vin)):r=await t.extra.owners.cache.cacheGet(ie(e.vin),{maxAge:J}),r||(r=await t.extra.owners.api.getVehicleMileageHistory(e.vin),await t.extra.owners.cache.cacheSet(ie(e.vin),r),r)}catch(e){return console.log("OWNERS: thunkApi vehicleMileageHistory error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleMileageHistory.loading,a=!!e?.refresh&&e.refresh;return!!e.vin&&(!t().owners.vehicleMileageHistory.currentRequestId&&(r!==xe&&(("loaded"!==r||!0===a)&&void 0)))}}),ia={data:{},loading:Oe,currentRequestId:null,error:null},oa=(0,s.Z0)({name:"vehicleMileageHistory",initialState:ia,reducers:{},extraReducers:e=>{e.addCase(sa.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(sa.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.data=t.payload,e.loading="loaded",e.currentRequestId=null)}),e.addCase(sa.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:ca,reducer:la}=oa,{}=ca;var da=la;const ua=(0,s.zD)("vehicleSelfByVin/fetchVehicleSelfByVin",async(e,t)=>{try{let r,a,n;
1if(!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(ge(e.vin)):(n=await t.extra.owners.cache.cacheGet(ge(e.vin),{maxAge:J}),r=n?.serviceHistoryRecords,a=n?.repairOrders),n&&(r?.length||a?.length))return{serviceHistoryRecords:r,repairOrders:a};{const n=await t.extra.owners.api.getVehicleSelfByVin(e.vin,"third"),s=await t.extra.owners.api.getVehicleSelfByVin(e.vin,"nsh");return r=n?.serviceHistoryRecords,a=s?.repairOrders,console.log("OWNERS: thunkApi vehicleSelfByVin",{serviceHistoryRecords:r,repairOrders:a}),await t.extra.owners.cache.cacheSet(ge(e.vin),{serviceHistoryRecords:r,repairOrders:a}),{serviceHistoryRecords:r,repairOrders:a}}}catch(e){return console.log("OWNERS: thunkApi vehicleSelfByVin error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleSelfByVin.loading,a=!!e?.refresh&&e.refresh;return!!e.vin&&(!t().owners.vehicleSelfByVin.currentRequestId&&(("loaded"!==r||!0===a)&&void 0))}}),ha={serviceHistoryRecords:[],repairOrders:[],loading:Oe,currentRequestId:null,error:null},ga=(0,s.Z0)({name:"vehicleSelfByVin",initialState:ha,reducers:{},extraReducers:e=>{e.addCase(ua.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe;e.currentRequestId=t.meta.requestId}).addCase(ua.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.currentRequestId=null,e.serviceHistoryRecords=t?.payload?.serviceHistoryRecords?t.payload.serviceHistoryRecords:[],e.repairOrders=t?.payload?.repairOrders?t.payload.repairOrders:[],e.loading="loaded")}).addCase(ua.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.error=t.error,e.currentRequestId=null)}).addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:pa,reducer:ma}=ga,{}=pa;var fa=ma;const va=(0,s.zD)("vehicleSpecification/fetchVehicleSpecification",async(e,t)=>{try{let r;const a=!!e?.refresh&&e.refresh,n=e?.vin,s=e?.token,i=await tcom_v2.getOwnersSession();return a?await t.extra.owners.cache.cacheDeleteItem(Te(n)):r=await t.extra.owners.cache.cacheGet(Te(n),{maxAge:J}),r?(i.ownersData.vehicleSpecification={data:r,loadingStatus:"loaded"},r?.error?i.dispatchEvent(new CustomEvent(z,{detail:{data:r?.error}})):i.dispatchEvent(new CustomEvent(U,{detail:{data:r?.data}})),r):(r=await t.extra.owners.api.getVehicleSpecification(n,s),await t.extra.owners.cache.cacheSet(Te(n),r),i.ownersData.vehicleSpecification={data:r,loadingStatus:"loaded"},r?.error?i.dispatchEvent(new CustomEvent(z,{detail:{data:r?.error}})):i.dispatchEvent(new CustomEvent(U,{detail:{data:r?.data}})),r)}catch(e){return console.log("OWNERS: thunkApi vehicleSpecification error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleSpecification.loading,a=(!!e?.refresh&&e.refresh,e?.vin);return!!a&&(!t().owners.vehicleSpecification.currentRequestId&&(r!==xe&&void 0))}}),ya={data:{},loading:Oe,currentRequestId:null,error:null},Ia=(0,s.Z0)({name:"vehicleSpecification",initialState:ya,reducers:{},extraReducers:e=>{e.addCase(va.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(va.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.data=t.payload,e.loading="loaded",e.currentRequestId=null)}),e.addCase(va.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:wa,reducer:Ca}=Ia,{}=wa;var Sa=Ca,Ra=r(34352);const qa=(0,s.zD)("vehicleDetailedSpecification/fetchVehicleDetailedSpecification",async(e,t)=>{let r;const a=e?.refresh||!1,n=e?.vin;let s=e?.captchaToken;const i=await tcom_v2.getOwnersSession();s||(s=await(0,Ra.default)());const o=e=>{const t=e?.body?.error||e?.error,r=t?K:B,a=t||e?.data;i.dispatchEvent(new CustomEvent(r,{detail:{data:a}}))};return a?await t.extra.owners.cache.cacheDeleteItem(Te(n)):r=await t.extra.owners.cache.cacheGet(Te(n),{maxAge:J}),r?(o(r),r):(r=await t.extra.owners.api.getVehicleDetailedSpecification(n,s),await t.extra.owners.cache.cac
1heSet(Te(n),r),o(r),r)},{condition:(e,{getState:t})=>{const r=e?.vin,a=t().owners.vehicleDetailedSpecification;return!!r&&(a.loading!==xe&&(!a.currentRequestId&&void 0))}}),Da={data:{},loading:Oe,currentRequestId:null,error:null},Ta=(0,s.Z0)({name:"vehicleDetailedSpecification",initialState:Da,reducers:{},extraReducers:e=>{e.addCase(qa.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(qa.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.data=t.payload,e.loading="loaded",e.currentRequestId=null)}),e.addCase(qa.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",()=>Da)}}),{reducer:ba}=Ta;var Va=ba;let Na;const Oa=(0,s.zD)("vehicleSubscriptions/fetchVehicleSubscriptions",async(e,t)=>{try{let r;return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(ce(e.vin)):r=await t.extra.owners.cache.cacheGet(ce(e.vin),{maxAge:J}),r||(r=await t.extra.owners.api.getVehicleSubscriptions(e.vin),await t.extra.owners.cache.cacheSet(ce(e.vin),r),r)}catch(e){return console.log("OWNERS: REDUX: thunkApi vehicleSubscriptions error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleSubscriptions.loading,a=!!e?.refresh&&e.refresh;return!!e.vin&&((e.vin!==Na||!0===a)&&(Na=e.vin,!t().owners.vehicleSubscriptions.currentRequestId&&(r!==xe&&void 0)))}}),xa={data:{},loading:Oe,currentRequestId:null,error:null},_a=(0,s.Z0)({name:"vehicleSubscriptions",initialState:xa,reducers:{},extraReducers:e=>{e.addCase(Oa.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}),e.addCase(Oa.fulfilled,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="loaded",e.data=t.payload,e.currentRequestId=null)}),e.addCase(Oa.rejected,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="error",e.error=t.error,e.currentRequestId=null)}),e.addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:Ea,reducer:Ma}=_a,{}=Ea;var Aa=Ma;const ka=(0,s.zD)("warningLights/fetchWarningLights",async(e,t)=>{try{let r,a=e.model||"common",n=e.year||"0000";const s=!!e?.refresh&&e.refresh,i=De(`${a}_${n}`);return s?await t.extra.owners.cache.cacheDeleteItem(i):r=await(t.extra.owners.cache?.cacheGet(i,{maxAge:$})),r||(r=await t.extra.owners.api.getWarningLights(a,n),await(t.extra.owners.cache?.cacheSet(i,r)),r)}catch(e){return console.log("OWNERS: REDUX: thunkApi warningLights error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.warningLights.loading;!!e?.refresh&&e.refresh;return!t().owners.warningLights.currentRequestId&&(r!==xe&&void 0)}}),Pa={data:{},modelCode:"",loading:Oe,currentRequestId:null,error:null},ja=(0,s.Z0)({name:"warningLights",initialState:Pa,reducers:{},extraReducers:e=>{e.addCase(ka.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(ka.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload,e.modelCode=t?.meta?.arg?.model))}).addCase(ka.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}).addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:La,reducer:Ua}=ja;var za=Ua;const Ha=(0,s.zD)("bz4xVerifyVin/fetchBz4xVerifyVin",async(e,t)=>{try{let r;const a=e.vin,n=!!e?.refresh&&e.refresh,s=be(a);return n?await t.extra.owners.cache.cacheDeleteItem(s):r=await(t.extra.owners.cache?.cacheGet(s,{maxAge:J})),r||(r=await t.extra.owners.api.getBz4xVerifyVin(a),await(t.extra.owners.cache?.cacheSet(s,r)),r)}catch(e){return console.log("OWNERS: REDUX: thunkApi bz4xVerifyVin error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.bz4xVerifyVin.loading;!!e?.refresh&&e.refresh;return!t().owners.bz4xVerifyVin.currentRequestId&&(r!==xe&&void 0)}}),Ba={data:{},loading:Oe,currentRequestId:null,error:null},Ka=(0,s.Z0)({name:"bz4xVerifyVin",initialState:Ba,reducers:{},extraReducers:e=>{e.addCase(Ha.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(Ha.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(Ha.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}).addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:Ya,reducer:Fa}=Ka;var Ga=Fa;const Wa=(0,s.zD)("vehicleRecalls/fetchVehicleRecalls",async(e,t)=>{try{let r;const a=e.licensePlate,n=e.state,s=e.vin,i=e?.token,o=!!e?.refresh&&e.refresh,c=Ve(a,n,s);
1return o?await t.extra.owners.cache.cacheDeleteItem(c):r=await(t.extra.owners.cache?.cacheGet(c,{maxAge:W})),r||(r=await t.extra.owners.api.getVehicleRecalls({licensePlate:a,state:n,vin:s,token:i}),await(t.extra.owners.cache?.cacheSet(c,r)),r)}catch(e){return console.log("OWNERS: REDUX: thunkApi vehicleRecalls error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.vehicleRecalls.loading;!!e?.refresh&&e.refresh;return!t().owners.vehicleRecalls.currentRequestId&&(r!==xe&&void 0)}}),$a={data:{},loading:Oe,currentRequestId:null,error:null},Ja=(0,s.Z0)({name:"vehicleRecalls",initialState:$a,reducers:{},extraReducers:e=>{e.addCase(Wa.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(Wa.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(Wa.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)}).addCase("ownersContextInfo/setCurrentVehicleById/pending",(e,t)=>{0})}}),{actions:Za,reducer:Xa}=Ja;var Qa=Xa;const en=(0,s.zD)("dealerDetails/fetchDealerDetails",async(e,t)=>{try{let r;const a=e.dealerCode,n=Ne(a);return!!e?.refresh&&e.refresh?await t.extra.owners.cache.cacheDeleteItem(n):r=await t.extra.owners.cache.cacheGet(n,{maxAge:$}),r||(r=await t.extra.owners.api.getDealerDetails(a),await t.extra.owners.cache.cacheSet(n,r),r)}catch(e){return console.log("OWNERS: thunkApi dealerDetails error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.dealerDetails.loading,a=!!e?.refresh&&e.refresh;return!t().owners.dealerDetails.currentRequestId&&(("loaded"!==r||!0===a)&&void 0)}}),tn={byId:{},entities:[],loading:Oe,currentRequestId:null,error:null},rn=(0,s.Z0)({name:"dealerDetails",initialState:tn,reducers:{},extraReducers:e=>{e.addCase(en.pending,(e,t)=>{e.loading===xe&&e.currentRequestId!==t.meta.requestId||(e.loading=xe,e.currentRequestId=t.meta.requestId,e.error=null)}).addCase(en.fulfilled,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="loaded",e.currentRequestId=null,e.entities=t.payload,e.error=null)}).addCase(en.rejected,(e,t)=>{e.loading===xe&&e.currentRequestId===t.meta.requestId&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:an,reducer:nn}=rn,{}=an;var sn=nn;const on=(e=[])=>{const t={};return e&&e.length>0&&e.forEach(e=>{e&&void 0!==e.vehicleId&&(t[e.vehicleId]=e)}),t},cn={byId:{},entities:[],loading:Oe,currentRequestId:null,error:null},ln=window.sessionStorage.getItem(F),dn=ln?JSON.parse(ln).persistentInfo:null;if(dn){!!(dn.vehicleList&&dn.vehicleList.length>0)&&(cn.entities=dn.vehicleList,cn.byId=on(dn.vehicleList))}const un=(0,s.zD)("availableVehicles/fetchAllVehicles",async(e,t)=>{try{let r,a=!1;const n=tcom_v2.login?.getUserInfo()?.userId||"1";t.getState().owners;if(!!e?.refresh&&e.refresh)await t.extra.owners.cache.cacheDeleteItem(ee(n));else{let e=[];dn&&dn.vehicleList&&(e=dn.vehicleList),e.length>0?(r=e,a=!0,await t.extra.owners.cache.cacheSet(ee(n),r)):r=await t.extra.owners.cache.cacheGet(ee(n),{maxAge:G})}if(r&&r.length>0&&a||(r=await t.extra.owners.api.getVehicles(),await t.extra.owners.cache.cacheSet(ee(n),r)),r){const e=await tcom_v2.getOwnersSession();e.ownersData.availableVehicles={data:r,loadingStatus:"loaded"},e.dispatchEvent(new CustomEvent(u,{detail:{vehicles:r}})),((e,t)=>{const r=e.store.getState()?.owners?.context?.data?.transientInfo,a=window.sessionStorage.getItem(F)?JSON.parse(window.sessionStorage.getItem(F)):{};if(!r?.selectedModel||!r?.selectedYear)if(a.persistentInfo?.profile?.prefVehicleId)e.setCurrentVehicleById(a.persistentInfo.profile.prefVehicleId,void 0,"from-owners-init");else{const r=t.find(e=>"Y"===e.preferredVehicle);if(r&&r.vehicleId)e.setCurrentVehicleById(r.vehicleId,void 0,"from-owners-init");else if(t&&t.length>0){const r=t[0].vehicleId,a=t[0].vin||null;e.setCurrentVehicleById(r,a,"from-owners-init")}else e.clearCurrentVehicle()}})(e,r);const t=[];
1r.forEach(e=>{e.nickName&&!e.hasOwnProperty("nickname")?e.nickname=e.nickName:e.hasOwnProperty("nickname")||(e.nickname=null),t.push(e)});let a=JSON.parse(window.sessionStorage.getItem(F))||{};return a.persistentInfo||(a.persistentInfo={}),a.persistentInfo.vehicle=on(t),a.persistentInfo.vehicleList=t,t.length<1&&(a.persistentInfo.prefVehicleId=""),window.sessionStorage.setItem(F,JSON.stringify(a)),r}return t.rejectWithValue({error:"No vehicles found"})}catch(e){return console.log("OWNERS: REDUX: fetchAllVehicles: thunkApi availableVehicles error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.availableVehicles.loading,a=!!e?.refresh&&e.refresh;return r!==xe&&(("loaded"!==r||!0===a)&&void 0)}}),hn=(0,s.Z0)({name:"availableVehicles",initialState:cn,reducers:{clearVehicles(e,t){initialState}},extraReducers:e=>{e.addCase(un.pending,(e,t)=>{e.loading!==xe&&(e.loading=xe,e.currentRequestId=t.meta.requestId)}).addCase(un.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.byId=on(t.payload),e.loading="loaded",e.entities=t.payload,e.currentRequestId=null,e.error=null)}).addCase(un.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.error=t.error,e.currentRequestId=null)})}}),{actions:gn,reducer:pn}=hn,{clearVehicles:mn}=gn;var fn=pn;const vn={loading:Oe,data:{currentVehicleId:null,currentVin:null,loggedIn:window.tcom_v2.login.isLoggedIn(),transientInfo:{selectedModel:null,selectedYear:null}},currentRequestId:null,error:null},yn={...vn};let In;const wn=window.sessionStorage.getItem(F);if(wn){In=JSON.parse(wn);const e=In?.transientInfo?.selectedModel,t=In?.transientInfo?.selectedYear;if(e&&t)yn.data.transientInfo.selectedModel=e,yn.data.transientInfo.selectedYear=t;else{const e=In.persistentInfo?.profile?.prefVehicleId||null;e&&(yn.data.currentVehicleId=e)}}const Cn=(0,s.zD)("ownersContextInfo/setInitialContextInfo",async(e,t)=>{try{let e;if(tcom_v2.login.isLoggedIn()){const r=tcom_v2.login?.getUserInfo()?.userId||"1";let a=await t.extra.owners.cache.cacheGet(Q(r),{maxAge:$});if(a){if(yn.data.currentVehicleId&&yn.data.currentVehicleId!==a.currentVehicleId){const e=t.getState().availableVehicles.entities;if(e.length>0){const t=e.find(e=>e.vehicleId===yn.data.currentVehicleId);t&&(a.currentVehicleId=yn.data.currentVehicleId,a.currentVin=t.vin||null)}}e=a}else e=yn.data;await t.extra.owners.cache.cacheSet(Q(r),e)}else e=yn.data;return e}catch(e){return{error:e}}}),Sn=(0,s.zD)("ownersContextInfo/setCurrentVehicleById",async(e,t)=>{try{const r=tcom_v2.login?.getUserInfo()?.userId||"1",a=await t.extra.owners.cache.cacheGet(Q(r),{maxAge:864e5});if(a){const n={...a,currentVehicleId:e.vehicleId,currentVin:e.vin};return await t.extra.owners.cache.cacheSet(Q(r),n),e.vehicleId?{vehicleId:e.vehicleId,vin:e.vin}:t.rejectWithValue("setCurrentVehicleById: No vehicleId in args")}return t.rejectWithValue("setCurrentVehicleById: No vehicleId in args")}catch(e){return{error:e}}}),Rn=(0,s.Z0)({name:"ownersContextInfo",initialState:yn,reducers:{clearContextInfo(e,t){0},setTransientInfo(e,t){e.data.transientInfo.selectedModel=t.payload.model,e.data.transientInfo.selectedYear=t.payload.year},clearVehicle(e,t){e.data.currentVin=null,e.data.currentVehicleId=null}},extraReducers:e=>{e.addCase(Cn.pending,(e,t)=>{e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(Cn.fulfilled,(e,t)=>{e.loading="loaded"}).addCase(Cn.rejected,(e,t)=>{e.loading="error",e.error=t.error}).addCase(Sn.pending,(e,t)=>{e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(Sn.fulfilled,(e,t)=>{e.loading="loaded",e.data.currentVehicleId=t.payload.vehicleId,e.data.currentVin=t.payload.vin}).addCase(Sn.rejected,(e,t)=>{e.loading="error",e.error=t.error})}}),{actions:qn,reducer:Dn}=Rn,{clearVehicle:Tn,clearContextInfo:bn,setTransientInfo:Vn}=qn;var Nn=Dn;const On=(0,s.zD)("checkEmailAvailability/fetchCheckEmailAvailability",async(e,t)=>{try{let r;const a=e.email;return r=await t.extra.owners.api.getCheckEmailAvailability({email:a}),r}catch(e){return console.log("OWNERS: REDUX: thunkApi checkEmailAvailability error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.checkEmailAvailability.loading;return!t().owners.checkEmailAvailability.currentRequestId&&(r!==xe&&void 0)}}),xn={data:{},loading:Oe,currentRequestId:null,error:null},_n=(0,s.Z0)({name:"checkEmailAvailability",initialState:xn,reducers:{},extraReducers:e=>{e.addCase(On.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(On.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(On.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:En,reducer:Mn}=_n;var An=Mn;const kn=(0,s.zD)("createAccount/fetchCreateAccount",async(e,t)=>{try{let r;return r=await t.extra.owners.api.postCreateAccount({customerType:e.customerType,email:e.email,password:e.password,...e.firstName&&{firstName:e.firstName},...e.lastName&&{lastName:e.lastName},...e.businessName&&{organizationName:e.businessName},areaCode:e.areaCode,phoneNumber:e.phoneNumber}),r}catch(e){return console.log("OWNERS: REDUX: thunkApi createAccount error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.createAccount.loading;return!t().owners.createAccount.currentRequestId&&(r!==xe&&void 0)}}),Pn={data:{},loading:Oe,currentRequestId:null,error:null},jn=(0,s.Z0)({name:"createAccount",initialState:Pn,reducers:{},extraReducers:e=>{e.addCase(kn.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(kn.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(kn.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:Ln,reducer:Un}=jn;var zn=Un;const Hn=(0,s.zD)("resetPassword/fetchResetPassword",async(e,t)=>{try{let r;return r=await t.extra.owners.api.putResetPassword({newPassword:e.password,resetCode:e.resetCode}),r}catch(e){return console.log("OWNERS: REDUX: thunkApi resetPassword error",e),e}},{condition:(e,{getState:t})=>{const r=t().owners.resetPassword.loading;return!t().owners.resetPassword.currentRequestId&&(r!==xe&&void 0)}}),Bn={data:{},loading:Oe,currentRequestId:null,error:null},Kn=(0,s.Z0)({name:"resetPassword",initialState:Bn,reducers:{},extraReducers:e=>{e.addCase(Hn.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(Hn.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(Hn.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:Yn,reducer:Fn}=Kn;var Gn=Fn;const Wn={data:{},loading:Oe,currentRequestId:null,error:null},$n=(0,s.zD)("validatePassword/fetchValidatePassword",async(e,t)=>{try{let r;const a=await(0,He.A)();return r=await t.extra.owners.api.patchValidatePassword(a,e?.requestBody),console.log("fetchValidatePassword :: validatePassword",r),r}catch(e){console.log(e)}},{condition:(e,{getState:t})=>{const r=t().owners.validatePassword.loading;return!t().owners.validatePassword.currentRequestId&&(r!==xe&&void 0)}}),Jn=(0,s.Z0)({name:"validatePassword",initialState:Wn,reducers:{},extraReducers:e=>{e.addCase($n.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase($n.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase($n.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:Zn,reducer:Xn}=Jn;var Qn=Xn;const es={data:{},loading:Oe,currentRequestId:null,error:null},ts=(0,s.zD)("validateOtp/fetchValidateOtp",async(e,t)=>{try{let r;const a=await(0,He.A)();return r=await t.extra.owners.api.patchValidateOtp(a,e?.requestBody),console.log("fetchValidateOtp :: validateOtp",r),r}catch(e){console.log(e)}},{condition:(e,{getState:t})=>{const r=t().owners.validateOtp.loading;return!t().owners.validateOtp.currentRequestId&&(r!==xe&&void 0)}}),rs=(0,s.Z0)({name:"validateOtp",initialState:es,reducers:{},extraReducers:e=>{e.addCase(ts.pending,(e,t)=>{if(e.loading===xe){if(e.currentRequestId!==t.meta.requestId)return}else e.loading=xe,e.currentRequestId=t.meta.requestId}).addCase(ts.fulfilled,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="loaded",e.currentRequestId=null,t.payload&&(e.data=t.payload))}).addCase(ts.rejected,(e,t)=>{const{requestId:r}=t.meta;e.loading===xe&&e.currentRequestId===r&&(e.loading="error",e.currentRequestId=null,e.error=t.error)})}}),{actions:as,reducer:ns}=rs;var ss=ns;const is=window.tcom_v2.login.isLoggedIn()?{availableVehicles:fn,bz4xVerifyVin:Ga,vehicleRecalls:Qa,context:Nn,customerDcsInfo:Xe,customerUpdatePassword:lt,customerUpdatePersonalInfo:ft,customerSubscriptions:at,generateOtp:Vt,marketingOffers:Ut,maintenanceSc
1heduleEmail:Mt,ownersOffers:Ft,safetyCampaigns:ir,serviceOpCodes:ur,toyotaCare:yr,vehicleDealer:Dr,vehicleDrivers:xr,vehicleHealthHistory:jr,vehicleHealthReport:Yr,vehicleMaintenanceSchedule:Xr,vehicleMaintenanceScheduled:na,engineTransmissionDrive:St,vehicleMileageHistory:da,vehicleSelfByVin:fa,vehicleSubscriptions:Aa,warningLights:za,preferredVehicle:er,vehicleSpecification:Sa,vehicleDetailedSpecification:Va,checkEmailAvailability:An,createAccount:zn,resetPassword:Gn,dealerDetails:sn,validatePassword:Qn,validateOtp:ss}:{context:Nn,bz4xVerifyVin:Ga,vehicleRecalls:Qa,warningLights:za,vehicleMaintenanceScheduled:na,engineTransmissionDrive:St,checkEmailAvailability:An,createAccount:zn,resetPassword:Gn,dealerDetails:sn,ownersOffers:Ft};var os=(0,l.HY)(is);var cs=r(33131),ls=r.n(cs);function ds(){return ls()('/*! For license information please see idb-cache.worker.js.LICENSE.txt */\n!function(){"use strict";const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),s=e=>"object"==typeof e&&null!==e||"function"==typeof e,i={canHandle:t=>s(t)&&t[e],serialize(e){const{port1:t,port2:n}=new MessageChannel;return c(e,t),[n,[n]]},deserialize(e){return e.start(),function(e,t){const n=new Map;return e.addEventListener("message",function(e){const{data:t}=e;if(!t||!t.id)return;const r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}}),g(e,n,[],t)}(e)}},o=new Map([["proxy",i],["throw",{canHandle:e=>s(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function c(t,n=globalThis,s=["*"]){n.addEventListener("message",function i(o){if(!o||!o.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(s,o.origin))return void console.warn(`Invalid origin \'${o.origin}\' for comlink proxy`);const{id:l,type:f,path:h}=Object.assign({path:[]},o.data),p=(o.data.argumentList||[]).map(v);let g;try{const n=h.slice(0,-1).reduce((e,t)=>e[t],t),r=h.reduce((e,t)=>e[t],t);switch(f){case"GET":g=r;break;case"SET":n[h.slice(-1)[0]]=v(o.data.value),g=!0;break;case"APPLY":g=r.apply(n,p);break;case"CONSTRUCT":g=function(t){return Object.assign(t,{[e]:!0})}(new r(...p));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;c(t,n),g=function(e,t){return m.set(e,t),e}(e,[e])}break;case"RELEASE":g=void 0;break;default:return}}catch(e){g={value:e,[a]:0}}Promise.resolve(g).catch(e=>({value:e,[a]:0})).then(e=>{const[a,s]=y(e);n.postMessage(Object.assign(Object.assign({},a),{id:l}),s),"RELEASE"===f&&(n.removeEventListener("message",i),u(n),r in t&&"function"==typeof t[r]&&t[r]())}).catch(e=>{const[t,r]=y({value:new TypeError("Unserializable return value"),[a]:0});n.postMessage(Object.assign(Object.assign({},t),{id:l}),r)})}),n.start&&n.start()}function u(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function l(e){if(e)throw new Error("Proxy has been released and is not useable")}function f(e){return b(e,new Map,{type:"RELEASE"}).then(()=>{u(e)})}const h=new WeakMap,p="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(h.get(e)||0)-1;h.set(e,t),0===t&&f(e)});function g(e,r,a=[],s=function(){}){let i=!1;const o=new Proxy(s,{get(t,s){if(l(i),s===n)return()=>{!function(e){p&&p.unregister(e)}(o),f(e),r.clear(),i=!0};if("then"===s){if(0===a.length)return{then:()=>o};const t=b(e,r,{type:"GET",path:a.map(e=>e.toString())}).then(v);return t.then.bind(t)}return g(e,r,[...a,s])},set(t,n,s){l(i);const[o,c]=y(s);return b(e,r,{type:"SET",path:[...a,n].map(e=>e.toString()),value:o},c).then(v)},apply(n,s,o){l(i);const c=a[a.length-1];if(c===t)return b(e,r,{type:"ENDPOINT"}).then(v);if("bind"===c)return g(e,r,a.slice(0,-1));const[u,f]=d(o);return b(e,r,{type:"APPLY",path:a.map(e=>e.toString()),argumentList:u},f).then(v)},construct(t,n){l(i);const[s,o]=d(n);return b(e,r,{type:"CONSTRUCT",path:a.map(e=>e.toString()),argumentList:s},o).then(v)}});return function(e,t){const n=(h.get(t)||0)+1;h.set(t,n),p&&p.register(e,t,e)}(o,e),o}function d(e){const t=e.map(y);return[t.map(e=>e[0]),(n=t.map(e=>e[1]),Array.prototype.concat.apply([],n))];var n}const m=new WeakMap;function y(e){for(const[t,n]of o)if(n.canHandle(e)){const[r,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},a]}return[{type:"RAW",value:e},m.get(e)||[]]}function v(e){switch(e.type){case"HANDLER":return o.get(e.name).deserialize(e.value);case"RAW":return e.value}}function b(e,t,n,r){return new Promise(a=>{const s=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(s,a),e.start&&e.start(),e.postMessage(Object.assign({id:s},n),r)})}function E(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function w(e,t){const n=function(){if(navigator.userAgentData||!/Safari\\//.test(navigator.userAgent)||/Chrom(e|ium)\\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise(t=>{const n=()=>indexedDB.databases().finally(t);e=setInterval(n,100),n()}).finally(()=>clearInterval(e))}().then(()=>{const n=indexedDB.open(e);return n.onupgradeneeded=()=>n.result.createObjectStore(t),E(n)});return(e,r)=>n.then(n=>r(n.transaction(t,e).objectStore(t)))}let S;function O(){return S||(S=w("keyval-store","keyval")),S}function k(e,t){return e("readonly",e=>(e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},E(e.transaction)))}var A={__proto__:null,clear:function(e=O()){return e("readwrite",e=>(e.clear(),E(e.transaction)))},createStore:w,del:function(e,t=O()){return t("readwrite",t=>(t.delete(e),E(t.transaction)))},entries:function(e=O()){const t=[];return k(e,e=>t.push([e.key,e.value])).then(()=>t)},get:function(e,t=O()){return t("readonly",t=>E(t.get(e)))},getMany:function(e,t=O()){return t("readonly",t=>Promise.all(e.map(e=>E(t.get(e)))))},keys:function(e=O()){const t=[];return k(e,e=>t.push(e.key)).then(()=>t)},promisifyRequest:E,set:function(e,t,n=O()){return n("readwrite",n=>(n.put(t,e),E(n.transaction)))},setMany:function(e,t=O()){return t("readwrite",t=>
1(e.forEach(e=>t.put(e[1],e[0])),E(t.transaction)))},update:function(e,t,n=O()){return n("readwrite",n=>new Promise((r,a)=>{n.get(e).onsuccess=function(){try{n.put(t(this.result),e),r(E(n.transaction))}catch(e){a(e)}}}))},values:function(e=O()){const t=[];return k(e,e=>t.push(e.value)).then(()=>t)}},P={maxAge:1/0,version:0,lib:A},C=function(e){return Object.assign({},P,e)},R=A,T=function(e,t,n){var r=C(t),a=r.maxAge,s=r.version,i=r.lib;return i.get(e,n).then(JSON.parse).then(function(t){return Date.now()-t.time>a||s!==t.version?(i.del(e,n),null):t.data}).catch(function(){return null})},M=function(e){var t,n=C(e);return n.name&&(t=w(n.name,n.name)),{get:function(e){return T(e,n,t)},set:function(e,r){return function(e,t,n,r){var a=C(n),s=a.lib,i=a.version;return s.set(e,JSON.stringify({version:i,time:Date.now(),data:t}),r).catch(function(){return null})}(e,r,n,t)},getAll:function(){return function(e,t){var n,r=C(e);return r.lib.keys(t).then(function(e){return n=e,Promise.all(n.map(function(e){return T(e,r,t)}))}).then(function(e){return e.reduce(function(e,t,r){return t&&(e[n[r]]=t),e},{})}).catch(function(){})}(n,t)},del:function(e){return n.lib.del(e,t)},clear:function(){return n.lib.clear(t)},keys:function(){return n.lib.keys(t)}}};c(class{constructor(e){e||console.log("OWNERS: IDB CACHE :: NO OPTIONS PROVIDED TO CONSTRUCTOR"),this.store=R.createStore(e.name,e.name),this.cache=M(e),this.defaultOpts=e,this.defaultOpts.lib=R}cacheSet(e,t){return this.cache.set(e,t)}async cacheGet(e,t={}){if(t.maxAge){const n=Object.assign({},this.defaultOpts,t);return T(e,n,this.store)}return this.cache.get(e)}cacheGetAll(e){return this.cache.getAll(e)}cacheClear(){return this.cache.clear()}cacheDeleteItem(e){return this.cache.del(e)}cacheGetKeys(){return this.cache.keys()}})}();\n',"Worker",void 0,void 0)}function us(){return ls()('/*! For license information please see to-api.worker.js.LICENSE.txt */\n!function(){"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();const t=Symbol("Comlink.proxy"),n=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),a=Symbol("Comlink.finalizer"),o=Symbol("Comlink.thrown"),s=e=>"object"==typeof e&&null!==e||"function"==typeof e,i={canHandle:e=>s(e)&&e[t],serialize(e){const{port1:t,port2:n}=new MessageChannel;return l(e,t),[n,[n]]},deserialize(e){return e.start(),function(e,t){const n=new Map;return e.addEventListener("message",function(e){const{data:t}=e;if(!t||!t.id)return;const r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}}),d(e,n,[],t)}(e)}},c=new Map([["proxy",i],["throw",{canHandle:e=>s(e)&&o in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function l(e,n=globalThis,r=["*"]){n.addEventListener("message",function s(i){if(!i||!i.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(r,i.origin))return void console.warn(`Invalid origin \'${i.origin}\' for comlink proxy`);const{id:c,type:p,path:f}=Object.assign({path:[]},i.data),h=(i.data.argumentList||[]).map(E);let g;try{const n=f.slice(0,-1).reduce((e,t)=>e[t],e),r=f.reduce((e,t)=>e[t],e);switch(p){case"GET":g=r;break;case"SET":n[f.slice(-1)[0]]=E(i.data.value),g=!0;break;case"APPLY":g=r.apply(n,h);break;case"CONSTRUCT":g=function(e){return Object.assign(e,{[t]:!0})}(new r(...h));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;l(e,n),g=function(e,t){return y.set(e,t),e}(t,[t])}break;case"RELEASE":g=void 0;break;default:return}}catch(e){g={value:e,[o]:0}}Promise.resolve(g).catch(e=>({value:e,[o]:0})).then(t=>{const[r,o]=b(t);n.postMessage(Object.assign(Object.assign({},r),{id:c}),o),"RELEASE"===p&&(n.removeEventListener("message",s),u(n),a in e&&"function"==typeof e[a]&&e[a]())}).catch(e=>{const[t,r]=b({value:new TypeError("Unserializable return value"),[o]:0});n.postMessage(Object.assign(Object.assign({},t),{id:c}),r)})}),n.start&&n.start()}function u(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function p(e){if(e)throw new Error("Proxy has been released and is not useable")}function f(e){return w(e,new Map,{type:"RELEASE"}).then(()=>{u(e)})}const h=new WeakMap,g="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(h.get(e)||0)-1;h.set(e,t),0===t&&f(e)});function d(e,t,a=[],o=function(){}){let s=!1;const i=new Proxy(o,{get(n,o){if(p(s),o===r)return()=>{!function(e){g&&g.unregister(e)}(i),f(e),t.clear(),s=!0};if("then"===o){if(0===a.length)return{then:()=>i};const n=w(e,t,{type:"GET",path:a.map(e=>e.toString())}).then(E);return n.then.bind(n)}return d(e,t,[...a,o])},set(n,r,o){p(s);const[i,c]=b(o);return w(e,t,{type:"SET",path:[...a,r].map(e=>e.toString()),value:i},c).then(E)},apply(r,o,i){p(s);const c=a[a.length-1];if(c===n)return w(e,t,{type:"ENDPOINT"}).then(E);if("bind"===c)return d(e,t,a.slice(0,-1));const[l,u]=m(i);
1return w(e,t,{type:"APPLY",path:a.map(e=>e.toString()),argumentList:l},u).then(E)},construct(n,r){p(s);const[o,i]=m(r);return w(e,t,{type:"CONSTRUCT",path:a.map(e=>e.toString()),argumentList:o},i).then(E)}});return function(e,t){const n=(h.get(t)||0)+1;h.set(t,n),g&&g.register(e,t,e)}(i,e),i}function m(e){const t=e.map(b);return[t.map(e=>e[0]),(n=t.map(e=>e[1]),Array.prototype.concat.apply([],n))];var n}const y=new WeakMap;function b(e){for(const[t,n]of c)if(n.canHandle(e)){const[r,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},a]}return[{type:"RAW",value:e},y.get(e)||[]]}function E(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function w(e,t,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(o,a),e.start&&e.start(),e.postMessage(Object.assign({id:o},n),r)})}let R={},v={},k={dataType:"json",method:"get",cache:!0,timeout:3e4};const C=async t=>{try{let r,a,o,s=t.url+(t.urlParameters&&Object.keys(t.urlParameters).length>0?"?"+e.g.decodeURIComponent((n=t.urlParameters,Object.keys(n).map(function(t){return e.g.encodeURIComponent(t)+"="+e.g.encodeURIComponent(n[t])}).join("&"))):"");return a={...k,...t,url:s},o={url:a.url,configuration:{credentials:"same-origin",method:a.method,headers:a.headers}},"post"!==o.configuration.method.toLowerCase()&&"put"!==o.configuration.method.toLowerCase()&&"patch"!==o.configuration.method.toLowerCase()||null!=a.body&&(o.configuration.body=a.body),r=new Promise((e,n)=>{fetch(o.url,o.configuration).then(e=>e.json()).then(n=>{n&&""!==n&&(n=t.parser?t.parser(n,a.parseMethod,a.parseParams):n,R[s]=n),v[s]=null,e(n)}).catch(e=>{v[s]=null,n(e)})}),r}catch(e){console.log("OWNERS: WORKER: API: request() ERROR ",e)}var n},O=e=>{let t;switch(e){case"preflight":t=e=>e.access_token;break;case"nested":t=e=>e.data;break;case"nested-alt":t=e=>e.body.data;break;default:t=e=>e}return t};l(class{constructor(e){}async apiCallWithPreflight(e,t){try{let n;if(t){const r=await this.apiCall(t);e.headers.authorization=r,n=await this.apiCall(e)}else n=await this.apiCall(e);return n}catch(e){console.log("OWNERS: WORKER: ERROR in Preflight callback",e)}}async apiCall(e){try{e.body&&(e.body=JSON.stringify(e.body)),e.parser=e.parser?O(e.parser):O("default");return await C(e)}catch(e){console.log("OWNERS: ERROR in apiCall callback",e)}}})}();\n',"Worker",void 0,void 0)}const hs=window.tcom_v2.login,gs=new Set(["/my-dashboard/","/my-dashboard/personal-information/","/my-dashboard/password-settings/","/my-dashboard/communication-preferences/","/owners/vehicle-dashboard/","/owners/vehicle-dashboard/service-history/","/owners/vehicle-dashboard/schedule-service-tool/","/owners/dashboard/","/owners/vehicle-specification/","/owners/account/user-management/","/owners/account/vehicle-management/","/owners/recalls/"]),ps=new Set(["/my-dashboard/payments/"]);var ms=()=>{const e=window.location.pathname;ps.has(e)||gs.has(e)&&hs?.signin()};const fs=new Set(["/owners/register/resend-activation/","/owners/sign-in-help/"]);var vs=()=>{const e=window.location.pathname;fs.has(e)&&(window.location="/my-dashboard/personal-information")},ys=r(47409),Is={meta:{region:"s",requestId:"60895398-ac12-4b47-b718-a85912ab431a"},data:{scheduleMaintenance:{vin:"JTMA1RFV5KD003318",division:null,model:null,modelYear:null,language:"en",outputType:"VIN_FSS_DATA",lastKnownMileage:"1",specialInstrctionId:null,operCondId:null,engineTransDrive:[{engine:"L4 - A25A-FKS",transmission:"8AT",driveType:"4WD"}],splInstructions:[[{specialInstructionId:"100",specialInstructionDesc:"Normal"}]],operatingConditions:[{opCondid:"1",operCondDesc:"Normal (5000 mile service interval)"},{opCondid:"4",operCondDesc:"Driving while towing, using a car-top carrier, or heavy vehicle loading (5000 mile service interval)"},{opCondid:"6",operCondDesc:"Repeated trips of less than five miles in temperatures below 32 F/ 0 C (5000 mile service interval)"},{opCondid:"17",operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow (5000 mile service interval)"},{opCondid:"18",operCondDesc:"Extensive idling and/or low speed driving for long distances such as police, taxi or door to door delivery service (5000 mile service interval)"}
1],scheduleMaintenanceDetails:[{interval:"NEXT",intervalMileage:"10000",mileageUnit:"Miles",serviceIntervalTime:"12",timeUnit:"Months",maintenanceTasksList:{maintenanceTask:[{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Replace Engine Oil And Oil Filter",servItemNotes:'Reset "Maint Reqd" Light If Equipped after maintenance at every 5,000 miles.',operCondSort:"1",servItemSort:"10",servActionSort:"70"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Rotate Tires",servItemNotes:null,operCondSort:"1",servItemSort:"20",servActionSort:"50"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Inspect /Adjust All Fluid Levels",servItemNotes:"Inspect sealed transmissions, transfer cases, and differentials for signs of leakage. If any leakage from a sealed component is suspected, it is recommended that you have the sealed component inspected by a Toyota dealer. Inspect power steering fluid (if equipped) and brake fluid level/condition. Inspect engine and inverter (if equipped) coolant level/condition/freezing point. Your dealer may recommend services (Dealer-Recommended Maintenance) based on inspection results.",operCondSort:"1",servItemSort:"50",servActionSort:"60"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Check Installation Of Driver's Floor Mat",servItemNotes:null,operCondSort:"1",servItemSort:"60",servActionSort:"20"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Visually Inspect Brake Linings/Drums And Brake Pads/Discs",servItemNotes:"Thickness Measurement And Runout.",operCondSort:"1",servItemSort:"240",servActionSort:"90"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Inspect Wiper Blades",servItemNotes:null,operCondSort:"1",servItemSort:null,servActionSort:"60"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Add Toyota EFI Tank Additive or equivalent",servItemNotes:"Hawaii, Puerto Rico, Saipan and American Samoa only",operCondSort:"1",servItemSort:null,servActionSort:"130"},{intervalNote:null,operCondDesc:"Driving while towing, using a car-top carrier, or heavy vehicle loading",operCondNotes:"Not all vehicles are designed for towing. Refer to your Vehicle Owner's Manual for details.",servItemDesc:"Torque Propeller Shaft Bolt",servItemNotes:"Includes operating on roads which road salt has been applied.",operCondSort:"4",servItemSort:"230",servActionSort:"120"},{intervalNote:null,operCondDesc:"Driving while towing, using a car-top carrier, or heavy vehicle loading",operCondNotes:"Not all vehicles are designed for towing. Refer to your Vehicle Owner's Manual for details.",servItemDesc:"Torque Nuts And Bolts On Chassis And Body",servItemNotes:null,operCondSort:"4",servItemSort:"280",servActionSort:"120"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Inspect Ball Joints And Dust Covers",servItemNotes:null,operCondSort:"17",servItemSort:"90",servActionSort:"60"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Inspect Drive Shaft Boots",servItemNotes:null,operCondSort:"17",servItemSort:"120",servActionSort:"60"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Inspect Steering Linkage And Boots",servItemNotes:null,operCondSort:"17",servItemSort:"200",servActionSort:"60"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Inspect Engine Air Filter",servItemNotes:null,operCondSort:"17",servItemSort:"210",servActionSort:"60"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Torque Propeller Shaft Bolt",servItemNotes:"Includes operating on roads which road salt has been applied.",operCondSort:"17",servItemSort:"230",servActionSort:"120"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Torque Nuts And Bolts On Chassis And Body",servItemNotes:null,operCondSort:"17",servItemSort:"280",servActionSort:"120"}]}},{interval:"CURRENT",intervalMileage:"5000",mileageUnit:"Miles",serviceIntervalTime:"6",timeUnit:"Months",maintenanceTasksList:{maintenanceTask:[{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Rotate Tires",servItemNotes:null,operCondSort:"1",servItemSort:"20",servActionSort:"50"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Inspect /Adjust All Fluid Levels",servItemNotes:"Inspect sealed transmissions, transfer cases, and differentials for signs of leakage. If any leakage from a sealed component is suspected, it is recommended that you have the sealed component inspected by a Toyota dealer. Inspect power steering fluid (if equipped) and brake fluid level/condition. Inspect engine and inverter (if equipped) coolant level/condition/freezing point. Your dealer may recommend services (Dealer-Recommended Maintenance) based on inspection results.",operCondSort:"1",servItemSort:"50",servActionSort:"60"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Check Installation Of Driver's Floor Mat",servItemNotes:null,operCondSort:"1",servItemSort:"60",servActionSort:"20"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Visually Inspect Brake Linings/Drums And Brake Pads/Discs",servItemNotes:"Thickness Measurement And Runout.",operCondSort:"1",servItemSort:"240",servActionSort:"90"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Inspect Wiper Blades",servItemNotes:null,operCondSort:"1",servItemSort:null,servActionSort:"60"},{intervalNote:null,operCondDesc:"Normal",operCondNotes:null,servItemDesc:"Add Toyota EFI Tank Additive or equivalent",servItemNotes:"Hawaii, Puerto Rico, Saipan and American Samoa only",o
1perCondSort:"1",servItemSort:null,servActionSort:"130"},{intervalNote:null,operCondDesc:"Driving while towing, using a car-top carrier, or heavy vehicle loading",operCondNotes:"Not all vehicles are designed for towing. Refer to your Vehicle Owner's Manual for details.",servItemDesc:"Replace Engine Oil And Oil Filter",servItemNotes:'Reset "Maint Reqd" Light If Equipped after maintenance at every 5,000 miles.',operCondSort:"4",servItemSort:"10",servActionSort:"70"},{intervalNote:null,operCondDesc:"Driving while towing, using a car-top carrier, or heavy vehicle loading",operCondNotes:"Not all vehicles are designed for towing. Refer to your Vehicle Owner's Manual for details.",servItemDesc:"Torque Propeller Shaft Bolt",servItemNotes:"Includes operating on roads which road salt has been applied.",operCondSort:"4",servItemSort:"230",servActionSort:"120"},{intervalNote:null,operCondDesc:"Driving while towing, using a car-top carrier, or heavy vehicle loading",operCondNotes:"Not all vehicles are designed for towing. Refer to your Vehicle Owner's Manual for details.",servItemDesc:"Torque Nuts And Bolts On Chassis And Body",servItemNotes:null,operCondSort:"4",servItemSort:"280",servActionSort:"120"},{intervalNote:null,operCondDesc:"Repeated trips of less than five miles in temperatures below 32 F/ 0 C",operCondNotes:null,servItemDesc:"Replace Engine Oil And Oil Filter",servItemNotes:'Reset "Maint Reqd" Light If Equipped after maintenance at every 5,000 miles.',operCondSort:"6",servItemSort:"10",servActionSort:"70"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Replace Engine Oil And Oil Filter",servItemNotes:'Reset "Maint Reqd" Light If Equipped after maintenance at every 5,000 miles.',operCondSort:"17",servItemSort:"10",servActionSort:"70"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Inspect Ball Joints And Dust Covers",servItemNotes:null,operCondSort:"17",servItemSort:"90",servActionSort:"60"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Inspect Drive Shaft Boots",servItemNotes:null,operCondSort:"17",servItemSort:"120",servActionSort:"60"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Inspect Steering Linkage And Boots",servItemNotes:null,operCondSort:"17",servItemSort:"200",servActionSort:"60"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Inspect Engine Air Filter",servItemNotes:null,operCondSort:"17",servItemSort:"210",servActionSort:"60"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Torque Propeller Shaft Bolt",servItemNotes:"Includes operating on roads which road salt has been applied.",operCondSort:"17",servItemSort:"230",servActionSort:"120"},{intervalNote:null,operCondDesc:"Driving on dirt/dusty/muddy roads or on roads with melted snow",operCondNotes:null,servItemDesc:"Torque Nuts And Bolts On Chassis And Body",servItemNotes:null,operCondSort:"17",servItemSort:"280",servActionSort:"120"},{intervalNote:null,operCondDesc:"Extensive idling and/or low speed driving for long distances such as police, taxi or door to door delivery service",operCondNotes:null,servItemDesc:"Replace Engine Oil And Oil Filter",servItemNotes:'Reset "Maint Reqd" Light If Equipped after maintenance at every 5,000 miles.',operCondSort:"18",servItemSort:"10",servActionSort:"70"}]}}],serviceIntervalList:{serviceInterval:[{interval:"5000",serviceIntervalMileage:"5000",mileageUnit:"Miles",serviceIntervalTime:"6",timeUnit:"Months"},{interval:"10000",serviceIntervalMileage:"10000",mileageUnit:"Miles",serviceIntervalTime:"12",timeUnit:"Months"},{interval:"15000",serviceIntervalMileage:"15000",mileageUnit:"Miles",serviceIntervalTime:"18",timeUnit:"Months"},{interval:"20000",serviceIntervalMileage:"20000",mileageUnit:"Miles",serviceIntervalTime:"24",timeUnit:"Months"},{interval:"25000",serviceIntervalMileage:"25000",mileageUnit:"Miles",serviceIntervalTime:"30",timeUnit:"Months"},{interval:"30000",serviceIntervalMileage:"30000",mileageUnit:"Miles",serviceIntervalTime:"36",timeUnit:"Months"},{interval:"35000",serviceIntervalMileage:"35000",mileageUnit:"Miles",serviceIntervalTime:"42",timeUnit:"Months"},{interval:"40000",serviceIntervalMileage:"40000",mileageUnit:"Miles",serviceIntervalTime:"48",timeUnit:"Months"},{interval:"45000",serviceIntervalMileage:"45000",mileageUnit:"Miles",serviceIntervalTime:"54",timeUnit:"Months"},{interval:"50000",serviceIntervalMileage:"50000",mileageUnit:"Miles",serviceIntervalTime:"60",timeUnit:"Months"},{interval:"55000",serviceIntervalMileage:"55000",mileageUnit:"Miles",serviceIntervalTime:"66",timeUnit:"Months"},{interval:"60000",serviceIntervalMileage:"60000",mileageUnit:"Miles",serviceIntervalTime:"72",timeUnit:"Months"},{interval:"65000",serviceIntervalMileage:"65000",mileageUnit:"Miles",serviceIntervalTime:"78",timeUnit:"Months"},{interval:"70000",serviceIntervalMileage:"70000",mileageUnit:"Miles",serviceIntervalTime:"84",timeUnit:"Months"},{interval:"75000",serviceIntervalMileage:"75000",mileageUnit:"Miles",serviceIntervalTime:"90",timeUnit:"Months"},{interval:"80000",serviceIntervalMileage:"80000",mileageUnit:"Miles",serviceIntervalTime:"96",timeUnit:"Months"},{interval:"85000",serviceIntervalMileage:"85000",mileageUnit:"Miles",serviceIntervalTime:"102",timeUnit:"Months"}
1,{interval:"90000",serviceIntervalMileage:"90000",mileageUnit:"Miles",serviceIntervalTime:"108",timeUnit:"Months"},{interval:"95000",serviceIntervalMileage:"95000",mileageUnit:"Miles",serviceIntervalTime:"114",timeUnit:"Months"},{interval:"100000",serviceIntervalMileage:"100000",mileageUnit:"Miles",serviceIntervalTime:"120",timeUnit:"Months"},{interval:"105000",serviceIntervalMileage:"105000",mileageUnit:"Miles",serviceIntervalTime:"126",timeUnit:"Months"},{interval:"110000",serviceIntervalMileage:"110000",mileageUnit:"Miles",serviceIntervalTime:"132",timeUnit:"Months"},{interval:"115000",serviceIntervalMileage:"115000",mileageUnit:"Miles",serviceIntervalTime:"138",timeUnit:"Months"},{interval:"120000",serviceIntervalMileage:"120000",mileageUnit:"Miles",serviceIntervalTime:"144",timeUnit:"Months"}]}}}},ws={meta:{region:"s",requestId:"48e9350c-6c46-4b5b-90c7-83d27cfdb832"},data:{vehicleModelYearList:{86:["2017","2018","2019","2020"],"MR2 Spyder":["2000","2001","2002","2003","2004","2005","2006"],"Prius PHV":["2012","2013","2014","2015"],Van:["1984","1985","1986","1987","1988","1989"],"Corolla Hatchback":["2019","2020","2021","2022","2023","2024"],iM:["2016"],Avalon:["1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022"],iQ:["2011","2012","2013","2014","2015"],GR86:["2022","2023"],Cressida:["1979","1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992"],Celica:["1979","1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005"],Sienna:["1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020"],"RAV4 Prime":["2021","2022","2023"],"Tundra HV":["2022","2023","2024"],"Sienna HV":["2021","2022","2023","2024"],Venza:["2009","2010","2011","2012","2013","2014","2015","2016"],"Toyota Crown":["2023"],Solara:["1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009"],"Camry HV":["2007","2008","2009","2010","2011","2012","2013","2014","2014.5","2015","2016","2017","2018","2019","2020","2021","2022","2023","2024"],Matrix:["2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014"],Raize:["2023","2024"],Supra:["1979","1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","2020","2021","2024"],Corona:["1979","1980","1981","1982"],"Venza HV":["2021","2022","2023"],Sequoia:["2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022"],"Prius V":["2012","2013","2014","2015","2016","2017"],"iQ EV":["2013"],"Yaris Liftback":["2018"],"Yaris SD THAI-Prod":["2024"],Highlander:["2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023"],RAV4:["1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023","2024"],MR2:["1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995"],"Yaris iA":["2017","2018"],"Corolla Cross HV":["2023"],"Avalon HV":["2013","2014","2015","2016","2017","2018","2019","2020","2021","2022"],"FJ Cruiser":["2007","2008","2009","2010","2011","2012","2013","2014"],"Prius Prime":["2017","2018","2019","2020","2021","2022","2023","2024"],Mirai:["2016","2017","2018","2019","2020","2021","2022","2023"],"Prius C":["2012","2013","2014","2015","2016","2017","2018","2019","2020","2021"],Tercel:["1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","1999"],"FR-S":["2013","2014","2015","2016"],"YARIS HATCHBACK":["2020"],Paseo:["1991","1992","1993","1994","1995","1996","1997","1998","1999"],T100:["1993","1994","1995","1996","1997","1998"],"Highlander HV":["2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023"],"Corolla iM":["2017","2018"],"Land Cruiser":["1979","1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2013","2014","2015","2016","2017","2018","2019","2020","2021"],xA:["2004","2005","2006"],Starlet:["1981","1982","1983","1984"],xB:["2004","2005","2006","2008","2009","2010","2011","2012","2013","2014","2015"],"C-HR":["2017","2018","2019","2020","2021","2022"],xD:["2008","2009","2010","2011","2012","2013","2014"],tC:["2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016"],"4Runner":["1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023"],Tacoma:["1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023"],Previa:["1990","1991","1992","1993","1994","1995","1996","1997"],"GR Corolla":["2023","2024"],"Sequoia HV":["2023","2024"],"RAV4 EV":["2012","2013","2014"],Corolla:["1979","1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023","2024"],"Corolla HV":["2020","2021","2022","2023","2024"],"Corolla Cross":["2022","2023"],Echo:["2000","2001","2002","2003","2004","2005"],"Grand Highlander":["2024"],Yaris:["2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2019","2022","2023"],"Grand Highlander HV":["2024"],Hilux:["2024"],Truck:["1979","1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995"],Camry:["1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2014.5","2015","2016","2017","2018","2019","2020","2021","2022","2023","2024"],bZ4X:["2023"],iA:["2016"],Prius:["2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023","2024"],Tundra:["2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023","2024"],"GR Supra":["2022","2023"],Avanza:["2024"],"RAV4 HV":["2016","2017","2018","2019","2020","2021","2022","2023","2024"]}}},Cs={statusCode:404,body:{meta:{region:"s",requestId:"d0fc2468-6590-40db-88f2-14918b114eb1"}
1,error:{code:"B002",message:"No campaigns found",detail:"No service campaigns have been found for the given VIN.",bodId:null}}},Ss={meta:{region:"s",requestId:"76259e14-0270-4b9c-9a41-84736e6b08da"},data:{opCodes:[{opCodeCatagory:"Maintenance",serviceDesc:"Alignment",opCode:142,brand:"T",serviceHistoryOpCodeId:141},{opCodeCatagory:"Brakes",serviceDesc:"Brakes",opCode:143,brand:"T",serviceHistoryOpCodeId:142},{opCodeCatagory:"Maintenance",serviceDesc:"Inspection",opCode:144,brand:"T",serviceHistoryOpCodeId:143},{opCodeCatagory:"Maintenance",serviceDesc:"Oil Change",opCode:145,brand:"T",serviceHistoryOpCodeId:144},{opCodeCatagory:"Maintenance",serviceDesc:"Scheduled Maintenance",opCode:146,brand:"T",serviceHistoryOpCodeId:145},{opCodeCatagory:"Maintenance",serviceDesc:"Tire Rotation",opCode:147,brand:"T",serviceHistoryOpCodeId:146},{opCodeCatagory:"Miscellaneous Service",serviceDesc:"Other",opCode:148,brand:"T",serviceHistoryOpCodeId:147}]}},Rs=r(83837);const qs=["2020","2021","2022","2023","2024"],Ds=[{match:"Yaris",minYear:2021},{match:"Yaris SD HV THAI-Prod",allYears:!0},{match:"Yaris SD THAI-Prod",allYears:!0},{match:"Yaris THAI-Prod",allYears:!0},{match:"Sienna HV MaaS Package",allYears:!0},{match:"Tercel",allYears:!0},{match:"Starlet",allYears:!0},{match:"MR2",allYears:!0},{match:"Paseo",allYears:!0},{match:"Previa",allYears:!0},{match:"T100",allYears:!0},{match:"Truck",allYears:!0},{match:"Van",allYears:!0},{match:"Supra",allYears:!0}],Ts={sedan:"https://www.toyota.com/content/dam/toyotaowners/vehicles/sedan_generic/Sedan_Generic_base_default_d_profile_743x235.png",suv:"https://www.toyota.com/content/dam/toyotaowners/vehicles/suv_generic/SUV_Generic_base_default_d_profile_743x235.png",truck:"https://www.toyota.com/content/dam/toyotaowners/vehicles/truck_generic/Truck_Generic_base_default_d_profile_743x235.png",van:"https://www.toyota.com/content/dam/toyotaowners/vehicles/van_generic/Van_Generic_base_default_d_profile_743x235.png",compact:"https://www.toyota.com/content/dam/toyotaowners/vehicles/compact_generic/Compact_Generic_base_default_d_profile_743x235.png"};class bs extends EventTarget{constructor(){super(),this.useStubs=!1,this.stubConfigSet=!1,this.authConfig={b2c:{authKey:tcom_v2.login.getToken()},b2o:{}}
1,this.store=null,this.isLoggedIn,this.configSet=!1,this.currentVehicleId=null,this.isCacheInitialized=!1,this.isOwnersApiInitialized=!1,this.isOwnersSessionInitialized=!1;const e=window.location.protocol;return this.useSSL=e.startsWith("https"),this.addVehicleVIN=null,this.captchaSetInterval,this.vapiMapData=void 0,this.init()}ownersData={availableVehicles:{data:null,loadingStatus:Oe},currentVehicle:{byVin:{data:null,loadingStatus:Oe},dealer:{data:null,loadingStatus:Oe},details:{data:null,loadingStatus:Oe},engineTransmissionDrive:{data:null,loadingStatus:Oe},maintenanceSchedule:{data:null,loadingStatus:Oe},maintenanceScheduled:{data:null,loadingStatus:Oe},manual:{data:null,loadingStatus:Oe},safetyCampaigns:{data:null,loadingStatus:Oe},selfByVin:{data:null,loadingStatus:Oe},serviceOpCodes:{data:null,loadingStatus:Oe},serviceRecords:{data:null,loadingStatus:Oe},subscriptions:{data:null,loadingStatus:Oe},telematics:{},toyotaCare:{data:null,loadingStatus:Oe},vehicleHealthReport:{data:null,loadingStatus:Oe},vehicleHealthHistory:{data:null,loadingStatus:Oe},vehicleMileageHistory:{data:null,loadingStatus:Oe},jelliesImages:{data:null,loadingStatus:Oe},captchaVerification:{data:null,loadingStatus:Oe},vehicleSpecification:{data:null,loadingStatus:Oe}},customer:{communication:{preferences:{data:null,loadingStatus:Oe},profile:{data:null,loadingStatus:Oe}},masterPreferences:{},masterVehiclesOfInterest:{},subscriptions:{data:null,loadingStatus:Oe}},jellyImages:{default:{"Crossovers & SUVs":Ts?.suv,"Cars & Minivan":Ts?.sedan,Trucks:Ts?.truck,loadingStatus:"loaded"}},offers:{owner:{data:null,loadingStatus:Oe},marketing:{data:null,loadingStatus:Oe}},vehicleModelYearList:{data:null,loadingStatus:Oe}};init(){return this.addEventListener(u,e=>{let t=null;this.currentVehicleId?(t=this.ownersData.availableVehicles.data.find(e=>e.vehicleId===this.currentVehicleId)||null,t?this.currentVehicleId=t.vehicleId:(t=this.ownersData.availableVehicles.data[0]||null,this.currentVehicleId=this.ownersData.availableVehicles.data[0]?.vehicleId)):(t=this.ownersData.availableVehicles.data[0]||null,t&&(this.currentVehicleId=t.vehicleId||null)),t?(this.ownersData.currentVehicle.details.data=t,document.body.classList.add("has-current-vehicle"),this.dispatchEvent(new CustomEvent(h,{detail:{vehicle:this.ownersData.currentVehicle.details.data}}))):document.body.classList.remove("has-current-vehicle")}),this.addEventListener(h,async e=>{this.buildCurrentVehicleDetails(e.detail?.vehicle||e.detail?.vehicle),e.detail?.vehicle?.vin?document.body.classList.remove("has-no-vin"):document.body.classList.add("has-no-vin")}),this.addEventListener(j,e=>{const t=e?.detail?.data,r=this.addVehicleVIN;r&&this.getCaptchaVerification({vin:r,token:t})}),this.addEventListener(y,e=>{const t=e?.detail?.data,r=this.addVehicleVIN;r&&this.acquireSafetyCampaignsData(r,t)}),this.addEventListener(C,e=>{const t=e?.detail?.data,r=this.addVehicleVIN;r&&this.acquireToyotaCareData(r,t)}),this.addEventListener(A,e=>{this.getAvailableVehiclesData({refresh:!0})}),new Promise(async(e,t)=>{if(!1===tcom_v2.login.isLoggedIn()){ms(),this.isLoggedIn=!1;let e=JSON.parse(window.sessionStorage.getItem(F));e?(e.loggedIn=!1,window.sessionStorage.setItem(F,JSON.stringify(e))):window.sessionStorage.setItem(F,JSON.stringify({loggedIn:!1}))}else{vs();let e=JSON.parse(window.sessionStorage.getItem(F));e?(e.loggedIn=!0,window.sessionStorage.setItem(F,JSON.stringify(e))):window.sessionStorage.setItem(F,JSON.stringify({loggedIn:!0})),this.isLoggedIn=!0}const a=this.initSessionData();a&&a.config&&this.setConfig(a.config);try{const e=new us,t=n.LV(e),r=await new t;this.OwnersApi=r||null,this.isOwnersApiInitialized=!!this.OwnersApi;const a=window?.tcom_v2?.login?.getUserInfo()?.userId||"anonymous",s=X(a),i=new ds,o=n.LV(i),c=await new o({version:a,name:s});this.OwnersCache=c||null,this.useCacheData=!!this.OwnersCache,this.isCacheInitialized=!!this.OwnersCache,this.isCacheInitialized&&this.isOwnersApiInitialized&&this.dispatchEvent(new CustomEvent(d))}catch(e){console.error("OWNERS: ERROR: ",e),this.OwnersApi=null,this.isOwnersApiInitialized=!1,this.OwnersCache=null,this.useCacheData=!1,this.isCacheInitialized=!1,this.dispatchEvent(new CustomEvent(d))}const i=await async function(e,t,a){const n=c(e,a),i=(0,s.U1)({reducer:{owners:os},middleware:e=>e({thunk:{extraArgument:{owners:{api:n,cache:t}}}}),devTools:"prod"!==r.g.tcom_env?.environment?.name});return i.observeStore=(e,t,r)=>{let a;function n(){let n=t(e.getState());n!==a&&(a=n,r(a))}let s=e.subscribe(n);return n(),s},i.injectReducer=(e,t)=>{i.asyncReducers[e]=t,i.replaceReducer(createReducer(i.asyncReducers))},i}(this.OwnersApi,this.OwnersCache,window.tcom_v2.login.getToken());this.store=i,this.isOwnersSessionInitialized=!0,i.dispatch(Cn()),this.isLoggedIn?(this.getAvailableVehiclesData(!1),this.getCustomerDcsInfoV3(!0)):this.setSwapInfo(),await this.getVehicleModelYearListData(),await this.getVapiMappingData(),this.initSelectVehicleFromURL(),this.initVehicleFromURL(),this.initPersistentInfo(),this.initVehicleModelClassName(),this.initPageAnalytics(),e(this)})}initPageAnalytics(){if(!window?._dL?.page)return;const e={user_logged_status:tcom_v2.login.isLoggedIn()?"logged_in":"logged_out"};Object.keys(e).forEach(t=>window._dL.page[t]=e[t])}initPersistentInfo(){const e=()=>sessionStorage.getItem("context")?JSON.parse(sessionStorage.getItem("context")):{},t={...e()?.persistentInfo||{},profile:{...e()?.persistentInfo?.profile||{},prefVehicleId:e()?.persistentInfo?.profile?.prefVehicleId||""},vehicle:e()?.persistentInfo?.vehicle||{},vehicleList:e()?.persistentInfo?.vehicleList||[]},r=t=>sessionStorage.setItem("context",JSON.stringify({...e()||{},persistentInfo:t})),a=this.isLoggedIn?t:null;r(a),this.isLoggedIn&&window.tcom_v2?.login?.beforeSignOutFunctions?.push(function(){new Promise(function(e,t){try{r(null),e()}catch(e){t()}})})}initVehicleFromURL(){const{model:e,year:t}=this.getVehicleFromURL()||{};e&&t&&this.setVehicleByModelYear({model:e,year:t})}async initSelectVehicleFromURL(){if(!window.location.href.match(/\?vehicle-selection/g))return;const e=`/content/experience-fragments/tcom/us/${tcom_v2.i18n.getCurrentLocale()}/site/select-vehicle/master`;new(await tcom_v2.getXfCfModal())({el:null,path:e,app:"safety-sense",fullscreen:!1})}getVehicleFromURL(){const{pathname:e}=window.location,t=["warranty-owners-manuals","dashboard-lights","toyota-for-families","how-to-videos","audio-multimedia"].filter(t=>e.includes(t)).pop();if(!t)return;const r=new RegExp(`${t}/.*/(?<modelCode>[\\w-]+)/(?<year>\\d{4})`),a=window.location.href.match(r)?.groups||{},{modelCode:n,year:s}=a;if(!n||!s)return;const i=decodeURI(String(n)).replace(/-/g," ");return{model:this.getVehicleDisplayName(i,s)||n,year:s}}setVehicleByModelYear({model:e,year:t}){if(!e||!t)return;const r=this.getCurrentModelAndYear();if(e==r?.model&&t==r?.year)return;const a=this.getNormalizedModelName(e),n=parseInt(t);let s=null;const i=this,o=()=>i.store.getState().owners.availableVehicles||{},c=()=>{const r=(o()?.entities||[]).reduce((e,t)=>
1t?.model?.toLowerCase()?.includes(a.toLowerCase())&&parseInt(t?.year)===n&&t?.vehicleId?t?.vehicleId:e,null);r?i.setCurrentVehicleById(r,void 0,"from-url-vehicle"):this.setTransientInfo({model:e,year:t})},l=()=>{c(),s&&s()};this.setMTGarageData({model:e,year:t}),this.isLoggedIn?"loaded"===o()?.loading?c():s=this.store.observeStore(this.store,e=>e.owners.availableVehicles.entities,l):this.setTransientInfo({model:e,year:t})}getRecentModelYears({model:e,year:t}){const r=`${t} ${e}`,a=((0,ys.R5)("recentModelYear")||"").split(", ").map(e=>e.replace(/[\[\]\"\\]/g,"")).filter(e=>e.includes(r)).filter((e,t)=>t>4);return[r,...a]}setMTGarageData({model:e,year:t,addvehicle:r}){if(!e||!t)return;const a=this.getNormalizedModelName(e),n=parseInt(t),s=r?{addToMyGarage:!0}:{},i=sessionStorage.getItem("context")?JSON.parse(sessionStorage.getItem("context")):{},o=this.getRecentModelYears({model:a,year:n}),c=`"[${o.join(", ")}]"`;sessionStorage.setItem("context",JSON.stringify({...i,...s})),(0,ys.TV)("selectedModel",a),(0,ys.TV)("selectedYear",n),(0,ys.TV)("recentModelYear",c),(0,ys.TV)("contextModelYear",JSON.stringify(o))}setSwapInfo({model:e,year:t}={}){const r=this.getNormalizedModelName(e),a=parseInt(t),n=sessionStorage.getItem("context")?JSON.parse(sessionStorage.getItem("context")):{},s=!this.isLoggedIn||!e||!t?null:{...n?.swapInfo||{},model:r,year:a};sessionStorage.setItem("context",JSON.stringify({...n,swapInfo:s}))}setTransientInfo({model:e,year:t}){const r=e?this.getNormalizedModelName(e):e,a=parseInt(t),n=sessionStorage.getItem("context")?JSON.parse(sessionStorage.getItem("context")):{},s=this.getRecentModelYears({model:r,year:a}),i={...n?.transientInfo||{},selectedModel:r,selectedYear:String(a),recentModelYears:s},o={...n?.persistentInfo||{},profile:{...n?.persistentInfo?.profile||{},prefVehicleId:e&&t?"":n?.persistentInfo?.profile?.prefVehicleId}};sessionStorage.setItem("context",JSON.stringify({...n||{},persistentInfo:o,transientInfo:i})),(0,ys.TV)("selectedModel",e),(0,ys.TV)("selectedYear",t),this.store.dispatch(Vn({model:e,year:t})),e&&t?(this.store.dispatch(Tn()),document.body.classList.add("has-transient-vehicle")):document.body.classList.remove("has-transient-vehicle"),this.setVehicleModelClassName()}initVehicleModelClassName(){if(this.isLoggedIn){[e=>e.owners.availableVehicles.entities,e=>e.owners.context.data.currentVehicleId].forEach(e=>this.store.observeStore(this.store,e,this.setVehicleModelClassName.bind(this)))}this.setVehicleModelClassName()}setVehicleModelClassName(){const e=window.sessionStorage.getItem("context"),t=(e&&JSON.parse(e),"to-vehicle-");[...document.body.classList].forEach(e=>{e.includes(t)&&document.body.classList.remove(e)});const{model:r}=this.getCurrentModelAndYear();if(!r)return void document.body.classList.remove("has-vehicle");const a=r.trim().toLowerCase().replace(/\s+/g,"-");document.body.classList.add(`${t}${a}`),document.body.classList.add("has-vehicle")}getVehicleTitle(){const{model:e,year:t}=this.getCurrentModelAndYear(),r=this.getVehicleDisplayName(e,t)||e;return r&&t?`${t} ${r}`:""}
1async setConfig(e){e&&(this.configSet=!0,e.b2c&&(this.authConfig={...this.authConfig,b2c:{...e.b2c}}),e.b2o&&(this.authConfig={...this.authConfig,b2o:{...e.b2o}}))}setStubConfig(e){this.useStubs=e}async buildCurrentVehicleDetails(e){const t=e?.vin;t&&this.getVehicleServiceOpCodes()}getLogger(e="DummyService"){return(...t)=>console.log(`OWNERS: ${e}()`,...t)}getStatusSetter(e={},t="",r=()=>{}){return a=>{e.loadingStatus=a,r&&r("setStatus:",a),this.dispatchEvent(new CustomEvent(t)),r&&r("setStatus event:",t)}}getDataSetter(e={},t="",r=()=>{}){return(a=null)=>{e.data=a,r&&r("setData:",a),this.dispatchEvent(new CustomEvent(t,{detail:{data:a}})),r&&r("setData event:",t)}}async getAcquireData({STUB_DATA:e=null,acquireFromCache:t=()=>{},acquireFromApi:r=()=>{},cacheSetter:a=()=>{},dataSetter:n=()=>{},statusSetter:s=()=>{},logger:i=()=>{}}){try{if(s(xe),this.useStubs&&e){const t=e;return n(t),s("loaded"),t}if(this.useCacheData&&this.OwnersCache){const e=await t();if(e)return n(e),s("loaded"),e}const i=await r();return i&&this.useCacheData&&this.OwnersCache&&a(i),n(i),s("loaded"),i}catch(e){return i("error:",e),s("error"),null}}getCustomerDcsInfo(e){this.store&&this.store.dispatch(Ge({refresh:e}))}getCustomerDcsInfoV3(e){this.store&&this.store.dispatch(We({refresh:e}))}getMarketingOffersData(e,t,r,n=!1,s=!1){return this.store&&s&&this.store.dispatch(At({zip:e,series:t,year:r,refresh:n})),this.ownersData.offers.marketing.loadingStatus!==a.LOADING_STATUS.LOADING?marketingOffersDataPromise?this.marketingOffersDataPromise:this.marketingOffersDataPromise=this.acquireMarketingOffersData(e,t,r):async()=>this.ownersData.offers.marketing.data}async acquireMarketingOffersData(e,t,n){const s=async(e,t,a)=>{try{await r.g.tcom_v2.pipeline.priority3;const n=await r.g.tcom_v2.callService("getRawOffers",e,t,a);n&&(this.OwnersCache&&await this.OwnersCache.cacheSet(we(e),n),i(n))}catch(e){console.log("OWNERS: acquireMarketingOffersData(): error",e)}},i=e=>{this.ownersData.marketing.owner={data:e,loadingStatus:"loaded"},this.dispatchEvent(new CustomEvent(V,{detail:{data:e}})),this.dispatchEvent(new CustomEvent(N))};try{if(this.ownersData.offers.marketing.loadingStatus=a.LOADING_STATUS.LOADING,this.dispatchEvent(new CustomEvent(N)),this.useCacheData){const r=await this.OwnersCache.get(we(e),{maxAge:G});r?i(r):s(e,t,n)}else s(e,t,n)}catch(e){console.log("OWNERS: acquireMarketingOffersData(): error",e)}}getOwnerOffersData(e={},t=!1,r=!1){this.store&&this.store.dispatch(zt(e))}getToyotaCareData(e,t=!1){this.store&&this.store.dispatch(gr({vin:e,refresh:t}))}getVehicleServiceOpCodes(e=!1){if(!e)return this.vehicleServiceOpCodesPromise?this.vehicleServiceOpCodesPromise:this.vehicleServiceOpCodesPromise=this.acquireVehicleServiceOpCodes();this.store&&this.store.dispatch(or())}async acquireVehicleServiceOpCodes(){const e=async()=>{const e=await r.g.tcom_v2.callService("getTOPreflightTokenV1",{appName:Ee});if(e){const a=await r.g.tcom_v2.callService("getTOVehicleServiceOpCodes",{authKey:e});a&&(this.useCacheData&&this.OwnersCache.cacheSet(le,a),t(a))}},t=e=>{this.ownersData.currentVehicle.serviceOpCodes={data:e,loadingStatus:"loaded"},this.dispatchEvent(new CustomEvent(I,{detail:{data:e}})),this.dispatchEvent(new CustomEvent(w))};try{if(this.useStubs)return Ss;if(this.ownersData.currentVehicle.serviceOpCodes.loadingStatus=xe,this.dispatchEvent(new CustomEvent(w)),this.useCacheData){const r=await this.OwnersCache.cacheGet(le,{maxAge:Z});r?t(r):e()}else e()}catch(e){}}getSafetyCampaigns(e,t=!1){e&&t?this.store.dispatch(tr({vin:e})):this.ownersData.currentVehicle.safetyCampaigns.loadingStatus!==xe&&(this.ownersData.currentVehicle.safetyCampaigns.loadingStatus=xe,this.dispatchEvent(new CustomEvent(f)),e&&(this.addVehicleVIN=e,this.getCaptchaToken(window?.tcom_env?.services?.google?.siteKey,"login",y)))}async acquireSafetyCampaignsData(e,t){const a=async(e,t)=>{try{await r.g.tcom_v2.pipeline.priority2;const a=await r.g.tcom_v2.callService("getTOPreflightTokenV2",{appName:_e});if(!e)return logger("acquireSafetyCampaignsData acquireFromApi warn:","Unable to acquire vin"),statusSetter(Oe),null;if(a){const s=await r.g.tcom_v2.callService("postTOVehicleSafetyCampaigns",{authKey:a,vin:e,token:t});
1s?(this.OwnersCache&&await this.OwnersCache.cacheSet(oe(e),s),n(s)):(this.ownersData.currentVehicle.safetyCampaigns.loadingStatus="error",this.ownersData.currentVehicle.safetyCampaigns.data=null,this.dispatchEvent(new CustomEvent(v)))}else this.ownersData.currentVehicle.safetyCampaigns.loadingStatus="error",this.ownersData.currentVehicle.safetyCampaigns.data=null,this.dispatchEvent(new CustomEvent(v))}catch(e){console.error("OWNERS: acquireSafetyCampaignsData(): Error acquiring safety campaigns data: ",e)}},n=async e=>{this.ownersData.currentVehicle.safetyCampaigns={data:e?.body?.data||e?.body?.error,loadingStatus:"loaded"},e?.body?.error?this.dispatchEvent(new CustomEvent(v)):(this.dispatchEvent(new CustomEvent(m,{detail:{data:e?.body?.data||e?.body?.error}})),this.dispatchEvent(new CustomEvent(f)))};try{if(this.useStubs)return Cs;if(this.ownersData.currentVehicle.safetyCampaigns.loadingStatus=xe,this.dispatchEvent(new CustomEvent(f)),this.useCacheData)if(e){let r=await this.OwnersCache.cacheGet(oe(e),{maxAge:J});r?n(r):a(e,t)}else this.ownersData.currentVehicle.safetyCampaigns.loadingStatus="error",this.ownersData.currentVehicle.safetyCampaigns.data=null,this.dispatchEvent(new CustomEvent(v));else e?a(e,t):(this.ownersData.currentVehicle.safetyCampaigns.loadingStatus="error",this.ownersData.currentVehicle.safetyCampaigns.data=null,this.dispatchEvent(new CustomEvent(v)))}catch(e){console.log("OWNERS: acquireSafetyCampaignsData(): ERROR: ",e)}}async getCaptchaToken(e,t,r){t=t||"login",e=e||window?.tcom_env?.services?.google?.siteKey;try{let a=await(async()=>new Promise((r,a)=>{grecaptcha.enterprise.ready(function(){grecaptcha.enterprise.execute(e,{action:t}).then(function(e){return r(e)})})}))();if(a)return window.clearInterval(this.captchaSetInterval),this.dispatchEvent(new CustomEvent(r||_,{detail:{data:a}})),a;null==this.captchaSetInterval&&(this.captchaSetInterval=window.setInterval(this.getCaptchaToken,250,e,t,r))}catch(e){return this.dispatchEvent(new CustomEvent(E,{detail:{data:e}})),e}}getCaptchaVerification({model:e,year:t,vin:r,token:a}){return this.captchaVerificationDataPromise?this.captchaVerificationDataPromise:this.captchaVerificationDataPromise=this.acquireCaptchaVerificationData({model:e,year:t,vin:r,token:a})}async acquireCaptchaVerificationData({model:e,year:t,vin:a,token:n}){const s=async({model:e,year:t,vin:a,token:n})=>{try{const s=await r.g.tcom_v2.callService("submitTOVehicles",{authKey:this.authConfig.b2c.authKey,model:e,year:t,vin:a,token:n});return s?i(s):this.dispatchEvent(new CustomEvent(P)),s}catch(e){return this.dispatchEvent(new CustomEvent(M)),e}},i=async e=>{e?.error?this.dispatchEvent(new CustomEvent(k,{detail:{data:e?.error}})):this.dispatchEvent(new CustomEvent(A,{detail:{data:e?.data}}))};try{n||(n=await this.getCaptchaToken());return await s({model:e,year:t,vin:a,token:n})}catch(e){return this.dispatchEvent(new CustomEvent(M)),e}}getVehicleSpecification(e,t){return this.acquireVehicleSpecificationData(e,t,!1)}async acquireVehicleSpecificationData(e,t,r=!1){const a=async(e,t)=>{try{this.store?.dispatch?this.store.dispatch(va({vin:e,token:t,refresh:r})):this.dispatchEvent(new CustomEvent(H))}catch(e){return console.error("OWNERS: acquireVehicleSpecificationData(): Error acquiring captcha: ",e),this.dispatchEvent(new CustomEvent(L)),e}};try{t||(t=await this.getCaptchaToken());return await a(e,t)}catch(e){return this.dispatchEvent(new CustomEvent(M)),e}}getMaintenanceSchedule(e,t=null){if(!e)return null;this.store&&this.store.dispatch(Gr({vin:e,lastKnownMileage:t}))}getMaintenanceScheduled(e,t){this.store&&e&&t&&this.store.dispatch(Qr({model:e,year:t}))}sendMaintenanceScheduleEmail({requestBody:e}){if(0==Object.keys(e).length)return null;this.store&&this.store.dispatch(Ot({requestBody:e}))}getEngineTransmissionDrive(e,t,r,a,n,s){this.store&&this.store.dispatch(vt({model:e,year:t,lastKnownMileage:r,engine:a,transmission:n,driveType:s}))}getCustomerCommunicationPreferences(){return"loaded"!==this.ownersData.customer.communication.preferences.loadingStatus?this.customerCommunicationPreferencesPromise?this.customerCommunicationPreferencesPromise:this.customerCommunicationPreferencesPromise=this.acquireCustomerCommunicationPreferences():async()=>
1this.ownersData.customer.communication.preferences.data}async acquireCustomerCommunicationPreferences(){const e=async()=>{try{if(this.authConfig?.b2c?.authKey){await r.g.tcom_v2.pipeline.priority3;const e=await r.g.tcom_v2.callService("getTOCustomerCommunicationPreferences",{authKey:this.authConfig.b2c.authKey});e&&t(e)}}catch(e){console.error("OWNERS: acquireCustomerCommunicationPreferences() error: ",e)}},t=e=>(this.OwnersCache&&this.OwnersCache.cacheSet(fe,e),this.ownersData.customer.communication.preferences={data:e,loadingStatus:"loaded"},this.dispatchEvent(new CustomEvent(q,{detail:{data:e}})),this.dispatchEvent(new CustomEvent(D)),e);try{if(!this.useStubs)if(this.ownersData.customer.communication.preferences.loadingStatus=xe,this.dispatchEvent(new CustomEvent(D)),this.useCacheData){let r=await this.OwnersCache.cacheGet(fe,{maxAge:G});r?t(r):e()}else e()}catch(e){console.error("OWNERS: acquireCustomerCommunicationPreferences() error: ",e)}}getCustomerCommunicationProfile(){return"loaded"!==this.ownersData.customer.communication.profile.loadingStatus?this.customerCommunicationProfilePromise?this.customerCommunicationProfilePromise:this.customerCommunicationProfilePromise=this.acquireCustomerCommunicationProfile():async()=>this.ownersData.customer.communication.profile.data}async acquireCustomerCommunicationProfile(){const e=async()=>{try{if(this.authConfig?.b2c?.authKey){await r.g.tcom_v2.pipeline.priority3;const e=await r.g.tcom_v2.callService("getTOCustomerCommunicationProfile",{authKey:this.authConfig.b2c.authKey});e&&t(e)}}catch(e){console.error("OWNERS: acquireCustomerCommunicationProfile() acquireProfileFromApi() error: ",e)}},t=e=>(this.OwnersCache.cacheSet(me,e),this.ownersData.customer.communication.profile.data=e,this.dispatchEvent(new CustomEvent(T,{detail:{data:e}})),this.ownersData.customer.communication.profile.loadingStatus="loaded",this.dispatchEvent(new CustomEvent(a.EVENT_CUSTOMER_COMMUNICATION_PROFILE_LOADING_STATUS_CHANGED)),e);try{if(this.useStubs)return;if(this.ownersData.customer.communication.profile.loadingStatus=xe,this.dispatchEvent(new CustomEvent(b)),this.useCacheData){let r=await this.OwnersCache.cacheGet(me,{maxAge:G});r?t(r):e()}else e()}catch(e){console.error("OWNERS: acquireCustomerCommunicationProfile() error: ",e)}}async getUserProfileLimit(){try{const e=await fetch(i.Fu,{method:"POST",headers:{origin:window.location.origin,"x-brand":"T","x-client":"TCOM","x-domain-token":await this.getCaptchaToken(),authorization:tcom_v2.login.getToken()}}),t=await e.json();return"200"===t?.status?.code?t?.userInfo:{}}catch(e){return console.error(e),{}}}async getSearchInteractiveManuals(e,t){const r=encodeURIComponent(this.getNormalizedModelName(e));try{const e=await fetch(((e,t)=>`/service/tcom/manualswarrantiesdetails/${e}/${t}`)(r,t),{headers:{xauthToken:await this.getCaptchaToken()}});return await e.json()}catch(e){return[]}}async getManualTableOfContents(e,t){const r=encodeURIComponent(this.getNormalizedModelName(e));try{const e=((e,t)=>`/service/tcom/ownersManuals/${e}/${t}`)(r,t),a=await fetch(e,{headers:{xauthToken:await this.getCaptchaToken()}});return await a.json()}catch(e){return console.error(e),[]}}async getManualWarranties(e,t){const r=encodeURIComponent(this.getNormalizedModelName(e).toLowerCase()),a=MANUALS_WARRANTIES_URL(r,t),n=await fetch(a,{headers:{xauthToken:await this.getCaptchaToken()}}),s=await n.json();return s?.data}getVehicleByVin(e){return e?this.acquireVehicleByVin(e):null}async acquireVehicleByVin(e){let t=e;const a=async e=>{if(void 0!==e&&(t=e),this.authConfig?.b2c?.authKey&&t){const e=await r.g.tcom_v2.callService("postTOVehicle",{authKey:this.authConfig.b2c.authKey,vin:t});e&&(this.useCacheData&&await this.OwnersCache.cacheSet(he(t),e),n(e))}},n=e=>{this.ownersData.currentVehicle.byVin={data:e,loadingStatus:"loaded"},this.dispatchEvent(new CustomEvent(g,{detail:{data:e}})),this.dispatchEvent(new CustomEvent(p))};try{if(this.ownersData.currentVehicle.byVin.loadingStatus=xe,this.dispatchEvent(new CustomEvent(p)),this.useCacheData){let e=await this.OwnersCache.cac
1heGet(he(t),{maxAge:J});e?n(e):a(t)}else a(t)}catch(e){console.error("OWNERS: acquireVehicleByVin() error: ",e)}}getVehicleSelfByVin(e,t="third",r=!0,a=!1){this.store&&this.store.dispatch(ua({vin:e,serviceType:t,refresh:r}))}async addServiceRecord(e,t,a="third"){try{if(this.authConfig?.b2c?.authKey&&e&&t){const n=await r.g.tcom_v2.callService("postTOServiceRecord",{authKey:this.authConfig.b2c.authKey,serviceRecord:e,serviceType:a,vin:t});return this.getVehicleSelfByVin(t,a,!0),n}}catch(e){console.error("OWNERS: addServiceRecord() error: ",e)}}async setPreferredDealer({vin:e,dealerCode:t}){try{if(this.authConfig?.b2c?.authKey&&t&&e){const a=await r.g.tcom_v2.callService("postTOPreferredDealer",{authKey:this.authConfig.b2c.authKey,dealerCode:t,vin:e});return 200===a?.statusCode&&this.getVehicleDealer(e,!0),a}}catch(e){console.error("OWNERS: setPreferredDealer() error: ",e)}}async updateVehicleNickname({vin:e,nickName:t}){try{if(this.authConfig?.b2c?.authKey&&e){var r={nickName:t};const a=await fetch((0,i.IP)(e),{method:"PATCH",headers:{"Content-Type":"application/json; charset=utf-8","x-brand":"T",authorization:this.authConfig.b2c.authKey},body:JSON.stringify(r)});return 200===a?.status&&this.getAvailableVehiclesData(!0),a}}catch(e){console.log("OWNERS: updateNickname() error: ",e)}}async removeVehicle({vin:e,reason:t,date:r=""}){try{if(this.authConfig?.b2c?.authKey&&e&&t){const r=await fetch((0,i.Zs)(e,t),{method:"DELETE",headers:{"Content-Type":"application/json; charset=utf-8","x-brand":"T",authorization:this.authConfig.b2c.authKey}});return 200!==r?.status&&404!==r?.status||this.getAvailableVehiclesData(!0),r}}catch(e){console.log("OWNERS: removeVehicle() error: ",e)}}async getVehicleDrivers({vin:e,refresh:t=!1}){this.store&&this.store.dispatch(Tr({vin:e,refresh:t}))}async addVehicleDriver({vin:e,tmsGuid:t}){try{if(this.authConfig?.b2c?.authKey&&e&&t){await r.g.tcom_v2.pipeline.preflight;const a=await r.g.tcom_v2.callService("postTOVehicleDriver",{authKey:this.authConfig.b2c.authKey,vin:e,tmsGuid:t});return 200!==a?.status&&null===a?.data?.customer?.customerId||this.getAvailableVehiclesData(!0),a}}catch(e){console.error("OWNERS: addVehicleDriver() error: ",e)}}async addCustomer({vin:e,firstName:t,lastName:a,email:n,phoneNumber:s,vehicleDisplayName:i,ownerFirstName:o}){try{if(this.authConfig?.b2c?.authKey&&e&&t&&a&&n&&s&&i&&o){return await r.g.tcom_v2.callService("postTOCustomer",{authKey:this.authConfig.b2c.authKey,vin:e,firstName:t,lastName:a,email:n,phoneNumber:s,vehicleDisplayName:i,ownerFirstName:o})}}catch(e){console.error("OWNERS: addCustomer() error: ",e)}}async deleteVehicleDriver({vin:e,tmsGuid:t}){try{if(this.authConfig?.b2c?.authKey&&e&&t){const a={driverTmsGuid:t};await r.g.tcom_v2.pipeline.preflight;const n=await fetch((0,i.PC)(e),{method:"DELETE",headers:{"Content-Type":"application/json; charset=utf-8","x-brand":"T",authorization:this.authConfig.b2c.authKey},body:JSON.stringify(a)});return 200!==n?.status&&404!==n?.status||this.getVehicleDrivers({vin:e,refresh:!0}),n}}catch(e){console.error("OWNERS: deleteVehicleDriver() error: ",e)}}async updateServiceRecord(e,t,r){try{if(this.authConfig?.b2c?.authKey&&e&&t&&r){const a=await fetch((0,i.zS)(r,t),{method:"PATCH",headers:{"Content-Type":"application/json; charset=utf-8","x-brand":"T",authorization:this.authConfig.b2c.authKey},body:JSON.stringify(e)});return this.getVehicleSelfByVin(r,void 0,!0),a}}catch(e){console.log("OWNERS: updateServiceRecord() error: ",e)}}getCustomerSubscriptions(){this.store.dispatch(Qe())}getVehicleSubscriptions(e,t=!1,r=!0){this.store&&e&&r&&this.store.dispatch(Oa({vin:e,refresh:t}))}getVehicleDealer(e,t){this.store&&this.store.dispatch(wr({vin:e,refresh:t}))}getVehicleMileageHistory(e,t=!1){this.store&&this.store.dispatch(sa({vin:e,refresh:t}))}getVehicleHealthHistory(e,t=!1,r=!1){if(this.store)return this.store.dispatch(Er({vin:e,refresh:t}))}getVehicleHealthReport(e,t=!1,r=!0){this.store&&e&&r&&this.store.dispatch(Ur({vin:e,refresh:t}))}getWarningLights(e,t){this.store&&this.store.dispatch(ka({model:e,year:t}))}getVehicleRecalls(e,t,r,a){this.store&&this.store.dispatch(Wa({licensePlate:e,state:t,vin:r,token:a}))}checkEmailAvailability(e){this.store&&this.store.dispatch(On({email:e}))}createAccount(e,t,r,a,n,s,i,o,c){this.store&&this.store.dispatch(kn({organizationName:e,customerType:t,email:r,password:a,firstName:n,lastName:s,areaCode:i,phoneNumber:o,businessName:c}))}resetPassword(e,t){this.store&&this.store.dispatch(Hn({password:e,resetCode:t}))}getBz4xVerifyVin(e){this.store&&this.store.dispatch(Ha({vin:e}))}updateCustomerPassword(e,t,r){this.store&&this.store.dispatch(st({password:e,newPassword:t,otpCode:r}))}updateCustomerPersonalInfo(e){this.store&&this.store.dispatch(ut({userData:e}))}updateCustomerPersonalInfoV4(e){this.store&&this.store.dispatch(ht({requestBody:e}))}generateOtp(e){this.store&&this.store.dispatch(qt({requestBody:e}))}validatePassword(e){this.store&&this.store.dispatch($n({requestBody:e}))}validateOtp(e){this.store&&this.store.dispatch(ts({requestBody:e}))}getDealerDetails(e){this.store&&this.store.dispatch(en({refresh:e.refresh,dealerCode:e.dealerCode}))}getVehicleDetailedSpecification(e){this.store&&this.store.dispatch(qa({vin:e}))}
1getVehicleContext(){return this?.store?.getState()?.owners?.context?.data}getCurrentVehicle(){const e=this.getVehicleContext(),t=e?.currentVehicleId;return this.isLoggedIn&&t&&(this?.store?.getState()?.owners?.availableVehicles?.byId||{})[t]}getCurrentVin(){return this.getCurrentVehicle()?.vin}getTransientVehicle(){const e=this.getVehicleContext();return e?.transientInfo}getCurrentModelAndYear(){const e=this.getTransientVehicle(),t=this.getCurrentVehicle()||{},r=t?.model||e?.selectedModel||null;return{year:parseInt(t?.year||e?.selectedYear)||null,model:r}}getAdjustedModelName(e=""){return e.replace(/Plug-in\s?(Hybrid)?/i,"Plug-in Hybrid").replace(/PHV/i,"Plug-in Hybrid").replace(/HV/i,"Hybrid").replace(/Prius C/i,"Prius c").replace(/Prius V/i,"Prius v")}getNormalizedModelName(e=""){return decodeURIComponent(String(e)).replace(/Plug-in Hybrid/i,"PHV").replace(/Hybrid/i,"HV").replace(/Prius C/i,"Prius C").replace(/Prius V/i,"Prius V")}resolveVehicleModelYearListKey(e=""){if(!e)return null;const t=this?.ownersData?.vehicleModelYearList?.data;if(!t)return e;const r=this.getNormalizedModelName(e).toLowerCase(),a=this.getAdjustedModelName(e).toLowerCase();return Object.keys(t).find(t=>t.toLowerCase()===String(e).toLowerCase()||(this.getNormalizedModelName(t).toLowerCase()===r||this.getAdjustedModelName(t).toLowerCase()===a))||e}getVehicleDisplayName(e="",t=""){if(!e)return"";const r=this.resolveVehicleModelYearListKey(e),a=this.getVapiMapping(r,t);return this.getAdjustedModelName(a)}async getVapiMappingData(){if(void 0!==this.vapiMapData)return Promise.resolve();const e="/service/tcom/contentFragmentData/v2/series-mapper";try{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch JSON from ${e} (status: ${t.status})`);const r=await t.json();let a={};if(r&&void 0!==r.seriesMapper){const{seriesMapper:e}=r;if("string"==typeof e)try{a=JSON.parse(e)}catch(e){console.error("Error parsing seriesMapper string as JSON:",e)}else"object"==typeof e&&null!==e?a=e:console.error(`seriesMapper is of an unexpected type: ${typeof e}. Expected string or object.`)}else console.error("seriesMapper key not found in VAPI response.");this.vapiMapData=a}catch(e){return console.error("Error fetching or processing Series Mapper JSON:",e),this.vapiMapData={},null}}getVapiMapping(e="",t=""){const r=`${t} ${e}`;if(console.groupCollapsed("Series Mapping Tool Dataset"),console.table(this.vapiMapData),console.groupEnd(),this.vapiMapData&&Object.prototype.hasOwnProperty.call(this.vapiMapData,r)){const e=this.vapiMapData[r];if(null!=e)return e}return console.warn(`VAPI mapping not found for key: ${r}`),e}isModelSuppressed(e="",t=""){const r=String(e).trim(),a=parseInt(t,10);return Ds.some(e=>r.toLowerCase()===e.match.toLowerCase()&&(!!e.allYears||null!=e.minYear&&!Number.isNaN(a)&&a>=e.minYear))}getAdjustedVehicleModelYearList(){const e=this?.ownersData?.vehicleModelYearList?.data;return e?Object.keys(e).sort((e,t)=>e.toLowerCase()>t.toLowerCase()?1:e.toLowerCase()<t.toLowerCase()?-1:0).reduce((t,r)=>{const a=this.getYearsForModel(e,r).filter(e=>!this.isModelSuppressed(r,e));return a.length?[...t,{name:this.getAdjustedModelName(r),value:r,years:a}]:t},[]):[]}getYearsForModel(e,t){let r=(e[t]||[]).map(String);return"GR Supra"===t&&(r.push(...qs),r=[...new Set(r)]),"Supra"===t&&(r=r.filter(e=>!qs.includes(e))),r}getAdjustedVehicleYearList(){const e=this?.ownersData?.vehicleModelYearList?.data;if(!e)return[];const t=new Set;return Object.keys(e).forEach(r=>{this.getYearsForModel(e,r).forEach(e=>{this.isModelSuppressed(r,e)||t.add(e)})}),[...t].filter(e=>parseInt(e,10)>=1996).sort((e,t)=>parseInt(t,10)-parseInt(e,10))}getVehicleModelListSortKey(e=""){return"toyota crown"===String(e).toLowerCase()?"Crown":"toyota crown signia"===String(e).toLowerCase()?"Crown Signia":e}getAdjustedVehicleModelsForYear(e){const t=this?.ownersData?.vehicleModelYearList?.data;if(!t||!e)return[];const r=String(e);return Object.keys(t).filter(e=>this.getYearsForModel(t,e).includes(r)&&!this.isModelSuppressed(e,r)).sort((e,t)=>{const r=this.getVehicleModelListSortKey(e).toLowerCase(),a=this.getVehicleModelListSortKey(t).toLowerCase();return r>a?1:r<a?-1:0}).map(e=>({name:this.getVehicleDisplayName(e,r),value:e}))}
1getVehicleModelYearListData(){return this.ownersData.vehicleModelYearList===xe?this.vehicleModelYearListDataPromise:this.vehicleModelYearListDataPromise=this.acquireVehicleModelYearListData()}async acquireVehicleModelYearListData(){const e="es"!==window.tcom_v2.i18n.getCurrentLocale()?[{model:"avanza",years:"any"},{model:"cressida",years:"any"},{model:"hilux",years:"any"},{model:"raize",years:"any"}]:[],t=this.getLogger("acquireVehicleModelYearListData"),a=this.getStatusSetter(this.ownersData.vehicleModelYearList,R,t),n=this.getDataSetter(this.ownersData.vehicleModelYearList,S,t);return this.getAcquireData({STUB_DATA:Is.data,acquireFromCache:async()=>{const e=await this.OwnersCache.cacheGet(Re,{maxAge:Z});return t("acquireFromCache:",e),e},acquireFromApi:async()=>{const a=await r.g.tcom_v2.callService("getTOVehicleModelYearList")||await(0,Rs.N)()||ws.data.vehicleModelYearList;if(t("acquireFromApi response:",a),!a)return{};var n;return n=a,Object.entries(n).reduce((t,r)=>{const a=r[0],n=r[1],s=e.reduce((e,t)=>e||a.toLowerCase().includes(t.model)&&t,null);return s?"any"!==s.years&&Array.isArray(s.years)?Object.assign(t,{[a]:n.filter(e=>s.years.includes(parseInt(e)))}):t:Object.assign(t,{[a]:n})},{})},cacheSetter:e=>{e&&(t("setCache:",e),this.OwnersCache.cacheSet(Re,e))},dataSetter:n,statusSetter:a,logger:t})}getAvailableVehiclesData(e=!1){return this.store.dispatch(un({refresh:e}))}async getCurrentVehicleJellyImageSrc({useThreeD:e=!1,threeDProfile:t="680_383_PNG"}={}){const r=this.getCurrentVehicle();if(!r)return"";const a=r.year,n=r.model,s=`0${r.exteriorColorCode}`,i=r.modelCode;return await this.getJellyImageSrc({year:a,model:n,vehicleModelCode:i,vehicleExteriorColorCode:s})}async getJellyImageSrc(e,t,r,a,n=!1,s="680_383_PNG"){const i=await this.getJelliesImages(e,t),o=Object.keys(i||{}).length>0,c=i?.category?.length?this.ownersData?.jellyImages?.default[i.category[0]]:this.ownersData?.jellyImages?.default["Cars & Minivan"],l=o&&Object.keys(i.model)||["default"],d=o&&(r||"")in i.model?r:l[0],u=o?a&&Object.keys(i?.model[d]?.exteriorcolor)?.includes(a)?a:Object.keys(i?.model[d]?.exteriorcolor)[0]:"default"===d?"default":Object.keys(i?.model[d]?.exteriorcolor)[0],h="default"===d||"default"===u?{year:e,model:{[d]:{code:d,exteriorcolor:{[u]:{code:u,carjellyimage:c,"3dimage":{"380_214_PNG":{1:[c]},"680_383_PNG":{1:[c]},"864_477_PNG":{1:[c]},"1200_663_JPG":{1:[c]},"1200_663_PNG":{1:[c]}}}}}}}.model[d].exteriorcolor[u]:i.model[d].exteriorcolor[u],g=n&&"3dimage"in h&&s in h["3dimage"]&&"1"in h["3dimage"][s]&&h["3dimage"][s][1][0]||h.carjellyimage,p=tcom_env?.services?.owners?.host||"toyota.com";return g.toLowerCase().includes("_generic_")?g:["https://",p,g].join("")}getJelliesImages(e,t){const r=[e,t].join("_").replace(/\s/g,"_"),a=this.vehicleJelliesPromise,n=a&&this.vehicleJelliesPromise[r];return a||(this.vehicleJelliesPromise={}),n||(this.vehicleJelliesPromise[r]={}),n||(this.vehicleJelliesPromise[r]=this.acquireJelliesImagesData(e,t,r)),this.vehicleJelliesPromise[r]}async acquireJelliesImagesData(e,t,a){const n=this.ownersData.jellyImages[a],s=n&&this.ownersData.jellyImages[a].loadingStatus;n||(this.ownersData.jellyImages[a]={}),s||(this.ownersData.jellyImages[a].loadingStatus=Oe);const i=this.getLogger("acquireJelliesImagesData"),o=this.getStatusSetter(this.ownersData.jellyImages[a],x,i),c=this.getDataSetter(this.ownersData.jellyImages[a],O,i);return this.getAcquireData({STUB_DATA:{},acquireFromCache:async()=>{const e=await this.OwnersCache.cacheGet(Se(a),{maxAge:J});return i("acquireFromCache:",e),e},acquireFromApi:async()=>{const a=this.getAdjustedModelName(t).replace(/GR Supra/gi,"Supra").replace(/GRSupra/gi,"Supra").replace(/Sienna.*Hybrid/gi,"Sienna").toLowerCase(),n=await r.g.tcom_v2.callService("getTOImages",{year:e,model:a});return n||null},cacheSetter:e=>{e&&(i("setCache:",e),this.OwnersCache.cacheSet(Se(a),e))},dataSetter:c,statusSetter:o,logger:i})}async initSessionData(){let e={};const t=JSON.parse(window.sessionStorage.getItem(Y));e.config=t||null;const r=JSON.parse(window.sessionStorage.getItem(F));if(r){let t=r.persistentInfo||null;if(e.context=t,null!=t&&(this.currentVehicleId=t.profile?.prefVehicleId||null),null!==this.currentVehicleId)for(var a=this.ownersD
1ata.availableVehicles?.data?.length;a--;)this.ownersData.availableVehicles.data[a].vehicleId==this.currentVehicleId&&(this.ownersData.currentVehicle.details.data=this.ownersData.availableVehicles.data[a]);else this.ownersData.currentVehicle.details.data=null}return e}addVehicle({siteKey:e,action:t,vin:r}){this.addVehicleVIN=r,this.getCaptchaToken(e,t,j)}setPreferredVehicleApiCall(e,t){this.store&&this.store.dispatch($t({dataPackage:e,refresh:t}))}setPreferredVehicle({vehicleId:e,model:t,year:r,vin:a}){let n;n=a?{vin:a}:{vehicleId:e,model:t,year:r},this.setPreferredVehicleApiCall(n,!1)}setSessionVehicleId(e){let t=JSON.parse(window.sessionStorage.getItem(F));t||(t={}),t.persistentInfo||(t.persistentInfo={}),t.persistentInfo.profile||(t.persistentInfo.profile={}),t.persistentInfo.profile.prefVehicleId=e;const r=JSON.stringify(t);window.sessionStorage.setItem(F,r)}async setCurrentVehicleById(e,t=null,r=""){this.store.dispatch(Sn({vehicleId:e,vin:t})),this.setTransientInfo({model:null,year:null}),this.setSessionVehicleId(e);const a=(this.store.getState().owners?.availableVehicles?.entities||[]).find(t=>t.vehicleId==e);a&&(this.setPreferredVehicle(a),this.dispatchEvent(new CustomEvent(h,{detail:{vehicle:a,eventSource:r}})))}async clearCurrentVehicle(){this.ownersData.currentVehicle={dealer:{data:null,loadingStatus:Oe},details:{data:null,loadingStatus:Oe},engineTransmissionDrive:{data:null,loadingStatus:Oe},maintenanceSchedule:{data:null,loadingStatus:Oe},maintenanceScheduled:{data:null,loadingStatus:Oe},manual:{data:null,loadingStatus:Oe},safetyCampaigns:{data:null,loadingStatus:Oe},serviceOpCodes:{data:null,loadingStatus:Oe},serviceRecords:{data:null,loadingStatus:Oe},subscriptions:{data:null,loadingStatus:Oe},telematics:{},toyotaCare:{},vehicleHealthReport:{data:null,loadingStatus:Oe},vehicleHealthHistory:{data:null,loadingStatus:Oe},vehicleMileageHistory:{data:null,loadingStatus:Oe},jelliesImages:{data:null,loadingStatus:Oe},vehicleSpecification:{data:null,loadingStatus:Oe}},await this.OwnersCache.cacheClear(),this.dispatchEvent(new CustomEvent(a.EVENT_VEHICLE_CHANGED,{detail:{vehicle:this.ownersData.currentVehicle.details.data}}))}}var Vs=bs},34352:function(e,t,r){async function a(e="login"){const t=window?.tcom_env?.services?.google?.siteKey||null;try{if(null==t||""===t)throw new Error("NO MY TOYOTA GOOGLE SITE KEY CONFIGURED");let r=await(async()=>new Promise((r,a)=>{grecaptcha.enterprise.ready(function(){grecaptcha.enterprise.execute(t,{action:e}).then(function(e){return console.log("getToken() -> TOKEN",e),r(e)})})}))();if(r)return r}catch(e){return console.log("getCaptchaToken() -> err: ",e),e}}r.r(t),r.d(t,{default:function(){return a}})},83837:function(e,t,r){var a=r(25330),n=r(21524);t.default=(0,a.default)(()=>({cache:!1,url:(0,n.sQ)(),parser:e=>e.data?.vehicleModelYearList,method:"get",dataType:"json",headers:{"Content-type":"application/json; charset=UTF-8","x-brand":"T"}}));r.d(t,["N",0,async()=>{try{const e=`${n.Qz}/model-year-list`,t=await fetch(e),r=await t.json();return r?.vehicleModelYearList&&JSON.parse(r.vehicleModelYearList)}catch(e){console.error(e)}return null}])}}]); 2//# sourceMappingURL=7783.90ac4e567584b57eb299.js.map
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.