(window.webpackJsonp=window.webpackJsonp||[]).push([[1,158,159,168,170],{353:function(t,e,n){"use strict";n.r(e);var o=n(370),r=n(399),l=n(383),c={components:{MemberAddress:o.default},computed:{overview:function(){return null!==this.immutableContact?this.immutableContact:this.$store.state.member.contact}},methods:{getContactInfo:function(){this.$store.dispatch("member/getMemberContactDetails",{type:"".concat(this.memberType,"s"),id:void 0!==this.memberId?this.memberId:this.$route.params.id})},showManageContactDetails:function(){var t=this;this.$buefy.modal.open({parent:this,component:r.default,hasModalCard:!0,trapFocus:!0,fullScreen:!1,props:{contactBaseUrl:this.postUrl,memberContacts:this.managingUserContacts},events:{refresh:function(e){t.getContactInfo()}}})},showOpenInMappingSoftwareModal:function(address){this.$buefy.modal.open({parent:this,component:l.default,hasModalCard:!0,trapFocus:!0,fullScreen:!1,props:{address:address}})}},mounted:function(){var t=this;this.$nextTick((function(){null===t.immutableContact&&(t.$store.commit("member/setContactDetails",null),t.getContactInfo())}))},props:{memberType:{type:String,required:!1,default:null},memberId:{type:String,required:!1},immutableContact:{type:Object,required:!1,default:null},showUnverifiedWarning:{type:Boolean,default:!0,required:!1},managingUserContacts:{type:Boolean,required:!1,default:!1},postUrl:{type:String,required:!1,default:function(){return"contact/members/".concat(this.$route.params.id)}}}},d=(n(388),n(2)),component=Object(d.a)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",[null!==t.overview&&void 0!==t.overview?[n("div",{staticClass:"flex-container mb-4"},[n("div",{staticClass:"icon-child"},[n("b-icon",{attrs:{icon:"email-outline"}})],1),t._v(" "),n("div",{staticClass:"flex-child"},[t.overview.emails.length>0?t._l(t.overview.emails,(function(e){return n("p",{key:e.id,staticClass:"pb-1"},[null===e.verified&&t.showUnverifiedWarning?n("b-tag",{attrs:{type:"is-danger is-light"}},[t._v("Unverified")]):t._e(),t._v(" "),n("a",{attrs:{href:"mailto:"+e.email,target:"_blank"}},[t._v(t._s(e.email))])],1)})):[t._v("\n No email addresses.\n ")]],2)]),t._v(" "),n("div",{staticClass:"flex-container mb-4"},[n("div",{staticClass:"icon-child"},[n("b-icon",{attrs:{icon:"phone-outline"}})],1),t._v(" "),n("div",{staticClass:"flex-child"},[t.overview.phones.length>0?t._l(t.overview.phones,(function(e){return n("p",{key:e.id,staticClass:"pb-1"},[null===e.verified?n("b-tag",{attrs:{type:"is-danger is-light"}},[t._v("Unverified")]):t._e(),t._v(" "),n("a",{attrs:{href:"tel:"+e.phone}},[t._v(t._s(e.phone))])],1)})):[t._v("\n No phone numbers.\n ")]],2)]),t._v(" "),n("div",{staticClass:"flex-container mb-4"},[n("div",{staticClass:"icon-child"},[n("b-icon",{attrs:{icon:"home-outline"}})],1),t._v(" "),n("div",{staticClass:"flex-child"},[t.overview.addresses.length>0?t._l(t.overview.addresses,(function(address){return n("p",{key:address.id,staticClass:"pb-1"},[n("a",{on:{click:function(e){return t.showOpenInMappingSoftwareModal(address.address)}}},[n("member-address",{attrs:{address:address.address}})],1)])})):[t._v("\n No addresses.\n ")]],2)]),t._v(" "),null!==t.memberType?n("div",{staticClass:"pt-1"},[n("b-button",{attrs:{type:"is-text",size:"is-small"},on:{click:t.showManageContactDetails}},[t._v("Manage Contact Details")])],1):t._e()]:t._e()],2)}),[],!1,null,"7db1481b",null);e.default=component.exports},359:function(t,e,n){var content=n(389);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(35).default)("5dd4b7c2",content,!0,{sourceMap:!1})},360:function(t,e,n){var content=n(391);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(35).default)("22f5828b",content,!0,{sourceMap:!1})},376:function(t,e,n){"use strict";n.r(e);n(15);var o={props:{postUrl:String,existing:{type:Object,required:!1,default:null}},data:function(){return{first:"",last:"",relation:""}},mounted:function(){var t=this;this.$nextTick((function(){null!==t.existing&&(t.first=t.existing.name.first,t.last=t.existing.name.last,t.relation=t.existing.relation)}))},methods:{deleteContact:function(){var t=this;this.$axios.delete(this.postUrl).then((function(e){t.$emit("refresh"),t.$emit("deleted"),t.$parent.close()}))},saveDetails:function(){var t=this;this.$axios.post(this.postUrl,{first:this.first,last:this.last,relation:this.relation}).then((function(e){t.$emit("refresh"),t.$parent.close()}))}}},r=(n(390),n(2)),component=Object(r.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"modal-card"},[n("header",{staticClass:"modal-card-head"},[n("p",{staticClass:"modal-card-title"},[t._v("\n "+t._s(null===t.existing?"New Emergency Contact":"Edit Emergency Contact")+"\n ")])]),t._v(" "),n("section",{staticClass:"modal-card-body"},[n("b-field",{attrs:{label:"First Name"}},[n("b-input",{attrs:{type:"text",placeholder:"John",required:""},model:{value:t.first,callback:function(e){t.first=e},expression:"first"}})],1),t._v(" "),n("b-field",{attrs:{label:"Last Name"}},[n("b-input",{attrs:{type:"text",placeholder:"Smith",required:""},model:{value:t.last,callback:function(e){t.last=e},expression:"last"}})],1),t._v(" "),n("b-field",{attrs:{label:"Relation"}},[n("b-input",{attrs:{type:"text",placeholder:"Guardian",required:""},model:{value:t.relation,callback:function(e){t.relation=e},expression:"relation"}})],1)],1),t._v(" "),n("footer",{staticClass:"modal-card-foot"},[n("div",{staticClass:"grid-container"},[n("div",{staticClass:"right"},[null!==t.existing?n("b-button",{attrs:{"icon-left":"delete-outline",type:"is-danger is-light"},on:{click:function(e){return t.deleteContact()}}}):t._e()],1),t._v(" "),n("div",{staticClass:"left"},[n("b-button",{attrs:{label:"Close"},on:{click:function(e){return t.$emit("close")}}}),t._v(" "),n("b-button",{attrs:{label:null===t.existing?"Add":"Update",type:"is-primary"},on:{click:function(e){return t.saveDetails()}}})],1)])])])}),[],!1,null,"6bb531cd",null);e.default=component.exports},383:function(t,e,n){"use strict";n.r(e);var o={components:{MemberAddress:n(370).default},data:function(){return{stringAddress:null}},props:{address:{type:Object,required:!0}},methods:{copyAddress:function(){var t=this;navigator.clipboard.writeText(this.stringAddress).then((function(){t.$buefy.snackbar.open("Address copied!")}),(function(){t.$buefy.snackbar.open({message:"Failed to copy address",type:"is-danger",actionText:"OK",queue:!1,duration:2500})}))},openInGoogleMaps:function(){window.open("https://www.google.com/maps/search/?api=1&query=".concat(this.stringAddress),"_blank"),this.$buefy.snackbar.open("Opened in Google Maps")},openInWaze:function(){window.open("https://waze.com/ul?q=".concat(this.stringAddress),"_blank"),this.$buefy.snackbar.open("Opened in Waze")}}},r=n(2),component=Object(r.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"modal-card"},[n("header",{staticClass:"modal-card-head"},[n("p",{staticClass:"modal-card-title"},[t._v("\n Open Address\n ")]),t._v(" "),n("button",{staticClass:"delete",attrs:{type:"button"},on:{click:function(e){return t.$emit("close")}}})]),t._v(" "),n("section",{staticClass:"modal-card-body"},[n("p",[t._v("\n Please select how you wish to open the address.\n ")]),t._v(" "),n("p",{staticClass:"has-text-centered"},[n("b",[n("member-address",{attrs:{address:t.address},on:{"string-address":function(e){return t.stringAddress=e}}})],1)]),t._v(" "),n("div",{staticClass:"buttons pt-3"},[n("b-button",{attrs:{"icon-left":"content-copy",type:"is-primary",disabled:null===t.stringAddress},on:{click:t.copyAddress}},[t._v("\n Copy\n ")]),t._v(" "),n("b-button",{attrs:{"icon-left":"google-maps",type:"is-primary",disabled:null===t.stringAddress},on:{click:t.openInGoogleMaps}},[t._v("\n Google Maps\n ")]),t._v(" "),n("b-button",{attrs:{"icon-left":"waze",type:"is-primary",disabled:null===t.stringAddress},on:{click:t.openInWaze}},[t._v("\n Waze\n ")])],1)]),t._v(" "),n("footer",{staticClass:"modal-card-foot"},[n("b-button",{attrs:{label:"Close"},on:{click:function(e){return t.$emit("close")}}})],1)])}),[],!1,null,null,null);e.default=component.exports},388:function(t,e,n){"use strict";n(359)},389:function(t,e,n){var o=n(34)(!1);o.push([t.i,".flex-container[data-v-7db1481b]{display:flex;width:100%}.flex-child[data-v-7db1481b]{flex:1}.icon-child[data-v-7db1481b]{flex:0 0 1em;margin-right:2em;flex-wrap:wrap}",""]),t.exports=o},390:function(t,e,n){"use strict";n(360)},391:function(t,e,n){var o=n(34)(!1);o.push([t.i,'.grid-container[data-v-6bb531cd]{width:100%;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;grid-gap:0 0;gap:0 0;grid-auto-flow:row;grid-template-areas:"left right"}.right[data-v-6bb531cd]{grid-area:right;margin-left:auto;margin-right:0}.left[data-v-6bb531cd]{grid-area:left}',""]),t.exports=o},414:function(t,e,n){"use strict";n.r(e);var o=n(353),r=n(376),l=n(425),c={components:{CommonContactInformationOverview:o.default},props:{showManagementButtons:{type:Boolean,required:!1,default:!0},postUrl:{type:String,required:!1,default:function(){return"contact/members/emergency/".concat(this.$route.params.id)}},emergencyContacts:{type:Array,required:!1,default:function(){return null}}},data:function(){return{people:[]}},computed:{loading:function(){return!this.emergencyContacts&&null===this.$store.state.member.emergencyContacts},internalEmergencyContacts:function(){return null!==this.emergencyContacts?this.emergencyContacts:this.$store.state.member.emergencyContacts},totalContacts:function(){return null===this.internalEmergencyContacts?0:this.internalEmergencyContacts.length}},methods:{showManageContactsModal:function(){var t=this;this.$buefy.modal.open({parent:this,component:l.default,hasModalCard:!0,props:{postUrl:this.postUrl},events:{refresh:function(){t.$emit("refresh")}}})},showAddPersonModal:function(){var t=this;this.$buefy.modal.open({parent:this,component:r.default,hasModalCard:!0,props:{postUrl:this.postUrl},events:{refresh:function(){t.$emit("refresh")}}})}}},d=n(2),component=Object(d.a)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",[t.loading?n("p",[t._v("\n Loading....\n ")]):0==t.totalContacts?n("p",[t._v("\n No emergency contacts, please add one.\n ")]):t.totalContacts>0?t._l(t.internalEmergencyContacts,(function(e){return n("div",{key:e},[n("h2",{staticClass:"is-size-4 pt-2"},[t._v(t._s(e.name.first)+" "+t._s(e.name.last))]),t._v(" "),""!==e.relation?n("h3",{staticClass:"subtitle is-6 mb-2"},[t._v(t._s(e.relation))]):t._e(),t._v(" "),n("common-contact-information-overview",{attrs:{"immutable-contact":e,"show-unverified-warning":!1,"post-url":t.postUrl}}),t._v(" "),n("p",{staticClass:"is-size-7 has-text-grey-light mt-0"},["linked"===e.type?[t._v("\n This information is based on an established link to "+t._s(e.name.first)+".\n ")]:"static"===e.type?[t._v("\n This information is based on a static entry.\n ")]:t._e()],2)],1)})):n("p",[t._v("\n Oh length "+t._s(t.totalContacts)+"\n ")]),t._v(" "),null!==t.memberType&&t.showManagementButtons?n("div",{staticClass:"pt-3"},[t.totalContacts>0?n("b-button",{attrs:{type:"is-text",size:"is-small"},on:{click:function(e){return t.showManageContactsModal()}}},[t._v("Manage Contacts")]):t._e(),t._v(" "),n("b-button",{attrs:{type:"is-text",size:"is-small"},on:{click:function(e){return t.showAddPersonModal()}}},[t._v("Add Emergency Contact")])],1):t._e()],2)}),[],!1,null,null,null);e.default=component.exports},425:function(t,e,n){"use strict";n.r(e);n(18),n(24);var o=n(353),r=n(399),l=n(376),c={components:{CommonContactInformationOverview:o.default},props:{postUrl:{type:String,required:!1,default:function(){return"contact/members/emergency/".concat(this.$route.params.id)}},existing:{type:Object,required:!1,default:null}},data:function(){return{activeTab:0}},computed:{emergencyContacts:function(){return this.$store.state.member.emergencyContacts.filter((function(t){return"static"===t.type}))}},watch:{emergencyContacts:function(){console.log("changed!!!")}},methods:{showEditNameModal:function(t){var e=this;this.$buefy.modal.open({parent:this,component:l.default,hasModalCard:!0,props:{postUrl:"".concat(this.postUrl,"/").concat(t.id),existing:t},events:{refresh:function(){e.$emit("refresh")},delete:function(){e.activeTab=0}}})},showEditContactDetailsModal:function(t){var e=this;this.$buefy.modal.open({parent:this,component:r.default,hasModalCard:!0,trapFocus:!0,fullScreen:!1,props:{contactBaseUrl:"".concat(this.postUrl,"/").concat(t.id),emergencyPersonId:t.id},events:{refresh:function(){e.$emit("refresh")}}})}}},d=n(2),component=Object(d.a)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"modal-card"},[t._m(0),t._v(" "),n("section",{staticClass:"modal-card-body pt-1"},[t.emergencyContacts.length>0?n("b-tabs",{model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},t._l(t.emergencyContacts,(function(e){return n("b-tab-item",{key:e.id,attrs:{label:e.name.first+" "+e.name.last}},[n("common-contact-information-overview",{attrs:{"immutable-contact":e,"show-unverified-warning":!1}}),t._v(" "),n("b-button",{attrs:{type:"is-text",size:"is-small"},on:{click:function(n){return t.showEditNameModal(e)}}},[t._v("\n Edit "+t._s(e.name.first)+"'s Information\n ")]),t._v(" "),n("b-button",{attrs:{type:"is-text",size:"is-small"},on:{click:function(n){return t.showEditContactDetailsModal(e)}}},[t._v("\n Manage "+t._s(e.name.first)+"'s Contact Details\n ")])],1)})),1):n("p",{staticClass:"pt-3"},[t._v("\n No static emergency contacts.\n ")])],1),t._v(" "),n("footer",{staticClass:"modal-card-foot"},[n("b-button",{attrs:{label:"Close"},on:{click:function(e){return t.$parent.close()}}})],1)])}),[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("header",{staticClass:"modal-card-head"},[n("p",{staticClass:"modal-card-title"},[t._v("\n Manage Emergency Contacts\n ")])])}],!1,null,null,null);e.default=component.exports}}]);