(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-85f08b88"],{"0ab4b":function(e,t,a){"use strict";(function(e){var o=a("9ab4"),n=a("7a23"),l=a("7bb1"),c=a("fd34"),r=a("506a"),d=a("2dad"),s=a("f44b"),i=a("9b23"),u=a("6c02"),b=a("0251");t["a"]=Object(n["defineComponent"])({name:"address-form",components:{Form:l["c"],Toggle:d["a"]},setup:function(){var t,a=this,l=Object(n["ref"])({lat:11.578956353229527,lng:104.88878130912781}),d=Object(u["c"])(),v=Object(u["d"])(),m=Object(n["ref"])({}),f=(Object(b["useI18n"])().t,Object(n["ref"])(null)),O=Object(n["ref"])({form:!1,submit:!1}),p=Object(n["ref"])({map:!1}),j=null===(t=null===e||void 0===e?void 0:Object({VUE_APP_NAME:"Logistic",VUE_APP_VERSION:"1.0",VUE_APP_FULL_NAME:" Management",VUE_APP_API_URL:"https://api-ecos.codexcambodia.com",VUE_APP_SASS_COMPONENTS_PATH:"src/assets/sass/core/components",VUE_APP_SHOP_ID:"2",VUE_APP_I18N_LOCALE:"en",VUE_APP_I18N_FALLBACK_LOCALE:"en",VUE_APP_GOOGEL_MAP_KEY:"AIzaSyClBV26hepUt322B30vfn850MB3VVFbeSg",VUE_APP_GOOGLE_KEY:"991837647433-qhhqvg5f48s0oh8rb5otu3uo51ioh166.apps.googleusercontent.com",VUE_APP_FACEBOOK_KEY:"1043312742928130",NODE_ENV:"production",VUE_APP_GOOGLE_MAP_KEY:"AIzaSyClBV26hepUt322B30vfn850MB3VVFbeSg",BASE_URL:"/"}))||void 0===t?void 0:t.VUE_APP_GOOGEL_MAP_KEY,g=Object(n["computed"])((function(){return void 0!==d.params.addressId})),V=Object(n["computed"])((function(){return d.params.addressId})),h=Object(n["ref"])({position:l}),_=Object(n["ref"])({lat:11.578956353229527,lng:104.88878130912781}),N=Object(n["ref"])({position:_}),E=r["a"]().shape({name:r["c"]().required("Required").label("Name"),address:r["c"]().required("Required").label("Address")}),w=function(e,t){var n=t.resetForm;return Object(o["b"])(a,void 0,void 0,(function(){var e;return Object(o["e"])(this,(function(t){switch(t.label){case 0:return O.value.submit=!0,e="",g.value?[4,Object(i["f"])(m.value).then((function(t){e=t.data.message}))]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,Object(i["d"])(m.value).then((function(t){var a;e=t.data.message,f.value=null===(a=t.data)||void 0===a?void 0:a.current_save_id}))];case 3:t.sent(),n(),t.label=4;case 4:return O.value.submit=!1,Object(s["g"])({type:"success",message:null!==e&&void 0!==e?e:"Success"}),[2]}}))}))},A=function(){return Object(o["b"])(a,void 0,void 0,(function(){var e;return Object(o["e"])(this,(function(t){switch(t.label){case 0:return O.value.form=!0,[4,Object(i["e"])({addressId:V.value})];case 1:return e=t.sent(),m.value=e.data.data,l.value={lat:m.value.lat,lng:m.value.lng},O.value.form=!1,[2]}}))}))},S=function(e){m.value.lat=e.latLng.lat(),m.value.lng=e.latLng.lng(),l.value={lat:m.value.lat,lng:m.value.lng},U(l)},P=function(e){_.value.lat=e.latLng.lat(),_.value.lng=e.latLng.lng()},y=function(e){N.value.position={lat:e.geometry.location.lat(),lng:e.geometry.location.lng()},m.value.lat=l.value.lat,m.value.lng=l.value.lng};function x(){navigator.geolocation?navigator.geolocation.getCurrentPosition((function(e){h.value.position=l.value={lat:e.coords.latitude,lng:e.coords.longitude},m.value.lat=e.coords.latitude,m.value.lng=e.coords.longitude,U(_)}),(function(e){console.log("%cForm.vue line:335 error","color: #007acc;",e)})):console.log("Geolocation is not supported by this browser.")}var M=function(){p.value.map=!p.value.map},C=function(){h.value.position=l.value={lat:_.value.lat,lng:_.value.lng},m.value.lat=_.value.lat,m.value.lng=_.value.lng,U(_),L()},D=Object(n["ref"])(!1);function k(){D.value=!0}function L(){D.value=!1}var U=function(e){var t=new google.maps.Geocoder;t.geocode({location:e.value},(function(e){m.value.address=e[0].formatted_address}))};return Object(n["onMounted"])((function(){Object(c["a"])("Settings",["Account"]),g.value?A():(m.value.is_default=!0,x())})),{onSubmitAddress:w,addressValidate:E,addressDetails:m,route:d,center:l,googleMapKey:j,moveMarker:S,marker:h,setPlace:y,loading:O,isEdit:g,show:p,showMap:M,moveMarkerModal:P,submitModal:C,markerModal:N,centerModal:_,showModal:k,closeModal:L,isShow:D,router:v,currentSavedId:f}}})}).call(this,a("4362"))},"2fb5":function(e,t,a){"use strict";a("3bac")},"3bac":function(e,t,a){},"5a7b":function(e,t,a){"use strict";a("a305")},7245:function(e,t,a){"use strict";a.r(t);var o=a("82ea"),n=a("2101"),l=a("7461"),c=a("86db"),r=a("6075"),d=a("7a23"),s=function(e){return Object(d["pushScopeId"])("data-v-1bac19ec"),e=e(),Object(d["popScopeId"])(),e},i={class:"col-xxs-12 col-md-6 translate_center w-100"},u={class:"second_main_div"},b={class:"card mb-5 mb-xl-10 col"},v={class:"card-header border-0 cursor-pointer",role:"button","data-bs-toggle":"collapse","data-bs-target":"#kt_account_profile_details","aria-expanded":"true","aria-controls":"kt_account_profile_details"},m={class:"card-title m-0 d-flex justify-content-between w-100"},f={class:"fw-bolder m-0"},O={id:"kt_account_settings_profile_details",class:"collapse show"},p={class:"card-body border-top"},j={class:"row"},g={class:"col-lg-12 fv-row fv-plugins-icon-container"},V={class:"mb-10"},h={class:"form-label"},_=s((function(){return Object(d["createElementVNode"])("span",{class:"text-danger"},"*",-1)})),N={class:"form-label"},E=s((function(){return Object(d["createElementVNode"])("span",{class:"text-danger"},"*",-1)})),w={class:"form-label",style:{"font-family":"'Open Sans'","font-style":"normal","font-weight":"400","line-height":"22px","/* identical to box height */\n\n letter-spacing":"-0.3px",color:"#00af27"},role:"button"},A={class:"col-lg-12 fv-row fv-plugins-icon-container"},S={class:"mb-10"},P={class:"fv-row fv-plugins-icon-container"},y={class:"mb-10"},x={class:"modal-x"},M={class:"fv-row fv-plugins-icon-container"},C={class:"mb-10"},D={class:"fv-row fv-plugins-icon-container"},k={class:"mb-10"},L={class:"fv-row fv-plugins-icon-container"},U={class:"mb-10"},I={class:"form-label"},B={class:"fv-row fv-plugins-icon-container"},$={class:"mb-10"},G={class:"form-label"},T={class:"card-footer d-flex justify-content-end py-6 px-9"},K=s((function(){return Object(d["createElementVNode"])("input",{type:"hidden"},null,-1)})),F=s((function(){return Object(d["createElementVNode"])("div",null,null,-1)}));function q(e,t,a,s,q,z){var Y=o["a"],R=r["a"],H=c["a"],J=l["a"],W=n["a"],Q=Object(d["resolveComponent"])("GMapMarker"),X=Object(d["resolveComponent"])("GMapMap"),Z=Object(d["resolveComponent"])("GMapAutocomplete"),ee=o["a"],te=Object(d["resolveComponent"])("Modal"),ae=Object(d["resolveComponent"])("BaseTextArea"),oe=Object(d["resolveComponent"])("Toggle"),ne=Object(d["resolveComponent"])("Form",!0);return Object(d["openBlock"])(),Object(d["createElementBlock"])("div",i,[Object(d["createElementVNode"])("div",u,[Object(d["createElementVNode"])("div",b,[Object(d["createElementVNode"])("div",v,[Object(d["createElementVNode"])("div",m,[Object(d["createElementVNode"])("h3",f,Object(d["toDisplayString"])(e.isEdit?e.$t("Edit Address"):e.$t("New Address")),1),Object(d["createVNode"])(Y,{showLoading:e.loading.submit,onClick:t[0]||(t[0]=function(t){var a;return null===(a=e.router)||void 0===a?void 0:a.go(-1)})},{default:Object(d["withCtx"])((function(){return[Object(d["createTextVNode"])(Object(d["toDisplayString"])(e.$t("Back")),1)]})),_:1},8,["showLoading"])])]),Object(d["createElementVNode"])("div",O,[Object(d["createVNode"])(ne,{onSubmit:e.onSubmitAddress,class:"form fv-plugins-bootstrap5 fv-plugins-framework","validation-schema":e.addressValidate,onKeypress:t[7]||(t[7]=Object(d["withKeys"])((function(e){return e.preventDefault()}),["enter"]))},{default:Object(d["withCtx"])((function(a){var o=a.errors;return[Object(d["createVNode"])(R,{formLoading:e.loading.form},null,8,["formLoading"]),Object(d["createElementVNode"])("div",p,[Object(d["createElementVNode"])("div",j,[Object(d["createElementVNode"])("div",g,[Object(d["createElementVNode"])("div",V,[Object(d["createElementVNode"])("label",h,[Object(d["createTextVNode"])(Object(d["toDisplayString"])(e.$t("Address Name"))+" ",1),_]),Object(d["createVNode"])(H,{name:"name",type:"text",placeholder:e.$t("Address Name"),modelValue:e.addressDetails.name,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.addressDetails.name=t})},null,8,["placeholder","modelValue"])])]),Object(d["createVNode"])(W,{class:"justify-content-between"},{default:Object(d["withCtx"])((function(){return[Object(d["createElementVNode"])("label",N,[Object(d["createTextVNode"])(Object(d["toDisplayString"])(e.$t("Delivery Address"))+" ",1),E]),Object(d["createVNode"])(W,{onClick:e.showModal},{default:Object(d["withCtx"])((function(){return[Object(d["createVNode"])(J,{iconName:"bi bi-geo-alt",noBorder:"",zeroHW:"",isGreenColor:"",role:"button"}),Object(d["createElementVNode"])("label",w,Object(d["toDisplayString"])(e.$t("Search Map")),1)]})),_:1},8,["onClick"])]})),_:1}),Object(d["createElementVNode"])("div",A,[Object(d["createElementVNode"])("div",S,[Object(d["createVNode"])(H,{name:"address",type:"text",placeholder:e.$t("Your Address"),modelValue:e.addressDetails.address,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.addressDetails.address=t})},null,8,["placeholder","modelValue"])])]),Object(d["createElementVNode"])("div",P,[Object(d["createElementVNode"])("div",y,[Object(d["createVNode"])(X,{center:e.center,zoom:16,"map-type-id":"terrain",style:{width:"100%",height:"250px"}},{default:Object(d["withCtx"])((function(){var t;return[Object(d["createVNode"])(Q,{position:null===(t=e.marker)||void 0===t?void 0:t.position,draggable:!0,onDragend:e.moveMarker},null,8,["position","onDragend"])]})),_:1},8,["center"])])]),Object(d["createVNode"])(te,{modelValue:e.isShow,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.isShow=t}),close:e.closeModal},{default:Object(d["withCtx"])((function(){var t;return[Object(d["createElementVNode"])("div",x,[Object(d["createElementVNode"])("div",M,[Object(d["createElementVNode"])("div",C,[Object(d["createVNode"])(Z,{placeholder:e.$t("Enter a location"),onPlace_changed:e.setPlace,"select-first-on-enter":!0,class:Object(d["normalizeClass"])(["form-control form-control-lg form-control-solid",[(null===(t=null===o||void 0===o?void 0:o.address)||void 0===t?void 0:t.length)>0&&"is-invalid border border border-danger"]])},null,8,["placeholder","onPlace_changed","class"])])]),Object(d["createElementVNode"])("div",D,[Object(d["createElementVNode"])("div",k,[Object(d["createVNode"])(X,{center:e.centerModal,zoom:16,"map-type-id":"terrain",style:{width:"100%",height:"250px"}},{default:Object(d["withCtx"])((function(){var t;return[Object(d["createVNode"])(Q,{position:null===(t=e.markerModal)||void 0===t?void 0:t.position,draggable:!0,onDragend:e.moveMarkerModal},null,8,["position","onDragend"])]})),_:1},8,["center"])])]),Object(d["createVNode"])(ee,{class:"w-100",onClick:e.submitModal},{default:Object(d["withCtx"])((function(){return[Object(d["createTextVNode"])(Object(d["toDisplayString"])(e.$t("Submit")),1)]})),_:1},8,["onClick"])])]})),_:2},1032,["modelValue","close"]),Object(d["withDirectives"])(Object(d["createElementVNode"])("div",L,[Object(d["createElementVNode"])("div",U,[Object(d["createElementVNode"])("label",I,Object(d["toDisplayString"])(e.$t("Address")),1),Object(d["createVNode"])(ae,{name:"address",type:"text",placeholder:e.$t("Address"),modelValue:e.addressDetails.address,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.addressDetails.address=t})},null,8,["placeholder","modelValue"])])],512),[[d["vShow"],!1]]),Object(d["createElementVNode"])("div",B,[Object(d["createElementVNode"])("div",$,[Object(d["createElementVNode"])("label",G,Object(d["toDisplayString"])(e.$t("Default Address")),1),Object(d["createVNode"])(oe,{modelValue:e.addressDetails.is_default,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.addressDetails.is_default=t}),class:"form-control form-control-lg form-control-solid"},null,8,["modelValue"])])])])]),Object(d["createElementVNode"])("div",T,[Object(d["withDirectives"])(Object(d["createVNode"])(Y,{showLoading:e.loading.submit,onClick:t[6]||(t[6]=function(t){var a;return null===(a=e.router)||void 0===a?void 0:a.push({name:"checkout",query:{current_save_id:e.currentSavedId}})})},{default:Object(d["withCtx"])((function(){return[Object(d["createTextVNode"])(Object(d["toDisplayString"])(e.$t("Back to Order")),1)]})),_:1},8,["showLoading"]),[[d["vShow"],e.currentSavedId]]),Object(d["createVNode"])(Y,{showLoading:e.loading.submit},{default:Object(d["withCtx"])((function(){return[Object(d["createTextVNode"])(Object(d["toDisplayString"])(e.$t("Save")),1)]})),_:1},8,["showLoading"])]),K,F]})),_:1},8,["onSubmit","validation-schema"])])])])])}var z=a("0ab4b"),Y=(a("5a7b"),a("2fb5"),a("d959")),R=a.n(Y);const H=R()(z["a"],[["render",q],["__scopeId","data-v-1bac19ec"]]);t["default"]=H},a305:function(e,t,a){}}]); //# sourceMappingURL=chunk-85f08b88.09a4ef9e.js.map