recombee-js-api-client
Advanced tools
Comparing version 2.2.1 to 2.3.0
@@ -1,2 +0,2 @@ | ||
(function(e,t){'object'==typeof exports&&'object'==typeof module?module.exports=t():'function'==typeof define&&define.amd?define('recombee',[],t):'object'==typeof exports?exports.recombee=t():e.recombee=t()})('undefined'==typeof self?this:self,function(){return function(e){function t(r){if(a[r])return a[r].exports;var o=a[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var a={};return t.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var a=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(a,'a',a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='',t(t.s=4)}([function(e,t){'use strict';function a(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}t.Request=function e(t,r,o){a(this,e),this.method=t,this.path=r,this.timeout=o}},function(e,t){'use strict';function a(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function r(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function o(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var n=function(e){function t(e){a(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.name=o.constructor.name,'function'==typeof Error.captureStackTrace?Error.captureStackTrace(o,o.constructor):o.stack=new Error(e).stack,o}return o(t,e),t}(Error);t.ApiError=n},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=a(1),i=function(e){function t(e,a,n){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return s.request=e,s.statusCode=a,s}return n(t,e),t}(s.ApiError);t.ResponseError=i},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=a(1),i=function(e){function t(e){r(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Client did not get response within '+e.timeout+' ms'));return a.request=e,a}return n(t,e),t}(s.ApiError);t.TimeoutError=i},function(e,t,a){e.exports=a(5)},function(e,t,a){'use strict';t.ApiClient=a(6).ApiClient,t.ApiError=a(1).ApiError,t.ResponseError=a(2).ResponseError,t.TimeoutError=a(3).TimeoutError,t.MergeUsers=a(10).MergeUsers,t.AddDetailView=a(11).AddDetailView,t.AddPurchase=a(12).AddPurchase,t.AddRating=a(13).AddRating,t.AddCartAddition=a(14).AddCartAddition,t.AddBookmark=a(15).AddBookmark,t.SetViewPortion=a(16).SetViewPortion,t.RecommendItemsToUser=a(17).RecommendItemsToUser,t.RecommendItemsToItem=a(18).RecommendItemsToItem},function(e,t,a){'use strict';(function(e){function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}var o=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),n=a(8),s=a(9),i=function(){function t(a,o,n){r(this,t),this.databaseId=a,this.publicToken=o,this.options=n||{},this.baseUri=this.options.baseUri||e.env.RAPI_URI||'client-rapi.recombee.com',this.useHttps=!('useHttps'in this.options)||this.options.useHttps,this.async=!('async'in this.options)||this.options.async}return o(t,[{key:'send',value:function(e,t){var a=this;if(void 0===t&&window.Promise)return new Promise(function(t,r){a.send(e,function(e,a){e?r(e):t(a)})});var r=this._signUrl(e.path),o=(this.useHttps?'https://':'http://')+this.baseUri+r,n=new XMLHttpRequest;n.open('POST',o,this.async),n.setRequestHeader('Accept','application/json'),n.setRequestHeader('Content-Type','text/plain'),this.async&&(n.timeout=e.timeout),n.onreadystatechange=function(){if(4==this.readyState&&this.responseText)if(200==this.status){if(t)return t(null,JSON.parse(this.responseText));}else if(t)return t(new s.ResponseError(e,this.status,this.responseText))},n.ontimeout=function(){if(t)return t(new s.TimeoutError(e))},n.send(JSON.stringify(e.bodyParameters()))}},{key:'_signUrl',value:function(e){var t='/'+this.databaseId+e;t+=(-1==e.indexOf('?')?'?':'&')+'frontend_timestamp='+parseInt(new Date().getTime()/1e3);var a=new n('SHA-1','TEXT');return a.setHMACKey(this.publicToken,'TEXT'),a.update(t),t+='&frontend_sign='+a.getHMAC('HEX'),t}}]),t}();t.ApiClient=i}).call(t,a(7))},function(e){function t(){throw new Error('setTimeout has not been defined')}function a(){throw new Error('clearTimeout has not been defined')}function r(e){if(u===setTimeout)return setTimeout(e,0);if((u===t||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function o(e){if(d===clearTimeout)return clearTimeout(e);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function n(){b&&l&&(b=!1,l.length?m=l.concat(m):f=-1,m.length&&s())}function s(){if(!b){var e=r(n);b=!0;for(var t=m.length;t;){for(l=m,m=[];++f<t;)l&&l[f].run();f=-1,t=m.length}l=null,b=!1,o(e)}}function c(e,t){this.fun=e,this.array=t}function i(){}var u,d,p=e.exports={};(function(){try{u='function'==typeof setTimeout?setTimeout:t}catch(a){u=t}try{d='function'==typeof clearTimeout?clearTimeout:a}catch(t){d=a}})();var l,m=[],b=!1,f=-1;p.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];m.push(new c(e,t)),1!==m.length||b||r(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title='browser',p.browser=!0,p.env={},p.argv=[],p.version='',p.versions={},p.on=i,p.addListener=i,p.once=i,p.off=i,p.removeListener=i,p.removeAllListeners=i,p.emit=i,p.prependListener=i,p.prependOnceListener=i,p.listeners=function(){return[]},p.binding=function(){throw new Error('process.binding is not supported')},p.cwd=function(){return'/'},p.chdir=function(){throw new Error('process.chdir is not supported')},p.umask=function(){return 0}},function(e,a,r){'use strict';var o;(function(n){function s(o,s,a){var i,_,S,R,H,m,f,T,r,t=0,e=[],h=0,n=!1,d=[],I=[],O=!1,y=!1,U=-1;if(a=a||{},i=a.encoding||'UTF8',r=a.numRounds||1,r!==parseInt(r,10)||1>r)throw Error('numRounds must a integer >= 1');if('SHA-1'===o)H=512,m=A,f=k,R=160,T=function(e){return e.slice()};else if(0===o.lastIndexOf('SHA-',0)){if(m=function(e,t){return g(e,t,o)},f=function(t,a,r,n){var e,s;if('SHA-224'===o||'SHA-256'===o)e=(a+65>>>9<<4)+15,s=16;else if('SHA-384'===o||'SHA-512'===o)e=(a+129>>>10<<5)+31,s=32;else throw Error('Unexpected error in SHA-2 implementation');for(;t.length<=e;)t.push(0);for(t[a>>>5]|=128<<24-a%32,a+=r,t[e]=4294967295&a,t[e-1]=0|a/4294967296,r=t.length,a=0;a<r;a+=s)n=g(t.slice(a,a+s),n,o);if('SHA-224'===o)t=[n[0],n[1],n[2],n[3],n[4],n[5],n[6]];else if('SHA-256'===o)t=n;else if('SHA-384'===o)t=[n[0].a,n[0].b,n[1].a,n[1].b,n[2].a,n[2].b,n[3].a,n[3].b,n[4].a,n[4].b,n[5].a,n[5].b];else if('SHA-512'===o)t=[n[0].a,n[0].b,n[1].a,n[1].b,n[2].a,n[2].b,n[3].a,n[3].b,n[4].a,n[4].b,n[5].a,n[5].b,n[6].a,n[6].b,n[7].a,n[7].b];else throw Error('Unexpected error in SHA-2 implementation');return t},T=function(e){return e.slice()},'SHA-224'===o)H=512,R=224;else if('SHA-256'===o)H=512,R=256;else if('SHA-384'===o)H=1024,R=384;else if('SHA-512'===o)H=1024,R=512;else throw Error('Chosen SHA variant is not supported');}else if(0===o.lastIndexOf('SHA3-',0)||0===o.lastIndexOf('SHAKE',0)){var x=6;if(m=v,T=function(t){var a,e=[];for(a=0;5>a;a+=1)e[a]=t[a].slice();return e},U=1,'SHA3-224'===o)H=1152,R=224;else if('SHA3-256'===o)H=1088,R=256;else if('SHA3-384'===o)H=832,R=384;else if('SHA3-512'===o)H=576,R=512;else if('SHAKE128'===o)H=1344,R=-1,x=31,y=!0;else if('SHAKE256'===o)H=1088,R=-1,x=31,y=!0;else throw Error('Chosen SHA variant is not supported');f=function(t,a,r,e,o){r=H;var s,i=x,c=[],u=r>>>5,n=0,p=a>>>5;for(s=0;s<p&&a>=r;s+=u)e=v(t.slice(s,s+u),e),a-=r;for(t=t.slice(s),a%=r;t.length<u;)t.push(0);for(s=a>>>3,t[s>>2]^=i<<8*(s%4),t[u-1]^=2147483648,e=v(t,e);32*c.length<o&&(t=e[n%5][0|n/5],c.push(t.b),!(32*c.length>=o));)c.push(t.a),n+=1,0==64*n%r&&v(null,e);return c}}else throw Error('Chosen SHA variant is not supported');S=P(s,i,U),_=E(o),this.setHMACKey=function(e,a,r){var s;if(!0==n)throw Error('HMAC key already set');if(!0==O)throw Error('Cannot set HMAC key after calling update');if(!0==y)throw Error('SHAKE is not supported for HMAC');if(i=(r||{}).encoding||'UTF8',a=P(a,i,U)(e),e=a.binLen,a=a.value,s=H>>>3,r=s/4-1,s<e/8){for(a=f(a,e,0,E(o),R);a.length<=r;)a.push(0);a[r]&=4294967040}else if(s>e/8){for(;a.length<=r;)a.push(0);a[r]&=4294967040}for(e=0;e<=r;e+=1)d[e]=909522486^a[e],I[e]=1549556828^a[e];_=m(d,_),t=H,n=!0},this.update=function(r){var a,o,n,s=0,i=H>>>5;for(a=S(r,e,h),r=a.binLen,o=a.value,a=r>>>5,n=0;n<a;n+=i)s+H<=r&&(_=m(o.slice(n,n+i),_),s+=H);t+=s,e=o.slice(s>>>5),h=r%H,O=!0},this.getHash=function(s,a){var i,b,g,d;if(!0==n)throw Error('Cannot call getHash after setting HMAC key');if(g=C(a),!0==y){if(-1===g.shakeLen)throw Error('shakeLen must be specified in options');R=g.shakeLen}switch(s){case'HEX':i=function(e){return c(e,R,U,g)};break;case'B64':i=function(e){return u(e,R,U,g)};break;case'BYTES':i=function(e){return p(e,R,U)};break;case'ARRAYBUFFER':try{b=new ArrayBuffer(0)}catch(e){throw Error('ARRAYBUFFER not supported by this environment')}i=function(e){return l(e,R,U)};break;default:throw Error('format must be HEX, B64, BYTES, or ARRAYBUFFER');}for(d=f(e.slice(),h,t,T(_),R),b=1;b<r;b+=1)!0==y&&0!=R%32&&(d[d.length-1]&=16777215>>>24-R%32),d=f(d,R,0,E(o),R);return i(d)},this.getHMAC=function(r,a){var s,i,b,d;if(!1==n)throw Error('Cannot call getHMAC without first setting HMAC key');switch(b=C(a),r){case'HEX':s=function(e){return c(e,R,U,b)};break;case'B64':s=function(e){return u(e,R,U,b)};break;case'BYTES':s=function(e){return p(e,R,U)};break;case'ARRAYBUFFER':try{s=new ArrayBuffer(0)}catch(e){throw Error('ARRAYBUFFER not supported by this environment')}s=function(e){return l(e,R,U)};break;default:throw Error('outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER');}return i=f(e.slice(),h,t,T(_),R),d=m(I,E(o)),d=f(i,R,H,d,R),s(d)}}function i(e,t){this.a=e,this.b=t}function c(t,r,a,o){var e='';r/=8;var s,n,i;for(i=-1===a?3:0,s=0;s<r;s+=1)n=t[s>>>2]>>>8*(i+s%4*a),e+='0123456789abcdef'.charAt(15&n>>>4)+'0123456789abcdef'.charAt(15&n);return o.outputUpper?e.toUpperCase():e}function u(t,r,a,o){var e,s,i,c,u='',d=r/8;for(c=-1===a?3:0,e=0;e<d;e+=3)for(s=e+1<d?t[e+1>>>2]:0,i=e+2<d?t[e+2>>>2]:0,i=(255&t[e>>>2]>>>8*(c+e%4*a))<<16|(255&s>>>8*(c+(e+1)%4*a))<<8|255&i>>>8*(c+(e+2)%4*a),s=0;4>s;s+=1)u+=8*e+6*s<=r?'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(63&i>>>6*(3-s)):o.b64Pad;return u}function p(t,r,a){var o='';r/=8;var e,n,s;for(s=-1===a?3:0,e=0;e<r;e+=1)n=255&t[e>>>2]>>>8*(s+e%4*a),o+=String.fromCharCode(n);return o}function l(t,r,a){r/=8;var o,e,n,s=new ArrayBuffer(r);for(n=new Uint8Array(s),e=-1===a?3:0,o=0;o<r;o+=1)n[o]=255&t[o>>>2]>>>8*(e+o%4*a);return s}function C(e){var t={outputUpper:!1,b64Pad:'=',shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty('b64Pad')&&(t.b64Pad=e.b64Pad),!0===e.hasOwnProperty('shakeLen')){if(0!=e.shakeLen%8)throw Error('shakeLen must be a multiple of 8');t.shakeLen=e.shakeLen}if('boolean'!=typeof t.outputUpper)throw Error('Invalid outputUpper formatting option');if('string'!=typeof t.b64Pad)throw Error('Invalid b64Pad formatting option');return t}function P(e,o,n){switch(o){case'UTF8':case'UTF16BE':case'UTF16LE':break;default:throw Error('encoding must be UTF8, UTF16BE, or UTF16LE');}switch(e){case'HEX':e=function(e,t,a){var r,o,s,i,d,p,u=e.length;if(0!=u%2)throw Error('String of HEX type must be in byte increments');for(t=t||[0],a=a||0,d=a>>>3,p=-1===n?3:0,r=0;r<u;r+=2){if(o=parseInt(e.substr(r,2),16),isNaN(o))throw Error('String of HEX type contains invalid characters');for(i=(r>>>1)+d,s=i>>>2;t.length<=s;)t.push(0);t[s]|=o<<8*(p+i%4*n)}return{value:t,binLen:4*u+a}};break;case'TEXT':e=function(e,a,s){var i,c,d,l,m,b,u,r,t=0;if(a=a||[0],s=s||0,m=s>>>3,'UTF8'===o)for(r=-1===n?3:0,d=0;d<e.length;d+=1)for(i=e.charCodeAt(d),c=[],128>i?c.push(i):2048>i?(c.push(192|i>>>6),c.push(128|63&i)):55296>i||57344<=i?c.push(224|i>>>12,128|63&i>>>6,128|63&i):(d+=1,i=65536+((1023&i)<<10|1023&e.charCodeAt(d)),c.push(240|i>>>18,128|63&i>>>12,128|63&i>>>6,128|63&i)),l=0;l<c.length;l+=1){for(u=t+m,b=u>>>2;a.length<=b;)a.push(0);a[b]|=c[l]<<8*(r+u%4*n),t+=1}else if('UTF16BE'===o||'UTF16LE'===o)for(r=-1===n?2:0,c='UTF16LE'==o&&1!==n||'UTF16LE'!=o&&1===n,d=0;d<e.length;d+=1){for(i=e.charCodeAt(d),!0===c&&(l=255&i,i=l<<8|i>>>8),u=t+m,b=u>>>2;a.length<=b;)a.push(0);a[b]|=i<<8*(r+u%4*n),t+=2}return{value:a,binLen:8*t+s}};break;case'B64':e=function(e,a,o){var s,i,d,p,l,m,u,r,t=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error('Invalid character in base-64 string');if(i=e.indexOf('='),e=e.replace(/\=/g,''),-1!==i&&i<e.length)throw Error('Invalid \'=\' found in base-64 string');for(a=a||[0],o=o||0,m=o>>>3,r=-1===n?3:0,i=0;i<e.length;i+=4){for(l=e.substr(i,4),d=p=0;d<l.length;d+=1)s='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.indexOf(l[d]),p|=s<<18-6*d;for(d=0;d<l.length-1;d+=1){for(u=t+m,s=u>>>2;a.length<=s;)a.push(0);a[s]|=(255&p>>>16-8*d)<<8*(r+u%4*n),t+=1}}return{value:a,binLen:8*t+o}};break;case'BYTES':e=function(e,t,a){var r,o,s,i,u,d;for(t=t||[0],a=a||0,s=a>>>3,d=-1===n?3:0,o=0;o<e.length;o+=1)r=e.charCodeAt(o),u=o+s,i=u>>>2,t.length<=i&&t.push(0),t[i]|=r<<8*(d+u%4*n);return{value:t,binLen:8*e.length+a}};break;case'ARRAYBUFFER':try{e=new ArrayBuffer(0)}catch(t){throw Error('ARRAYBUFFER not supported by this environment')}e=function(e,t,a){var r,o,s,i,u,d;for(t=t||[0],a=a||0,o=a>>>3,u=-1===n?3:0,d=new Uint8Array(e),r=0;r<e.byteLength;r+=1)i=r+o,s=i>>>2,t.length<=s&&t.push(0),t[s]|=d[r]<<8*(u+i%4*n);return{value:t,binLen:8*e.byteLength+a}};break;default:throw Error('format must be HEX, TEXT, B64, BYTES, or ARRAYBUFFER');}return e}function m(e,t){return e<<t|e>>>32-t}function b(e,t){return 32<t?(t-=32,new i(e.b<<t|e.a>>>32-t,e.a<<t|e.b>>>32-t)):0===t?e:new i(e.a<<t|e.b>>>32-t,e.b<<t|e.a>>>32-t)}function f(e,t){return e>>>t|e<<32-t}function h(e,t){var a=null,a=new i(e.a,e.b);return a=32>=t?new i(a.a>>>t|4294967295&a.b<<32-t,a.b>>>t|4294967295&a.a<<32-t):new i(a.b>>>t-32|4294967295&a.a<<64-t,a.a>>>t-32|4294967295&a.b<<64-t)}function t(e,t){var a=null;return a=32>=t?new i(e.a>>>t,e.b>>>t|4294967295&e.a<<32-t):new i(0,e.a>>>t-32)}function I(e,t,a){return e&t^~e&a}function _(e,t,a){return new i(e.a&t.a^~e.a&a.a,e.b&t.b^~e.b&a.b)}function S(e,t,a){return e&t^e&a^t&a}function R(e,t,a){return new i(e.a&t.a^e.a&a.a^t.a&a.a,e.b&t.b^e.b&a.b^t.b&a.b)}function T(e){return f(e,2)^f(e,13)^f(e,22)}function O(e){var t=h(e,28),a=h(e,34);return e=h(e,39),new i(t.a^a.a^e.a,t.b^a.b^e.b)}function U(e){return f(e,6)^f(e,11)^f(e,25)}function j(e){var t=h(e,14),a=h(e,18);return e=h(e,41),new i(t.a^a.a^e.a,t.b^a.b^e.b)}function Y(e){return f(e,7)^f(e,18)^e>>>3}function M(e){var r=h(e,1),a=h(e,8);return e=t(e,7),new i(r.a^a.a^e.a,r.b^a.b^e.b)}function N(e){return f(e,17)^f(e,19)^e>>>10}function Q(e){var r=h(e,19),a=h(e,61);return e=t(e,6),new i(r.a^a.a^e.a,r.b^a.b^e.b)}function $(e,t){var a=(65535&e)+(65535&t);return(65535&(e>>>16)+(t>>>16)+(a>>>16))<<16|65535&a}function G(t,r,a,o){var e=(65535&t)+(65535&r)+(65535&a)+(65535&o);return(65535&(t>>>16)+(r>>>16)+(a>>>16)+(o>>>16)+(e>>>16))<<16|65535&e}function ee(t,r,a,o,e){var n=(65535&t)+(65535&r)+(65535&a)+(65535&o)+(65535&e);return(65535&(t>>>16)+(r>>>16)+(a>>>16)+(o>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function H(t,r){var a,o,e;return a=(65535&t.b)+(65535&r.b),o=(t.b>>>16)+(r.b>>>16)+(a>>>16),e=(65535&o)<<16|65535&a,a=(65535&t.a)+(65535&r.a)+(o>>>16),o=(t.a>>>16)+(r.a>>>16)+(a>>>16),new i((65535&o)<<16|65535&a,e)}function te(t,r,a,o){var e,s,n;return e=(65535&t.b)+(65535&r.b)+(65535&a.b)+(65535&o.b),s=(t.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o.b>>>16)+(e>>>16),n=(65535&s)<<16|65535&e,e=(65535&t.a)+(65535&r.a)+(65535&a.a)+(65535&o.a)+(s>>>16),s=(t.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o.a>>>16)+(e>>>16),new i((65535&s)<<16|65535&e,n)}function ae(t,r,a,o,e){var s,n,c;return s=(65535&t.b)+(65535&r.b)+(65535&a.b)+(65535&o.b)+(65535&e.b),n=(t.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o.b>>>16)+(e.b>>>16)+(s>>>16),c=(65535&n)<<16|65535&s,s=(65535&t.a)+(65535&r.a)+(65535&a.a)+(65535&o.a)+(65535&e.a)+(n>>>16),n=(t.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o.a>>>16)+(e.a>>>16)+(s>>>16),new i((65535&n)<<16|65535&s,c)}function y(e,t){return new i(e.a^t.a,e.b^t.b)}function E(e){var t,r=[];if('SHA-1'===e)r=[1732584193,4023233417,2562383102,271733878,3285377520];else if(0===e.lastIndexOf('SHA-',0))switch(r=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],t=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],e){case'SHA-224':break;case'SHA-256':r=t;break;case'SHA-384':r=[new i(3418070365,r[0]),new i(1654270250,r[1]),new i(2438529370,r[2]),new i(355462360,r[3]),new i(1731405415,r[4]),new i(41048885895,r[5]),new i(3675008525,r[6]),new i(1203062813,r[7])];break;case'SHA-512':r=[new i(t[0],4089235720),new i(t[1],2227873595),new i(t[2],4271175723),new i(t[3],1595750129),new i(t[4],2917565137),new i(t[5],725511199),new i(t[6],4215389547),new i(t[7],327033209)];break;default:throw Error('Unknown SHA variant');}else if(0===e.lastIndexOf('SHA3-',0)||0===e.lastIndexOf('SHAKE',0))for(e=0;5>e;e+=1)r[e]=[new i(0,0),new i(0,0),new i(0,0),new i(0,0),new i(0,0)];else throw Error('No SHA variants supported');return r}function A(t,r){var a,e,o,n,s,i,c,u=[];for(a=r[0],e=r[1],o=r[2],n=r[3],s=r[4],c=0;80>c;c+=1)u[c]=16>c?t[c]:m(u[c-3]^u[c-8]^u[c-14]^u[c-16],1),i=20>c?ee(m(a,5),e&o^~e&n,s,1518500249,u[c]):40>c?ee(m(a,5),e^o^n,s,1859775393,u[c]):60>c?ee(m(a,5),S(e,o,n),s,2400959708,u[c]):ee(m(a,5),e^o^n,s,3395469782,u[c]),s=n,n=o,o=m(e,30),e=a,a=i;return r[0]=$(a,r[0]),r[1]=$(e,r[1]),r[2]=$(o,r[2]),r[3]=$(n,r[3]),r[4]=$(s,r[4]),r}function k(t,r,a,o){var e;for(e=(r+65>>>9<<4)+15;t.length<=e;)t.push(0);for(t[r>>>5]|=128<<24-r%32,r+=a,t[e]=4294967295&r,t[e-1]=0|r/4294967296,r=t.length,e=0;e<r;e+=16)o=A(t.slice(e,e+16),o);return o}function g(o,s,a){var c,e,b,n,h,l,p,f,m,g,u,r,t,P,v,y,A,k,x,w,F,C,B,q=[];if('SHA-224'===a||'SHA-256'===a)g=64,r=1,C=Number,t=$,P=G,v=ee,y=Y,A=N,k=T,x=U,F=S,w=I,B=L;else if('SHA-384'===a||'SHA-512'===a)g=80,r=2,C=i,t=H,P=te,v=ae,y=M,A=Q,k=O,x=j,F=R,w=_,B=d;else throw Error('Unexpected error in SHA-2 implementation');for(a=s[0],c=s[1],e=s[2],b=s[3],n=s[4],h=s[5],l=s[6],p=s[7],u=0;u<g;u+=1)16>u?(m=u*r,f=o.length<=m?0:o[m],m=o.length<=m+1?0:o[m+1],q[u]=new C(f,m)):q[u]=P(A(q[u-2]),q[u-7],y(q[u-15]),q[u-16]),f=v(p,x(n),w(n,h,l),B[u],q[u]),m=t(k(a),F(a,c,e)),p=l,l=h,h=n,n=t(b,f),b=e,e=c,c=a,a=t(f,m);return s[0]=t(a,s[0]),s[1]=t(c,s[1]),s[2]=t(e,s[2]),s[3]=t(b,s[3]),s[4]=t(n,s[4]),s[5]=t(h,s[5]),s[6]=t(l,s[6]),s[7]=t(p,s[7]),s}function v(t,r){var a,o,e,s,n=[],c=[];if(null!==t)for(o=0;o<t.length;o+=2)r[(o>>>1)%5][0|(o>>>1)/5]=y(r[(o>>>1)%5][0|(o>>>1)/5],new i(t[o+1],t[o]));for(a=0;24>a;a+=1){for(s=E('SHA3-'),o=0;5>o;o+=1){e=r[o][0];var u=r[o][1],d=r[o][2],p=r[o][3],l=r[o][4];n[o]=new i(e.a^u.a^d.a^p.a^l.a,e.b^u.b^d.b^p.b^l.b)}for(o=0;5>o;o+=1)c[o]=y(n[(o+4)%5],b(n[(o+1)%5],1));for(o=0;5>o;o+=1)for(e=0;5>e;e+=1)r[o][e]=y(r[o][e],c[o]);for(o=0;5>o;o+=1)for(e=0;5>e;e+=1)s[e][(2*o+3*e)%5]=b(r[o][e],x[o][e]);for(o=0;5>o;o+=1)for(e=0;5>e;e+=1)r[o][e]=y(s[o][e],new i(~s[(o+1)%5][e].a&s[(o+2)%5][e].a,~s[(o+1)%5][e].b&s[(o+2)%5][e].b));r[0][0]=y(r[0][0],w[a])}return r}var L,d,x,w;L=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=[new i(L[0],3609767458),new i(L[1],602891725),new i(L[2],3964484399),new i(L[3],2173295548),new i(L[4],4081628472),new i(L[5],3053834265),new i(L[6],2937671579),new i(L[7],3664609560),new i(L[8],2734883394),new i(L[9],1164996542),new i(L[10],1323610764),new i(L[11],3590304994),new i(L[12],4068182383),new i(L[13],991336113),new i(L[14],633803317),new i(L[15],3479774868),new i(L[16],2666613458),new i(L[17],944711139),new i(L[18],2341262773),new i(L[19],2007800933),new i(L[20],1495990901),new i(L[21],1856431235),new i(L[22],3175218132),new i(L[23],2198950837),new i(L[24],3999719339),new i(L[25],766784016),new i(L[26],2566594879),new i(L[27],3203337956),new i(L[28],1034457026),new i(L[29],2466948901),new i(L[30],3758326383),new i(L[31],168717936),new i(L[32],1188179964),new i(L[33],1546045734),new i(L[34],1522805485),new i(L[35],2643833823),new i(L[36],2343527390),new i(L[37],1014477480),new i(L[38],1206759142),new i(L[39],344077627),new i(L[40],1290863460),new i(L[41],3158454273),new i(L[42],3505952657),new i(L[43],106217008),new i(L[44],3606008344),new i(L[45],1432725776),new i(L[46],1467031594),new i(L[47],851169720),new i(L[48],3100823752),new i(L[49],1363258195),new i(L[50],3750685593),new i(L[51],3785050280),new i(L[52],3318307427),new i(L[53],3812723403),new i(L[54],2003034995),new i(L[55],3602036899),new i(L[56],1575990012),new i(L[57],1125592928),new i(L[58],2716904306),new i(L[59],442776044),new i(L[60],593698344),new i(L[61],3733110249),new i(L[62],2999351573),new i(L[63],3815920427),new i(3391569614,3928383900),new i(3515267271,566280711),new i(3940187606,3454069534),new i(4118630271,4000239992),new i(116418474,1914138554),new i(174292421,2731055270),new i(289380356,3203993006),new i(460393269,320620315),new i(685471733,587496836),new i(852142971,1086792851),new i(1017036298,365543100),new i(1126000580,2618297676),new i(1288033470,3409855158),new i(1501505948,4234509866),new i(1607167915,987167468),new i(1816402316,1246189591)],w=[new i(0,1),new i(0,32898),new i(2147483648,32906),new i(2147483648,2147516416),new i(0,32907),new i(0,2147483649),new i(2147483648,2147516545),new i(2147483648,32777),new i(0,138),new i(0,136),new i(0,2147516425),new i(0,2147483658),new i(0,2147516555),new i(2147483648,139),new i(2147483648,32905),new i(2147483648,32771),new i(2147483648,32770),new i(2147483648,128),new i(0,32778),new i(2147483648,2147483658),new i(2147483648,2147516545),new i(2147483648,32896),new i(0,2147483649),new i(2147483648,2147516424)],x=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]],(o=function(){return s}.call(a,r,a,e),!(o!==void 0&&(e.exports=o)))})(this)},function(e,t,a){'use strict';t.ApiError=a(1).ApiError,t.ResponseError=a(2).ResponseError,t.TimeoutError=a(3).TimeoutError},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'PUT','/users/'+encodeURIComponent(e)+'/merge/'+encodeURIComponent(a),3e4,!1));return s.targetUserId=e,s.sourceUserId=a,n=n||{},s.cascadeCreate=n.cascadeCreate,s}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={cascadeCreate:void 0===this.cascadeCreate||this.cascadeCreate};return e}}]),t}(i.Request);t.MergeUsers=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/detailviews/',3e3,!1));return s.userId=e,s.itemId=a,n=n||{},s.timestamp=n.timestamp,s.duration=n.duration,s.cascadeCreate=n.cascadeCreate,s.recommId=n.recommId,s}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.duration&&(e.duration=this.duration),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.recommId&&(e.recommId=this.recommId),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(i.Request);t.AddDetailView=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/purchases/',3e3,!1));return s.userId=e,s.itemId=a,n=n||{},s.timestamp=n.timestamp,s.cascadeCreate=n.cascadeCreate,s.amount=n.amount,s.price=n.price,s.profit=n.profit,s.recommId=n.recommId,s}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.amount&&(e.amount=this.amount),void 0!==this.price&&(e.price=this.price),void 0!==this.profit&&(e.profit=this.profit),void 0!==this.recommId&&(e.recommId=this.recommId),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(i.Request);t.AddPurchase=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n,s){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/ratings/',3e3,!1));return i.userId=e,i.itemId=a,i.rating=n,s=s||{},i.timestamp=s.timestamp,i.cascadeCreate=s.cascadeCreate,i.recommId=s.recommId,i}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,e.rating=this.rating,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.recommId&&(e.recommId=this.recommId),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(i.Request);t.AddRating=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/cartadditions/',3e3,!1));return s.userId=e,s.itemId=a,n=n||{},s.timestamp=n.timestamp,s.cascadeCreate=n.cascadeCreate,s.amount=n.amount,s.price=n.price,s.recommId=n.recommId,s}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.amount&&(e.amount=this.amount),void 0!==this.price&&(e.price=this.price),void 0!==this.recommId&&(e.recommId=this.recommId),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(i.Request);t.AddCartAddition=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/bookmarks/',3e3,!1));return s.userId=e,s.itemId=a,n=n||{},s.timestamp=n.timestamp,s.cascadeCreate=n.cascadeCreate,s.recommId=n.recommId,s}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.recommId&&(e.recommId=this.recommId),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(i.Request);t.AddBookmark=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n,s){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/viewportions/',3e3,!1));return i.userId=e,i.itemId=a,i.portion=n,s=s||{},i.sessionId=s.sessionId,i.timestamp=s.timestamp,i.cascadeCreate=s.cascadeCreate,i.recommId=s.recommId,i}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,e.portion=this.portion,void 0!==this.sessionId&&(e.sessionId=this.sessionId),void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.recommId&&(e.recommId=this.recommId),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(i.Request);t.SetViewPortion=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/recomms/users/'+encodeURIComponent(e)+'/items/',9e3,!1));return s.userId=e,s.count=a,n=n||{},s.filter=n.filter,s.booster=n.booster,s.cascadeCreate=n.cascadeCreate,s.scenario=n.scenario,s.returnProperties=n.returnProperties,s.includedProperties=n.includedProperties,s.diversity=n.diversity,s.minRelevance=n.minRelevance,s.rotationRate=n.rotationRate,s.rotationTime=n.rotationTime,s.expertSettings=n.expertSettings,s}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={};return e.count=this.count,void 0!==this.filter&&(e.filter=this.filter),void 0!==this.booster&&(e.booster=this.booster),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.scenario&&(e.scenario=this.scenario),void 0!==this.returnProperties&&(e.returnProperties=this.returnProperties),void 0!==this.includedProperties&&(e.includedProperties=this.includedProperties),void 0!==this.diversity&&(e.diversity=this.diversity),void 0!==this.minRelevance&&(e.minRelevance=this.minRelevance),void 0!==this.rotationRate&&(e.rotationRate=this.rotationRate),void 0!==this.rotationTime&&(e.rotationTime=this.rotationTime),void 0!==this.expertSettings&&(e.expertSettings=this.expertSettings),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(i.Request);t.RecommendItemsToUser=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(0),c=function(e){function t(e,a,n,s){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/recomms/items/'+encodeURIComponent(e)+'/items/',9e3,!1));return i.itemId=e,i.targetUserId=a,i.count=n,s=s||{},i.userImpact=s.userImpact,i.filter=s.filter,i.booster=s.booster,i.cascadeCreate=s.cascadeCreate,i.scenario=s.scenario,i.returnProperties=s.returnProperties,i.includedProperties=s.includedProperties,i.diversity=s.diversity,i.minRelevance=s.minRelevance,i.rotationRate=s.rotationRate,i.rotationTime=s.rotationTime,i.expertSettings=s.expertSettings,i}return n(t,e),s(t,[{key:'bodyParameters',value:function(){var e={};return e.targetUserId=this.targetUserId,e.count=this.count,void 0!==this.userImpact&&(e.userImpact=this.userImpact),void 0!==this.filter&&(e.filter=this.filter),void 0!==this.booster&&(e.booster=this.booster),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.scenario&&(e.scenario=this.scenario),void 0!==this.returnProperties&&(e.returnProperties=this.returnProperties),void 0!==this.includedProperties&&(e.includedProperties=this.includedProperties),void 0!==this.diversity&&(e.diversity=this.diversity),void 0!==this.minRelevance&&(e.minRelevance=this.minRelevance),void 0!==this.rotationRate&&(e.rotationRate=this.rotationRate),void 0!==this.rotationTime&&(e.rotationTime=this.rotationTime),void 0!==this.expertSettings&&(e.expertSettings=this.expertSettings),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(i.Request);t.RecommendItemsToItem=c}])}); | ||
(function(e,t){'object'==typeof exports&&'object'==typeof module?module.exports=t():'function'==typeof define&&define.amd?define('recombee',[],t):'object'==typeof exports?exports.recombee=t():e.recombee=t()})('undefined'==typeof self?this:self,function(){return function(e){function t(r){if(a[r])return a[r].exports;var o=a[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var a={};return t.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var a=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(a,'a',a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='',t(t.s=4)}([function(e,t){'use strict';function a(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}t.Request=function e(t,r,o){a(this,e),this.method=t,this.path=r,this.timeout=o}},function(e,t){'use strict';function a(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function r(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function o(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var n=function(e){function t(e){a(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.name=o.constructor.name,'function'==typeof Error.captureStackTrace?Error.captureStackTrace(o,o.constructor):o.stack=new Error(e).stack,o}return o(t,e),t}(Error);t.ApiError=n},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=a(1),s=function(e){function t(e,a,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return i.request=e,i.statusCode=a,i}return n(t,e),t}(i.ApiError);t.ResponseError=s},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=a(1),s=function(e){function t(e){r(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Client did not get response within '+e.timeout+' ms'));return a.request=e,a}return n(t,e),t}(i.ApiError);t.TimeoutError=s},function(e,t,a){e.exports=a(5)},function(e,t,a){'use strict';t.ApiClient=a(6).ApiClient,t.ApiError=a(1).ApiError,t.ResponseError=a(2).ResponseError,t.TimeoutError=a(3).TimeoutError,t.MergeUsers=a(10).MergeUsers,t.AddDetailView=a(11).AddDetailView,t.AddPurchase=a(12).AddPurchase,t.AddRating=a(13).AddRating,t.AddCartAddition=a(14).AddCartAddition,t.AddBookmark=a(15).AddBookmark,t.SetViewPortion=a(16).SetViewPortion,t.RecommendItemsToUser=a(17).RecommendItemsToUser,t.RecommendItemsToItem=a(18).RecommendItemsToItem},function(e,t,a){'use strict';(function(e){function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}var o=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),n=a(8),i=a(9),s=function(){function t(a,o,n){r(this,t),this.databaseId=a,this.publicToken=o,this.options=n||{},this.baseUri=this.options.baseUri||e.env.RAPI_URI||'client-rapi.recombee.com',this.useHttps=!('useHttps'in this.options)||this.options.useHttps,this.async=!('async'in this.options)||this.options.async}return o(t,[{key:'send',value:function(e,t){var a=this;if(void 0===t&&window.Promise)return new Promise(function(t,r){a.send(e,function(e,a){e?r(e):t(a)})});var r=this._signUrl(e.path),o=(this.useHttps?'https://':'http://')+this.baseUri+r,n=new XMLHttpRequest;n.open('POST',o,this.async),n.setRequestHeader('Accept','application/json'),n.setRequestHeader('Content-Type','text/plain'),this.async&&(n.timeout=e.timeout),n.onreadystatechange=function(){if(4==this.readyState&&this.responseText)if(200==this.status){if(t)return t(null,JSON.parse(this.responseText));}else if(t)return t(new i.ResponseError(e,this.status,this.responseText))},n.ontimeout=function(){if(t)return t(new i.TimeoutError(e))},n.send(JSON.stringify(e.bodyParameters()))}},{key:'_signUrl',value:function(e){var t='/'+this.databaseId+e;t+=(-1==e.indexOf('?')?'?':'&')+'frontend_timestamp='+parseInt(new Date().getTime()/1e3);var a=new n('SHA-1','TEXT');return a.setHMACKey(this.publicToken,'TEXT'),a.update(t),t+='&frontend_sign='+a.getHMAC('HEX'),t}}]),t}();t.ApiClient=s}).call(t,a(7))},function(e){function t(){throw new Error('setTimeout has not been defined')}function a(){throw new Error('clearTimeout has not been defined')}function r(e){if(d===setTimeout)return setTimeout(e,0);if((d===t||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch(t){try{return d.call(null,e,0)}catch(t){return d.call(this,e,0)}}}function o(e){if(u===clearTimeout)return clearTimeout(e);if((u===a||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{return u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}function n(){b&&p&&(b=!1,p.length?m=p.concat(m):f=-1,m.length&&s())}function s(){if(!b){var e=r(n);b=!0;for(var t=m.length;t;){for(p=m,m=[];++f<t;)p&&p[f].run();f=-1,t=m.length}p=null,b=!1,o(e)}}function c(e,t){this.fun=e,this.array=t}function i(){}var d,u,l=e.exports={};(function(){try{d='function'==typeof setTimeout?setTimeout:t}catch(a){d=t}try{u='function'==typeof clearTimeout?clearTimeout:a}catch(t){u=a}})();var p,m=[],b=!1,f=-1;l.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];m.push(new c(e,t)),1!==m.length||b||r(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},l.title='browser',l.browser=!0,l.env={},l.argv=[],l.version='',l.versions={},l.on=i,l.addListener=i,l.once=i,l.off=i,l.removeListener=i,l.removeAllListeners=i,l.emit=i,l.prependListener=i,l.prependOnceListener=i,l.listeners=function(){return[]},l.binding=function(){throw new Error('process.binding is not supported')},l.cwd=function(){return'/'},l.chdir=function(){throw new Error('process.chdir is not supported')},l.umask=function(){return 0}},function(e,a,r){'use strict';var o;(function(n){function i(o,i,a){var s,_,S,R,H,m,f,T,r,t=0,e=[],h=0,n=!1,d=[],I=[],O=!1,y=!1,U=-1;if(a=a||{},s=a.encoding||'UTF8',r=a.numRounds||1,r!==parseInt(r,10)||1>r)throw Error('numRounds must a integer >= 1');if('SHA-1'===o)H=512,m=A,f=k,R=160,T=function(e){return e.slice()};else if(0===o.lastIndexOf('SHA-',0)){if(m=function(e,t){return g(e,t,o)},f=function(t,a,r,n){var e,i;if('SHA-224'===o||'SHA-256'===o)e=(a+65>>>9<<4)+15,i=16;else if('SHA-384'===o||'SHA-512'===o)e=(a+129>>>10<<5)+31,i=32;else throw Error('Unexpected error in SHA-2 implementation');for(;t.length<=e;)t.push(0);for(t[a>>>5]|=128<<24-a%32,a+=r,t[e]=4294967295&a,t[e-1]=0|a/4294967296,r=t.length,a=0;a<r;a+=i)n=g(t.slice(a,a+i),n,o);if('SHA-224'===o)t=[n[0],n[1],n[2],n[3],n[4],n[5],n[6]];else if('SHA-256'===o)t=n;else if('SHA-384'===o)t=[n[0].a,n[0].b,n[1].a,n[1].b,n[2].a,n[2].b,n[3].a,n[3].b,n[4].a,n[4].b,n[5].a,n[5].b];else if('SHA-512'===o)t=[n[0].a,n[0].b,n[1].a,n[1].b,n[2].a,n[2].b,n[3].a,n[3].b,n[4].a,n[4].b,n[5].a,n[5].b,n[6].a,n[6].b,n[7].a,n[7].b];else throw Error('Unexpected error in SHA-2 implementation');return t},T=function(e){return e.slice()},'SHA-224'===o)H=512,R=224;else if('SHA-256'===o)H=512,R=256;else if('SHA-384'===o)H=1024,R=384;else if('SHA-512'===o)H=1024,R=512;else throw Error('Chosen SHA variant is not supported');}else if(0===o.lastIndexOf('SHA3-',0)||0===o.lastIndexOf('SHAKE',0)){var x=6;if(m=v,T=function(t){var a,e=[];for(a=0;5>a;a+=1)e[a]=t[a].slice();return e},U=1,'SHA3-224'===o)H=1152,R=224;else if('SHA3-256'===o)H=1088,R=256;else if('SHA3-384'===o)H=832,R=384;else if('SHA3-512'===o)H=576,R=512;else if('SHAKE128'===o)H=1344,R=-1,x=31,y=!0;else if('SHAKE256'===o)H=1088,R=-1,x=31,y=!0;else throw Error('Chosen SHA variant is not supported');f=function(t,a,r,e,o){r=H;var i,s=x,c=[],u=r>>>5,n=0,l=a>>>5;for(i=0;i<l&&a>=r;i+=u)e=v(t.slice(i,i+u),e),a-=r;for(t=t.slice(i),a%=r;t.length<u;)t.push(0);for(i=a>>>3,t[i>>2]^=s<<8*(i%4),t[u-1]^=2147483648,e=v(t,e);32*c.length<o&&(t=e[n%5][0|n/5],c.push(t.b),!(32*c.length>=o));)c.push(t.a),n+=1,0==64*n%r&&v(null,e);return c}}else throw Error('Chosen SHA variant is not supported');S=P(i,s,U),_=E(o),this.setHMACKey=function(e,a,r){var i;if(!0==n)throw Error('HMAC key already set');if(!0==O)throw Error('Cannot set HMAC key after calling update');if(!0==y)throw Error('SHAKE is not supported for HMAC');if(s=(r||{}).encoding||'UTF8',a=P(a,s,U)(e),e=a.binLen,a=a.value,i=H>>>3,r=i/4-1,i<e/8){for(a=f(a,e,0,E(o),R);a.length<=r;)a.push(0);a[r]&=4294967040}else if(i>e/8){for(;a.length<=r;)a.push(0);a[r]&=4294967040}for(e=0;e<=r;e+=1)d[e]=909522486^a[e],I[e]=1549556828^a[e];_=m(d,_),t=H,n=!0},this.update=function(r){var a,o,n,i=0,s=H>>>5;for(a=S(r,e,h),r=a.binLen,o=a.value,a=r>>>5,n=0;n<a;n+=s)i+H<=r&&(_=m(o.slice(n,n+s),_),i+=H);t+=i,e=o.slice(i>>>5),h=r%H,O=!0},this.getHash=function(i,a){var s,b,g,d;if(!0==n)throw Error('Cannot call getHash after setting HMAC key');if(g=C(a),!0==y){if(-1===g.shakeLen)throw Error('shakeLen must be specified in options');R=g.shakeLen}switch(i){case'HEX':s=function(e){return c(e,R,U,g)};break;case'B64':s=function(e){return u(e,R,U,g)};break;case'BYTES':s=function(e){return l(e,R,U)};break;case'ARRAYBUFFER':try{b=new ArrayBuffer(0)}catch(e){throw Error('ARRAYBUFFER not supported by this environment')}s=function(e){return p(e,R,U)};break;default:throw Error('format must be HEX, B64, BYTES, or ARRAYBUFFER');}for(d=f(e.slice(),h,t,T(_),R),b=1;b<r;b+=1)!0==y&&0!=R%32&&(d[d.length-1]&=16777215>>>24-R%32),d=f(d,R,0,E(o),R);return s(d)},this.getHMAC=function(r,a){var i,s,b,d;if(!1==n)throw Error('Cannot call getHMAC without first setting HMAC key');switch(b=C(a),r){case'HEX':i=function(e){return c(e,R,U,b)};break;case'B64':i=function(e){return u(e,R,U,b)};break;case'BYTES':i=function(e){return l(e,R,U)};break;case'ARRAYBUFFER':try{i=new ArrayBuffer(0)}catch(e){throw Error('ARRAYBUFFER not supported by this environment')}i=function(e){return p(e,R,U)};break;default:throw Error('outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER');}return s=f(e.slice(),h,t,T(_),R),d=m(I,E(o)),d=f(s,R,H,d,R),i(d)}}function s(e,t){this.a=e,this.b=t}function c(t,r,a,o){var e='';r/=8;var i,n,s;for(s=-1===a?3:0,i=0;i<r;i+=1)n=t[i>>>2]>>>8*(s+i%4*a),e+='0123456789abcdef'.charAt(15&n>>>4)+'0123456789abcdef'.charAt(15&n);return o.outputUpper?e.toUpperCase():e}function u(t,r,a,o){var e,i,s,c,d='',u=r/8;for(c=-1===a?3:0,e=0;e<u;e+=3)for(i=e+1<u?t[e+1>>>2]:0,s=e+2<u?t[e+2>>>2]:0,s=(255&t[e>>>2]>>>8*(c+e%4*a))<<16|(255&i>>>8*(c+(e+1)%4*a))<<8|255&s>>>8*(c+(e+2)%4*a),i=0;4>i;i+=1)d+=8*e+6*i<=r?'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(63&s>>>6*(3-i)):o.b64Pad;return d}function l(t,r,a){var o='';r/=8;var e,n,i;for(i=-1===a?3:0,e=0;e<r;e+=1)n=255&t[e>>>2]>>>8*(i+e%4*a),o+=String.fromCharCode(n);return o}function p(t,r,a){r/=8;var o,e,n,i=new ArrayBuffer(r);for(n=new Uint8Array(i),e=-1===a?3:0,o=0;o<r;o+=1)n[o]=255&t[o>>>2]>>>8*(e+o%4*a);return i}function C(e){var t={outputUpper:!1,b64Pad:'=',shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty('b64Pad')&&(t.b64Pad=e.b64Pad),!0===e.hasOwnProperty('shakeLen')){if(0!=e.shakeLen%8)throw Error('shakeLen must be a multiple of 8');t.shakeLen=e.shakeLen}if('boolean'!=typeof t.outputUpper)throw Error('Invalid outputUpper formatting option');if('string'!=typeof t.b64Pad)throw Error('Invalid b64Pad formatting option');return t}function P(e,o,n){switch(o){case'UTF8':case'UTF16BE':case'UTF16LE':break;default:throw Error('encoding must be UTF8, UTF16BE, or UTF16LE');}switch(e){case'HEX':e=function(e,t,a){var r,o,i,s,d,l,u=e.length;if(0!=u%2)throw Error('String of HEX type must be in byte increments');for(t=t||[0],a=a||0,d=a>>>3,l=-1===n?3:0,r=0;r<u;r+=2){if(o=parseInt(e.substr(r,2),16),isNaN(o))throw Error('String of HEX type contains invalid characters');for(s=(r>>>1)+d,i=s>>>2;t.length<=i;)t.push(0);t[i]|=o<<8*(l+s%4*n)}return{value:t,binLen:4*u+a}};break;case'TEXT':e=function(e,a,i){var s,c,d,l,m,b,u,r,t=0;if(a=a||[0],i=i||0,m=i>>>3,'UTF8'===o)for(r=-1===n?3:0,d=0;d<e.length;d+=1)for(s=e.charCodeAt(d),c=[],128>s?c.push(s):2048>s?(c.push(192|s>>>6),c.push(128|63&s)):55296>s||57344<=s?c.push(224|s>>>12,128|63&s>>>6,128|63&s):(d+=1,s=65536+((1023&s)<<10|1023&e.charCodeAt(d)),c.push(240|s>>>18,128|63&s>>>12,128|63&s>>>6,128|63&s)),l=0;l<c.length;l+=1){for(u=t+m,b=u>>>2;a.length<=b;)a.push(0);a[b]|=c[l]<<8*(r+u%4*n),t+=1}else if('UTF16BE'===o||'UTF16LE'===o)for(r=-1===n?2:0,c='UTF16LE'==o&&1!==n||'UTF16LE'!=o&&1===n,d=0;d<e.length;d+=1){for(s=e.charCodeAt(d),!0===c&&(l=255&s,s=l<<8|s>>>8),u=t+m,b=u>>>2;a.length<=b;)a.push(0);a[b]|=s<<8*(r+u%4*n),t+=2}return{value:a,binLen:8*t+i}};break;case'B64':e=function(e,a,o){var i,s,d,l,p,m,u,r,t=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error('Invalid character in base-64 string');if(s=e.indexOf('='),e=e.replace(/\=/g,''),-1!==s&&s<e.length)throw Error('Invalid \'=\' found in base-64 string');for(a=a||[0],o=o||0,m=o>>>3,r=-1===n?3:0,s=0;s<e.length;s+=4){for(p=e.substr(s,4),d=l=0;d<p.length;d+=1)i='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.indexOf(p[d]),l|=i<<18-6*d;for(d=0;d<p.length-1;d+=1){for(u=t+m,i=u>>>2;a.length<=i;)a.push(0);a[i]|=(255&l>>>16-8*d)<<8*(r+u%4*n),t+=1}}return{value:a,binLen:8*t+o}};break;case'BYTES':e=function(e,t,a){var r,o,i,s,d,u;for(t=t||[0],a=a||0,i=a>>>3,u=-1===n?3:0,o=0;o<e.length;o+=1)r=e.charCodeAt(o),d=o+i,s=d>>>2,t.length<=s&&t.push(0),t[s]|=r<<8*(u+d%4*n);return{value:t,binLen:8*e.length+a}};break;case'ARRAYBUFFER':try{e=new ArrayBuffer(0)}catch(t){throw Error('ARRAYBUFFER not supported by this environment')}e=function(e,t,a){var r,o,i,s,d,u;for(t=t||[0],a=a||0,o=a>>>3,d=-1===n?3:0,u=new Uint8Array(e),r=0;r<e.byteLength;r+=1)s=r+o,i=s>>>2,t.length<=i&&t.push(0),t[i]|=u[r]<<8*(d+s%4*n);return{value:t,binLen:8*e.byteLength+a}};break;default:throw Error('format must be HEX, TEXT, B64, BYTES, or ARRAYBUFFER');}return e}function m(e,t){return e<<t|e>>>32-t}function b(e,t){return 32<t?(t-=32,new s(e.b<<t|e.a>>>32-t,e.a<<t|e.b>>>32-t)):0===t?e:new s(e.a<<t|e.b>>>32-t,e.b<<t|e.a>>>32-t)}function f(e,t){return e>>>t|e<<32-t}function h(e,t){var a=null,a=new s(e.a,e.b);return a=32>=t?new s(a.a>>>t|4294967295&a.b<<32-t,a.b>>>t|4294967295&a.a<<32-t):new s(a.b>>>t-32|4294967295&a.a<<64-t,a.a>>>t-32|4294967295&a.b<<64-t)}function t(e,t){var a=null;return a=32>=t?new s(e.a>>>t,e.b>>>t|4294967295&e.a<<32-t):new s(0,e.a>>>t-32)}function I(e,t,a){return e&t^~e&a}function _(e,t,a){return new s(e.a&t.a^~e.a&a.a,e.b&t.b^~e.b&a.b)}function S(e,t,a){return e&t^e&a^t&a}function R(e,t,a){return new s(e.a&t.a^e.a&a.a^t.a&a.a,e.b&t.b^e.b&a.b^t.b&a.b)}function T(e){return f(e,2)^f(e,13)^f(e,22)}function O(e){var t=h(e,28),a=h(e,34);return e=h(e,39),new s(t.a^a.a^e.a,t.b^a.b^e.b)}function U(e){return f(e,6)^f(e,11)^f(e,25)}function j(e){var t=h(e,14),a=h(e,18);return e=h(e,41),new s(t.a^a.a^e.a,t.b^a.b^e.b)}function Y(e){return f(e,7)^f(e,18)^e>>>3}function M(e){var r=h(e,1),a=h(e,8);return e=t(e,7),new s(r.a^a.a^e.a,r.b^a.b^e.b)}function N(e){return f(e,17)^f(e,19)^e>>>10}function Q(e){var r=h(e,19),a=h(e,61);return e=t(e,6),new s(r.a^a.a^e.a,r.b^a.b^e.b)}function $(e,t){var a=(65535&e)+(65535&t);return(65535&(e>>>16)+(t>>>16)+(a>>>16))<<16|65535&a}function G(t,r,a,o){var e=(65535&t)+(65535&r)+(65535&a)+(65535&o);return(65535&(t>>>16)+(r>>>16)+(a>>>16)+(o>>>16)+(e>>>16))<<16|65535&e}function ee(t,r,a,o,e){var n=(65535&t)+(65535&r)+(65535&a)+(65535&o)+(65535&e);return(65535&(t>>>16)+(r>>>16)+(a>>>16)+(o>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function H(t,r){var a,o,e;return a=(65535&t.b)+(65535&r.b),o=(t.b>>>16)+(r.b>>>16)+(a>>>16),e=(65535&o)<<16|65535&a,a=(65535&t.a)+(65535&r.a)+(o>>>16),o=(t.a>>>16)+(r.a>>>16)+(a>>>16),new s((65535&o)<<16|65535&a,e)}function te(t,r,a,o){var e,i,n;return e=(65535&t.b)+(65535&r.b)+(65535&a.b)+(65535&o.b),i=(t.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o.b>>>16)+(e>>>16),n=(65535&i)<<16|65535&e,e=(65535&t.a)+(65535&r.a)+(65535&a.a)+(65535&o.a)+(i>>>16),i=(t.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o.a>>>16)+(e>>>16),new s((65535&i)<<16|65535&e,n)}function ae(t,r,a,o,e){var i,n,c;return i=(65535&t.b)+(65535&r.b)+(65535&a.b)+(65535&o.b)+(65535&e.b),n=(t.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o.b>>>16)+(e.b>>>16)+(i>>>16),c=(65535&n)<<16|65535&i,i=(65535&t.a)+(65535&r.a)+(65535&a.a)+(65535&o.a)+(65535&e.a)+(n>>>16),n=(t.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o.a>>>16)+(e.a>>>16)+(i>>>16),new s((65535&n)<<16|65535&i,c)}function y(e,t){return new s(e.a^t.a,e.b^t.b)}function E(e){var t,r=[];if('SHA-1'===e)r=[1732584193,4023233417,2562383102,271733878,3285377520];else if(0===e.lastIndexOf('SHA-',0))switch(r=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],t=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],e){case'SHA-224':break;case'SHA-256':r=t;break;case'SHA-384':r=[new s(3418070365,r[0]),new s(1654270250,r[1]),new s(2438529370,r[2]),new s(355462360,r[3]),new s(1731405415,r[4]),new s(41048885895,r[5]),new s(3675008525,r[6]),new s(1203062813,r[7])];break;case'SHA-512':r=[new s(t[0],4089235720),new s(t[1],2227873595),new s(t[2],4271175723),new s(t[3],1595750129),new s(t[4],2917565137),new s(t[5],725511199),new s(t[6],4215389547),new s(t[7],327033209)];break;default:throw Error('Unknown SHA variant');}else if(0===e.lastIndexOf('SHA3-',0)||0===e.lastIndexOf('SHAKE',0))for(e=0;5>e;e+=1)r[e]=[new s(0,0),new s(0,0),new s(0,0),new s(0,0),new s(0,0)];else throw Error('No SHA variants supported');return r}function A(t,r){var a,e,o,n,i,s,c,u=[];for(a=r[0],e=r[1],o=r[2],n=r[3],i=r[4],c=0;80>c;c+=1)u[c]=16>c?t[c]:m(u[c-3]^u[c-8]^u[c-14]^u[c-16],1),s=20>c?ee(m(a,5),e&o^~e&n,i,1518500249,u[c]):40>c?ee(m(a,5),e^o^n,i,1859775393,u[c]):60>c?ee(m(a,5),S(e,o,n),i,2400959708,u[c]):ee(m(a,5),e^o^n,i,3395469782,u[c]),i=n,n=o,o=m(e,30),e=a,a=s;return r[0]=$(a,r[0]),r[1]=$(e,r[1]),r[2]=$(o,r[2]),r[3]=$(n,r[3]),r[4]=$(i,r[4]),r}function k(t,r,a,o){var e;for(e=(r+65>>>9<<4)+15;t.length<=e;)t.push(0);for(t[r>>>5]|=128<<24-r%32,r+=a,t[e]=4294967295&r,t[e-1]=0|r/4294967296,r=t.length,e=0;e<r;e+=16)o=A(t.slice(e,e+16),o);return o}function g(o,i,a){var c,e,b,n,h,l,p,f,m,g,u,r,t,P,v,y,A,k,x,w,F,C,D,B=[];if('SHA-224'===a||'SHA-256'===a)g=64,r=1,C=Number,t=$,P=G,v=ee,y=Y,A=N,k=T,x=U,F=S,w=I,D=L;else if('SHA-384'===a||'SHA-512'===a)g=80,r=2,C=s,t=H,P=te,v=ae,y=M,A=Q,k=O,x=j,F=R,w=_,D=d;else throw Error('Unexpected error in SHA-2 implementation');for(a=i[0],c=i[1],e=i[2],b=i[3],n=i[4],h=i[5],l=i[6],p=i[7],u=0;u<g;u+=1)16>u?(m=u*r,f=o.length<=m?0:o[m],m=o.length<=m+1?0:o[m+1],B[u]=new C(f,m)):B[u]=P(A(B[u-2]),B[u-7],y(B[u-15]),B[u-16]),f=v(p,x(n),w(n,h,l),D[u],B[u]),m=t(k(a),F(a,c,e)),p=l,l=h,h=n,n=t(b,f),b=e,e=c,c=a,a=t(f,m);return i[0]=t(a,i[0]),i[1]=t(c,i[1]),i[2]=t(e,i[2]),i[3]=t(b,i[3]),i[4]=t(n,i[4]),i[5]=t(h,i[5]),i[6]=t(l,i[6]),i[7]=t(p,i[7]),i}function v(t,r){var a,o,e,i,n=[],c=[];if(null!==t)for(o=0;o<t.length;o+=2)r[(o>>>1)%5][0|(o>>>1)/5]=y(r[(o>>>1)%5][0|(o>>>1)/5],new s(t[o+1],t[o]));for(a=0;24>a;a+=1){for(i=E('SHA3-'),o=0;5>o;o+=1){e=r[o][0];var d=r[o][1],u=r[o][2],l=r[o][3],p=r[o][4];n[o]=new s(e.a^d.a^u.a^l.a^p.a,e.b^d.b^u.b^l.b^p.b)}for(o=0;5>o;o+=1)c[o]=y(n[(o+4)%5],b(n[(o+1)%5],1));for(o=0;5>o;o+=1)for(e=0;5>e;e+=1)r[o][e]=y(r[o][e],c[o]);for(o=0;5>o;o+=1)for(e=0;5>e;e+=1)i[e][(2*o+3*e)%5]=b(r[o][e],x[o][e]);for(o=0;5>o;o+=1)for(e=0;5>e;e+=1)r[o][e]=y(i[o][e],new s(~i[(o+1)%5][e].a&i[(o+2)%5][e].a,~i[(o+1)%5][e].b&i[(o+2)%5][e].b));r[0][0]=y(r[0][0],w[a])}return r}var L,d,x,w;L=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=[new s(L[0],3609767458),new s(L[1],602891725),new s(L[2],3964484399),new s(L[3],2173295548),new s(L[4],4081628472),new s(L[5],3053834265),new s(L[6],2937671579),new s(L[7],3664609560),new s(L[8],2734883394),new s(L[9],1164996542),new s(L[10],1323610764),new s(L[11],3590304994),new s(L[12],4068182383),new s(L[13],991336113),new s(L[14],633803317),new s(L[15],3479774868),new s(L[16],2666613458),new s(L[17],944711139),new s(L[18],2341262773),new s(L[19],2007800933),new s(L[20],1495990901),new s(L[21],1856431235),new s(L[22],3175218132),new s(L[23],2198950837),new s(L[24],3999719339),new s(L[25],766784016),new s(L[26],2566594879),new s(L[27],3203337956),new s(L[28],1034457026),new s(L[29],2466948901),new s(L[30],3758326383),new s(L[31],168717936),new s(L[32],1188179964),new s(L[33],1546045734),new s(L[34],1522805485),new s(L[35],2643833823),new s(L[36],2343527390),new s(L[37],1014477480),new s(L[38],1206759142),new s(L[39],344077627),new s(L[40],1290863460),new s(L[41],3158454273),new s(L[42],3505952657),new s(L[43],106217008),new s(L[44],3606008344),new s(L[45],1432725776),new s(L[46],1467031594),new s(L[47],851169720),new s(L[48],3100823752),new s(L[49],1363258195),new s(L[50],3750685593),new s(L[51],3785050280),new s(L[52],3318307427),new s(L[53],3812723403),new s(L[54],2003034995),new s(L[55],3602036899),new s(L[56],1575990012),new s(L[57],1125592928),new s(L[58],2716904306),new s(L[59],442776044),new s(L[60],593698344),new s(L[61],3733110249),new s(L[62],2999351573),new s(L[63],3815920427),new s(3391569614,3928383900),new s(3515267271,566280711),new s(3940187606,3454069534),new s(4118630271,4000239992),new s(116418474,1914138554),new s(174292421,2731055270),new s(289380356,3203993006),new s(460393269,320620315),new s(685471733,587496836),new s(852142971,1086792851),new s(1017036298,365543100),new s(1126000580,2618297676),new s(1288033470,3409855158),new s(1501505948,4234509866),new s(1607167915,987167468),new s(1816402316,1246189591)],w=[new s(0,1),new s(0,32898),new s(2147483648,32906),new s(2147483648,2147516416),new s(0,32907),new s(0,2147483649),new s(2147483648,2147516545),new s(2147483648,32777),new s(0,138),new s(0,136),new s(0,2147516425),new s(0,2147483658),new s(0,2147516555),new s(2147483648,139),new s(2147483648,32905),new s(2147483648,32771),new s(2147483648,32770),new s(2147483648,128),new s(0,32778),new s(2147483648,2147483658),new s(2147483648,2147516545),new s(2147483648,32896),new s(0,2147483649),new s(2147483648,2147516424)],x=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]],(o=function(){return i}.call(a,r,a,e),!(o!==void 0&&(e.exports=o)))})(this)},function(e,t,a){'use strict';t.ApiError=a(1).ApiError,t.ResponseError=a(2).ResponseError,t.TimeoutError=a(3).TimeoutError},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'PUT','/users/'+encodeURIComponent(e)+'/merge/'+encodeURIComponent(a),3e4,!1));return i.targetUserId=e,i.sourceUserId=a,n=n||{},i.cascadeCreate=n.cascadeCreate,i}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={cascadeCreate:void 0===this.cascadeCreate||this.cascadeCreate};return e}}]),t}(s.Request);t.MergeUsers=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/detailviews/',3e3,!1));return i.userId=e,i.itemId=a,n=n||{},i.timestamp=n.timestamp,i.duration=n.duration,i.cascadeCreate=n.cascadeCreate,i.recommId=n.recommId,i.additionalData=n.additionalData,i}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.duration&&(e.duration=this.duration),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.recommId&&(e.recommId=this.recommId),void 0!==this.additionalData&&(e.additionalData=this.additionalData),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(s.Request);t.AddDetailView=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/purchases/',3e3,!1));return i.userId=e,i.itemId=a,n=n||{},i.timestamp=n.timestamp,i.cascadeCreate=n.cascadeCreate,i.amount=n.amount,i.price=n.price,i.profit=n.profit,i.recommId=n.recommId,i.additionalData=n.additionalData,i}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.amount&&(e.amount=this.amount),void 0!==this.price&&(e.price=this.price),void 0!==this.profit&&(e.profit=this.profit),void 0!==this.recommId&&(e.recommId=this.recommId),void 0!==this.additionalData&&(e.additionalData=this.additionalData),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(s.Request);t.AddPurchase=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n,i){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/ratings/',3e3,!1));return s.userId=e,s.itemId=a,s.rating=n,i=i||{},s.timestamp=i.timestamp,s.cascadeCreate=i.cascadeCreate,s.recommId=i.recommId,s.additionalData=i.additionalData,s}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,e.rating=this.rating,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.recommId&&(e.recommId=this.recommId),void 0!==this.additionalData&&(e.additionalData=this.additionalData),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(s.Request);t.AddRating=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/cartadditions/',3e3,!1));return i.userId=e,i.itemId=a,n=n||{},i.timestamp=n.timestamp,i.cascadeCreate=n.cascadeCreate,i.amount=n.amount,i.price=n.price,i.recommId=n.recommId,i.additionalData=n.additionalData,i}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.amount&&(e.amount=this.amount),void 0!==this.price&&(e.price=this.price),void 0!==this.recommId&&(e.recommId=this.recommId),void 0!==this.additionalData&&(e.additionalData=this.additionalData),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(s.Request);t.AddCartAddition=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/bookmarks/',3e3,!1));return i.userId=e,i.itemId=a,n=n||{},i.timestamp=n.timestamp,i.cascadeCreate=n.cascadeCreate,i.recommId=n.recommId,i.additionalData=n.additionalData,i}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.recommId&&(e.recommId=this.recommId),void 0!==this.additionalData&&(e.additionalData=this.additionalData),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(s.Request);t.AddBookmark=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n,i){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/viewportions/',3e3,!1));return s.userId=e,s.itemId=a,s.portion=n,i=i||{},s.sessionId=i.sessionId,s.timestamp=i.timestamp,s.cascadeCreate=i.cascadeCreate,s.recommId=i.recommId,s.additionalData=i.additionalData,s}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={};return e.userId=this.userId,e.itemId=this.itemId,e.portion=this.portion,void 0!==this.sessionId&&(e.sessionId=this.sessionId),void 0!==this.timestamp&&(e.timestamp=this.timestamp),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.recommId&&(e.recommId=this.recommId),void 0!==this.additionalData&&(e.additionalData=this.additionalData),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(s.Request);t.SetViewPortion=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/recomms/users/'+encodeURIComponent(e)+'/items/',9e3,!1));return i.userId=e,i.count=a,n=n||{},i.filter=n.filter,i.booster=n.booster,i.cascadeCreate=n.cascadeCreate,i.scenario=n.scenario,i.returnProperties=n.returnProperties,i.includedProperties=n.includedProperties,i.diversity=n.diversity,i.minRelevance=n.minRelevance,i.rotationRate=n.rotationRate,i.rotationTime=n.rotationTime,i.expertSettings=n.expertSettings,i.returnAbGroup=n.returnAbGroup,i}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={};return e.count=this.count,void 0!==this.filter&&(e.filter=this.filter),void 0!==this.booster&&(e.booster=this.booster),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.scenario&&(e.scenario=this.scenario),void 0!==this.returnProperties&&(e.returnProperties=this.returnProperties),void 0!==this.includedProperties&&(e.includedProperties=this.includedProperties),void 0!==this.diversity&&(e.diversity=this.diversity),void 0!==this.minRelevance&&(e.minRelevance=this.minRelevance),void 0!==this.rotationRate&&(e.rotationRate=this.rotationRate),void 0!==this.rotationTime&&(e.rotationTime=this.rotationTime),void 0!==this.expertSettings&&(e.expertSettings=this.expertSettings),void 0!==this.returnAbGroup&&(e.returnAbGroup=this.returnAbGroup),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(s.Request);t.RecommendItemsToUser=c},function(e,t,a){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function n(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var a,r=0;r<t.length;r++)a=t[r],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(0),c=function(e){function t(e,a,n,i){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'POST','/recomms/items/'+encodeURIComponent(e)+'/items/',9e3,!1));return s.itemId=e,s.targetUserId=a,s.count=n,i=i||{},s.userImpact=i.userImpact,s.filter=i.filter,s.booster=i.booster,s.cascadeCreate=i.cascadeCreate,s.scenario=i.scenario,s.returnProperties=i.returnProperties,s.includedProperties=i.includedProperties,s.diversity=i.diversity,s.minRelevance=i.minRelevance,s.rotationRate=i.rotationRate,s.rotationTime=i.rotationTime,s.expertSettings=i.expertSettings,s.returnAbGroup=i.returnAbGroup,s}return n(t,e),i(t,[{key:'bodyParameters',value:function(){var e={};return e.targetUserId=this.targetUserId,e.count=this.count,void 0!==this.userImpact&&(e.userImpact=this.userImpact),void 0!==this.filter&&(e.filter=this.filter),void 0!==this.booster&&(e.booster=this.booster),void 0!==this.cascadeCreate&&(e.cascadeCreate=this.cascadeCreate),void 0!==this.scenario&&(e.scenario=this.scenario),void 0!==this.returnProperties&&(e.returnProperties=this.returnProperties),void 0!==this.includedProperties&&(e.includedProperties=this.includedProperties),void 0!==this.diversity&&(e.diversity=this.diversity),void 0!==this.minRelevance&&(e.minRelevance=this.minRelevance),void 0!==this.rotationRate&&(e.rotationRate=this.rotationRate),void 0!==this.rotationTime&&(e.rotationTime=this.rotationTime),void 0!==this.expertSettings&&(e.expertSettings=this.expertSettings),void 0!==this.returnAbGroup&&(e.returnAbGroup=this.returnAbGroup),e.cascadeCreate=void 0===this.cascadeCreate||this.cascadeCreate,e}}]),t}(s.Request);t.RecommendItemsToItem=c}])}); | ||
//# sourceMappingURL=recombee-api-client.min.js.map |
{ | ||
"name": "recombee-js-api-client", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"description": "Client-side js library for easy use of the Recombee recommendation API", | ||
@@ -5,0 +5,0 @@ "browser": "./src/index.js", |
@@ -18,3 +18,3 @@ # Recombee API Client | ||
```js | ||
<script src="https://cdn.jsdelivr.net/gh/recombee/js-api-client@2.2.1/dist/recombee-api-client.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/recombee/js-api-client@2.3.0/dist/recombee-api-client.min.js"></script> | ||
``` | ||
@@ -151,3 +151,3 @@ | ||
<script src="https://cdn.jsdelivr.net/gh/recombee/js-api-client@2.2.1/dist/recombee-api-client.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/recombee/js-api-client@2.3.0/dist/recombee-api-client.min.js"></script> | ||
@@ -154,0 +154,0 @@ <script type="text/javascript"> |
@@ -28,2 +28,5 @@ /* | ||
* - Description: If this bookmark is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -38,2 +41,3 @@ constructor(userId, itemId, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -59,2 +63,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
params.cascadeCreate = (this.cascadeCreate !== undefined) ? this.cascadeCreate : true; | ||
@@ -61,0 +68,0 @@ return params; |
@@ -34,2 +34,5 @@ /* | ||
* - Description: If this cart addition is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -46,2 +49,3 @@ constructor(userId, itemId, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -73,2 +77,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
params.cascadeCreate = (this.cascadeCreate !== undefined) ? this.cascadeCreate : true; | ||
@@ -75,0 +82,0 @@ return params; |
@@ -31,2 +31,5 @@ /* | ||
* - Description: If this detail view is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -42,2 +45,3 @@ constructor(userId, itemId, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -66,2 +70,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
params.cascadeCreate = (this.cascadeCreate !== undefined) ? this.cascadeCreate : true; | ||
@@ -68,0 +75,0 @@ return params; |
@@ -37,2 +37,5 @@ /* | ||
* - Description: If this purchase is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -50,2 +53,3 @@ constructor(userId, itemId, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -80,2 +84,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
params.cascadeCreate = (this.cascadeCreate !== undefined) ? this.cascadeCreate : true; | ||
@@ -82,0 +89,0 @@ return params; |
@@ -29,2 +29,5 @@ /* | ||
* - Description: If this rating is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -40,2 +43,3 @@ constructor(userId, itemId, rating, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -62,2 +66,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
params.cascadeCreate = (this.cascadeCreate !== undefined) ? this.cascadeCreate : true; | ||
@@ -64,0 +71,0 @@ return params; |
@@ -120,2 +120,5 @@ /* | ||
* - Description: Dictionary of custom options. | ||
* - *returnAbGroup* | ||
* - Type: boolean | ||
* - Description: If there is a custom AB-testing running, return name of group to which the request belongs. | ||
*/ | ||
@@ -140,2 +143,3 @@ constructor(itemId, targetUserId, count, optional) { | ||
this.expertSettings = optional.expertSettings; | ||
this.returnAbGroup = optional.returnAbGroup; | ||
} | ||
@@ -188,2 +192,5 @@ | ||
if(this.returnAbGroup !== undefined) | ||
params.returnAbGroup = this.returnAbGroup; | ||
params.cascadeCreate = (this.cascadeCreate !== undefined) ? this.cascadeCreate : true; | ||
@@ -190,0 +197,0 @@ return params; |
@@ -104,2 +104,5 @@ /* | ||
* - Description: Dictionary of custom options. | ||
* - *returnAbGroup* | ||
* - Type: boolean | ||
* - Description: If there is a custom AB-testing running, return name of group to which the request belongs. | ||
*/ | ||
@@ -122,2 +125,3 @@ constructor(userId, count, optional) { | ||
this.expertSettings = optional.expertSettings; | ||
this.returnAbGroup = optional.returnAbGroup; | ||
} | ||
@@ -166,2 +170,5 @@ | ||
if(this.returnAbGroup !== undefined) | ||
params.returnAbGroup = this.returnAbGroup; | ||
params.cascadeCreate = (this.cascadeCreate !== undefined) ? this.cascadeCreate : true; | ||
@@ -168,0 +175,0 @@ return params; |
@@ -33,2 +33,5 @@ /* | ||
* - Description: If this view portion is based on a recommendation request, `recommId` is the id of the clicked recommendation. | ||
* - *additionalData* | ||
* - Type: | ||
* - Description: A dictionary of additional data for the interaction. | ||
*/ | ||
@@ -45,2 +48,3 @@ constructor(userId, itemId, portion, optional) { | ||
this.recommId = optional.recommId; | ||
this.additionalData = optional.additionalData; | ||
} | ||
@@ -70,2 +74,5 @@ | ||
if(this.additionalData !== undefined) | ||
params.additionalData = this.additionalData; | ||
params.cascadeCreate = (this.cascadeCreate !== undefined) ? this.cascadeCreate : true; | ||
@@ -72,0 +79,0 @@ return params; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1873410
3505