/*! For license information please see commons-376892cdaeb739bc1ccd.js.LICENSE.txt */ (self.webpackChunkphaeria_dev=self.webpackChunkphaeria_dev||[]).push([[9351],{7757:function(e,t,n){e.exports=n(5666)},3964:function(e,t,n){(e=n.nmd(e)).exports=function(){"use strict";var t,n;function r(){return t.apply(null,arguments)}function i(e){t=e}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function d(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Y=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,j={},F={};function U(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(F[e]=i),t&&(F[t[0]]=function(){return R(i.apply(this,arguments),t[1],t[2])}),n&&(F[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function G(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function q(e){var t,n,r=e.match(Y);for(t=0,n=r.length;t=0&&L.test(e);)e=e.replace(L,r),L.lastIndex=0,n-=1;return e}var W={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Q(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Y).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var B="Invalid date";function Z(){return this._invalidDate}var J="%d",z=/\d{1,2}/;function K(e){return this._ordinal.replace("%d",e)}var X={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function $(e,t,n,r){var i=this._relativeTime[n];return P(i)?i(e,t,n,r):i.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return P(n)?n(t):n.replace(/%s/i,t)}var te={};function ne(e,t){var n=e.toLowerCase();te[n]=te[n+"s"]=te[t]=e}function re(e){return"string"==typeof e?te[e]||te[e.toLowerCase()]:void 0}function ie(e){var t,n,r={};for(n in e)s(e,n)&&(t=re(n))&&(r[t]=e[n]);return r}var ae={};function oe(e,t){ae[e]=t}function se(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:ae[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}function ue(e){return e%4==0&&e%100!=0||e%400==0}function de(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ce(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=de(t)),n}function le(e,t){return function(n){return null!=n?(he(this,e,n),r.updateOffset(this,t),this):fe(this,e)}}function fe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function he(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&ue(e.year())&&1===e.month()&&29===e.date()?(n=ce(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),$e(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function pe(e){return P(this[e=re(e)])?this[e]():this}function me(e,t){if("object"==typeof e){var n,r=se(e=ie(e));for(n=0;n68?1900:2e3)};var yt=le("FullYear",!0);function gt(){return ue(this.year())}function vt(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function Dt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,n){var r=7+t-n;return-(7+Dt(e,0,r).getUTCDay()-t)%7+r-1}function _t(e,t,n,r,i){var a,o,s=1+7*(t-1)+(7+n-r)%7+wt(e,r,i);return s<=0?o=mt(a=e-1)+s:s>mt(e)?(a=e+1,o=s-mt(e)):(a=e,o=s),{year:a,dayOfYear:o}}function St(e,t,n){var r,i,a=wt(e.year(),t,n),o=Math.floor((e.dayOfYear()-a-1)/7)+1;return o<1?r=o+Ot(i=e.year()-1,t,n):o>Ot(e.year(),t,n)?(r=o-Ot(e.year(),t,n),i=e.year()+1):(i=e.year(),r=o),{week:r,year:i}}function Ot(e,t,n){var r=wt(e,t,n),i=wt(e+1,t,n);return(mt(e)-r+i)/7}function bt(e){return St(e,this._week.dow,this._week.doy).week}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),oe("week",5),oe("isoWeek",5),xe("w",Se),xe("ww",Se,ve),xe("W",Se),xe("WW",Se,ve),Ue(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=ce(e)}));var Tt={dow:0,doy:6};function Ct(){return this._week.dow}function kt(){return this._week.doy}function Et(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Pt(e){var t=St(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function It(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Nt(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Mt(e,t){return e.slice(t,7).concat(e.slice(0,t))}U("d",0,"do","day"),U("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),U("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),U("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),oe("day",11),oe("weekday",11),oe("isoWeekday",11),xe("d",Se),xe("e",Se),xe("E",Se),xe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),xe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),xe("dddd",(function(e,t){return t.weekdaysRegex(e)})),Ue(["dd","ddd","dddd"],(function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:y(n).invalidWeekday=e})),Ue(["d","e","E"],(function(e,t,n,r){t[r]=ce(e)}));var At="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),xt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Yt=Ae,Lt=Ae,jt=Ae;function Ft(e,t){var n=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Mt(n,this._week.dow):e?n[e.day()]:n}function Ut(e){return!0===e?Mt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Gt(e){return!0===e?Mt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function qt(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=qe.call(this._weekdaysParse,o))?i:null:"ddd"===t?-1!==(i=qe.call(this._shortWeekdaysParse,o))?i:null:-1!==(i=qe.call(this._minWeekdaysParse,o))?i:null:"dddd"===t?-1!==(i=qe.call(this._weekdaysParse,o))||-1!==(i=qe.call(this._shortWeekdaysParse,o))||-1!==(i=qe.call(this._minWeekdaysParse,o))?i:null:"ddd"===t?-1!==(i=qe.call(this._shortWeekdaysParse,o))||-1!==(i=qe.call(this._weekdaysParse,o))||-1!==(i=qe.call(this._minWeekdaysParse,o))?i:null:-1!==(i=qe.call(this._minWeekdaysParse,o))||-1!==(i=qe.call(this._weekdaysParse,o))||-1!==(i=qe.call(this._shortWeekdaysParse,o))?i:null}function Vt(e,t,n){var r,i,a;if(this._weekdaysParseExact)return qt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Ht(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=It(e,this.localeData()),this.add(e-t,"d")):t}function Wt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Qt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Nt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Bt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Yt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Zt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Lt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Jt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=jt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function zt(){function e(e,t){return t.length-e.length}var t,n,r,i,a,o=[],s=[],u=[],d=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=Le(this.weekdaysMin(n,"")),i=Le(this.weekdaysShort(n,"")),a=Le(this.weekdays(n,"")),o.push(r),s.push(i),u.push(a),d.push(r),d.push(i),d.push(a);o.sort(e),s.sort(e),u.sort(e),d.sort(e),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Kt(){return this.hours()%12||12}function Xt(){return this.hours()||24}function $t(e,t){U(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function en(e,t){return t._meridiemParse}function tn(e){return"p"===(e+"").toLowerCase().charAt(0)}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Kt),U("k",["kk",2],0,Xt),U("hmm",0,0,(function(){return""+Kt.apply(this)+R(this.minutes(),2)})),U("hmmss",0,0,(function(){return""+Kt.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)})),U("Hmm",0,0,(function(){return""+this.hours()+R(this.minutes(),2)})),U("Hmmss",0,0,(function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)})),$t("a",!0),$t("A",!1),ne("hour","h"),oe("hour",13),xe("a",en),xe("A",en),xe("H",Se),xe("h",Se),xe("k",Se),xe("HH",Se,ve),xe("hh",Se,ve),xe("kk",Se,ve),xe("hmm",Oe),xe("hmmss",be),xe("Hmm",Oe),xe("Hmmss",be),Fe(["H","HH"],Qe),Fe(["k","kk"],(function(e,t,n){var r=ce(e);t[Qe]=24===r?0:r})),Fe(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),Fe(["h","hh"],(function(e,t,n){t[Qe]=ce(e),y(n).bigHour=!0})),Fe("hmm",(function(e,t,n){var r=e.length-2;t[Qe]=ce(e.substr(0,r)),t[Be]=ce(e.substr(r)),y(n).bigHour=!0})),Fe("hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[Qe]=ce(e.substr(0,r)),t[Be]=ce(e.substr(r,2)),t[Ze]=ce(e.substr(i)),y(n).bigHour=!0})),Fe("Hmm",(function(e,t,n){var r=e.length-2;t[Qe]=ce(e.substr(0,r)),t[Be]=ce(e.substr(r))})),Fe("Hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[Qe]=ce(e.substr(0,r)),t[Be]=ce(e.substr(r,2)),t[Ze]=ce(e.substr(i))}));var nn=/[ap]\.?m?\.?/i,rn=le("Hours",!0);function an(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var on,sn={calendar:A,longDateFormat:W,invalidDate:B,ordinal:J,dayOfMonthOrdinalParse:z,relativeTime:X,months:et,monthsShort:tt,week:Tt,weekdays:At,weekdaysMin:Rt,weekdaysShort:xt,meridiemParse:nn},un={},dn={};function cn(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=hn(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&cn(i,n)>=t-1)break;t--}a++}return on}function hn(t){var n=null;if(void 0===un[t]&&e&&e.exports)try{n=on._abbr,Object(function(){var e=new Error("Cannot find module 'undefined'");throw e.code="MODULE_NOT_FOUND",e}()),pn(n)}catch(r){un[t]=null}return un[t]}function pn(e,t){var n;return e&&((n=d(t)?gn(e):mn(e,t))?on=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),on._abbr}function mn(e,t){if(null!==t){var n,r=sn;if(t.abbr=e,null!=un[e])E("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=un[e]._config;else if(null!=t.parentLocale)if(null!=un[t.parentLocale])r=un[t.parentLocale]._config;else{if(null==(n=hn(t.parentLocale)))return dn[t.parentLocale]||(dn[t.parentLocale]=[]),dn[t.parentLocale].push({name:e,config:t}),null;r=n._config}return un[e]=new M(N(r,t)),dn[e]&&dn[e].forEach((function(e){mn(e.name,e.config)})),pn(e),un[e]}return delete un[e],null}function yn(e,t){if(null!=t){var n,r,i=sn;null!=un[e]&&null!=un[e].parentLocale?un[e].set(N(un[e]._config,t)):(null!=(r=hn(e))&&(i=r._config),t=N(i,t),null==r&&(t.abbr=e),(n=new M(t)).parentLocale=un[e],un[e]=n),pn(e)}else null!=un[e]&&(null!=un[e].parentLocale?(un[e]=un[e].parentLocale,e===pn()&&pn(e)):null!=un[e]&&delete un[e]);return un[e]}function gn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return on;if(!a(e)){if(t=hn(e))return t;e=[e]}return fn(e)}function vn(){return C(un)}function Dn(e){var t,n=e._a;return n&&-2===y(e).overflow&&(t=n[He]<0||n[He]>11?He:n[We]<1||n[We]>$e(n[Ve],n[He])?We:n[Qe]<0||n[Qe]>24||24===n[Qe]&&(0!==n[Be]||0!==n[Ze]||0!==n[Je])?Qe:n[Be]<0||n[Be]>59?Be:n[Ze]<0||n[Ze]>59?Ze:n[Je]<0||n[Je]>999?Je:-1,y(e)._overflowDayOfYear&&(tWe)&&(t=We),y(e)._overflowWeeks&&-1===t&&(t=ze),y(e)._overflowWeekday&&-1===t&&(t=Ke),y(e).overflow=t),e}var wn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_n=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sn=/Z|[+-]\d\d(?::?\d\d)?/,On=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],bn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Tn=/^\/?Date\((-?\d+)/i,Cn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,kn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function En(e){var t,n,r,i,a,o,s=e._i,u=wn.exec(s)||_n.exec(s);if(u){for(y(e).iso=!0,t=0,n=On.length;tmt(a)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),n=Dt(a,0,e._dayOfYear),e._a[He]=n.getUTCMonth(),e._a[We]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=r[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Qe]&&0===e._a[Be]&&0===e._a[Ze]&&0===e._a[Je]&&(e._nextDay=!0,e._a[Qe]=0),e._d=(e._useUTC?Dt:vt).apply(null,o),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Qe]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function Fn(e){var t,n,r,i,a,o,s,u,d;null!=(t=e._w).GG||null!=t.W||null!=t.E?(a=1,o=4,n=Yn(t.GG,e._a[Ve],St(Zn(),1,4).year),r=Yn(t.W,1),((i=Yn(t.E,1))<1||i>7)&&(u=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,d=St(Zn(),a,o),n=Yn(t.gg,e._a[Ve],d.year),r=Yn(t.w,d.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+a,(t.e<0||t.e>6)&&(u=!0)):i=a),r<1||r>Ot(n,a,o)?y(e)._overflowWeeks=!0:null!=u?y(e)._overflowWeekday=!0:(s=_t(n,r,i,a,o),e._a[Ve]=s.year,e._dayOfYear=s.dayOfYear)}function Un(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],y(e).empty=!0;var t,n,i,a,o,s,u=""+e._i,d=u.length,c=0;for(i=H(e._f,e._locale).match(Y)||[],t=0;t0&&y(e).unusedInput.push(o),u=u.slice(u.indexOf(n)+n.length),c+=n.length),F[a]?(n?y(e).empty=!1:y(e).unusedTokens.push(a),Ge(a,n,e)):e._strict&&!n&&y(e).unusedTokens.push(a);y(e).charsLeftOver=d-c,u.length>0&&y(e).unusedInput.push(u),e._a[Qe]<=12&&!0===y(e).bigHour&&e._a[Qe]>0&&(y(e).bigHour=void 0),y(e).parsedDateParts=e._a.slice(0),y(e).meridiem=e._meridiem,e._a[Qe]=Gn(e._locale,e._a[Qe],e._meridiem),null!==(s=y(e).era)&&(e._a[Ve]=e._locale.erasConvertYear(s,e._a[Ve])),jn(e),Dn(e)}else xn(e);else En(e)}function Gn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function qn(e){var t,n,r,i,a,o,s=!1;if(0===e._f.length)return y(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:v()}));function Kn(e,t){var n,r;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return Zn();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _r(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e,t={};return _(t,this),(t=Wn(t))._a?(e=t._isUTC?p(t._a):Zn(t._a),this._isDSTShifted=this.isValid()&&ur(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Sr(){return!!this.isValid()&&!this._isUTC}function Or(){return!!this.isValid()&&this._isUTC}function br(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Tr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Cr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function kr(e,t){var n,r,i,a=e,o=null;return or(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(o=Tr.exec(e))?(n="-"===o[1]?-1:1,a={y:0,d:ce(o[We])*n,h:ce(o[Qe])*n,m:ce(o[Be])*n,s:ce(o[Ze])*n,ms:ce(sr(1e3*o[Je]))*n}):(o=Cr.exec(e))?(n="-"===o[1]?-1:1,a={y:Er(o[2],n),M:Er(o[3],n),w:Er(o[4],n),d:Er(o[5],n),h:Er(o[6],n),m:Er(o[7],n),s:Er(o[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=Ir(Zn(a.from),Zn(a.to)),(a={}).ms=i.milliseconds,a.M=i.months),r=new ar(a),or(e)&&s(e,"_locale")&&(r._locale=e._locale),or(e)&&s(e,"_isValid")&&(r._isValid=e._isValid),r}function Er(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Pr(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Ir(e,t){var n;return e.isValid()&&t.isValid()?(t=fr(t,e),e.isBefore(t)?n=Pr(e,t):((n=Pr(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Nr(e,t){return function(n,r){var i;return null===r||isNaN(+r)||(E(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),Mr(this,kr(n,r),e),this}}function Mr(e,t,n,i){var a=t._milliseconds,o=sr(t._days),s=sr(t._months);e.isValid()&&(i=null==i||i,s&&dt(e,fe(e,"Month")+s*n),o&&he(e,"Date",fe(e,"Date")+o*n),a&&e._d.setTime(e._d.valueOf()+a*n),i&&r.updateOffset(e,o||s))}kr.fn=ar.prototype,kr.invalid=ir;var Ar=Nr(1,"add"),xr=Nr(-1,"subtract");function Rr(e){return"string"==typeof e||e instanceof String}function Yr(e){return O(e)||l(e)||Rr(e)||c(e)||jr(e)||Lr(e)||null==e}function Lr(e){var t,n,r=o(e)&&!u(e),i=!1,a=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;tn.valueOf():n.valueOf()9999?V(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):P(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(n,"Z")):V(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function $r(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,i="moment",a="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=a+'[")]',this.format(e+t+n+r)}function ei(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=V(this,e);return this.localeData().postformat(t)}function ti(e,t){return this.isValid()&&(O(e)&&e.isValid()||Zn(e).isValid())?kr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ni(e){return this.from(Zn(),e)}function ri(e,t){return this.isValid()&&(O(e)&&e.isValid()||Zn(e).isValid())?kr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ii(e){return this.to(Zn(),e)}function ai(e){var t;return void 0===e?this._locale._abbr:(null!=(t=gn(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var oi=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function si(){return this._locale}var ui=1e3,di=60*ui,ci=60*di,li=3506328*ci;function fi(e,t){return(e%t+t)%t}function hi(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-li:new Date(e,t,n).valueOf()}function pi(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-li:Date.UTC(e,t,n)}function mi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?pi:hi,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fi(t+(this._isUTC?0:this.utcOffset()*di),ci);break;case"minute":t=this._d.valueOf(),t-=fi(t,di);break;case"second":t=this._d.valueOf(),t-=fi(t,ui)}return this._d.setTime(t),r.updateOffset(this,!0),this}function yi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?pi:hi,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ci-fi(t+(this._isUTC?0:this.utcOffset()*di),ci)-1;break;case"minute":t=this._d.valueOf(),t+=di-fi(t,di)-1;break;case"second":t=this._d.valueOf(),t+=ui-fi(t,ui)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function gi(){return this._d.valueOf()-6e4*(this._offset||0)}function vi(){return Math.floor(this.valueOf()/1e3)}function Di(){return new Date(this.valueOf())}function wi(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function _i(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Si(){return this.isValid()?this.toISOString():null}function Oi(){return g(this)}function bi(){return h({},y(this))}function Ti(){return y(this).overflow}function Ci(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function ki(e,t){var n,i,a,o=this._eras||gn("en")._eras;for(n=0,i=o.length;n=0)return u[r]}function Pi(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Ii(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e(a=Ot(e,r,i))&&(t=a),zi.call(this,e,t,n,r,i))}function zi(e,t,n,r,i){var a=_t(e,t,n,r,i),o=Dt(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function Ki(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}U("N",0,0,"eraAbbr"),U("NN",0,0,"eraAbbr"),U("NNN",0,0,"eraAbbr"),U("NNNN",0,0,"eraName"),U("NNNNN",0,0,"eraNarrow"),U("y",["y",1],"yo","eraYear"),U("y",["yy",2],0,"eraYear"),U("y",["yyy",3],0,"eraYear"),U("y",["yyyy",4],0,"eraYear"),xe("N",Li),xe("NN",Li),xe("NNN",Li),xe("NNNN",ji),xe("NNNNN",Fi),Fe(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?y(n).era=i:y(n).invalidEra=e})),xe("y",Ee),xe("yy",Ee),xe("yyy",Ee),xe("yyyy",Ee),xe("yo",Ui),Fe(["y","yy","yyy","yyyy"],Ve),Fe(["yo"],(function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ve]=n._locale.eraYearOrdinalParse(e,i):t[Ve]=parseInt(e,10)})),U(0,["gg",2],0,(function(){return this.weekYear()%100})),U(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),qi("gggg","weekYear"),qi("ggggg","weekYear"),qi("GGGG","isoWeekYear"),qi("GGGGG","isoWeekYear"),ne("weekYear","gg"),ne("isoWeekYear","GG"),oe("weekYear",1),oe("isoWeekYear",1),xe("G",Pe),xe("g",Pe),xe("GG",Se,ve),xe("gg",Se,ve),xe("GGGG",Ce,we),xe("gggg",Ce,we),xe("GGGGG",ke,_e),xe("ggggg",ke,_e),Ue(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=ce(e)})),Ue(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),U("Q",0,"Qo","quarter"),ne("quarter","Q"),oe("quarter",7),xe("Q",ge),Fe("Q",(function(e,t){t[He]=3*(ce(e)-1)})),U("D",["DD",2],"Do","date"),ne("date","D"),oe("date",9),xe("D",Se),xe("DD",Se,ve),xe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Fe(["D","DD"],We),Fe("Do",(function(e,t){t[We]=ce(e.match(Se)[0])}));var Xi=le("Date",!0);function $i(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}U("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),oe("dayOfYear",4),xe("DDD",Te),xe("DDDD",De),Fe(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=ce(e)})),U("m",["mm",2],0,"minute"),ne("minute","m"),oe("minute",14),xe("m",Se),xe("mm",Se,ve),Fe(["m","mm"],Be);var ea=le("Minutes",!1);U("s",["ss",2],0,"second"),ne("second","s"),oe("second",15),xe("s",Se),xe("ss",Se,ve),Fe(["s","ss"],Ze);var ta,na,ra=le("Seconds",!1);for(U("S",0,0,(function(){return~~(this.millisecond()/100)})),U(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),U(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),U(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),U(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),U(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),U(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),ne("millisecond","ms"),oe("millisecond",16),xe("S",Te,ge),xe("SS",Te,ve),xe("SSS",Te,De),ta="SSSS";ta.length<=9;ta+="S")xe(ta,Ee);function ia(e,t){t[Je]=ce(1e3*("0."+e))}for(ta="S";ta.length<=9;ta+="S")Fe(ta,ia);function aa(){return this._isUTC?"UTC":""}function oa(){return this._isUTC?"Coordinated Universal Time":""}na=le("Milliseconds",!1),U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var sa=S.prototype;function ua(e){return Zn(1e3*e)}function da(){return Zn.apply(null,arguments).parseZone()}function ca(e){return e}sa.add=Ar,sa.calendar=Gr,sa.clone=qr,sa.diff=Jr,sa.endOf=yi,sa.format=ei,sa.from=ti,sa.fromNow=ni,sa.to=ri,sa.toNow=ii,sa.get=pe,sa.invalidAt=Ti,sa.isAfter=Vr,sa.isBefore=Hr,sa.isBetween=Wr,sa.isSame=Qr,sa.isSameOrAfter=Br,sa.isSameOrBefore=Zr,sa.isValid=Oi,sa.lang=oi,sa.locale=ai,sa.localeData=si,sa.max=zn,sa.min=Jn,sa.parsingFlags=bi,sa.set=me,sa.startOf=mi,sa.subtract=xr,sa.toArray=wi,sa.toObject=_i,sa.toDate=Di,sa.toISOString=Xr,sa.inspect=$r,"undefined"!=typeof Symbol&&null!=Symbol.for&&(sa[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),sa.toJSON=Si,sa.toString=Kr,sa.unix=vi,sa.valueOf=gi,sa.creationData=Ci,sa.eraName=Ii,sa.eraNarrow=Ni,sa.eraAbbr=Mi,sa.eraYear=Ai,sa.year=yt,sa.isLeapYear=gt,sa.weekYear=Vi,sa.isoWeekYear=Hi,sa.quarter=sa.quarters=Ki,sa.month=ct,sa.daysInMonth=lt,sa.week=sa.weeks=Et,sa.isoWeek=sa.isoWeeks=Pt,sa.weeksInYear=Bi,sa.weeksInWeekYear=Zi,sa.isoWeeksInYear=Wi,sa.isoWeeksInISOWeekYear=Qi,sa.date=Xi,sa.day=sa.days=Ht,sa.weekday=Wt,sa.isoWeekday=Qt,sa.dayOfYear=$i,sa.hour=sa.hours=rn,sa.minute=sa.minutes=ea,sa.second=sa.seconds=ra,sa.millisecond=sa.milliseconds=na,sa.utcOffset=pr,sa.utc=yr,sa.local=gr,sa.parseZone=vr,sa.hasAlignedHourOffset=Dr,sa.isDST=wr,sa.isLocal=Sr,sa.isUtcOffset=Or,sa.isUtc=br,sa.isUTC=br,sa.zoneAbbr=aa,sa.zoneName=oa,sa.dates=T("dates accessor is deprecated. Use date instead.",Xi),sa.months=T("months accessor is deprecated. Use month instead",ct),sa.years=T("years accessor is deprecated. Use year instead",yt),sa.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mr),sa.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_r);var la=M.prototype;function fa(e,t,n,r){var i=gn(),a=p().set(r,t);return i[n](a,e)}function ha(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return fa(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=fa(e,r,n,"month");return i}function pa(e,t,n,r){"boolean"==typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var i,a=gn(),o=e?a._week.dow:0,s=[];if(null!=n)return fa(t,(n+o)%7,r,"day");for(i=0;i<7;i++)s[i]=fa(t,(i+o)%7,r,"day");return s}function ma(e,t){return ha(e,t,"months")}function ya(e,t){return ha(e,t,"monthsShort")}function ga(e,t,n){return pa(e,t,n,"weekdays")}function va(e,t,n){return pa(e,t,n,"weekdaysShort")}function Da(e,t,n){return pa(e,t,n,"weekdaysMin")}la.calendar=x,la.longDateFormat=Q,la.invalidDate=Z,la.ordinal=K,la.preparse=ca,la.postformat=ca,la.relativeTime=$,la.pastFuture=ee,la.set=I,la.eras=ki,la.erasParse=Ei,la.erasConvertYear=Pi,la.erasAbbrRegex=Ri,la.erasNameRegex=xi,la.erasNarrowRegex=Yi,la.months=at,la.monthsShort=ot,la.monthsParse=ut,la.monthsRegex=ht,la.monthsShortRegex=ft,la.week=bt,la.firstDayOfYear=kt,la.firstDayOfWeek=Ct,la.weekdays=Ft,la.weekdaysMin=Gt,la.weekdaysShort=Ut,la.weekdaysParse=Vt,la.weekdaysRegex=Bt,la.weekdaysShortRegex=Zt,la.weekdaysMinRegex=Jt,la.isPM=tn,la.meridiem=an,pn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===ce(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=T("moment.lang is deprecated. Use moment.locale instead.",pn),r.langData=T("moment.langData is deprecated. Use moment.localeData instead.",gn);var wa=Math.abs;function _a(){var e=this._data;return this._milliseconds=wa(this._milliseconds),this._days=wa(this._days),this._months=wa(this._months),e.milliseconds=wa(e.milliseconds),e.seconds=wa(e.seconds),e.minutes=wa(e.minutes),e.hours=wa(e.hours),e.months=wa(e.months),e.years=wa(e.years),this}function Sa(e,t,n,r){var i=kr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Oa(e,t){return Sa(this,e,t,1)}function ba(e,t){return Sa(this,e,t,-1)}function Ta(e){return e<0?Math.floor(e):Math.ceil(e)}function Ca(){var e,t,n,r,i,a=this._milliseconds,o=this._days,s=this._months,u=this._data;return a>=0&&o>=0&&s>=0||a<=0&&o<=0&&s<=0||(a+=864e5*Ta(Ea(s)+o),o=0,s=0),u.milliseconds=a%1e3,e=de(a/1e3),u.seconds=e%60,t=de(e/60),u.minutes=t%60,n=de(t/60),u.hours=n%24,o+=de(n/24),s+=i=de(ka(o)),o-=Ta(Ea(i)),r=de(s/12),s%=12,u.days=o,u.months=s,u.years=r,this}function ka(e){return 4800*e/146097}function Ea(e){return 146097*e/4800}function Pa(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+ka(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Ea(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function Ia(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ce(this._months/12):NaN}function Na(e){return function(){return this.as(e)}}var Ma=Na("ms"),Aa=Na("s"),xa=Na("m"),Ra=Na("h"),Ya=Na("d"),La=Na("w"),ja=Na("M"),Fa=Na("Q"),Ua=Na("y");function Ga(){return kr(this)}function qa(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function Va(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ha=Va("milliseconds"),Wa=Va("seconds"),Qa=Va("minutes"),Ba=Va("hours"),Za=Va("days"),Ja=Va("months"),za=Va("years");function Ka(){return de(this.days()/7)}var Xa=Math.round,$a={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function eo(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function to(e,t,n,r){var i=kr(e).abs(),a=Xa(i.as("s")),o=Xa(i.as("m")),s=Xa(i.as("h")),u=Xa(i.as("d")),d=Xa(i.as("M")),c=Xa(i.as("w")),l=Xa(i.as("y")),f=a<=n.ss&&["s",a]||a0,f[4]=r,eo.apply(null,f)}function no(e){return void 0===e?Xa:"function"==typeof e&&(Xa=e,!0)}function ro(e,t){return void 0!==$a[e]&&(void 0===t?$a[e]:($a[e]=t,"s"===e&&($a.ss=t-1),!0))}function io(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,a=$a;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(a=Object.assign({},$a,t),null!=t.s&&null==t.ss&&(a.ss=t.s-1)),r=to(this,!i,a,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var ao=Math.abs;function oo(e){return(e>0)-(e<0)||+e}function so(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,a,o,s,u=ao(this._milliseconds)/1e3,d=ao(this._days),c=ao(this._months),l=this.asSeconds();return l?(e=de(u/60),t=de(e/60),u%=60,e%=60,n=de(c/12),c%=12,r=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=l<0?"-":"",a=oo(this._months)!==oo(l)?"-":"",o=oo(this._days)!==oo(l)?"-":"",s=oo(this._milliseconds)!==oo(l)?"-":"",i+"P"+(n?a+n+"Y":"")+(c?a+c+"M":"")+(d?o+d+"D":"")+(t||e||u?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(u?s+r+"S":"")):"P0D"}var uo=ar.prototype;return uo.isValid=rr,uo.abs=_a,uo.add=Oa,uo.subtract=ba,uo.as=Pa,uo.asMilliseconds=Ma,uo.asSeconds=Aa,uo.asMinutes=xa,uo.asHours=Ra,uo.asDays=Ya,uo.asWeeks=La,uo.asMonths=ja,uo.asQuarters=Fa,uo.asYears=Ua,uo.valueOf=Ia,uo._bubble=Ca,uo.clone=Ga,uo.get=qa,uo.milliseconds=Ha,uo.seconds=Wa,uo.minutes=Qa,uo.hours=Ba,uo.days=Za,uo.weeks=Ka,uo.months=Ja,uo.years=za,uo.humanize=io,uo.toISOString=so,uo.toString=so,uo.toJSON=so,uo.locale=ai,uo.localeData=si,uo.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",so),uo.lang=oi,U("X",0,0,"unix"),U("x",0,0,"valueOf"),xe("x",Pe),xe("X",Me),Fe("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),Fe("x",(function(e,t,n){n._d=new Date(ce(e))})),r.version="2.29.1",i(Zn),r.fn=sa,r.min=Xn,r.max=$n,r.now=er,r.utc=p,r.unix=ua,r.months=ma,r.isDate=l,r.locale=pn,r.invalid=v,r.duration=kr,r.isMoment=O,r.weekdays=ga,r.parseZone=da,r.localeData=gn,r.isDuration=or,r.monthsShort=ya,r.weekdaysMin=Da,r.defineLocale=mn,r.updateLocale=yn,r.locales=vn,r.weekdaysShort=va,r.normalizeUnits=re,r.relativeTimeRounding=no,r.relativeTimeThreshold=ro,r.calendarFormat=Ur,r.prototype=sa,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()},6785:function(e,t){"use strict";t.Z=void 0;var n=function(e,t){void 0===t&&(t="start");var n=document.querySelector(e);return!!n&&(n.scrollIntoView({behavior:"smooth",block:t}),!0)};t.Z=n},3259:function(e,t,n){"use strict";n.d(t,{$6:function(){return we},$g:function(){return g},A5:function(){return G},CK:function(){return Se},DB:function(){return V},DG:function(){return W},E4:function(){return h},EF:function(){return Pe},Ei:function(){return ke},Ex:function(){return Z},G2:function(){return O},GQ:function(){return ee},GR:function(){return Ie},I0:function(){return F},I1:function(){return M},IT:function(){return I},KN:function(){return _e},KP:function(){return N},Kr:function(){return q},LY:function(){return Me},Lp:function(){return ve},MF:function(){return w},OQ:function(){return K},PA:function(){return y},PN:function(){return le},Pb:function(){return j},Qk:function(){return Ee},S8:function(){return P},SG:function(){return ae},TD:function(){return de},TO:function(){return U},T_:function(){return be},U2:function(){return De},UJ:function(){return d},Vu:function(){return me},WC:function(){return $},XK:function(){return z},XU:function(){return A},Xu:function(){return s},Zo:function(){return J},_5:function(){return S},_r:function(){return H},a:function(){return m},aG:function(){return k},aT:function(){return x},aV:function(){return Oe},bb:function(){return ye},cA:function(){return r},dK:function(){return ne},dj:function(){return _},ez:function(){return oe},fx:function(){return L},gM:function(){return te},gQ:function(){return he},h0:function(){return E},hy:function(){return ge},i8:function(){return T},in:function(){return b},jc:function(){return ue},jp:function(){return i},kP:function(){return c},kr:function(){return Q},ky:function(){return se},lU:function(){return p},m:function(){return a},mk:function(){return R},mo:function(){return v},nN:function(){return u},ng:function(){return ce},oi:function(){return ie},qB:function(){return f},qX:function(){return C},rA:function(){return l},rN:function(){return o},rS:function(){return Te},sd:function(){return Y},ss:function(){return X},t7:function(){return fe},tA:function(){return Ce},w3:function(){return Ne},xW:function(){return B},y3:function(){return D},yg:function(){return pe},yt:function(){return re}});var r="GET_PRODUCTS_BEGIN",i="GET_PRODUCTS_SUCCESS",a="GET_PRODUCTS_ERROR",o="UPDATE_FILTERS",s="INCREASE_STEP",u="DECREASE_STEP",d="SHOW_MANUAL_ADDRESS",c="RESET_CUSTOMER_DATA",l="UPDATE_CUSTOMER_FROM_URL",f="SET_STEP",h="ACCOUNT_NUMBER_VALID",p="SORT_CODE_ERROR",m="SET_QUESTIONS_CHECKED",y="UPDATE_PREMIUM_FUNDING_DETAILS",g="SORT_CODE_VALID",v="SEARCH",D="SEARCH_REGNO_IN_PROGRESS",w="DELETE_STRIPE_CLIENT_SECRET",_="INCREASE_CHECKED_QUESTIONS",S="DECREASE_CHECKED_QUESTIONS",O="ADD_TO_CART",b="REMOVE_CART_ITEM",T="ADD_PRODUCT_SIDEBAR",C="CLEAR_CART",k="GET_QUOTE_ID",E="FILTER_PRODUCT_SUCCESS",P="GET_PURCHASE_DATE",I="GET_REGISTRATION_DATE",N="GET_QUESTIONS_SUCCESS",M="GET_QUESTIONS_BEGIN",A="COMPLETE_ORDER_BEGIN",x="GET_PURCHASE_CODE",R="SET_FETCHED_VEHICLE_DETAILS",Y="CHANGE_SELECTED_PRODUCTS_DATE",L="SET_TYPE_OF_PAYMENT",j="SET_BIRTHDAY",F="DELETE_EXISTING_STRIPE_DATA",U="CHECK_QUESTION",G="UNCHECK_ALL_QUESTIONS",q="SEARCH_POSTCODE_IN_PROGRESS",V="SET_ADDRESS_DETAILS",H="UPDATE_ADDRESS",W="UPDATE_PERSONAL_FUNDING_DETAILS",Q="UPDATE_HIRE_AND_REWARD_QUESTIONS",B="CHECK_BANK_DETAILS",Z="START_CHECK_VALIDATION",J="SET_PAYMENT_DAY",z="FAILED_BANK_VALIDATION_REQUEST",K="SET_FIN_IDD_RESULT",X="SET_FIN_COMPLAINTS",$="SET_FIN_CANCELLATION",ee="SET_FEEDBACK_QUESTIONS",te="SET_DISCOUNT_CODE",ne="QUOTE_DETAILS_ERROR",re="SET_DATE",ie="INCREASE_WEDDING_STEP",ae="DECREASE_WEDDING_STEP",oe="FIN_IDD_ERROR",se="GET_WEDDING_PRODUCTS",ue="GET_WEDDING_PRODUCTS_LOADING",de="GET_WEDDING_PRODUCTS_ERROR",ce="UPDATE_ADDITIONAL_OPTIONS",le="UPDATE_PERSONAL_DETAILS",fe="UPDATE_EVENT_DETAILS",he="UPDATE_CART",pe="UPDATE_PROGRESS_BAR_INDEX",me="RETURN_TO_PRODUCTS",ye="SET_QUERY_PARAMS",ge="START_GET_QUOTE_DETAILS_LOADING",ve="SET_QUOTE_DETAILS",De="UPDATE_INIT_VALUES",we="UPDATE_REDIRECT_FLAG",_e="GET_PRODUCTS_FROM_SESSION",Se="UPDATE_STEP",Oe="COMPLETE_QUOTE_ERROR",be="SET_INIT_BASKET_QUERY_PARAMS",Te="INIT_BASKET_REDIRECT",Ce="CHANGE_STEP_VALUE",ke="SEARCH_REGNO_ERROR",Ee="DESELECT_PRODUCT",Pe="UPDATE_IDS_ARRAY",Ie="UPDATE_QUOTE_ID",Ne="UPDATE_REGISTRATION_DATE",Me="SET_TOTAL_COST"},9335:function(e,t,n){"use strict";n.d(t,{B:function(){return ne},D:function(){return re}});var r,i,a,o,s,u,d,c,l,f,h,p,m,y,g,v,D,w,_,S,O,b,T,C,k,E,P,I,N,M,A,x=n(5861),R=n(7757),Y=n.n(R),L=n(7294),j=n(3259),F=n(3433),U=n(4517),G=n(1789),q=n(3964),V=n.n(q),H=function(e,t){if(t.type===j.rN){var n,r=t.payload,i=r.value,a=r.name;return Object.assign({},e,{customerData:Object.assign({},e.customerData,(n={},n[a]=i,n))})}if(t.type===j.kr){var o,s=t.payload,u=s.checked,d=s.name;return Object.assign({},e,{hireRewardQuestions:Object.assign({},e.hireRewardQuestions,(o={},o[d]=u,o))})}if(t.type===j.cA)return Object.assign({},e,{loading:!0});if(t.type===j.REINITIALIZE_PRODUCTS)return Object.assign({},e,{products:[],quoteId:0,groupedByOriginProducts:[]});if(t.type===j.jp){var c=t.payload,l=c.products,f=c.quoteId,h=l?l.filter((function(e){return-1!==G.arrayOfOrigins.indexOf(e.Origin)})):[];return Object.assign({},e,{removeUnknownOrigin:h,quoteId:f,loading:!1,quoteError:!1,products:l,groupedByOriginProducts:(0,U.oc)(h)})}if(t.type===j.kP)return Object.assign({},e,{customerData:{mileage:"",vehicleValue:"",vehicleMake:"",vehicleModel:"",engineCC:"",regNo:"",categoryType:"Car",registrationDate:new Date,dateOfPurchase:new Date,firstname:"",lastname:"",email:"",address:"",mobile:"",tyresType:"",postcode:"",town:"",addressList:null}});if(t.type===j.m)return Object.assign({},e,{loading:!1,quoteError:!0});if(t.type===j.dj)return Object.assign({},e,{questionChecked:e.questionChecked+1});if(t.type===j._5)return Object.assign({},e,{questionChecked:0});if(t.type===j.a)return Object.assign({},e,{questionChecked:t.payload});if(t.type===j.mk){var p=t.payload,m=p.VehicleMake,y=p.VehicleModel,g=p.TyreSizeType,v=p.EngineCC,D=p.VehicleTypeName,w=p.dateSubstring,_=p.DriveAxle;return Object.assign({},e,{customerData:Object.assign({},e.customerData,{vehicleMake:m,vehicleModel:y,DriveTrain:_,categoryType:D,tyresType:g,engineCC:v||"0",registrationDate:new Date(w)}),error:!1,displayEngineAndDateFlag:!v||!w,displaySidebar:!0})}if(t.type===j.Ei)return Object.assign({},e,{error:!0,loading:!1});if(t.type===j.y3)return Object.assign({},e,{searchRegNoInProgress:t.payload});if(t.type===j.rA){var S=t.payload,O=S.regNo,b=S.mileage,T=S.vehicleValue,C=S.email,k="true"===S.hireRewardParam,E="true"===S.emailReceiving;return Object.assign({},e,{customerData:Object.assign({},e.customerData,{vehicleValue:T,mileage:b,regNo:O,email:C}),hireRewardQuestions:Object.assign({},e.hireRewardQuestions,{firstQuestion:k,emailReceiving:E})})}if(t.type===j.Ex)return Object.assign({},e,{directDebitLoading:!0});if(t.type===j.XK)return Object.assign({},e,{directDebitLoading:!1,directDebitError:!0});if(t.type===j.OQ)return Object.assign({},e,{finIDDfetchResult:t.payload});if(t.type===j.ss)return Object.assign({},e,{finComplaints:t.payload});if(t.type===j.Kr)return Object.assign({},e,{showManualAddress:t.payload});if(t.type===j.WC)return Object.assign({},e,{finCancellation:t.payload});if(t.type===j.Zo){var P=new Date;if(t.payload&&t.payload.target&&t.payload.target.value&&Number.isInteger(Number(t.payload.target.value))){var I=new Date;return P=new Date(I.getFullYear(),I.getMonth(),t.payload.target.value),Object.assign({},e,{directDebitDetails:Object.assign({},e.directDebitDetails,{preferredPaymentDateUnformatted:t.payload.target.value,preferredPaymentDate:V()(P).format("DD/MM/YYYY")})})}return Object.assign({},e,{directDebitDetails:Object.assign({},e.directDebitDetails,{preferredPaymentDateUnformatted:t.payload,preferredPaymentDate:V()(t.payload).format("DD/MM/YYYY")})})}if(t.type===j.Pb)return Object.assign({},e,{dateOfBirthUnformatted:t.payload,dateOfBirth:V()(t.payload).format("DD/MM/YYYY")});if(t.type===j.xW){var N=t.payload,M=N.code,A=N.result;return Object.assign({},e,{directDebitDetails:Object.assign({},e.directDebitDetails,{bankName:A.Bank,bankPostcode:A.ContactPostcode,bankAddress1:A.ContactAddressLine1,bankAddress2:A.ContactAddressLine2,bankTown:A.ContactPostTown?A.ContactPostTown:"-"}),directDebitLoading:!1,bankValidationCode:M})}if(t.type===j.G2){var x=t.payload.product;if(x){var R,Y,L,q=null===(R=e.cart)||void 0===R?void 0:R.find((function(e){return e.Origin===x.Origin})),H=null===(Y=e.cart)||void 0===Y?void 0:Y.find((function(e){return"Return to Invoice"===e.Origin})),W=null===(L=e.cart)||void 0===L?void 0:L.find((function(e){return"Finance Gap"===e.Origin}));if(q){var Q=e.cart.map((function(t){if(t.Origin===x.Origin){var n,r=e.cart.findIndex((function(e){return e.Origin===t.Origin}));return-1!==r&&(n=e.cart[r]=x),Object.assign({},n)}return t}));return Object.assign({},e,{cart:Q})}if("Return to Invoice"===x.Origin&&W){var B=e.cart.findIndex((function(e){return"Finance Gap"===e.Origin}));return-1!==B&&(e.cart[B]=x),Object.assign({},e)}if("Finance Gap"===x.Origin&&H){var Z=e.cart.findIndex((function(e){return"Return to Invoice"===e.Origin}));return-1!==Z&&(e.cart[Z]=x),Object.assign({},e)}var J,z=((J={Description:x.Description,Discount:x.Discount,KeyFacts:x.KeyFacts,Origin:x.Origin,PPPId:x.PPPId,Price:x.Price,PriceRRP:x.PriceRRP,ProducGroupId:x.ProducGroupId,ProducGroupTitle:x.ProducGroupTitle,Title:x.Title,claim_limit:x.claim_limit,months_of_cover:x.months_of_cover,TC:x.TC}).KeyFacts=x.KeyFacts,J.MonthlyPrice=x.MonthlyPrice,J.Instalments=x.Instalments,J);return Object.assign({},e,{cart:[].concat((0,F.Z)(e.cart),[z])})}return Object.assign({},e,{purchaseError:!0})}if(t.type===j.Qk){var K=e.cart.filter((function(e){return e.Origin!==t.payload}));return Object.assign({},e,{cart:K})}if(t.type===j.EF){var X,$,ee,te=null===(X=e.cart)||void 0===X?void 0:X.map((function(e){return e.PPPId})),ne=null===($=e.cart)||void 0===$?void 0:$.map((function(e){return{Title:e.Title,PPPId:e.PPPId,StartDate:new Date,Origin:e.Origin,Price:e.Price,months_of_cover:e.months_of_cover,claim_limit:e.claim_limit,TC:e.TC,KeyFacts:e.KeyFacts}})),re=null==ne?void 0:ne.map((function(e){return{PPPId:e.PPPId,StartDate:V()(e.StartDate).format("DD/MM/YYYY")}})),ie=0;return null===(ee=e.cart)||void 0===ee||ee.map((function(e){return ie+=e.Price})),Object.assign({},e,{ids:te,selectedProductsUnformattedDate:ne,totalCost:ie,selectedProducts:re,discountCode:null,premiumFundingDetails:{}})}if(t.type===j.sd){var ae=t.payload,oe=ae.date,se=ae.id,ue=e.selectedProductsUnformattedDate,de=ue.findIndex((function(e){return e.PPPId===se}));ue[de].StartDate=oe;var ce=ue.map((function(e){var t=e.StartDate;return{PPPId:e.PPPId,StartDate:V()(t).format("DD/MM/YYYY")}}));return Object.assign({},e,{selectedProductsUnformattedDate:(0,F.Z)(e.selectedProductsUnformattedDate),selectedProducts:ce})}if(t.type===j.in){var le=e.cart.filter((function(e){return e.PPPId!==t.payload}));return Object.assign({},e,{cart:le})}if(t.type===j.Xu)return Object.assign({},e,{checkoutStep:e.checkoutStep+1});if(t.type===j.nN)return Object.assign({},e,{checkoutStep:0===e.checkoutStep?0:e.checkoutStep-1});if(t.type===j.Kr)return Object.assign({},e,{searchPostcodeInProgress:t.payload});if(t.type===j.DB){var fe=[],he=t.payload.address;return he&&(fe=he),Object.assign({},e,{customerData:Object.assign({},e.customerData,{addressList:fe})})}if(t.type===j.GR)return Object.assign({},e,{quoteId:t.payload});if(t.type===j.I1)return Object.assign({},e,{isQuestionsLoading:!0});if(t.type===j.KP){var pe=t.payload,me=pe.removeInvert,ye=pe.premiumFundingDetails,ge=pe.co2Emission;return Object.assign({},e,{questions:me,premiumFundingDetails:ye,co2Emission:ge,isQuestionsLoading:!1,checkedList:0!==e.cart.length?me.map((function(e){return Object.assign({},e,{checked:!1})})):[]})}if(t.type===j.TO)return Object.assign({},e,{checkedList:t.payload});if(t.type===j._r){var ve=t.payload,De=ve.value,we=ve.town,_e=(ve.address,ve.postcode);return Object.assign({},e,{customerData:Object.assign({},e.customerData,{town:we,postcode:_e,address:De})})}if(t.type===j.fx)return Object.assign({},e,{typeOfPayment:t.payload,selectTypeOfPaymentFlag:!0});if(t.type===j.qX)return Object.assign({},e,{cart:[],ids:[],questions:[]});if(t.type===j.DG){var Se,Oe=t.payload,be=Oe.value,Te=Oe.name;return Object.assign({},e,{directDebitDetails:Object.assign({},e.directDebitDetails,(Se={},Se[Te]=be,Se))})}if(t.type===j.tA)return Object.assign({},e,{checkoutStep:t.payload});if(t.type===j.i8){var Ce=t.payload.productOrigin;return Object.assign({},e,{addProduct:Ce})}if(t.type===j.rS){var ke,Ee,Pe;"undefined"!=typeof window&&window.sessionStorage.getItem("premiumFundingDetailsInitBasket")&&(Ee=JSON.parse(sessionStorage.getItem("premiumFundingDetailsInitBasket")));var Ie=Ee.questions.filter((function(e){return!e.Invert}));return"undefined"!=typeof window&&window.sessionStorage.getItem("quoteDetailsVehicle")&&(Pe=JSON.parse(sessionStorage.getItem("quoteDetailsVehicle"))),Object.assign({},e,{questions:Ie,quoteId:Ee.quoteId,fetchPremiumFundingDetails:Ee.premiumFundingDetails,co2Emissions:Ee.co2Emission,isQuestionsLoading:!1,checkedList:Ie.map((function(e){return Object.assign({},e,{checked:!1})})),cart:null===(ke=Pe)||void 0===ke?void 0:ke.products})}if(t.type===j.A5)return Object.assign({},e,{checkedList:0!==e.cart.length?e.questions.map((function(e){return Object.assign({},e,{checked:!1})})):[]});if(t.type===j.I0)return Object.assign({},e,{stripeTokenId:"",stripeStatusCode:"",datePickerFlag:!1});if(t.type===j.S8)return Object.assign({},e,{customerData:Object.assign({},e.customerData,{dateOfPurchase:t.payload})});if(t.type===j.XU)return Object.assign({},e,{purchaseLoading:!0});if(t.type===j.aT){var Ne=t.payload,Me=Ne.purchaseCode,Ae=Ne.code,xe=Ne.stripeClientSecret;return Object.assign({},e,{purchaseCode:Me,stripeStatusCode:Ae,stripeClientSecret:xe,datePickerFlag:!0,purchaseLoading:!1})}if(t.type===j.MF)return Object.assign({},e,{stripeClientSecret:void 0});if(t.type===j.w3)return Object.assign({},e,{customerData:Object.assign({},e.customerData,{registrationDate:t.payload})});if(t.type===j.GQ)return Object.assign({},e,{feedbackQuestions:t.payload});if(t.type===j.gM)return Object.assign({},e,{discountCode:t.payload});if(t.type===j.LY)return Object.assign({},e,{totalCost:t.payload});throw new Error('No Matching "'+t.type+'" - action type')},W=n(5444),Q=L.createContext(),B={},Z={},J={},z=[],K=[],X={},$=[],ee={};"undefined"!=typeof window&&window.sessionStorage.getItem("quoteDetailsVehicle")&&(J=JSON.parse(sessionStorage.getItem("quoteDetailsVehicle")),sessionStorage.removeItem("formData")),"undefined"!=typeof window&&window.sessionStorage.getItem("formData")&&(B=JSON.parse(sessionStorage.getItem("formData"))),"undefined"!=typeof window&&window.sessionStorage.getItem("hireRewardQuestions")&&(Z=JSON.parse(sessionStorage.getItem("hireRewardQuestions"))),"undefined"!=typeof window&&window.sessionStorage.getItem("groupedByOriginProducts")&&(M=JSON.parse(sessionStorage.getItem("groupedByOriginProducts"))),"undefined"!=typeof window&&window.sessionStorage.getItem("premiumFundingDetails")&&(X=JSON.parse(sessionStorage.getItem("premiumFundingDetails"))),"undefined"!=typeof window&&window.sessionStorage.getItem("products")&&(z=JSON.parse(sessionStorage.getItem("products"))),"undefined"!=typeof window&&window.sessionStorage.getItem("questions")&&($=JSON.parse(sessionStorage.getItem("questions"))),"undefined"!=typeof window&&window.sessionStorage.getItem("checkoutStep")&&(A=JSON.parse(sessionStorage.getItem("checkoutStep"))),"undefined"!=typeof window&&window.sessionStorage.getItem("initBasketHireRewards")&&(ee=JSON.parse(sessionStorage.getItem("initBasketHireRewards"))),"undefined"!=typeof window&&window.sessionStorage.getItem("cart")&&(K=JSON.parse(sessionStorage.getItem("cart")));var te={customerData:{mileage:null!==(r=B)&&void 0!==r&&r.mileage?null===(i=B)||void 0===i?void 0:i.mileage:J.Mileage?J.Mileage:"",vehicleValue:null!==(a=B)&&void 0!==a&&a.vehicleValue?B.vehicleValue:J.Price?J.Price:"",vehicleMake:null!==(o=B)&&void 0!==o&&o.vehicleMake?B.vehicleMake:J.VehicleMake?J.VehicleMake:"",vehicleModel:null!==(s=B)&&void 0!==s&&s.vehicleModel?B.vehicleModel:J.VehicleModel?J.VehicleModel:"",DriveTrain:null!==(u=B)&&void 0!==u&&u.DriveTrain?B.DriveTrain:J.DriveTrain?J.DriveTrain:"",engineCC:null!==(d=B)&&void 0!==d&&d.engineCC?B.engineCC:J.EngineCC?J.EngineCC:"",regNo:null!==(c=B)&&void 0!==c&&c.regNo?null===(l=B)||void 0===l?void 0:l.regNo:J.RegNo?J.RegNo:"",categoryType:null!==(f=B)&&void 0!==f&&f.categoryType?null===(h=B)||void 0===h?void 0:h.categoryType:"Car",registrationDate:null!==(p=B)&&void 0!==p&&p.registrationDate?new Date(B.registrationDate):null!==(m=J)&&void 0!==m&&m.RegistrationDate?new Date(Number(null===(y=J)||void 0===y?void 0:y.RegistrationDate.substring(6,(null===(g=J)||void 0===g?void 0:g.RegistrationDate.length)-2))):new Date,dateOfPurchase:new Date,firstname:null!==(v=B)&&void 0!==v&&v.firstname?B.firstname:J.FirstName?J.FirstName:"",lastname:null!==(D=B)&&void 0!==D&&D.lastname?B.lastname:J.Surname?J.Surname:"",email:null!==(w=B)&&void 0!==w&&w.email?B.email:J.Email?J.Email:"",address:null!==(_=B)&&void 0!==_&&_.address?B.address:J.Address1?J.Address1:"",mobile:null!==(S=B)&&void 0!==S&&S.mobile?B.mobile:J.Mobile?J.Mobile:"",tyresType:null!==(O=B)&&void 0!==O&&O.tyresType?B.tyresType:J.TyreSizeType?J.TyreSizeType:"",postcode:null!==(b=B)&&void 0!==b&&b.postcode?B.postcode:J.Postcode?J.Postcode:"",town:null!==(T=B)&&void 0!==T&&T.town?B.town:J.Town?J.Town:"-",addressList:null},addProduct:"",searchPostcodeInProgress:"",hireRewardQuestions:{firstQuestion:0!==Object.keys(ee).length?ee.firstQuestion:0!==Object.keys(Z).length&&Z.firstQuestion,secondQuestion:0!==Object.keys(ee).length?ee.secondQuestion:0!==Object.keys(Z).length&&Z.secondQuestion,thirdQuestion:0!==Object.keys(ee).length?ee.thirdQuestion:0===Object.keys(Z).length||Z.thirdQuestion,emailReceiving:0!==Object.keys(Z).length&&Z.emailReceiving},directDebitDetails:{firstname:"",surname:"",sortCode:"",accountNo:"",bankName:"-",bankPostcode:"-",bankAddress1:"-",bankAddress2:"-",bankTown:"-",preferredPaymentDateUnformatted:"",preferredPaymentDate:null},showManualAddress:!0,dateOfBirthUnformatted:null,directDebitLoading:!1,directDebitError:!1,bankValidationCode:"",products:z?z.products:[],groupedByOriginProducts:M||[],quoteId:z?z.quoteId:"",OrganisationLogo:"",OrganisationName:"",loading:!1,fetchProductsSuccess:!1,error:!1,searchRegNoInProgress:!1,displaySidebar:!1,displayEngineAndDateFlag:!1,cart:K||(null!==(C=J)&&void 0!==C&&C.products?null===(k=J)||void 0===k?void 0:k.products:[]),voucherCode:null!==(E=J)&&void 0!==E&&E.voucherCode?null===(P=J)||void 0===P?void 0:P.voucherCode:"",Referral:null!==(I=J)&&void 0!==I&&I.Referral?null===(N=J)||void 0===N?void 0:N.Referral:"",ids:[],purchaseError:"",selectedProductsUnformattedDate:K||[],selectedProducts:K||[],totalCost:0,quoteError:!1,checkoutStep:A||0,isQuestionsLoading:!1,questions:$||[],checkedList:$||[],premiumFundingDetails:X||{},co2Emission:"",typeOfPayment:"fullPayment",selectTypeOfPaymentFlag:"ShowPaymentTypeSelector"in X&&X.ShowPaymentTypeSelector,purchaseCode:"",co2Option:!1,stripeStatusCode:"",stripeClientSecret:"",stripeTokenId:"",datePickerFlag:!1,purchaseLoading:!1,questionChecked:0,finIDDfetchResult:"",finComplaints:"",finCancellation:"",discountCode:""},ne=function(e){var t=e.children,n=(0,L.useReducer)(H,te),r=n[0],i=n[1],a=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,a,o,s,u,d,c,l,f,h,p;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i({type:j.cA}),t=r.customerData.regNo,n=r.customerData.vehicleValue,a=r.customerData.mileage,(o=new Headers).append("Cookie","ASP.NET_SessionId=5tnbx0wsv0qzqaf4akfajpps"),(s=new FormData).append("data","{\n'IgnoreFilters':'false',\n'ProviderId':'10092500'\n ,\n'RegNo':'"+t+"',\n'Mileage': '"+a+"',\n'Price': '"+n+"'\n ,\n'FirstName': 'Test',\n'Surname': 'Surname'\n ,\n'Address1': 'test 1234',\n'Email': 'test333@phaeria.com'\n}"),u={method:"POST",headers:o,body:s,redirect:"follow"},e.next=11,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/GetQuote",u);case 11:return d=e.sent,e.next=14,d.json();case 14:c=e.sent,l=c.products,f=c.quoteId,h=c.code,p=c.status,"undefined"!=typeof window&&sessionStorage.setItem("products",JSON.stringify({products:r.products,quoteId:r.quoteId})),i(h&&"Success"===h||p&&!h&"Success"===p?{type:j.jp,payload:{products:l,quoteId:f}}:{type:j.m});case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),o=function(){var e=(0,x.Z)(Y().mark((function e(){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i({type:j.qX});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=0,u="",d=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,a,o,d,c,l,f,h,p,m;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i({type:j.cA}),i({type:j.REINITIALIZE_PRODUCTS}),(t=new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),n=new FormData,!(++s>1)){e.next=8;break}return e.abrupt("return");case 8:if(""!=r.customerData.regNo&&""!=r.customerData.vehicleMake&&""!=r.customerData.vehicleModel&&""!=r.customerData.mileage&&""!=r.customerData.vehicleValue){e.next=11;break}return i({type:j.m}),e.abrupt("return","");case 11:return u=""!==r.customerData.DriveTrain?',"EligibilityCar":{"DriveTrain":"'+r.customerData.DriveTrain+'"}':"",r.voucherCode?n.append("data","{\n'IgnoreFilters':'false',\n'VoucherCode':'"+r.voucherCode+"',\n'Referral':'"+r.Referral+"'\n ,\n'RegNo':'"+r.customerData.regNo.toUpperCase()+"',\n'Mileage':'"+r.customerData.mileage+"',\n'Price':'"+r.customerData.vehicleValue+"'\n ,\n'FirstName':'"+(r.customerData.firstname?r.customerData.firstname.replace(/'/g,"\\'"):"-")+"',\n'Surname':'"+(r.customerData.lastname?r.customerData.lastname.replace(/'/g,"\\'"):"-")+"'\n ,\n'Address1':'"+r.customerData.address.replace(/'/g,"\\'")+"',\n'Email':'"+(r.customerData.email?r.customerData.email:"TestEmail")+"'\n ,\n'VehicleMake':'"+r.customerData.vehicleMake+"',\n'VehicleModel':'"+r.customerData.vehicleModel+"'\n ,\n'TyreSizeType':'"+r.customerData.tyresType+"',\n'EngineCC':'"+r.customerData.engineCC+"'\n ,\n'Postcode':'"+r.customerData.postcode+"',\n'Mobile':'"+r.customerData.mobile+"'\n ,\n'HireReward':'"+(r.hireRewardQuestions.firstQuestion?"1":"0")+"',\n'Town':'"+r.customerData.town.replace(/'/g,"\\'")+"'\n ,\n'RegistrationDate':'"+V()(r.customerData.registrationDate).format("DD/MM/YYYY")+"'\n ,\n'VehiclePurchaseDate':'"+V()(r.customerData.dateOfPurchase).format("DD/MM/YYYY")+"'"+u+"\n ,\n'DateOfBirth': '"+(r.dateOfBirth?r.dateOfBirth:"")+"'\n }"):n.append("data","{\n'IgnoreFilters':'false',\n'ProviderId':'10092500',\n'Referral':'"+r.Referral+"'\n ,\n'RegNo':'"+r.customerData.regNo.toUpperCase()+"',\n'Mileage':'"+r.customerData.mileage+"',\n'Price':'"+r.customerData.vehicleValue+"'\n ,\n'FirstName':'"+(r.customerData.firstname?r.customerData.firstname.replace(/'/g,"\\'"):"-")+"',\n'Surname':'"+(r.customerData.lastname?r.customerData.lastname.replace(/'/g,"\\'"):"-")+"'\n ,\n'Address1':'"+r.customerData.address.replace(/'/g,"\\'")+"',\n'Email':'"+(r.customerData.email?r.customerData.email:"TestEmail")+"'\n ,\n'VehicleMake':'"+r.customerData.vehicleMake+"',\n'VehicleModel':'"+r.customerData.vehicleModel+"'\n ,\n'TyreSizeType':'"+r.customerData.tyresType+"',\n'EngineCC':'"+r.customerData.engineCC+"'\n ,\n'Postcode':'"+r.customerData.postcode+"',\n'Mobile':'"+r.customerData.mobile+"'\n ,\n'HireReward':'"+(r.hireRewardQuestions.firstQuestion?"1":"0")+"',\n'Town':'"+r.customerData.town.replace(/'/g,"\\'")+"'\n ,\n'RegistrationDate':'"+V()(r.customerData.registrationDate).format("DD/MM/YYYY")+"'\n ,\n'VehiclePurchaseDate':'"+V()(r.customerData.dateOfPurchase).format("DD/MM/YYYY")+"'"+u+"\n ,\n'DateOfBirth': '"+(r.dateOfBirth?r.dateOfBirth:"")+"'\n }"),a={method:"POST",headers:t,body:n,redirect:"follow"},e.prev=14,e.next=17,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/GetQuote",a);case 17:return o=e.sent,e.next=20,o.json();case 20:if(d=e.sent,c=d.quoteId,l=d.code,f=d.status,h=d.OrganisationName,p=d.OrganisationLogo,!(l&&"Success"===l||f&&!l&"Success"===f)){e.next=31;break}return m=!1===r.hireRewardQuestions.secondQuestion&&!1===r.hireRewardQuestions.thirdQuestion?d.products.filter((function(e){return"Finance Gap"!==e.Origin&&"Return to Invoice"!==e.Origin})):d.products,i({type:j.jp,payload:{products:m,quoteId:c}}),"undefined"!=typeof window&&sessionStorage.setItem("products",JSON.stringify({products:m,quoteId:c,OrganisationName:h,OrganisationLogo:p})),i({type:j.GR,payload:c}),r.finIDDfetchResult||w(p,h),e.abrupt("return",l);case 31:i({type:j.m});case 32:e.next=38;break;case 34:e.prev=34,e.t0=e.catch(14),console.log("[SMH]ERROR"+e.t0),i({type:j.m});case 38:case 39:case"end":return e.stop()}}),e,null,[[14,34]])})));return function(){return e.apply(this,arguments)}}(),c=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,a,o,s,u,d,c,l,f,h,p,m;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!r.customerData.regNo){e.next=17;break}return(t=new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),n={method:"GET",headers:t,redirect:"follow"},i({type:j.y3,payload:!0}),"undefined"!=typeof window&&sessionStorage.getItem("formData")&&(a=JSON.parse(sessionStorage.getItem("formData")),sessionStorage.removeItem("formData"),a.vehicleMake="",a.vehicleModel="",r.customerData.vehicleMake="",r.customerData.vehicleModel="",sessionStorage.setItem("formData",JSON.stringify(a))),e.next=9,fetch("https://portal.loyaltycoversoftware.com/Home/SearchRegNo?regNo="+r.customerData.regNo.toUpperCase(),n);case 9:return o=e.sent,i({type:j.y3,payload:!1}),e.next=13,o.json();case 13:s=e.sent,u=s.VehicleMake,d=s.VehicleModel,c=s.TyreSizeType,l=s.EngineCC,f=s.VehicleRegistrationDate,h=s.VehicleTypeName,p=s.DriveAxle,m=Number(f.substring(6,f.length-2)),i({type:j.mk,payload:{VehicleMake:u,VehicleModel:d,TyreSizeType:c,EngineCC:l,VehicleTypeName:h,dateSubstring:m,DriveAxle:p}});case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(0),i({type:j.Ei});case 22:case"end":return e.stop()}}),e,null,[[0,19]])})));return function(){return e.apply(this,arguments)}}(),l=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,a,o,s;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!r.customerData.postcode){e.next=18;break}return i({type:j.Kr,payload:!1}),(t=new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),n={method:"GET",headers:t,redirect:"follow"},i({type:j.Kr,payload:!0}),e.next=9,fetch("https://portal.loyaltycoversoftware.com/Home/SearchPostcode?postcode="+r.customerData.postcode.toUpperCase(),n);case 9:return a=e.sent,i({type:j.Kr,payload:!1}),e.next=13,a.json();case 13:o=e.sent,s=Object.values(o),i({type:j.DB,payload:{address:s}}),e.next=19;break;case 18:i({type:j.DB,payload:[]});case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(0),console.log(e.t0);case 24:case"end":return e.stop()}}),e,null,[[0,21]])})));return function(){return e.apply(this,arguments)}}(),f=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,a,o,s,u,d,c,l,f,h,p,m;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i({type:j.I1}),i({type:j._5}),(t=new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),n={method:"GET",headers:t,redirect:"follow"},a=r.ids.join(","),o=r.quoteId,s=r.discountCode,u=null!==s&&""!==s?"&discountCode="+s:"",e.prev=9,e.next=12,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/CheckDemandAndNeeds?quoteId="+o+"&ids="+a+u,n);case 12:return d=e.sent,e.next=15,d.json();case 15:return c=e.sent,l=c.questions,f=c.premiumFundingDetails,h=c.co2Emission,p=c.code,m=l.filter((function(e){return!e.Invert})),r.hireRewardQuestions.firstQuestion||(m=m.filter((function(e){return!e.Question.toLowerCase().includes("hire and reward")}))),sessionStorage.setItem("questions",JSON.stringify(m)),sessionStorage.setItem("premiumFundingDetails",JSON.stringify(f)),i({type:j.KP,payload:{removeInvert:m,premiumFundingDetails:f,co2Emission:h}}),f&&f.TotalCost&&C(f.TotalCost),e.abrupt("return",p);case 26:e.prev=26,e.t0=e.catch(9),console.log(e.t0);case 29:case"end":return e.stop()}}),e,null,[[9,26]])})));return function(){return e.apply(this,arguments)}}(),h=function(e,t,n){return e.map((function(e){return e.PPPIds===t?Object.assign({},e,{checked:n}):e}))},p=function(){var e=(0,x.Z)(Y().mark((function e(){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f();case 2:i({type:j.MF}),i({type:j.a,payload:1});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),m=function(){var e=(0,x.Z)(Y().mark((function e(t){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i({type:j.G2,payload:{product:t}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),y=function(){var e=(0,x.Z)(Y().mark((function e(t){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i({type:j.Qk,payload:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(0,L.useEffect)((function(){i({type:j.EF})}),[r.cart]),(0,L.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("idd",r.finIDDfetchResult)}),[r.finIDDfetchResult]),(0,L.useEffect)((function(){if("undefined"!=typeof window){localStorage.getItem("currentTheme");var e=JSON.parse(window.sessionStorage.getItem("redirectFlagVehicle")),t=JSON.parse(window.sessionStorage.getItem("premiumFundingDetailsInitBasket"));e&&t&&i({type:j.rS})}}),[]),(0,L.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("cart",JSON.stringify(r.cart))}),[r.cart]),(0,L.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("complaints",r.finComplaints)}),[r.finComplaints]),(0,L.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("cancellation",r.finCancellation)}),[r.finCancellation]),(0,L.useEffect)((function(){c()}),[r.customerData.regNo]),(0,L.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("checkoutStep",r.checkoutStep)}),[r.checkoutStep]),(0,L.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("formData",JSON.stringify(r.customerData))}),[r.customerData]);var g=function(){var e=(0,x.Z)(Y().mark((function e(t){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i({type:j.in,payload:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),v=function(){var e=(0,x.Z)(Y().mark((function e(){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:sessionStorage.clear();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=(0,G.checkTheme)(),w=function(){var e=(0,x.Z)(Y().mark((function e(t,n){var r,a,o,s,u,d,c;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new Headers).append("Content-Type","application/json"),r.append("x-api-key","ZObSvoANuKQ0"),a=t||D.externalLogo,o=n||D.pageTitle,s=JSON.stringify({OrganisationLogo:a,OrganisationLogoAlt:o,AddressLine_1:D.addressLine1,AddressLine_2:D.addressLine2,AddressLine_3:D.addressLine3,FCANumber:D.fca}),u={method:"POST",headers:r,body:s,redirect:"follow"},e.prev=7,e.next=10,fetch({}.GATSBY_FIN_API_IDD,u);case 10:return d=e.sent,e.next=13,d.text();case 13:c=e.sent,i({type:j.OQ,payload:c}),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(7),console.log(e.t0);case 20:case"end":return e.stop()}}),e,null,[[7,17]])})));return function(t,n){return e.apply(this,arguments)}}(),_=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,r,a,o;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new Headers).append("Content-Type","application/json"),t.append("x-api-key",{}.GATSBY_FIN_DEFAULT_KEY),n=JSON.stringify({OrganisationLogo:D.externalLogo,OrganisationLogoAlt:D.pageTitle,AddressLine_1:D.addressLine1,AddressLine_2:D.addressLine2,AddressLine_3:D.addressLine3,FCANumber:D.fca}),r={method:"POST",headers:t,body:n,redirect:"follow"},e.prev=5,e.next=8,fetch({}.GATSBY_FIN_COMPLAINTS_API,r);case 8:return a=e.sent,e.next=11,a.text();case 11:o=e.sent,i({type:j.ss,payload:o}),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),console.log(e.t0);case 18:case"end":return e.stop()}}),e,null,[[5,15]])})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,r,a,o;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new Headers).append("Content-Type","application/json"),t.append("x-api-key",{}.GATSBY_FIN_DEFAULT_KEY),n=JSON.stringify({OrganisationLogo:D.externalLogo,OrganisationLogoAlt:D.pageTitle,AddressLine_1:D.addressLine1,AddressLine_2:D.addressLine2,AddressLine_3:D.addressLine3,FCANumber:D.fca}),r={method:"POST",headers:t,body:n,redirect:"follow"},e.prev=5,e.next=8,fetch({}.GATSBY_FIN_CANCELLATION_API,r);case 8:return a=e.sent,e.next=11,a.text();case 11:o=e.sent,i({type:j.WC,payload:o}),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),console.log(e.t0);case 18:case"end":return e.stop()}}),e,null,[[5,15]])})));return function(){return e.apply(this,arguments)}}();(0,L.useEffect)((function(){_(),S()}),[]);var O=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,a,o;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i({type:j.Ex}),(t=new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),n={method:"GET",headers:t,redirect:"follow"},e.prev=4,e.next=7,fetch("https://portal.loyaltycoversoftware.com//Home/BankValidationSeach?accountNumber="+r.directDebitDetails.accountNo+"&sortCode="+r.directDebitDetails.sortCode,n);case 7:return a=e.sent,e.next=10,a.json();case 10:"Failed"===(o=e.sent).code?i({type:j.XK}):"Success"===o.code&&i({type:j.xW,payload:o}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),i({type:j.XK});case 17:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=(0,x.Z)(Y().mark((function e(){var t,n,a,o,s,u,d,c;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i({type:j.I0}),i({type:j.XU}),(new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),t=new FormData,"fullPayment"===r.typeOfPayment?t.append("data","{\n'QuoteId':'"+r.quoteId+"',\n'SelectedProducts':"+JSON.stringify(r.selectedProducts)+",\n'DOB': '"+r.dateOfBirth+"',\n'PaymentType': '"+r.typeOfPayment+"',\n'PurchaseCode':'"+r.purchaseCode+"',\n'co2Emission':'"+r.co2Option+"',\n'DiscountCode':'"+r.discountCode+"'}"):"directDebit"===r.typeOfPayment&&t.append("data","{\n'QuoteId':'"+r.quoteId+"',\n'SelectedProducts':"+JSON.stringify(r.selectedProducts)+",\n'DOB': '"+r.dateOfBirth+"',\n'PaymentType': '"+r.typeOfPayment+"',\n'TransactionId':'test',\n'AmountPaid': '"+r.premiumFundingDetails.MinDepositAmount+"',\n'AccountHolderFirstname': '"+r.directDebitDetails.firstname+"',\n'AccountHolderSurname':'"+r.directDebitDetails.surname+"',\n'AccountNumber':'"+r.directDebitDetails.accountNo+"',\n'SortCode':'"+r.directDebitDetails.sortCode+"',\n'BankName':'"+r.directDebitDetails.bankName+"',\n'PreferredPaymentDate':'"+r.directDebitDetails.preferredPaymentDate+"',\n'PurchaseCode':'"+r.purchaseCode+"',\n'co2Emission':'"+r.co2Option+"',\n'DiscountCode':'"+r.discountCode+"'}"),n={method:"POST",body:t,redirect:"follow"},e.prev=7,e.next=10,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/CompleteQuoteOrder",n);case 10:return a=e.sent,e.next=13,a.json();case 13:return o=e.sent,s=o.purchaseCode,u=o.code,d=o.stripeClientSecret,c=o.feedbackQuestions,sessionStorage.setItem("purchaseCode",s),i({type:j.aT,payload:{purchaseCode:s,stripeClientSecret:d,code:u}}),i({type:"SET_FEEDBACK_QUESTIONS",payload:c}),"directDebit"===r.typeOfPayment&&0===r.premiumFundingDetails.MinDepositAmount?null!=s&&""!=s&&(i({type:j.tA,payload:3}),sessionStorage.clear()):i({type:j.fx,payload:"fullPayment"}),e.abrupt("return",u);case 22:e.prev=22,e.t0=e.catch(7),console.log(e.t0);case 25:case"end":return e.stop()}}),e,null,[[7,22]])})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=(0,x.Z)(Y().mark((function e(t){var n,i,a;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),n=new FormData,i={PurchaseCode:r.purchaseCode,FeedbackQuestions:t},n.append("data",JSON.stringify(i)),a={method:"POST",body:n,redirect:"follow"},e.prev=6,e.next=9,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/SendCustomerFeedback",a);case 9:e.sent,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),console.log(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})));return function(t){return e.apply(this,arguments)}}(),C=function(e){i({type:j.LY,payload:e})},k=function(){var e=(0,x.Z)(Y().mark((function e(t){var n,r;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),(n=new FormData).append("email",t),r={method:"POST",body:n,redirect:"follow"},e.prev=5,e.next=8,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/Unsubscribe",r);case 8:e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),console.log(e.t0);case 14:return e.abrupt("return");case 15:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(t){return e.apply(this,arguments)}}();return L.createElement(Q.Provider,{value:Object.assign({},r,{updateCustomerDetails:function(e){var t=e.target.name,n=e.target.value;i({type:j.rN,payload:{value:n,name:t}})},getQuoteWithDefaultCustomerValues:a,searchRegNo:c,addToCart:m,selectTypeOfPayment:function(e){var t;t=e.target.dataset.type?e.target.dataset.type:e.target.value,i({type:j.fx,payload:t})},deselectProduct:y,handleDateOfBirth:function(e){i({type:j.Pb,payload:e})},handleDate:function(e,t){i({type:j.sd,payload:{date:e,id:t}})},handleDirectDebit:function(e){var t=e.target.name,n=e.target.value;i({type:j.DG,payload:{name:t,value:n}})},removeItem:g,updateAddress:function(e){var t=e.target.value,n=t.split(","),r="",a="",o="";if(2==n.length){a=n[0];var s=n[1].split(" ");if(s.length>=3){o=s[s.length-2]+" "+s[s.length-1];for(var u=0;u0?e.step-1:0,isStepChanged:!0});if(t.type===s.Kr)return Object.assign({},e,{searchPostcodeInProgress:t.payload});if(t.type===s.DB)return Object.assign({},e,{addressArray:t.payload});if(t.type===s.OQ)return Object.assign({},e,{finIDDfetchResult:t.payload});if(t.type===s.ss)return Object.assign({},e,{finComplaints:t.payload});if(t.type===s.WC)return Object.assign({},e,{finCancellation:t.payload});if(t.type===s.jc)return Object.assign({},e,{weddingProductsLoading:!0});if(t.type===s.ky){t.payload.products;var P=t.payload.products;if("true"===e.weddingDetails.publicLiabilityCover&&"Failed"!==t.payload.code){P.filter((function(e){return e.Title.toLowerCase().includes("public liability")}));"couple only"===e.weddingDetails.publicLiabilityLevel||""===e.weddingDetails.publicLiabilityLevel?P=P.filter((function(e){return e.Title.toLowerCase().includes("couple only")})):"couple and guests"===e.weddingDetails.publicLiabilityLevel&&(P=P.filter((function(e){return e.Title.toLowerCase().includes("couple and guests")})))}"20000"===e.weddingDetails.marqueeCoverAmount&&!0!==e.weddingDetails.ceremonialSwords?P.filter((function(e){return e.CodeTemplate.endsWith("01")})):"20000"===e.weddingDetails.marqueeCoverAmount&&!0===e.weddingDetails.ceremonialSwords?P.filter((function(e){return e.CodeTemplate.endsWith("11")})):"50000"===e.weddingDetails.marqueeCoverAmount&&!0!==e.weddingDetails.ceremonialSwords?P.filter((function(e){return e.CodeTemplate.endsWith("02")})):"50000"===e.weddingDetails.marqueeCoverAmount&&!0===e.weddingDetails.ceremonialSwords?P.filter((function(e){return e.CodeTemplate.endsWith("12")})):""===e.weddingDetails.marqueeCoverAmount&&!0===e.weddingDetails.ceremonialSwords?P.filter((function(e){return e.CodeTemplate.endsWith("10")})):!1===e.weddingDetails.marqueeCoverAmount&&!1===e.weddingDetails.ceremonialSwords&&P.filter((function(e){return e.CodeTemplate.endsWith("00")}));var I=P;return"undefined"!=typeof window&&sessionStorage.setItem("weddingProducts",JSON.stringify((0,c.kO)(I,"CodeTemplate"))),"undefined"!=typeof window&&sessionStorage.setItem("weddingQuote",t.payload.quoteId),Object.assign({},e,{weddingProducts:(0,c.kO)(I,"CodeTemplate"),quoteIDEvents:t.payload.quoteId,weddingProductsLoading:!1,weddingProductsError:!1})}if(t.type===s.fx)return Object.assign({},e,{typeOfPayment:t.payload,selectTypeOfPaymentFlag:!0});if(t.type===s.TD)return Object.assign({},e,{weddingProductsError:!0});if(t.type===s.G2){var N=t.payload;return Object.assign({},e,{cart:N,selectedProductCodeTemplate:N.CodeTemplate.slice(0,N.CodeTemplate.length-2)})}if(t.type===s.qX)return Object.assign({},e,{cart:""});if(t.type===s.yg)return Object.assign({},e,{step:t.payload});if(t.type===s.bb)return Object.assign({},e);if(t.type===s.hy)return Object.assign({},e,{getQuoteDetailsLoading:!0});if(t.type===s.T_)return Object.assign({},e);if(t.type===s.Lp){var M=t.payload,A=M.ProductTypes,x=M.FirstName,R=M.Surname,Y=M.Address1,L=M.Mobile,j=M.Town,F=M.EngineCC,U=M.HireReward,G=M.Mileage,q=M.RegNo,V=M.RegistrationDate,H=M.TyreSizeType,W=M.VehicleMake,Q=M.Price,B=M.VehicleModel,Z=M.VehiclePurchaseDate,J=M.Postcode,z=M.Email,K=M.DateOfBirth,X=M.EventDate,$=M.products,ee=M.quoteId,te=M.code,ne=M.voucherCode,re=M.Referral;return Object.assign({},e,{testQuoteDetails:t.payload,getQuoteDetailsLoading:!1,quoteIDEvents:ee,quoteDetails:{productType:A,quoteId:ee,firstname:x,surname:R,address:Y,mobile:L,town:j,engineCC:F,hirereward:U,mileage:G,regno:q,registrationdate:V,tyresize:H,vehiclemake:W,price:Q,vehicleModel:B,vehiclePurchaseDate:Z,postcode:J,email:z,dob:K,eventDate:X,products:$,code:te,voucherCode:ne,Referral:re}})}if(t.type===s.dK)return Object.assign({},e,{getQuoteDetailsLoading:!1,quoteIdError:!0});if(t.type===s.Ex)return Object.assign({},e,{directDebitLoading:!0});if(t.type===s.XK)return Object.assign({},e,{directDebitLoading:!1,directDebitError:!0});if(t.type===s.I1)return Object.assign({},e,{isQuestionsLoading:!0});if(t.type===s.PA){var ie=t.payload;return Object.assign({},e,{premiumFundingDetails:ie})}if(t.type===s.KP){var ae=t.payload,oe=ae.questions,se=ae.premiumFundingDetails,ue=ae.code;return Object.assign({},e,{questions:oe,premiumFundingDetails:se,isQuestionsLoading:!1,needsAndDemandsCode:ue})}var de,ce,le,fe,he,pe,me,ye,ge,ve,De,we,_e;if(t.type===s.U2)return"undefined"!=typeof window&&window.sessionStorage.getItem("quoteDetailsEvent")&&(ye=JSON.parse(sessionStorage.getItem("quoteDetailsEvent"))),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingIdd")&&(ge=sessionStorage.getItem("weddingIdd")),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingProducts")&&JSON.parse(sessionStorage.getItem("weddingProducts")),Object.assign({},e,{cart:null===(de=ye)||void 0===de?void 0:de.products[0],finIddResult:ge,weddingDetails:{ceremonyType:"marriage",location:"true",weddingDate:(null===(ce=ye)||void 0===ce?void 0:ce.EventDate)||new Date,reception:"false",ceremonyAndReception:"false",publicLiabilityCover:"true",publicLiabilityLevel:"couple only",marqueeCover:"true",marqueeCoverAmount:"20000",ceremonialSwords:"false"},personalDetails:{firstCeremonyParticipantForname:null===(le=ye)||void 0===le?void 0:le.firstname,firstCeremonyParticipantSurname:null===(fe=ye)||void 0===fe?void 0:fe.surname,firstCeremonyParticipantDob:new Date,firstParticipantUkResidentAndRegistered:"false",secondCeremonyParticipantsFirstname:"test",secondCeremonyParticipantsSurname:"test",secondCeremonyParticipantsDob:new Date,secondParticipantUkResidentAndRegistered:"false",purchaser:"test",relationWithParticipants:"test",purchaserFirstname:null===(he=ye)||void 0===he?void 0:he.firstname,purchaserSurname:null===(pe=ye)||void 0===pe?void 0:pe.surname,purchaserDob:new Date,houseNumber:"test",postcode:"test",fullAddress:"test",address:"tst",telephoneNumber:"test",emailAddress:null===(me=ye)||void 0===me?void 0:me.email}});if(t.type===s.$6)return Object.assign({},e,{isRedirected:!0});if(t.type===s.CK)return Object.assign({},e,{step:t.payload});if(t.type===s.gQ)return"undefined"!=typeof window&&window.sessionStorage.getItem("quoteDetailsEvent")&&(we=JSON.parse(sessionStorage.getItem("quoteDetailsEvent"))),Object.assign({},e,{cart:null===(ve=we)||void 0===ve?void 0:ve.products[0],quoteIDEvents:null===(De=we)||void 0===De?void 0:De.quoteId});if(t.type===s.KN)return"undefined"!=typeof window&&window.sessionStorage.getItem("weddingProducts")&&(_e=JSON.parse(window.sessionStorage.getItem("weddingProducts"))),Object.assign({},e,{weddingProducts:_e});if(t.type===s.I0)return Object.assign({},e,{stripeTokenId:"",stripeStatusCode:""});if(t.type===s.XU)return Object.assign({},e,{purchaseLoading:!0,completeQuoteError:!1});if(t.type===s.DG){var Se,Oe=t.payload,be=Oe.value,Te=Oe.name;return Object.assign({},e,{directDebitDetails:Object.assign({},e.directDebitDetails,(Se={},Se[Te]=be,Se))})}if(t.type===s.aT){var Ce=t.payload,ke=Ce.purchaseCode,Ee=Ce.code,Pe=Ce.stripeClientSecret;return Object.assign({},e,{purchaseCode:ke,stripeStatusCode:Ee,stripeClientSecret:Pe,datePickerFlag:!0,purchaseLoading:!1,completeQuoteError:!1})}if(t.type===s.aV)return Object.assign({},e,{completeQuoteError:!0,purchaseLoading:!1});if(t.type===s.Vu)return e.quoteIDEvents?Object.assign({},e,{step:1,stripeClientSecret:"",purchaseCode:"",quoteIdInitBasket:"",ids:"",cart:""}):Object.assign({},e,{step:e.step-1,stripeClientSecret:"",purchaseCode:"",cart:""});throw new Error('No Matching "'+t.type+'" - action type')},f=n(2818),h=n(6785),p=n(5444);var m=(0,o.createContext)({outlet:null,matches:[]});var y,g,v,D,w,_,S,O,b,T,C,k,E,P,I,N,M,A,x,R,Y,L,j,F,U,G,q,V,H,W,Q,B,Z,J,z,K,X,$,ee,te,ne,re,ie,ae,oe,se,ue,de,ce,le,fe,he,pe,me,ye,ge,ve,De,we,_e,Se,Oe,be,Te,Ce,ke,Ee,Pe,Ie,Ne,Me,Ae,xe,Re,Ye,Le,je,Fe,Ue,Ge,qe,Ve,He,We,Qe,Be,Ze,Je,ze,Ke,Xe,$e,et,tt,nt,rt,it,at,ot,st,ut,dt,ct,lt,ft,ht,pt=n(1789),mt={MBI:"list1","Alloy Wheel":"list2","Cosmetic Repair":"list3",Tyre:"list4","Finance Gap":"list5","Return to Invoice":"list5"},yt={};f.forEach((function(e){var t=e.Origin,n=t in mt?mt[t]:"others";n in yt&&yt[n]?yt[n].push(e):yt[n]=[e]}));var gt,vt,Dt,wt,_t=[],St={},Ot={};if("undefined"!=typeof window&&"/init-basket"===window.location.pathname){var bt=new URLSearchParams(window.location.search);ht=bt.get("id"),gt=bt.get("quoteId")}"undefined"!=typeof window&&window.sessionStorage.getItem("quoteDetailsEvent")&&JSON.parse(sessionStorage.getItem("quoteDetailsEvent")),"undefined"!=typeof window&&window.sessionStorage.getItem("currentStep")&&(st=JSON.parse(sessionStorage.getItem("currentStep"))),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingCart")&&null!=window.sessionStorage.getItem("weddingCart")&&(_t=JSON.parse(sessionStorage.getItem("weddingCart"))),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingQuote")&&(vt=sessionStorage.getItem("weddingQuote")),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingPersonalDetails")&&(ut=JSON.parse(sessionStorage.getItem("weddingPersonalDetails"))),"undefined"!=typeof window&&window.sessionStorage.getItem("additionalOption")&&(dt=JSON.parse(sessionStorage.getItem("additionalOption"))),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingDetails")&&(ct=JSON.parse(sessionStorage.getItem("weddingDetails"))),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingIdd")&&(Dt=sessionStorage.getItem("weddingIdd")),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingProducts")&&(lt=JSON.parse(sessionStorage.getItem("weddingProducts"))),"undefined"!=typeof window&&window.sessionStorage.getItem("quoteDetailsEvent")&&(St=JSON.parse(sessionStorage.getItem("quoteDetailsEvent"))),"undefined"!=typeof window&&window.sessionStorage.getItem("redirectFlagEvent")&&(wt=JSON.parse(sessionStorage.getItem("redirectFlagEvent"))),"undefined"!=typeof window&&window.sessionStorage.getItem("weddingPurchaseCode")&&sessionStorage.getItem("weddingPurchaseCode"),"undefined"!=typeof window&&window.sessionStorage.getItem("premiumFundingDetailsInitBasket")&&(Ot=JSON.parse(sessionStorage.getItem("premiumFundingDetailsInitBasket"))),"undefined"!=typeof window&&window.sessionStorage.getItem("formData")&&(ft=sessionStorage.getItem("formData"));var Tt={products_loading:!1,products_error:!1,products:f,filters:{mileage:null!==(y=ft)&&void 0!==y&&y.mileage?null===(g=ft)||void 0===g?void 0:g.mileage:"",vehicleValue:null!==(v=ft)&&void 0!==v&&v.vehicleValue?null===(D=ft)||void 0===D?void 0:D.vehicleValue:"",regNo:null!==(w=ft)&&void 0!==w&&w.regNo?null===(_=ft)||void 0===_?void 0:_.regNo:"",category:"MBI"},search:!1,quoteID:null!==(S=St)&&void 0!==S&&S.quoteId?null===(O=St)||void 0===O?void 0:O.quoteId:"",successResponse:!1,step:st||0,isStepChanged:!1,weddingDetails:{ceremonyType:ct?ct.ceremonyType:"",location:!ct||ct.location,weddingDate:ct?new Date(ct.weddingDate):null,reception:!!ct&&ct.reception,ceremonyAndReception:!!ct&&ct.ceremonyAndReception,receptionDate:ct?new Date(ct.receptionDate):null,totalCost:ct?ct.totalCost:"",publicLiabilityCover:null!==(b=ct)&&void 0!==b&&b.publicLiabilityCover?null===(T=ct)||void 0===T?void 0:T.publicLiabilityCover:!(null===(C=St)||void 0===C||!C.Eligibility||""==(null===(k=St)||void 0===k?void 0:k.Eligibility)),publicLiabilityLevel:null!==(E=ct)&&void 0!==E&&E.publicLiabilityLevel&&""!=(null===(P=ct)||void 0===P?void 0:P.publicLiabilityLevel)?null===(I=ct)||void 0===I?void 0:I.publicLiabilityLevel:"CoupleOnly"==(null===(N=St)||void 0===N||null===(M=N.Eligibility)||void 0===M?void 0:M.PublicLiability)?"couple only":"CoupleAndGuests"==(null===(A=St)||void 0===A||null===(x=A.Eligibility)||void 0===x?void 0:x.PublicLiability)?"couple and guests":"",monetaryLiabilityCover:ct?ct.monetaryLiabilityCover:"",guestsNumber:ct?ct.guestsNumber:"",marqueeCover:null!==(R=ct)&&void 0!==R&&R.marqueeCover?null===(Y=ct)||void 0===Y?void 0:Y.marqueeCover:!(null===(L=St)||void 0===L||null===(j=L.Eligibility)||void 0===j||!j.MarqueeCover)&&St.Eligibility.MarqueeCover,marqueeCoverDaysNumber:ct?ct.marqueeCoverDaysNumber:"",marqueeCoverAmount:null!==(F=ct)&&void 0!==F&&F.marqueeCoverAmount?ct.marqueeCoverAmount:"LTEQ20000"===(null===(U=St)||void 0===U||null===(G=U.Eligibility)||void 0===G?void 0:G.MarqueeCover)?"2000":"GT20000"===(null===(q=St)||void 0===q||null===(V=q.Eligibility)||void 0===V?void 0:V.MarqueeCover)?"50000":"",ceremonialSwords:null!==(H=ct)&&void 0!==H&&H.ceremonialSwords?ct.ceremonialSwords:!(null===(W=St)||void 0===W||null===(Q=W.Eligibility)||void 0===Q||!Q.CeremonialSwords)&&(null===(B=St)||void 0===B||null===(Z=B.Eligibility)||void 0===Z?void 0:Z.CeremonialSwords),covidCover:null!==(J=ct)&&void 0!==J&&J.covidCover?ct.covidCover:!(null===(z=St)||void 0===z||null===(K=z.Eligibility)||void 0===K||!K.CovidCover)&&(null===(X=St)||void 0===X||null===($=X.Eligibility)||void 0===$?void 0:$.CovidCover)},personalDetails:{firstCeremonyParticipantForname:""!=(null===(ee=ut)||void 0===ee?void 0:ee.firstCeremonyParticipantForname)&&null!==(te=ut)&&void 0!==te&&te.firstCeremonyParticipantForname?null===(ne=ut)||void 0===ne?void 0:ne.firstCeremonyParticipantForname:null!==(re=St)&&void 0!==re&&re.FirstName?null===(ie=St)||void 0===ie?void 0:ie.FirstName:"",firstCeremonyParticipantSurname:""!=(null===(ae=ut)||void 0===ae?void 0:ae.firstCeremonyParticipantSurname)&&null!==(oe=ut)&&void 0!==oe&&oe.firstCeremonyParticipantSurname?null===(se=ut)||void 0===se?void 0:se.firstCeremonyParticipantSurname:null!==(ue=St)&&void 0!==ue&&ue.Surname?null===(de=St)||void 0===de?void 0:de.Surname:"",firstCeremonyParticipantDob:ut?new Date(ut.firstCeremonyParticipantDob):null,firstParticipantUkResidentAndRegistered:!ut||ut.firstParticipantUkResidentAndRegistered,secondCeremonyParticipantsFirstname:ut?ut.secondCeremonyParticipantsFirstname:"",secondCeremonyParticipantsSurname:ut?ut.secondCeremonyParticipantsSurname:"",secondCeremonyParticipantsDob:ut?new Date(ut.secondCeremonyParticipantsDob):null,secondParticipantUkResidentAndRegistered:!ut||ut.secondParticipantUkResidentAndRegistered,purchaser:!!ut&&ut.purchaser,relationWithParticipants:ut?ut.relationWithParticipants:"",purchaserFirstname:ut?ut.purchaserFirstname:"",purchaserSurname:ut?ut.purchaserSurname:"",purchaserDob:ut?new Date(ut.purchaserDob):null,houseNumber:null!==(ce=ut)&&void 0!==ce&&ce.houseNumber?ut.houseNumber:null!==(le=St)&&void 0!==le&&le.Town?null===(fe=St)||void 0===fe?void 0:fe.Town:"",postcode:null!==(he=ut)&&void 0!==he&&he.postcode&&""!=(null===(pe=ut)||void 0===pe?void 0:pe.postcode)?null===(me=ut)||void 0===me?void 0:me.postcode:null!==(ye=St)&&void 0!==ye&&ye.Postcode?St.Postcode:"",fullAddress:""!=(null===(ge=ut)||void 0===ge?void 0:ge.address)?null===(ve=ut)||void 0===ve?void 0:ve.fullAddress:null!==(De=St)&&void 0!==De&&De.Address1?St.Address1:"",address:ut?null===(we=ut)||void 0===we?void 0:we.address:null!==(_e=St)&&void 0!==_e&&_e.Address1?St.Address1:"",telephoneNumber:null!==(Se=ut)&&void 0!==Se&&Se.telephoneNumber?null===(Oe=ut)||void 0===Oe?void 0:Oe.telephoneNumber:null!==(be=St)&&void 0!==be&&be.Mobile?St.Mobile:"",emailAddress:null!==(Te=ut)&&void 0!==Te&&Te.emailAddress?null===(Ce=ut)||void 0===Ce?void 0:Ce.emailAddress:null!==(ke=St)&&void 0!==ke&&ke.Email?St.Email:""},additionalOptions:{marquee:dt?dt.marquee:"",sword:dt||""},addressArray:[],searchPostcodeInProgress:!1,accountNoError:!1,sortCodeError:!1,finIddLoading:!1,finIddResult:Dt||"",finIddError:!1,quoteIDEvents:vt||(null!==(Ee=St)&&void 0!==Ee&&Ee.quoteId?null===(Pe=St)||void 0===Pe?void 0:Pe.quoteId:""),weddingProductsLoading:!1,stripeClientSecret:"",weddingProducts:lt||[],weddingProductsError:!1,cart:_t||"",selectedProductCodeTemplate:"",quoteDetails:{productType:null!==(Ie=St)&&void 0!==Ie&&Ie.ProductTypes?null===(Ne=St)||void 0===Ne?void 0:Ne.ProductTypes:"",quoteId:null!==(Me=St)&&void 0!==Me&&Me.quoteId?null===(Ae=St)||void 0===Ae?void 0:Ae.quoteId:"",firstname:null!==(xe=St)&&void 0!==xe&&xe.FirstName?null===(Re=St)||void 0===Re?void 0:Re.FirstName:"",surname:null!==(Ye=St)&&void 0!==Ye&&Ye.Surname?null===(Le=St)||void 0===Le?void 0:Le.Surname:"",address:null!==(je=St)&&void 0!==je&&je.Address1?null===(Fe=St)||void 0===Fe?void 0:Fe.Address1:"",mobile:null!==(Ue=St)&&void 0!==Ue&&Ue.Mobile?null===(Ge=St)||void 0===Ge?void 0:Ge.Mobile:"",town:null!==(qe=St)&&void 0!==qe&&qe.Town?null===(Ve=St)||void 0===Ve?void 0:Ve.Town:"",postcode:null!==(He=St)&&void 0!==He&&He.Postcode?null===(We=St)||void 0===We?void 0:We.Postcode:"",email:null!==(Qe=St)&&void 0!==Qe&&Qe.Email?null===(Be=St)||void 0===Be?void 0:Be.Email:"",dob:null!==(Ze=St)&&void 0!==Ze&&Ze.DateOfBirth?null===(Je=St)||void 0===Je?void 0:Je.DateOfBirth:"",eventDate:null!==(ze=St)&&void 0!==ze&&ze.EventDate?null===(Ke=St)||void 0===Ke?void 0:Ke.EventDate:"",products:null!==(Xe=St)&&void 0!==Xe&&Xe.products?null===($e=St)||void 0===$e?void 0:$e.products:[],code:null!==(et=St)&&void 0!==et&&et.cod?null===(tt=St)||void 0===tt?void 0:tt.cod:"test",voucherCode:null!==(nt=St)&&void 0!==nt&&nt.voucherCode?null===(rt=St)||void 0===rt?void 0:rt.voucherCode:"",Referral:null!==(it=St)&&void 0!==it&&it.Referral?null===(at=St)||void 0===at?void 0:at.Referral:""},ids:ht,voucherCode:"",quoteIdInitBasket:gt,isQuestionsLoading:!1,directDebitDetails:{firstname:"",surname:"",sortCode:"",accountNo:"",bankName:"",bankPostcode:"",bankAddress1:"",bankAddress2:"",bankTown:"",preferredPaymentDateUnformatted:new Date,preferredPaymentDate:d()(new Date).format("DD/MM/YYYY")},dateOfBirthUnformatted:new Date,premiumFundingDetails:null!==(ot=Ot)&&void 0!==ot&&ot.premiumFundingDetails?Ot.premiumFundingDetails:{},questions:[],needsAndDemandsCode:"",quoteIdError:!1,getQuoteDetailsLoading:!0,typeOfPayment:"fullPayment",testQuoteDetails:{},isRedirected:wt||!1,finIDDfetchResult:Dt||"",finComplaints:"",finCancellation:"",stripeTokenId:"",stripeStatusCode:"",purchaseLoading:"",purchaseCode:"",completeQuoteError:!1},Ct=o.createContext(),kt=function(e){var t,n,i=e.children,u=(0,o.useReducer)(l,Tt),d=u[0],c=u[1],f=(t=(0,o.useContext)(m).matches,(n=t[t.length-1])?n.params:{}),y=(f.id,f.quoteId,function(){var e=(0,r.Z)(a().mark((function e(){var t,n,r,i,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new Headers).append("Content-Type","application/json"),t.append("x-api-key",{}.GATSBY_FIN_DEFAULT_KEY),n=JSON.stringify({OrganisationLogo:(0,pt.checkTheme)().externalLogo,OrganisationLogoAlt:(0,pt.checkTheme)().pageTitle,AddressLine_1:"Lower Ground Floor, Martland Mill,",AddressLine_2:"Mart Lane,",AddressLine_3:"Burscough, L40 0SD",FCANumber:"732530"}),r={method:"POST",headers:t,body:n,redirect:"follow"},e.prev=5,e.next=8,fetch({}.GATSBY_FIN_COMPLAINTS_API,r);case 8:return i=e.sent,e.next=11,i.text();case 11:o=e.sent,c({type:s.ss,payload:o}),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),console.log(e.t0);case 18:case"end":return e.stop()}}),e,null,[[5,15]])})));return function(){return e.apply(this,arguments)}}()),g=function(){var e=(0,r.Z)(a().mark((function e(){var t,n,r,i,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new Headers).append("Content-Type","application/json"),t.append("x-api-key",{}.GATSBY_FIN_DEFAULT_KEY),n=JSON.stringify({OrganisationLogo:(0,pt.checkTheme)().externalLogo,OrganisationLogoAlt:(0,pt.checkTheme)().pageTitle,AddressLine_1:"Lower Ground Floor, Martland Mill,",AddressLine_2:"Mart Lane,",AddressLine_3:"Burscough, L40 0SD",FCANumber:"732530"}),r={method:"POST",headers:t,body:n,redirect:"follow"},e.prev=5,e.next=8,fetch({}.GATSBY_FIN_CANCELLATION_API,r);case 8:return i=e.sent,e.next=11,i.text();case 11:o=e.sent,c({type:s.WC,payload:o}),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),console.log(e.t0);case 18:case"end":return e.stop()}}),e,null,[[5,15]])})));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){y(),g()}),[]);"undefined"!=typeof window&&sessionStorage.setItem("getQuote",!1);var v=function(){var e=(0,r.Z)(a().mark((function e(){var t,n,r,i,o,u,l,f,p,m,y,g;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c({type:s.cA}),t=d.filters.regNo,n=d.filters.vehicleValue,r=d.filters.mileage,(i=new Headers).append("Cookie","ASP.NET_SessionId=5tnbx0wsv0qzqaf4akfajpps"),o=new FormData,d.voucherCode?o.append("data","{\n'IgnoreFilters':'false',\n'VoucherCode':'"+d.voucherCode+"',\n'RegNo':'"+t+"'\n ,\n'Mileage': '"+r+"',\n'Price': '"+n+"',\n'FirstName': 'Test'\n ,\n'Surname': 'Surname',\n'Address1': 'test 1234',\n'Email': 'test333@phaeria.com'\n}"):o.append("data","{\n'IgnoreFilters':'false',\n'ProviderId':'10092500',\n'RegNo':'"+t+"'\n ,\n'Mileage': '"+r+"',\n'Price': '"+n+"',\n'FirstName': 'Test',\n'Surname': 'Surname',\n'Address1': 'test 1234',\n'Email': 'test333@phaeria.com'\n}"),u={method:"POST",headers:i,body:o,redirect:"follow"},e.next=11,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/GetQuote",u);case 11:return l=e.sent,e.next=14,l.json();case 14:f=e.sent,p=f.products,m=f.quoteId,y=f.code,g=f.status,y&&"Success"===y||g&&!y&"Success"===g?(c({type:s.mo}),c({type:s.jp,payload:p}),c({type:s.aG,payload:m}),c({type:s.h0}),(0,h.Z)("#products"),localStorage.setItem("getQuote",!0)):(localStorage.setItem("getQuote",!1),c({type:s.m}));case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){c({type:s.MF}),c({type:s.SG})};(0,o.useEffect)((function(){"undefined"!=typeof window&&3!==d.step&&sessionStorage.setItem("currentStep",JSON.stringify(d.step))}),[d.step]),(0,o.useEffect)((function(){"undefined"!=typeof window&&d.cart&&sessionStorage.setItem("weddingCart",JSON.stringify(d.cart))}),[d.cart]),(0,o.useEffect)((function(){return"undefined"!=typeof window&&"/wedding-checkout"===window.location.pathname&&sessionStorage.setItem("getQuote",!1),window.addEventListener("popstate",D),function(){return window.removeEventListener("popstate",D)}})),(0,o.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("weddingDetails",JSON.stringify(d.weddingDetails))}),[d.weddingDetails]),(0,o.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("weddingPersonalDetails",JSON.stringify(d.personalDetails))}),[d.personalDetails]),(0,o.useEffect)((function(){"undefined"!=typeof window&&sessionStorage.setItem("additionalOptions",JSON.stringify(d.additionalOptions))}),[d.additionalOptions]),(0,o.useEffect)((function(){window.localStorage.setItem("personalDetailsWedding",JSON.stringify(d.personalDetails))}),[d.personalDetails]);var w=function(){var e=(0,r.Z)(a().mark((function e(){var t,n,r,i,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(t=new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),n={method:"GET",headers:t,redirect:"follow"},c({type:s.Kr,payload:!0}),e.next=7,fetch("https://portal.loyaltycoversoftware.com/Home/SearchPostcode?postcode="+d.personalDetails.postcode,n);case 7:return r=e.sent,c({type:s.Kr,payload:!1}),e.next=11,r.json();case 11:i=e.sent,o=Object.values(i),c({type:s.DB,payload:o}),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),console.log(e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=(0,r.Z)(a().mark((function e(){var t,n,r,i,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new Headers).append("Content-Type","application/json"),t.append("x-api-key","ZObSvoANuKQ0"),n=JSON.stringify({OrganisationLogo:(0,pt.checkTheme)().externalLogo,OrganisationLogoAlt:(0,pt.checkTheme)().pageTitle,AddressLine_1:"Lower Ground Floor, Martland Mill,",AddressLine_2:"Mart Lane,",AddressLine_3:"Burscough, L40 0SD",FCANumber:"732530"}),r={method:"POST",headers:t,body:n,redirect:"follow"},e.prev=5,e.next=8,fetch({}.GATSBY_FIN_API_IDD,r);case 8:return i=e.sent,e.next=11,i.text();case 11:o=e.sent,c({type:s.OQ,payload:o}),"undefined"!=typeof window&&sessionStorage.setItem("weddingIdd",o),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),c({type:s.ez});case 19:case"end":return e.stop()}}),e,null,[[5,16]])})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=(0,r.Z)(a().mark((function e(){var t,n,r,i,o,u,l;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c({type:s.jc}),(t=new Headers).append("Cookie","ASP.NET_SessionId=vai1rjmn32ye02hxygceqjxj"),n=new FormData,(r={}).provider_id="1234593",r.wedding_date=d.weddingDetails.weddingDate,r.price=d.weddingDetails.totalCost?d.weddingDetails.totalCost:0,r.first_name=!0===d.personalDetails.purchaser?d.personalDetails.firstCeremonyParticipantForname:d.personalDetails.purchaserFirstname,r.last_name=!0===d.personalDetails.purchaser?d.personalDetails.firstCeremonyParticipantSurname:d.personalDetails.purchaserSurname,r.address1=d.personalDetails.fullAddress,r.town=d.personalDetails.houseNumber,r.Postcode=d.personalDetails.postcode,r.email=d.personalDetails.emailAddress,r.date_of_birth=d.personalDetails.firstCeremonyParticipantDob,r.phone_number=d.personalDetails.telephoneNumber,i={},!0===d.weddingDetails.ceremonialSwords?i.CeremonialSwords="1":i.CeremonialSwords="0",!0===d.weddingDetails.covidCover?i.CovidCover="1":i.CovidCover="0","20000"===d.weddingDetails.marqueeCoverAmount?i.MarqueeCover="LTEQ20000":"50000"===d.weddingDetails.marqueeCoverAmount&&(i.MarqueeCover="GT20000"),"couple only"===d.weddingDetails.publicLiabilityLevel||""===d.weddingDetails.publicLiabilityLevel?i.PublicLiability="CoupleOnly":"couple and guests"===d.weddingDetails.publicLiabilityLevel&&(i.PublicLiability="CoupleAndGuests"),"2M"===d.weddingDetails.monetaryLiabilityCover?i.PublicLiabilityValue="£2M":"5M"===d.weddingDetails.monetaryLiabilityCover&&(i.PublicLiabilityValue="£5M"),0,r.eligibility=i,n.append("data",JSON.stringify(r)),o={method:"POST",headers:t,body:n,redirect:"follow"},e.prev=26,e.next=29,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/GetEventsQuote",o);case 29:return u=e.sent,e.next=32,u.json();case 32:l=e.sent,c({type:s.ky,payload:l}),e.next=39;break;case 36:e.prev=36,e.t0=e.catch(26),c({type:s.TD});case 39:case"end":return e.stop()}}),e,null,[[26,36]])})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=(0,r.Z)(a().mark((function e(){var t,n,r,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c({type:s.Ex}),(t=new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),n={method:"GET",headers:t,redirect:"follow"},e.prev=4,e.next=7,fetch("https://portal.loyaltycoversoftware.com//Home/BankValidationSeach?accountNumber="+d.directDebitDetails.accountNo+"&sortCode="+d.directDebitDetails.sortCode,n);case 7:return r=e.sent,e.next=10,r.json();case 10:"Failed"===(i=e.sent).code?c({type:s.XK}):"Success"===i.code&&c({type:s.xW,payload:i}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),c({type:s.XK});case 17:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=(0,r.Z)(a().mark((function e(t,n,r){var i,o,u,d,l,f,h,p,m,y,g,v,D,w,_,S,O,b,T,C,k,E,P,I,N,M,A,x,R,Y,L,j,F,U,G,q;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c({type:s.hy}),i={method:"GET",redirect:"follow"},e.prev=2,r){e.next=9;break}return e.next=6,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/GetQuoteDetails?quoteId="+t+"&ids="+n,i);case 6:e.t0=e.sent,e.next=12;break;case 9:return e.next=11,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/GetQuoteDetails?quoteId="+t+"&ids="+n+"&voucherCode="+r,i);case 11:e.t0=e.sent;case 12:return f=e.t0,e.next=15,f.json();case 15:h=e.sent,null===(null===(o=h.quoteDetails)||void 0===o?void 0:o.ProductTypes)&&(h.quoteDetails.ProductTypes=["Car"]),p={},h.voucherCode=r,null===(u=h.quoteDetails)||void 0===u||!u.Source||"GOC1"!=(null===(d=h.quoteDetails)||void 0===d?void 0:d.Source)&&"IMS1"!=(null===(l=h.quoteDetails)||void 0===l?void 0:l.Source)||(p.firstQuestion=!1,p.secondQuestion=!0,p.thirdQuestion=!0),Object.keys(p).length&&sessionStorage.setItem("initBasketHireRewards",JSON.stringify(p)),m=h.quoteDetails,y=m.ProductTypes,g=m.FirstName,v=m.Eligibility,D=m.Surname,w=m.EngineCC,_=m.HireReward,S=m.Mileage,O=m.RegNo,b=m.RegistrationDate,T=m.TyreSizeType,C=m.Source,k=m.VehicleMake,E=m.Price,P=m.VehicleModel,I=m.VehiclePurchaseDate,N=m.Address1,M=m.Mobile,A=m.Town,x=m.Postcode,R=m.Email,Y=m.DateOfBirth,L=m.EligibilityCar,j=m.EventDate,F=m.Referral,U=h.products,G=h.quoteId,q=h.code,"Car"===y[0]?sessionStorage.setItem("quoteDetailsVehicle",JSON.stringify({ProductTypes:y,FirstName:g,Surname:D,Address1:N,Mobile:M,Town:A,Postcode:x,Eligibility:v,Source:C,Email:R,EngineCC:w,HireReward:_,Mileage:S,RegNo:O,RegistrationDate:b,TyreSizeType:T,VehicleMake:k,Price:E,VehicleModel:P,VehiclePurchaseDate:I,DateOfBirth:Y,EventDate:j,products:U,quoteId:G,Referral:F,DriveTrain:L&&L.DriveTrain?L.DriveTrain:"",voucherCode:r,code:q})):sessionStorage.setItem("quoteDetailsEvent",JSON.stringify({ProductTypes:y,FirstName:g,Surname:D,Address1:N,Mobile:M,Town:A,Postcode:x,Eligibility:v,Source:C,Email:R,EngineCC:w,HireReward:_,Mileage:S,RegNo:O,RegistrationDate:b,TyreSizeType:T,VehicleMake:k,Price:E,VehicleModel:P,VehiclePurchaseDate:I,DateOfBirth:Y,EventDate:j,products:U,quoteId:G,Referral:F,voucherCode:r,code:q})),c({type:s.Lp,payload:{ProductTypes:y,FirstName:g,Surname:D,Address1:N,Mobile:M,Town:A,Postcode:x,Email:R,EngineCC:w,HireReward:_,Mileage:S,RegNo:O,RegistrationDate:b,TyreSizeType:T,VehicleMake:k,Price:E,VehicleModel:P,VehiclePurchaseDate:I,DriveTrain:L&&L.DriveTrain?L.DriveTrain:"",DateOfBirth:Y,EventDate:j,products:U,quoteId:G,Referral:F,voucherCode:r,code:q}}),e.next=29;break;case 26:e.prev=26,e.t1=e.catch(2),c({type:s.dK});case 29:case"end":return e.stop()}}),e,null,[[2,26]])})));return function(t,n,r){return e.apply(this,arguments)}}(),T=function(){var e=(0,r.Z)(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c({type:s.PA,payload:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=(0,r.Z)(a().mark((function e(t,n){var r,i,o,u,d,l,f;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c({type:s.I1}),(r=new Headers).append("Cookie","ASP.NET_SessionId=ed5gs5jk1vj2d3d0gxkvrezp"),i={method:"GET",headers:r,redirect:"follow"},e.prev=4,e.next=7,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/CheckDemandAndNeeds?quoteId="+t+"&ids="+n,i);case 7:return o=e.sent,e.next=10,o.json();case 10:u=e.sent,d=u.questions,l=u.premiumFundingDetails,f=u.code,window.sessionStorage.setItem("premiumFundingDetailsInitBasket",JSON.stringify(u)),c({type:s.KP,payload:{questions:d,premiumFundingDetails:l,code:f}}),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(4),console.log(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})));return function(t,n){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){"Success"===d.needsAndDemandsCode&&"Success"===d.quoteDetails.code&&c({type:s.yg,payload:JSON.parse(sessionStorage.getItem("currentStep"))})}),[d.needsAndDemandsCode,d.quoteDetails.code]);var k=function(){var e=(0,r.Z)(a().mark((function e(){var t,n,r,i,o,u,l,f,h;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c({type:s.I0}),c({type:s.XU}),n=[{PPPId:null===(t=d.cart)||void 0===t?void 0:t.PPPId,StartDate:"09/09/2023"}],(new Headers).append("Cookie","ASP.NET_SessionId=1vsvgysimyrtprm2q4qn42pr"),r=new FormData,"fullPayment"===d.typeOfPayment?r.append("data","{\n'QuoteId':'"+d.quoteIDEvents+"',\n'SelectedProducts':"+JSON.stringify(n)+",\n'PaymentType': '"+d.typeOfPayment+"',\n'PurchaseCode':'"+d.purchaseCode+"',\n'co2Emission':'"+!1+"'}"):"directDebit"===d.typeOfPayment&&r.append("data","{\n'QuoteId':'"+d.quoteIDEvents+"',\n'SelectedProducts':"+JSON.stringify(n)+",\n'DOB': '"+d.dateOfBirth+"',\n'PaymentType': '"+d.typeOfPayment+"',\n'TransactionId':'test',\n'AmountPaid': '"+d.premiumFundingDetails.MinDepositAmount+"',\n'AccountHolderFirstname': '"+d.directDebitDetails.firstname+"',\n'AccountHolderSurname':'"+d.directDebitDetails.surname+"',\n'AccountNumber':'"+d.directDebitDetails.accountNo+"',\n'SortCode':'"+d.directDebitDetails.sortCode+"',\n'BankName':'"+d.directDebitDetails.bankName+"',\n'PreferredPaymentDate':'"+d.directDebitDetails.preferredPaymentDate+"',\n'PurchaseCode':'"+d.purchaseCode+"',\n'co2Emission':'"+!1+"'}"),i={method:"POST",body:r,redirect:"follow"},e.prev=8,e.next=11,fetch("https://portal.loyaltycoversoftware.com/ExternalQuote/CompleteQuoteOrder",i);case 11:return o=e.sent,e.next=14,o.json();case 14:return u=e.sent,l=u.purchaseCode,f=u.code,h=u.stripeClientSecret,u.message,sessionStorage.setItem("weddingPurchaseCode",l),"Success"===f?(c({type:s.aT,payload:{purchaseCode:l,stripeClientSecret:h,code:f}}),"directDebit"===d.typeOfPayment&&0===d.premiumFundingDetails.MinDepositAmount&&(c({type:s.oi}),sessionStorage.clear())):"Failed"===f&&c({type:s.aV}),e.abrupt("return",f);case 21:e.prev=21,e.t0=e.catch(8),console.log(e.t0);case 24:case"end":return e.stop()}}),e,null,[[8,21]])})));return function(){return e.apply(this,arguments)}}();return(0,o.useEffect)((function(){4===d.step&&(sessionStorage.clear(),localStorage.clear()),0===d.formStep&&sessionStorage.removeItem("weddingPurchaseCode")}),[d.step]),o.createElement(Ct.Provider,{value:Object.assign({},d,{updateFilters:function(e){var t=e.target.name,n=e.target.value;c({type:s.rN,payload:{value:n,name:t}})},fetchFiltredProducts:v,getDate:function(e,t){c({type:s.yt,payload:{date:e,id:t}})},searchPostcode:w,selectTypeOfPayment:function(e){var t;t=e.target.dataset.type?e.target.dataset.type:e.target.value,c({type:s.fx,payload:t})},increaseStep:function(){c({type:s.oi})},finEventsIdd:_,decreaseStep:D,getEventsQuote:S,addToCart:function(e){c({type:s.G2,payload:e})},clearCart:function(){c({type:s.qX}),c({type:s.MF})},updateAdditionalOptions:function(e){var t=e.target.name,n=e.target.value;c({type:s.ng,payload:{value:n,name:t}})},updateEventDetails:function(e){var t,n=e.target.name;if("checkbox"===e.target.type){if(t=e.target.checked,"marqueeCover"==n&&0==t){c({type:s.t7,payload:{name:"marqueeCoverAmount",value:""}})}if("publicLiabilityCover"==n&&0==t){c({type:s.t7,payload:{name:"publicLiabilityLevel",value:""}})}if("publicLiabilityCover"==n&&0==t){c({type:s.t7,payload:{name:"monetaryLiabilityCover",value:""}})}if("publicLiabilityCover"==n&&0==t){c({type:s.t7,payload:{name:"guestsNumber",value:""}})}if("reception"==n&&0==t){c({type:s.t7,payload:{name:"ceremonyAndReception",value:!1}})}}else t=e.target.value;c({type:s.t7,payload:{value:t,name:n}})},updateEventToggle:function(e){var t,n=e.target.name;t=e.target.checked,c({type:s.PN,payload:{value:t,name:n}})},updatePersonalDetails:function(e){var t=e.target.name,n=e.target.value;c({type:s.PN,payload:{value:n,name:t}})},updatePersonalDetailsTown:function(e,t){c({type:s.PN,payload:{value:t,name:e}})},changeStepIndex:function(e,t){ed.step&&0!==t.length&&c({type:s.yg,payload:e>3?3:e})},setStep:function(e){c({type:s.qB,payload:e})},getQuoteDetails:b,checkDemandandNeeds:C,handleDateOfBirth:function(e){c({type:s.Pb,payload:e})},redirectToEventsCheckout:function(){"Success"===d.needsAndDemandsCode&&"Success"===d.quoteDetails.code&&((0,p.navigate)("/wedding-checkout"),_())},checkBankData:O,changeWeddingIndexAfterRedirect:function(e){c({type:s.CK,payload:e})},updateCartAfterRedirect:function(){c({type:s.gQ})},completeQuoteOrder:k,premiumFundingDetailsUpdate:T,returnToProducts:function(){c({type:s.Vu})},handleDirectDebit:function(e){var t=e.target.name,n=e.target.value;"accountNo"===t||"sortCode"===t?(n=n.replace(/[^\d,]/g,""),"accountNo"===t&&8!==n.length?c({type:s.ACCOUNT_NUMBER_ERROR}):"sortCode"==t&&6!==n.length?c({type:s.lU}):(c({type:s.E4}),c({type:s.$g})),c({type:s.DG,payload:{name:t,value:n}})):c({type:s.DG,payload:{name:t,value:n}})}})},i)},Et=function(){return(0,o.useContext)(Ct)}},4517:function(e,t,n){"use strict";n.d(t,{E1:function(){return r},gG:function(){return s},kO:function(){return a},oH:function(){return o},oc:function(){return u},vM:function(){return i}});var r=function(e,t,n){var r=[];return t.forEach((function(t){n.forEach((function(n){var i=e.filter((function(e){return e.claim_limit===t&&e.months_of_cover===n}))[0];r.push(i)}))})),r},i=function(e,t){return t.reduce((function(t,n){var r,i,a=n[e];return a in t?Object.assign({},t,((i={})[a]=t[a].concat(n),i)):Object.assign({},t,((r={})[a]=[n],r))}),{})},a=function(e,t){var n={};if(e)for(var r=0;r()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function s(e){return 0==e[0]&&e.length<=11}function u(e){var t={MBI:"mbi","Alloy Wheel":"alloy","Cosmetic Repair":"cosmetic",Tyre:"tyre","Finance Gap":"gap","Return to Invoice":"gap",Excess:"excess"},n={};return e.forEach((function(e){var r=e.Origin,i=r in t?t[r]:"others";i in n&&n[i]?n[i].push(e):n[i]=[e]})),n}},5666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(N){u=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new E(r||[]);return a._invoke=function(e,t,n){var r=l;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw a;return I()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=T(o,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?p:f,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(N){return{type:"throw",arg:N}}}e.wrap=d;var l="suspendedStart",f="suspendedYield",h="executing",p="completed",m={};function y(){}function g(){}function v(){}var D={};u(D,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(P([])));_&&_!==n&&r.call(_,a)&&(D=_);var S=v.prototype=y.prototype=Object.create(D);function O(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var d=u.arg,l=d.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(l).then((function(e){d.value=e,o(d)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function T(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function P(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),d=r.call(o,"finallyLoc");if(u&&d){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(n){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(d){return void n(d)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})}}]); //# sourceMappingURL=commons-376892cdaeb739bc1ccd.js.map