(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4328],{4798:function(e,a,n){"use strict";n.d(a,{Rr:function(){return v},Wf:function(){return m},qz:function(){return l}});let l=[{value:"ALLY",name:"ALLEY"},{value:"ALWY",name:"ALLEYWAY"},{value:"AMBL",name:"AMBLE"},{value:"ANCG",name:"ANCHORAGE"},{value:"APP",name:"APPROACH"},{value:"ARC",name:"ARCADE"},{value:"ART",name:"ARTERY"},{value:"AVE",name:"AVENUE"},{value:"BASN",name:"BASIN"},{value:"BCH",name:"BEACH"},{value:"BEND",name:"BEND"},{value:"BLK",name:"BLOCK"},{value:"BVD",name:"BOULEVARD"},{value:"BRCE",name:"BRACE"},{value:"BRAE",name:"BRAE"},{value:"BRK",name:"BREAK"},{value:"BDGE",name:"BRIDGE"},{value:"BDWY",name:"BROADWAY"},{value:"BROW",name:"BROW"},{value:"BYPA",name:"BYPASS"},{value:"BYWY",name:"BYWAY"},{value:"CAUS",name:"CAUSEWAY"},{value:"CTR",name:"CENTRE"},{value:"CNWY",name:"CENTREWAY"},{value:"CH",name:"CHASE"},{value:"CIR",name:"CIRCLE"},{value:"CLT",name:"CIRCLET"},{value:"CCT",name:"CIRCUIT"},{value:"CRCS",name:"CIRCUS"},{value:"CL",name:"CLOSE"},{value:"CLDE",name:"COLONNADE"},{value:"CMMN",name:"COMMON"},{value:"CON",name:"CONCOURSE"},{value:"CPS",name:"COPSE"},{value:"CNR",name:"CORNER"},{value:"CSO",name:"CORSO"},{value:"CT",name:"COURT"},{value:"CTYD",name:"COURTYARD"},{value:"COVE",name:"COVE"},{value:"CRES",name:"CRESCENT"},{value:"CRST",name:"CREST"},{value:"CRSS",name:"CROSS"},{value:"CRSG",name:"CROSSING"},{value:"CRD",name:"CROSSROAD"},{value:"COWY",name:"CROSSWAY"},{value:"CUWY",name:"CRUISEWAY"},{value:"CDS",name:"CUL-DE-SAC"},{value:"CTTG",name:"CUTTING"},{value:"DALE",name:"DALE"},{value:"DELL",name:"DELL"},{value:"DEVN",name:"DEVIATION"},{value:"DIP",name:"DIP"},{value:"DSTR",name:"DISTRIBUTOR"},{value:"DR",name:"DRIVE"},{value:"DRWY",name:"DRIVEWAY"},{value:"EDGE",name:"EDGE"},{value:"ELB",name:"ELBOW"},{value:"END",name:"END"},{value:"ENT",name:"ENTRANCE"},{value:"ESP",name:"ESPLANADE"},{value:"EST",name:"ESTATE"},{value:"EXP",name:"EXPRESSWAY"},{value:"EXTN",name:"EXTENSION"},{value:"FAWY",name:"FAIRWAY"},{value:"FTRK",name:"FIRE"},{value:"FITR",name:"FIRETRAIL"},{value:"FLAT",name:"FLAT"},{value:"FOLW",name:"FOLLOW"},{value:"FTWY",name:"FOOTWAY"},{value:"FSHR",name:"FORESHORE"},{value:"FORM",name:"FORMATION"},{value:"FWY",name:"FREEWAY"},{value:"FRNT",name:"FRONT"},{value:"FRTG",name:"FRONTAGE"},{value:"GAP",name:"GAP"},{value:"GDN",name:"GARDEN"},{value:"GTE",name:"GATE"},{value:"GDNS",name:"GARDENS"},{value:"GTES",name:"GATES"},{value:"GLD",name:"GLADE"},{value:"GLEN",name:"GLEN"},{value:"GRA",name:"GRANGE"},{value:"GRN",name:"GREEN"},{value:"GRND",name:"GROUND"},{value:"GR",name:"GROVE"},{value:"GLY",name:"GULLY"},{value:"HTS",name:"HEIGHTS"},{value:"HRD",name:"HIGHROAD"},{value:"HWY",name:"HIGHWAY"},{value:"HILL",name:"HILL"},{value:"INTG",name:"INTERCHANGE"},{value:"INTN",name:"INTERSECTION"},{value:"JNC",name:"JUNCTION"},{value:"KEY",name:"KEY"},{value:"LDG",name:"LANDING"},{value:"LANE",name:"LANE"},{value:"LNWY",name:"LANEWAY"},{value:"LEES",name:"LEES"},{value:"LINE",name:"LINE"},{value:"LINK",name:"LINK"},{value:"LT",name:"LITTLE"},{value:"LKT",name:"LOOKOUT"},{value:"LOOP",name:"LOOP"},{value:"LWR",name:"LOWER"},{value:"MALL",name:"MALL"},{value:"MNDR",name:"MEANDER"},{value:"MEW",name:"MEW"},{value:"MEWS",name:"MEWS"},{value:"MWY",name:"MOTORWAY"},{value:"MT",name:"MOUNT"},{value:"NOOK",name:"NOOK"},{value:"OTLK",name:"OUTLOOK"},{value:"PDE",name:"PARADE"},{value:"PARK",name:"PARK"},{value:"PKLD",name:"PARKLANDS"},{value:"PKWY",name:"PARKWAY"},{value:"PART",name:"PART"},{value:"PASS",name:"PASS"},{value:"PATH",name:"PATH"},{value:"PHWY",name:"PATHWAY"},{value:"PIAZ",name:"PIAZZA"},{value:"PL",name:"PLACE"},{value:"PLAT",name:"PLATEAU"},{value:"PLZA",name:"PLAZA"},{value:"PKT",name:"POCKET"},{value:"PNT",name:"POINT"},{value:"PORT",name:"PORT"},{value:"PROM",name:"PROMENADE"},{value:"QUAD",name:"QUAD"},{value:"QDGL",name:"QUADRANGLE"},{value:"QDRT",name:"QUADRANT"},{value:"QY",name:"QUAY"},{value:"QYS",name:"QUAYS"},{value:"RMBL",name:"RAMBLE"},{value:"RAMP",name:"RAMP"},{value:"RNGE",name:"RANGE"},{value:"RCH",name:"REACH"},{value:"RES",name:"RESERVE"},{value:"REST",name:"REST"},{value:"RTT",name:"RETREAT"},{value:"RIDE",name:"RIDE"},{value:"RDGE",name:"RIDGE"},{value:"RGWY",name:"RIDGEWAY"},{value:"ROWY",name:"RIGHT"},{value:"RING",name:"RING"},{value:"RISE",name:"RISE"},{value:"RVR",name:"RIVER"},{value:"RVWY",name:"RIVERWAY"},{value:"RVRA",name:"RIVIERA"},{value:"RD",name:"ROAD"},{value:"RDS",name:"ROADS"},{value:"RDSD",name:"ROADSIDE"},{value:"RDWY",name:"ROADWAY"},{value:"RNDE",name:"RONDE"},{value:"RSBL",name:"ROSEBOWL"},{value:"RTY",name:"ROTARY"},{value:"RND",name:"ROUND"},{value:"RTE",name:"ROUTE"},{value:"ROW",name:"ROW"},{value:"RUE",name:"RUE"},{value:"RUN",name:"RUN"},{value:"SWY",name:"SERVICE"},{value:"SDNG",name:"SIDING"},{value:"SLPE",name:"SLOPE"},{value:"SND",name:"SOUND"},{value:"SPUR",name:"SPUR"},{value:"SQ",name:"SQUARE"},{value:"STRS",name:"STAIRS"},{value:"SHWY",name:"STATE"},{value:"STPS",name:"STEPS"},{value:"STRA",name:"STRAND"},{value:"ST",name:"STREET"},{value:"STRP",name:"STRIP"},{value:"SBWY",name:"SUBWAY"},{value:"TARN",name:"TARN"},{value:"TCE",name:"TERRACE"},{value:"THOR",name:"THOROUGHFARE"},{value:"TLWY",name:"TOLLWAY"},{value:"TOP",name:"TOP"},{value:"TOR",name:"TOR"},{value:"TWRS",name:"TOWERS"},{value:"TRK",name:"TRACK"},{value:"TRL",name:"TRAIL"},{value:"TRLR",name:"TRAILER"},{value:"TRI",name:"TRIANGLE"},{value:"TKWY",name:"TRUNKWAY"},{value:"TURN",name:"TURN"},{value:"UPAS",name:"UNDERPASS"},{value:"UPR",name:"UPPER"},{value:"VALE",name:"VALE"},{value:"VDCT",name:"VIADUCT"},{value:"VIEW",name:"VIEW"},{value:"VLLS",name:"VILLAS"},{value:"VSTA",name:"VISTA"},{value:"WADE",name:"WADE"},{value:"WALK",name:"WALK"},{value:"WKWY",name:"WALKWAY"},{value:"WAY",name:"WAY"},{value:"WHRF",name:"WHARF"},{value:"WYND",name:"WYND"},{value:"YARD",name:"YARD"}],m={first_name:"Matthew",middle_name:"Eales",last_name:"Hunt",phone:"0412345678",email:"matthew.hunt@fakeemail.com",dob:"1978-11-16",gender:"M",street_name:"Huntsman",street_type:"CTR",street_number:"4",suburb:"Pyrmont",state:"NSW",postcode:"2011",license_number:"758811G",employer:"DATA FISH PTY LTD",unit:""},u=e=>{let a=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(!a)return e;let[,n,l,m]=a,u=m.padStart(2,"0"),v=l.padStart(2,"0");return"".concat(n,"-").concat(v,"-").concat(u)},v=e=>{let a=u(e.DOB);return{first_name:e.first_name,last_name:e.last_name,middle_name:e.middle_name?e.middle_name:"",phone:e.phone.startsWith("04")?e.phone:"",dob:a,gender:e.gender,street_name:e.street_name,street_type:e.street_type,street_number:e.street_number,unit:e.unit?e.unit:"",suburb:e.suburb,state:e.state,postcode:e.postcode,license_number:e.license_number,employer:e.employer?e.employer:"",email:e.email}}},64328:function(e,a,n){"use strict";n.r(a),n.d(a,{default:function(){return W}});var l=n(85893),m=n(67294),u=n(87536),v=n(15103),R=n(48583),t=n(20906),E=n(4798),A=n(4298),s=n.n(A),T=n(55962),r=e=>{let{setLoaded:a}=e;return(0,m.useLayoutEffect)(()=>{window.handleGoogleClientLoad=function(){a(!0),window.googleMapLoaded=!0,console.log("googlemapsloaded")}}),(0,l.jsx)(s(),{strategy:"lazyOnload",src:"https://maps.googleapis.com/maps/api/js?key=".concat(T.q,"&libraries=places&callback=handleGoogleClientLoad")})},o=n(70656),S=n(94605),L=n(85),i=n(91185),N=n.n(i);let d=(0,v.cn)(!1),O=S.SL0?"NZ":"AU",C={subpremise:["subpremise","short_name"],floor:["floor","short_name"],street_number:["street_number","short_name"],route:["street","long_name"],locality:["suburb","short_name"],administrative_area_level_2:["city","short_name"],administrative_area_level_1:["state","short_name"],postal_code:["postcode","short_name"]},D=e=>{let{id:a,formItem:n,equifaxMapping:m}=e,v=(0,u.Gc)().setValue,{ready:R,value:A,suggestions:{status:s,data:T},setValue:r,clearSuggestions:o}=(0,t.ZP)({requestOptions:{componentRestrictions:{country:O}},debounce:300,cache:!1}),S=e=>{let a=e.find(e=>e.types.includes("route")),n=e.find(e=>e.types.includes("subpremise")),l=null==n?void 0:n.long_name.split(" ").slice(-1).join(" "),m=null==a?void 0:a.long_name.split(" ").slice(0,-1).join(" "),u=null==a?void 0:a.long_name.split(" ").slice(-1).join(" ");if(m&&u){var R;let e=null===(R=E.qz.find(e=>e.name===u.toUpperCase()))||void 0===R?void 0:R.value;v("street_name",m),v("street_type",e)}n&&v("unit",l)},L=e=>{let{description:a}=e;return()=>{var e;r(a,!1),v(null!==(e=n.name)&&void 0!==e?e:"Your Current Address",a),o(),(0,t.LM)({address:a,componentRestrictions:{country:"au"}}).then(e=>{let a=e[0].address_components;a&&a.map(e=>{let n=m?m[e.types[0]]:C[e.types[0]];n&&(v(n[0],e[n[1]]),m&&("route"===e.types[0]||"subpremise"===e.types[0])&&S(a))})})}};return(0,l.jsxs)("div",{children:[(0,l.jsx)("input",{className:"form-control",value:A,onInput:e=>{r(e.target.value)},disabled:!R,placeholder:"Address",id:a,autoComplete:"new-password"}),"OK"===s&&(0,l.jsx)("div",{className:"rounded border py-1 px-3 shadow bg-white",id:"addressSugestions",children:(0,l.jsx)("ul",{className:N().styledUl,children:T.map(e=>{let{place_id:a,structured_formatting:{main_text:n,secondary_text:m}}=e;return(0,l.jsxs)("li",{onClick:L(e),children:[(0,l.jsx)("strong",{children:n})," ",(0,l.jsx)("small",{children:m})]},a)})})})]})};var W=(0,L.Z)({})(e=>{let[a,n]=(0,R.KO)(d);return(0,m.useLayoutEffect)(()=>{window.googleMapLoaded&&n(!0)},[]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r,{setLoaded:n}),a?(0,l.jsx)(D,{...e}):(0,l.jsx)(o.O,{className:"w-full mb-3",style:{height:32}})]})})},91185:function(e){e.exports={xs:"min-width: 400px",sm:"min-width: 576px","sm-down":"max-width: 576px",md:"min-width: 768px","md-down":"max-width: 768px",lg:"min-width: 992px","lg-down":"max-width: 992px",xl:"min-width: 1200px","xl-down":"max-width: 1200px",xxl:"min-width: 1400px",styledUl:"AddressInput_styledUl__wvouU"}}}]);