@foxford/foxford-js-sdk
Advanced tools
Comparing version 2.0.12 to 2.1.33
@@ -251,3 +251,3 @@ import { AxiosInstance } from 'axios' | ||
export interface FoxfordI { | ||
export interface IFoxford { | ||
api: AxiosInstance; | ||
@@ -265,4 +265,4 @@ user: UserServiceI; | ||
export class Foxford implements FoxfordI { | ||
export class Foxford implements IFoxford { | ||
constructor(config?: FoxfordConfig); | ||
} |
@@ -1,2 +0,2 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var r=require('axios');var e=require('axios-retry');function t(r){return r&&'object'==typeof r&&'default'in r?r:{default:r}}var a=t(r);var o=t(e);function n(r,e,t,a,o,n,i){try{var s=r[n](i);var c=s.value}catch(r){return void t(r)}s.done?e(c):Promise.resolve(c).then(a,o)}function i(r){return function(){var e=this,t=arguments;return new Promise(((a,o)=>{var i=r.apply(e,t);function s(r){n(i,a,o,s,c,"next",r)}function c(r){n(i,a,o,s,c,"throw",r)}s(void 0)}))}}var s='https://foxford.ru';var c=r=>{try{return!!r()}catch(r){return!0}};var v={}.toString;var u=it=>v.call(it).slice(8,-1);var l=''.split;var f=c((()=>!Object('z').propertyIsEnumerable(0)))?it=>'String'==u(it)?l.call(it,''):Object(it):Object;var d=it=>{if(null==it)throw TypeError("Can't call method on "+it);return it};var p=it=>f(d(it));var h='undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:'undefined'!=typeof global?global:'undefined'!=typeof self?self:{};function y(r){var e={exports:{}};return r(e,e.exports),e.exports}var g=it=>it&&it.Math==Math&⁢var m=g('object'==typeof globalThis&&globalThis)||g('object'==typeof window&&window)||g('object'==typeof self&&self)||g('object'==typeof h&&h)||function(){return this}()||Function("","return this")();var b=!c((()=>7!=Object.defineProperty({},1,{get:()=>7})[1]));var w=it=>'object'==typeof it?null!==it:'function'==typeof it;var j=m.document;var O=w(j)&&w(j.createElement);var S=it=>O?j.createElement(it):{};var P=!b&&!c((()=>7!=Object.defineProperty(S('div'),'a',{get:()=>7}).a));var E=it=>{if(!w(it))throw TypeError(String(it)+' is not an object');return it};var T=(r,e)=>{if(!w(r))return r;var t,a;if(e&&'function'==typeof(t=r.toString)&&!w(a=t.call(r)))return a;if('function'==typeof(t=r.valueOf)&&!w(a=t.call(r)))return a;if(!e&&'function'==typeof(t=r.toString)&&!w(a=t.call(r)))return a;throw TypeError("Can't convert object to primitive value")};var C=Object.defineProperty;var x={f:b?C:(r,e,t)=>{if(E(r),e=T(e,!0),E(t),P)try{return C(r,e,t)}catch(r){}if('get'in t||'set'in t)throw TypeError('Accessors not supported');return'value'in t&&(r[e]=t.value),r}};var _=(r,e)=>({enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:e});var k=b?(r,e,t)=>x.f(r,e,_(1,t)):(r,e,t)=>(r[e]=t,r);var A=(r,e)=>{try{k(m,r,e)}catch(t){m[r]=e}return e};var L=m["__core-js_shared__"]||A("__core-js_shared__",{});var R=y((r=>{(r.exports=(r,e)=>L[r]||(L[r]=void 0!==e?e:{}))('versions',[]).push({version:'3.8.2',mode:'global',copyright:'© 2021 Denis Pushkarev (zloirock.ru)'})}));var I={}.hasOwnProperty;var U=(it,r)=>I.call(it,r);var M=0;var N=Math.random();var F=r=>'Symbol('+String(void 0===r?'':r)+')_'+(++M+N).toString(36);var D=!!Object.getOwnPropertySymbols&&!c((()=>!String(Symbol())));var q=D&&!Symbol.sham&&'symbol'==typeof Symbol.iterator;var G=R('wks');var W=m.Symbol;var V=q?W:W&&W.withoutSetter||F;var z=r=>(U(G,r)||(G[r]=D&&U(W,r)?W[r]:V('Symbol.'+r)),G[r]);var H=Math.ceil;var B=Math.floor;var X=r=>isNaN(r=+r)?0:(r>0?B:H)(r);var Y=Math.min;var K=r=>r>0?Y(X(r),9007199254740991):0;var J=Math.max;var Z=Math.min;var $=r=>(e,t,a)=>{var o=p(e);var n=K(o.length);var i=((r,e)=>{var t=X(r);return t<0?J(t+e,0):Z(t,e)})(a,n);var s;if(r&&t!=t){for(;n>i;)if((s=o[i++])!=s)return!0}else for(;n>i;i++)if((r||i in o)&&o[i]===t)return r||i||0;return!r&&-1};var Q={includes:$(!0),indexOf:$(!1)};var rr={};var er=Q.indexOf;var tr=(r,e)=>{var t=p(r);var a=0;var o=[];var n;for(n in t)!U(rr,n)&&U(t,n)&&o.push(n);for(;e.length>a;)U(t,n=e[a++])&&(~er(o,n)||o.push(n));return o};var ar=['constructor','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','toLocaleString','toString','valueOf'];var or=Object.keys||(r=>tr(r,ar));var nr=b?Object.defineProperties:(r,e)=>{E(r);var t=or(e);var a=t.length;var o=0;var n;for(;a>o;)x.f(r,n=t[o++],e[n]);return r};var ir=m;var sr=r=>'function'==typeof r?r:void 0;var cr=function(r,e){return arguments.length<2?sr(ir[r])||sr(m[r]):ir[r]&&ir[r][e]||m[r]&&m[r][e]};var vr=cr('document','documentElement');var ur=R('keys');var lr=r=>ur[r]||(ur[r]=F(r));var fr=lr('IE_PROTO');var dr=()=>{};var pr=r=>"<script>"+r+"</script>";var hr;var yr=()=>{try{hr=document.domain&&new ActiveXObject('htmlfile')}catch(r){}var r,e;yr=hr?(r=>{r.write(pr('')),r.close();var e=r.parentWindow.Object;return r=null,e})(hr):((r=S('iframe')).style.display='none',vr.appendChild(r),r.src=String("javascript:"),(e=r.contentWindow.document).open(),e.write(pr('document.F=Object')),e.close(),e.F);var t=ar.length;for(;t--;)delete yr.prototype[ar[t]];return yr()};rr[fr]=!0;var gr=Object.create||((r,e)=>{var t;return null!==r?(dr.prototype=E(r),t=new dr,dr.prototype=null,t[fr]=r):t=yr(),void 0===e?t:nr(t,e)});var mr=z('unscopables');var br=Array.prototype;null==br[mr]&&x.f(br,mr,{configurable:!0,value:gr(null)});var wr=r=>{br[mr][r]=!0};var jr={};var Or=Function.toString;'function'!=typeof L.inspectSource&&(L.inspectSource=it=>Or.call(it));var Sr=L.inspectSource;var Pr=m.WeakMap;var Er,Tr,Cr;if('function'==typeof Pr&&/native code/.test(Sr(Pr))){var xr=L.state||(L.state=new(0,m.WeakMap));var _r=xr.get;var kr=xr.has;var Ar=xr.set;Er=(it,r)=>(r.facade=it,Ar.call(xr,it,r),r),Tr=it=>_r.call(xr,it)||{},Cr=it=>kr.call(xr,it)}else{var Lr=lr('state');rr[Lr]=!0,Er=(it,r)=>(r.facade=it,k(it,Lr,r),r),Tr=it=>U(it,Lr)?it[Lr]:{},Cr=it=>U(it,Lr)}var Rr={set:Er,get:Tr,has:Cr,enforce:it=>Cr(it)?Tr(it):Er(it,{}),getterFor:r=>it=>{var e;if(!w(it)||(e=Tr(it)).type!==r)throw TypeError('Incompatible receiver, '+r+' required');return e}};var Ir={}.propertyIsEnumerable;var Ur=Object.getOwnPropertyDescriptor;var Mr={f:Ur&&!Ir.call({1:2},1)?function(r){var e=Ur(this,r);return!!e&&e.enumerable}:Ir};var Nr=Object.getOwnPropertyDescriptor;var Fr={f:b?Nr:(r,e)=>{if(r=p(r),e=T(e,!0),P)try{return Nr(r,e)}catch(r){}if(U(r,e))return _(!Mr.f.call(r,e),r[e])}};var Dr=y((function(r){var e=Rr.get;var t=Rr.enforce;var a=String(String).split('String');(r.exports=(r,e,o,n)=>{var i=!!n&&!!n.unsafe;var s=!!n&&!!n.enumerable;var c=!!n&&!!n.noTargetGet;var v;'function'==typeof o&&('string'!=typeof e||U(o,'name')||k(o,'name',e),(v=t(o)).source||(v.source=a.join('string'==typeof e?e:''))),r!==m?(i?!c&&r[e]&&(s=!0):delete r[e],s?r[e]=o:k(r,e,o)):s?r[e]=o:A(e,o)})(Function.prototype,'toString',(function(){return'function'==typeof this&&e(this).source||Sr(this)}))}));var qr=ar.concat('length','prototype');var Gr={f:Object.getOwnPropertyNames||(r=>tr(r,qr))};var Wr={f:Object.getOwnPropertySymbols};var Vr=cr('Reflect','ownKeys')||(it=>{var r=Gr.f(E(it));var e=Wr.f;return e?r.concat(e(it)):r});var zr=(r,e)=>{var t=Vr(e);var a=x.f;var o=Fr.f;for(var n=0;n<t.length;n++){var i=t[n];U(r,i)||a(r,i,o(e,i))}};var Hr=/#|\.prototype\./;var Br=(r,e)=>{var t=Yr[Xr(r)];return t==Jr||t!=Kr&&('function'==typeof e?c(e):!!e)};var Xr=Br.normalize=r=>String(r).replace(Hr,'.').toLowerCase();var Yr=Br.data={};var Kr=Br.NATIVE='N';var Jr=Br.POLYFILL='P';var Zr=Br;var $r=Fr.f;var Qr=(r,e)=>{var t=r.target;var a=r.global;var o=r.stat;var n,i,s,c,v;if(n=a?m:o?m[t]||A(t,{}):(m[t]||{}).prototype)for(i in e){if(c=e[i],s=r.noTargetGet?(v=$r(n,i))&&v.value:n[i],!Zr(a?i:t+(o?'.':'#')+i,r.forced)&&void 0!==s){if(typeof c==typeof s)continue;zr(c,s)}(r.sham||s&&s.sham)&&k(c,'sham',!0),Dr(n,i,c,r)}};var re=r=>Object(d(r));var ee=!c((()=>{function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}));var te=lr('IE_PROTO');var ae=Object.prototype;var oe=ee?Object.getPrototypeOf:r=>(r=re(r),U(r,te)?r[te]:'function'==typeof r.constructor&&r instanceof r.constructor?r.constructor.prototype:r instanceof Object?ae:null);var ne=z('iterator');var ie=!1;var se,ce,ve;[].keys&&('next'in(ve=[].keys())?(ce=oe(oe(ve)))!==Object.prototype&&(se=ce):ie=!0),null==se&&(se={}),U(se,ne)||k(se,ne,(function(){return this}));var ue={IteratorPrototype:se,BUGGY_SAFARI_ITERATORS:ie};var le=x.f;var fe=z('toStringTag');var de=(it,r,e)=>{it&&!U(it=e?it:it.prototype,fe)&&le(it,fe,{configurable:!0,value:r})};var pe=ue.IteratorPrototype;var he=function(){return this};var ye=Object.setPrototypeOf||('__proto__'in{}?(()=>{var r=!1;var test={};var e;try{(e=Object.getOwnPropertyDescriptor(Object.prototype,'__proto__').set).call(test,[]),r=test instanceof Array}catch(r){}return(t,a)=>(E(t),(it=>{if(!w(it)&&null!==it)throw TypeError("Can't set "+String(it)+' as a prototype')})(a),r?e.call(t,a):t.__proto__=a,t)})():void 0);var ge=ue.IteratorPrototype;var me=ue.BUGGY_SAFARI_ITERATORS;var be=z('iterator');var we=function(){return this};var je=Rr.set;var Oe=Rr.getterFor("Array Iterator");var Se=function(r,e,t,a,o){(r=>{var e="Array Iterator";r.prototype=gr(pe,{next:_(1,(function(){var r=Oe(this);var e=r.target;var t=r.kind;var a=r.index++;return!e||a>=e.length?(r.target=void 0,{value:void 0,done:!0}):'keys'==t?{value:a,done:!1}:'values'==t?{value:e[a],done:!1}:{value:[a,e[a]],done:!1}}))}),de(r,e,!1),jr[e]=he})(t);var n=function(r){if(r===o&&v)return v;if(!me&&r in s)return s[r];switch(r){case"keys":case"values":case"entries":return function(){return new t(this,r)}}return function(){return new t(this)}};var i=!1;var s=r.prototype;var c=s[be]||s['@@iterator']||s.values;var v=!me&&c||n(o);var u=s.entries||c;var l,f,d;if(u&&(l=oe(u.call(new r)),ge!==Object.prototype&&l.next&&(oe(l)!==ge&&(ye?ye(l,ge):'function'!=typeof l[be]&&k(l,be,we)),de(l,"Array Iterator",!0))),c&&"values"!==c.name&&(i=!0,v=function(){return c.call(this)}),s[be]!==v&&k(s,be,v),jr.Array=v,void(f={values:n("values"),keys:n("keys"),entries:n("entries")}))for(d in f)(me||i||!(d in s))&&Dr(s,d,f[d]);else Qr({target:'Array',proto:!0,forced:me||i},f);return f}(Array,0,(function(r,e){je(this,{type:"Array Iterator",target:p(r),index:0,kind:e})}),0,'values');jr.Arguments=jr.Array,wr('keys'),wr('values'),wr('entries');var Pe={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};var Ee=z('iterator');var Te=z('toStringTag');var Ce=Se.values;for(var xe in Pe){var _e=m[xe];var ke=_e&&_e.prototype;if(ke){if(ke[Ee]!==Ce)try{k(ke,Ee,Ce)}catch(r){ke[Ee]=Ce}if(ke[Te]||k(ke,Te,xe),Pe[xe])for(var Ae in Se)if(ke[Ae]!==Se[Ae])try{k(ke,Ae,Se[Ae])}catch(r){ke[Ae]=Se[Ae]}}}function Le(r){var e=!1;for(var t=0;t<r.length;t++){var a=r.charAt(t);e&&/[a-zA-Z]/.test(a)&&a.toUpperCase()===a?(r=r.substr(0,t)+'-'+r.substr(t),e=!1,t++):e=a.toLowerCase()===a}return r}var Re=function r(e){return e?e instanceof Date?e:Array.isArray(e)?e.map((e=>r(e))):"object"==typeof e?((r,e)=>{var t={};var a=Object.keys(r);for(var o=0;o<a.length;o++){var n=a[o];var i=e(n,r[n]);t[i[0]]=i[1]}return t})(e,((t,a)=>{var o=function(){var r=[].map.call(arguments,(r=>r.trim())).filter((r=>r.length)).join('-');return r.length?1===r.length?r:/[_.\- ]+/.test(r)?(r=Le(r)).replace(/^[_.\- ]+/,'').toLowerCase().replace(/[_.\- ]+(\w|$)/g,((r,e)=>e.toUpperCase())):r===r.toUpperCase()?r.toLowerCase():r[0]!==r[0].toLowerCase()?r[0].toLowerCase()+r.slice(1):r:''}(t);if(t!==o&&o in e)throw new Error("Camelcased key `"+o+"` would overwrite existing key of the given JSON object");return[o,r(a)]})):e:e};var Ie=m.Promise;var Ue=z('species');var Me=it=>{if('function'!=typeof it)throw TypeError(String(it)+' is not a function');return it};var Ne=z('iterator');var Fe=Array.prototype;var De=(r,e,t)=>{if(Me(r),void 0===e)return r;switch(t){case 0:return()=>r.call(e);case 1:return t=>r.call(e,t);case 2:return(t,a)=>r.call(e,t,a);case 3:return(t,a,o)=>r.call(e,t,a,o)}return function(){return r.apply(e,arguments)}};var test={};test[z('toStringTag')]='z';var qe='[object z]'===String(test);var Ge=z('toStringTag');var We='Arguments'==u(function(){return arguments}());var Ve=qe?u:it=>{var r,e,t;return void 0===it?'Undefined':null===it?'Null':'string'==typeof(e=((it,r)=>{try{return it[r]}catch(r){}})(r=Object(it),Ge))?e:We?u(r):'Object'==(t=u(r))&&'function'==typeof r.callee?'Arguments':t};var ze=z('iterator');var He=r=>{var e=r.return;if(void 0!==e)return E(e.call(r)).value};var Be=function(r,e){this.stopped=r,this.result=e};var Xe=(r,e,t)=>{var a=!(!t||!t.AS_ENTRIES);var o=!(!t||!t.IS_ITERATOR);var n=!(!t||!t.INTERRUPTED);var i=De(e,t&&t.that,1+a+n);var s,c,v,u,l,f,d;var p=r=>(s&&He(s),new Be(!0,r));var h=r=>a?(E(r),n?i(r[0],r[1],p):i(r[0],r[1])):n?i(r,p):i(r);if(o)s=r;else{if('function'!=typeof(c=(it=>{if(null!=it)return it[ze]||it['@@iterator']||jr[Ve(it)]})(r)))throw TypeError('Target is not iterable');if(void 0!==(it=c)&&(jr.Array===it||Fe[Ne]===it)){for(v=0,u=K(r.length);u>v;v++)if((l=h(r[v]))&&l instanceof Be)return l;return new Be(!1)}s=c.call(r)}var it;for(f=s.next;!(d=f.call(s)).done;){try{l=h(d.value)}catch(r){throw He(s),r}if('object'==typeof l&&l&&l instanceof Be)return l}return new Be(!1)};var Ye=z('iterator');var Ke=!1;try{var Je=0;var Ze={next:()=>({done:!!Je++}),return:()=>{Ke=!0}};Ze[Ye]=function(){return this},Array.from(Ze,(()=>{throw 2}))}catch(r){}var $e=z('species');var Qe=cr('navigator','userAgent')||'';var rt=/(iphone|ipod|ipad).*applewebkit/i.test(Qe);var et='process'==u(m.process);var tt=m.location;var at=m.setImmediate;var ot=m.clearImmediate;var nt=m.process;var st=m.MessageChannel;var ct=m.Dispatch;var vt=0;var ut={};var lt,ft,dt;var pt=r=>{if(ut.hasOwnProperty(r)){var e=ut[r];delete ut[r],e()}};var ht=r=>()=>{pt(r)};var yt=r=>{pt(r.data)};var gt=r=>{m.postMessage(r+'',tt.protocol+'//'+tt.host)};at&&ot||(at=function(r){var e=[];var t=1;for(;arguments.length>t;)e.push(arguments[t++]);return ut[++vt]=()=>{('function'==typeof r?r:Function(r)).apply(void 0,e)},lt(vt),vt},ot=r=>{delete ut[r]},et?lt=r=>{nt.nextTick(ht(r))}:ct&&ct.now?lt=r=>{ct.now(ht(r))}:st&&!rt?(dt=(ft=new st).port2,ft.port1.onmessage=yt,lt=De(dt.postMessage,dt,1)):m.addEventListener&&'function'==typeof postMessage&&!m.importScripts&&tt&&'file:'!==tt.protocol&&!c(gt)?(lt=gt,m.addEventListener('message',yt,!1)):lt="onreadystatechange"in S('script')?function(r){vr.appendChild(S('script')).onreadystatechange=function(){vr.removeChild(this),pt(r)}}:r=>{setTimeout(ht(r),0)});var mt={set:at,clear:ot};var bt=/web0s(?!.*chrome)/i.test(Qe);var wt=mt.set;var jt=m.MutationObserver||m.WebKitMutationObserver;var Ot=m.document;var St=m.process;var Pt=m.Promise;var Et=(0,Fr.f)(m,'queueMicrotask');var Tt=Et&&Et.value;var Ct,xt,_t,kt,At,Lt,Rt,It;Tt||(Ct=()=>{var r,e;for(et&&(r=St.domain)&&r.exit();xt;){e=xt.fn,xt=xt.next;try{e()}catch(r){throw xt?kt():_t=void 0,r}}_t=void 0,r&&r.enter()},rt||et||bt||!jt||!Ot?Pt&&Pt.resolve?(Rt=Pt.resolve(void 0),It=Rt.then,kt=()=>{It.call(Rt,Ct)}):kt=et?()=>{St.nextTick(Ct)}:()=>{wt.call(m,Ct)}:(At=!0,Lt=Ot.createTextNode(''),new jt(Ct).observe(Lt,{characterData:!0}),kt=()=>{Lt.data=At=!At}));var Ut=Tt||(r=>{var e={fn:r,next:void 0};_t&&(_t.next=e),xt||(xt=e,kt()),_t=e});var Mt=function(r){var e,t;this.promise=new r(((r,a)=>{if(void 0!==e||void 0!==t)throw TypeError('Bad Promise constructor');e=r,t=a})),this.resolve=Me(e),this.reject=Me(t)};var Nt={f:r=>new Mt(r)};var Ft=(r,e)=>{if(E(r),w(e)&&e.constructor===r)return e;var t=Nt.f(r);return(0,t.resolve)(e),t.promise};var Dt=r=>{try{return{error:!1,value:r()}}catch(r){return{error:!0,value:r}}};var qt=m.process;var Gt=qt&&qt.versions;var Wt=Gt&&Gt.v8;var Vt,zt;Wt?zt=(Vt=Wt.split('.'))[0]+Vt[1]:Qe&&(!(Vt=Qe.match(/Edge\/(\d+)/))||Vt[1]>=74)&&(Vt=Qe.match(/Chrome\/(\d+)/))&&(zt=Vt[1]);var Ht=zt&&+zt;var Bt=mt.set;var Xt=z('species');var Yt=Rr.get;var Kt=Rr.set;var Jt=Rr.getterFor("Promise");var Zt=Ie;var $t=m.TypeError;var Qt=m.document;var ra=m.process;var ea=cr('fetch');var ta=Nt.f;var aa=ta;var oa=!!(Qt&&Qt.createEvent&&m.dispatchEvent);var na='function'==typeof PromiseRejectionEvent;var ia,sa,ca,va;var ua=Zr("Promise",(()=>{if(Sr(Zt)===String(Zt)){if(66===Ht)return!0;if(!et&&!na)return!0}if(Ht>=51&&/native code/.test(Zt))return!1;var r=Zt.resolve(1);var e=r=>{r((()=>{}),(()=>{}))};return(r.constructor={})[Xt]=e,!(r.then((()=>{}))instanceof e)}));var la=ua||!(()=>{if(!Ke)return!1;var r=!1;try{var e={};e[Ye]=()=>({next:()=>({done:r=!0})}),Zt.all(e).catch((()=>{}))}catch(r){}return r})();var fa=it=>{var r;return!(!w(it)||'function'!=typeof(r=it.then))&&r};var da=(r,e)=>{if(!r.notified){r.notified=!0;var t=r.reactions;Ut((()=>{var a=r.value;var o=1==r.state;var n=0;for(;t.length>n;){var i=t[n++];var s=o?i.ok:i.fail;var c=i.resolve;var v=i.reject;var u=i.domain;var l,f,d;try{s?(o||(2===r.rejection&&ga(r),r.rejection=1),!0===s?l=a:(u&&u.enter(),l=s(a),u&&(u.exit(),d=!0)),l===i.promise?v($t('Promise-chain cycle')):(f=fa(l))?f.call(l,c,v):c(l)):v(a)}catch(r){u&&!d&&u.exit(),v(r)}}r.reactions=[],r.notified=!1,e&&!r.rejection&&ha(r)}))}};var pa=(r,e,t)=>{var a,o;oa?((a=Qt.createEvent('Event')).promise=e,a.reason=t,a.initEvent(r,!1,!0),m.dispatchEvent(a)):a={promise:e,reason:t},!na&&(o=m['on'+r])?o(a):"unhandledrejection"===r&&function(r,e){var t=m.console;t&&t.error&&(1===arguments.length?t.error(r):t.error(r,e))}('Unhandled promise rejection',t)};var ha=r=>{Bt.call(m,(()=>{var e=r.facade;var t=r.value;var a;if(ya(r)&&(a=Dt((()=>{et?ra.emit('unhandledRejection',t,e):pa("unhandledrejection",e,t)})),r.rejection=et||ya(r)?2:1,a.error))throw a.value}))};var ya=r=>1!==r.rejection&&!r.parent;var ga=r=>{Bt.call(m,(()=>{var e=r.facade;et?ra.emit('rejectionHandled',e):pa("rejectionhandled",e,r.value)}))};var ma=(r,e,t)=>a=>{r(e,a,t)};var ba=(r,e,t)=>{r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=2,da(r,!0))};var wa=(r,e,t)=>{if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw $t("Promise can't be resolved itself");var a=fa(e);a?Ut((()=>{var t={done:!1};try{a.call(e,ma(wa,t,r),ma(ba,t,r))}catch(e){ba(t,e,r)}})):(r.value=e,r.state=1,da(r,!1))}catch(e){ba({done:!1},e,r)}}};var ja;ua&&(Zt=function(r){(()=>{if(!(this instanceof Zt))throw TypeError("Incorrect Promise invocation")})(),Me(r),ia.call(this);var e=Yt(this);try{r(ma(wa,e),ma(ba,e))}catch(r){ba(e,r)}},(ia=function(){Kt(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=((r,e)=>{for(var t in e)Dr(r,t,e[t],void 0);return r})(Zt.prototype,{then:function(r,e){var t=Jt(this);var a=ta((o=Zt,void 0===(n=E(this).constructor)||null==(i=E(n)[$e])?o:Me(i)));var o,n,i;return a.ok='function'!=typeof r||r,a.fail='function'==typeof e&&e,a.domain=et?ra.domain:void 0,t.parent=!0,t.reactions.push(a),0!=t.state&&da(t,!1),a.promise},catch:function(r){return this.then(void 0,r)}}),sa=function(){var r=new ia;var e=Yt(r);this.promise=r,this.resolve=ma(wa,e),this.reject=ma(ba,e)},Nt.f=ta=r=>r===Zt||r===ca?new sa(r):aa(r),'function'==typeof Ie&&(va=Ie.prototype.then,Dr(Ie.prototype,'then',(function(r,e){var t=this;return new Zt(((r,e)=>{va.call(t,r,e)})).then(r,e)}),{unsafe:!0}),'function'==typeof ea&&Qr({global:!0,enumerable:!0,forced:!0},{fetch:function(){return Ft(Zt,ea.apply(m,arguments))}}))),Qr({global:!0,wrap:!0,forced:ua},{Promise:Zt}),de(Zt,"Promise",!1),ja=cr("Promise"),b&&ja&&!ja[Ue]&&(0,x.f)(ja,Ue,{configurable:!0,get:function(){return this}}),ca=cr("Promise"),Qr({target:"Promise",stat:!0,forced:ua},{reject:function(r){var e=ta(this);return e.reject.call(void 0,r),e.promise}}),Qr({target:"Promise",stat:!0,forced:ua},{resolve:function(r){return Ft(this,r)}}),Qr({target:"Promise",stat:!0,forced:la},{all:function(r){var e=this;var t=ta(e);var a=t.resolve;var o=t.reject;var n=Dt((()=>{var t=Me(e.resolve);var n=[];var i=0;var s=1;Xe(r,(r=>{var c=i++;var v=!1;n.push(void 0),s++,t.call(e,r).then((r=>{v||(v=!0,n[c]=r,--s||a(n))}),o)})),--s||a(n)}));return n.error&&o(n.value),t.promise},race:function(r){var e=this;var t=ta(e);var a=t.reject;var o=Dt((()=>{var o=Me(e.resolve);Xe(r,(r=>{o.call(e,r).then(t.resolve,a)}))}));return o.error&&a(o.value),t.promise}});var Oa=function(){var r=E(this);var e='';return r.global&&(e+='g'),r.ignoreCase&&(e+='i'),r.multiline&&(e+='m'),r.dotAll&&(e+='s'),r.unicode&&(e+='u'),r.sticky&&(e+='y'),e};var Sa=RegExp.prototype;var Pa=Sa.toString;function Ea(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ta(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter((e=>Object.getOwnPropertyDescriptor(r,e).enumerable))),t.push.apply(t,a)}return t}(c((()=>'/a/b'!=Pa.call({source:'a',flags:'b'})))||"toString"!=Pa.name)&&Dr(RegExp.prototype,"toString",(function(){var r=E(this);var e=String(r.source);var t=r.flags;return'/'+e+'/'+String(void 0===t&&r instanceof RegExp&&!('flags'in Sa)?Oa.call(r):t)}),{unsafe:!0});var Ca=[422,401];var xa=a.default.create({timeout:1e4,baseURL:s,withCredentials:!0,xsrfCookieName:'_csrf_token',xsrfHeaderName:'X-CSRF-Token',headers:{'X-Requested-With':'XMLHttpRequest'}});xa.interceptors.request.use((r=>{var e='boolean'!=typeof r.camelize||r.camelize;if(r.headers?r.headers['Content-Type']='application/json':r.headers={'Content-Type':'application/json'},e){var t=a.default.defaults.transformResponse||[];var o=r=>Re(r);var n=Array.isArray(t)?[...t,o]:[t,o];r.transformResponse=n}return r})),xa.interceptors.response.use((r=>r),(r=>{var{config:e=null,response:t=null}=r;if(null===e||null===t)return Promise.reject(r);var a=e;Ca.includes(t.status)&&(a._retry=!0);var o=function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Ta(Object(t),!0).forEach((e=>{Ea(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ta(Object(t)).forEach((e=>{Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}({status:t.status,statusText:t.statusText,errorText:r.toString(),headers:t.headers},'object'==typeof t.data?t.data:{data:t.data});return Promise.reject(o)})),o.default(xa,{retries:3,retryDelay:o.default.exponentialDelay});class _a{constructor(r){if(this.id=void 0,this.email=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.phone=void 0,this.parent=void 0,this.fakeUser=void 0,this.isCustomer=void 0,this.emailConfirmed=void 0,this.fakeEmail=void 0,this.phoneConfirmed=void 0,this.createdAt=void 0,this.recentRegistration=void 0,this.profileEnriched=void 0,this.skype=void 0,this.graduate=void 0,this.type=void 0,this.avatarUrl=void 0,this.bonusAmount=void 0,this.grade=void 0,this.gradeChecked=void 0,this.tags=void 0,this.hasChats=void 0,this.hasReferrals=void 0,this.onboardingFinished=void 0,this.externshipUser=void 0,'object'!=typeof r)throw new Error('data is wrong');this.id=r.id,this.gradeChecked=r.gradeChecked,this.email=r.email||'',this.firstName=r.firstName,this.middleName=r.middleName||'',this.lastName=r.lastName,this.phone=r.phone||'',this.parent=r.parent,this.fakeUser=r.fakeUser,this.isCustomer=r.isCustomer,this.emailConfirmed=r.emailConfirmed,this.fakeEmail=r.fakeEmail,this.phoneConfirmed=r.phoneConfirmed,this.createdAt=r.createdAt||'',this.recentRegistration=r.recentRegistration,this.profileEnriched=r.profileEnriched,this.skype=r.skype||'',this.graduate=r.graduate,this.type=r.type,this.avatarUrl=r.avatarUrl||'',this.bonusAmount=r.bonusAmount,this.grade=r.grade,this.tags=r.tags,this.hasChats=r.hasChats,this.hasReferrals=r.hasReferrals,this.onboardingFinished=r.onboardingFinished,this.externshipUser=r.externshipUser}isLoggedIn(){return this.id>0}}var ka={id:0,gradeChecked:!1,email:'',firstName:'',middleName:'',lastName:'',phone:'',parent:!1,fakeUser:!1,isCustomer:!1,emailConfirmed:!1,fakeEmail:!1,phoneConfirmed:!1,createdAt:'',recentRegistration:!1,profileEnriched:!1,skype:'',graduate:!1,type:'pupil',avatarUrl:'',bonusAmount:0,grade:{id:0,index:0},tags:[],hasChats:!1,hasReferrals:!1,onboardingFinished:!1,externshipUser:!1};class Aa{getUser(){return i((function*(){try{var r=yield xa.get('/api/user/me').then((r=>{var{data:e}=r;return e}));return new _a(r)}catch(r){return new _a(ka)}}))()}createUser(r){return new _a(r)}purchases(r){return i((function*(){var{resourceId:e,resourceType:t}=r;if(e&&'number'!=typeof e)throw new Error('resourceId must be a number');if(t&&'string'!=typeof t)throw new Error('resourceType must be a string');var a=[];e&&a.push("resource_id=".concat(encodeURIComponent(e))),t&&a.push("resource_type=".concat(encodeURIComponent(t)));var o=a.length?"?".concat(a.join('&')):'';var{data:n}=yield xa.get("/api/user/purchases".concat(o));return n}))()}signIn(r){var{redirectUrl:e}=r;if(e&&'string'!=typeof e)throw new Error('redirectUrl must be a string');var t="".concat(s,"/user/registration?redirect_url=");e&&(t+=encodeURIComponent(document.location.href)),document.location.href=t}signOut(){var r=arguments;return i((function*(){var e=!(r.length>0&&void 0!==r[0])||r[0];var t=yield xa.delete("/user/log_out");return e&&window.location.reload(),t}))()}pushEvent(r){return i((function*(){yield xa.post("/api/user/event",{event:r})}))()}}class La{checkPromocode(r){return i((function*(){var{data:e}=yield xa.get("/api/promo_codes/invite/".concat(r));return e}))()}}var Ra=Object.assign;var Ia=Object.defineProperty;var Ua=!Ra||c((function(){if(b&&1!==Ra({b:1},Ra(Ia({},'a',{enumerable:!0,get:function(){Ia(this,'b',{value:3,enumerable:!1})}}),{b:2})).b)return!0;var r={};var e={};var t=Symbol();var a='abcdefghijklmnopqrst';return r[t]=7,a.split('').forEach((r=>{e[r]=r})),7!=Ra({},r)[t]||or(Ra({},e)).join('')!=a}))?function(r){var e=re(r);var t=arguments.length;var a=1;var o=Wr.f;var n=Mr.f;for(;t>a;){var i=f(arguments[a++]);var s=o?or(i).concat(o(i)):or(i);var c=s.length;var v=0;var u;for(;c>v;)u=s[v++],b&&!n.call(i,u)||(e[u]=i[u])}return e}:Ra;Qr({target:'Object',stat:!0,forced:Object.assign!==Ua},{assign:Ua});class Ma{createLeadRequest(r,e,t){return Object.assign({type:r,agreement:!0,context:e},arguments.length>2&&void 0!==t?t:{})}send(r){var e=arguments;return i((function*(){var t=e.length>1&&void 0!==e[1]?e[1]:'';var{data:a}=yield xa.post("/api/lead_requests".concat(t),{lead_request:r});return a}))()}}class Na{addTag(r){return i((function*(){var{data:e}=yield xa.post("/api/user/tag?id=".concat(r));return e}))()}}class Fa{createCartItem(r,e){return{resource_id:r,cart_item_type:e}}addCartItemToCart(r){return i((function*(){var{data:e}=yield xa.post("/api/cart_items",{cart_item:r});return e}))()}}class Da{getCourse(r){return i((function*(){if('number'!=typeof r)throw new TypeError('id is wrong');var{data:e}=yield xa.get("/api/courses/".concat(r));return e}))()}enrollCourse(r){return i((function*(){if('number'!=typeof r)throw new TypeError('id is wrong');yield xa.post("/api/courses/".concat(r,"/users_courses"))}))()}}class qa{getProductPack(r){return i((function*(){if('number'!=typeof r)throw new TypeError('id is wrong');var{data:e}=yield xa.get("/api/product_packs/".concat(r));return e}))()}}class Ga{constructor(r){var e=arguments.length>0&&void 0!==r?r:'latest';this.version=void 0,this.version=e}create(r){var e=this;return i((function*(){if(!r)throw new Error('You must specify config for creating widgets');if(yield e.loadAssets(),!window.FoxfordWidgets)throw new Error('FoxfordWidgets not found in global scope');if('function'!=typeof window.FoxfordWidgets.create)throw new Error('Not found function create in FoxfordWidgets library');window.FoxfordWidgets.create(r)}))()}loadAssets(){var r=this;return i((function*(){return r.version||(r.version='latest'),new Promise(((e,t)=>{var a="https://dist.ngcdn.ru/libs/foxford-widgets/".concat(r.version,"/foxford-widgets.js");var o=document.createElement('script');o.type='text/javascript',o.async=!0,o.onload=()=>e(!0),o.onerror=r=>t(r),o.src=a,document.body.appendChild(o)}))}))()}}var Wa={host:s,widgetsVersion:'latest'};exports.Foxford=class r{constructor(r){var e=arguments.length>0&&void 0!==r?r:Wa;this.api=void 0,this.user=void 0,this.tag=void 0,this.cart=void 0,this.promo=void 0,this.course=void 0,this.productPack=void 0,this.leadrequest=void 0,this.widgets=void 0,this._config=void 0,this._config=e,this._config.host&&(xa.defaults.baseURL=this._config.host),this.user=new Aa,this.promo=new La,this.tag=new Na,this.cart=new Fa,this.course=new Da,this.widgets=new Ga(e.widgetsVersion),this.productPack=new qa,this.leadrequest=new Ma,this.api=xa}shortURL(r){return xa.post("/api/short_urls",{link:r}).then((r=>r))}}; | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var e=require('axios');var t=require('axios-retry');function r(e){return e&&'object'==typeof e&&'default'in e?e:{default:e}}var n=r(e);var a=r(t);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var c;var u=(function(){var e=function(e){var t=Object.prototype;var r=t.hasOwnProperty;var n;var a="function"==typeof Symbol?Symbol:{};var o=a.iterator||"@@iterator";var i=a.asyncIterator||"@@asyncIterator";var s=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=(e,t,r)=>e[t]=r}function u(e,t,r,n){var a=Object.create((t&&t.prototype instanceof y?t:y).prototype);var o=new O(n||[]);return a._invoke=((e,t,r)=>{var n=p;return(a,o)=>{if(n===l)throw new Error("Generator is already running");if(n===d){if("throw"===a)throw o;return U()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=j(i,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var c=h(e,t,r);if("normal"===c.type){if(n=r.done?d:f,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}})(e,r,o),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p="suspendedStart";var f="suspendedYield";var l="executing";var d="completed";var v={};function y(){}function m(){}function g(){}var w={};w[o]=function(){return this};var b=Object.getPrototypeOf;var x=b&&b(b(P([])));x&&x!==t&&r.call(x,o)&&(w=x);var k=g.prototype=y.prototype=Object.create(w);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(a,o,i,s){var c=h(e[a],e,o);if("throw"!==c.type){var u=c.arg;var p=u.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((e=>{n("next",e,i,s)}),(e=>{n("throw",e,i,s)})):t.resolve(p).then((e=>{u.value=e,i(u)}),(e=>n("throw",e,i,s)))}s(c.arg)}var a;this._invoke=(e,r)=>{function o(){return new t(((t,a)=>{n(e,r,t,a)}))}return a=a?a.then(o,o):o()}}function j(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,j(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var a=h(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,v;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,v):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function P(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a<e.length;)if(r.call(e,a))return t.value=e[a],t.done=!1,t;return t.value=n,t.done=!0,t};return i.next=i}}return{next:U}}function U(){return{value:n,done:!0}}return m.prototype=k.constructor=g,g.constructor=m,m.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=e=>{var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=e=>(Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(k),e),e.awrap=e=>({__await:e}),E(C.prototype),C.prototype[i]=function(){return this},e.AsyncIterator=C,e.async=(t,r,n,a,o)=>{void 0===o&&(o=Promise);var i=new C(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((e=>e.done?e.value:i.next()))},E(k),c(k,s,"Generator"),k[o]=function(){return this},k.toString=()=>"[object Generator]",e.keys=e=>{var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=P,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function a(r,a){return s.type="throw",s.arg=e,t.next=r,a&&(t.method="next",t.arg=n),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];var s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc");var u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:P(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),v}},e}((c={exports:{}}).exports);try{regeneratorRuntime=e}catch(t){Function("e","regeneratorRuntime=e")(e)}}(),c.exports);function h(e,t,r,n,a,o,i){try{var s=e[o](i);var c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function p(e){return function(){var t=this,r=arguments;return new Promise(((n,a)=>{var o=e.apply(t,r);function i(e){h(o,n,a,i,s,"next",e)}function s(e){h(o,n,a,i,s,"throw",e)}i(void 0)}))}}var f='https://foxford.ru';function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function d(e){var t=!1;for(var r=0;r<e.length;r++){var n=e.charAt(r);t&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(e=e.substr(0,r)+'-'+e.substr(r),t=!1,r++):t=n.toLowerCase()===n}return e}var v=function e(t){return t?t instanceof Date?t:Array.isArray(t)?t.map((t=>e(t))):"object"==typeof t?((e,t)=>{var r={};var n=Object.keys(e);for(var a=0;a<n.length;a++){var o=n[a];var i=t(o,e[o]);r[i[0]]=i[1]}return r})(t,((r,n)=>{var a=function(){var e=[].map.call(arguments,(e=>e.trim())).filter((e=>e.length)).join('-');return e.length?1===e.length?e:/[_.\- ]+/.test(e)?(e=d(e)).replace(/^[_.\- ]+/,'').toLowerCase().replace(/[_.\- ]+(\w|$)/g,((e,t)=>t.toUpperCase())):e===e.toUpperCase()?e.toLowerCase():e[0]!==e[0].toLowerCase()?e[0].toLowerCase()+e.slice(1):e:''}(r);if(r!==a&&a in t)throw new Error("Camelcased key `"+a+"` would overwrite existing key of the given JSON object");return[a,e(n)]})):t:t};function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((t=>Object.getOwnPropertyDescriptor(e,t).enumerable))),r.push.apply(r,n)}return r}var g=[422,401];var w=n.default.create({timeout:1e4,baseURL:f,withCredentials:!0,xsrfCookieName:'_csrf_token',xsrfHeaderName:'X-CSRF-Token',headers:{'X-Requested-With':'XMLHttpRequest'}});w.interceptors.request.use((e=>{var t='boolean'!=typeof e.camelize||e.camelize;if(e.headers?e.headers['Content-Type']='application/json':e.headers={'Content-Type':'application/json'},t){var r=n.default.defaults.transformResponse||[];var a=e=>v(e);var o=Array.isArray(r)?[].concat((e=>{if(Array.isArray(e))return l(e)})(i=r)||(e=>{if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)})(i)||((e,t)=>{if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}})(i)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})(),[a]):[r,a];e.transformResponse=o}var i;return e})),w.interceptors.response.use((e=>e),(e=>{var t=e.config,r=void 0===t?null:t,n=e.response,a=void 0===n?null:n;if(null===r||null===a)return Promise.reject(e);var o=r;g.includes(a.status)&&(o._retry=!0);var i=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((t=>{y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({status:a.status,statusText:a.statusText,errorText:e.toString(),headers:a.headers},'object'==typeof a.data?a.data:{data:a.data});return Promise.reject(i)})),a.default(w,{retries:3,retryDelay:a.default.exponentialDelay});var b=function(){function e(t){if(o(this,e),this.id=void 0,this.email=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.phone=void 0,this.parent=void 0,this.fakeUser=void 0,this.isCustomer=void 0,this.emailConfirmed=void 0,this.fakeEmail=void 0,this.phoneConfirmed=void 0,this.createdAt=void 0,this.recentRegistration=void 0,this.profileEnriched=void 0,this.skype=void 0,this.graduate=void 0,this.type=void 0,this.avatarUrl=void 0,this.bonusAmount=void 0,this.grade=void 0,this.gradeChecked=void 0,this.tags=void 0,this.hasChats=void 0,this.hasReferrals=void 0,this.onboardingFinished=void 0,this.externshipUser=void 0,'object'!=typeof t)throw new Error('data is wrong');this.id=t.id,this.gradeChecked=t.gradeChecked,this.email=t.email||'',this.firstName=t.firstName,this.middleName=t.middleName||'',this.lastName=t.lastName,this.phone=t.phone||'',this.parent=t.parent,this.fakeUser=t.fakeUser,this.isCustomer=t.isCustomer,this.emailConfirmed=t.emailConfirmed,this.fakeEmail=t.fakeEmail,this.phoneConfirmed=t.phoneConfirmed,this.createdAt=t.createdAt||'',this.recentRegistration=t.recentRegistration,this.profileEnriched=t.profileEnriched,this.skype=t.skype||'',this.graduate=t.graduate,this.type=t.type,this.avatarUrl=t.avatarUrl||'',this.bonusAmount=t.bonusAmount,this.grade=t.grade,this.tags=t.tags,this.hasChats=t.hasChats,this.hasReferrals=t.hasReferrals,this.onboardingFinished=t.onboardingFinished,this.externshipUser=t.externshipUser}return s(e,[{key:"isLoggedIn",value:function(){return this.id>0}}]),e}();var x={id:0,gradeChecked:!1,email:'',firstName:'',middleName:'',lastName:'',phone:'',parent:!1,fakeUser:!1,isCustomer:!1,emailConfirmed:!1,fakeEmail:!1,phoneConfirmed:!1,createdAt:'',recentRegistration:!1,profileEnriched:!1,skype:'',graduate:!1,type:'pupil',avatarUrl:'',bonusAmount:0,grade:{id:0,index:0},tags:[],hasChats:!1,hasReferrals:!1,onboardingFinished:!1,externshipUser:!1};var k=function(){function e(){o(this,e)}var t;var r;var n;var a;return s(e,[{key:"getUser",value:(a=p(u.mark((function e(){var t;return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,w.get('/api/user/me').then((e=>e.data));case 3:return t=new b(e.sent),e.abrupt("return",t);case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",new b(x));case 11:case"end":return e.stop()}}),e,null,[[0,8]])}))),function(){return a.apply(this,arguments)})},{key:"createUser",value:e=>new b(e)},{key:"purchases",value:(n=p(u.mark((function e(t){var r,n,a,o;return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:if(n=t.resourceType,!(r=t.resourceId)||'number'==typeof r){e.next=3;break}throw new Error('resourceId must be a number');case 3:if(!n||'string'==typeof n){e.next=5;break}throw new Error('resourceType must be a string');case 5:return a=[],r&&a.push("resource_id=".concat(encodeURIComponent(r))),n&&a.push("resource_type=".concat(encodeURIComponent(n))),o=a.length?"?".concat(a.join('&')):'',e.next=11,w.get("/api/user/purchases".concat(o));case 11:return e.abrupt("return",e.sent.data);case 14:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"signIn",value:e=>{var t=e.redirectUrl,r=void 0===t?void 0:t;if(r&&'string'!=typeof r)throw new Error('redirectUrl must be a string');var n="".concat(f,"/user/registration?redirect_url=");r&&(n+=encodeURIComponent(document.location.href)),document.location.href=n}},{key:"signOut",value:(r=p(u.mark((function e(){var t,r,n=arguments;return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:return t=!(n.length>0&&void 0!==n[0])||n[0],e.next=3,w.delete("/user/log_out");case 3:return r=e.sent,t&&window.location.reload(),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"pushEvent",value:(t=p(u.mark((function e(t){return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:return e.next=2,w.post("/api/user/event",{event:t});case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();var E=function(){function e(){o(this,e)}var t;return s(e,[{key:"checkPromocode",value:(t=p(u.mark((function e(t){return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:return e.next=2,w.get("/api/promo_codes/invite/".concat(t));case 2:return e.abrupt("return",e.sent.data);case 5:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();var C=function(){function e(){o(this,e)}var t;return s(e,[{key:"createLeadRequest",value:function(e,t,r){var n=arguments.length>2&&void 0!==r?r:{};return Object.assign({type:e,agreement:!0,context:t},n)}},{key:"send",value:(t=p(u.mark((function e(t){var r,n=arguments;return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:'',e.next=3,w.post("/api/lead_requests".concat(r),{lead_request:t});case 3:return e.abrupt("return",e.sent.data);case 6:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();var j=function(){function e(){o(this,e)}var t;return s(e,[{key:"addTag",value:(t=p(u.mark((function e(t){return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:return e.next=2,w.post("/api/user/tag?id=".concat(t));case 2:return e.abrupt("return",e.sent.data);case 5:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();var _=function(){function e(){o(this,e)}var t;return s(e,[{key:"createCartItem",value:(e,t)=>({resource_id:e,cart_item_type:t})},{key:"addCartItemToCart",value:(t=p(u.mark((function e(t){return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:return e.next=2,w.post("/api/cart_items",{cart_item:t});case 2:return e.abrupt("return",e.sent.data);case 5:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();var L=function(){function e(){o(this,e)}var t;var r;return s(e,[{key:"getCourse",value:(r=p(u.mark((function e(t){return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:if('number'==typeof t){e.next=2;break}throw new TypeError('id is wrong');case 2:return e.next=4,w.get("/api/courses/".concat(t));case 4:return e.abrupt("return",e.sent.data);case 7:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"enrollCourse",value:(t=p(u.mark((function e(t){return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:if('number'==typeof t){e.next=2;break}throw new TypeError('id is wrong');case 2:return e.next=4,w.post("/api/courses/".concat(t,"/users_courses"));case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();var O=function(){function e(){o(this,e)}var t;return s(e,[{key:"getProductPack",value:(t=p(u.mark((function e(t){return u.wrap((e=>{for(;;)switch(e.prev=e.next){case 0:if('number'==typeof t){e.next=2;break}throw new TypeError('id is wrong');case 2:return e.next=4,w.get("/api/product_packs/".concat(t));case 4:return e.abrupt("return",e.sent.data);case 7:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();var P=function(){function e(t){var r=arguments.length>0&&void 0!==t?t:'latest';o(this,e),this.version=void 0,this.version=r}var t;var r;return s(e,[{key:"create",value:(r=p(u.mark((function e(t){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error('You must specify config for creating widgets');case 2:return e.next=4,this.loadAssets();case 4:if(window.FoxfordWidgets){e.next=6;break}throw new Error('FoxfordWidgets not found in global scope');case 6:if('function'==typeof window.FoxfordWidgets.create){e.next=8;break}throw new Error('Not found function create in FoxfordWidgets library');case 8:window.FoxfordWidgets.create(t);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"loadAssets",value:(t=p(u.mark((function e(){var t=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.version||(this.version='latest'),e.abrupt("return",new Promise(((e,r)=>{var n="https://dist.ngcdn.ru/libs/foxford-widgets/".concat(t.version,"/foxford-widgets.js");var a=document.createElement('script');a.type='text/javascript',a.async=!0,a.onload=()=>e(!0),a.onerror=e=>r(e),a.src=n,document.body.appendChild(a)})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();var U={host:f,widgetsVersion:'latest'};exports.Foxford=function(){function e(t){var r=arguments.length>0&&void 0!==t?t:U;o(this,e),this.api=void 0,this.user=void 0,this.tag=void 0,this.cart=void 0,this.promo=void 0,this.course=void 0,this.productPack=void 0,this.leadrequest=void 0,this.widgets=void 0,this._config=void 0,this._config=r,this._config.host&&(w.defaults.baseURL=this._config.host),this.user=new k,this.promo=new E,this.tag=new j,this.cart=new _,this.course=new L,this.widgets=new P(r.widgetsVersion),this.productPack=new O,this.leadrequest=new C,this.api=w}return s(e,[{key:"shortURL",value:e=>w.post("/api/short_urls",{link:e}).then((e=>e))}]),e}(); | ||
//# sourceMappingURL=foxford.cjs.js.map |
@@ -251,3 +251,3 @@ import { AxiosInstance } from 'axios' | ||
export interface FoxfordI { | ||
export interface IFoxford { | ||
api: AxiosInstance; | ||
@@ -265,4 +265,4 @@ user: UserServiceI; | ||
export class Foxford implements FoxfordI { | ||
export class Foxford implements IFoxford { | ||
constructor(config?: FoxfordConfig); | ||
} |
@@ -251,3 +251,3 @@ import { AxiosInstance } from 'axios' | ||
export interface FoxfordI { | ||
export interface IFoxford { | ||
api: AxiosInstance; | ||
@@ -265,4 +265,4 @@ user: UserServiceI; | ||
export class Foxford implements FoxfordI { | ||
export class Foxford implements IFoxford { | ||
constructor(config?: FoxfordConfig); | ||
} |
{ | ||
"name": "@foxford/foxford-js-sdk", | ||
"version": "2.0.12", | ||
"version": "2.1.33", | ||
"description": "Foxford sdk for external projects", | ||
@@ -9,3 +9,3 @@ "main": "foxford.cjs.js", | ||
"typings": "index.d.ts", | ||
"dependencies": { | ||
"peerDependencies": { | ||
"axios": "^0.21.1", | ||
@@ -39,3 +39,4 @@ "axios-retry": "^3.1.9" | ||
}, | ||
"./foxford.mjs": "./foxford.mjs", | ||
"./plugins/autocomplete-email": "./plugins/autocomplete-email.mjs", | ||
"./plugins/autocomplete-email.cjs": "./plugins/autocomplete-email.cjs.js", | ||
"./package.json": "./package.json" | ||
@@ -51,6 +52,11 @@ }, | ||
"foxford.cjs.js.map", | ||
"foxford.cjs.js.flow", | ||
"foxford.mjs.js.flow", | ||
"foxford.cjs.d.ts", | ||
"foxford.cjs.js.flow", | ||
"foxford.mjs.d.ts", | ||
"foxford.mjs.js.flow" | ||
"plugins/autocomplete-email.d.ts", | ||
"plugins/autocomplete-email.mjs", | ||
"plugins/autocomplete-email.mjs.flow", | ||
"plugins/autocomplete-email.cjs.js", | ||
"plugins/autocomplete-email.cjs.js.flow" | ||
], | ||
@@ -57,0 +63,0 @@ "keywords": [ |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
16
1046
2
257688
- Removedaxios@^0.21.1
- Removedaxios-retry@^3.1.9