Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

encore-api-services

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encore-api-services - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

dist/typings/index.d.ts

1

dist/basket/index.d.ts

@@ -0,1 +1,2 @@

import './typings';
export { getBasket, getDeliveries } from './services';

@@ -14,2 +14,3 @@ import { BasketItemData, ProductType, Seat } from '../typings';

private readonly seats;
private readonly venueId;
private product;

@@ -39,2 +40,3 @@ constructor(basketItemData: BasketItemData);

getImages(): any;
getVenueId(): string;
}

@@ -0,1 +1,2 @@

import './typings';
export { getProduct, getImages } from './services';

@@ -0,1 +1,2 @@

import './typings';
export * from './basket';

2

dist/index.js

@@ -8,2 +8,2 @@ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="//",n(n.s="./src/index.ts")}({"./node_modules/axios/index.js":function(e,t,n){e.exports=n("./node_modules/axios/lib/axios.js")},"./node_modules/axios/lib/adapters/xhr.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js"),o=n("./node_modules/axios/lib/core/settle.js"),i=n("./node_modules/axios/lib/helpers/buildURL.js"),s=n("./node_modules/axios/lib/helpers/parseHeaders.js"),u=n("./node_modules/axios/lib/helpers/isURLSameOrigin.js"),a=n("./node_modules/axios/lib/core/createError.js"),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n("./node_modules/axios/lib/helpers/btoa.js");e.exports=function(e){return new Promise(function(t,l){var f=e.data,p=e.headers;r.isFormData(f)&&delete p["Content-Type"];var d=new XMLHttpRequest,h="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in d||u(e.url)||(d=new window.XDomainRequest,h="onload",m=!0,d.onprogress=function(){},d.ontimeout=function(){}),e.auth){var y=e.auth.username||"",b=e.auth.password||"";p.Authorization="Basic "+c(y+":"+b)}if(d.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d[h]=function(){if(d&&(4===d.readyState||m)&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?s(d.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:n,config:e,request:d};o(t,l,r),d=null}},d.onerror=function(){l(a("Network Error",e,null,d)),d=null},d.ontimeout=function(){l(a("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var x=n("./node_modules/axios/lib/helpers/cookies.js"),v=(e.withCredentials||u(e.url))&&e.xsrfCookieName?x.read(e.xsrfCookieName):void 0;v&&(p[e.xsrfHeaderName]=v)}if("setRequestHeader"in d&&r.forEach(p,function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete p[t]:d.setRequestHeader(t,e)}),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){d&&(d.abort(),l(e),d=null)}),void 0===f&&(f=null),d.send(f)})}},"./node_modules/axios/lib/axios.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js"),o=n("./node_modules/axios/lib/helpers/bind.js"),i=n("./node_modules/axios/lib/core/Axios.js"),s=n("./node_modules/axios/lib/defaults.js");function u(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var a=u(s);a.Axios=i,a.create=function(e){return u(r.merge(s,e))},a.Cancel=n("./node_modules/axios/lib/cancel/Cancel.js"),a.CancelToken=n("./node_modules/axios/lib/cancel/CancelToken.js"),a.isCancel=n("./node_modules/axios/lib/cancel/isCancel.js"),a.all=function(e){return Promise.all(e)},a.spread=n("./node_modules/axios/lib/helpers/spread.js"),e.exports=a,e.exports.default=a},"./node_modules/axios/lib/cancel/Cancel.js":function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},"./node_modules/axios/lib/cancel/CancelToken.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/cancel/Cancel.js");function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new r(e),t(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},"./node_modules/axios/lib/cancel/isCancel.js":function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},"./node_modules/axios/lib/core/Axios.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/defaults.js"),o=n("./node_modules/axios/lib/utils.js"),i=n("./node_modules/axios/lib/core/InterceptorManager.js"),s=n("./node_modules/axios/lib/core/dispatchRequest.js");function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e){"string"==typeof e&&(e=o.merge({url:arguments[0]},arguments[1])),(e=o.merge(r,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[s,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},o.forEach(["delete","get","head","options"],function(e){u.prototype[e]=function(t,n){return this.request(o.merge(n||{},{method:e,url:t}))}}),o.forEach(["post","put","patch"],function(e){u.prototype[e]=function(t,n,r){return this.request(o.merge(r||{},{method:e,url:t,data:n}))}}),e.exports=u},"./node_modules/axios/lib/core/InterceptorManager.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js");function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},"./node_modules/axios/lib/core/createError.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/core/enhanceError.js");e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},"./node_modules/axios/lib/core/dispatchRequest.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js"),o=n("./node_modules/axios/lib/core/transformData.js"),i=n("./node_modules/axios/lib/cancel/isCancel.js"),s=n("./node_modules/axios/lib/defaults.js"),u=n("./node_modules/axios/lib/helpers/isAbsoluteURL.js"),a=n("./node_modules/axios/lib/helpers/combineURLs.js");function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!u(e.url)&&(e.url=a(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||s.adapter)(e).then(function(t){return c(e),t.data=o(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},"./node_modules/axios/lib/core/enhanceError.js":function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e}},"./node_modules/axios/lib/core/settle.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/core/createError.js");e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},"./node_modules/axios/lib/core/transformData.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js");e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},"./node_modules/axios/lib/defaults.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js"),o=n("./node_modules/axios/lib/helpers/normalizeHeaderName.js"),i={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u={adapter:function(){var e;return"undefined"!=typeof XMLHttpRequest?e=n("./node_modules/axios/lib/adapters/xhr.js"):"undefined"!=typeof process&&(e=n("./node_modules/axios/lib/adapters/xhr.js")),e}(),transformRequest:[function(e,t){return o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){u.headers[e]={}}),r.forEach(["post","put","patch"],function(e){u.headers[e]=r.merge(i)}),e.exports=u},"./node_modules/axios/lib/helpers/bind.js":function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},"./node_modules/axios/lib/helpers/btoa.js":function(e,t,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",e.exports=function(e){for(var t,n,i=String(e),s="",u=0,a=r;i.charAt(0|u)||(a="=",u%1);s+=a.charAt(63&t>>8-u%1*8)){if((n=i.charCodeAt(u+=.75))>255)throw new o;t=t<<8|n}return s}},"./node_modules/axios/lib/helpers/buildURL.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js");function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,function(e,t){null!==e&&void 0!==e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))}))}),i=s.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},"./node_modules/axios/lib/helpers/combineURLs.js":function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},"./node_modules/axios/lib/helpers/cookies.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js");e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===s&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},"./node_modules/axios/lib/helpers/isAbsoluteURL.js":function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},"./node_modules/axios/lib/helpers/isURLSameOrigin.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js");e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(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 e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},"./node_modules/axios/lib/helpers/normalizeHeaderName.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js");e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},"./node_modules/axios/lib/helpers/parseHeaders.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/utils.js"),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"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}}),s):s}},"./node_modules/axios/lib/helpers/spread.js":function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"./node_modules/axios/lib/utils.js":function(e,t,n){"use strict";var r=n("./node_modules/axios/lib/helpers/bind.js"),o=n("./node_modules/is-buffer/index.js"),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function u(e){return null!==e&&"object"==typeof e}function a(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!==e&&void 0!==e)if("object"!=typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:o,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:a,isStream:function(e){return u(e)&&a(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},"./node_modules/is-buffer/index.js":function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}

*/
e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},"./src/index.ts":function(e,t,n){"use strict";n.r(t);var r,o,i,s=n("./node_modules/axios/index.js"),u=n.n(s),a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},c=function(e){var t={baseURL:e},n=u.a.create(t);return n.interceptors.response.use(l,f),n},l=function(e){var t=e.data;return t?a({},e,{data:t.response}):e},f=function(e){var t=e.response;return t?t.data.context.errors:[]},p=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},d=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},h=c("https://basket.dev.aws.encoretix.co.uk/api/v1"),m=function(e){return p(void 0,void 0,void 0,function(){var t;return d(this,function(n){switch(n.label){case 0:return t="/baskets/"+e,[4,h.get(t)];case 1:return[2,n.sent().data]}})})},y=function(e){return p(void 0,void 0,void 0,function(){var t;return d(this,function(n){switch(n.label){case 0:return t="/baskets/"+e+"/deliveries",[4,h.get(t)];case 1:return[2,n.sent().data]}})})};!function(e){e.Collection="collection",e.Postage="postage",e.Eticket="eticket"}(r||(r={})),function(e){e.Active="active",e.Expired="expired",e.Confirmed="confirmed"}(o||(o={})),function(e){e.Show="SHW",e.Attraction="ATT",e.Flexitickets="FLX",e.GiftVoucher="GVC",e.Postage="PST"}(i||(i={}));var b,x,v,g=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},w=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},j=c("https://content.dev.aws.encoretix.co.uk/api/v1"),_=function(e){return g(void 0,void 0,void 0,function(){var t;return w(this,function(n){switch(n.label){case 0:return t="/products/"+e,[4,j.get(t)];case 1:return[2,n.sent().data]}})})},S=function(){function e(e){var t=e.name,n=e.showType,r=e.venue,o=e.id;this.name=t,this.type=n,this.venue=r,this.id=o}return e.prototype.getName=function(){return this.name},e.prototype.getType=function(){return this.type},e.prototype.getVenue=function(){return this.venue},e}(),k=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},P=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};!function(e){e.Products="products"}(b||(b={})),function(e){e.Square="square",e.Landscape="landscape",e.Portrait="portrait",e.Default="default"}(x||(x={}));var A,C=((v={})[x.Default]=[{screenSize:"xxl",imageSize:80},{screenSize:"xl",imageSize:64},{screenSize:"lg",imageSize:48},{screenSize:"md",imageSize:64},{screenSize:"sm",imageSize:64}],v),E=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},T=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},R=function(){function e(e){var t=e.id,n=e.quantity,r=e.productId,o=e.productName,i=e.productType,s=e.faceValue,u=e.salePrice,a=e.date,c=e.seats;this.id=t,this.quantity=n,this.productId=r,this.productName=o,this.productType=i,this.faceValue=s,this.salePrice=u,this.date=new Date(a),this.seats=c}return e.prototype.getId=function(){return this.id},e.prototype.getQuantity=function(){return this.quantity},e.prototype.getProductId=function(){return this.productId},e.prototype.getProductName=function(){return this.productName},e.prototype.isVoucher=function(){return this.productType===i.GiftVoucher},e.prototype.isPostage=function(){return this.productType===i.Postage},e.prototype.isFlexiticket=function(){return this.productType===i.Flexitickets},e.prototype.isShow=function(){return this.productType===i.Show},e.prototype.isAttraction=function(){return this.productType===i.Attraction},e.prototype.getProductType=function(){return this.productType},e.prototype.getFaceValue=function(){return this.faceValue},e.prototype.getSalePrice=function(){return this.salePrice},e.prototype.getFaceValueAmount=function(){return this.faceValue.value},e.prototype.getSalePriceAmount=function(){return this.salePrice.value},e.prototype.hasDiscount=function(){return this.getFaceValueAmount()>this.getSalePriceAmount()},e.prototype.getDiscount=function(){return this.quantity*(this.getFaceValueAmount()-this.getSalePriceAmount())},e.prototype.getTotalPrice=function(){return this.quantity*this.getSalePriceAmount()},e.prototype.getPriceBeforeDiscount=function(){return this.quantity*this.getFaceValueAmount()},e.prototype.getDate=function(){return this.date},e.prototype.getSeats=function(){return this.seats},e.prototype.getProductDetails=function(){return E(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return this.product?[3,2]:(e=this,[4,function(e){return k(void 0,void 0,void 0,function(){var t;return P(this,function(n){switch(n.label){case 0:return[4,_(e)];case 1:return t=n.sent(),[2,new S(t)]}})})}(this.productId)]);case 1:e.product=t.sent(),t.label=2;case 2:return[2,this.product]}})})},e.prototype.getImages=function(){return function(e,t,n){return void 0===n&&(n=x.Default),C[n].map(function(r){var o=r.screenSize,i=r.imageSize;return{screenSize:o,url:"https://content.dev.aws.encoretix.co.uk/images/"+e+"/"+t+"/"+n+"?width="+i}})}(b.Products,this.productId)},e}(),D=function(){return(D=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},N=function(){function e(e){this.items=[],this.items=e.map(function(e,t){return new R(D({},e,{id:(t+1).toString()}))})}return e.prototype.getItems=function(){return this.items.slice()},e.prototype.hasVoucher=function(){return this.items.some(function(e){return e.isVoucher()})},e.prototype.hasPostage=function(){return this.items.some(function(e){return e.isPostage()})},e.prototype.hasFlexiticket=function(){return this.items.some(function(e){return e.isFlexiticket()})},e.prototype.hasShow=function(){return this.items.some(function(e){return e.isShow()})},e.prototype.hasAttraction=function(){return this.items.some(function(e){return e.isAttraction()})},e.prototype.getLength=function(){return this.items.length},e.prototype.getAttractions=function(){return this.items.filter(function(e){return e.isAttraction()})},e.prototype.getFlexiticket=function(){return this.items.find(function(e){return e.isFlexiticket()})},e.prototype.getPostage=function(){return this.items.find(function(e){return e.isPostage()})},e}(),B=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},O=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},L=function(){function e(e){this.basketData=e;var t=e.reservations,n=e.expiredAt,r=e.status,o=e.reference;this.itemsCollection=new N(t),this.expiredAt=new Date(n),this.status=r,this.reference=o}return e.prototype.getExpiredDate=function(){return this.expiredAt},e.prototype.isExpired=function(){return this.status===o.Expired||this.expiredAt<new Date},e.prototype.getReference=function(){return this.reference},e.prototype.getItemsCollection=function(){return this.itemsCollection},e.prototype.getDeliveries=function(){return B(this,void 0,void 0,function(){var e;return O(this,function(t){switch(t.label){case 0:return this.deliveries?[3,2]:(e=this,[4,V(this.reference,this.getItemsCollection())]);case 1:e.deliveries=t.sent(),t.label=2;case 2:return[2,this.deliveries]}})})},e.prototype.isEmpty=function(){return!this.itemsCollection.getLength()},e.prototype.getTotalPrice=function(){return this.reduceBasketItemsAmount(function(e,t){return e+t.getTotalPrice()})},e.prototype.getTotalDiscount=function(){return this.reduceBasketItemsAmount(function(e,t){return e+t.getDiscount()})},e.prototype.getTotalPriceBeforeDiscount=function(){return this.reduceBasketItemsAmount(function(e,t){return e+t.getPriceBeforeDiscount()})},e.prototype.hasDiscount=function(){return this.itemsCollection.getItems().some(function(e){return e.hasDiscount()})},e.prototype.reduceBasketItemsAmount=function(e){return this.itemsCollection.getItems().reduce(e,0)},e}(),q=((A={})[r.Collection]={name:"Collect at the Box Office",voucherName:"Free postal delivery",attractionName:"Print at home voucher"},A[r.Postage]={name:"By Post – UK Addresses only"},A[r.Eticket]={name:"Print at Home"},A),U=function(){function e(e,t){var n=e.method,r=e.charge;this.amount=r,this.method=n,this.setName(t)}return e.prototype.getAmount=function(){return this.amount},e.prototype.getMethod=function(){return this.method},e.prototype.getName=function(){return this.name},e.prototype.setName=function(e){this.name=this.method===r.Collection?this.getCollectionDeliveryName(e):q[this.method].name},e.prototype.getCollectionDeliveryName=function(e){var t=q[r.Collection];return e.hasVoucher()?t.voucherName:e.hasAttraction()?t.attractionName:t.name},e}(),F=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},I=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},z=function(e){return F(void 0,void 0,void 0,function(){var t;return I(this,function(n){switch(n.label){case 0:return[4,m(e)];case 1:return t=n.sent(),[2,new L(t)]}})})},V=function(e,t){return F(void 0,void 0,void 0,function(){return I(this,function(n){switch(n.label){case 0:return[4,y(e)];case 1:return[2,n.sent().map(function(e){return new U(e,t)})]}})})};n.d(t,"getBasket",function(){return z}),n.d(t,"getDeliveries",function(){return V})}});
e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},"./src/index.ts":function(e,t,n){"use strict";n.r(t);var r,o,i;n("./src/typings/index.ts");!function(e){e.Collection="collection",e.Postage="postage",e.Eticket="eticket"}(r||(r={})),function(e){e.Active="active",e.Expired="expired",e.Confirmed="confirmed"}(o||(o={})),function(e){e.Show="SHW",e.Attraction="ATT",e.Flexitickets="FLX",e.GiftVoucher="GVC",e.Postage="PST"}(i||(i={}));var s,u,a=n("./node_modules/axios/index.js"),c=n.n(a),l=function(){return(l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},f=function(e){var t={baseURL:e},n=c.a.create(t);return n.interceptors.response.use(p,d),n},p=function(e){var t=e.data;return t?l({},e,{data:t.response}):e},d=function(e){var t=e.response;return t?t.data.context.errors:[]},h=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},m=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},y=f("https://basket.dev.aws.encoretix.co.uk/api/v1"),b=function(e){return h(void 0,void 0,void 0,function(){var t;return m(this,function(n){switch(n.label){case 0:return t="/baskets/"+e,[4,y.get(t)];case 1:return[2,n.sent().data]}})})},x=function(e){return h(void 0,void 0,void 0,function(){var t;return m(this,function(n){switch(n.label){case 0:return t="/baskets/"+e+"/deliveries",[4,y.get(t)];case 1:return[2,n.sent().data]}})})};!function(e){e.Products="products"}(s||(s={})),function(e){e.Square="square",e.Landscape="landscape",e.Portrait="portrait",e.Default="default"}(u||(u={}));var v,g,w=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},j=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},_=f("https://content.dev.aws.encoretix.co.uk/api/v1"),S=function(e){return w(void 0,void 0,void 0,function(){var t;return j(this,function(n){switch(n.label){case 0:return t="/products/"+e,[4,_.get(t)];case 1:return[2,n.sent().data]}})})},k=function(){function e(e){var t=e.name,n=e.showType,r=e.venue,o=e.id;this.name=t,this.type=n,this.venue=r,this.id=o}return e.prototype.getName=function(){return this.name},e.prototype.getType=function(){return this.type},e.prototype.getVenue=function(){return this.venue},e}(),P=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},A=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},C=((v={})[u.Default]=[{screenSize:"xxl",imageSize:80},{screenSize:"xl",imageSize:64},{screenSize:"lg",imageSize:48},{screenSize:"md",imageSize:64},{screenSize:"sm",imageSize:64}],v),E=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},T=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},R=function(){function e(e){var t=e.id,n=e.quantity,r=e.productId,o=e.productName,i=e.productType,s=e.faceValue,u=e.salePrice,a=e.date,c=e.seats,l=e.venueId;this.id=t,this.quantity=n,this.productId=r,this.productName=o,this.productType=i,this.faceValue=s,this.salePrice=u,this.date=new Date(a),this.seats=c,this.venueId=l}return e.prototype.getId=function(){return this.id},e.prototype.getQuantity=function(){return this.quantity},e.prototype.getProductId=function(){return this.productId},e.prototype.getProductName=function(){return this.productName},e.prototype.isVoucher=function(){return this.productType===i.GiftVoucher},e.prototype.isPostage=function(){return this.productType===i.Postage},e.prototype.isFlexiticket=function(){return this.productType===i.Flexitickets},e.prototype.isShow=function(){return this.productType===i.Show},e.prototype.isAttraction=function(){return this.productType===i.Attraction},e.prototype.getProductType=function(){return this.productType},e.prototype.getFaceValue=function(){return this.faceValue},e.prototype.getSalePrice=function(){return this.salePrice},e.prototype.getFaceValueAmount=function(){return this.faceValue.value},e.prototype.getSalePriceAmount=function(){return this.salePrice.value},e.prototype.hasDiscount=function(){return this.getFaceValueAmount()>this.getSalePriceAmount()},e.prototype.getDiscount=function(){return this.quantity*(this.getFaceValueAmount()-this.getSalePriceAmount())},e.prototype.getTotalPrice=function(){return this.quantity*this.getSalePriceAmount()},e.prototype.getPriceBeforeDiscount=function(){return this.quantity*this.getFaceValueAmount()},e.prototype.getDate=function(){return this.date},e.prototype.getSeats=function(){return this.seats},e.prototype.getProductDetails=function(){return E(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return this.product?[3,2]:(e=this,[4,function(e){return P(void 0,void 0,void 0,function(){var t;return A(this,function(n){switch(n.label){case 0:return[4,S(e)];case 1:return t=n.sent(),[2,new k(t)]}})})}(this.productId)]);case 1:e.product=t.sent(),t.label=2;case 2:return[2,this.product]}})})},e.prototype.getImages=function(){return function(e,t,n){return void 0===n&&(n=u.Default),C[n].map(function(r){var o=r.screenSize,i=r.imageSize;return{screenSize:o,url:"https://content.dev.aws.encoretix.co.uk/images/"+e+"/"+t+"/"+n+"?width="+i}})}(s.Products,this.productId)},e.prototype.getVenueId=function(){return this.venueId},e}(),D=function(){return(D=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},N=function(){function e(e){this.items=[],this.items=e.map(function(e,t){return new R(D({},e,{id:(t+1).toString()}))})}return e.prototype.getItems=function(){return this.items.slice()},e.prototype.hasVoucher=function(){return this.items.some(function(e){return e.isVoucher()})},e.prototype.hasPostage=function(){return this.items.some(function(e){return e.isPostage()})},e.prototype.hasFlexiticket=function(){return this.items.some(function(e){return e.isFlexiticket()})},e.prototype.hasShow=function(){return this.items.some(function(e){return e.isShow()})},e.prototype.hasAttraction=function(){return this.items.some(function(e){return e.isAttraction()})},e.prototype.getLength=function(){return this.items.length},e.prototype.getAttractions=function(){return this.items.filter(function(e){return e.isAttraction()})},e.prototype.getFlexiticket=function(){return this.items.find(function(e){return e.isFlexiticket()})},e.prototype.getPostage=function(){return this.items.find(function(e){return e.isPostage()})},e}(),B=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},O=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},L=function(){function e(e){this.basketData=e;var t=e.reservations,n=e.expiredAt,r=e.status,o=e.reference;this.itemsCollection=new N(t),this.expiredAt=new Date(n),this.status=r,this.reference=o}return e.prototype.getExpiredDate=function(){return this.expiredAt},e.prototype.isExpired=function(){return this.status===o.Expired||this.expiredAt<new Date},e.prototype.getReference=function(){return this.reference},e.prototype.getItemsCollection=function(){return this.itemsCollection},e.prototype.getDeliveries=function(){return B(this,void 0,void 0,function(){var e;return O(this,function(t){switch(t.label){case 0:return this.deliveries?[3,2]:(e=this,[4,z(this.reference,this.getItemsCollection())]);case 1:e.deliveries=t.sent(),t.label=2;case 2:return[2,this.deliveries]}})})},e.prototype.isEmpty=function(){return!this.itemsCollection.getLength()},e.prototype.getTotalPrice=function(){return this.reduceBasketItemsAmount(function(e,t){return e+t.getTotalPrice()})},e.prototype.getTotalDiscount=function(){return this.reduceBasketItemsAmount(function(e,t){return e+t.getDiscount()})},e.prototype.getTotalPriceBeforeDiscount=function(){return this.reduceBasketItemsAmount(function(e,t){return e+t.getPriceBeforeDiscount()})},e.prototype.hasDiscount=function(){return this.itemsCollection.getItems().some(function(e){return e.hasDiscount()})},e.prototype.reduceBasketItemsAmount=function(e){return this.itemsCollection.getItems().reduce(e,0)},e}(),q=((g={})[r.Collection]={name:"Collect at the Box Office",voucherName:"Free postal delivery",attractionName:"Print at home voucher"},g[r.Postage]={name:"By Post – UK Addresses only"},g[r.Eticket]={name:"Print at Home"},g),I=function(){function e(e,t){var n=e.method,r=e.charge;this.amount=r,this.method=n,this.setName(t)}return e.prototype.getAmount=function(){return this.amount},e.prototype.getMethod=function(){return this.method},e.prototype.getName=function(){return this.name},e.prototype.setName=function(e){this.name=this.method===r.Collection?this.getCollectionDeliveryName(e):q[this.method].name},e.prototype.getCollectionDeliveryName=function(e){var t=q[r.Collection];return e.hasVoucher()?t.voucherName:e.hasAttraction()?t.attractionName:t.name},e}(),U=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},F=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},V=function(e){return U(void 0,void 0,void 0,function(){var t;return F(this,function(n){switch(n.label){case 0:return[4,b(e)];case 1:return t=n.sent(),[2,new L(t)]}})})},z=function(e,t){return U(void 0,void 0,void 0,function(){return F(this,function(n){switch(n.label){case 0:return[4,x(e)];case 1:return[2,n.sent().map(function(e){return new I(e,t)})]}})})};n.d(t,"getBasket",function(){return V}),n.d(t,"getDeliveries",function(){return z})},"./src/typings/index.ts":function(e,t){}});
{
"name": "encore-api-services",
"version": "0.0.1",
"version": "0.0.2",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc