webpackJsonp([1],{"+66z":function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},"+7Sm":function(t,e,r){(t.exports=r("FZ+f")(!1)).push([t.i,".list-filter[data-v-1d62e14a]{opacity:.3;color:#20a8d8}.list-filter.is-enabled[data-v-1d62e14a]{opacity:1}",""])},"+gg+":function(t,e,r){var i=r("TQ3y")["__core-js_shared__"];t.exports=i},"+te5":function(t,e,r){var i=r("7lMT");"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);r("rjj0")("dd707630",i,!1,{sourceMap:!1})},"+tje":function(t,e,r){"use strict";var i=r("Xxa5"),n=r.n(i),s=r("exGp"),a=r.n(s),o=r("BO1k"),l=r.n(o),c=r("Dd8w"),u=r.n(c),d=r("kvU2"),p=r.n(d),f=r("PJh5"),h=r.n(f),m=r("fiaM"),v=r("NYxO"),g=r("HPim"),b=r("NnWl");e.a={props:{registration:{type:Object,required:!0},trip:{type:Object}},components:{AirportAutocomplete:g.a},data:function(){return{modalId:this.trip?"edit-trip-"+this.trip.id:"add-trip-"+this.registration.id,loading:!1,initialParams:{assign_now:0,capacity:this.trip?this.trip.capacity:0,description:this.trip?this.trip.description:null,booking_reference:this.trip?this.trip.booking_reference:null,is_group_booking:this.trip?this.trip.is_group_booking:0,segments:this.trip?this.trip.segments:[],arrive_deviation_transit_airport:this.trip?this.trip.arrive_deviation_transit_airport:null},params:{}}},created:function(){var t=this;this.initialiseFields(),this.isEditing||b.a.$on("button-edit-trip.new",function(){console.log("button-edit-trip.new"),t.$bvModal.show(t.modalId)})},computed:u()({isEditing:function(){return!!this.trip},modalOkTitle:function(){return this.loading?"Saving...":"Save"}},Object(v.mapState)({activeSeason:"activeSeason"})),methods:{initialiseFields:function(){this.params=p()(this.initialParams),this.isEditing||(this.params.assign_now=1);var t=!0,e=!1,r=void 0;try{for(var i,n=l()(this.params.segments);!(t=(i=n.next()).done);t=!0){var s=i.value;s.departure_time_date=h()(s.departure_time).format("YYYY-MM-DD"),s.departure_time_time=h()(s.departure_time).format("HH:mm"),s.arrival_time_date=h()(s.arrival_time).format("YYYY-MM-DD"),s.arrival_time_time=h()(s.arrival_time).format("HH:mm")}}catch(t){e=!0,r=t}finally{try{!t&&n.return&&n.return()}finally{if(e)throw r}}},addSegment:function(){var t=this.params.segments.length>0?this.params.segments[this.params.segments.length-1]:null;t&&this.syncSegmentTimes(t);var e=t?{departure_airport:t.arrival_airport,departure_time:t.arrival_time,departure_time_date:h()(t.arrival_time).format("YYYY-MM-DD"),departure_time_time:h()(t.arrival_time).format("HH:mm")}:{},r=m.a.bakeTripSegment(e);this.params.segments.push(r)},removeSegment:function(t){this.params.segments.splice(t,1)},handleOk:function(t){t.preventDefault(),this.isValid()?this.handleSubmit():this.showError({message:"Form validation failed. Please check all values."})},isValid:function(){return!0},onAirportSelected:function(t){var e=t.airport,r=t.index,i=t.field;this.params.segments[r][i]=e.iata_code},onDeviationAirportSelected:function(t){var e=t.airport;t.index,t.field;this.params.arrive_deviation_transit_airport=e.iata_code},syncSegmentTimes:function(t){t.departure_time=h()(t.departure_time_date+" "+t.departure_time_time,"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm:ss"),t.arrival_time=h()(t.arrival_time_date+" "+t.arrival_time_time,"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm:ss")},bakePayload:function(){var t=this,e=null,r=null,i=null,n=null;if(this.params.segments.length>0){var s=!0,a=!1,o=void 0;try{for(var c,d=l()(this.params.segments);!(s=(c=d.next()).done);s=!0){var f=c.value;this.syncSegmentTimes(f)}}catch(t){a=!0,o=t}finally{try{!s&&d.return&&d.return()}finally{if(a)throw o}}var h=["MED","JED","RUH","YNB"],m=p()(this.params.segments);e=m[0],r=m.find(function(t){return h.indexOf(t.arrival_airport)>-1}),i=m.find(function(t){return h.indexOf(t.departure_airport)>-1}),n=m.reverse().find(function(e){return e.arrival_airport===t.params.arrive_deviation_transit_airport})}return u()({},this.params,{season_id:this.activeSeason.id,depart_home_flight_code:e?e.flight_code:null,depart_home_airport:e?e.departure_airport:null,depart_home_time:e?e.departure_time:null,arrive_saudi_flight_code:r?r.flight_code:null,arrive_saudi_airport:r?r.arrival_airport:null,arrive_saudi_time:r?r.arrival_time:null,depart_saudi_flight_code:i?i.flight_code:null,depart_saudi_airport:i?i.departure_airport:null,depart_saudi_time:i?i.departure_time:null,arrive_deviation_transit_flight_code:n?n.flight_code:null,arrive_deviation_transit_airport:n?n.arrival_airport:null,arrive_deviation_transit_time:n?n.arrival_time:null})},handleSubmit:function(){var t=a()(n.a.mark(function t(){var e;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.loading=!0,e=this.bakePayload(),t.prev=2,!this.isEditing){t.next=8;break}return t.next=6,this.$store.dispatch("registrations/trips/update",{payload:e,parent:this.registration,modelId:this.trip.id});case 6:t.next=10;break;case 8:return t.next=10,this.$store.dispatch("registrations/trips/create",{payload:e,parent:this.registration});case 10:this.$refs.modal.hide(),this.showSuccess(),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(2),console.error(t.t0),this.showError({message:"["+t.t0.response.status+"] "+t.t0.response.data.message});case 18:this.loading=!1;case 19:case"end":return t.stop()}},t,this,[[2,14]])}));return function(){return t.apply(this,arguments)}}()},notifications:{showError:{title:"Saving trip failed",message:"Whoops, something went wrong",type:"error"},showSuccess:{message:"Saved successfully",type:"success"}}}},"+x9i":function(t,e,r){var i=r("vjaL"),n=function(t){var e=[(t=t||{}).lightness,t.saturation].map(function(t){return t=t||[.35,.5,.65],"[object Array]"===Object.prototype.toString.call(t)?t.concat():[t]});this.L=e[0],this.S=e[1],this.hash=t.hash||i};n.prototype.hsl=function(t){var e,r,i=this.hash(t);return e=i%359,i=parseInt(i/360),r=this.S[i%this.S.length],i=parseInt(i/this.S.length),[e,r,this.L[i%this.L.length]]},n.prototype.rgb=function(t){var e=this.hsl(t);return function(t,e,r){t/=360;var i=r<.5?r*(1+e):r+e-r*e,n=2*r-i;return[t+1/3,t,t-1/3].map(function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(i-n)*t:t<.5?i:t<2/3?n+6*(i-n)*(2/3-t):n,Math.round(255*t)})}.apply(this,e)},n.prototype.hex=function(t){var e,r=this.rgb(t);return e="#",r.forEach(function(t){t<16&&(e+=0),e+=t.toString(16)}),e},t.exports=n},"/1zI":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("jtnD"),n=r("Ygwn"),s=r("VU/8")(i.a,n.a,!1,null,null,null);s.options.__file="pages/admin/registrations/documents.vue",e.default=s.exports},"/4xH":function(t,e,r){var i=r("/TtT");"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);r("rjj0")("17609277",i,!1,{sourceMap:!1})},"/Ce5":function(t,e,r){var i;i=function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=89)}([function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){var i=r(54),n=r(14);t.exports=function(t){return i(n(t))}},function(t,e,r){t.exports=!r(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,r){var i=r(5),n=r(11);t.exports=r(3)?function(t,e,r){return i.f(t,e,n(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var i=r(7),n=r(29),s=r(23),a=Object.defineProperty;e.f=r(3)?Object.defineProperty:function(t,e,r){if(i(t),e=s(e,!0),i(r),n)try{return a(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var i=r(21)("wks"),n=r(12),s=r(0).Symbol,a="function"==typeof s;(t.exports=function(t){return i[t]||(i[t]=a&&s[t]||(a?s:n)("Symbol."+t))}).store=i},function(t,e,r){var i=r(9);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){var i=r(34),n=r(15);t.exports=Object.keys||function(t){return i(t,n)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var r=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+i).toString(36))}},function(t,e){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){t.exports={}},function(t,e){t.exports=!0},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){var i=r(5).f,n=r(1),s=r(6)("toStringTag");t.exports=function(t,e,r){t&&!n(t=r?t:t.prototype,s)&&i(t,s,{configurable:!0,value:e})}},function(t,e,r){var i=r(21)("keys"),n=r(12);t.exports=function(t){return i[t]||(i[t]=n(t))}},function(t,e,r){var i=r(0),n=i["__core-js_shared__"]||(i["__core-js_shared__"]={});t.exports=function(t){return n[t]||(n[t]={})}},function(t,e){var r=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:r)(t)}},function(t,e,r){var i=r(9);t.exports=function(t,e){if(!i(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!i(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!i(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!i(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var i=r(0),n=r(13),s=r(17),a=r(25),o=r(5).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=s?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||o(e,t,{value:a.f(t)})}},function(t,e,r){e.f=r(6)},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){var i=r(9),n=r(0).document,s=i(n)&&i(n.createElement);t.exports=function(t){return s?n.createElement(t):{}}},function(t,e,r){var i=r(0),n=r(13),s=r(51),a=r(4),o=function(t,e,r){var l,c,u,d=t&o.F,p=t&o.G,f=t&o.S,h=t&o.P,m=t&o.B,v=t&o.W,g=p?n:n[e]||(n[e]={}),b=g.prototype,y=p?i:f?i[e]:(i[e]||{}).prototype;for(l in p&&(r=e),r)(c=!d&&y&&void 0!==y[l])&&l in g||(u=c?y[l]:r[l],g[l]=p&&"function"!=typeof y[l]?r[l]:m&&c?s(u,i):v&&y[l]==u?function(t){var e=function(e,r,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(u):h&&"function"==typeof u?s(Function.call,u):u,h&&((g.virtual||(g.virtual={}))[l]=u,t&o.R&&b&&!b[l]&&a(b,l,u)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,t.exports=o},function(t,e,r){t.exports=!r(3)&&!r(8)(function(){return 7!=Object.defineProperty(r(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){"use strict";var i=r(17),n=r(28),s=r(35),a=r(4),o=r(1),l=r(16),c=r(56),u=r(19),d=r(63),p=r(6)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,r,m,v,g,b){c(r,e,m);var y,_,x,w=function(t){if(!f&&t in z)return z[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},k=e+" Iterator",C="values"==v,S=!1,z=t.prototype,j=z[p]||z["@@iterator"]||v&&z[v],E=j||w(v),F=v?C?w("entries"):E:void 0,L="Array"==e&&z.entries||j;if(L&&(x=d(L.call(new t)))!==Object.prototype&&(u(x,k,!0),i||o(x,p)||a(x,p,h)),C&&j&&"values"!==j.name&&(S=!0,E=function(){return j.call(this)}),i&&!b||!f&&!S&&z[p]||a(z,p,E),l[e]=E,l[k]=h,v)if(y={values:C?E:w("values"),keys:g?E:w("keys"),entries:F},b)for(_ in y)_ in z||s(z,_,y[_]);else n(n.P+n.F*(f||S),e,y);return y}},function(t,e,r){var i=r(7),n=r(60),s=r(15),a=r(20)("IE_PROTO"),o=function(){},l=function(){var t,e=r(27)("iframe"),i=s.length;for(e.style.display="none",r(53).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("