@froomle/frontend-sdk 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- "use strict";var he=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ge=Object.prototype.hasOwnProperty;var We=(d,e)=>{for(var t in e)he(d,t,{get:e[t],enumerable:!0})},Qe=(d,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ke(e))!Ge.call(d,n)&&n!==t&&he(d,n,{get:()=>e[n],enumerable:!(r=Je(e,n))||r.enumerable});return d};var Ye=d=>Qe(he({},"__esModule",{value:!0}),d);var mt={};We(mt,{DomDomDom:()=>Me,FroomleDomTree:()=>ie,FroomleSdk:()=>L,RecoBackendV2:()=>p,RecommendationItem:()=>ee,RecommendationList:()=>Z,Recommendations:()=>Y,Version:()=>fe,_getAllItemsFromCache:()=>ut,_getRawRecommendationCache:()=>ct,_getRecoQueue:()=>at,_getRecommendedItemsCache:()=>_t,getFroomleEnvironment:()=>nt,getFroomleUserId:()=>rt,getRecommendationItem:()=>lt,getRecommendations:()=>ot,preloadRecommendations:()=>it,reset:()=>gt,setFroomleEnvironment:()=>st,setFroomleUserId:()=>tt,weirdReco:()=>pt});module.exports=Ye(mt);var s=class d{static global(e){return d.globals[e]?d.globals[e]:d.globals[e]={}}static createStatic(e,t,r){let n=null;Object.defineProperty(e,t,{enumerable:!0,get:function(){return r!=null&&(n=r(),r=null),n},set:function(l){r!=null&&(n=r(),r=null),n=l}})}static iterator(e){if(Array.isArray(e)){let t=e;return function(){return d.mkIter(t)}}else return typeof e.iterator=="function"?e.iterator.bind(e):e.iterator}static getIterator(e){return Array.isArray(e)?d.mkIter(e):e.iterator()}static mkIter(e){return new de(e)}static extend(e){function t(){this[d.new].apply(this,arguments)}return Object.setPrototypeOf(t.prototype,e.prototype),t}static inherits(e,t){t==null&&(t=!1);function r(){t&&e&&r[d.init]&&r[d.init](),this[d.new].apply(this,arguments)}return t?r[d.init]=()=>{let n=e();n[d.init]&&n[d.init](),Object.setPrototypeOf(r.prototype,n.prototype),r[d.init]=void 0}:e&&e[d.init]?(t=!0,r[d.init]=()=>{e[d.init]&&e[d.init](),Object.setPrototypeOf(r.prototype,e.prototype),r[d.init]=void 0}):e&&Object.setPrototypeOf(r.prototype,e.prototype),r}static bind(e,t){if(t==null)return null;t.__id__==null&&(t.__id__=d.fid++);let r=null;return e.hx__closures__==null?e.hx__closures__={}:r=e.hx__closures__[t.__id__],r==null&&(r=t.bind(e),e.hx__closures__[t.__id__]=r),r}static get __name__(){return"genes.Register"}get __class__(){return d}};s.$global=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:void 0;s.globals={};s.new=Symbol();s.init=Symbol();s.fid=0;var de=s.global("$hxClasses")["genes._Register.ArrayIterator"]=class $e extends s.inherits(){[s.new](e){this.current=0,this.array=e}hasNext(){return this.current<this.array.length}next(){return this.array[this.current++]}static get __name__(){return"genes._Register.ArrayIterator"}get __class__(){return $e}};de.prototype.array=null;de.prototype.current=null;var xt=s.$global,fe=s.global("$hxClasses").Version=class ke{static get __name__(){return"Version"}get __class__(){return ke}};fe.CURRENT="0.0.8";var wt=s.$global,Y=function(){};Y.__isInterface__=!0;var Z=function(){};Z.__isInterface__=!0;var ee=function(){};ee.__isInterface__=!0;var It=s.$global,ae=s.global("$hxClasses")["haxe.ValueException"]=class Se extends s.inherits(()=>k,!0){[s.new](e,t,r){super[s.new](String(e),t,r),this.value=e}unwrap(){return this.value}static get __name__(){return"haxe.ValueException"}static get __super__(){return k}get __class__(){return Se}};ae.prototype.value=null;var Ct=s.$global,k=s.global("$hxClasses")["haxe.Exception"]=class te extends s.inherits(()=>Error,!0){[s.new](e,t,r){Error.call(this,e),this.message=e,this.__previousException=t,this.__nativeException=r!=null?r:this}unwrap(){return this.__nativeException}get_native(){return this.__nativeException}static caught(e){return e instanceof te?e:e instanceof Error?new te(e.message,null,e):new ae(e,null,e)}static thrown(e){return e instanceof te?e.get_native():e instanceof Error?e:new ae(e)}static get __name__(){return"haxe.Exception"}static get __super__(){return Error}get __class__(){return te}};k.prototype.native=null;k.prototype.__skipStack=null;k.prototype.__nativeException=null;k.prototype.__previousException=null;var qt=s.$global,xe=s.global("$hxClasses")["js.Browser"]=class Ce{static get supported(){return this.get_supported()}static get_supported(){return typeof window!="undefined"&&typeof window.location!="undefined"?typeof window.location.protocol=="string":!1}static createXMLHttpRequest(){if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")return new"ActiveXObject"("Microsoft.XMLHTTP");throw k.thrown("Unable to create XMLHttpRequest object.")}static get __name__(){return"js.Browser"}get __class__(){return Ce}};var Ft=s.$global,A=s.global("$hxEnums")["haxe.io.Error"]={__ename__:"haxe.io.Error",Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error"},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error"},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error"},Custom:Object.assign(d=>({_hx_index:3,__enum__:"haxe.io.Error",e:d}),{_hx_name:"Custom",__params__:["e"]})};A.__constructs__=[A.Blocked,A.Overflow,A.OutsideBounds,A.Custom];A.__empty_constructs__=[A.Blocked,A.Overflow,A.OutsideBounds];var Tt=s.$global,H=s.global("$hxEnums")["haxe.io.Encoding"]={__ename__:"haxe.io.Encoding",UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding"},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding"}};H.__constructs__=[H.UTF8,H.RawNative];H.__empty_constructs__=[H.UTF8,H.RawNative];var Xt=s.$global,J=s.global("$hxClasses")["haxe.io.Bytes"]=class ye extends s.inherits(){[s.new](e){this.length=e.byteLength,this.b=new Uint8Array(e),this.b.bufferValue=e,e.hxBytes=this,e.bytes=this.b}getString(e,t,r){if(e<0||t<0||e+t>this.length)throw k.thrown(A.OutsideBounds);r==null&&(r=H.UTF8);let n="",l=this.b,o=e,i=e+t;switch(r._hx_index){case 0:let f=e>0;for(;o<i;){let m=l[o++];if(m<128){if(m==0)break;n+=String.fromCodePoint(m)}else if(m<224){let a=(m&63)<<6|l[o++]&127;n+=String.fromCodePoint(a)}else if(m<240){let a=l[o++],u=(m&31)<<12|(a&127)<<6|l[o++]&127;n+=String.fromCodePoint(u)}else{let a=l[o++],u=l[o++],c=(m&15)<<18|(a&127)<<12|(u&127)<<6|l[o++]&127;n+=String.fromCodePoint(c)}}break;case 1:for(;o<i;){let m=l[o++]|l[o++]<<8;n+=String.fromCodePoint(m)}break}return n}static ofData(e){let t=e.hxBytes;return t!=null?t:new ye(e)}static get __name__(){return"haxe.io.Bytes"}get __class__(){return ye}};J.prototype.length=null;J.prototype.b=null;var Gt=s.$global,F=s.global("$hxClasses")["haxe.http.HttpBase"]=class De extends s.inherits(){[s.new](e){this.url=e,this.headers=[],this.params=[],this.emptyOnData=s.bind(this,this.onData)}get responseData(){return this.get_responseData()}setHeader(e,t){let r=0,n=this.headers.length;for(;r<n;){let l=r++;if(this.headers[l].name==e){this.headers[l]={name:e,value:t};return}}this.headers.push({name:e,value:t})}setPostData(e){this.postData=e,this.postBytes=null}onData(e){}onBytes(e){}onError(e){}onStatus(e){}hasOnData(){return s.bind(this,this.onData)!=this.emptyOnData}success(e){this.responseBytes=e,this.responseAsString=null,this.hasOnData()&&this.onData(this.get_responseData()),this.onBytes(this.responseBytes)}get_responseData(){return this.responseAsString==null&&this.responseBytes!=null&&(this.responseAsString=this.responseBytes.getString(0,this.responseBytes.length,H.UTF8)),this.responseAsString}static get __name__(){return"haxe.http.HttpBase"}get __class__(){return De}};F.prototype.url=null;F.prototype.responseBytes=null;F.prototype.responseAsString=null;F.prototype.postData=null;F.prototype.postBytes=null;F.prototype.headers=null;F.prototype.params=null;F.prototype.emptyOnData=null;var Yt=s.$global,ue=s.global("$hxClasses")["haxe.iterators.MapKeyValueIterator"]=class Pe extends s.inherits(){[s.new](e){this.map=e,this.keys=e.keys()}hasNext(){return this.keys.hasNext()}next(){let e=this.keys.next();return{value:this.map.get(e),key:e}}static get __name__(){return"haxe.iterators.MapKeyValueIterator"}get __class__(){return Pe}};ue.prototype.map=null;ue.prototype.keys=null;var tr=s.$global,be=function(){};be.__isInterface__=!0;var nr=s.$global,we=s.global("$hxClasses")["js.Boot"]=class re{static __string_rec(e,t){if(e==null)return"null";if(t.length>=5)return"<...>";let r=typeof e;switch(r=="function"&&(e.__name__||e.__ename__)&&(r="object"),r){case"function":return"<function>";case"object":if(e.__enum__){let m=s.global("$hxEnums")[e.__enum__].__constructs__[e._hx_index],a=m._hx_name;return m.__params__?(t=t+" ",a+"("+(function(u){var c;let I=[];{let _=0,g=m.__params__;for(;_<g.length;){let R=g[_];_=_+1,I.push(re.__string_rec(e[R],t))}}return c=I,c})(this).join(",")+")"):a}if(e instanceof Array){let f="[";t+=" ";let m=0,a=e.length;for(;m<a;){let u=m++;f+=(u>0?",":"")+re.__string_rec(e[u],t)}return f+="]",f}let n;try{n=e.toString}catch{return"???"}if(n!=null&&n!=Object.toString&&typeof n=="function"){let f=e.toString();if(f!="[object Object]")return f}let l=`{
2
- `;t+=" ";let o=e.hasOwnProperty!=null,i=null;for(i in e)o&&!e.hasOwnProperty(i)||i=="prototype"||i=="__class__"||i=="__super__"||i=="__interfaces__"||i=="__properties__"||(l.length!=2&&(l+=`,
3
- `),l+=t+i+" : "+re.__string_rec(e[i],t));return t=t.substring(1),l+=`
4
- `+t+"}",l;break;case"string":return e;default:return String(e)}}static get __name__(){return"js.Boot"}get __class__(){return re}};we.__toStr={}.toString;var ar=s.$global,C=s.global("$hxClasses").Std=class Be{static string(e){return we.__string_rec(e,"")}static parseInt(e){let t=parseInt(e);return isNaN(t)?null:t}static get __name__(){return"Std"}get __class__(){return Be}};String.__name__=!0,Array.__name__=!0;var gr=s.$global,_e=s.global("$hxClasses")["genes.util.EsMap"]=class se extends s.inherits(){[s.new](){this.inst=new Map}set(e,t){this.inst.set(e,t)}get(e){return this.inst.get(e)}remove(e){return this.inst.delete(e)}exists(e){return this.inst.has(e)}keys(){return se.adaptIterator(this.inst.keys())}iterator(){return se.adaptIterator(this.inst.values())}toString(){let e=[],t=se.adaptIterator(this.inst.keys());for(;t.hasNext();){let r=t.next();e.push(""+C.string(r)+" => "+C.string(this.inst.get(r)))}return"{"+e.join(", ")+"}"}clear(){this.inst.clear()}static adaptIterator(e){let t,r,n=function(){let l=e.next();t=l.value,r=l.done};return{hasNext:function(){return r==null&&n(),!r},next:function(){r==null&&n();let l=t;return n(),l}}}static get __name__(){return"genes.util.EsMap"}get __class__(){return se}};_e.prototype.inst=null;var xr=s.$global,qe=s.global("$hxClasses")["haxe.ds.StringMap"]=class Re extends s.inherits(_e){[s.new](){super[s.new]()}copy(){let e=new Re;return e.inst=new Map(this.inst),e}keyValueIterator(){return new ue(this)}static get __name__(){return"haxe.ds.StringMap"}static get __interfaces__(){return[be]}static get __super__(){return _e}get __class__(){return Re}};var wr=s.$global,B=s.global("$hxClasses").HxOverrides=class Ve{static cca(e,t){let r=e.charCodeAt(t);if(r==r)return r}static substr(e,t,r){if(r==null)r=e.length;else if(r<0)if(t==0)r=e.length+r;else return"";return e.substr(t,r)}static now(){return Date.now()}static get __name__(){return"HxOverrides"}get __class__(){return Ve}};typeof performance!="undefined"&&typeof performance.now=="function"&&(B.now=performance.now.bind(performance));var Ir=s.$global,j=s.global("$hxClasses").StringTools=class ce{static isSpace(e,t){let r=B.cca(e,t);return r>8&&r<14?!0:r==32}static ltrim(e){let t=e.length,r=0;for(;r<t&&ce.isSpace(e,r);)++r;return r>0?B.substr(e,r,t-r):e}static rtrim(e){let t=e.length,r=0;for(;r<t&&ce.isSpace(e,t-r-1);)++r;return r>0?B.substr(e,0,t-r):e}static replace(e,t,r){return e.split(t).join(r)}static get __name__(){return"StringTools"}get __class__(){return ce}};var Sr=s.$global,Ae=s.global("$hxClasses").Lambda=class Fe{static exists(e,t){let r=s.getIterator(e);for(;r.hasNext();){let n=r.next();if(t(n))return!0}return!1}static get __name__(){return"Lambda"}get __class__(){return Fe}};var Vr=s.$global,ne=s.global("$hxClasses").EReg=class He extends s.inherits(){[s.new](e,t){this.r=new RegExp(e,t.split("u").join(""))}match(e){return this.r.global&&(this.r.lastIndex=0),this.r.m=this.r.exec(e),this.r.s=e,this.r.m!=null}matched(e){if(this.r.m!=null&&e>=0&&e<this.r.m.length)return this.r.m[e];throw k.thrown("EReg::matched")}matchedPos(){if(this.r.m==null)throw k.thrown("No string matched");return{pos:this.r.m.index,len:this.r.m[0].length}}matchSub(e,t,r){if(r==null&&(r=-1),this.r.global){this.r.lastIndex=t,this.r.m=this.r.exec(r<0?e:B.substr(e,0,t+r));let n=this.r.m!=null;return n&&(this.r.s=e),n}else{let n=this.match(r<0?B.substr(e,t,null):B.substr(e,t,r));return n&&(this.r.s=e,this.r.m.index+=t),n}}map(e,t){let r=0,n="";do{if(r>=e.length)break;if(!this.matchSub(e,r)){n+=C.string(B.substr(e,r,null));break}let l=this.matchedPos();n+=C.string(B.substr(e,r,l.pos-r)),n+=C.string(t(this)),l.len==0?(n+=C.string(B.substr(e,l.pos,1)),r=l.pos+1):r=l.pos+l.len}while(this.r.global);return!this.r.global&&r>0&&r<e.length&&(n+=C.string(B.substr(e,r,null))),n}static get __name__(){return"EReg"}get __class__(){return He}};ne.prototype.r=null;var zr=s.$global,K=s.global("$hxClasses")["haxe.http.HttpJs"]=class Oe extends s.inherits(F){[s.new](e){this.async=!0,this.withCredentials=!1,super[s.new](e)}request(e){this.responseAsString=null,this.responseBytes=null,this.responseHeaders=null;let t=this.req=xe.createXMLHttpRequest(),r=this,n=function(a){if(t.readyState!=4)return;let u;try{u=t.status}catch{u=null}if(u==0&&xe.get_supported()&&s.$global.location!=null){let c=s.$global.location.protocol.toLowerCase();new ne("^(?:about|app|app-storage|.+-extension|file|res|widget):$","").match(c)&&(u=t.response!=null?200:404)}if(u==null&&(u=null),u!=null&&r.onStatus(u),u!=null&&u>=200&&u<400){r.req=null;let c=t.getAllResponseHeaders().split(`\r
5
- `),I=[],_=0,g=c;for(;_<g.length;){let b=g[_];++_,b!=""&&I.push(b)}c=I;let R=new qe;r.responseHeaders=R;let y=0;for(;y<c.length;){let b=c[y];++y;let D=b.split(": "),V=D.shift(),w=D.length==1?D[0]:D.join(": ");w=j.ltrim(j.rtrim(w)),r.responseHeaders.inst.set(V,w)}r.success(J.ofData(t.response))}else if(u==null||u==0&&t.response==null)r.req=null,r.onError("Failed to connect or resolve host");else if(u==null){r.req=null;let c=t.response!=null?J.ofData(t.response):null;r.responseBytes=c,r.onError("Http Error #"+t.status)}else switch(u){case 12007:r.req=null,r.onError("Unknown host");break;case 12029:r.req=null,r.onError("Failed to connect to host");break;default:r.req=null;let c=t.response!=null?J.ofData(t.response):null;r.responseBytes=c,r.onError("Http Error #"+t.status)}};this.async&&(t.onreadystatechange=n);let l,o=this.postData,i=this.postBytes;if(o==null)if(i==null)l=null;else{let a=i;l=new Blob([a.b.bufferValue])}else i==null?l=o:l=null;if(l!=null)e=!0;else{let a=0,u=this.params;for(;a<u.length;){let c=u[a];++a,l==null?l="":l=(l==null?"null":C.string(l))+"&";let I=c.name,_=(l==null?"null":C.string(l))+encodeURIComponent(I)+"=",g=c.value;l=_+encodeURIComponent(g)}}try{if(e)t.open("POST",this.url,this.async);else if(l!=null){let a=this.url.split("?").length<=1;t.open("GET",this.url+(a?"?":"&")+(l==null?"null":C.string(l)),this.async),l=null}else t.open("GET",this.url,this.async);t.responseType="arraybuffer"}catch(a){let u=k.caught(a).unwrap();this.req=null,this.onError(u.toString());return}t.withCredentials=this.withCredentials,!Ae.exists(this.headers,function(a){return a.name=="Content-Type"})&&e&&this.postData==null&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");let f=0,m=this.headers;for(;f<m.length;){let a=m[f];++f,t.setRequestHeader(a.name,a.value)}t.send(l),this.async||n(null)}static get __name__(){return"haxe.http.HttpJs"}static get __super__(){return F}get __class__(){return Oe}};K.prototype.async=null;K.prototype.withCredentials=null;K.prototype.responseHeaders=null;K.prototype.req=null;var Gr=s.$global,U=s.global("$hxClasses").SimpleFuture=class Te extends s.inherits(){[s.new](){this._isFinished=!1}trigger(e){this._result=e,this._isFinished=!0,this._callback!=null&&this._callback(this._result)}then(e){this._callback=e,this._isFinished&&e(this._result)}static get __name__(){return"SimpleFuture"}get __class__(){return Te}};U.prototype._callback=null;U.prototype._result=null;U.prototype._isFinished=null;var Yr=s.$global,E=s.global("$hxClasses").Reflect=class Ue{static field(e,t){try{return e[t]}catch{return null}}static getProperty(e,t){let r;if(e==null)return null;{let n;return e.__properties__?(r=e.__properties__["get_"+t],n=r):n=!1,n?e[r]():e[t]}}static setProperty(e,t,r){let n,l;e.__properties__?(n=e.__properties__["set_"+t],l=n):l=!1,l?e[n](r):e[t]=r}static fields(e){let t=[];if(e!=null){let n=Object.prototype.hasOwnProperty;for(var r in e)r!="__id__"&&r!="hx__closures__"&&n.call(e,r)&&t.push(r)}return t}static get __name__(){return"Reflect"}get __class__(){return Ue}};var os=s.$global,p=s.global("$hxClasses")["internal.RecoBackendV2"]=class x extends s.inherits(){[s.new](){}static _requestUri(){return"https://"+x._req_domain+"/api/"+x._environment+"/recommendations/requests"}static noConsentBody(){return{device_id:"no-consent",user_group:"no-consent",version:"no-consent"}}static buildRequestBody(e){let t={lists:e,page_type:x._page_visit!=null?x._page_visit:x._page_view,channel:"www-desktop"};if(x._consent==0){let r=x.noConsentBody(),n=0,l=E.fields(r);for(;n<l.length;){let o=l[n];++n,t[o]=E.field(r,o)}}else x._user_id!=null?t.user_id=x._user_id:t.device_id=x._device_id;return t}static _requestRecos(e){let t=new U,r=null,n=new K(x._requestUri());n.setHeader("Content-Type","application/json"),n.setPostData(JSON.stringify(x.buildRequestBody(e))),n.onError=function(i){throw k.thrown("HTTP Request Error: "+i)},n.onStatus=function(i){if(i<200||i>=300)throw k.thrown("HTTP Status Error: "+i)};try{n.request(!1)}catch(i){let f=k.caught(i).unwrap();throw k.thrown("Failed to execute synchronous request: "+C.string(f))}let l=function(i){let f=JSON.parse(i),m=G.fromRequestData(f);t.trigger(m)},o=n.get_responseData();return o!=null?l(o):n.onData=l,t}static getRawRecommendations(e){return x._requestRecos(e)}static setConsent(e){e>2&&(e=2),x._consent=e}static setPageVisit(e){x._page_visit=e}static setEnvironment(e){x._environment=e}static setDeviceId(e){x._device_id=e}static setUserId(e){x._user_id=e}static setRequestDomain(e){x._req_domain=e}static setPageView(e){x._page_view=e}static getRequestDomain(){return x._req_domain}static getEnvironment(){return x._environment}static getPageVisit(){return x._page_visit}static getUserId(){return x._user_id}static getDeviceId(){return x._device_id}static getPageView(){return x._page_view}static get __name__(){return"internal.RecoBackendV2"}get __class__(){return x}};p._environment=null;p._device_id=null;p._user_id=null;p._consent=0;p._req_domain="europe-west1.froomle.com";p._page_visit=null;p._page_view=null;var Ze=function(){};Ze.__isInterface__=!0;var et=function(){};et.__isInterface__=!0;var G=s.global("$hxClasses")["internal._RecommendationsInternal"]=class ve extends s.inherits(){[s.new](e,t,r,n,l){this.request_id=t,this.user_group=r,this.device_id=e,this.user_id=n,this._lists=l}items(){let e=[],t=0,r=this._lists;for(;t<r.length;){let n=r[t];++t;let l=0,o=n.items;for(;l<o.length;){let i=o[l];++l,e.push(i)}}return e}lists(){return this._lists}getItemsByListName(e){let t=0,r=this._lists;for(;t<r.length;){let n=r[t];if(++t,n.list_name==e)return n}return null}static fromRequestData(e){let t=E.getProperty(e,"lists"),r=[],n=0;for(;n<t.length;){let l=t[n];++n;let o=E.getProperty(l,"items"),i=[],f=0;for(;f<o.length;){let a=o[f];++f,i.push(new le(a))}let m=new W({limit:E.getProperty(l,"limit"),list_key:E.getProperty(l,"list_key"),list_name:E.getProperty(l,"list_name"),list_size:E.getProperty(l,"list_size"),items:i});r.push(m)}return new ve(E.getProperty(e,"device_id"),E.getProperty(e,"request_id"),E.getProperty(e,"user_group"),E.getProperty(e,"user_id"),r)}static get __name__(){return"internal._RecommendationsInternal"}static get __interfaces__(){return[Y]}get __class__(){return ve}};G.prototype.request_id=null;G.prototype.user_group=null;G.prototype.user_id=null;G.prototype.device_id=null;G.prototype._lists=null;var W=s.global("$hxClasses")["internal._RecommendationsListInternal"]=class Le extends s.inherits(){[s.new](e){this.items=e.items,this.limit=e.limit,this.list_key=e.list_key,this.list_name=e.list_name,this.list_size=e.list_size}static get __name__(){return"internal._RecommendationsListInternal"}static get __interfaces__(){return[Z]}get __class__(){return Le}};W.prototype.limit=null;W.prototype.list_key=null;W.prototype.list_name=null;W.prototype.list_size=null;W.prototype.items=null;var le=s.global("$hxClasses")["internal._RecommendationItemInternal"]=class Ne extends s.inherits(){[s.new](e){this._data={},this.Id=E.getProperty(e,"item_id"),this.RequestId=E.getProperty(e,"request_id"),this.UserGroup=E.getProperty(e,"user_group");let t=0,r=E.fields(e);for(;t<r.length;){let n=r[t];++t,this._data[n]=E.field(e,n)}}get(e){return this._data[e]}static get __name__(){return"internal._RecommendationItemInternal"}static get __interfaces__(){return[ee]}get __class__(){return Ne}};le.prototype.Id=null;le.prototype.RequestId=null;le.prototype.UserGroup=null;le.prototype._data=null;var P=s.global("$hxClasses")["internal._RecoBackendV2.RecoBackendV2_Fields_"]=class Ee{static getRawRecommendations(e){return p.getRawRecommendations(e)}static setConsent(e){p.setConsent(e)}static setPageVisit(e){p.setPageVisit(e)}static setEnvironment(e){p.setEnvironment(e)}static setDeviceId(e){p.setDeviceId(e)}static setUserId(e){p.setUserId(e)}static setRequestDomain(e){p.setRequestDomain(e)}static setPageView(e){p.setPageView(e)}static getConsent(){Ee.getConsent()}static getPageVisit(){p.getPageVisit()}static getEnvironment(){p.getEnvironment()}static getDeviceId(){p.getDeviceId()}static getUserId(){p.getUserId()}static getPageView(){p.getPageView()}static get __name__(){return"internal._RecoBackendV2.RecoBackendV2_Fields_"}get __class__(){return Ee}},as=P.getRawRecommendations,us=P.setConsent,_s=P.setPageVisit,cs=P.setEnvironment,gs=P.setDeviceId,ps=P.setUserId,ms=P.setRequestDomain,hs=P.setPageView,ds=P.getConsent,fs=P.getPageVisit,xs=P.getEnvironment,ys=P.getDeviceId,bs=P.getUserId,ws=P.getPageView;var Is=s.$global,L=s.global("$hxClasses").FroomleSdk=class q{static register(){q.registered||q._env_set&&(!q._page_visit_set&&!q._page_view_set||(q.registered=!0))}static setEnvironment(e){p.setEnvironment(e),q._env_set=!0,q.register()}static setDeviceId(e){p.setDeviceId(e)}static setUserId(e){p.setUserId(e)}static setConsent(e){p.setConsent(e)}static setPageView(e){p.setPageView(e),q._page_view_set=!0,q.register()}static setPageVisit(e){p.setPageVisit(e),q._page_visit_set=!0,q.register()}static setRequestDomain(e){p.setRequestDomain(e)}static getRawRecommendations(e){return p.getRawRecommendations(e)}static getVersion(){return"0.0.8"}static get __name__(){return"FroomleSdk"}get __class__(){return q}};L._env_set=!1;L._page_visit_set=!1;L._page_view_set=!1;L.registered=!1;var Ss=s.$global,ie=s.global("$hxClasses")["internal.domHandler.FroomleDomTree"]=class ge extends s.inherits(){[s.new](){}createElement(e){return window.document.createElement(e)}querySelectorAll(e){let t=this.root,r=[],n=t.querySelectorAll(e),l=0,o=n.length;for(;l<o;){let i=l++;r.push(n.item(i))}return r}getRoot(){return this.root}toString(){return this.root.outerHTML}static run(){}static fromHtml(e){return new ge}static fromDocument(){let e=new ge;return e.root=window.document,e}static get __name__(){return"internal.domHandler.FroomleDomTree"}get __class__(){return ge}};ie.prototype.root=null;var Ps=s.$global,O=s.global("$hxClasses")["internal._ADomNode.ADomNode"]=class Ie{static _new(e){return e}static fromElement(e){return e}static create(e,t){return window.document.createElement(t)}static replaceChild(e,t,r){e.replaceChild(t,r)}static get attributes(){return this.get_attributes()}static get_attributes(e){let t=e,r=[],n=0,l=t.attributes.length;for(;n<l;){let o=n++,i=t.attributes.item(o);r.push({name:i.name,value:i.value})}return r}static addChild(e,t){e.appendChild(t)}static removeChild(e,t){e.removeChild(t)}static getAttribute(e,t){return e.getAttribute(t)}static setAttribute(e,t,r){e.setAttribute(t,r)}static getText(e){return e.textContent}static setText(e,t){e.textContent=t}static get children(){return this.get_children()}static get_children(e){let t=[],n=e.children,l=0,o=n.length;for(;l<o;){let i=l++;t.push(n[i])}return t}static querySelectorAll(e,t){let r=e,n=[],l=r.querySelectorAll(t),o=0,i=l.length;for(;o<i;){let f=o++;n.push(l.item(f))}return n}static getFilterKeyValue(e){let t=0,r=Ie.get_attributes(e);for(;t<r.length;){let n=r[t];if(++t,n.name.startsWith("data-froomle-reco-filter-"))return{key:n.name.substring(25),value:n.value}}return{key:null,value:null}}static get __name__(){return"internal._ADomNode.ADomNode_Impl_"}get __class__(){return Ie}};var Ms=s.$global,Me=s.global("$hxClasses")["internal.domHandler.DomDomDom"]=class X extends s.inherits(){[s.new](){}static _fillRecoTargets(e){let t=new U;if(e==null)return t.trigger(!1),t;let r=[],n=e,l=[],o=n.querySelectorAll("*"),i=0,f=o.length;for(;i<f;){let h=i++;l.push(o.item(h))}let m=l,a=0;for(;a<m.length;){let h=m[a];++a;let $=0,v=O.get_attributes(h);for(;$<v.length;){let M=v[$];++$,M.name=="data-froomle-reco"&&r.push(h)}}let u=[],c=0;for(;c<r.length;){let h=r[c];++c,h.getAttribute("data-froomle-request-id")==null&&(h.getAttribute("data-froomle-id")==null||h.getAttribute("data-froomle-id")=="")&&u.push(h)}if(u.length<1)return new U;let I=[],_=[],g="",R="",y="",b=[],D=function(){let h={list_name:g,list_size:b.length,limit:b.length};R!=null&&E.setProperty(h,R,y),I.push(h),_.push(b)},V=function(h,$,v,M){g=h,R=$,y=v,b=[M]},w=0;for(;w<u.length;){let h=u[w];++w;let $=h.getAttribute("data-froomle-reco"),v=O.getFilterKeyValue(h);if(g==""){V($,v.key,v.value,h);continue}else if($==g&&v.key==R&&v.value==y){b.push(h);continue}else{D(),V($,v.key,v.value,h);continue}}return g!=""&&D(),P.getRawRecommendations(I).then(function(h){let $=0,v=h.lists();for(;$<v.length;){let M=v[$],N=$++,T=M,z=T.items.length!=_[N].length,Q=0,pe=T.items;for(;Q<pe.length;){let me=pe[Q],Xe=Q++,ze=me;X._fillParameters(_[N][Xe],ze,h.request_id)}}t.trigger(!0)}),t}static _fillParameters(e,t,r){let n=function(c,I,_,g){g==null&&(g="");let R=function(y,b,D){D==null&&(D="fgh");try{b=new ne("\\\\[(\\\\w+)\\\\]","g").map(b,function(v){return"."+v.matched(1)}),b=j.replace(b,"[","."),b=j.replace(b,"]",""),B.cca(b,0)==46&&(b=B.substr(b,1,null));let w=b.split("."),S=y.get(w[0]),h=1,$=w.length;for(;h<$;){let v=h++;if(S==null)return null;S instanceof Array&&C.parseInt(w[v])!=null?S=S[C.parseInt(w[v])]:S=E.field(S,w[v])}return S}catch{return D}};try{let y=R(t,_,g);I=="inner"?c.textContent=y:c.setAttribute(I,y)}catch{}};e.setAttribute("data-froomle-id",t.Id),e.setAttribute("data-froomle-request-id",r);let l=e,o=[],i=l.querySelectorAll("*"),f=0,m=i.length;for(;f<m;){let c=f++;o.push(i.item(c))}let a=o,u=0;for(;u<a.length;){let c=a[u];++u;let I=0,_=O.get_attributes(c);for(;I<_.length;){let g=_[I];if(++I,g.name.startsWith("data-froomle-param-")){let R=j.replace(g.name,"data-froomle-param-",""),y=g.value;n(c,R,y)}}}}static _orderElements(e){let t=function(_,g,R){let y=[],b=O.get_children(_),D=0;for(;D<b.length;){let S=b[D];if(++D,S.getAttribute("data-froomle-ordervalue")!=null){y.push(S);let $=O.create(e,"span");$.setAttribute("data-froomle-tmp-node",""),O.replaceChild(_,$,S)}}let V=[],w=0;for(;w<y.length;){let S=y[w];++w,V.push(S.getAttribute("data-froomle-ordervalue"))}return{el:_,key:g,values:V,orderChildren:y,list_name:R}},r=new U,n=e.getRoot(),l=[],o=n.querySelectorAll("*"),i=0,f=o.length;for(;i<f;){let _=i++;l.push(o.item(_))}let m=l,a=[],u=0;for(;u<m.length;){let _=m[u];++u;let g=0,R=O.get_attributes(_);for(;g<R.length;){let y=R[g];++g,y.name.startsWith("data-froomle-order-")&&a.push(t(_,y.name.substring(19),y.value))}}if(a.length<1)return r.trigger(!1),r;let c=[],I=0;for(;I<a.length;){let _=a[I];++I;let g={list_name:_.list_name,limit:_.values.length,list_size:_.values.length},R={};E.setProperty(R,_.key,_.values),E.setProperty(g,"order",R),c.push(g)}return P.getRawRecommendations(c).then(function(_){let g=0,R=_.lists();for(;g<R.length;){let y=R[g],D=g++,V=y,w=a[D];w.el.setAttribute("data-froomle-request-id",_.request_id);let S=[],h=0,$=V.items;for(;h<$.length;){let oe=$[h];++h;let N=oe.get(w.key),T=0,z=w.values;for(;T<z.length;){let Q=z[T],me=T++;if(N==Q){S.push(w.orderChildren[me]);break}}}let v=0,M=S.length;for(;v<M;){let oe=v++,N=0,T=O.get_children(w.el);for(;N<T.length;){let z=T[N];if(++N,z.getAttribute("data-froomle-tmp-node")==""){O.replaceChild(w.el,S[oe],z);break}}}}r.trigger(!0)}),r}static domInit(e){X._orderElements(e).then(function(t){X._fillRecoTargets(e.getRoot())})}static fillElementRecos(e){X._fillRecoTargets(e)}static runFromHtml(e){let t=ie.fromHtml(e);return X.domInit(t),t.toString()}static get __name__(){return"internal.domHandler.DomDomDom"}get __class__(){return X}};var zs=s.$global;var tt=L.setUserId,rt=p.getUserId,st=L.setEnvironment,nt=p.getEnvironment,lt=async()=>{throw new Error("Not implemented in V2")},it=async()=>{console.warn("preloadRecommendations not implemented")},ot=async()=>[],at=()=>[],ut=()=>[],_t=()=>[],ct=()=>[],gt=async()=>{},pt=()=>{};
1
+ "use strict";var he=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ge=Object.prototype.hasOwnProperty;var We=(f,e)=>{for(var t in e)he(f,t,{get:e[t],enumerable:!0})},Qe=(f,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ke(e))!Ge.call(f,n)&&n!==t&&he(f,n,{get:()=>e[n],enumerable:!(r=Je(e,n))||r.enumerable});return f};var Ye=f=>Qe(he({},"__esModule",{value:!0}),f);var pt={};We(pt,{DomDomDom:()=>je,FroomleDomTree:()=>ie,FroomleSdk:()=>L,RecoBackendV2:()=>i,RecommendationItem:()=>ee,RecommendationList:()=>Z,Recommendations:()=>Y,Version:()=>fe,_getAllItemsFromCache:()=>ut,_getRawRecommendationCache:()=>ct,_getRecoQueue:()=>at,_getRecommendedItemsCache:()=>_t,getFroomleEnvironment:()=>nt,getFroomleUserId:()=>rt,getRecommendationItem:()=>lt,getRecommendations:()=>ot,preloadRecommendations:()=>it,reset:()=>gt,setFroomleEnvironment:()=>st,setFroomleUserId:()=>tt,weirdReco:()=>mt});module.exports=Ye(pt);var s=class f{static global(e){return f.globals[e]?f.globals[e]:f.globals[e]={}}static createStatic(e,t,r){let n=null;Object.defineProperty(e,t,{enumerable:!0,get:function(){return r!=null&&(n=r(),r=null),n},set:function(l){r!=null&&(n=r(),r=null),n=l}})}static iterator(e){if(Array.isArray(e)){let t=e;return function(){return f.mkIter(t)}}else return typeof e.iterator=="function"?e.iterator.bind(e):e.iterator}static getIterator(e){return Array.isArray(e)?f.mkIter(e):e.iterator()}static mkIter(e){return new de(e)}static extend(e){function t(){this[f.new].apply(this,arguments)}return Object.setPrototypeOf(t.prototype,e.prototype),t}static inherits(e,t){t==null&&(t=!1);function r(){t&&e&&r[f.init]&&r[f.init](),this[f.new].apply(this,arguments)}return t?r[f.init]=()=>{let n=e();n[f.init]&&n[f.init](),Object.setPrototypeOf(r.prototype,n.prototype),r[f.init]=void 0}:e&&e[f.init]?(t=!0,r[f.init]=()=>{e[f.init]&&e[f.init](),Object.setPrototypeOf(r.prototype,e.prototype),r[f.init]=void 0}):e&&Object.setPrototypeOf(r.prototype,e.prototype),r}static bind(e,t){if(t==null)return null;t.__id__==null&&(t.__id__=f.fid++);let r=null;return e.hx__closures__==null?e.hx__closures__={}:r=e.hx__closures__[t.__id__],r==null&&(r=t.bind(e),e.hx__closures__[t.__id__]=r),r}static get __name__(){return"genes.Register"}get __class__(){return f}};s.$global=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:void 0;s.globals={};s.new=Symbol();s.init=Symbol();s.fid=0;var de=s.global("$hxClasses")["genes._Register.ArrayIterator"]=class Ee extends s.inherits(){[s.new](e){this.current=0,this.array=e}hasNext(){return this.current<this.array.length}next(){return this.array[this.current++]}static get __name__(){return"genes._Register.ArrayIterator"}get __class__(){return Ee}};de.prototype.array=null;de.prototype.current=null;var xt=s.$global,fe=s.global("$hxClasses").Version=class Ce{static get __name__(){return"Version"}get __class__(){return Ce}};fe.CURRENT="0.0.10";var wt=s.$global,Y=function(){};Y.__isInterface__=!0;var Z=function(){};Z.__isInterface__=!0;var ee=function(){};ee.__isInterface__=!0;var Et=s.$global,ae=s.global("$hxClasses")["haxe.ValueException"]=class $e extends s.inherits(()=>$,!0){[s.new](e,t,r){super[s.new](String(e),t,r),this.value=e}unwrap(){return this.value}static get __name__(){return"haxe.ValueException"}static get __super__(){return $}get __class__(){return $e}};ae.prototype.value=null;var Dt=s.$global,$=s.global("$hxClasses")["haxe.Exception"]=class te extends s.inherits(()=>Error,!0){[s.new](e,t,r){Error.call(this,e),this.message=e,this.__previousException=t,this.__nativeException=r!=null?r:this}unwrap(){return this.__nativeException}get_native(){return this.__nativeException}static caught(e){return e instanceof te?e:e instanceof Error?new te(e.message,null,e):new ae(e,null,e)}static thrown(e){return e instanceof te?e.get_native():e instanceof Error?e:new ae(e)}static get __name__(){return"haxe.Exception"}static get __super__(){return Error}get __class__(){return te}};$.prototype.native=null;$.prototype.__skipStack=null;$.prototype.__nativeException=null;$.prototype.__previousException=null;var Bt=s.$global,xe=s.global("$hxClasses")["js.Browser"]=class ke{static get supported(){return this.get_supported()}static get_supported(){return typeof window!="undefined"&&typeof window.location!="undefined"?typeof window.location.protocol=="string":!1}static createXMLHttpRequest(){if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")return new"ActiveXObject"("Microsoft.XMLHTTP");throw $.thrown("Unable to create XMLHttpRequest object.")}static get __name__(){return"js.Browser"}get __class__(){return ke}};var Ft=s.$global,A=s.global("$hxEnums")["haxe.io.Error"]={__ename__:"haxe.io.Error",Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error"},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error"},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error"},Custom:Object.assign(f=>({_hx_index:3,__enum__:"haxe.io.Error",e:f}),{_hx_name:"Custom",__params__:["e"]})};A.__constructs__=[A.Blocked,A.Overflow,A.OutsideBounds,A.Custom];A.__empty_constructs__=[A.Blocked,A.Overflow,A.OutsideBounds];var Tt=s.$global,H=s.global("$hxEnums")["haxe.io.Encoding"]={__ename__:"haxe.io.Encoding",UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding"},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding"}};H.__constructs__=[H.UTF8,H.RawNative];H.__empty_constructs__=[H.UTF8,H.RawNative];var Xt=s.$global,J=s.global("$hxClasses")["haxe.io.Bytes"]=class ye extends s.inherits(){[s.new](e){this.length=e.byteLength,this.b=new Uint8Array(e),this.b.bufferValue=e,e.hxBytes=this,e.bytes=this.b}getString(e,t,r){if(e<0||t<0||e+t>this.length)throw $.thrown(A.OutsideBounds);r==null&&(r=H.UTF8);let n="",l=this.b,a=e,o=e+t;switch(r._hx_index){case 0:let x=e>0;for(;a<o;){let p=l[a++];if(p<128){if(p==0)break;n+=String.fromCodePoint(p)}else if(p<224){let u=(p&63)<<6|l[a++]&127;n+=String.fromCodePoint(u)}else if(p<240){let u=l[a++],_=(p&31)<<12|(u&127)<<6|l[a++]&127;n+=String.fromCodePoint(_)}else{let u=l[a++],_=l[a++],g=(p&15)<<18|(u&127)<<12|(_&127)<<6|l[a++]&127;n+=String.fromCodePoint(g)}}break;case 1:for(;a<o;){let p=l[a++]|l[a++]<<8;n+=String.fromCodePoint(p)}break}return n}static ofData(e){let t=e.hxBytes;return t!=null?t:new ye(e)}static get __name__(){return"haxe.io.Bytes"}get __class__(){return ye}};J.prototype.length=null;J.prototype.b=null;var Gt=s.$global,F=s.global("$hxClasses")["haxe.http.HttpBase"]=class De extends s.inherits(){[s.new](e){this.url=e,this.headers=[],this.params=[],this.emptyOnData=s.bind(this,this.onData)}get responseData(){return this.get_responseData()}setHeader(e,t){let r=0,n=this.headers.length;for(;r<n;){let l=r++;if(this.headers[l].name==e){this.headers[l]={name:e,value:t};return}}this.headers.push({name:e,value:t})}setPostData(e){this.postData=e,this.postBytes=null}onData(e){}onBytes(e){}onError(e){}onStatus(e){}hasOnData(){return s.bind(this,this.onData)!=this.emptyOnData}success(e){this.responseBytes=e,this.responseAsString=null,this.hasOnData()&&this.onData(this.get_responseData()),this.onBytes(this.responseBytes)}get_responseData(){return this.responseAsString==null&&this.responseBytes!=null&&(this.responseAsString=this.responseBytes.getString(0,this.responseBytes.length,H.UTF8)),this.responseAsString}static get __name__(){return"haxe.http.HttpBase"}get __class__(){return De}};F.prototype.url=null;F.prototype.responseBytes=null;F.prototype.responseAsString=null;F.prototype.postData=null;F.prototype.postBytes=null;F.prototype.headers=null;F.prototype.params=null;F.prototype.emptyOnData=null;var Yt=s.$global,ue=s.global("$hxClasses")["haxe.iterators.MapKeyValueIterator"]=class Se extends s.inherits(){[s.new](e){this.map=e,this.keys=e.keys()}hasNext(){return this.keys.hasNext()}next(){let e=this.keys.next();return{value:this.map.get(e),key:e}}static get __name__(){return"haxe.iterators.MapKeyValueIterator"}get __class__(){return Se}};ue.prototype.map=null;ue.prototype.keys=null;var tr=s.$global,be=function(){};be.__isInterface__=!0;var nr=s.$global,we=s.global("$hxClasses")["js.Boot"]=class re{static __string_rec(e,t){if(e==null)return"null";if(t.length>=5)return"<...>";let r=typeof e;switch(r=="function"&&(e.__name__||e.__ename__)&&(r="object"),r){case"function":return"<function>";case"object":if(e.__enum__){let p=s.global("$hxEnums")[e.__enum__].__constructs__[e._hx_index],u=p._hx_name;return p.__params__?(t=t+" ",u+"("+(function(_){var g;let E=[];{let c=0,m=p.__params__;for(;c<m.length;){let R=m[c];c=c+1,E.push(re.__string_rec(e[R],t))}}return g=E,g})(this).join(",")+")"):u}if(e instanceof Array){let x="[";t+=" ";let p=0,u=e.length;for(;p<u;){let _=p++;x+=(_>0?",":"")+re.__string_rec(e[_],t)}return x+="]",x}let n;try{n=e.toString}catch{return"???"}if(n!=null&&n!=Object.toString&&typeof n=="function"){let x=e.toString();if(x!="[object Object]")return x}let l=`{
2
+ `;t+=" ";let a=e.hasOwnProperty!=null,o=null;for(o in e)a&&!e.hasOwnProperty(o)||o=="prototype"||o=="__class__"||o=="__super__"||o=="__interfaces__"||o=="__properties__"||(l.length!=2&&(l+=`,
3
+ `),l+=t+o+" : "+re.__string_rec(e[o],t));return t=t.substring(1),l+=`
4
+ `+t+"}",l;break;case"string":return e;default:return String(e)}}static get __name__(){return"js.Boot"}get __class__(){return re}};we.__toStr={}.toString;var ar=s.$global,S=s.global("$hxClasses").Std=class Pe{static string(e){return we.__string_rec(e,"")}static parseInt(e){let t=parseInt(e);return isNaN(t)?null:t}static get __name__(){return"Std"}get __class__(){return Pe}};String.__name__=!0,Array.__name__=!0;var gr=s.$global,_e=s.global("$hxClasses")["genes.util.EsMap"]=class se extends s.inherits(){[s.new](){this.inst=new Map}set(e,t){this.inst.set(e,t)}get(e){return this.inst.get(e)}remove(e){return this.inst.delete(e)}exists(e){return this.inst.has(e)}keys(){return se.adaptIterator(this.inst.keys())}iterator(){return se.adaptIterator(this.inst.values())}toString(){let e=[],t=se.adaptIterator(this.inst.keys());for(;t.hasNext();){let r=t.next();e.push(""+S.string(r)+" => "+S.string(this.inst.get(r)))}return"{"+e.join(", ")+"}"}clear(){this.inst.clear()}static adaptIterator(e){let t,r,n=function(){let l=e.next();t=l.value,r=l.done};return{hasNext:function(){return r==null&&n(),!r},next:function(){r==null&&n();let l=t;return n(),l}}}static get __name__(){return"genes.util.EsMap"}get __class__(){return se}};_e.prototype.inst=null;var xr=s.$global,qe=s.global("$hxClasses")["haxe.ds.StringMap"]=class Re extends s.inherits(_e){[s.new](){super[s.new]()}copy(){let e=new Re;return e.inst=new Map(this.inst),e}keyValueIterator(){return new ue(this)}static get __name__(){return"haxe.ds.StringMap"}static get __interfaces__(){return[be]}static get __super__(){return _e}get __class__(){return Re}};var wr=s.$global,q=s.global("$hxClasses").HxOverrides=class Be{static cca(e,t){let r=e.charCodeAt(t);if(r==r)return r}static substr(e,t,r){if(r==null)r=e.length;else if(r<0)if(t==0)r=e.length+r;else return"";return e.substr(t,r)}static now(){return Date.now()}static get __name__(){return"HxOverrides"}get __class__(){return Be}};typeof performance!="undefined"&&typeof performance.now=="function"&&(q.now=performance.now.bind(performance));var Er=s.$global,M=s.global("$hxClasses").StringTools=class ce{static isSpace(e,t){let r=q.cca(e,t);return r>8&&r<14?!0:r==32}static ltrim(e){let t=e.length,r=0;for(;r<t&&ce.isSpace(e,r);)++r;return r>0?q.substr(e,r,t-r):e}static rtrim(e){let t=e.length,r=0;for(;r<t&&ce.isSpace(e,t-r-1);)++r;return r>0?q.substr(e,0,t-r):e}static replace(e,t,r){return e.split(t).join(r)}static get __name__(){return"StringTools"}get __class__(){return ce}};var kr=s.$global,Ve=s.global("$hxClasses").Lambda=class Ae{static exists(e,t){let r=s.getIterator(e);for(;r.hasNext();){let n=r.next();if(t(n))return!0}return!1}static get __name__(){return"Lambda"}get __class__(){return Ae}};var Vr=s.$global,ne=s.global("$hxClasses").EReg=class Fe extends s.inherits(){[s.new](e,t){this.r=new RegExp(e,t.split("u").join(""))}match(e){return this.r.global&&(this.r.lastIndex=0),this.r.m=this.r.exec(e),this.r.s=e,this.r.m!=null}matched(e){if(this.r.m!=null&&e>=0&&e<this.r.m.length)return this.r.m[e];throw $.thrown("EReg::matched")}matchedPos(){if(this.r.m==null)throw $.thrown("No string matched");return{pos:this.r.m.index,len:this.r.m[0].length}}matchSub(e,t,r){if(r==null&&(r=-1),this.r.global){this.r.lastIndex=t,this.r.m=this.r.exec(r<0?e:q.substr(e,0,t+r));let n=this.r.m!=null;return n&&(this.r.s=e),n}else{let n=this.match(r<0?q.substr(e,t,null):q.substr(e,t,r));return n&&(this.r.s=e,this.r.m.index+=t),n}}map(e,t){let r=0,n="";do{if(r>=e.length)break;if(!this.matchSub(e,r)){n+=S.string(q.substr(e,r,null));break}let l=this.matchedPos();n+=S.string(q.substr(e,r,l.pos-r)),n+=S.string(t(this)),l.len==0?(n+=S.string(q.substr(e,l.pos,1)),r=l.pos+1):r=l.pos+l.len}while(this.r.global);return!this.r.global&&r>0&&r<e.length&&(n+=S.string(q.substr(e,r,null))),n}static get __name__(){return"EReg"}get __class__(){return Fe}};ne.prototype.r=null;var zr=s.$global,K=s.global("$hxClasses")["haxe.http.HttpJs"]=class He extends s.inherits(F){[s.new](e){this.async=!0,this.withCredentials=!1,super[s.new](e)}request(e){this.responseAsString=null,this.responseBytes=null,this.responseHeaders=null;let t=this.req=xe.createXMLHttpRequest(),r=this,n=function(u){if(t.readyState!=4)return;let _;try{_=t.status}catch{_=null}if(_==0&&xe.get_supported()&&s.$global.location!=null){let g=s.$global.location.protocol.toLowerCase();new ne("^(?:about|app|app-storage|.+-extension|file|res|widget):$","").match(g)&&(_=t.response!=null?200:404)}if(_==null&&(_=null),_!=null&&r.onStatus(_),_!=null&&_>=200&&_<400){r.req=null;let g=t.getAllResponseHeaders().split(`\r
5
+ `),E=[],c=0,m=g;for(;c<m.length;){let b=m[c];++c,b!=""&&E.push(b)}g=E;let R=new qe;r.responseHeaders=R;let y=0;for(;y<g.length;){let b=g[y];++y;let P=b.split(": "),V=P.shift(),w=P.length==1?P[0]:P.join(": ");w=M.ltrim(M.rtrim(w)),r.responseHeaders.inst.set(V,w)}r.success(J.ofData(t.response))}else if(_==null||_==0&&t.response==null)r.req=null,r.onError("Failed to connect or resolve host");else if(_==null){r.req=null;let g=t.response!=null?J.ofData(t.response):null;r.responseBytes=g,r.onError("Http Error #"+t.status)}else switch(_){case 12007:r.req=null,r.onError("Unknown host");break;case 12029:r.req=null,r.onError("Failed to connect to host");break;default:r.req=null;let g=t.response!=null?J.ofData(t.response):null;r.responseBytes=g,r.onError("Http Error #"+t.status)}};this.async&&(t.onreadystatechange=n);let l,a=this.postData,o=this.postBytes;if(a==null)if(o==null)l=null;else{let u=o;l=new Blob([u.b.bufferValue])}else o==null?l=a:l=null;if(l!=null)e=!0;else{let u=0,_=this.params;for(;u<_.length;){let g=_[u];++u,l==null?l="":l=(l==null?"null":S.string(l))+"&";let E=g.name,c=(l==null?"null":S.string(l))+encodeURIComponent(E)+"=",m=g.value;l=c+encodeURIComponent(m)}}try{if(e)t.open("POST",this.url,this.async);else if(l!=null){let u=this.url.split("?").length<=1;t.open("GET",this.url+(u?"?":"&")+(l==null?"null":S.string(l)),this.async),l=null}else t.open("GET",this.url,this.async);t.responseType="arraybuffer"}catch(u){let _=$.caught(u).unwrap();this.req=null,this.onError(_.toString());return}t.withCredentials=this.withCredentials,!Ve.exists(this.headers,function(u){return u.name=="Content-Type"})&&e&&this.postData==null&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");let x=0,p=this.headers;for(;x<p.length;){let u=p[x];++x,t.setRequestHeader(u.name,u.value)}t.send(l),this.async||n(null)}static get __name__(){return"haxe.http.HttpJs"}static get __super__(){return F}get __class__(){return He}};K.prototype.async=null;K.prototype.withCredentials=null;K.prototype.responseHeaders=null;K.prototype.req=null;var Gr=s.$global,U=s.global("$hxClasses").SimpleFuture=class Oe extends s.inherits(){[s.new](){this._isFinished=!1}trigger(e){this._result=e,this._isFinished=!0,this._callback!=null&&this._callback(this._result)}then(e){this._callback=e,this._isFinished&&e(this._result)}static get __name__(){return"SimpleFuture"}get __class__(){return Oe}};U.prototype._callback=null;U.prototype._result=null;U.prototype._isFinished=null;var Yr=s.$global,I=s.global("$hxClasses").Reflect=class Te{static field(e,t){try{return e[t]}catch{return null}}static getProperty(e,t){let r;if(e==null)return null;{let n;return e.__properties__?(r=e.__properties__["get_"+t],n=r):n=!1,n?e[r]():e[t]}}static setProperty(e,t,r){let n,l;e.__properties__?(n=e.__properties__["set_"+t],l=n):l=!1,l?e[n](r):e[t]=r}static fields(e){let t=[];if(e!=null){let n=Object.prototype.hasOwnProperty;for(var r in e)r!="__id__"&&r!="hx__closures__"&&n.call(e,r)&&t.push(r)}return t}static get __name__(){return"Reflect"}get __class__(){return Te}};var os=s.$global,i=s.global("$hxClasses")["internal.RecoBackendV2"]=class d extends s.inherits(){[s.new](){}static _requestUri(){return"https://"+d._req_domain+"/api/"+d._environment+"/recommendations/requests"}static noConsentBody(){return{device_id:"no-consent",user_group:"no-consent",version:"no-consent"}}static buildRequestBody(e){let t={lists:e,page_type:d._page_visit!=null?d._page_visit:d._page_view,channel:"www-desktop"};if(d._consent==0){let r=d.noConsentBody(),n=0,l=I.fields(r);for(;n<l.length;){let a=l[n];++n,t[a]=I.field(r,a)}}else d._user_id!=null?t.user_id=d._user_id:t.device_id=d._device_id;return t}static _requestRecos(e){let t=new U,r=null,n=new K(d._requestUri());n.setHeader("Content-Type","application/json"),n.setPostData(JSON.stringify(d.buildRequestBody(e))),n.onError=function(o){throw $.thrown("HTTP Request Error: "+o)},n.onStatus=function(o){if(o<200||o>=300)throw $.thrown("HTTP Status Error: "+o)};try{n.request(!1)}catch(o){let x=$.caught(o).unwrap();throw $.thrown("Failed to execute synchronous request: "+S.string(x))}let l=function(o){let x=JSON.parse(o),p=G.fromRequestData(x);t.trigger(p)},a=n.get_responseData();return a!=null?l(a):n.onData=l,t}static getRawRecommendations(e){return d._requestRecos(e)}static setConsent(e){e>2&&(e=2),d._consent=e}static setChannel(e){d._channel=e}static setPageVisit(e){d._page_visit=e}static setEnvironment(e){d._environment=e}static setDeviceId(e){d._device_id=e}static setUserId(e){d._user_id=e}static setRequestDomain(e){d._req_domain=e}static setPageView(e){d._page_view=e}static getRequestDomain(){return d._req_domain}static getEnvironment(){return d._environment}static getPageVisit(){return d._page_visit}static getUserId(){return d._user_id}static getDeviceId(){return d._device_id}static getPageView(){return d._page_view}static getConsent(){return d._consent}static getChannel(){return d._channel}static get __name__(){return"internal.RecoBackendV2"}get __class__(){return d}};i._environment=null;i._device_id="no-consent";i._user_id=null;i._consent=0;i._req_domain="europe-west1.froomle.com";i._page_visit=null;i._page_view=null;i._channel="www-desktop";var Ze=function(){};Ze.__isInterface__=!0;var et=function(){};et.__isInterface__=!0;var G=s.global("$hxClasses")["internal._RecommendationsInternal"]=class ve extends s.inherits(){[s.new](e,t,r,n,l){this.request_id=t,this.user_group=r,this.device_id=e,this.user_id=n,this._lists=l}items(){let e=[],t=0,r=this._lists;for(;t<r.length;){let n=r[t];++t;let l=0,a=n.items;for(;l<a.length;){let o=a[l];++l,e.push(o)}}return e}lists(){return this._lists}getItemsByListName(e){let t=0,r=this._lists;for(;t<r.length;){let n=r[t];if(++t,n.list_name==e)return n}return null}static fromRequestData(e){let t=I.getProperty(e,"lists"),r=[],n=0;for(;n<t.length;){let l=t[n];++n;let a=I.getProperty(l,"items"),o=[],x=0;for(;x<a.length;){let u=a[x];++x,o.push(new le(u))}let p=new W({limit:I.getProperty(l,"limit"),list_key:I.getProperty(l,"list_key"),list_name:I.getProperty(l,"list_name"),list_size:I.getProperty(l,"list_size"),items:o});r.push(p)}return new ve(I.getProperty(e,"device_id"),I.getProperty(e,"request_id"),I.getProperty(e,"user_group"),I.getProperty(e,"user_id"),r)}static get __name__(){return"internal._RecommendationsInternal"}static get __interfaces__(){return[Y]}get __class__(){return ve}};G.prototype.request_id=null;G.prototype.user_group=null;G.prototype.user_id=null;G.prototype.device_id=null;G.prototype._lists=null;var W=s.global("$hxClasses")["internal._RecommendationsListInternal"]=class Ue extends s.inherits(){[s.new](e){this.items=e.items,this.limit=e.limit,this.list_key=e.list_key,this.list_name=e.list_name,this.list_size=e.list_size}static get __name__(){return"internal._RecommendationsListInternal"}static get __interfaces__(){return[Z]}get __class__(){return Ue}};W.prototype.limit=null;W.prototype.list_key=null;W.prototype.list_name=null;W.prototype.list_size=null;W.prototype.items=null;var le=s.global("$hxClasses")["internal._RecommendationItemInternal"]=class Le extends s.inherits(){[s.new](e){this._data={},this.Id=I.getProperty(e,"item_id"),this.RequestId=I.getProperty(e,"request_id"),this.UserGroup=I.getProperty(e,"user_group");let t=0,r=I.fields(e);for(;t<r.length;){let n=r[t];++t,this._data[n]=I.field(e,n)}}get(e){return this._data[e]}static get __name__(){return"internal._RecommendationItemInternal"}static get __interfaces__(){return[ee]}get __class__(){return Le}};le.prototype.Id=null;le.prototype.RequestId=null;le.prototype.UserGroup=null;le.prototype._data=null;var k=s.global("$hxClasses")["internal._RecoBackendV2.RecoBackendV2_Fields_"]=class Ne{static getRawRecommendations(e){return i.getRawRecommendations(e)}static setConsent(e){i.setConsent(e)}static setPageVisit(e){i.setPageVisit(e)}static setEnvironment(e){i.setEnvironment(e)}static setDeviceId(e){i.setDeviceId(e)}static setUserId(e){i.setUserId(e)}static setRequestDomain(e){i.setRequestDomain(e)}static setPageView(e){i.setPageView(e)}static setChannel(e){i.setChannel(e)}static getRequestDomain(){i.getRequestDomain()}static getConsent(){i.getConsent()}static getPageVisit(){i.getPageVisit()}static getEnvironment(){i.getEnvironment()}static getDeviceId(){i.getDeviceId()}static getUserId(){i.getUserId()}static getPageView(){i.getPageView()}static getChannel(){i.getChannel()}static get __name__(){return"internal._RecoBackendV2.RecoBackendV2_Fields_"}get __class__(){return Ne}},as=k.getRawRecommendations,us=k.setConsent,_s=k.setPageVisit,cs=k.setEnvironment,gs=k.setDeviceId,ms=k.setUserId,ps=k.setRequestDomain,hs=k.setPageView,ds=k.setChannel,fs=k.getRequestDomain,xs=k.getConsent,ys=k.getPageVisit,bs=k.getEnvironment,ws=k.getDeviceId,Rs=k.getUserId,vs=k.getPageView,Is=k.getChannel;var ks=s.$global,L=s.global("$hxClasses").FroomleSdk=class B{static register(){B.registered||B._env_set&&(!B._page_visit_set&&!B._page_view_set||(B.registered=!0))}static buildScriptTag(){let e='<script src="https://cdn.froomle.com/reco-backend-v2/0.0.10/reco-backend-v2.min.js" data-froomle-env="'+i.getEnvironment()+'" ';return i.getPageVisit()!=null&&(e+='data-froomle-page-visit="'+i.getPageVisit()+'" '),i.getPageView()!=null&&(e+='data-froomle-page-view="'+i.getPageView()+'" '),i.getDeviceId()!=null&&(e+='data-froomle-device-id="'+i.getDeviceId()+'" '),i.getUserId()!=null&&(e+='data-froomle-user-id="'+i.getUserId()+'" '),i.getConsent()>0&&(e+='data-froomle-consent="'+i.getConsent()+'" '),i.getRequestDomain()!=null&&(e+='data-froomle-request-domain="'+i.getRequestDomain()+'" '),e+="><\/script>",e}static setEnvironment(e){i.setEnvironment(e),B._env_set=!0,B.register()}static setDeviceId(e){i.setDeviceId(e)}static setUserId(e){i.setUserId(e)}static setConsent(e){i.setConsent(e)}static setPageView(e){i.setPageView(e),B._page_view_set=!0,B.register()}static setPageVisit(e){i.setPageVisit(e),B._page_visit_set=!0,B.register()}static setRequestDomain(e){i.setRequestDomain(e)}static getRawRecommendations(e){return i.getRawRecommendations(e)}static getVersion(){return"0.0.10"}static get __name__(){return"FroomleSdk"}get __class__(){return B}};L._env_set=!1;L._page_visit_set=!1;L._page_view_set=!1;L.registered=!1;var Ps=s.$global,ie=s.global("$hxClasses")["internal.domHandler.FroomleDomTree"]=class ge extends s.inherits(){[s.new](){}createElement(e){return window.document.createElement(e)}querySelectorAll(e){let t=this.root,r=[],n=t.querySelectorAll(e),l=0,a=n.length;for(;l<a;){let o=l++;r.push(n.item(o))}return r}getRoot(){return this.root}toString(){return this.root.outerHTML}static run(){}static fromHtml(e){return new ge}static fromDocument(){let e=new ge;return e.root=window.document,e}static get __name__(){return"internal.domHandler.FroomleDomTree"}get __class__(){return ge}};ie.prototype.root=null;var Vs=s.$global,O=s.global("$hxClasses")["internal._ADomNode.ADomNode"]=class Ie{static _new(e){return e}static fromElement(e){return e}static create(e,t){return window.document.createElement(t)}static replaceChild(e,t,r){e.replaceChild(t,r)}static get attributes(){return this.get_attributes()}static get_attributes(e){let t=e,r=[],n=0,l=t.attributes.length;for(;n<l;){let a=n++,o=t.attributes.item(a);r.push({name:o.name,value:o.value})}return r}static addChild(e,t){e.appendChild(t)}static removeChild(e,t){e.removeChild(t)}static getAttribute(e,t){return e.getAttribute(t)}static setAttribute(e,t,r){e.setAttribute(t,r)}static getText(e){return e.textContent}static setText(e,t){e.textContent=t}static get children(){return this.get_children()}static get_children(e){let t=[],n=e.children,l=0,a=n.length;for(;l<a;){let o=l++;t.push(n[o])}return t}static querySelectorAll(e,t){let r=e,n=[],l=r.querySelectorAll(t),a=0,o=l.length;for(;a<o;){let x=a++;n.push(l.item(x))}return n}static getFilterKeyValue(e){let t=0,r=Ie.get_attributes(e);for(;t<r.length;){let n=r[t];if(++t,n.name.startsWith("data-froomle-reco-filter-"))return{key:n.name.substring(25),value:n.value}}return{key:null,value:null}}static get __name__(){return"internal._ADomNode.ADomNode_Impl_"}get __class__(){return Ie}};var zs=s.$global,je=s.global("$hxClasses")["internal.domHandler.DomDomDom"]=class X extends s.inherits(){[s.new](){}static _fillRecoTargets(e){let t=new U;if(e==null)return t.trigger(!1),t;let r=[],n=e,l=[],a=n.querySelectorAll("*"),o=0,x=a.length;for(;o<x;){let h=o++;l.push(a.item(h))}let p=l,u=0;for(;u<p.length;){let h=p[u];++u;let C=0,v=O.get_attributes(h);for(;C<v.length;){let j=v[C];++C,j.name=="data-froomle-reco"&&r.push(h)}}let _=[],g=0;for(;g<r.length;){let h=r[g];++g,h.getAttribute("data-froomle-request-id")==null&&(h.getAttribute("data-froomle-id")==null||h.getAttribute("data-froomle-id")=="")&&_.push(h)}if(_.length<1)return new U;let E=[],c=[],m="",R="",y="",b=[],P=function(){let h={list_name:m,list_size:b.length,limit:b.length};R!=null&&I.setProperty(h,R,y),E.push(h),c.push(b)},V=function(h,C,v,j){m=h,R=C,y=v,b=[j]},w=0;for(;w<_.length;){let h=_[w];++w;let C=h.getAttribute("data-froomle-reco"),v=O.getFilterKeyValue(h);if(m==""){V(C,v.key,v.value,h);continue}else if(C==m&&v.key==R&&v.value==y){b.push(h);continue}else{P(),V(C,v.key,v.value,h);continue}}return m!=""&&P(),k.getRawRecommendations(E).then(function(h){let C=0,v=h.lists();for(;C<v.length;){let j=v[C],N=C++,T=j,z=T.items.length!=c[N].length,Q=0,me=T.items;for(;Q<me.length;){let pe=me[Q],Xe=Q++,ze=pe;X._fillParameters(c[N][Xe],ze,h.request_id)}}t.trigger(!0)}),t}static _fillParameters(e,t,r){let n=function(g,E,c,m){m==null&&(m="");let R=function(y,b,P){P==null&&(P="fgh");try{b=new ne("\\\\[(\\\\w+)\\\\]","g").map(b,function(v){return"."+v.matched(1)}),b=M.replace(b,"[","."),b=M.replace(b,"]",""),q.cca(b,0)==46&&(b=q.substr(b,1,null));let w=b.split("."),D=y.get(w[0]),h=1,C=w.length;for(;h<C;){let v=h++;if(D==null)return null;D instanceof Array&&S.parseInt(w[v])!=null?D=D[S.parseInt(w[v])]:D=I.field(D,w[v])}return D}catch{return P}};try{let y=R(t,c,m);E=="inner"?g.textContent=y:g.setAttribute(E,y)}catch{}};e.setAttribute("data-froomle-id",t.Id),e.setAttribute("data-froomle-request-id",r);let l=e,a=[],o=l.querySelectorAll("*"),x=0,p=o.length;for(;x<p;){let g=x++;a.push(o.item(g))}let u=a,_=0;for(;_<u.length;){let g=u[_];++_;let E=0,c=O.get_attributes(g);for(;E<c.length;){let m=c[E];if(++E,m.name.startsWith("data-froomle-param-")){let R=M.replace(m.name,"data-froomle-param-",""),y=m.value;n(g,R,y)}}}}static _orderElements(e){let t=function(c,m,R){let y=[],b=O.get_children(c),P=0;for(;P<b.length;){let D=b[P];if(++P,D.getAttribute("data-froomle-ordervalue")!=null){y.push(D);let C=O.create(e,"span");C.setAttribute("data-froomle-tmp-node",""),O.replaceChild(c,C,D)}}let V=[],w=0;for(;w<y.length;){let D=y[w];++w,V.push(D.getAttribute("data-froomle-ordervalue"))}return{el:c,key:m,values:V,orderChildren:y,list_name:R}},r=new U,n=e.getRoot(),l=[],a=n.querySelectorAll("*"),o=0,x=a.length;for(;o<x;){let c=o++;l.push(a.item(c))}let p=l,u=[],_=0;for(;_<p.length;){let c=p[_];++_;let m=0,R=O.get_attributes(c);for(;m<R.length;){let y=R[m];++m,y.name.startsWith("data-froomle-order-")&&u.push(t(c,y.name.substring(19),y.value))}}if(u.length<1)return r.trigger(!1),r;let g=[],E=0;for(;E<u.length;){let c=u[E];++E;let m={list_name:c.list_name,limit:c.values.length,list_size:c.values.length},R={};I.setProperty(R,c.key,c.values),I.setProperty(m,"order",R),g.push(m)}return k.getRawRecommendations(g).then(function(c){let m=0,R=c.lists();for(;m<R.length;){let y=R[m],P=m++,V=y,w=u[P];w.el.setAttribute("data-froomle-request-id",c.request_id);let D=[],h=0,C=V.items;for(;h<C.length;){let oe=C[h];++h;let N=oe.get(w.key),T=0,z=w.values;for(;T<z.length;){let Q=z[T],pe=T++;if(N==Q){D.push(w.orderChildren[pe]);break}}}let v=0,j=D.length;for(;v<j;){let oe=v++,N=0,T=O.get_children(w.el);for(;N<T.length;){let z=T[N];if(++N,z.getAttribute("data-froomle-tmp-node")==""){O.replaceChild(w.el,D[oe],z);break}}}}r.trigger(!0)}),r}static domInit(e){X._orderElements(e).then(function(t){X._fillRecoTargets(e.getRoot())})}static fillElementRecos(e){X._fillRecoTargets(e)}static runFromHtml(e){if(e=="")return"";let t=ie.fromHtml(e);return X.domInit(t),t.toString()}static get __name__(){return"internal.domHandler.DomDomDom"}get __class__(){return X}};var Gs=s.$global;var tt=L.setUserId,rt=i.getUserId,st=L.setEnvironment,nt=i.getEnvironment,lt=async()=>{throw new Error("Not implemented in V2")},it=async()=>{console.warn("preloadRecommendations not implemented")},ot=async()=>[],at=()=>[],ut=()=>[],_t=()=>[],ct=()=>[],gt=async()=>{},mt=()=>{};
6
6
  //# sourceMappingURL=testing.cjs.map