diff --git a/strr-web/assets/styles/theme.scss b/strr-web/assets/styles/theme.scss index da8d9af0..a6badeb2 100644 --- a/strr-web/assets/styles/theme.scss +++ b/strr-web/assets/styles/theme.scss @@ -86,4 +86,9 @@ html, body { overflow-x: hidden; background-color: #F1F3F5; +} + +body { + overflow-y: hidden; + height: 100%; } \ No newline at end of file diff --git a/strr-web/components/bcros/alerts/Message.vue b/strr-web/components/bcros/alerts/Message.vue index 8a153cb4..2a1b594e 100644 --- a/strr-web/components/bcros/alerts/Message.vue +++ b/strr-web/components/bcros/alerts/Message.vue @@ -1,12 +1,12 @@ diff --git a/strr-web/components/bcros/form-section/FormSection.vue b/strr-web/components/bcros/form-section/FormSection.vue index d9092af0..ed659572 100644 --- a/strr-web/components/bcros/form-section/FormSection.vue +++ b/strr-web/components/bcros/form-section/FormSection.vue @@ -1,8 +1,8 @@ diff --git a/strr-web/components/bcros/form-section/contact-information/ContactDetails.vue b/strr-web/components/bcros/form-section/contact-information/ContactDetails.vue index 5b37c0b2..8fa0e5f3 100644 --- a/strr-web/components/bcros/form-section/contact-information/ContactDetails.vue +++ b/strr-web/components/bcros/form-section/contact-information/ContactDetails.vue @@ -3,25 +3,51 @@
- +
- - + + - +
- +
- - + +
@@ -35,16 +61,11 @@ diff --git a/strr-web/components/bcros/form-section/contact-information/ContactInfo.vue b/strr-web/components/bcros/form-section/contact-information/ContactInfo.vue index a60ea70f..0ead92cf 100644 --- a/strr-web/components/bcros/form-section/contact-information/ContactInfo.vue +++ b/strr-web/components/bcros/form-section/contact-information/ContactInfo.vue @@ -2,28 +2,25 @@
- - + + - - + - - + aria-label="birth month" + /> - - + +
@@ -31,28 +28,36 @@ diff --git a/strr-web/components/bcros/form-section/contact-information/Form.vue b/strr-web/components/bcros/form-section/contact-information/Form.vue index 52cce511..3deaa738 100644 --- a/strr-web/components/bcros/form-section/contact-information/Form.vue +++ b/strr-web/components/bcros/form-section/contact-information/Form.vue @@ -14,18 +14,39 @@ {{ t('create-account.contact.disclaimer') }}
- - - - + + + + -
+
@@ -45,13 +66,31 @@
- + - - + + @@ -60,15 +99,64 @@ diff --git a/strr-web/components/bcros/form-section/contact-information/MailingAddress.vue b/strr-web/components/bcros/form-section/contact-information/MailingAddress.vue index 6d55d04b..66b9e533 100644 --- a/strr-web/components/bcros/form-section/contact-information/MailingAddress.vue +++ b/strr-web/components/bcros/form-section/contact-information/MailingAddress.vue @@ -3,56 +3,49 @@
- - - + />
- +
- +
- + - - - + - +
@@ -60,17 +53,45 @@ diff --git a/strr-web/components/bcros/form-section/property/Address.vue b/strr-web/components/bcros/form-section/property/Address.vue index 16dbf28e..34fc9db1 100644 --- a/strr-web/components/bcros/form-section/property/Address.vue +++ b/strr-web/components/bcros/form-section/property/Address.vue @@ -3,66 +3,63 @@
- +
- - + +
- - - + aria-label="country" + />
- - + +
- +
- + - - - + - +
@@ -70,20 +67,43 @@ diff --git a/strr-web/components/bcros/form-section/property/Details.vue b/strr-web/components/bcros/form-section/property/Details.vue index 8f5f01c2..80d10b54 100644 --- a/strr-web/components/bcros/form-section/property/Details.vue +++ b/strr-web/components/bcros/form-section/property/Details.vue @@ -3,36 +3,44 @@
- +
- +
- - - +
- - - +
@@ -40,37 +48,19 @@ diff --git a/strr-web/components/bcros/form-section/property/Form.vue b/strr-web/components/bcros/form-section/property/Form.vue index 194e3431..e5284c4a 100644 --- a/strr-web/components/bcros/form-section/property/Form.vue +++ b/strr-web/components/bcros/form-section/property/Form.vue @@ -1,22 +1,91 @@ diff --git a/strr-web/components/bcros/form-section/property/ListingDetails.vue b/strr-web/components/bcros/form-section/property/ListingDetails.vue index c61905d6..61795ad6 100644 --- a/strr-web/components/bcros/form-section/property/ListingDetails.vue +++ b/strr-web/components/bcros/form-section/property/ListingDetails.vue @@ -1,16 +1,23 @@ diff --git a/strr-web/public/css/addresscomplete-2.30.min.css b/strr-web/public/css/addresscomplete-2.30.min.css deleted file mode 100644 index 39ede188..00000000 --- a/strr-web/public/css/addresscomplete-2.30.min.css +++ /dev/null @@ -1,12 +0,0 @@ -/*! Copyright © 2009-2020 Postcode Anywhere (Holdings) Ltd. (http://www.postcodeanywhere.co.uk) - * - * AddressComplete v2.30 - * Style for AddressComplete for the web. - * - * WEB-1-3 23/10/2020 22:11:00 - */ -.pca{margin:0;padding:0;position:static;border:none;box-sizing:content-box}.pca *{box-sizing:content-box}.pca .pcatext{font:9pt arial;color:#333}.pca .pcalist{position:relative;list-style-type:none;list-style-position:outside;margin:0;padding:0;overflow-y:auto;overflow-x:hidden;background-color:#fafafa}.pca .pcaitem{cursor:pointer;position:relative;margin:0;padding:9px 10px 9px 10px;padding:7px 10px;line-height:15px;text-align:left;white-space:nowrap;border:solid 1px transparent;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#e5e5e5;border-bottom-color:transparent;padding-right:22px;opacity:.8;filter:alpha(opacity=80);color:#000}.pca .pcaselected{color:#333;background-color:#e5f0ff;background-color:#f0f0f0;border-width:1px;border-style:solid;border-color: transparent;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#e5e5e5;border-bottom-color:transparent;opacity:1;filter:alpha(opacity=100);color:#000}.pca .pcalastitem{border-bottom:none}.pca .pcadisableselect{-moz-user-select:none;-webkit-user-select:none}.pca .pcaautocomplete{margin:0;padding:0;border-width:1px;border-style:solid;border-color:#ccc;border-bottom:0;background:0;box-shadow:0 8px 17px 0 rgba(0,0,0,.2);width:inherit;position:absolute;z-index:100000}.pca .pcaanchor{margin:0;padding:0;border:0;background:0}.pca .pcaanchor .pcachain{position:relative}.pca .pcaautocomplete .pcaheader{background-color:#fafafa;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#ccc;color:#969696}.pca .pcaautocomplete .pcamessage{padding:8px 10px;line-height:18px}.pca .pcaautocomplete .pcalist{height:244px;width:auto;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#ccc}.pca .pcaautocomplete .pcafooter{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#ccc;background-color:#fafafa;height:30px;box-sizing:content-box;min-width:138px;overflow:hidden}.pca .pcanotification{background-color:#fafafa;padding:8px 10px 8px 10px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;position:absolute;z-index:100000;transition:opacity .5s ease-in-out;-moz-transition:opacity .5s ease-in-out;-webkit-transition:opacity .5s ease-in-out;opacity:1;display:none}.pca .pcanotification.pcavisible{display:block}.pca .pcanotification.pcafade{opacity:0}.pca .pcanotification.pcaerror{background-color:#db7f83;color:#fff}.pca .pcaautocomplete .pcafooter .pcamessage{font:bold 9pt arial;color:#969696;margin:9px 0 0 5px;padding:0;position:relative;float:right}.pca .pcamodal{position:fixed;top:50%;left:50%;z-index:100000}.pca .pcamodal .pcalist{height:244px;width:auto;min-width:200px;min-height:100px}.pca .pcamodal .pcaborder{position:absolute;width:100%;height:100%;top:0;left:0;background-color:#000;border-radius:0px;opacity:.20;filter:alpha(opacity=20)}.pca .pcamodal .pcaframe{position:relative;margin:12px;background-color:#f5f7f9;border-radius:0px;border-width:1px;border-style:solid;border-color: #c8cacc}.pca .pcamodal .pcacontent{position:relative;padding:15px}.pca .pcamodal .pcacontent .pcainputrow{width:450px;text-align:right}.pca .pcamodal .pcacontent .pcainputrow input{width:300px;border-width:1px;border-style:solid;border-color: #d4d4d4;padding:8px;margin:15px;background:#fff}.pca .pcamodal .pcacontent .pcainputrow input:invalid{-webkit-box-shadow:0 0 1.5px 1px red;-moz-box-shadow:0 0 1.5px 1px red;box-shadow:0 0 1.5px 1px red}.pca .pcamodal .pcacontent .pcainputrow .pcahalf{width:126px}.pca .pcamodal .pcacontent .pcainputrow label{font:bold 14px arial;color:#444444}.pca .pcamodal .pcaheader{position:relative;top:0;left:0;border-top:1px solid#e1e3e5;border-bottom:1px solid #c8cacc;border-radius:0px 0px 0 0;background:#e1e3e5;background:-moz-linear-gradient(top,#e1e3e5 0%,#e1e3e5 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#e1e3e5),color-stop(100%,#e1e3e5));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e1e3e5',endColorstr='#e1e3e5',GradientType=0)}.pca .pcamodal .pcaheader .pcatitle{font:bold 18px arial;color:#005db9;margin:15px}.pca .pcamodal .pcafooter{position:relative;bottom:0;left:0;border-top:1px solid #c8cacc;background:#fff}.pca .pcamodal .pcafooter .pcabutton{width:150px;margin:15px}.pca .pcafullscreen{position:fixed;top:0;left:0;height:100%;width:100%}.pca .pcamask{background-color:#000;opacity:.40;filter:alpha(opacity=40);z-index:100000}.pca .pcabutton{font:bold 14px arial;color:#444444;border:1px solid #d4d4d4;border-radius:0px;padding:8px;cursor:pointer;background:#f5f7f9;background:-moz-linear-gradient(top,#f5f7f9 0%,#f5f7f9 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f5f7f9),color-stop(100%,#f5f7f9));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f7f9',endColorstr='#f5f7f9',GradientType=0)}.pca .pcatooltip{position:absolute;z-index:100000}.pca .pcatooltip .pcabackground{position:absolute;height:100%;width:100%;background-color:#000;border-radius:5px;opacity:.6;filter:alpha(opacity=60)}.pca .pcatooltip .pcamessage{position:relative;padding:5px;font:9pt arial;color:#fff}.pca .pcabutton:hover{color:#444444}.pca .pcalink{font:bold 9pt arial;cursor:pointer}.pca .pcaclear{clear:both} -.pcaflag{width:14px;height:12px;position:absolute;font-size:0;background-image:url(//ws1.postescanada-canadapost.ca/images/flags16x16.png);-moz-box-shadow:0 1px 2px rgba(128,128,128,.3);-webkit-box-shadow:0 1px 2px rgba(128,128,128,.3);box-shadow:0 1px 2px rgba(128,128,128,.3)}.pca .pcaautocomplete .pcafooter .pcaflagbutton{width:31px;height:21px;position:relative;float:right;padding:5px 6px;cursor:pointer;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/flag_clear_down.png);background-position:5px 5px;background-repeat:no-repeat}.pca .pcaautocomplete .pcafooter .pcaflagbutton:hover{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/flag_clear_down_hover.png)}.pca .pcaautocomplete .pcafooter .pcaflagbutton .pcaflag{top:9px;left:9px}.pca .pcaautocomplete .pcaflaglabel{position:relative;left:26px}.pca .pcacountrylist .pcafooter .pcaflagbutton{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/flag_clear_up.png)}.pca .pcacountrylist .pcafooter .pcaflagbutton:hover{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/flag_clear_up_hover.png)} -.pca .pcaexpandable{background-image:url('//ws1.postescanada-canadapost.ca/images/icons/captureplus/chevron.png');background-repeat:no-repeat;background-position-x:99%;background-position-y:50%;background-position:right 7px center}.pca .pcaautocomplete .pcafooter .pcalogo{width:68px;height:15px;font-size:0;margin:7px 5px 8px 11px;position:relative;float:left;background-repeat:no-repeat;background-size:contain;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/pca_predict_logo.png)}.pca .pcaautocomplete .pcafooter .aclogo{width:112px;height:15px;font-size:0;margin:8px 5px 8px 11px;position:relative;float:left;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/address_complete_logo_en.png)}.pca .pcaautocomplete .pcafooter .aclogo.pcalogofr{width:118px;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/address_complete_logo_fr.png)}.pca .pcaautocomplete .pcafooter .dtlogo{width:100px;height:14px;font-size:0;margin:9px 5px 6px 9px;position:relative;float:left;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/dt_express_capture_logo.png)}.pca .pcaautocomplete .pcafooter .anlogo{width:129px;height:11px;font-size:0;margin:10px 5px 9px 9px;position:relative;float:left;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/address_now_logo.png)}.pca .pcaitem .pcadescription{font-style:italic;color:#6b6b6b;margin-left:8px} -.pcaaddresscomplete{}.pca .pcaautocomplete .pcaheader .pcamessageicon{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/info.png);height:15px;position:relative;top:2px;margin-right:8px;display:inline-block;width:15px} - diff --git a/strr-web/public/css/addresscomplete-2.50.min.css b/strr-web/public/css/addresscomplete-2.50.min.css new file mode 100644 index 00000000..cfffd849 --- /dev/null +++ b/strr-web/public/css/addresscomplete-2.50.min.css @@ -0,0 +1,11 @@ +/*! Copyright © 2009-2024 Postcode Anywhere (Holdings) Ltd. (http://www.postcodeanywhere.co.uk) + * + * AddressComplete v2.50 + * Style for AddressComplete for the web. + * + * p-w-u-c1-1-x4rp 25/05/2024 00:09:50 + */ + .pca{margin:0;padding:0;position:static;border:none;box-sizing:content-box}.pca *{box-sizing:content-box}.pca .pcatext{font:.8rem arial;color:#333}.pca .pcalist{position:relative;list-style-type:none;list-style-position:outside;margin:0;padding:0;overflow-y:auto;overflow-x:hidden;background-color:#fafafa}.pca .pcaitem{cursor:pointer;position:relative;margin:0;padding:9px 10px 9px 10px;padding:7px 10px;line-height:15px;text-align:left;white-space:nowrap;border:solid 1px transparent;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#e5e5e5;border-bottom-color:transparent;padding-right:22px;filter:alpha(opacity=80);color:#000}.pca .pcaselected,.pca .pcaitem:hover{color:#333;background-color:#e5f0ff;background-color:#f0f0f0;border-width:1px;border-style:solid;border-color: transparent;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#e5e5e5;border-bottom-color:transparent;opacity:1;filter:alpha(opacity=100);color:#000}.pca .pcalastitem,.pca .pcalastitem:hover{border-bottom:none}.pca .pcadisableselect{-moz-user-select:none;-webkit-user-select:none}.pca .pcaautocomplete{margin:0;padding:0;border-width:1px;border-style:solid;border-color:#ccc;border-bottom:0;background:0;box-shadow:0 8px 17px 0 rgba(0,0,0,.2);width:inherit;position:absolute;z-index:9999999999}.pca .pcaanchor{margin:0;padding:0;border:0;background:0}.pca .pcaanchor .pcachain{position:relative}.pca .pcaautocomplete .pcaheader{background-color:#fafafa;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#ccc;color:#969696}.pca .pcaautocomplete .pcamessage{padding:8px 10px;line-height:18px}.pca .pcaautocomplete .pcalist{height:244px;width:auto;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#ccc}.pca .pcaautocomplete .pcafooter{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#ccc;background-color:#fafafa;height:30px;box-sizing:content-box;min-width:138px;overflow:hidden;display:flex;align-items:center;justify-content:flex-end;padding:0 10px}.pca .pcaautocomplete .pcafooter.pca-showlogo{justify-content:space-between}.pca .pcanotification{background-color:#fafafa;padding:8px 10px 8px 10px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;position:absolute;z-index:100000;transition:opacity .5s ease-in-out;-moz-transition:opacity .5s ease-in-out;-webkit-transition:opacity .5s ease-in-out;opacity:1;display:none}.pca .pcanotification.pcavisible{display:block}.pca .pcanotification.pcafade{opacity:0}.pca .pcanotification.pcaerror{background-color:#cb484f;color:#fff}.pca .pcaautocomplete .pcafooter .pcamessage{font:bold 9pt arial;color:#757575;margin-right:10px;padding:0;position:relative;float:right}.pca .pcamodal{position:fixed;top:50%;left:50%;z-index:100000}.pca .pcamodal .pcalist{height:244px;width:auto;min-width:200px;min-height:100px}.pca .pcamodal .pcaborder{position:absolute;width:100%;height:100%;top:0;left:0;background-color:#000;border-radius:0px;opacity:.20;filter:alpha(opacity=20)}.pca .pcamodal .pcaframe{position:relative;margin:12px;background-color:#f5f7f9;border-radius:0px;border-width:1px;border-style:solid;border-color: #c8cacc}.pca .pcamodal .pcacontent{position:relative;padding:15px}.pca .pcamodal .pcacontent .pcainputrow{width:450px;text-align:right}.pca .pcamodal .pcacontent .pcainputrow input{width:300px;border-width:1px;border-style:solid;border-color: #d4d4d4;padding:8px;margin:15px;background:#fff}.pca .pcamodal .pcacontent .pcainputrow input:invalid{-webkit-box-shadow:0 0 1.5px 1px red;-moz-box-shadow:0 0 1.5px 1px red;box-shadow:0 0 1.5px 1px red}.pca .pcamodal .pcacontent .pcainputrow .pcahalf{width:126px}.pca .pcamodal .pcacontent .pcainputrow label{font:bold 14px arial;color:#444444}.pca .pcamodal .pcaheader{position:relative;top:0;left:0;border-top:1px solid#e1e3e5;border-bottom:1px solid #c8cacc;border-radius:0px 0px 0 0;background:#e1e3e5;background:-moz-linear-gradient(top,#e1e3e5 0%,#e1e3e5 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#e1e3e5),color-stop(100%,#e1e3e5));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e1e3e5',endColorstr='#e1e3e5',GradientType=0)}.pca .pcamodal .pcaheader .pcatitle{font:bold 18px arial;color:#005db9;margin:15px}.pca .pcamodal .pcafooter{position:relative;bottom:0;left:0;border-top:1px solid #c8cacc;background:#fff}.pca .pcamodal .pcafooter .pcabutton{width:150px;margin:15px}.pca .pcafullscreen{position:fixed;top:0;left:0;height:100%;width:100%}.pca .pcamask{background-color:#000;opacity:.40;filter:alpha(opacity=40);z-index:100000}.pca .pcabutton{font:bold 14px arial;color:#444444;border:1px solid #d4d4d4;border-radius:0px;padding:8px;cursor:pointer;background:#f5f7f9;background:-moz-linear-gradient(top,#f5f7f9 0%,#f5f7f9 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f5f7f9),color-stop(100%,#f5f7f9));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f7f9',endColorstr='#f5f7f9',GradientType=0)}.pca .pcatooltip{position:absolute;z-index:100000}.pca .pcatooltip .pcabackground{position:absolute;height:100%;width:100%;background-color:#000;border-radius:5px;opacity:.6;filter:alpha(opacity=60)}.pca .pcatooltip .pcamessage{position:relative;padding:5px;font:.8rem arial;color:#fff}.pca .pcabutton:hover{color:#444444}.pca .pcalink{font:bold 9pt arial;cursor:pointer}.pca .pcaclear{clear:both} + .pcaflag{width:14px;height:12px;font-size:0;background-image:url(//ws1.postescanada-canadapost.ca/images/flags16x16.png);-moz-box-shadow:0 1px 2px rgba(128,128,128,.3);-webkit-box-shadow:0 1px 2px rgba(128,128,128,.3);box-shadow:0 1px 2px rgba(128,128,128,.3)}.pca .pcaautocomplete .pcafooter .pcaflagbutton{height:21px;position:relative;cursor:pointer;display:flex;align-items:center}.pca .pcaautocomplete .pcaflaglabel{position:relative;margin-left:8px}.pca .pcacountrylist .pcafooter .pcaflagbutton{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/flag_clear_up.png)}.pca .pcacountrylist .pcalist .pcaitem{display:flex}.pca .pcacountrylist .pcafooter .pcaflagbutton:hover{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/flag_clear_up_hover.png)} + .pca .pcaexpandable{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/chevron.png);background-repeat:no-repeat;background-position-x:99%;background-position-y:50%;background-position:right 7px center}.pca .pcaautocomplete .pcafooter .geoLocationIcon{width:21px;height:21px;font-size:0;margin:0 5px 0 0;padding:5px 0 5px 5px;position:relative;float:right;cursor:pointer;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/geolocationicon.svg);background-position:right;background-repeat:no-repeat;color:#7e8593;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"!important;visibility:hidden}.pca .pcaautocomplete .pcafooter .geoLocationIcon.active{visibility:visible}.pca .pcaautocomplete .pcafooter .geoLocationIcon.working{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/loader.gif)}.pca .pcaautocomplete .pcafooter .geoLocationMessage{color:#7e8593;padding:9px 0;position:relative;float:right;cursor:pointer;font-size:11px;visibility:hidden}.pca .pcaautocomplete .pcafooter .geoLocationMessage.active{visibility:visible}.pca .pcaautocomplete .pcafooter .pcalogo{width:68px;height:16px;margin:7px 0 0 7px;font-size:0;position:relative;float:left;background-repeat:no-repeat;background-size:contain;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/loqatelogoinverted.svg)}.pca .pcaautocomplete .pcafooter .adsylogo{width:68px;height:16px;margin:7px 0 0 7px;font-size:0;position:relative;float:left;background-repeat:no-repeat;background-size:contain;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/loqatelogoinverted.svg)}.pca .pcaautocomplete .pcafooter .aclogo{width:112px;height:15px;font-size:0;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/address_complete_logo_en.png)}.pca .pcaautocomplete .pcafooter .aclogo.pcalogofr{width:118px;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/address_complete_logo_fr.png)}.pca .pcaautocomplete .pcafooter .dtlogo{width:100px;height:14px;font-size:0;margin:9px 5px 6px 9px;position:relative;float:left;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/dt_express_capture_logo.png)}.pca .pcaautocomplete .pcafooter .anlogo{width:129px;height:11px;font-size:0;margin:10px 5px 9px 9px;position:relative;float:left;background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/address_now_logo.png)}.pca .pcaitem .pcadescription{color:#6b6b6b;margin-left:8px}.pca .pcaitem .pcautilitytype{padding-right:8px;font-style:italic}.pca .pca-visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px} + .pcaaddresscomplete{}.pca .pcaautocomplete .pcaheader .pcamessageicon{background-image:url(//ws1.postescanada-canadapost.ca/images/icons/captureplus/info.png);height:15px;position:relative;top:2px;margin-right:8px;display:inline-block;width:15px} \ No newline at end of file diff --git a/strr-web/public/icons/create-account/invalid_step.svg b/strr-web/public/icons/create-account/invalid_step.svg new file mode 100644 index 00000000..a8ad5e89 --- /dev/null +++ b/strr-web/public/icons/create-account/invalid_step.svg @@ -0,0 +1,4 @@ + + + + diff --git a/strr-web/public/icons/create-account/valid_step.svg b/strr-web/public/icons/create-account/valid_step.svg new file mode 100644 index 00000000..47ebbbf5 --- /dev/null +++ b/strr-web/public/icons/create-account/valid_step.svg @@ -0,0 +1,4 @@ + + + + diff --git a/strr-web/public/js/addresscomplete-2.30.min.js b/strr-web/public/js/addresscomplete-2.30.min.js deleted file mode 100644 index aeb2c031..00000000 --- a/strr-web/public/js/addresscomplete-2.30.min.js +++ /dev/null @@ -1,259 +0,0 @@ -/*! Copyright © 2009-2020 Postcode Anywhere (Holdings) Ltd. (http://www.postcodeanywhere.co.uk) - * - * AddressComplete v2.30 - * Capture Plus for the web. - * - * WEB-1-3 23/10/2020 22:11:57 - */ -(function(n,t){function e(){r.addEventListener?(i.ignore(r,"DOMContentLoaded",e),f=!0,i.ready()):r.readyState==="complete"&&(i.ignore(r,"onreadystatechange",e),f=!0,i.ready())}function v(){r.readyState==="complete"?(f=!0,i.ready()):(r.addEventListener?i.listen(r,"DOMContentLoaded",e):i.listen(r,"onreadystatechange",e),i.listen(n,"load",e))}function s(t){if(i.blockRequests&&i.waitingRequest){i.requestQueue=[t];return}if(t.block&&(i.blockRequests=!0),t.queue&&i.waitingRequest){i.requestQueue.push(t);return}if(i.waitingRequest=!0,t.cache&&i.requestCache[t.url]){function r(){t.callback(i.requestCache[t.url].response)}n.setImmediate?n.setImmediate(r):n.setTimeout(r,1);return}t.post?h(t):a(t)}function y(n){i.waitingRequest=!1,n.block&&(i.blockRequests=!1),n.response.Items.length===1&&n.response.Items[0].Error!==t?n.error(n.response.Items[0].Description):n.success(n.response.Items,n.response),n.cache&&(i.requestCache[n.url]=n),n.position&&(i.scriptRequests[n.position-1]=null),i.requestQueue.length&&s(i.requestQueue.shift())}function a(n){navigator.appName=="Microsoft Internet Explorer"?w(n):p(n)}function p(n){var t=new i.XMLHttpRequest;n.url.length>i.limit?(n.post=!0,h(n)):(t.onreadystatechange=function(){t.readyState==4&&t.status==200&&n.callback(i.parseJSON(t.responseText))},n.credentials&&(t.withCredentials=n.credentials),t.onerror=n.serviceError,t.ontimeout=n.timeoutError,t.open("GET",n.url,!0),t.send())}function w(n){var t=i.create("script",{type:"text/javascript",async:"async"}),u=r.getElementsByTagName("head")[0];n.position=i.scriptRequests.push(n),t.src=n.url+"&callback=pca.scriptRequests["+(n.position-1)+"].callback",t.onload=t.onreadystatechange=function(){this.readyState&&this.readyState!=="loaded"&&this.readyState!=="complete"||(t.onload=t.onreadystatechange=null,u&&t.parentNode&&u.removeChild(t))},t.src.length>i.limit?(n.post=!0,h(n)):u.insertBefore(t,u.firstChild)}function h(n){navigator.appName=="Microsoft Internet Explorer"?l(n):c(n)}function c(n){var t=new i.XMLHttpRequest;t.onreadystatechange=function(){t.readyState==4&&t.status==200&&n.callback(i.parseJSON(t.responseText))},n.credentials&&(t.withCredentials=n.credentials),t.onerror=n.serviceError,t.ontimeout=n.timeoutError,t.open("POST",n.destination,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.send(n.query)}function l(n){function o(n,t){var i=r.createElement("input");i.name=n,i.value=t,u.appendChild(i)}var u=r.createElement("form"),t=r.createElement("iframe"),s=!1,e,f;u.method="POST",u.action=i.protocol+"//"+i.host+"/"+n.service+"/json.ws";for(e in n.data)o(e,n.data[e]);o("CallbackVariable","window.name"),o("CallbackWithScriptTags","true"),t.onload=function(){s?(n.callback({Items:i.parseJSON(t.contentWindow.name)}),r.body.removeChild(t)):(s=!0,t.contentWindow.location="about:blank")},t.style.display="none",r.body.appendChild(t),f=t.contentDocument||t.contentWindow.document,f.body?f.body.appendChild(u):f.appendChild(u),u.submit()}function u(t){return t==n||t==r||t==r.body}var i=n.pca=n.pca||{},r=n.document,f,o;i.protocol=(n.location||r.location).protocol=="https:"?"https:":"http:",i.host="ws1.postescanada-canadapost.ca",i.endpoint="json3ex.ws",i.limit=2e3,i.synonyms=[{r:/\bN(?=\s)/,w:"NORTH"},{r:/\b(?:NE|NORTHEAST)(?=\s)/,w:"NORTH EAST"},{r:/\b(?:NW|NORTHWEST)(?=\s)/,w:"NORTH WEST"},{r:/\bS(?=\s)/,w:"SOUTH"},{r:/\b(?:SE|SOUTHEAST)(?=\s)/,w:"SOUTH EAST"},{r:/\b(?:SW|SOUTHWEST)(?=\s)/,w:"SOUTH WEST"},{r:/\bE(?=\s)/,w:"EAST"},{r:/\bW(?=\s)/,w:"WEST"},{r:/\bST(?=\s)/,w:"SAINT"}],i.diacritics=[{r:/[ÀÁÂÃ]/gi,w:"A"},{r:/Å/gi,w:"AA"},{r:/[ÆæÄ]/gi,w:"AE"},{r:/Ç/gi,w:"C"},{r:/Ð/gi,w:"DJ"},{r:/[ÈÉÊË]/gi,w:"E"},{r:/[ÌÍÏ]/gi,w:"I"},{r:/Ñ/gi,w:"N"},{r:/[ÒÓÔÕ]/gi,w:"O"},{r:/[ŒØÖ]/gi,w:"OE"},{r:/Š/gi,w:"SH"},{r:/ß/gi,w:"SS"},{r:/[ÙÚÛ]/gi,w:"U"},{r:/Ü/gi,w:"UE"},{r:/[ŸÝ]/gi,w:"ZH"},{r:/-/gi,w:" "},{r:/[.,]/gi,w:""}],i.hypertext=[{r:/&/g,w:"&"},{r:/"/g,w:"""},{r:/'/g,w:"'"},{r://g,w:">"}],i.requestQueue=[],i.requestCache={},i.scriptRequests=[],i.waitingRequest=!1,i.blockRequests=!1,i.styleFixes=[],i.agent=navigator&&navigator.userAgent||"",i.galaxyFix=/Safari\/534.30/.test(i.agent)&&/GT-I8190|GT-I9100|GT-I9305|GT-P3110/.test(i.agent),i.container=null,i.XMLHttpRequest=n.XMLHttpRequest,f=!1,o=[],i.fuzzyMatch=!0,i.fuzzyTags=["*"],i.ready=function(n){var i,t;if(f){if(o.length)for(i=o,o=[],t=0;ti.data[t]?1:-1:n.tag>i.tag?1:-1}),n.fire("sort"),n},n.reverse=function(){return n.items.reverse(),n.fire("reverse"),n},n.filter=function(t){var u=i.formatTag(t),r=n.count;return n.count=0,n.firstVisibleItem=null,n.lastVisibleItem=null,n.all(function(t){~t.tag.indexOf(u)?(t.show(),n.count++,n.firstVisibleItem=n.firstVisibleItem||t,n.lastVisibleItem=t):t.hide()}),r!=n.count&&n.fire("filter"),n},n.match=function(t){var u=i.formatTag(t),r=[];return n.all(function(n){~n.tag.indexOf(u)&&r.push(n)}),r},n.clear=function(){return n.items=[],n.count=0,n.highlighted=-1,n.firstItem=null,n.lastItem=null,n.firstVisibleItem=null,n.lastVisibleItem=null,n.fire("clear"),n},n.all=function(t){for(var i=0;i=0;i--)if(t?t(n.items[i]):n.items[i].visible)return n.items[i];return null},n.next=function(t){for(var i=n.highlighted+1;i=0;i--)if(t?t(n.items[i]):n.items[i].visible)return n.items[i];return n.last()},n.visibleItems=function(){var t=[];return n.all(function(n){n.visible&&t.push(n)}),t},n},i.List=function(t){function u(n,t,u){var f=new i.Item(n,t);return f.listen("mouseover",function(){r.collection.highlight(f),f.highlight()}),r.collection.listen("highlight",f.lowlight),f.listen("select",function(n){r.collection.fire("select",n),u(n)}),f}var r=new i.Eventable(this);return r.options=t||{},r.element=i.create("div",{className:"pca pcalist"}),r.collection=new i.Collection,r.visible=!0,r.scroll={held:!1,moved:!1,origin:0,position:0,x:0,y:0,dx:0,dy:0},r.highlightedItem=null,r.headerItem=null,r.footerItem=null,r.firstItem=null,r.lastItem=null,r.firstItemClass="pcafirstitem",r.lastItemClass="pcalastitem",r.options.minItems=r.options.minItems||0,r.options.maxItems=r.options.maxItems||10,r.options.allowTab=r.options.allowTab||!1,r.show=function(){return r.visible=!0,r.element.style.display="",r.fire("show"),r.resize(),r},r.hide=function(){return r.visible=!1,r.element.style.display="none",r.fire("hide"),r},r.draw=function(){return r.destroy(),r.headerItem&&r.element.appendChild(r.headerItem.element),r.collection.all(function(n){r.element.appendChild(n.element)}),r.footerItem&&r.element.appendChild(r.footerItem.element),r.resize(),r.fire("draw"),r},r.markItems=function(){r.firstItem&&i.removeClass(r.firstItem.element,r.firstItemClass),r.lastItem&&i.removeClass(r.lastItem.element,r.lastItemClass),r.collection.count&&(r.firstItem=r.headerItem||r.collection.firstVisibleItem,r.lastItem=r.footerItem||r.collection.lastVisibleItem,i.addClass(r.firstItem.element,r.firstItemClass),i.addClass(r.lastItem.element,r.lastItemClass))},r.add=function(n,t,i){return r.collection.add(n,t,i),r.draw(),r},r.destroy=function(){while(r.element.childNodes&&r.element.childNodes.length)r.element.removeChild(r.element.childNodes[0]);return r},r.clear=function(){return r.collection.clear(),r.destroy(),r.fire("clear"),r},r.setScroll=function(n){return r.element.scrollTop=n,r.fire("scroll"),r},r.enableTouch=function(){function f(t){t=t||n.event,r.scroll.held=!0,r.scroll.moved=!1,r.scroll.origin=parseInt(r.scrollTop),r.scroll.y=parseInt(t.touches[0].pageY)}function e(){r.scroll.held=!1}function t(){r.scroll.held=!1}function u(t){r.scroll.held&&(t=t||n.event,i.smash(t),r.scroll.dy=r.scroll.y-parseInt(t.touches[0].pageY),r.scroll.position=r.scroll.origin+r.scroll.dy,r.setScroll(r.scroll.position),r.scroll.moved=!0)}return i.listen(r.element,"touchstart",f),i.listen(r.element,"touchmove",u),i.listen(r.element,"touchend",e),i.listen(r.element,"touchcancel",t),r},r.move=function(n){return n&&(r.collection.highlight(n),(n==r.headerItem||n==r.footerItem)&&n.highlight(),r.scrollToItem(n)),r},r.next=function(){return r.move(r.nextItem())},r.previous=function(){return r.move(r.previousItem())},r.first=function(){return r.move(r.firstItem)},r.last=function(){return r.move(r.lastItem)},r.nextItem=function(){return r.highlightedItem?r.highlightedItem==r.collection.lastVisibleItem&&(r.footerItem||r.headerItem)?r.footerItem||r.headerItem:r.footerItem&&r.headerItem&&r.highlightedItem==r.footerItem?r.headerItem:r.collection.next():r.firstItem},r.previousItem=function(){return r.highlightedItem?r.highlightedItem==r.collection.firstVisibleItem&&(r.footerItem||r.headerItem)?r.headerItem||r.footerItem:r.footerItem&&r.headerItem&&r.highlightedItem==r.headerItem?r.footerItem:r.collection.previous():r.lastItem},r.currentItem=function(){return r.highlightedItem},r.selectable=function(){return r.visible&&!!r.currentItem()},r.select=function(){return r.selectable()&&r.currentItem().select(),r},r.navigate=function(n){switch(n){case 40:return r.next(),!0;case 38:return r.previous(),!0;case 13:if(r.selectable())return r.select(),!0;case 9:if(r.options.allowTab)return r.next(),!0}return!1},r.scrollToItem=function(n){return r.scroll.position=r.element.scrollTop,n.element.offsetTopr.scroll.position+r.element.offsetHeight&&(r.scroll.position=n.element.offsetTop+n.element.offsetHeight-r.element.offsetHeight,r.setScroll(r.scroll.position)),r},r.filter=function(n){var t=r.collection.count;return r.collection.filter(n),r.markItems(),t!=r.collection.count&&r.fire("filter",n),r},r.getHeight=function(){for(var t=r.collection.visibleItems(),o=r.headerItem?i.getSize(r.headerItem.element).height:0,e=r.footerItem?i.getSize(r.footerItem.element).height:0,f=0,u=0,n=0;n0&&(r.element.style.height=n+"px")},r.setHeaderItem=function(n,t,f){return r.headerItem=u(n,t,f),i.addClass(r.footerItem.element,"pcaheaderitem"),r.markItems(),r},r.setFooterItem=function(n,t,f){return r.footerItem=u(n,t,f),i.addClass(r.footerItem.element,"pcafooteritem"),r.markItems(),r},r.collection.listen("highlight",function(n){r.highlightedItem=n}),r.collection.listen("add",function(n){r.markItems(),r.fire("add",n)}),r.options.name&&(i.setAttributes(r.element,{id:r.options.name,role:"listbox","aria-activedescendant":""}),r.collection.listen("add",function(n){function u(n){n.listen("highlight",function(){i.setAttributes(r.element,{"aria-activedescendant":n.id})})}for(var t=0;th.height,a,l;return e.upwards=!b&&p&&!e.options.onlyDown,e.upwards?e.options.force?e.element.style.top=-(h.height+v.height+2)+"px":(e.element.style.top=s.top-c.top-h.height+(o?f.top:0)+"px",e.element.style.left=s.left-c.left+(o?f.left:0)+"px"):e.options.force?e.element.style.top="auto":(e.element.style.top=s.top-c.top+v.height+1+(o?f.top:0)+"px",e.element.style.left=s.left-c.left+(o?f.left:0)+"px"),e.options.left&&(e.element.style.left=parseInt(e.element.style.left)+parseInt(e.options.left)+"px"),e.options.top&&(e.element.style.top=parseInt(e.element.style.top)+parseInt(e.options.top)+"px"),a=parseInt(i.getStyle(e.element,"borderLeftWidth"))+parseInt(i.getStyle(e.element,"borderRightWidth"))||0,l=Math.max(i.getSize(t).width-a,0),e.fixedWidth||(e.element.style.minWidth=l+"px"),(r.documentMode&&r.documentMode<=7||/\bMSIE (7|6)/.test(i.agent))&&(e.setWidth(Math.max(l,280)),e.element.style.left=(parseInt(e.element.style.left)||0)-2+"px",e.element.style.top=(parseInt(e.element.style.top)||0)-2+"px"),e.positionField=t,e.fire("move"),e},e.reposition=function(){return e.positionField&&e.position(e.positionField),e},e.prompt=function(n,t){if(typeof t=="number"){if(t==0?n=" "+n:t>=n.length?(n=n+" ",t++):(n=n.substring(0,t)+" "+n.substring(t,n.length),t++),i.setValue(e.field,n),e.field.setSelectionRange)e.field.focus(),e.field.setSelectionRange(t,t);else if(e.field.createTextRange){var r=e.field.createTextRange();r.move("character",t),r.select()}}else i.setValue(e.field,n);return e},e.show=function(){return e.disabled||e.stealth||(e.visible=!0,e.element.style.display="",e.list.collection.count?(e.options.emptyMessage&&e.header.clear().hide(),e.list.show()):(e.options.emptyMessage&&e.header.setText(e.options.emptyMessage).show(),e.list.hide()),e.setScroll(0),e.reposition(),e.fire("show")),e},e.showAll=function(){e.list.filter(""),e.show()},e.hide=function(){return e.visible=!1,e.element.style.display="none",e.fire("hide"),e},e.focus=function(n){e.field=n,e.focused=!0,e.show(),e.position(n),e.fire("focus")},e.blur=function(){e.focused=!1,e.checkHide(),e.fire("blur")},e.checkHide=function(){return!e.visible||e.focused||e.hover||e.hide(),e},e.handleKey=function(n,t){n==27?(e.hide(),e.fire("escape")):n==17?e.controlDown=!1:n==8||n==46?(e.filter(),e.fire("delete")):n!=0&&n<=46&&n!=32?e.visible&&e.list.navigate(n)?t&&i.smash(t):(n==38||n==40)&&e.filter():e.visible&&e.filter(),e.fire("keyup",n)},e.keydown=function(t){t=t||n.event;var r=t.which||t.keyCode;r==17&&(e.controlDown=!0),r==9&&e.options.allowTab&&i.smash(t)},e.keyup=function(t){t=t||n.event;var i=t.which||t.keyCode;e.handleKey(i,t)},e.keypress=function(t){var r=n.event?n.event.keyCode:t.which;e.visible&&r==13&&e.list.selectable()&&i.smash(t)},e.paste=function(){n.setTimeout(function(){e.filter(),e.fire("paste")},0)},e.click=function(n){e.fire("click",n)},e.dblclick=function(n){e.fire("dblclick",n)},e.change=function(n){e.fire("change",n)},e.resize=function(){e.visible&&e.reposition()},e.add=function(n,t,i){return e.list.add(n,t,i),e},e.clear=function(){return e.list.clear(),e},e.setScroll=function(n){return e.list.setScroll(n),e},e.setWidth=function(n){return typeof n=="number"?(n=Math.max(n,220),e.element.style.width=n+"px",r.documentMode&&r.documentMode<=5&&(n-=2),e.list.element.style.width=n+"px"):(e.element.style.width=n,e.list.element.style.width=n),e.fixedWidth=n!="auto",e.element.style.minWidth=0,e},e.setHeight=function(n){return e.list.element.style.height=typeof n=="number"?n+"px":n,e},e.filter=function(n){return n=n||i.getValue(e.field),e.skipFilter?e.list.collection.match(n).length+/g,"")},i.escapeHtml=function(n){return i.replaceList(n,i.hypertext)},i.validId=function(n){return/[a-z0-9-_:\.\[\]]+/gi.exec(n)},i.trimSpaces=function(n){return n.replace(/^\s+|\s(?=\s)|\s$/g,"")},i.tidy=function(n,t){t=t.replace("\\","\\\\");var i=new RegExp("^"+t+"+|"+t+"(?="+t+")|"+t+"$","gi");return n.replace(i,"")},i.getText=function(n){return/[a-zA-Z][a-zA-Z\s]+[a-zA-Z]/.exec(n)},i.getNumber=function(n){return/\d+/.exec(n)},i.parseJSON=function(n){return n&&/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?typeof JSON!="undefined"?JSON.parse(n):eval(n):{}},i.parseJSONDate=function(n){return new Date(parseInt(i.getNumber(n)))},i.containsWord=function(n,t){var i=new RegExp("\\b"+t+"\\b","gi");return i.test(n)},i.removeWord=function(n,t){var i=new RegExp("\\s?\\b"+t+"\\b","gi");return n.replace(i,"")},i.merge=function(n,t){for(var i in n)t[i]||(t[i]=n[i]);return t},i.getElement=function(n,t){var f,u;if(!n)return null;if(typeof n.nodeType=="number")return n;if(typeof n=="string"){if(t=i.getElement(t)||r,f=t.getElementById?t.getElementById(n):null,f)return f;if(u=t.getElementsByName?t.getElementsByName(n):null,u.length)return u[0]}return i.fuzzyMatch?i.getElementByRegex(n,t):null},i.getElementByRegex=function(n,t){var e,o,u,f;if(typeof n=="string")try{n=new RegExp(n)}catch(s){return null}if(n&&typeof n=="object"&&n.constructor==RegExp)for(t=i.getElement(t)||r,e=0;e"))},i.inputField=function(n){return(n=i.getElement(n))?n.tagName&&(n.tagName=="INPUT"||n.tagName=="TEXTAREA")&&n.type&&(n.type=="text"||n.type=="search"||n.type=="email"||n.type=="textarea"):!1},i.selectList=function(n){return(n=i.getElement(n))?n.tagName&&n.tagName=="SELECT":!1},i.getSelectedItem=function(n){return(n=i.getElement(n))&&n.tagName=="SELECT"&&n.selectedIndex>=0?n.options[n.selectedIndex]:null},i.checkBox=function(n){return(n=i.getElement(n))?n.tagName&&n.tagName=="INPUT"&&n.type&&n.type=="checkbox":!1},i.clear=function(n){i.setValue(n,"")},i.getPosition=function(t){var e={left:0,top:0},f,r;if(t=i.getElement(t)){if(!t.tagName)return e;if(typeof t.getBoundingClientRect!="undefined"){var h=t.getBoundingClientRect(),o=!u(i.getTopOffsetParent(t)),c=i.getScroll(n),s=i.getParentScroll(t);return{left:h.left+s.left+(o?0:c.left),top:h.top+s.top+(o?0:c.top)}}f=0,r=0;do f+=t.offsetLeft,r+=t.offsetTop;while(t=t.offsetParent);return{left:f,top:r}}return e},i.getScroll=function(n){return{left:parseInt(n.scrollX||n.scrollLeft,10)||(u(n)?parseInt(r.documentElement.scrollLeft)||0:0),top:parseInt(n.scrollY||n.scrollTop,10)||(u(n)?parseInt(r.documentElement.scrollTop)||0:0)}},i.getSize=function(n){return{height:n.offsetHeight||n.innerHeight||(u(n)?r.documentElement.clientHeight||r.body.clientHeight:0),width:n.offsetWidth||n.innerWidth||(u(n)?r.documentElement.clientWidth||r.body.clientWidth:0)}},i.getParentScroll=function(n){var f={left:0,top:0},r,t;if(n=i.getElement(n)){if(!n.tagName||!(n=n.parentNode))return f;r=0,t=0;do{if(u(n))break;r+=parseInt(n.scrollLeft)||0,t+=parseInt(n.scrollTop)||0}while(n=n.parentNode);return{left:r,top:t}}return f},i.getTopOffsetParent=function(n){while(n.offsetParent)if(n=n.offsetParent,i.getStyle(n,"position")=="fixed")break;return n},i.getStyle=function(t,i){return((n.getComputedStyle?n.getComputedStyle(t):t.currentStyle)||{})[i]||""},i.addClass=function(n,t){(n=i.getElement(n))&&(i.containsWord(n.className||"",t)||(n.className+=(n.className?" ":"")+t))},i.removeClass=function(n,t){(n=i.getElement(n))&&(n.className=i.removeWord(n.className,t))},i.setAttribute=function(n,t,r){(n=i.getElement(n))&&n.setAttribute(t,r)},i.setAttributes=function(n,t){if(n=i.getElement(n))for(var r in t)n.setAttribute(r,t[r])},i.applyStyleFixes=function(n,t){for(var h,u,f,s,o,e=0;e
{"+r.nameProperty+"}
",r.load=function(){function l(n){r.change(n),r.fire("select",n)}function c(t){if(n.selectList(t)){var i=n.getSelectedItem(t);r.change(r.find(i.value)||r.find(i.text))}else r.setCountry(n.getValue(t));r.textChanged=!1}var s,i,e,h,t,u,o,f;if(n.addClass(r.autocomplete.element,"pcacountrylist"),r.options.codesList){for(s=r.options.codesList.replace(/\s/g,"").split(","),i=[],r.autocomplete.clear(),e=0;e{count} matching results"},cy:{DIDYOUMEAN:"A oeddech yn meddwl:",NORESULTS:"Dim canlyniadau ar ganlyniadau",KEEPTYPING:"Cadwch teipio eich cyfeiriad i arddangos mwy o ganlyniadau",RETRIEVEERROR:"Mae'n ddrwg gennym, ni allem adfer y cyfeiriad hwn",SERVICEERROR:"Gwall gwasanaeth:",COUNTRYSELECT:"Dewiswch gwlad",NOLOCATION:"Mae'n ddrwg gennym, nid oeddem yn gallu cael eich lleoliad",NOCOUNTRY:"Mae'n ddrwg gennym, ni allem ddod o hyd y wlad hon",MANUALENTRY:"Ni allaf ddod o hyd i fy nghyfeiriad. Gadewch i mi deipio mewn",RESULTCOUNT:"{count} Canlyniadau paru"},fr:{DIDYOUMEAN:"Vouliez-vous dire:",NORESULTS:"Aucun résultat n'a été trouvé",KEEPTYPING:"Continuer à taper votre adresse pour afficher plus de résultats",RETRIEVEERROR:"Désolé , nous ne pouvions pas récupérer cette adresse",SERVICEERROR:"Erreur de service:",COUNTRYSELECT:"Changer de pays",NOLOCATION:"Désolé, nous n'avons pas pu obtenir votre emplacement",NOCOUNTRY:"Désolé, nous n'avons pas trouvé ce pays",MANUALENTRY:"Je ne peux pas trouver mon adresse. Permettez-moi de taper dans",RESULTCOUNT:"{count} résultats correspondants"},de:{DIDYOUMEAN:"Meinten Sie:",NORESULTS:"Keine Adressen gefunden",KEEPTYPING:"Geben Sie mehr von Ihrer Adresse ein, um weitere Ergebnisse anzuzeigen",RETRIEVEERROR:"Wir konnten diese Adresse leider nicht abrufen",SERVICEERROR:"Service-Fehler:",COUNTRYSELECT:"Land wechseln",NOLOCATION:"Wir konnten Ihren Standort leider nicht finden",NOCOUNTRY:"Wir konnten dieses Land leider nicht finden",MANUALENTRY:"Ich kann meine Adresse nicht finden. Lassen Sie mich es manuell eingeben",RESULTCOUNT:"{count} passenden Ergebnisse"}},n.exampleAddress={Id:"GBR|PR|52509479|0|0|0",DomesticId:"52509479",Language:"ENG",LanguageAlternatives:"ENG",Department:"",Company:"Postcode Anywhere (Europe) Ltd",SubBuilding:"",BuildingNumber:"",BuildingName:"Waterside",SecondaryStreet:"",Street:"Basin Road",Block:"",Neighbourhood:"",District:"",City:"Worcester",Line1:"Waterside",Line2:"Basin Road",Line3:"",Line4:"",Line5:"",AdminAreaName:"Worcester",AdminAreaCode:"47UE",Province:"Worcestershire",ProvinceName:"Worcestershire",ProvinceCode:"",PostalCode:"WR5 3DA",CountryName:"United Kingdom",CountryIso2:"GB",CountryIso3:"GBR",CountryIsoNumber:826,SortingNumber1:"94142",SortingNumber2:"",Barcode:"(WR53DA1PX)",Label:"Postcode Anywhere (Europe) Ltd\nWaterside\nBasin Road\n\nWorcester\nWR5 3DA\nUnited Kingdom",Type:"Commercial",DataLevel:"Premise",Field1:"",Field2:"",Field3:"",Field4:"",Field5:"",Field6:"",Field7:"",Field8:"",Field9:"",Field10:"",Field11:"",Field12:"",Field13:"",Field14:"",Field15:"",Field16:"",Field17:"",Field18:"",Field19:"",Field20:""},n.templates={AUTOCOMPLETE:"{HighlightedText}{{Description}}"},n.Address=function(t,i){function u(){r.lastActionTimer!=null&&(window.clearTimeout(r.lastActionTimer),r.lastActionTimer=null)}function f(){r.reset(),r.message(n.messages[r.language].NORESULTS,{clickToDisable:r.options.manualEntry,error:!0,clearList:!0}),r.fire("noresults")}function e(t){r.message(n.formatLine({count:t},n.messages[r.language].RESULTCOUNT))}var r=new n.Eventable(this);r.fields=t||[],r.options=i||{},r.key=r.options.key||"",r.options.name=r.options.name||"",r.options.source=r.options.source||"",r.options.populate=typeof r.options.populate=="boolean"?r.options.populate:!0,r.options.onlyInputs=typeof r.options.onlyInputs=="boolean"?r.options.onlyInputs:!1,r.options.autoSearch=typeof r.options.autoSearch=="boolean"?r.options.autoSearch:!1,r.options.preselect=typeof r.options.preselect=="boolean"?r.options.preselect:!0,r.options.minSearch=r.options.minSearch||1,r.options.minItems=r.options.minItems||1,r.options.maxItems=r.options.maxItems||7,r.options.advancedFields=r.options.advancedFields||[],r.options.manualEntry=typeof r.options.manualEntry=="boolean"?r.options.manualEntry:!1,r.options.manualEntryItem=typeof r.options.manualEntryItem=="boolean"?r.options.manualEntryItem:!1,r.options.disableTime=r.options.disableTime||6e4,r.options.suppressAutocomplete=typeof r.options.suppressAutocomplete=="boolean"?r.options.suppressAutocomplete:!0,r.options.setCountryByIP=typeof r.options.setCountryByIP=="boolean"?r.options.setCountryByIP:!1,r.options.brand=r.options.brand||"CanadaPost"||"PostcodeAnywhere",r.options.product=r.options.product||"AddressComplete",r.options.provider=r.options.provider||"AddressComplete"||"CapturePlus",r.options.culture=r.options.culture||"en-GB",r.options.prompt=typeof r.options.prompt=="boolean"?r.options.prompt:!1,r.options.promptDelay=r.options.promptDelay||0,r.options.inlineMessages=typeof r.options.inlineMessages=="boolean"?r.options.inlineMessages:!1,r.options.setCursor=typeof r.options.setCursor=="boolean"?r.options.setCursor:!1,r.options.matchCount=typeof r.options.matchCount=="boolean"?r.options.matchCount:!1,r.options.languagePreference=r.options.languagePreference||"",r.options.filteringMode=r.options.filteringMode||n.filteringMode.EVERYTHING,r.options.orderingMode=r.options.orderingMode||n.orderingMode.DEFAULT,r.options.countries=r.options.countries||{},r.options.countries.defaultCode=r.options.countries.defaultCode||"",r.options.countries.value=r.options.countries.value||"",r.options.countries.prepopulate=typeof r.options.countries.prepopulate=="boolean"?r.options.countries.prepopulate:!0,r.options.list=r.options.list||{},r.options.list.name=r.options.name?r.options.name+"_results":"",r.options.list.maxItems=r.options.list.maxItems||r.options.maxItems,r.options.list.minItems=r.options.list.minItems||r.options.minItems,r.options.countries.list=r.options.countries.list||n.merge(r.options.list,{}),r.options.countries.list.name=r.options.name?r.options.name+"_countries":"",r.options.bar=r.options.bar||{},r.options.bar.visible=typeof r.options.bar.visible=="boolean"?r.options.bar.visible:!0,r.options.bar.showCountry=typeof r.options.bar.showCountry=="boolean"?r.options.bar.showCountry:!0,r.options.bar.showLogo=typeof r.options.bar.showLogo=="boolean"?r.options.bar.showLogo:!0,r.options.bar.logoLink=typeof r.options.bar.logoLink=="boolean"?r.options.bar.logoLink:!1,r.options.bar.logoClass=r.options.bar.logoClass||"aclogo"||"pcalogo",r.options.bar.logoTitle=r.options.bar.logoTitle||"www.canadapost.ca",r.options.bar.logoUrl=r.options.bar.logoUrl||"http://www.canadapost.ca/pca",r.options.search=r.options.search||{},r.country=r.options.countries.defaultCode,r.advancedFields=r.options.advancedFields,r.initialSearch=!1,r.searchContext=null,r.lastActionTimer=null,r.notifcationTimer=null,r.storedSearch=null,r.geolocation=null,r.loaded=!1,r.language="en",r.filteringMode=r.options.filteringMode,r.orderingMode=r.options.orderingMode,r.autocomplete=null,r.countrylist=null,r.messageBox=null,r.load=function(){for(var p=[],h=[],t,v,f,b,e,w,y,u,a,l,o,s,c=0;c36)&&r.searchFromField()}),r.autocomplete.listen("paste",function(){r.newSearch(),r.searchFromField()}),r.autocomplete.listen("focus",r.focus),r.autocomplete.listen("blur",r.blur),r.autocomplete.listen("show",function(){r.fire("show")}),r.autocomplete.listen("hide",function(){r.fire("hide")}),r.autocomplete.listen("dblclick",r.searchFromField),r.autocomplete.list.listen("filter",function(){r.search(n.getValue(r.autocomplete.field))}),r.autocomplete.listen("delete",r.newSearch),!r.options.countries.value&&h.length&&(r.options.countries.value=n.getValue(h[0])),r.options.countries.language=r.language,r.countrylist=new n.CountryList(h,r.options.countries),r.countrylist.autocomplete.options.emptyMessage=n.messages[r.language].NOCOUNTRY,r.country=r.countrylist.country.iso3,r.countrylist.listen("change",function(n){r.country=n&&n.iso3?n.iso3:r.options.countries.defaultCode,r.fire("country",n)}),r.countrylist.listen("select",r.switchToSearchMode),r.countrylist.autocomplete.listen("filter",function(){r.options.preselect&&r.countrylist.autocomplete.list.first()}),r.countrylist.autocomplete.listen("show",function(){r.fire("show")}),r.countrylist.autocomplete.listen("hide",function(){r.autocomplete.enable(),r.storedSearch!=null&&n.setValue(r.autocomplete.field,r.storedSearch),r.storedSearch=null,r.fire("hide")}),r.countrylist.autocomplete.list.collection.count==1&&(r.options.bar.showCountry=!1),f=n.create("div",{className:"pcaflagbutton"}),b=r.countrylist.flag(),f.appendChild(b),r.autocomplete.footer.setContent(r.options.bar.showCountry?f:""),n.listen(f,"click",r.switchToCountrySelect),e=n.create("div",{className:"pcaflagbutton"}),w=r.countrylist.flag(),e.appendChild(w),r.countrylist.autocomplete.footer.setContent(r.options.bar.showCountry?e:""),n.listen(e,"click",r.switchToSearchMode),y=n.create("div",{className:"pcamessage pcadisableselect",innerHTML:n.messages[r.language].COUNTRYSELECT}),r.autocomplete.footer.setContent(r.options.bar.showCountry?y:""),u=n.create("a",{href:r.options.bar.logoUrl,target:"_blank",rel:"nofollow"}),a=n.create("div",{className:r.options.bar.logoClass+" pcalogo"+r.language,title:r.options.bar.logoTitle}),r.options.bar.logoLink?u.appendChild(a):u=a,r.autocomplete.footer.setContent(u),r.showFooterLogo=function(){u.style.display=r.options.bar.showLogo?"":"none"},r.showFooterMessage=function(){u.style.display=r.options.bar.showCountry?"none":r.options.bar.showLogo?"":"none"},r.options.bar.visible?(r.autocomplete.footer.show(),r.showFooterMessage()):r.autocomplete.hide(),l=n.create("div",{className:"pcamessage pcadisableselect",innerHTML:n.messages[r.language].COUNTRYSELECT}),r.countrylist.autocomplete.footer.setContent(r.options.bar.showCountry?l:""),r.options.bar.visible&&r.countrylist.autocomplete.footer.show(),r.options.manualEntryItem&&r.addManualEntryItem(),r.options.setCountryByIP&&r.setCountryByIP(),i.name&&(o=i.list.name,s=i.countries.list.name,n.setAttributes(y,{id:o+"_label"}),n.setAttributes(f,{id:o+"_button",role:"button","aria-labelledby":o+"_label"}),n.setAttributes(l,{id:s+"_label"}),n.setAttributes(e,{id:s+"_button",role:"button","aria-labelledby":s+"_label"})),r.messageBox=n.create("div",{className:"pcatext pcanotification"}),n.append(r.messageBox,n.container),r.loaded=!0,r.fire("load")},r.searchFromField=function(){var t=n.getValue(r.autocomplete.field);t&&!r.autocomplete.disabled&&!r.initialSearch&&t.length>=r.options.minSearch&&(r.initialSearch=!0,r.search(t))},r.search=function(t){function o(t,i){t.length?r.display(t,n.templates.AUTOCOMPLETE,i):f()}var e,i,u;return r.searchContext&&(~t.indexOf(r.searchContext.search)?t=t.replace(r.searchContext.search,r.searchContext.text):r.searchContext=null),e=r.searchContext?r.searchContext.id||"":"",i={searchTerm:t,lastId:e,options:r.options.search},r.fire("search",i),i.searchTerm&&(u={Key:r.key,Country:r.country,SearchTerm:i.searchTerm,LanguagePreference:r.language,LastId:i.lastId,SearchFor:r.filteringMode,OrderBy:r.orderingMode,$block:!0,$cache:!0},i.options.maxSuggestions&&(u.MaxSuggestions=i.options.maxSuggestions),i.options.maxResults&&(u.MaxResults=i.options.maxResults),n.fetch(r.options.provider+"/Interactive/Find/v2.10",u,o,r.error)),r},r.searchByLocation=function(t,i){function s(n){n&&n.coords?(t=n.coords.latitude,i=n.coords.longitude,o=n.coords.accuracy,r.geolocation=n.coords,r.fire("location",r.geolocation),e()):u()}function u(){r.message(n.messages[r.language].NOLOCATION,!0),r.fire("location")}function e(){function u(t,i){t.length?r.display(t,n.templates.AUTOCOMPLETE,i):f()}n.fetch(r.options.provider+"/Interactive/FindByPosition/v2.00",{Key:r.key,Latitude:t,Longitude:i,LocationAccuracy:o,LanguagePreference:r.language,$block:!0,$cache:!0},u,r.error)}var o=0;return(t||t==0)&&(i||i==0)?e():navigator.geolocation?navigator.geolocation.getCurrentPosition(s,u,{enableHighAccuracy:!0}):u(),r},r.retrieve=function(t){function e(n){n.length?r.populate(n):u(n)}function u(t){r.message(n.messages[r.language].RETRIEVEERROR,{clickToDisable:r.options.manualEntry,error:!0,clearList:!0}),r.error(t)}for(var f={Key:r.key,Id:t,Source:r.options.source,$cache:!0},i=0;i=0?t.Cursor:null)):(n.setValue(r.autocomplete.field,i+" "),r.autocomplete.field.focus()),r.searchContext={id:t.Id,text:t.Text,search:i},r.search(i)}return r.fire("select",t),t.Next=="Retrieve"?r.retrieve(t.Id):i(),r},r.highlight=function(n,t,i){var e,r,o,f,u;for(t=t||"",i=i||"",e=0;e=0;f--)u=o[f].split("-"),r.HighlightedText=r.HighlightedText.substring(0,parseInt(u[0]))+t+r.HighlightedText.substring(parseInt(u[0]),parseInt(u[1]))+i+r.HighlightedText.substring(parseInt(u[1]),r.HighlightedText.length)},r.populate=function(t){var u=t[0],h,f,a,o,v,l,e,s,i,c,y;if(r.options.languagePreference)for(h=0;h1)return n.Company;t==1&&i==1?e=n.Company:(t--,i--)}for(u=n.Line1?n.Line2?n.Line3?n.Line4?n.Line5?5:4:3:2:1:0,o=i>=u?t:Math.floor(1+(u/i+(i-(t-1))/i)*(t-1)),s=Math.floor(u/i+(i-t)/i),f=0;f1?t.substring(0,2).toLowerCase():"en",n.messages[r.language]||(r.language="en")},r.setCulture=function(n){r.options.culture=n,r.reload()},r.setWidth=function(n){r.autocomplete.setWidth(n),r.countrylist.autocomplete.setWidth(n)},r.setHeight=function(n){r.autocomplete.setHeight(n),r.countrylist.autocomplete.setHeight(n)},r.clear=function(){for(var t=0;t{text}",r.manualEntry)},r.bound=function(i){if(i=n.getElement(i))for(var u=0;ui.limit?(n.post=!0,o(n)):(t.onreadystatechange=function(){t.readyState===4&&t.status===200&&n.callback(i.parseJSON(t.responseText))},n.credentials&&(t.withCredentials=n.credentials),t.onerror=n.serviceError,t.ontimeout=n.timeoutError,t.open("GET",n.url,!0),t.send())}function h(n){var t=i.create("script",{type:"text/javascript",async:"async"}),u=r.getElementsByTagName("head")[0];n.position=i.scriptRequests.push(n),t.src=n.url+"&callback=pca.scriptRequests["+(n.position-1)+"].callback",t.onload=t.onreadystatechange=function(){this.readyState&&this.readyState!=="loaded"&&this.readyState!=="complete"||(t.onload=t.onreadystatechange=null,u&&t.parentNode&&u.removeChild(t))},t.src.length>i.limit?(n.post=!0,o(n)):u.insertBefore(t,u.firstChild)}function l(t){n.navigator.appName==="Microsoft Internet Explorer"?h(t):y(t)}function s(t){if(i.blockRequests&&i.waitingRequest){i.requestQueue=[t];return}if(t.block&&(i.blockRequests=!0),t.queue&&i.waitingRequest){i.requestQueue.push(t);return}if(i.waitingRequest=!0,t.cache&&i.requestCache[t.url]){function r(){t.callback(i.requestCache[t.url].response)}n.setImmediate?n.setImmediate(r):n.setTimeout(r,1);return}t.post?o(t):l(t)}function c(n){i.waitingRequest=!1,n.block&&(i.blockRequests=!1),n.unwrapped?n.success(n.response,n.response,n):n.response.Items.length===1&&n.response.Items[0].Error!==t?n.error(n.response.Items[0].Description,n):n.success(n.response.Items,n.response,n),n.cache&&(i.requestCache[n.url]=n),n.position&&(i.scriptRequests[n.position-1]=null),i.requestQueue.length&&s(i.requestQueue.shift())}var i=n.pca=n.pca||{},r=n.document,e,f;typeof r=="undefined"&&(r={attachEvent:function(){},location:{}}),typeof n.location=="undefined"&&(n.location={}),typeof n.navigator=="undefined"&&(n.navigator={}),typeof n.attachEvent=="undefined"&&(n.attachEvent=function(){}),i.protocol="https:",i.host="ws1.postescanada-canadapost.ca",i.endpoint="json3ex.ws",i.limit=2e3,i.sourceString=i.sourceString||"PCA-SCRIPT",i.synonyms=i.synonyms||[{r:/\bN(?=\s)/,w:"NORTH"},{r:/\b(?:NE|NORTHEAST)(?=\s)/,w:"NORTH EAST"},{r:/\b(?:NW|NORTHWEST)(?=\s)/,w:"NORTH WEST"},{r:/\bS(?=\s)/,w:"SOUTH"},{r:/\b(?:SE|SOUTHEAST)(?=\s)/,w:"SOUTH EAST"},{r:/\b(?:SW|SOUTHWEST)(?=\s)/,w:"SOUTH WEST"},{r:/\bE(?=\s)/,w:"EAST"},{r:/\bW(?=\s)/,w:"WEST"},{r:/\bST(?=\s)/,w:"SAINT"}],i.diacritics=i.diacritics||[{r:/[ÀÁÂÃ]/gi,w:"A"},{r:/Å/gi,w:"AA"},{r:/[ÆæÄ]/gi,w:"AE"},{r:/Ç/gi,w:"C"},{r:/Ð/gi,w:"DJ"},{r:/[ÈÉÊË]/gi,w:"E"},{r:/[ÌÍÏ]/gi,w:"I"},{r:/Ñ/gi,w:"N"},{r:/[ÒÓÔÕ]/gi,w:"O"},{r:/[ŒØÖ]/gi,w:"OE"},{r:/Š/gi,w:"SH"},{r:/ß/gi,w:"SS"},{r:/[ÙÚÛ]/gi,w:"U"},{r:/Ü/gi,w:"UE"},{r:/[ŸÝ]/gi,w:"ZH"},{r:/-/gi,w:" "},{r:/[.,]/gi,w:""}],i.hypertext=i.hypertext||[{r:/&/g,w:"&"},{r:/"/g,w:"""},{r:/'/g,w:"'"},{r://g,w:">"}],i.requestQueue=i.requestQueue||[],i.requestCache=i.requestCache||{},i.scriptRequests=i.scriptRequests||[],i.waitingRequest=i.waitingRequest||!1,i.blockRequests=i.blockRequests||!1,i.styleFixes=i.styleFixes||[],i.agent=i.agent||n.navigator&&n.navigator.userAgent||"",i.galaxyFix=i.galaxyFix||/Safari\/534.30/.test(i.agent)&&/GT-I8190|GT-I9100|GT-I9305|GT-P3110/.test(i.agent),i.container=i.container||null,i.XMLHttpRequest=i.XMLHttpRequest||n.XMLHttpRequest,e=!1,f=[],i.fuzzyMatch=typeof i.fuzzyMatch=="undefined"?!0:i.fuzzyMatch,i.fuzzyTags=i.fuzzyTags||["*"],i.ready=i.ready||function(n){var i,t;if(e){if(f.length)for(i=f,f=[],t=0;t-1}),u&&(t=u.inCountryListMode?u.countrylist.autocomplete:u.autocomplete,t.list.collection.items.indexOf(r)==0&&n.keyCode==38?t.field&&(t.field.focus(),setTimeout(function(){i.moveCursorToEnd(t.field)},0)):n.keyCode==9||n.keyCode==27?!u.inCountryListMode&&u.options.bar.visible&&u.options.bar.showCountry||t.field&&(t.field.focus(),i.moveCursorToEnd(t.field),t.hide(),t.field.dispatchEvent(n),i.smash(n)):t.list.navigate(n.keyCode)))}),r.visible=!0,r.highlight=function(){return i.addClass(r.element,u),r.fire("highlight"),r.element.focus(),r},r.lowlight=function(){return i.removeClass(r.element,u),r.fire("lowlight"),r},r.mouseover=function(){r.fire("mouseover")},r.mouseout=function(){r.fire("mouseout")},r.mousedown=function(){r.fire("mousedown")},r.mouseup=function(){r.fire("mouseup"),i.galaxyFix&&r.select()},r.click=function(){(r.fire("click"),i.galaxyFix)||r.select()},r.select=function(){return r.fire("select",r.data),r},r.hide=function(){return r.visible=!1,r.element.style.display="none",r.fire("hide"),r},r.show=function(){return r.visible=!0,r.element.style.display="",r.fire("show"),r},i.listen(r.element,"mouseout",r.mouseout),i.listen(r.element,"mousedown",r.mousedown),i.listen(r.element,"mouseup",r.mouseup),i.listen(r.element,"click",r.click),r},i.Collection=i.Collection||function(){var n=new i.Eventable(this);return n.items=[],n.highlighted=-1,n.count=0,n.firstItem=null,n.lastItem=null,n.firstVisibleItem=null,n.lastVisibleItem=null,n.add=function(t,r,u){function o(t){var f=new i.Item(t,r);return f.listen("mouseover",function(){n.highlight(f)}),f.listen("select",function(t){n.fire("select",t),u(t)}),n.items.push(f),e.push(f),f}var e=[],f;if(u=u||function(){},t.length)for(f=0;fi.data[t]?1:-1:n.tag>i.tag?1:-1}),n.fire("sort"),n},n.reverse=function(){return n.items.reverse(),n.fire("reverse"),n},n.filter=function(t){var u=i.formatTag(t),r=n.count;return n.count=0,n.firstVisibleItem=null,n.lastVisibleItem=null,n.all(function(t){~t.tag.indexOf(u)?(t.show(),n.count++,n.firstVisibleItem=n.firstVisibleItem||t,n.lastVisibleItem=t):t.hide()}),r!==n.count&&n.fire("filter"),n},n.match=function(t){var u=i.formatTag(t),r=[];return n.all(function(n){~n.tag.indexOf(u)&&r.push(n)}),r},n.clear=function(){return n.items=[],n.count=0,n.highlighted=-1,n.firstItem=null,n.lastItem=null,n.firstVisibleItem=null,n.lastVisibleItem=null,n.fire("clear"),n},n.all=function(t){for(var i=0;i=0;i--)if(t?t(n.items[i]):n.items[i].visible)return n.items[i];return null},n.next=function(t){for(var i=n.highlighted+1;i=0;i--)if(t?t(n.items[i]):n.items[i].visible)return n.items[i]},n.visibleItems=function(){var t=[];return n.all(function(n){n.visible&&t.push(n)}),t},n},i.List=i.List||function(t){function u(n,t,u){var f=new i.Item(n,t);return f.listen("mouseover",function(){r.collection.highlight(f),f.highlight()}),r.collection.listen("highlight",f.lowlight),f.listen("select",function(n){r.collection.fire("select",n),u(n)}),f}var r=new i.Eventable(this);return r.options=t||{},r.element=i.create("div",{className:"pca pcalist"}),r.collection=new i.Collection,r.visible=!0,r.scroll={held:!1,moved:!1,origin:0,position:0,x:0,y:0,dx:0,dy:0},r.highlightedItem=null,r.headerItem=null,r.footerItem=null,r.firstItem=null,r.lastItem=null,r.firstItemClass="pcafirstitem",r.lastItemClass="pcalastitem",r.options.minItems=r.options.minItems||0,r.options.maxItems=r.options.maxItems||10,r.options.allowTab=r.options.allowTab||!1,r.show=function(){return r.visible=!0,r.element.style.display="",r.fire("show"),r.resize(),r},r.hide=function(){return r.visible=!1,r.element.style.display="none",r.fire("hide"),r},r.draw=function(){return r.destroy(),r.headerItem&&r.element.appendChild(r.headerItem.element),r.collection.all(function(n){r.element.appendChild(n.element)}),r.footerItem&&r.element.appendChild(r.footerItem.element),r.resize(),r.fire("draw"),r},r.markItems=function(){r.firstItem&&i.removeClass(r.firstItem.element,r.firstItemClass),r.lastItem&&i.removeClass(r.lastItem.element,r.lastItemClass),r.collection.count&&(r.firstItem=r.headerItem||r.collection.firstVisibleItem,r.lastItem=r.footerItem||r.collection.lastVisibleItem,i.addClass(r.firstItem.element,r.firstItemClass),i.addClass(r.lastItem.element,r.lastItemClass))},r.add=function(n,t,i){return r.collection.add(n,t,i),r.draw(),r},r.destroy=function(){while(r.element.childNodes&&r.element.childNodes.length)r.element.removeChild(r.element.childNodes[0]);return r},r.clear=function(){return r.collection.clear(),r.destroy(),r.fire("clear"),r},r.setScroll=function(n){return r.element.scrollTop=n,r.fire("scroll"),r},r.enableTouch=function(){function f(t){t=t||n.event,r.scroll.held=!0,r.scroll.moved=!1,r.scroll.origin=parseInt(r.scrollTop),r.scroll.y=parseInt(t.touches[0].pageY)}function e(){r.scroll.held=!1}function t(){r.scroll.held=!1}function u(t){r.scroll.held&&(t=t||n.event,i.smash(t),r.scroll.dy=r.scroll.y-parseInt(t.touches[0].pageY),r.scroll.position=r.scroll.origin+r.scroll.dy,r.setScroll(r.scroll.position),r.scroll.moved=!0)}return i.listen(r.element,"touchstart",f),i.listen(r.element,"touchmove",u),i.listen(r.element,"touchend",e),i.listen(r.element,"touchcancel",t),r},r.move=function(n){return n&&(r.collection.highlight(n),(n===r.headerItem||n===r.footerItem)&&n.highlight(),r.scrollToItem(n)),r},r.next=function(){return r.move(r.nextItem())},r.previous=function(){return r.move(r.previousItem())},r.first=function(){return r.move(r.firstItem)},r.last=function(){return r.move(r.lastItem)},r.nextItem=function(){return r.highlightedItem?r.highlightedItem===r.collection.lastVisibleItem&&(r.footerItem||r.headerItem)?r.footerItem||r.headerItem:r.footerItem&&r.headerItem&&r.highlightedItem===r.footerItem?r.headerItem:r.collection.next():r.firstItem},r.previousItem=function(){return r.highlightedItem?r.highlightedItem===r.collection.firstVisibleItem&&(r.footerItem||r.headerItem)?r.headerItem||r.footerItem:r.footerItem&&r.headerItem&&r.highlightedItem===r.headerItem?r.footerItem:r.collection.previous():r.lastItem},r.currentItem=function(){return r.highlightedItem},r.selectable=function(){return r.visible&&!!r.currentItem()},r.select=function(){return r.selectable()&&r.currentItem().select(),r},r.navigate=function(n,t){switch(n){case 40:return t?r.first():r.next(),!0;case 38:return r.previous(),!0;case 13:if(r.selectable())return r.select(),!0;case 9:if(r.options.allowTab)return r.next(),!0}return!1},r.scrollToItem=function(n){return r.scroll.position=r.element.scrollTop,n.element.offsetTopr.scroll.position+r.element.offsetHeight&&(r.scroll.position=n.element.offsetTop+n.element.offsetHeight-r.element.offsetHeight,r.setScroll(r.scroll.position)),r},r.filter=function(n){var t=r.collection.count;return r.collection.filter(n),r.markItems(),t!==r.collection.count&&r.fire("filter",n),r},r.getHeight=function(){for(var t=r.collection.visibleItems(),o=r.headerItem?i.getSize(r.headerItem.element).height:0,e=r.footerItem?i.getSize(r.footerItem.element).height:0,f=0,u=0,n=0;n0&&(r.element.style.height=n+"px")},r.setHeaderItem=function(n,t,f){return r.headerItem=u(n,t,f),i.addClass(r.footerItem.element,"pcaheaderitem"),r.markItems(),r},r.setFooterItem=function(n,t,f){return r.footerItem=u(n,t,f),i.addClass(r.footerItem.element,"pcafooteritem"),r.markItems(),r},r.collection.listen("highlight",function(n){r.highlightedItem=n}),r.collection.listen("add",function(n){r.markItems(),r.fire("add",n)}),i.setAttributes(r.element,{id:r.options.name,role:"listbox","aria-activedescendant":""}),r.options.ariaLabel&&i.setAttributes(r.element,{"aria-label":r.options.ariaLabel}),r.collection.listen("add",function(n){function u(n){n.listen("highlight",function(){i.setAttributes(r.element,{"aria-activedescendant":n.id})})}for(var t=0;ts.height,l,c;return f.upwards=!w&&y&&!f.options.onlyDown,f.upwards?f.options.force?f.element.style.top=-(s.height+a.height+2)+"px":(f.element.style.top=o.top-h.top-s.height+(e?u.top:0)+"px",f.element.style.left=o.left-h.left+(e?u.left:0)+"px"):f.options.force?f.element.style.top="auto":(f.element.style.top=o.top-h.top+a.height+1+(e?u.top:0)+"px",f.element.style.left=o.left-h.left+(e?u.left:0)+"px"),f.options.left&&(f.element.style.left=parseInt(f.element.style.left)+parseInt(f.options.left)+"px"),f.options.top&&(f.element.style.top=parseInt(f.element.style.top)+parseInt(f.options.top)+"px"),l=parseInt(i.getStyle(f.element,"borderLeftWidth"))+parseInt(i.getStyle(f.element,"borderRightWidth"))||0,c=Math.max(i.getSize(t).width-l,0),f.fixedWidth||(f.element.style.minWidth=c+"px"),(r.documentMode&&r.documentMode<=7||/\bMSIE\s(7|6)/.test(i.agent))&&(f.setWidth(Math.max(c,280)),f.element.style.left=(parseInt(f.element.style.left)||0)-2+"px",f.element.style.top=(parseInt(f.element.style.top)||0)-2+"px"),f.positionField=t,f.fire("move"),f},f.reposition=function(){return f.positionField&&f.position(f.positionField),f},f.prompt=function(n,t){if(typeof t=="number"){if(t===0?n=" "+n:t>=n.length?(n=n+" ",t++):(n=n.substring(0,t)+" "+n.substring(t,n.length),t++),i.setValue(f.field,n),f.field.setSelectionRange)f.field.focus(),f.field.setSelectionRange(t,t);else if(f.field.createTextRange){var r=f.field.createTextRange();r.move("character",t),r.select()}}else i.setValue(f.field,n);return f},f.show=function(){if(!f.disabled&&!f.stealth){if(f.visible=!0,f.element.style.display="",f.field.value.length>2){var n=f.options.language||"en",t=f.options&&f.options.type&&f.options.type==="countrylist";i.read(f.list.collection.count+" "+(f.list.collection.count==1?t?i.messages[n].COUNTRYAVAILABLE:i.messages[n].ADDRESSAVAILABLE:t?i.messages[n].COUNTRIESAVAILABLE:i.messages[n].ADDRESSESAVAILABLE))}f.list.collection.count?(f.options.emptyMessage&&f.header.clear().hide(),f.list.show()):(f.options.emptyMessage&&f.header.setText(f.options.emptyMessage).show(),f.list.hide()),f.setScroll(0),f.reposition(),f.fire("show"),f.exitEvent=r.addEventListener("click",f.externalClickHandler)}return f},f.externalClickHandler=function(){i.closestElement(event.target,".pca")||f.hide()},f.showAll=function(){f.list.filter(""),f.show()},f.hide=function(){return f.visible=!1,f.element.style.display="none",f.fire("hide"),r.removeEventListener("click",f.externalClickHandler),f},f.focus=function(n){f.field=n,f.focused=!0,f.show(),f.position(n),f.fire("focus")},f.checkHide=function(){return!f.visible||f.focused||f.hover||f.hide(),f},f.handleKey=function(n,t){n===27||n===9?(f.hide(),f.fire("escape")):n===17||n===91?f.controlDown=!1:n===18?f.altDown=!1:n===16?f.shiftDown=!1:n===8||n===46?(f.filter(),f.fire("delete")):n!==0&&n<=46&&n!==32?n!==38&&(f.visible&&f.list.navigate(n,!0)?t&&i.smash(t):n===40&&f.filter()):f.visible&&f.filter(),f.fire("keyup",n)},f.keydown=function(t,i){if(t.keyCode==9)f.hide();else{f.visible||f.focus(i),t=t||n.event;var r=t.which||t.keyCode;r===17||r===91?f.controlDown=!0:r===16?f.shiftDown=!0:r===18?f.altDown=!0:r===67&&f.shiftDown&&f.controlDown&&f.address&&(t.preventDefault(),f.address.switchToCountrySelect())}},f.keyup=function(t){t=t||n.event;var i=t.which||t.keyCode;f.handleKey(i,t)},f.keypress=function(t){var r=n.event?n.event.keyCode:t.which;f.visible&&r===13&&f.list.selectable()&&i.smash(t)},f.paste=function(){n.setTimeout(function(){f.filter(),f.fire("paste")},0)},f.click=function(n){f.fire("click",n)},f.dblclick=function(n){f.fire("dblclick",n)},f.change=function(n){f.fire("change",n)},f.resize=function(){f.visible&&f.reposition()},f.add=function(n,t,i){return f.list.add(n,t,i),f},f.clear=function(){return f.list.clear(),f},f.setScroll=function(n){return f.list.setScroll(n),f},f.setWidth=function(n){return typeof n=="number"?(n=Math.max(n,220),f.element.style.width=n+"px",r.documentMode&&r.documentMode<=5&&(n-=2),f.list.element.style.width=n+"px"):(f.element.style.width=n,f.list.element.style.width=n),f.fixedWidth=n!=="auto",f.element.style.minWidth=0,f},f.setHeight=function(n){return f.list.element.style.height=typeof n=="number"?n+"px":n,f},f.filter=function(n){return n=n||i.getValue(f.field),f.skipFilter?f.list.collection.match(n).length+/g,"")},i.escapeHtml=i.escapeHtml||function(n){return i.replaceList(n,i.hypertext)},i.validId=i.validId||function(n){return/[a-z0-9\-_:\.\[\]]+/gi.exec(n)},i.trimSpaces=i.trimSpaces||function(n){return n.replace(/^\s+|\s(?=\s)|\s$/g,"")},i.tidy=i.tidy||function(n,t){t=t.replace("\\","\\\\");var i=new RegExp("^"+t+"+|"+t+"(?="+t+")|"+t+"$","gi");return n.replace(i,"")},i.getText=i.getText||function(n){return/[a-zA-Z][a-zA-Z\s]+[a-zA-Z]/.exec(n)},i.getNumber=i.getNumber||function(n){return/\d+/.exec(n)},i.parseJSON=i.parseJSON||function(n){return n&&/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?typeof JSON!="undefined"?JSON.parse(n):eval(n):{}},i.parseJSONDate=i.parseJSONDate||function(n){return new Date(parseInt(i.getNumber(n)))},i.containsWord=i.containsWord||function(n,t){var i=new RegExp("\\b"+t+"\\b","gi");return i.test(n)},i.removeWord=i.removeWord||function(n,t){var i=new RegExp("\\s?\\b"+t+"\\b","gi");return n.replace(i,"")},i.merge=i.merge||function(n,t){for(var i in n)t[i]||(t[i]=n[i]);return t},i.getElement=i.getElement||function(n,t){var f,u;if(!n)return null;if(typeof n.nodeType=="number")return n;if(typeof n=="string"){if(t=i.getElement(t)||r,f=t.getElementById?t.getElementById(n):null,f)return f;if(u=t.getElementsByName?t.getElementsByName(n):null,u.length)return u[0]}return i.fuzzyMatch?i.getElementByRegex(n,t):null},i.matches=i.matches||function(t,i){if(typeof n.Element.prototype.matches=="function")return t.matches(i);for(var u=(t.document||t.ownerDocument).querySelectorAll(i),r=0;u[r]&&u[r]!==t;)++r;return Boolean(u[r])},i.closestElement=i.closestElement||function(t,r){if(typeof n.Element.prototype.closest=="function")return t.closest(r);while(t&&t.nodeType===1){if(i.matches(t,r))return t;t=t.parentNode}return null},i.getElementByRegex=i.getElementByRegex||function(n,t){var e,o,u,f;if(typeof n=="string")try{n=new RegExp(n)}catch(s){return null}if(n&&typeof n=="object"&&n.constructor===RegExp)for(t=i.getElement(t)||r,e=0;e"))},i.inputField=i.inputField||function(n){return(n=i.getElement(n))?n.tagName&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA")&&n.type&&(n.type==="text"||n.type==="search"||n.type==="email"||n.type==="textarea"||n.type==="number"||n.type==="tel"):!1},i.selectList=i.selectList||function(n){return(n=i.getElement(n))?n.tagName&&n.tagName==="SELECT":!1},i.moveCursorToEnd=i.moveCursorToEnd||function(n){if(typeof n.selectionStart=="number")n.selectionStart=n.selectionEnd=n.value.length;else if(typeof n.createTextRange!="undefined"){n.focus();var t=n.createTextRange();t.collapse(!1),t.select()}},i.getSelectedItem=i.getSelectedItem||function(n){return(n=i.getElement(n))&&n.tagName==="SELECT"&&n.selectedIndex>=0?n.options[n.selectedIndex]:null},i.checkBox=i.checkBox||function(n){return(n=i.getElement(n))?n.tagName&&n.tagName==="INPUT"&&n.type&&n.type==="checkbox":!1},i.clear=i.clear||function(n){return i.setValue(n,""),i},i.getPosition=i.getPosition||function(t){var f={left:0,top:0},u,r;if(t=i.getElement(t)){if(!t.tagName)return f;if(typeof t.getBoundingClientRect!="undefined"){var s=t.getBoundingClientRect(),e=!i.isPage(i.getTopOffsetParent(t)),h=i.getScroll(n),o=i.getParentScroll(t);return{left:s.left+o.left+(e?0:h.left),top:s.top+o.top+(e?0:h.top)}}u=0,r=0;do u+=t.offsetLeft,r+=t.offsetTop;while(t=t.offsetParent);return{left:u,top:r}}return f},i.isPage=i.isPage||function(t){return t===n||t===r||t===r.body},i.getScroll=i.getScroll||function(n){return{left:parseInt(n.scrollX||n.scrollLeft,10)||(i.isPage(n)?parseInt(r.documentElement.scrollLeft)||0:0),top:parseInt(n.scrollY||n.scrollTop,10)||(i.isPage(n)?parseInt(r.documentElement.scrollTop)||0:0)}},i.getSize=i.getSize||function(n){return{height:n.offsetHeight||n.innerHeight||(i.isPage(n)?r.documentElement.clientHeight||r.body.clientHeight:0),width:n.offsetWidth||n.innerWidth||(i.isPage(n)?r.documentElement.clientWidth||r.body.clientWidth:0)}},i.getParentScroll=i.getParentScroll||function(n){var u={left:0,top:0},r,t;if(n=i.getElement(n)){if(!n.tagName||!(n=n.parentNode))return u;r=0,t=0;do{if(i.isPage(n))break;r+=parseInt(n.scrollLeft)||0,t+=parseInt(n.scrollTop)||0}while(n=n.parentNode);return{left:r,top:t}}return u},i.getTopOffsetParent=i.getTopOffsetParent||function(n){while(n.offsetParent)if(n=n.offsetParent,i.getStyle(n,"position")==="fixed")break;return n},i.getStyle=i.getStyle||function(t,i){return((n.getComputedStyle?n.getComputedStyle(t):t.currentStyle)||{})[i]||""},i.addClass=i.addClass||function(n,t){(n=i.getElement(n))&&(i.containsWord(n.className||"",t)||(n.className+=(n.className?" ":"")+t))},i.removeClass=i.removeClass||function(n,t){(n=i.getElement(n))&&(n.className=i.removeWord(n.className,t))},i.setAttribute=i.setAttribute||function(n,t,r){(n=i.getElement(n))&&n.setAttribute(t,r)},i.setAttributes=i.setAttributes||function(n,t){if(n=i.getElement(n))for(var r in t)n.setAttribute(r,t[r])},i.applyStyleFixes=i.applyStyleFixes||function(n,t){for(var h,u,f,s,o,e=0;e0&&(u=[{target:arguments[0].target||arguments[0].srcElement}]),e=function(){r=null,i||n.apply(o,u)},f=i&&!r,clearTimeout(r),r=setTimeout(e,t),f&&n.apply(o,u)}},i.defined=i.defined||function(n){return typeof n=="function"},i.fnDefined=i.defined,i.getLabel=i.getLabel||function(n){for(var f=r.getElementsByTagName("LABEL"),u,t=0;t
{"+r.nameProperty+"}
",r.load=function(){function l(n){r.change(n),r.fire("select",n)}function c(t){if(n.selectList(t)){var i=n.getSelectedItem(t);r.change(r.find(i.value)||r.find(i.text))}else r.setCountry(n.getValue(t));r.textChanged=!1}var s,i,e,h,t,u,o,f;if(n.addClass(r.autocomplete.element,"pcacountrylist"),r.options.codesList){for(s=r.options.codesList.replace(/\s/g,"").split(","),i=[],r.autocomplete.clear(),e=0;e{count} matching results",GEOLOCATION:"Use my Location",COUNTRYHELP:"The selected country is {country}. Press control and shift and C to change the selected country.",INCOUNTRYHELP:"You are in the country select menu. The selected country is {country}. Press control and shift and C to return to the address search.",DRILLDOWN:"There are multiple address options at this location, select this location to expand the address options.",POPULATED:"Address has populated",ADDRESSAVAILABLE:"address available",ADDRESSESAVAILABLE:"addresses available",COUNTRYAVAILABLE:"country available",COUNTRIESAVAILABLE:"countries available",ADDRESSLIST:"address list"},cy:{DIDYOUMEAN:"A oeddech yn meddwl:",NORESULTS:"Dim canlyniadau ar ganlyniadau",KEEPTYPING:"Cadwch teipio eich cyfeiriad i arddangos mwy o ganlyniadau",RETRIEVEERROR:"Mae'n ddrwg gennym, ni allem adfer y cyfeiriad hwn",SERVICEERROR:"Gwall gwasanaeth:",COUNTRYSELECT:"Dewiswch gwlad",NOLOCATION:"Mae'n ddrwg gennym, nid oeddem yn gallu cael eich lleoliad",NOCOUNTRY:"Mae'n ddrwg gennym, ni allem ddod o hyd y wlad hon",MANUALENTRY:"Ni allaf ddod o hyd i fy nghyfeiriad. Gadewch i mi deipio mewn",RESULTCOUNT:"{count} Canlyniadau paru",GEOLOCATION:"Defnyddiwch fy Lleoliad",COUNTRYHELP:"Y wlad a ddewiswyd yw {country}. Pwyswch reolaeth a shifft a C i newid y wlad a ddewiswyd.",INCOUNTRYHELP:"Rydych chi yn y ddewislen dewis gwlad. Y wlad a ddewiswyd yw {country}. Pwyswch control a shifft a C i ddychwelyd i'r chwiliad cyfeiriad.",DRILLDOWN:"Mae sawl opsiwn cyfeiriad yn y lleoliad hwn, dewiswch y lleoliad hwn i ehangu'r opsiynau cyfeiriad.",POPULATED:"Mae'r cyfeiriad wedi poblogi",ADDRESSAVAILABLE:"cyfeiriad ar gael",ADDRESSESAVAILABLE:"gyfeiriad ar gael",COUNTRYAVAILABLE:"gwlad ar gael",COUNTRIESAVAILABLE:"gwledydd ar gael",ADDRESSLIST:"rhestr cyfeiriadau"},fr:{DIDYOUMEAN:"Vouliez-vous dire:",NORESULTS:"Aucun résultat n'a été trouvé",KEEPTYPING:"Continuer à taper votre adresse pour afficher plus de résultats",RETRIEVEERROR:"Désolé , nous ne pouvions pas récupérer cette adresse",SERVICEERROR:"Erreur de service:",COUNTRYSELECT:"Changer de pays",NOLOCATION:"Désolé, nous n'avons pas pu obtenir votre emplacement",NOCOUNTRY:"Désolé, nous n'avons pas trouvé ce pays",MANUALENTRY:"Je ne peux pas trouver mon adresse. Permettez-moi de taper dans",RESULTCOUNT:"{count} résultats correspondants",GEOLOCATION:"Utiliser ma position",COUNTRYHELP:"Le pays sélectionné est {country}. Appuyez sur Ctrl et Maj et C pour changer le pays sélectionné.",INCOUNTRYHELP:"Vous êtes dans le menu de sélection du pays. Le pays sélectionné est {country}. Appuyez sur Ctrl et Maj et sur C pour revenir à la recherche d'adresse.",DRILLDOWN:"Il existe plusieurs options d'adresse à cet emplacement, sélectionnez cet emplacement pour développer les options d'adresse.",POPULATED:"L'adresse a été remplie",ADDRESSAVAILABLE:"adresse disponible",ADDRESSESAVAILABLE:"adresses disponibles",COUNTRYAVAILABLE:"pays disponible",COUNTRIESAVAILABLE:"pays disponibles",ADDRESSLIST:"liste d'adresses"},de:{DIDYOUMEAN:"Meinten Sie:",NORESULTS:"Keine Adressen gefunden",KEEPTYPING:"Geben Sie mehr von Ihrer Adresse ein, um weitere Ergebnisse anzuzeigen",RETRIEVEERROR:"Wir konnten diese Adresse leider nicht abrufen",SERVICEERROR:"Service-Fehler:",COUNTRYSELECT:"Land wechseln",NOLOCATION:"Wir konnten Ihren Standort leider nicht finden",NOCOUNTRY:"Wir konnten dieses Land leider nicht finden",MANUALENTRY:"Ich kann meine Adresse nicht finden. Lassen Sie mich es manuell eingeben",RESULTCOUNT:"{count} passenden Ergebnisse",GEOLOCATION:"Meinen Standort verwenden",COUNTRYHELP:"Das ausgewählte Land ist {country}. Drücken Sie Strg und Umschalt und C, um das ausgewählte Land zu ändern.",INCOUNTRYHELP:"Sie befinden sich im Länderauswahlmenü. Das ausgewählte Land ist {country}. Drücken Sie Strg und Umschalttaste und C, um zur Adresssuche zurückzukehren.",DRILLDOWN:"An diesem Speicherort gibt es mehrere Adressoptionen. Wählen Sie diesen Speicherort aus, um die Adressoptionen zu erweitern.",POPULATED:"Adresse wurde ausgefüllt",ADDRESSAVAILABLE:"Adresse verfügbar",ADDRESSESAVAILABLE:"Adressen verfügbar",COUNTRYAVAILABLE:"Land verfügbar",COUNTRIESAVAILABLE:"Länder verfügbar",ADDRESSLIST:"Adressliste"}},n.exampleAddress={Id:"GBR|PR|52509479|0|0|0",DomesticId:"52509479",Language:"ENG",LanguageAlternatives:"ENG",Department:"",Company:"Postcode Anywhere (Europe) Ltd",SubBuilding:"",BuildingNumber:"",BuildingName:"Waterside",SecondaryStreet:"",Street:"Basin Road",Block:"",Neighbourhood:"",District:"",City:"Worcester",Line1:"Waterside",Line2:"Basin Road",Line3:"",Line4:"",Line5:"",AdminAreaName:"Worcester",AdminAreaCode:"47UE",Province:"Worcestershire",ProvinceName:"Worcestershire",ProvinceCode:"",PostalCode:"WR5 3DA",CountryName:"United Kingdom",CountryIso2:"GB",CountryIso3:"GBR",CountryIsoNumber:826,SortingNumber1:"94142",SortingNumber2:"",Barcode:"(WR53DA1PX)",Label:"Postcode Anywhere (Europe) Ltd\nWaterside\nBasin Road\n\nWorcester\nWR5 3DA\nUnited Kingdom",Type:"Commercial",DataLevel:"Premise",Field1:"",Field2:"",Field3:"",Field4:"",Field5:"",Field6:"",Field7:"",Field8:"",Field9:"",Field10:"",Field11:"",Field12:"",Field13:"",Field14:"",Field15:"",Field16:"",Field17:"",Field18:"",Field19:"",Field20:""},n.templates={AUTOCOMPLETE:"{HighlightedText}{{HighlightedDescription}}",AUTOCOMPLETE_UTILITY:"{({UtilityType})}{HighlightedText}{{HighlightedDescription}}"},n.Address=function(t,i){function e(t){t=t||{},t.name=t.name||"",t.source=t.source||"",t.populate=typeof t.populate=="boolean"?t.populate:!0,t.onlyInputs=typeof t.onlyInputs=="boolean"?t.onlyInputs:!1,t.autoSearch=typeof t.autoSearch=="boolean"?t.autoSearch:!1,t.preselect=typeof t.preselect=="boolean"?t.preselect:!0,t.minSearch=t.minSearch||1,t.minItems=t.minItems||1,t.maxItems=t.maxItems||7,t.advancedFields=t.advancedFields||[],t.manualEntry=typeof t.manualEntry=="boolean"?t.manualEntry:!1,t.manualEntryItem=typeof t.manualEntryItem=="boolean"?t.manualEntryItem:!1,t.disableTime=t.disableTime||6e4,t.suppressAutocomplete=typeof t.suppressAutocomplete=="boolean"?t.suppressAutocomplete:!0,t.brand=t.brand||"CanadaPost"||"PostcodeAnywhere",t.product=t.product||"AddressComplete",t.culture=t.culture||"en-GB",t.prompt=typeof t.prompt=="boolean"?t.prompt:!1,t.promptDelay=t.promptDelay||0,t.inlineMessages=typeof t.inlineMessages=="boolean"?t.inlineMessages:!1,t.setCursor=typeof t.setCursor=="boolean"?t.setCursor:!1,t.matchCount=typeof t.matchCount=="boolean"?t.matchCount:!1,t.languagePreference=t.languagePreference||"",t.filteringMode=t.filteringMode||n.filteringMode.EVERYTHING,t.orderingMode=t.orderingMode||n.orderingMode.DEFAULT,t.countries=t.countries||{},t.countries.codesList=t.countries.codesList||"",t.countries.defaultCode=t.countries.defaultCode||"",t.setCountryByIP=typeof t.setCountryByIP=="boolean"&&!t.countries.defaultCode?t.setCountryByIP:!1,t.countries.value=t.countries.value||"",t.countries.prepopulate=typeof t.countries.prepopulate=="boolean"?t.countries.prepopulate:!0,t.list=t.list||{},t.list.name=t.name?t.name+"_results":"",t.list.maxItems=t.list.maxItems||t.maxItems,t.list.minItems=t.list.minItems||t.minItems,t.countries.list=t.countries.list||n.extend({},t.list),t.countries.list.name=t.name?t.name+"_countries":"",t.GeoLocationEnabled=t.GeoLocationEnabled=="true"||t.GeoLocationEnabled==!0,t.GeoLocationRadius=t.GeoLocationRadius||50,t.GeoLocationMaxItems=t.GeoLocationMaxItems||10,t.utilitiesenabled=typeof t.utilitiesenabled=="boolean"?t.utilitiesenabled:!1,t.utilitiesutilitycodetype=t.utilitiesutilitycodetype||"ALL",t.GeoLocationEnabled&&(t.setCountryByIP=!1),t.bar=t.bar||{},t.bar.visible=t.GeoLocationEnabled?!0:typeof t.bar.visible=="boolean"?t.bar.visible:!1,t.bar.showCountry=typeof t.bar.showCountry=="boolean"?t.bar.showCountry:!1,t.bar.showLogo=typeof t.bar.showLogo=="boolean"?t.bar.showLogo:!0,t.bar.logoLink=typeof t.bar.logoLink=="boolean"?t.bar.logoLink:!1,t.bar.logoClass=t.bar.logoClass||"aclogo"||"pcalogo",t.bar.logoTitle=t.bar.logoTitle||"www.canadapost-postescanada.ca/ac",t.bar.logoUrl=t.bar.logoUrl||"https://www.canadapost-postescanada.ca/ac",t.search=t.search||{},t.search.limit=t.search.limit||t.maxItems,t.search.origin=t.search.origin||t.countries.defaultCode||"",t.search.countries=t.search.countries||t.countries.codesList||"",t.search.datasets=t.search.datasets||"",t.search.language=t.search.language||""}function u(){r.lastActionTimer!=null&&(window.clearTimeout(r.lastActionTimer),r.lastActionTimer=null)}function f(n){var t=new Image;t.src=n}e(i);var r=new n.Eventable(this);r.fields=t||[],r.options=i,r.key=r.options.key||"",r.country=r.options.countries.defaultCode,r.origin=r.options.search.origin,r.advancedFields=r.options.advancedFields,r.initialSearch=!1,r.searchContext=null,r.lastActionTimer=null,r.notifcationTimer=null,r.storedSearch=null,r.geolocation=null,r.geoLocationButton=null,r.loaded=!1,r.language="en",r.filteringMode=r.options.filteringMode,r.orderingMode=r.options.orderingMode,r.testMode=!1,r.instance=null,r.frugalSearch=!0,r.blockSearches=!0,r.cacheRequests=!0,r.autocomplete=null,r.countrylist=null,r.messageBox=null,r.load=function(){for(var w=[],c=[],t,f,e,v,s,y,u,b,a,l,o,p,h=0;h=5?(r.autocomplete.addUtilityLookupToTop=!0,r.userSetFrugalSearch=r.frugalSearch,r.userSetCacheRequests=r.cacheRequests,r.frugalSearch=!1,r.cacheRequests=!1):(r.autocomplete.addUtilityLookupToTop=!1,r.frugalSearch=r.userSetFrugalSearch,r.cacheRequests=r.userSetCacheRequests))},r.autocomplete.listen("keyup",function(t){n.activeAddress=r,r.autocomplete.checkIfProbablyUtilitySearch(),r.countrylist.autocomplete.visible?r.countrylist.autocomplete.handleKey(t):r.autocomplete.controlDown&&t===40?r.switchToCountrySelect():(t===0||t===8||t===32||t>=36&&t<=40&&!r.initialSearch||t>40)&&r.searchFromField()}),r.autocomplete.listen("paste",function(){r.autocomplete.checkIfProbablyUtilitySearch(),r.newSearch(),r.searchFromField()}),r.autocomplete.listen("focus",r.focus),r.autocomplete.listen("show",function(){r.fire("show")}),r.autocomplete.listen("hide",function(){r.fire("hide")}),r.autocomplete.listen("dblclick",r.searchFromField),r.autocomplete.list.listen("filter",function(){r.frugalSearch&&r.search(n.getValue(r.autocomplete.field))}),r.autocomplete.listen("delete",r.newSearch),!r.options.countries.value&&c.length&&(r.options.countries.value=n.getValue(c[0])),r.options.countries.language=r.language,r.countrylist=new n.CountryList(c,r.options.countries),r.countrylist.autocomplete.options.emptyMessage=n.messages[r.language].NOCOUNTRY,r.country=r.countrylist.country.iso3,r.countrylist.listen("change",function(t,i){r.country=t&&t.iso3?t.iso3:r.options.countries.defaultCode,i&&r.updateGeoLocationActive(),r.origin=r.country,r.inCountryListMode=!1;var u=r.autocomplete.footer.element.querySelector("#pca-country-button-help-text");u&&(u.innerText=n.formatLine({country:t?r.language==="fr"?t.name_fr:t.name:""},n.messages[r.language].COUNTRYHELP)),r.fire("country",t)}),r.countrylist.listen("select",r.switchToSearchMode),r.countrylist.autocomplete.listen("show",function(){r.fire("show")}),r.countrylist.autocomplete.listen("hide",function(){r.autocomplete.enable(),r.storedSearch!=null&&n.setValue(r.autocomplete.field,r.storedSearch),r.storedSearch=null,r.fire("hide")}),e=n.create("a",{href:r.options.bar.logoUrl,target:"_blank",rel:"nofollow"}),v=n.create("div",{className:r.options.bar.logoClass+" pcalogo"+r.language,title:r.options.bar.logoTitle}),r.options.bar.logoLink?e.appendChild(v):e=v,r.autocomplete.footer.setContent(e),r.countrylist.autocomplete.list.collection.count===1&&(r.options.bar.showCountry=!1),r.options.GeoLocationEnabled&&(s=n.create("div",{className:"geoLocationIcon",title:n.messages[r.language].GEOLOCATION}),y=n.create("div",{className:"geoLocationMessage",innerHTML:n.messages[r.language].GEOLOCATION}),n.listen(s,"click",r.startGeoLocation),n.listen(y,"click",r.startGeoLocation),r.autocomplete.footer.setContent(s),r.autocomplete.footer.setContent(y),r.geocodeButton=s),u=n.create("div",{className:"pcaflagbutton"}),u.setAttribute("tabindex",0),u.setAttribute("role","button"),u.setAttribute("id",(i.list.name||"")+"_button"),u.setAttribute("aria-labelledby",(i.list.name||"")+"_label"),b=r.countrylist.flag(),a=n.create("div",{className:"pcamessage pcadisableselect",innerHTML:n.messages[r.language].COUNTRYSELECT}),a.setAttribute("id",(i.list.name||"addresslist_change_country")+"_label"),l=n.create("div",{className:"pcamessage pcadisableselect",innerHTML:n.messages[r.language].COUNTRYSELECT}),l.setAttribute("id",(i.countries.list.name||"countrylist_change_country")+"_label"),u.appendChild(a),u.appendChild(b),o=n.countries.find(function(n){return n.iso3==r.country}),p=n.create("span",{id:"pca-country-button-help-text",className:"pca-visually-hidden",innerText:n.formatLine({country:o?r.language==="fr"?o.name_fr:o.name:""},n.messages[r.language].COUNTRYHELP)}),r.options.bar.showCountry&&(r.autocomplete.footer.setContent(u),r.autocomplete.footer.setContent(p),r.countrylist.autocomplete.footer.setContent(l)),n.listen(u,"click",function(t){n.smash(t),r.switchToCountrySelect()}),n.listen(u,"keyup",function(t){t.keyCode==13&&(n.smash(t),r.switchToCountrySelect())}),r.showFooterLogo=function(){r.autocomplete.footer.element.classList.add("pca-showlogo"),e.style.display=r.options.bar.showLogo?"":"none"},r.showFooterMessage=function(){e.style.display=r.options.bar.showCountry?"none":r.options.bar.showLogo?"":"none"},r.options.bar.visible?(r.autocomplete.footer.show(),r.countrylist.autocomplete.footer.show(),r.showFooterMessage()):(r.autocomplete.hide(),r.countrylist.autocomplete.footer.hide()),r.options.manualEntryItem&&r.addManualEntryItem(),r.options.setCountryByIP?r.setCountryByIP():r.countrylist.setCountry(r.country),r.messageBox=n.create("div",{className:"pcatext pcanotification",id:"pca-help-text"}),n.append(r.messageBox,n.container),r.loaded=!0,r.fire("load")},r.searchFromField=function(){var t=n.getValue(r.autocomplete.field);t&&!r.autocomplete.disabled&&(!r.initialSearch||!r.frugalSearch)&&t.length>=r.options.minSearch&&(r.initialSearch=!0,r.search(t))},r.updateGeoLocationActive=function(){r.country=="GBR"&&n.supports("reverseGeo")&&r.options.GeoLocationEnabled?r.geocodeButton&&n.addClass(r.geocodeButton,"active"):r.geocodeButton&&n.removeClass(r.geocodeButton,"active")},r.geolocationLookup=function(t){if(t.coords){var i={Key:r.key,Latitude:t.coords.latitude,Longitude:t.coords.longitude,Items:r.options.GeoLocationMaxItems,Radius:r.options.GeoLocationRadius};r.fire("geolocation",i),n.fetch("Capture/Interactive/GeoLocation/v1.00",i,function(t,i){n.removeClass(r.geocodeButton,"working"),t.length?r.display(t,n.templates.AUTOCOMPLETE,i):r.noResultsMessage()},function(t){n.removeClass(r.geocodeButton,"working"),r.error(t)})}else r.error("The location supplied for the reverse geocode doesn't contain coordinate information.")},r.utilitiesLookup=function(t){var i={Key:r.key,Text:t,UtilCodeType:r.options.utilitiesutilitycodetype};r.fire("utilities",i),n.fetch("Capture/Interactive/Utilities/v1.00",i,function(t,i){t.length?r.display(t,n.templates.AUTOCOMPLETE_UTILITY,i):r.noResultsMessage()},function(n){r.error(n)})},r.search=function(t){var f,i,u;if(r.autocomplete.addUtilityLookupToTop)r.fire("utilitiesactive",t.replace(/[^0-9]/g,"")),r.display([{Id:"",Type:"Utility",Text:"Lookup MPAN/MPRN/Serial Number",Highlight:"",Description:""}],n.templates.AUTOCOMPLETE_UTILITY,null);else{r.searchContext&&(~t.indexOf(r.searchContext.search)?t=t.replace(r.searchContext.search,r.searchContext.text):r.searchContext=null),f=r.searchContext!=null,i={text:t,container:r.searchContext?r.searchContext.id||"":"",origin:r.origin||"",countries:r.options.search.countries,datasets:r.options.search.datasets,filter:r.filteringMode,limit:r.options.search.limit,language:r.options.search.language||r.language};function e(t,i){t.length?(r.display(t,n.templates.AUTOCOMPLETE,i),f&&r.autocomplete.list.next()):r.noResultsMessage()}r.fire("search",i),i.text&&(u={Key:r.key,Text:i.text,Container:i.container,Origin:i.origin,Countries:i.countries,Datasets:i.datasets,Limit:i.limit,Filter:i.filter,Language:i.language,$block:r.blockSearches,$cache:r.cacheRequests},r.testMode&&(u.Test=r.testMode),r.instance&&(u.Instance=r.instance),n.fetch("Capture/Interactive/Find/v1.00",u,e,r.error))}return r},r.retrieve=function(t){function f(t){r.message(n.messages[r.language].RETRIEVEERROR,{clickToDisable:r.options.manualEntry,error:!0,clearList:!0}),r.error(t)}function e(n,t,i){i&&r.fire("retrieveResponse",n,t,i),n.length?r.populate(n):f(n)}for(var u={Key:r.key,Id:t,Source:r.options.source,$cache:r.cacheRequests},i=0;i=0?t.Cursor:null)):(n.setValue(r.autocomplete.field,i+" "),r.autocomplete.field.focus()),r.searchContext={id:t.Id,text:t.Text,search:i},r.search(i)}if(t.Type==="Address")r.retrieve(t.Id);else if(t.Type==="Utility"){var i=n.getValue(r.autocomplete.field);r.utilitiesLookup(i)}else u();return r},r.highlight=function(n,t,i){function e(n,r){for(var u,f=r.length-1;f>=0;f--)u=r[f].split("-"),n=n.substring(0,parseInt(u[0]))+t+n.substring(parseInt(u[0]),parseInt(u[1]))+i+n.substring(parseInt(u[1]),n.length);return n}var f,r,u;for(t=t||"",i=i||"",f=0;f0&&(r.HighlightedText=e(r.HighlightedText,u[0].split(","))),u.length>1&&(r.HighlightedDescription=e(r.HighlightedDescription,u[1].split(","))))},r.populate=function(t){var u=t[0],h,f,a,o,v,l,e,s,i,c,y;if(r.options.languagePreference)for(h=0;h1)return n.Company;t===1&&i===1?e=n.Company:(t--,i--)}for(u=n.Line1?n.Line2?n.Line3?n.Line4?n.Line5?5:4:3:2:1:0,o=i>=u?t:Math.floor(1+(u/i+(i-(t-1))/i)*(t-1)),s=Math.floor(u/i+(i-t)/i),f=0;f=80&&i<90)&&(t.autocomplete="pca-override",r=!0))}r||(t.autocomplete="off")}},r.detectLanguage=function(){var t=r.options.culture,i=r.options.search.language;t!==i&&(t=(window&&window.navigator?window.navigator.language||window.navigator.browserLanguage:"")||""),r.language=t&&t.length>1?t.substring(0,2).toLowerCase():"en",n.messages[r.language]||(r.language="en")},r.setCulture=function(n){r.options.culture=n,r.reload()},r.setWidth=function(n){r.autocomplete.setWidth(n),r.countrylist.autocomplete.setWidth(n)},r.setHeight=function(n){r.autocomplete.setHeight(n),r.countrylist.autocomplete.setHeight(n)},r.clear=function(){for(var t=0;t{text}",r.manualEntry)},r.bound=function(i){if(i=n.getElement(i))for(var u=0;u { const activeUserAccounts = computed(() => { return userAccounts.value.filter(account => account.accountStatus === AccountStatusE.ACTIVE) }) + const me: Ref = ref() const userFirstName: Ref = ref(user.value?.firstName || '-') const userLastName: Ref = ref(user.value?.lastName || '') const userFullName = computed(() => `${userFirstName.value} ${userLastName.value}`) // errors const errors: Ref = ref([]) // api request variables - const axios = addAxiosInterceptors(Axios.create()) + const axiosInstance = addAxiosInterceptors(axios.create()) const apiURL = useRuntimeConfig().public.authApiURL /** Get user information from AUTH */ async function getAuthUserProfile (identifier: string) { - return await axios.get(`${apiURL}/users/${identifier}`) + return await axiosInstance.get(`${apiURL}/users/${identifier}`) .then((response) => { const data = response?.data if (!data) { throw new Error('Invalid AUTH API response') } @@ -50,7 +51,7 @@ export const useBcrosAccount = defineStore('bcros/account', () => { /** Update user information in AUTH with current token info */ async function updateAuthUserInfo () { - return await axios.post(`${apiURL}/users`, { isLogin: true }) + return await axiosInstance.post(`${apiURL}/users`, { isLogin: true }) .then(response => response.data) .catch((error) => { // not too worried if this errs -- log for ops @@ -77,10 +78,11 @@ export const useBcrosAccount = defineStore('bcros/account', () => { // TODO: TC - move this to an STRR store async function getMe () { const apiURL = useRuntimeConfig().public.strrApiURL - return await axios.get(`${apiURL}/account/me`) + return await axiosInstance.get(`${apiURL}/account/me`) .then((response) => { const data = response?.data as MeI if (!data) { throw new Error('Invalid STRR API response') } + me.value = data as MeI return data as MeI }) .catch((error) => { @@ -96,7 +98,7 @@ export const useBcrosAccount = defineStore('bcros/account', () => { /** Get the user's account list */ async function getUserAccounts (keycloakGuid: string) { const apiURL = useRuntimeConfig().public.authApiURL - return await axios.get(`${apiURL}/users/${keycloakGuid}/settings`) + return await axiosInstance.get(`${apiURL}/users/${keycloakGuid}/settings`) .then((response) => { const data = response?.data if (!data) { throw new Error('Invalid AUTH API response') } @@ -149,6 +151,8 @@ export const useBcrosAccount = defineStore('bcros/account', () => { } return { + axiosInstance, + me, currentAccount, currentAccountName, userAccounts, @@ -156,6 +160,8 @@ export const useBcrosAccount = defineStore('bcros/account', () => { activeUserAccounts, userFullName, errors, + userFirstName, + userLastName, updateAuthUserInfo, setUserName, setAccountInfo, diff --git a/strr-web/stores/strr.ts b/strr-web/stores/strr.ts index 7bf4493e..e8142617 100644 --- a/strr-web/stores/strr.ts +++ b/strr-web/stores/strr.ts @@ -1,84 +1,224 @@ import { z } from 'zod' +import axios from 'axios' import { CreateAccountFormStateI, OrgI } from '~/interfaces/account-i' -export const primaryContactSchema = z.object({ - preferredName: z.string().optional(), - phoneNumber: z.string(), - extension: z.string().optional(), - faxNumber: z.string().optional(), +const apiURL = useRuntimeConfig().public.strrApiURL +const axiosInstance = addAxiosInterceptors(axios.create()) + +export const submitCreateAccountForm = ( + userFirstName: string, + userLastName: string, + userFullName: string, + mailingAddress: { + city: string; + country: string; + postalCode: string; + region: string; + street: string; + streetAdditional: string; + }[] | undefined, + addSecondaryContact: boolean +) => { + const formData: CreateAccountFormAPII = formStateToApi( + formState, + userFirstName, + userLastName, + userFullName, + mailingAddress, + addSecondaryContact + ) + + axiosInstance.post(`${apiURL}/registrations`, + { ...formData } + ) + .then((response) => { + const data = response?.data + if (!data) { throw new Error('Invalid AUTH API response') } + return data + }) + .catch((error: string) => { + console.warn('Error creating account.') + console.error(error) + }) +} + +const numbersRegex = /^[0-9]+$/ +// matches chars 123456789 () +const phoneRegex = /^[0-9*#+() -]+$/ +const phoneError = { message: 'Valid characters are "()- 123457890" ' } +const requiredPhone = z.string().regex(phoneRegex, phoneError) +const requiredNumber = z.string().regex(numbersRegex, { message: 'Must be a number' }) +const optionalOrEmptyString = z.string().optional().transform(e => e === '' ? undefined : e) + +export const contactSchema = z.object({ + preferredName: optionalOrEmptyString, + phoneNumber: requiredPhone, + extension: optionalOrEmptyString, + faxNumber: optionalOrEmptyString, emailAddress: z.string(), address: z.string(), country: z.string(), - addressLineTwo: z.string().optional(), + addressLineTwo: optionalOrEmptyString, city: z.string(), province: z.string(), postalCode: z.string(), - day: z.string(), - month: z.string(), - year: z.string() + birthDay: requiredNumber.refine(day => day.length === 2, 'Day must be two digits'), + birthMonth: z.string(), + birthYear: requiredNumber + .refine(year => Number(year) <= new Date().getFullYear(), 'Year must be in the past') + .refine(year => year.length === 4, 'Year must be four digits') }) const primaryContact: ContactInformationI = { preferredName: '', - phoneNumber: '', + phoneNumber: undefined, extension: '', faxNumber: '', - emailAddress: '', - address: '', - country: '', - addressLineTwo: '', - city: '', - province: '', - postalCode: '', - dateOfBirth: { - day: '', - month: '', - year: '' - } + emailAddress: undefined, + address: undefined, + country: undefined, + addressLineTwo: undefined, + city: undefined, + province: undefined, + postalCode: undefined, + birthDay: undefined, + birthMonth: undefined, + birthYear: undefined } const secondaryContact: ContactInformationI = { preferredName: '', - phoneNumber: '', + phoneNumber: undefined, extension: '', faxNumber: '', - emailAddress: '', - address: '', - country: '', - addressLineTwo: '', - city: '', - province: '', - postalCode: '', - dateOfBirth: { - day: '', - month: '', - year: '' - } + emailAddress: undefined, + address: undefined, + country: undefined, + addressLineTwo: undefined, + city: undefined, + province: undefined, + postalCode: undefined, + birthDay: undefined, + birthMonth: undefined, + birthYear: undefined } +export const propertyDetailsSchema = z.object({ + address: z.string(), + addressLineTwo: optionalOrEmptyString, + businessLicense: optionalOrEmptyString, + city: z.string(), + country: z.string(), + listingDetails: z.array(z.object({ url: z.string() })), + nickname: optionalOrEmptyString, + ownershipType: z.string(), + parcelIdentifier: optionalOrEmptyString, + postalCode: z.string(), + propertyType: z.string(), + province: z.string(), + useMailing: z.boolean() +}) + export const formState: CreateAccountFormStateI = reactive({ primaryContact, secondaryContact, - questions: { - primaryResidence: '', - whichPlatform: '' - }, - unitDetails: { - parcelIdentifier: '', - businessLicense: '', - propertyType: '', - ownershipType: '' - }, - unitAddress: { + propertyDetails: { + parcelIdentifier: undefined, + businessLicense: undefined, + propertyType: undefined, + ownershipType: undefined, + primaryResidence: undefined, + whichPlatform: undefined, useMailing: false, nickname: '', - country: '', + country: 'CAN', + address: undefined, + addressLineTwo: undefined, + city: undefined, + province: 'BC', + postalCode: undefined, + listingDetails: [{ url: '' }] + }, + selectedAccount: {} as OrgI +}) + +const primaryContactAPI: ContactAPII = { + name: { + firstName: '', + middleName: '', + lastName: '' + }, + dateOfBirth: '', + details: { + preferredName: '', + phoneNumber: '', + extension: '', + faxNumber: '', + emailAddress: '' + }, + mailingAddress: { address: '', addressLineTwo: '', city: '', + postalCode: '', province: '', - postalCode: '' + country: '' + } +} + +const secondaryContactAPI: ContactAPII = { + name: { + firstName: '', + middleName: '', + lastName: '' }, - listingDetails: [''], - selectedAccount: {} as OrgI -}) + dateOfBirth: '', + details: { + preferredName: '', + phoneNumber: '', + extension: '', + faxNumber: '', + emailAddress: '' + }, + mailingAddress: { + address: '', + addressLineTwo: '', + city: '', + postalCode: '', + province: '', + country: '' + } +} + +export const formDataForAPI: CreateAccountFormAPII = { + selectedAccount: { + name: '', + mailingAddress: { + street: '', + streetAdditional: '', + city: '', + postalCode: '', + region: '', + country: '' + } + }, + registration: { + primaryContact: primaryContactAPI, + secondaryContact: secondaryContactAPI, + unitAddress: { + address: '', + addressLineTwo: '', + city: '', + postalCode: '', + province: '', + country: '' + }, + unitDetails: { + parcelIdentifier: '', + businessLicense: '', + propertyType: '', + ownershipType: '' + }, + listingDetails: [] + } +} diff --git a/strr-web/utils/countries.json b/strr-web/utils/countries.json new file mode 100644 index 00000000..9075fd7e --- /dev/null +++ b/strr-web/utils/countries.json @@ -0,0 +1,251 @@ +[ + { "iso2": "AF", "iso3": "AFG", "en": "Afghanistan", "fr": "Afghanistan" }, + { "iso2": "AX", "iso3": "ALA", "en": "Åland", "fr": "Åland(les Îles)" }, + { "iso2": "AL", "iso3": "ALB", "en": "Albania", "fr": "Albanie" }, + { "iso2": "DZ", "iso3": "DZA", "en": "Algeria", "fr": "Algérie" }, + { "iso2": "AS", "iso3": "ASM", "en": "American Samoa", "fr": "Samoa américaines" }, + { "iso2": "AD", "iso3": "AND", "en": "Andorra", "fr": "Andorre" }, + { "iso2": "AO", "iso3": "AGO", "en": "Angola", "fr": "Angola" }, + { "iso2": "AI", "iso3": "AIA", "en": "Anguilla", "fr": "Anguilla" }, + { "iso2": "AQ", "iso3": "ATA", "en": "Antarctica", "fr": "Antarctique" }, + { "iso2": "AG", "iso3": "ATG", "en": "Antigua and Barbuda", "fr": "Antigua-et-Barbuda" }, + { "iso2": "AR", "iso3": "ARG", "en": "Argentina", "fr": "Argentine" }, + { "iso2": "AM", "iso3": "ARM", "en": "Armenia", "fr": "Arménie" }, + { "iso2": "AW", "iso3": "ABW", "en": "Aruba", "fr": "Aruba" }, + { "iso2": "AU", "iso3": "AUS", "en": "Australia", "fr": "Australie" }, + { "iso2": "AT", "iso3": "AUT", "en": "Austria", "fr": "Autriche" }, + { "iso2": "AZ", "iso3": "AZE", "en": "Azerbaijan", "fr": "Azerbaïdjan" }, + { "iso2": "BS", "iso3": "BHS", "en": "Bahamas", "fr": "Bahamas" }, + { "iso2": "BH", "iso3": "BHR", "en": "Bahrain", "fr": "Bahreïn" }, + { "iso2": "BD", "iso3": "BGD", "en": "Bangladesh", "fr": "Bangladesh" }, + { "iso2": "BB", "iso3": "BRB", "en": "Barbados", "fr": "Barbade" }, + { "iso2": "BY", "iso3": "BLR", "en": "Belarus", "fr": "Bélarus" }, + { "iso2": "BE", "iso3": "BEL", "en": "Belgium", "fr": "Belgique" }, + { "iso2": "BZ", "iso3": "BLZ", "en": "Belize", "fr": "Belize" }, + { "iso2": "BJ", "iso3": "BEN", "en": "Benin", "fr": "Bénin" }, + { "iso2": "BM", "iso3": "BMU", "en": "Bermuda", "fr": "Bermudes" }, + { "iso2": "BT", "iso3": "BTN", "en": "Bhutan", "fr": "Bhoutan" }, + { "iso2": "BO", "iso3": "BOL", "en": "Bolivia", "fr": "Bolivie, l'État plurinational de la" }, + { "iso2": "BQ", "iso3": "BES", "en": "Bonaire, Sint Eustatius and Saba", "fr": "Bonaire, Saint-Eustache et Saba" }, + { "iso2": "BA", "iso3": "BIH", "en": "Bosnia and Herzegovina", "fr": "Bosnie-Herzégovine" }, + { "iso2": "BW", "iso3": "BWA", "en": "Botswana", "fr": "Botswana" }, + { "iso2": "BV", "iso3": "BVT", "en": "Bouvet Island", "fr": "Bouvet (l'Île)" }, + { "iso2": "BR", "iso3": "BRA", "en": "Brazil", "fr": "Brésil" }, + { "iso2": "IO", "iso3": "IOT", "en": "British Indian Ocean Territory", "fr": "Indien (le Territoire britannique de l'océan)" }, + { "iso2": "VG", "iso3": "VGB", "en": "British Virgin Islands", "fr": "Vierges britanniques (les Îles)" }, + { "iso2": "BN", "iso3": "BRN", "en": "Brunei", "fr": "Brunei" }, + { "iso2": "BG", "iso3": "BGR", "en": "Bulgaria", "fr": "Bulgarie" }, + { "iso2": "BF", "iso3": "BFA", "en": "Burkina Faso", "fr": "Burkina Faso" }, + { "iso2": "BI", "iso3": "BDI", "en": "Burundi", "fr": "Burundi" }, + { "iso2": "KH", "iso3": "KHM", "en": "Cambodia", "fr": "Cambodge" }, + { "iso2": "CM", "iso3": "CMR", "en": "Cameroon", "fr": "Cameroun" }, + { "iso2": "CA", "iso3": "CAN", "en": "Canada", "fr": "Canada" }, + { "iso2": "CV", "iso3": "CPV", "en": "Cape Verde", "fr": "Cabo Verde" }, + { "iso2": "KY", "iso3": "CYM", "en": "Cayman Islands", "fr": "Caïmans (les Îles)" }, + { "iso2": "CF", "iso3": "CAF", "en": "Central African Republic", "fr": "République centrafricaine" }, + { "iso2": "TD", "iso3": "TCD", "en": "Chad", "fr": "Tchad" }, + { "iso2": "CL", "iso3": "CHL", "en": "Chile", "fr": "Chili" }, + { "iso2": "CN", "iso3": "CHN", "en": "China", "fr": "Chine" }, + { "iso2": "CX", "iso3": "CXR", "en": "Christmas Island", "fr": "Christmas (l'Île)" }, + { "iso2": "CC", "iso3": "CCK", "en": "Cocos (Keeling) Islands", "fr": "Cocos (les Îles)/ Keeling (les Îles)" }, + { "iso2": "CO", "iso3": "COL", "en": "Colombia", "fr": "Colombie" }, + { "iso2": "KM", "iso3": "COM", "en": "Comoros", "fr": "Comores" }, + { "iso2": "CG", "iso3": "COG", "en": "Congo", "fr": "Congo" }, + { "iso2": "CD", "iso3": "COD", "en": "Congo (Democratic Republic)", "fr": "Congo (la République démocratique du)" }, + { "iso2": "CK", "iso3": "COK", "en": "Cook Islands", "fr": "Cook (les Îles)" }, + { "iso2": "CR", "iso3": "CRI", "en": "Costa Rica", "fr": "Costa Rica" }, + { "iso2": "HR", "iso3": "HRV", "en": "Croatia", "fr": "Croatie" }, + { "iso2": "CU", "iso3": "CUB", "en": "Cuba", "fr": "Cuba" }, + { "iso2": "CW", "iso3": "CUW", "en": "Curaçao", "fr": "Curaçao" }, + { "iso2": "CY", "iso3": "CYP", "en": "Cyprus", "fr": "Chypre" }, + { "iso2": "CZ", "iso3": "CZE", "en": "Czechia", "fr": "tchèque (la République)" }, + { "iso2": "DK", "iso3": "DNK", "en": "Denmark", "fr": "Danemark" }, + { "iso2": "DJ", "iso3": "DJI", "en": "Djibouti", "fr": "Djibouti" }, + { "iso2": "DM", "iso3": "DMA", "en": "Dominica", "fr": "Dominique" }, + { "iso2": "DO", "iso3": "DOM", "en": "Dominican Republic", "fr": "dominicaine (la République)" }, + { "iso2": "TL", "iso3": "TLS", "en": "East Timor", "fr": "Timor-Leste" }, + { "iso2": "EC", "iso3": "ECU", "en": "Ecuador", "fr": "Équateur" }, + { "iso2": "EG", "iso3": "EGY", "en": "Egypt", "fr": "Égypte" }, + { "iso2": "SV", "iso3": "SLV", "en": "El Salvador", "fr": "Salvador" }, + { "iso2": "GQ", "iso3": "GNQ", "en": "Equatorial Guinea", "fr": "Guinée équatoriale" }, + { "iso2": "ER", "iso3": "ERI", "en": "Eritrea", "fr": "Érythrée" }, + { "iso2": "EE", "iso3": "EST", "en": "Estonia", "fr": "Estonie" }, + { "iso2": "SZ", "iso3": "SWZ", "en": "Eswatini", "fr": "Eswatini" }, + { "iso2": "ET", "iso3": "ETH", "en": "Ethiopia", "fr": "Éthiopie" }, + { "iso2": "FK", "iso3": "FLK", "en": "Falkland Islands", "fr": "Falkland (les Îles)/Malouines (les Îles)" }, + { "iso2": "FO", "iso3": "FRO", "en": "Faroe Islands", "fr": "Féroé (les Îles)" }, + { "iso2": "FJ", "iso3": "FJI", "en": "Fiji", "fr": "Fidji" }, + { "iso2": "FI", "iso3": "FIN", "en": "Finland", "fr": "Finlande" }, + { "iso2": "FR", "iso3": "FRA", "en": "France", "fr": "France" }, + { "iso2": "GF", "iso3": "GUF", "en": "French Guiana", "fr": "Guyane française" }, + { "iso2": "PF", "iso3": "PYF", "en": "French Polynesia", "fr": "Polynésie française" }, + { "iso2": "TF", "iso3": "ATF", "en": "French Southern Territories", "fr": "Terres australes françaises" }, + { "iso2": "GA", "iso3": "GAB", "en": "Gabon", "fr": "Gabon" }, + { "iso2": "GM", "iso3": "GMB", "en": "Gambia", "fr": "Gambie" }, + { "iso2": "GE", "iso3": "GEO", "en": "Georgia", "fr": "Géorgie" }, + { "iso2": "DE", "iso3": "DEU", "en": "Germany", "fr": "Allemagne" }, + { "iso2": "GH", "iso3": "GHA", "en": "Ghana", "fr": "Ghana" }, + { "iso2": "GI", "iso3": "GIB", "en": "Gibraltar", "fr": "Gibraltar" }, + { "iso2": "GR", "iso3": "GRC", "en": "Greece", "fr": "Grèce" }, + { "iso2": "GL", "iso3": "GRL", "en": "Greenland", "fr": "Groenland" }, + { "iso2": "GD", "iso3": "GRD", "en": "Grenada", "fr": "Grenade" }, + { "iso2": "GP", "iso3": "GLP", "en": "Guadeloupe", "fr": "Guadeloupe" }, + { "iso2": "GU", "iso3": "GUM", "en": "Guam", "fr": "Guam" }, + { "iso2": "GT", "iso3": "GTM", "en": "Guatemala", "fr": "Guatemala" }, + { "iso2": "GG", "iso3": "GGY", "en": "Guernsey", "fr": "Guernesey" }, + { "iso2": "GN", "iso3": "GIN", "en": "Guinea", "fr": "Guinée" }, + { "iso2": "GW", "iso3": "GNB", "en": "Guinea-Bissau", "fr": "Guinée-Bissau" }, + { "iso2": "GY", "iso3": "GUY", "en": "Guyana", "fr": "Guyana" }, + { "iso2": "HT", "iso3": "HTI", "en": "Haiti", "fr": "Haïti" }, + { "iso2": "HM", "iso3": "HMD", "en": "Heard Island and McDonald Islands", "fr": "Heard-et-Îles MacDonald (l'Île)" }, + { "iso2": "HN", "iso3": "HND", "en": "Honduras", "fr": "Honduras" }, + { "iso2": "HK", "iso3": "HKG", "en": "Hong Kong", "fr": "Hong Kong" }, + { "iso2": "HU", "iso3": "HUN", "en": "Hungary", "fr": "Hongrie" }, + { "iso2": "IS", "iso3": "ISL", "en": "Iceland", "fr": "Islande" }, + { "iso2": "IN", "iso3": "IND", "en": "India", "fr": "Inde" }, + { "iso2": "ID", "iso3": "IDN", "en": "Indonesia", "fr": "Indonésie" }, + { "iso2": "IR", "iso3": "IRN", "en": "Iran", "fr": "Iran (République Islamique d')" }, + { "iso2": "IQ", "iso3": "IRQ", "en": "Iraq", "fr": "Iraq" }, + { "iso2": "IE", "iso3": "IRL", "en": "Ireland", "fr": "Irlande" }, + { "iso2": "IM", "iso3": "IMN", "en": "Isle of Man", "fr": "Île de Man" }, + { "iso2": "IL", "iso3": "ISR", "en": "Israel", "fr": "Israël" }, + { "iso2": "IT", "iso3": "ITA", "en": "Italy", "fr": "Italie" }, + { "iso2": "CI", "iso3": "CIV", "en": "Ivory Coast", "fr": "Côte d'Ivoire" }, + { "iso2": "JM", "iso3": "JAM", "en": "Jamaica", "fr": "Jamaïque" }, + { "iso2": "JP", "iso3": "JPN", "en": "Japan", "fr": "Japon" }, + { "iso2": "JE", "iso3": "JEY", "en": "Jersey", "fr": "Jersey" }, + { "iso2": "JO", "iso3": "JOR", "en": "Jordan", "fr": "Jordanie" }, + { "iso2": "KZ", "iso3": "KAZ", "en": "Kazakhstan", "fr": "Kazakhstan" }, + { "iso2": "KE", "iso3": "KEN", "en": "Kenya", "fr": "Kenya" }, + { "iso2": "KI", "iso3": "KIR", "en": "Kiribati", "fr": "Kiribati" }, + { "iso2": "KP", "iso3": "PRK", "en": "Korea (North)", "fr": "Corée (la République populaire démocratique de )" }, + { "iso2": "KR", "iso3": "KOR", "en": "Korea (South)", "fr": "Corée (la République de)" }, + { "iso2": "KW", "iso3": "KWT", "en": "Kuwait", "fr": "Koweït" }, + { "iso2": "KG", "iso3": "KGZ", "en": "Kyrgyzstan", "fr": "Kirghizistan" }, + { "iso2": "LA", "iso3": "LAO", "en": "Laos", "fr": "Lao, République démocratique populaire" }, + { "iso2": "LV", "iso3": "LVA", "en": "Latvia", "fr": "Lettonie" }, + { "iso2": "LB", "iso3": "LBN", "en": "Lebanon", "fr": "Liban" }, + { "iso2": "LS", "iso3": "LSO", "en": "Lesotho", "fr": "Lesotho" }, + { "iso2": "LR", "iso3": "LBR", "en": "Liberia", "fr": "Libéria" }, + { "iso2": "LY", "iso3": "LBY", "en": "Libya", "fr": "Libye" }, + { "iso2": "LI", "iso3": "LIE", "en": "Liechtenstein", "fr": "Liechtenstein" }, + { "iso2": "LT", "iso3": "LTU", "en": "Lithuania", "fr": "Lituanie" }, + { "iso2": "LU", "iso3": "LUX", "en": "Luxembourg", "fr": "Luxembourg" }, + { "iso2": "MO", "iso3": "MAC", "en": "Macao", "fr": "Macao" }, + { "iso2": "MG", "iso3": "MDG", "en": "Madagascar", "fr": "Madagascar" }, + { "iso2": "MW", "iso3": "MWI", "en": "Malawi", "fr": "Malawi" }, + { "iso2": "MY", "iso3": "MYS", "en": "Malaysia", "fr": "Malaisie" }, + { "iso2": "MV", "iso3": "MDV", "en": "Maldives", "fr": "Maldives" }, + { "iso2": "ML", "iso3": "MLI", "en": "Mali", "fr": "Mali" }, + { "iso2": "MT", "iso3": "MLT", "en": "Malta", "fr": "Malte" }, + { "iso2": "MH", "iso3": "MHL", "en": "Marshall Islands", "fr": "Marshall (Îles)" }, + { "iso2": "MQ", "iso3": "MTQ", "en": "Martinique", "fr": "Martinique" }, + { "iso2": "MR", "iso3": "MRT", "en": "Mauritania", "fr": "Mauritanie" }, + { "iso2": "MU", "iso3": "MUS", "en": "Mauritius", "fr": "Maurice" }, + { "iso2": "YT", "iso3": "MYT", "en": "Mayotte", "fr": "Mayotte" }, + { "iso2": "MX", "iso3": "MEX", "en": "Mexico", "fr": "Mexique" }, + { "iso2": "FM", "iso3": "FSM", "en": "Micronesia", "fr": "Micronésie, États fédérés de" }, + { "iso2": "MD", "iso3": "MDA", "en": "Moldova", "fr": "Moldova , République de" }, + { "iso2": "MC", "iso3": "MCO", "en": "Monaco", "fr": "Monaco" }, + { "iso2": "MN", "iso3": "MNG", "en": "Mongolia", "fr": "Mongolie" }, + { "iso2": "ME", "iso3": "MNE", "en": "Montenegro", "fr": "Monténégro" }, + { "iso2": "MS", "iso3": "MSR", "en": "Montserrat", "fr": "Montserrat" }, + { "iso2": "MA", "iso3": "MAR", "en": "Morocco", "fr": "Maroc" }, + { "iso2": "MZ", "iso3": "MOZ", "en": "Mozambique", "fr": "Mozambique" }, + { "iso2": "MM", "iso3": "MMR", "en": "Myanmar", "fr": "Myanmar" }, + { "iso2": "NA", "iso3": "NAM", "en": "Namibia", "fr": "Namibie" }, + { "iso2": "NR", "iso3": "NRU", "en": "Nauru", "fr": "Nauru" }, + { "iso2": "NP", "iso3": "NPL", "en": "Nepal", "fr": "Népal" }, + { "iso2": "NL", "iso3": "NLD", "en": "Netherlands", "fr": "Pays-Bas" }, + { "iso2": "NC", "iso3": "NCL", "en": "New Caledonia", "fr": "Nouvelle-Calédonie" }, + { "iso2": "NZ", "iso3": "NZL", "en": "New Zealand", "fr": "Nouvelle-Zélande" }, + { "iso2": "NI", "iso3": "NIC", "en": "Nicaragua", "fr": "Nicaragua" }, + { "iso2": "NE", "iso3": "NER", "en": "Niger", "fr": "Niger" }, + { "iso2": "NG", "iso3": "NGA", "en": "Nigeria", "fr": "Nigéria" }, + { "iso2": "NU", "iso3": "NIU", "en": "Niue", "fr": "Niue" }, + { "iso2": "NF", "iso3": "NFK", "en": "Norfolk Island", "fr": "Norfolk (l'Île)" }, + { "iso2": "MK", "iso3": "MKD", "en": "North Macedonia", "fr": "Macédoine (l'ex-République yougoslave de)" }, + { "iso2": "MP", "iso3": "MNP", "en": "Northern Mariana Islands", "fr": "Mariannes du Nord (les Îles)" }, + { "iso2": "NO", "iso3": "NOR", "en": "Norway", "fr": "Norvège" }, + { "iso2": "OM", "iso3": "OMN", "en": "Oman", "fr": "Oman" }, + { "iso2": "PK", "iso3": "PAK", "en": "Pakistan", "fr": "Pakistan" }, + { "iso2": "PW", "iso3": "PLW", "en": "Palau", "fr": "Palaos" }, + { "iso2": "PS", "iso3": "PSE", "en": "Palestine", "fr": "Palestine, État de" }, + { "iso2": "PA", "iso3": "PAN", "en": "Panama", "fr": "Panama" }, + { "iso2": "PG", "iso3": "PNG", "en": "Papua New Guinea", "fr": "Papouasie-Nouvelle-Guinée" }, + { "iso2": "PY", "iso3": "PRY", "en": "Paraguay", "fr": "Paraguay" }, + { "iso2": "PE", "iso3": "PER", "en": "Peru", "fr": "Pérou" }, + { "iso2": "PH", "iso3": "PHL", "en": "Philippines", "fr": "Philippines" }, + { "iso2": "PN", "iso3": "PCN", "en": "Pitcairn", "fr": "Pitcairn" }, + { "iso2": "PL", "iso3": "POL", "en": "Poland", "fr": "Pologne" }, + { "iso2": "PT", "iso3": "PRT", "en": "Portugal", "fr": "Portugal" }, + { "iso2": "PR", "iso3": "PRI", "en": "Puerto Rico", "fr": "Porto Rico" }, + { "iso2": "QA", "iso3": "QAT", "en": "Qatar", "fr": "Qatar" }, + { "iso2": "RE", "iso3": "REU", "en": "Réunion", "fr": "Réunion" }, + { "iso2": "RO", "iso3": "ROU", "en": "Romania", "fr": "Roumanie" }, + { "iso2": "RU", "iso3": "RUS", "en": "Russia", "fr": "Russie (la Fédération de)" }, + { "iso2": "RW", "iso3": "RWA", "en": "Rwanda", "fr": "Rwanda" }, + { "iso2": "MF", "iso3": "MAF", "en": "Saint Martin (French)", "fr": "Saint-Martin (partie française)" }, + { "iso2": "WS", "iso3": "WSM", "en": "Samoa", "fr": "Samoa" }, + { "iso2": "SM", "iso3": "SMR", "en": "San Marino", "fr": "Saint-Marin" }, + { "iso2": "ST", "iso3": "STP", "en": "Sao Tome and Principe", "fr": "Sao Tomé-et-Principe" }, + { "iso2": "SA", "iso3": "SAU", "en": "Saudi Arabia", "fr": "Arabie saoudite" }, + { "iso2": "SN", "iso3": "SEN", "en": "Senegal", "fr": "Sénégal" }, + { "iso2": "RS", "iso3": "SRB", "en": "Serbia", "fr": "Serbie" }, + { "iso2": "SC", "iso3": "SYC", "en": "Seychelles", "fr": "Seychelles" }, + { "iso2": "SL", "iso3": "SLE", "en": "Sierra Leone", "fr": "Sierra Leone" }, + { "iso2": "SG", "iso3": "SGP", "en": "Singapore", "fr": "Singapour" }, + { "iso2": "SX", "iso3": "SXM", "en": "Sint Maarten (Dutch)", "fr": "Saint-Martin (partie néerlandaise)" }, + { "iso2": "SK", "iso3": "SVK", "en": "Slovakia", "fr": "Slovaquie" }, + { "iso2": "SI", "iso3": "SVN", "en": "Slovenia", "fr": "Slovénie" }, + { "iso2": "SB", "iso3": "SLB", "en": "Solomon Islands", "fr": "Salomon (Îles)" }, + { "iso2": "SO", "iso3": "SOM", "en": "Somalia", "fr": "Somalie" }, + { "iso2": "ZA", "iso3": "ZAF", "en": "South Africa", "fr": "Afrique du Sud" }, + { "iso2": "GS", "iso3": "SGS", "en": "South Georgia and the South Sandwich Islands", "fr": "Géorgie du Sud-et-les Îles Sandwich du Sud" }, + { "iso2": "SS", "iso3": "SSD", "en": "South Sudan", "fr": "Soudan du Sud" }, + { "iso2": "ES", "iso3": "ESP", "en": "Spain", "fr": "Espagne" }, + { "iso2": "LK", "iso3": "LKA", "en": "Sri Lanka", "fr": "Sri Lanka" }, + { "iso2": "BL", "iso3": "BLM", "en": "St Barthélemy", "fr": "Saint-Barthélemy" }, + { "iso2": "SH", "iso3": "SHN", "en": "St Helena, Ascension and Tristan da Cunha", "fr": "Sainte-Hélène, Ascension et Tristan da Cunha" }, + { "iso2": "KN", "iso3": "KNA", "en": "St Kitts and Nevis", "fr": "Saint-Kitts-et-Nevis" }, + { "iso2": "LC", "iso3": "LCA", "en": "St Lucia", "fr": "Sainte-Lucie" }, + { "iso2": "PM", "iso3": "SPM", "en": "St Pierre and Miquelon", "fr": "Saint-Pierre-et-Miquelon" }, + { "iso2": "VC", "iso3": "VCT", "en": "St Vincent", "fr": "Saint-Vincent-et-les-Grenadines" }, + { "iso2": "SD", "iso3": "SDN", "en": "Sudan", "fr": "Soudan" }, + { "iso2": "SR", "iso3": "SUR", "en": "Suriname", "fr": "Suriname" }, + { "iso2": "SJ", "iso3": "SJM", "en": "Svalbard and Jan Mayen", "fr": "Svalbard et l'Île Jan Mayen" }, + { "iso2": "SE", "iso3": "SWE", "en": "Sweden", "fr": "Suède" }, + { "iso2": "CH", "iso3": "CHE", "en": "Switzerland", "fr": "Suisse" }, + { "iso2": "SY", "iso3": "SYR", "en": "Syria", "fr": "République arabe syrienne" }, + { "iso2": "TW", "iso3": "TWN", "en": "Taiwan", "fr": "Taïwan (Province de Chine)" }, + { "iso2": "TJ", "iso3": "TJK", "en": "Tajikistan", "fr": "Tadjikistan" }, + { "iso2": "TZ", "iso3": "TZA", "en": "Tanzania", "fr": "Tanzanie, République-Unie de" }, + { "iso2": "TH", "iso3": "THA", "en": "Thailand", "fr": "Thaïlande" }, + { "iso2": "TG", "iso3": "TGO", "en": "Togo", "fr": "Togo" }, + { "iso2": "TK", "iso3": "TKL", "en": "Tokelau", "fr": "Tokelau" }, + { "iso2": "TO", "iso3": "TON", "en": "Tonga", "fr": "Tonga" }, + { "iso2": "TT", "iso3": "TTO", "en": "Trinidad and Tobago", "fr": "Trinité-et-Tobago" }, + { "iso2": "TN", "iso3": "TUN", "en": "Tunisia", "fr": "Tunisie" }, + { "iso2": "TR", "iso3": "TUR", "en": "Turkey", "fr": "Turquie" }, + { "iso2": "TM", "iso3": "TKM", "en": "Turkmenistan", "fr": "Turkménistan" }, + { "iso2": "TC", "iso3": "TCA", "en": "Turks and Caicos Islands", "fr": "Turks-et-Caïcos (les Îles)" }, + { "iso2": "TV", "iso3": "TUV", "en": "Tuvalu", "fr": "Tuvalu" }, + { "iso2": "UG", "iso3": "UGA", "en": "Uganda", "fr": "Ouganda" }, + { "iso2": "UA", "iso3": "UKR", "en": "Ukraine", "fr": "Ukraine" }, + { "iso2": "AE", "iso3": "ARE", "en": "United Arab Emirates", "fr": "Émirats arabes unis" }, + { "iso2": "GB", "iso3": "GBR", "en": "United Kingdom", "fr": "Royaume-Uni" }, + { "iso2": "US", "iso3": "USA", "en": "United States", "fr": "États-Unis" }, + { "iso2": "UM", "iso3": "UMI", "en": "United States Minor Outlying Islands", "fr": "Îles mineures éloignées des États-Unis" }, + { "iso2": "VI", "iso3": "VIR", "en": "United States Virgin Islands", "fr": "Vierges des États-Unis (les Îles)" }, + { "iso2": "UY", "iso3": "URY", "en": "Uruguay", "fr": "Uruguay" }, + { "iso2": "UZ", "iso3": "UZB", "en": "Uzbekistan", "fr": "Ouzbékistan" }, + { "iso2": "VU", "iso3": "VUT", "en": "Vanuatu", "fr": "Vanuatu" }, + { "iso2": "VA", "iso3": "VAT", "en": "Vatican City", "fr": "Saint-Siège [État de la Cité du Vatican]" }, + { "iso2": "VE", "iso3": "VEN", "en": "Venezuela", "fr": "Venezuela, République bolivarienne du" }, + { "iso2": "VN", "iso3": "VNM", "en": "Vietnam", "fr": "Viet Nam" }, + { "iso2": "WF", "iso3": "WLF", "en": "Wallis and Futuna", "fr": "Wallis-et-Futuna" }, + { "iso2": "EH", "iso3": "ESH", "en": "Western Sahara", "fr": "Sahara occidental" }, + { "iso2": "YE", "iso3": "YEM", "en": "Yemen", "fr": "Yémen" }, + { "iso2": "ZM", "iso3": "ZMB", "en": "Zambia", "fr": "Zambie" }, + { "iso2": "ZW", "iso3": "ZWE", "en": "Zimbabwe", "fr": "Zimbabwe" } +] diff --git a/strr-web/utils/formStateToApi.ts b/strr-web/utils/formStateToApi.ts new file mode 100644 index 00000000..c39cbf18 --- /dev/null +++ b/strr-web/utils/formStateToApi.ts @@ -0,0 +1,73 @@ +export const formStateToApi = ( + formState: CreateAccountFormStateI, + firstName: string, + lastName: string, + fullName: string, + selectedAccountMailingAddress: SelectedAccountMailingAPII[] | undefined, + addSecondaryContact: boolean +): CreateAccountFormAPII => { + const formData = formDataForAPI + + const transformContactData = (primary: boolean) => { + const dataContact: ContactAPII | undefined = primary + ? formData.registration.primaryContact + : formData.registration.secondaryContact + if (!dataContact) { return } + const stateContact = primary + ? formState.primaryContact + : formState.secondaryContact + dataContact.name = { + firstName, + lastName + } + dataContact.dateOfBirth = `${stateContact.birthYear}-${stateContact.birthMonth}-${stateContact.birthDay}` + dataContact.details = { + preferredName: stateContact.preferredName, + phoneNumber: stateContact.phoneNumber ?? '', + extension: stateContact.extension, + faxNumber: stateContact.faxNumber, + emailAddress: stateContact.emailAddress ?? '' + } + dataContact.mailingAddress = { + address: stateContact.address ?? '', + addressLineTwo: stateContact.addressLineTwo, + city: stateContact.city ?? '', + postalCode: stateContact.postalCode ?? '', + province: stateContact.province ?? '', + country: stateContact.country ?? '' + } + + return dataContact + } + + formData.registration.primaryContact = transformContactData(true) + if (addSecondaryContact) { + formData.registration.secondaryContact = transformContactData(false) + } else { + delete formData.registration.secondaryContact + } + formData.registration.listingDetails = + formState.propertyDetails.listingDetails + formData.registration.unitAddress = { + address: formState.propertyDetails.address ?? '', + addressLineTwo: formState.propertyDetails.addressLineTwo, + city: formState.propertyDetails.city ?? '', + postalCode: formState.propertyDetails.postalCode ?? '', + province: formState.propertyDetails.province ?? '', + country: formState.propertyDetails.country ?? '' + } + formData.registration.unitDetails = { + parcelIdentifier: formState.propertyDetails.parcelIdentifier, + propertyType: formState.propertyDetails.propertyType ?? '', + ownershipType: formState.propertyDetails.ownershipType ?? '', + businessLicense: formState.propertyDetails.businessLicense + } + if (selectedAccountMailingAddress && selectedAccountMailingAddress.length) { + formData.selectedAccount.mailingAddress = { + ...selectedAccountMailingAddress[0] + } + } + formData.selectedAccount.name = fullName + + return formData +}