encore-api-services
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -49,5 +49,5 @@ import { Product } from '../../content-service/models'; | ||
isTicket(): boolean; | ||
isUkShow(): Promise<boolean>; | ||
isUsaShow(): Promise<boolean>; | ||
isUKShow(): Promise<boolean>; | ||
isUSAShow(): Promise<boolean>; | ||
getCountryCode(): Promise<string>; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { BasketData } from '../typings'; | ||
import { BasketData, Promotion } from '../typings'; | ||
import { BasketItemsCollection } from './basket-items-collection'; | ||
@@ -31,3 +31,3 @@ import { BasketItem } from './basket-item'; | ||
isMixedBasket(): Promise<boolean>; | ||
getAppliedPromotion(): import("../typings").Promotion; | ||
getAppliedPromotion(): Promotion; | ||
hasAppliedPromotion(): boolean; | ||
@@ -34,0 +34,0 @@ getPromotionCode(): string; |
@@ -8,2 +8,2 @@ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("apiServices",[],e):"object"==typeof exports?exports.apiServices=e():t.apiServices=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=26)}([function(t,e,n){"use strict";var r=n(2),o=n(9),i=Object.prototype.toString;function u(t){return"[object Array]"===i.call(t)}function s(t){return null!==t&&"object"==typeof t}function a(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),u(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:u,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:a,isStream:function(t){return s(t)&&a(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";var r=n(0),o=n(11),i={"Content-Type":"application/x-www-form-urlencoded"};function u(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var s={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=n(3):"undefined"!=typeof process&&(t=n(3)),t}(),transformRequest:[function(t,e){return o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(u(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(u(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(t){s.headers[t]={}}),r.forEach(["post","put","patch"],function(t){s.headers[t]=r.merge(i)}),t.exports=s},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(0),o=n(12),i=n(14),u=n(15),s=n(16),a=n(4),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(17);t.exports=function(t){return new Promise(function(e,f){var l=t.data,p=t.headers;r.isFormData(l)&&delete p["Content-Type"];var h=new XMLHttpRequest,d="onreadystatechange",y=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||s(t.url)||(h=new window.XDomainRequest,d="onload",y=!0,h.onprogress=function(){},h.ontimeout=function(){}),t.auth){var v=t.auth.username||"",g=t.auth.password||"";p.Authorization="Basic "+c(v+":"+g)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h[d]=function(){if(h&&(4===h.readyState||y)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:n,config:t,request:h};o(e,f,r),h=null}},h.onerror=function(){f(a("Network Error",t,null,h)),h=null},h.ontimeout=function(){f(a("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(18),w=(t.withCredentials||s(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;w&&(p[t.xsrfHeaderName]=w)}if("setRequestHeader"in h&&r.forEach(p,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete p[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),f(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t,e,n,o,i){var u=new Error(t);return r(u,e,n,o,i)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){t.exports=n(8)},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(10),u=n(1);function s(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var a=s(u);a.Axios=i,a.create=function(t){return s(r.merge(u,t))},a.Cancel=n(6),a.CancelToken=n(24),a.isCancel=n(5),a.all=function(t){return Promise.all(t)},a.spread=n(25),t.exports=a,t.exports.default=a},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)} | ||
*/ | ||
t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";var r=n(1),o=n(0),i=n(19),u=n(20);function s(t){this.defaults=t,this.interceptors={request:new i,response:new i}}s.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),(t=o.merge(r,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[u,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){s.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){s.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=s},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t}},function(t,e,n){"use strict";var r=n(0);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var u=[];r.forEach(e,function(t,e){null!==t&&void 0!==t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),u.push(o(e)+"="+o(t))}))}),i=u.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,n){"use strict";var r=n(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,u={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(u[e]&&o.indexOf(e)>=0)return;u[e]="set-cookie"===e?(u[e]?u[e]:[]).concat([n]):u[e]?u[e]+", "+n:n}}),u):u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,n,i=String(t),u="",s=0,a=r;i.charAt(0|s)||(a="=",s%1);u+=a.charAt(63&e>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new o;e=e<<8|n}return u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,u){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===u&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(0);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,n){"use strict";var r=n(0),o=n(21),i=n(5),u=n(1),s=n(22),a=n(23);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!s(t.url)&&(t.url=a(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||u.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(6);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";var r,o,i,u,s;n.r(e),function(t){t.Dev="dev",t.Qa="qa",t.Staging="staging",t.Prod="prod"}(r||(r={})),function(t){t.Collection="collection",t.Postage="postage",t.Eticket="eticket",t.Evoucher="evoucher"}(o||(o={})),function(t){t.Active="active",t.Expired="expired",t.Confirmed="confirmed"}(i||(i={})),function(t){t.Show="SHW",t.Attraction="ATT",t.Flexitickets="FLX",t.GiftVoucher="GVC",t.Postage="PST"}(u||(u={})),function(t){t.USA="USA",t.UK="GBR",t.Mixed="Mixed"}(s||(s={}));var a,c,f,l,p=n(7),h=n.n(p),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){var e={baseURL:t},n=h.a.create(e);return n.interceptors.response.use(v,g),n},v=function(t){var e=t.data;return e?d({},t,{data:e.response}):t},g=function(t){var e=t.response;return e?e.data.context.errors:[]},m=((a={})[r.Dev]="https://basket.dev.aws.encoretix.co.uk/api/v1",a[r.Qa]="https://basket.qa.aws.encoretix.co.uk/api/v1",a[r.Staging]="https://basket.staging.aws.encoretix.co.uk/api/v1",a[r.Prod]="https://basket.prod.aws.encoretix.co.uk/api/v1",a),w=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},b=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},x=function(t){var e=y(m[t]);return{upsertBasket:function(t){return w(void 0,void 0,void 0,function(){return b(this,function(n){switch(n.label){case 0:return[4,e.patch("/baskets",t)];case 1:return[2,n.sent().data]}})})},getBasket:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t,[4,e.get(n)];case 1:return[2,r.sent().data]}})})},getDeliveries:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t+"/deliveryOptions",[4,e.get(n)];case 1:return[2,r.sent().data]}})})}}};!function(t){t.Products="products"}(c||(c={})),function(t){t.Square="square",t.Landscape="landscape",t.Portrait="portrait",t.Default="default"}(f||(f={}));var k,S,P,C,A,D=((l={})[r.Dev]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.devtixuk.com/images"},l[r.Qa]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.qatixuk.com/images"},l[r.Staging]={api:"https://content-service.stagetixuk.io/api/v1",images:"https://content-service.stagetixuk.com/images"},l[r.Prod]={api:"https://content-service.tixuk.io/api/v1",images:"https://content-service.tixuk.com/images"},l),T=((k={})[f.Default]=[{screenSize:"xxl",imageSize:80},{screenSize:"xl",imageSize:64},{screenSize:"lg",imageSize:48},{screenSize:"md",imageSize:64},{screenSize:"sm",imageSize:64}],k),B=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},E=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},j=function(t){var e=D[t],n=y(e.api);return{getProduct:function(t){return B(void 0,void 0,void 0,function(){var e;return E(this,function(r){switch(r.label){case 0:return e="/products/"+t,[4,n.get(e)];case 1:return[2,r.sent().data]}})})},getImages:function(t,n,r){return void 0===r&&(r=f.Default),T[r].map(function(o){var i=o.screenSize,u=o.imageSize;return{screenSize:i,url:e.images+"/"+t+"/"+n+"/"+r+"?width="+u}})}}},R=function(){function t(t){var e=t.name,n=t.showType,r=t.venue,o=t.id,i=t.showFaceValue;this.name=e,this.type=n,this.venue=r,this.id=o,this.showFaceValue=i}return t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.getVenue=function(){return this.venue},t.prototype.needShowFaceValue=function(){return this.showFaceValue},t}(),I=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},O=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},N=function(t){var e=j(t),n=e.getImages,r=e.getProduct;return{getProduct:function(t){return I(void 0,void 0,void 0,function(){var e;return O(this,function(n){switch(n.label){case 0:return[4,r(t)];case 1:return e=n.sent(),[2,new R(e)]}})})},getImages:n}},q={setEnvironment:function(t){S=t},getRepository:function(){if(!S)return null;var t=N(S),e=J(S);return{getShowDetails:t.getProduct,getImages:t.getImages,getDeliveries:e.getDeliveries}}},U=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},F=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},L=function(){function t(t){this.repository=q.getRepository();var e=t.id,n=t.quantity,r=t.productId,o=t.productName,i=t.productType,u=t.faceValue,s=t.salePrice,a=t.originalSalePrice,c=t.adjustedAmount,f=t.date,l=t.items,p=t.venueId;this.id=e,this.quantity=n,this.productId=r,this.productName=o,this.productType=i,this.faceValue=u,this.salePrice=s,this.originalSalePrice=a,this.adjustedAmount=c,this.date=new Date(f),this.seats=l,this.venueId=p}return t.prototype.getId=function(){return this.id},t.prototype.getQuantity=function(){return this.quantity},t.prototype.getProductId=function(){return this.productId},t.prototype.getProductName=function(){return this.productName},t.prototype.isVoucher=function(){return this.productType===u.GiftVoucher},t.prototype.isPostage=function(){return this.productType===u.Postage},t.prototype.isFlexiticket=function(){return this.productType===u.Flexitickets},t.prototype.isShow=function(){return this.productType===u.Show},t.prototype.isAttraction=function(){return this.productType===u.Attraction},t.prototype.getProductType=function(){return this.productType},t.prototype.getFaceValue=function(){return this.faceValue},t.prototype.getSalePrice=function(){return this.salePrice},t.prototype.getOriginalSalePrice=function(){return this.originalSalePrice},t.prototype.getAdjustedAmount=function(){return this.adjustedAmount},t.prototype.getFaceValueAmount=function(){return this.faceValue.value},t.prototype.getSalePriceAmount=function(){return this.salePrice.value},t.prototype.getOriginalSalePriceAmount=function(){return this.originalSalePrice.value},t.prototype.hasDiscount=function(){return this.getFaceValueAmount()>this.getOriginalSalePriceAmount()},t.prototype.getPromotionDiscount=function(){return this.adjustedAmount.value},t.prototype.hasPromotionDiscount=function(){return!!this.getPromotionDiscount()},t.prototype.getDiscount=function(){return this.hasDiscount()?this.quantity*(this.getFaceValueAmount()-this.getOriginalSalePriceAmount()):0},t.prototype.getTotalPrice=function(){return this.quantity*this.getSalePriceAmount()},t.prototype.getPriceBeforeDiscount=function(){return this.quantity*this.getFaceValueAmount()},t.prototype.getDate=function(){return this.date},t.prototype.getSeats=function(){return this.seats},t.prototype.getProductDetails=function(){return U(this,void 0,void 0,function(){return F(this,function(t){return this.isTicket()?(this.productDetails||(this.productDetails=this.repository.getShowDetails(this.getProductId())),[2,this.productDetails]):[2,null]})})},t.prototype.getImages=function(){return this.repository.getImages(c.Products,this.getProductId())},t.prototype.getVenueId=function(){return this.venueId},t.prototype.isTicket=function(){return!this.isFlexiticket()&&!this.isPostage()},t.prototype.isUkShow=function(){return U(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})},t.prototype.isUsaShow=function(){return U(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})},t.prototype.getCountryCode=function(){return U(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:return[4,this.getProductDetails()];case 1:return[2,t.sent().getVenue().address.country.isoCode]}})})},t}(),V=function(){return(V=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=function(){function t(t){this.items=[],this.items=t.map(function(t,e){return new L(V({},t,{id:(e+1).toString()}))})}return t.prototype.getItems=function(){return this.items.slice()},t.prototype.hasVoucher=function(){return this.items.some(function(t){return t.isVoucher()})},t.prototype.hasPostage=function(){return this.items.some(function(t){return t.isPostage()})},t.prototype.hasFlexiticket=function(){return this.items.some(function(t){return t.isFlexiticket()})},t.prototype.hasShow=function(){return this.items.some(function(t){return t.isShow()})},t.prototype.hasAttraction=function(){return this.items.some(function(t){return t.isAttraction()})},t.prototype.getLength=function(){return this.items.length},t.prototype.getAttractions=function(){return this.items.filter(function(t){return t.isAttraction()})},t.prototype.getFlexitickets=function(){return this.items.filter(function(t){return t.isFlexiticket()})},t.prototype.getPostage=function(){return this.items.find(function(t){return t.isPostage()})},t.prototype.getTickets=function(){return this.items.filter(function(t){return t.isTicket()})},t}(),_=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},G=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},M=function(){function t(t){this.repository=q.getRepository(),this.basketData=t;var e=t.reservations,n=t.expiredAt,r=t.status,o=t.reference;this.itemsCollection=new z(e),this.expiredAt=new Date(n),this.status=r,this.reference=o}return t.prototype.getExpiredDate=function(){return this.expiredAt},t.prototype.isExpired=function(){return this.status===i.Expired||this.expiredAt<new Date},t.prototype.isPaid=function(){return this.status===i.Confirmed},t.prototype.getReference=function(){return this.reference},t.prototype.getItemsCollection=function(){return this.itemsCollection},t.prototype.setDeliveries=function(t){this.deliveries=t},t.prototype.getDeliveries=function(){return _(this,void 0,void 0,function(){return G(this,function(t){return this.deliveries||(this.deliveries=this.repository.getDeliveries(this.getReference(),this.getItemsCollection())),[2,this.deliveries]})})},t.prototype.isEmpty=function(){return!this.itemsCollection.getLength()},t.prototype.getTotalPrice=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getTotalPrice()})},t.prototype.getTotalDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getDiscount()})},t.prototype.getTotalPromotionDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPromotionDiscount()})},t.prototype.getTotalPriceBeforeDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPriceBeforeDiscount()})},t.prototype.hasDiscount=function(){return this.itemsCollection.getItems().some(function(t){return t.hasDiscount()})},t.prototype.getBasketData=function(){return this.basketData},t.prototype.getUKShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})})},t.prototype.getUSAShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})})},t.prototype.isMixedBasket=function(){return _(this,void 0,void 0,function(){var t;return G(this,function(e){switch(e.label){case 0:return[4,this.getCountyCodes()];case 1:return[2,!(t=e.sent()).every(function(e){return e===t[0]})]}})})},t.prototype.getAppliedPromotion=function(){return this.basketData.appliedPromotion},t.prototype.hasAppliedPromotion=function(){return!!this.getAppliedPromotion()},t.prototype.getPromotionCode=function(){return this.basketData.coupon.code},t.prototype.getCountyCodes=function(){return _(this,void 0,void 0,function(){var t,e=this;return G(this,function(n){return t=this.itemsCollection.getItems().map(function(t){return _(e,void 0,void 0,function(){return G(this,function(e){return t.isFlexiticket()||t.isVoucher()?[2,s.UK]:[2,t.getCountryCode()]})})}),[2,Promise.all(t)]})})},t.prototype.reduceBasketItemsAmount=function(t){return this.itemsCollection.getItems().reduce(t,0)},t}(),H=((P={})[o.Collection]={name:"Collect at the Box Office",voucherName:"Free postal delivery",attractionName:"Print at home voucher"},P[o.Postage]={name:"By Post – UK Addresses only"},P[o.Eticket]={name:"Print at Home"},P),K=function(){function t(t,e){var n=t.method,r=t.charge;this.amount=r,this.method=n,this.setName(e)}return t.prototype.getAmount=function(){return this.amount},t.prototype.getMethod=function(){return this.method},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){this.name=this.method===o.Collection?this.getCollectionDeliveryName(t):H[this.method].name},t.prototype.getCollectionDeliveryName=function(t){var e=H[o.Collection];return t.hasVoucher()?e.voucherName:t.hasAttraction()?e.attractionName:e.name},t}(),X=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},Q=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},J=function(t){var e=x(t);q.setEnvironment(t);return{getBasket:function(t){return X(void 0,void 0,void 0,function(){var n;return Q(this,function(r){switch(r.label){case 0:return[4,e.getBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},getDeliveries:function(t,n){return X(void 0,void 0,void 0,function(){return Q(this,function(r){switch(r.label){case 0:return[4,e.getDeliveries(t)];case 1:return[2,r.sent().map(function(t){return new K(t,n)})]}})})},createBasket:function(t){return X(void 0,void 0,void 0,function(){var n;return Q(this,function(r){switch(r.label){case 0:return[4,e.upsertBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},addItems:function(t,n){return X(void 0,void 0,void 0,function(){var r,o;return Q(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations=r.reservations.concat(n),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},removeItem:function(t,n){return X(void 0,void 0,void 0,function(){var r,o;return Q(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations.splice(n,1),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},addPromoCode:function(t,n){return X(void 0,void 0,void 0,function(){var r,o;return Q(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).coupon={code:n},[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},removePromoCode:function(t){return X(void 0,void 0,void 0,function(){var n,r;return Q(this,function(o){switch(o.label){case 0:return(n=t.getBasketData()).coupon=null,[4,e.upsertBasket(n)];case 1:return r=o.sent(),[2,new M(r)]}})})}}};!function(t){t.Negative="negative",t.Positive="positive",t.Neutral="neutral"}(C||(C={}));var $=((A={})[r.Dev]="https://venue-service.devtixuk.io/api/vLatest",A[r.Qa]="https://venue-service.qatixuk.io/api/vLatest",A[r.Staging]="https://venue-service.stagetixuk.io/api/api/vLatest",A[r.Prod]="https://venue-service.tixuk.io/api/vLatest",A),W=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},Y=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Z=function(t){var e=y($[t]);return{getSeatAttributes:function(t){return W(void 0,void 0,void 0,function(){return Y(this,function(n){switch(n.label){case 0:return[4,e.get("/venues/"+t+"/seats/attributes")];case 1:return[2,n.sent().data]}})})}}},tt=function(){function t(t){this.seats=t}return t.prototype.getSeats=function(){return this.seats},t.prototype.getBlockName=function(){var t=this.seats[0];return t?t.area:""},t}(),et=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},nt=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},rt=function(t){var e=Z(t);return{getSeats:function(t){return et(void 0,void 0,void 0,function(){var n;return nt(this,function(r){switch(r.label){case 0:return[4,e.getSeatAttributes(t)];case 1:return n=r.sent(),[2,new tt(n)]}})})}}};n.d(e,"Environment",function(){return r}),n.d(e,"getBasketApi",function(){return x}),n.d(e,"getBasketRepository",function(){return J}),n.d(e,"DeliveryMethod",function(){return o}),n.d(e,"BasketStatus",function(){return i}),n.d(e,"ProductType",function(){return u}),n.d(e,"BasketLocationType",function(){return s}),n.d(e,"Basket",function(){return M}),n.d(e,"Delivery",function(){return K}),n.d(e,"BasketItemsCollection",function(){return z}),n.d(e,"BasketItem",function(){return L}),n.d(e,"getContentServiceRepository",function(){return N}),n.d(e,"getContentServiceApi",function(){return j}),n.d(e,"Product",function(){return R}),n.d(e,"EntityType",function(){return c}),n.d(e,"ImageOrientation",function(){return f}),n.d(e,"getVenueApi",function(){return Z}),n.d(e,"getVenueRepository",function(){return rt}),n.d(e,"SeatsCollection",function(){return tt})}])}); | ||
t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";var r=n(1),o=n(0),i=n(19),u=n(20);function s(t){this.defaults=t,this.interceptors={request:new i,response:new i}}s.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),(t=o.merge(r,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[u,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){s.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){s.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=s},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t}},function(t,e,n){"use strict";var r=n(0);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var u=[];r.forEach(e,function(t,e){null!==t&&void 0!==t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),u.push(o(e)+"="+o(t))}))}),i=u.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,n){"use strict";var r=n(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,u={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(u[e]&&o.indexOf(e)>=0)return;u[e]="set-cookie"===e?(u[e]?u[e]:[]).concat([n]):u[e]?u[e]+", "+n:n}}),u):u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,n,i=String(t),u="",s=0,a=r;i.charAt(0|s)||(a="=",s%1);u+=a.charAt(63&e>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new o;e=e<<8|n}return u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,u){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===u&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(0);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,n){"use strict";var r=n(0),o=n(21),i=n(5),u=n(1),s=n(22),a=n(23);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!s(t.url)&&(t.url=a(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||u.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(6);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";var r,o,i,u,s;n.r(e),function(t){t.Dev="dev",t.Qa="qa",t.Staging="staging",t.Prod="prod"}(r||(r={})),function(t){t.Collection="collection",t.Postage="postage",t.Eticket="eticket",t.Evoucher="evoucher"}(o||(o={})),function(t){t.Active="active",t.Expired="expired",t.Confirmed="confirmed"}(i||(i={})),function(t){t.Show="SHW",t.Attraction="ATT",t.Flexitickets="FLX",t.GiftVoucher="GVC",t.Postage="PST"}(u||(u={})),function(t){t.USA="USA",t.UK="GBR",t.Mixed="Mixed"}(s||(s={}));var a,c,f,l,p=n(7),h=n.n(p),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){var e={baseURL:t},n=h.a.create(e);return n.interceptors.response.use(v,g),n},v=function(t){var e=t.data;return e?d({},t,{data:e.response}):t},g=function(t){var e=t.response;return e?e.data.context.errors:[]},m=((a={})[r.Dev]="https://basket.dev.aws.encoretix.co.uk/api/v1",a[r.Qa]="https://basket.qa.aws.encoretix.co.uk/api/v1",a[r.Staging]="https://basket.staging.aws.encoretix.co.uk/api/v1",a[r.Prod]="https://basket.prod.aws.encoretix.co.uk/api/v1",a),w=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},b=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},x=function(t){var e=y(m[t]);return{upsertBasket:function(t){return w(void 0,void 0,void 0,function(){return b(this,function(n){switch(n.label){case 0:return[4,e.patch("/baskets",t)];case 1:return[2,n.sent().data]}})})},getBasket:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t,[4,e.get(n)];case 1:return[2,r.sent().data]}})})},getDeliveries:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t+"/deliveryOptions",[4,e.get(n)];case 1:return[2,r.sent().data]}})})}}};!function(t){t.Products="products"}(c||(c={})),function(t){t.Square="square",t.Landscape="landscape",t.Portrait="portrait",t.Default="default"}(f||(f={}));var k,S,P,A,C,D=((l={})[r.Dev]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.devtixuk.com/images"},l[r.Qa]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.qatixuk.com/images"},l[r.Staging]={api:"https://content-service.stagetixuk.io/api/v1",images:"https://content-service.stagetixuk.com/images"},l[r.Prod]={api:"https://content-service.tixuk.io/api/v1",images:"https://content-service.tixuk.com/images"},l),T=((k={})[f.Default]=[{screenSize:"xxl",imageSize:80},{screenSize:"xl",imageSize:64},{screenSize:"lg",imageSize:48},{screenSize:"md",imageSize:64},{screenSize:"sm",imageSize:64}],k),B=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},E=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},j=function(t){var e=D[t],n=y(e.api);return{getProduct:function(t){return B(void 0,void 0,void 0,function(){var e;return E(this,function(r){switch(r.label){case 0:return e="/products/"+t,[4,n.get(e)];case 1:return[2,r.sent().data]}})})},getImages:function(t,n,r){return void 0===r&&(r=f.Default),T[r].map(function(o){var i=o.screenSize,u=o.imageSize;return{screenSize:i,url:e.images+"/"+t+"/"+n+"/"+r+"?width="+u}})}}},R=function(){function t(t){var e=t.name,n=t.showType,r=t.venue,o=t.id,i=t.showFaceValue;this.name=e,this.type=n,this.venue=r,this.id=o,this.showFaceValue=i}return t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.getVenue=function(){return this.venue},t.prototype.needShowFaceValue=function(){return this.showFaceValue},t}(),I=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},O=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},N=function(t){var e=j(t),n=e.getImages,r=e.getProduct;return{getProduct:function(t){return I(void 0,void 0,void 0,function(){var e;return O(this,function(n){switch(n.label){case 0:return[4,r(t)];case 1:return e=n.sent(),[2,new R(e)]}})})},getImages:n}},q={setEnvironment:function(t){S=t},getRepository:function(){if(!S)return null;var t=N(S),e=J(S);return{getShowDetails:t.getProduct,getImages:t.getImages,getDeliveries:e.getDeliveries}}},U=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},F=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},L=function(){function t(t){this.repository=q.getRepository();var e=t.id,n=t.quantity,r=t.productId,o=t.productName,i=t.productType,u=t.faceValue,s=t.salePrice,a=t.originalSalePrice,c=t.adjustedAmount,f=t.date,l=t.items,p=t.venueId;this.id=e,this.quantity=n,this.productId=r,this.productName=o,this.productType=i,this.faceValue=u,this.salePrice=s,this.originalSalePrice=a,this.adjustedAmount=c,this.date=new Date(f),this.seats=l,this.venueId=p}return t.prototype.getId=function(){return this.id},t.prototype.getQuantity=function(){return this.quantity},t.prototype.getProductId=function(){return this.productId},t.prototype.getProductName=function(){return this.productName},t.prototype.isVoucher=function(){return this.productType===u.GiftVoucher},t.prototype.isPostage=function(){return this.productType===u.Postage},t.prototype.isFlexiticket=function(){return this.productType===u.Flexitickets},t.prototype.isShow=function(){return this.productType===u.Show},t.prototype.isAttraction=function(){return this.productType===u.Attraction},t.prototype.getProductType=function(){return this.productType},t.prototype.getFaceValue=function(){return this.faceValue},t.prototype.getSalePrice=function(){return this.salePrice},t.prototype.getOriginalSalePrice=function(){return this.originalSalePrice},t.prototype.getAdjustedAmount=function(){return this.adjustedAmount},t.prototype.getFaceValueAmount=function(){return this.faceValue.value},t.prototype.getSalePriceAmount=function(){return this.salePrice.value},t.prototype.getOriginalSalePriceAmount=function(){return this.originalSalePrice.value},t.prototype.hasDiscount=function(){return this.getFaceValueAmount()>this.getOriginalSalePriceAmount()},t.prototype.getPromotionDiscount=function(){return this.adjustedAmount.value},t.prototype.hasPromotionDiscount=function(){return!!this.getPromotionDiscount()},t.prototype.getDiscount=function(){return this.hasDiscount()?this.quantity*(this.getFaceValueAmount()-this.getOriginalSalePriceAmount()):0},t.prototype.getTotalPrice=function(){return this.quantity*this.getSalePriceAmount()},t.prototype.getPriceBeforeDiscount=function(){return this.quantity*this.getFaceValueAmount()},t.prototype.getDate=function(){return this.date},t.prototype.getSeats=function(){return this.seats},t.prototype.getProductDetails=function(){return U(this,void 0,void 0,function(){return F(this,function(t){return this.isTicket()?(this.productDetails||(this.productDetails=this.repository.getShowDetails(this.getProductId())),[2,this.productDetails]):[2,null]})})},t.prototype.getImages=function(){return this.repository.getImages(c.Products,this.getProductId())},t.prototype.getVenueId=function(){return this.venueId},t.prototype.isTicket=function(){return!this.isFlexiticket()&&!this.isPostage()},t.prototype.isUKShow=function(){return U(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})},t.prototype.isUSAShow=function(){return U(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})},t.prototype.getCountryCode=function(){return U(this,void 0,void 0,function(){var t;return F(this,function(e){switch(e.label){case 0:return[4,this.getProductDetails()];case 1:return[2,(t=e.sent())?t.getVenue().address.country.isoCode:""]}})})},t}(),V=function(){return(V=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=function(){function t(t){this.items=[],this.items=t.map(function(t,e){return new L(V({},t,{id:(e+1).toString()}))})}return t.prototype.getItems=function(){return this.items.slice()},t.prototype.hasVoucher=function(){return this.items.some(function(t){return t.isVoucher()})},t.prototype.hasPostage=function(){return this.items.some(function(t){return t.isPostage()})},t.prototype.hasFlexiticket=function(){return this.items.some(function(t){return t.isFlexiticket()})},t.prototype.hasShow=function(){return this.items.some(function(t){return t.isShow()})},t.prototype.hasAttraction=function(){return this.items.some(function(t){return t.isAttraction()})},t.prototype.getLength=function(){return this.items.length},t.prototype.getAttractions=function(){return this.items.filter(function(t){return t.isAttraction()})},t.prototype.getFlexitickets=function(){return this.items.filter(function(t){return t.isFlexiticket()})},t.prototype.getPostage=function(){return this.items.find(function(t){return t.isPostage()})},t.prototype.getTickets=function(){return this.items.filter(function(t){return t.isTicket()})},t}(),_=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},G=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},M=function(){function t(t){this.repository=q.getRepository(),this.basketData=t;var e=t.reservations,n=t.expiredAt,r=t.status,o=t.reference;this.itemsCollection=new z(e),this.expiredAt=new Date(n),this.status=r,this.reference=o}return t.prototype.getExpiredDate=function(){return this.expiredAt},t.prototype.isExpired=function(){return this.status===i.Expired||this.expiredAt<new Date},t.prototype.isPaid=function(){return this.status===i.Confirmed},t.prototype.getReference=function(){return this.reference},t.prototype.getItemsCollection=function(){return this.itemsCollection},t.prototype.setDeliveries=function(t){this.deliveries=t},t.prototype.getDeliveries=function(){return _(this,void 0,void 0,function(){return G(this,function(t){return this.deliveries||(this.deliveries=this.repository.getDeliveries(this.getReference(),this.getItemsCollection())),[2,this.deliveries]})})},t.prototype.isEmpty=function(){return!this.itemsCollection.getLength()},t.prototype.getTotalPrice=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getTotalPrice()})},t.prototype.getTotalDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getDiscount()})},t.prototype.getTotalPromotionDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPromotionDiscount()})},t.prototype.getTotalPriceBeforeDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPriceBeforeDiscount()})},t.prototype.hasDiscount=function(){return this.itemsCollection.getItems().some(function(t){return t.hasDiscount()})},t.prototype.getBasketData=function(){return this.basketData},t.prototype.getUKShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})})},t.prototype.getUSAShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})})},t.prototype.isMixedBasket=function(){return _(this,void 0,void 0,function(){var t;return G(this,function(e){switch(e.label){case 0:return[4,this.getCountyCodes()];case 1:return[2,!(t=e.sent()).every(function(e){return e===t[0]})]}})})},t.prototype.getAppliedPromotion=function(){return this.basketData.appliedPromotion},t.prototype.hasAppliedPromotion=function(){return!!this.getAppliedPromotion()},t.prototype.getPromotionCode=function(){return this.basketData.coupon.code},t.prototype.getCountyCodes=function(){return _(this,void 0,void 0,function(){var t,e=this;return G(this,function(n){return t=this.itemsCollection.getItems().map(function(t){return _(e,void 0,void 0,function(){return G(this,function(e){return t.isFlexiticket()||t.isVoucher()?[2,s.UK]:[2,t.getCountryCode()]})})}),[2,Promise.all(t)]})})},t.prototype.reduceBasketItemsAmount=function(t){return this.itemsCollection.getItems().reduce(t,0)},t}(),H=((P={})[o.Collection]={name:"Collect at the Box Office",voucherName:"Free postal delivery",attractionName:"Print at home voucher"},P[o.Postage]={name:"By Post – UK Addresses only"},P[o.Eticket]={name:"Print at Home"},P),K=function(){function t(t,e){var n=t.method,r=t.charge;this.amount=r,this.method=n,this.setName(e)}return t.prototype.getAmount=function(){return this.amount},t.prototype.getMethod=function(){return this.method},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){this.name=this.method===o.Collection?this.getCollectionDeliveryName(t):H[this.method].name},t.prototype.getCollectionDeliveryName=function(t){var e=H[o.Collection];return t.hasVoucher()?e.voucherName:t.hasAttraction()?e.attractionName:e.name},t}(),X=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},Q=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},J=function(t){var e=x(t);q.setEnvironment(t);return{getBasket:function(t){return X(void 0,void 0,void 0,function(){var n;return Q(this,function(r){switch(r.label){case 0:return[4,e.getBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},getDeliveries:function(t,n){return X(void 0,void 0,void 0,function(){return Q(this,function(r){switch(r.label){case 0:return[4,e.getDeliveries(t)];case 1:return[2,r.sent().map(function(t){return new K(t,n)})]}})})},createBasket:function(t){return X(void 0,void 0,void 0,function(){var n;return Q(this,function(r){switch(r.label){case 0:return[4,e.upsertBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},addItems:function(t,n){return X(void 0,void 0,void 0,function(){var r,o;return Q(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations=r.reservations.concat(n),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},removeItem:function(t,n){return X(void 0,void 0,void 0,function(){var r,o;return Q(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations.splice(n,1),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},addPromoCode:function(t,n){return X(void 0,void 0,void 0,function(){var r,o;return Q(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).coupon={code:n},[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},removePromoCode:function(t){return X(void 0,void 0,void 0,function(){var n,r;return Q(this,function(o){switch(o.label){case 0:return(n=t.getBasketData()).coupon=null,[4,e.upsertBasket(n)];case 1:return r=o.sent(),[2,new M(r)]}})})}}};!function(t){t.Negative="negative",t.Positive="positive",t.Neutral="neutral"}(A||(A={}));var $=((C={})[r.Dev]="https://venue-service.devtixuk.io/api/vLatest",C[r.Qa]="https://venue-service.qatixuk.io/api/vLatest",C[r.Staging]="https://venue-service.stagetixuk.io/api/api/vLatest",C[r.Prod]="https://venue-service.tixuk.io/api/vLatest",C),W=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},Y=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Z=function(t){var e=y($[t]);return{getSeatAttributes:function(t){return W(void 0,void 0,void 0,function(){return Y(this,function(n){switch(n.label){case 0:return[4,e.get("/venues/"+t+"/seats/attributes")];case 1:return[2,n.sent().data]}})})}}},tt=function(){function t(t){this.seats=t}return t.prototype.getSeats=function(){return this.seats},t.prototype.getBlockName=function(){var t=this.seats[0];return t?t.area:""},t}(),et=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},nt=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},rt=function(t){var e=Z(t);return{getSeats:function(t){return et(void 0,void 0,void 0,function(){var n;return nt(this,function(r){switch(r.label){case 0:return[4,e.getSeatAttributes(t)];case 1:return n=r.sent(),[2,new tt(n)]}})})}}};n.d(e,"Environment",function(){return r}),n.d(e,"getBasketApi",function(){return x}),n.d(e,"getBasketRepository",function(){return J}),n.d(e,"DeliveryMethod",function(){return o}),n.d(e,"BasketStatus",function(){return i}),n.d(e,"ProductType",function(){return u}),n.d(e,"BasketLocationType",function(){return s}),n.d(e,"Basket",function(){return M}),n.d(e,"Delivery",function(){return K}),n.d(e,"BasketItemsCollection",function(){return z}),n.d(e,"BasketItem",function(){return L}),n.d(e,"getContentServiceRepository",function(){return N}),n.d(e,"getContentServiceApi",function(){return j}),n.d(e,"Product",function(){return R}),n.d(e,"EntityType",function(){return c}),n.d(e,"ImageOrientation",function(){return f}),n.d(e,"getVenueApi",function(){return Z}),n.d(e,"getVenueRepository",function(){return rt}),n.d(e,"SeatsCollection",function(){return tt})}])}); |
{ | ||
"name": "encore-api-services", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
56674