1import{h as V,aW as P,by as v}from"./index-06f66214.js";import w from"./TmlInput-108ccfb6.js";import h from"./TmlCountryPicker-5096581d.js";import q from"./TmlStatePicker-e3539373.js";import{B as m,E as n,M as o,Q as i,R as d,L as C,N as u}from"./vue-03075d31.js";import{A as f}from"./address-9859a6a1.js";import"./gtm-50ee8968.js";import"./sentry-c8447f6c.js";import"./faCheck-82f2f90a.js";import"./faTimes-f5dbc420.js";import"./faPlus-77102fcf.js";import"./faMinus-92960827.js";import"./faArrowRight-43a8a2b1.js";import"./faUndo-5ef0344f.js";import"./TmlNewSelect-250e1b34.js";import"./faTimes-e77a6424.js";import"./faSearch-afb9bee8.js";import"./form-field-c23da7c4.js";import"./debounce-03444de6.js";import"./scrollToElement-a2c1a898.js";import"./isEqual-e812493e.js";const F={name:"TmlAddressForm",components:{TmlItemTray:P,TmlInput:w,TmlCountryPicker:h,TmlStatePicker:q},props:{fieldNamePrefix:{type:String,required:!0},address:{type:f,default:new f},showNameFields:{type:Boolean,default:!1},showCompanyField:{type:Boolean,default:!1}},data(){return{isStateRequired:!1}},computed:{stateLabel(){const l="County/State";return this.isStateRequired?l+"*":l}},methods:{onCountryChange(l,t){this.address.country=l,this.isStateRequired=!!(t!=null&&t.strictStates),this.address.state=null},async validate(){const l=await this.$refs.addressForm.validateAll(),t=await v.validate(`${this.fieldNamePrefix}_new_form`,"form");return l&&t}},expose:["validate"]};function k(l,t,e,S,_,s){const r=m("tml-input"),y=m("tml-item-tray"),x=m("tml-country-picker"),p=m("tml-state-picker"),c=m("tml-new-form"),N=m("tml-form");return n(),o(N,{ref:"addressForm","form-name":`${e.fieldNamePrefix}_form`},{default:i(()=>[d(c,{ref:"addressNewForm",name:`${e.fieldNamePrefix}_new_form`},{default:i(()=>[C(l.$slots,"extra-fields-before",{fieldNamePrefix:e.fieldNamePrefix}),e.showNameFields?(n(),o(y,{key:0},{primary:i(()=>[d(r,{modelValue:e.address.firstName,"onUpdate:modelValue":t[0]||(t[0]=a=>e.address.firstName=a),"field-name":`${e.fieldNamePrefix}_first_name_input`,placeholder:"First Name*",type:"text","validation-rules":{required:!0,max_length:25}},null,8,["modelValue","field-name"])]),secondary:i(()=>[d(r,{modelValue:e.address.lastName,"onUpdate:modelValue":t[1]||(t[1]=a=>e.address.lastName=a),"field-name":`${e.fieldNamePrefix}_last_name_input`,placeholder:"Surname*",type:"text","validation-rules":{required:!0,max_length:25}},null,8,["modelValue","field-name"])]),_:1})):u("",!0),e.showCompanyField?(n(),o(r,{key:1,modelValue:e.address.company,"onUpdate:modelValue":t[2]||(t[2]=a=>e.address.company=a),"field-name":`${e.fieldNamePrefix}_company_input`,placeholder:"Company*",type:"text","validation-rules":{required:!0,max_length:100}},null,8,["modelValue","field-name"])):u("",!0),d(r,{modelValue:e.address.streetAddress,"onUpdate:modelValue":t[3]||(t[3]=a=>e.address.streetAddress=a),"field-name":`${e.fieldNamePrefix}_street_address_input`,placeholder:"Address*",type:"text","validation-rules":{required:!0,max_length:105}},null,8,["modelValue","field-name"]),d(r,{modelValue:e.address.city,"onUpdate:modelValue":t[4]||(t[4]=a=>e.address.city=a),"field-name":`${e.fieldNamePrefix}_city_input`,placeholder:"Town/City*",type:"text","validation-rules":{required:!0,max_length:30}},null,8,["modelValue","field-name"]),d(r,{modelValue:e.address.zip,"onUpdate:modelValue":t[5]||(t[5]=a=>e.address.zip=a),"field-name":`${e.fieldNamePrefix}_zip_input`,placeholder:"Postcode*",type:"text","validation-rules":{required:!0,max_length:10}},null,8,["modelValue","field-name"]),d(x,{value:e.address.country,"field-name-prefix":e.fieldNamePrefix,label:"Country*","validation-rules":{required:!0},onInput:s.onCountryChange},null,8,["value","field-name-prefix","onInput"]),d(p,{value:e.address.state,"field-name-prefix":e.fieldNamePrefix,label:s.stateLabel,"country-code":e.address.country,required:_.isStateRequired,onInput:t[6]||(t[6]=a=>e.address.state=a)},null,8,["value","field-name-prefix","label","country-code","required"])]),_:3},8,["name"])]),_:3},8,["form-name"])}const X=V(F,[["render",k]]);export{X as default}; 2//# sourceMappingURL=TmlAddressForm-7a8f8c3f.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.