@goodgamestudios/cxf-announcements
Advanced tools
Comparing version 0.19.1-qa.28 to 0.19.1
@@ -1,2 +0,2 @@ | ||
!function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},e={},n={},r=t.parcelRequireb657;function o(t,e,n,r,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var i=t.apply(e,n);function c(t){o(i,r,a,c,u,"next",t)}function u(t){o(i,r,a,c,u,"throw",t)}c(void 0)}))}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){i(t,e,n[e])}))}return t}function u(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||u(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}null==r&&((r=function(t){if(t in e)return e[t].exports;if(t in n){let r=n[t];delete n[t];let o={id:t,exports:{}};return e[t]=o,r.call(o.exports,o,o.exports),o.exports}var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(t,e){n[t]=e},t.parcelRequireb657=r);var f,h,g,d,p,m={};Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=new Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o<n;){var a=e[o];if(t.call(r,a,o,e))return a;o++}},configurable:!0,writable:!0});var y,v,w,E,_,N="CXF-ANNOUNCEMENT",O={info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(h=console).info.apply(h,["%c ".concat(N," ->"),"background: green; color: yellow"].concat(l(e)))},log:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(g=console).info.apply(g,["%c ".concat(N," ->"),"background: green; color: yellow"].concat(l(e)))},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(d=console).warn.apply(d,["%c ".concat(N," ->"),"background: orange; color: yellow"].concat(l(e)))},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(p=console).error.apply(p,["%c ".concat(N," ->"),"background: red; color: yellow"].concat(l(e)))}},A=(f={containsInstance:function(t,e,n){var r=t.find((function(t){return t.id===e}));return!!r&&(r=r.instances.find((function(t){return t===n})),Boolean(r))},sharedCommands:{CLOSE_POPUP:"cxf.announcements.closePopup",MARK_AS_READ:"cxf.announcements.markAsRead",SHOW_ANNOUNCEMENTS:"cxf.announcements.getAllAnnouncements",TRACKING:"cxf.announcements.tracking"},appendLoginParams:function(t,e){return t+"/"+e.network+"/"+e.instance+"/"+e.lang},ANNOUNCEMENTS_LOCALSTORAGE_KEY:"ggs.cxf.announcements.fetchedAnnouncements",hashCode:function(t){for(var e=0,n=0;n<t.length;n++)e=Math.imul(31,e)+t.charCodeAt(n)|0;return e},getHashKey:function(t,e,n,r){var o=[t,e,n,r].join("_");return"ggs.cxf.announcements.".concat(o,".messageHash")},logger:O,subtractArray:function(t,e){return t.filter((function(t){return!e.includes(t)}))}}).subtractArray,S=f.sharedCommands,L=f.ANNOUNCEMENTS_LOCALSTORAGE_KEY,b=(y={CXF_DIALOG_OPEN:"cxf.dialog.open",CXF_DIALOG_CLOSE:"cxf.dialog.close"}).CXF_DIALOG_CLOSE,C="game.button.clicked.",x={GET_ANNOUNCEMENTS:"".concat(C,"getAnnouncements"),OPEN_ANNOUNCEMENTS:"".concat(C,"openAnnouncements")},T=(v={GAME_CALLBACK:{UNREAD_ANNOUNCEMENTS:"setCapToolNotifications"},GAME:{BIG_FARM:"bigfarm",EMPIRE:"empire",E4K:"empirefourkingdoms"},GAME_BUTTON_CLICKED_PREFIX:C,GAME_ANNOUNCEMENTS_EVENT:x,OPEN:x.OPEN_ANNOUNCEMENTS,GET:x.GET_ANNOUNCEMENTS}).GET,I=f.logger,P="cxf.tracking.message",k=(w={init:function(t){I.log("tracking has been initialized",t),E=t},tracking:function(t,e,n){var r=function(t){var e;return t&&(e=Array.isArray(t.Items)?t.Items[0]:t),e}(e),o={eventId:1236,gameId:Number.parseInt(E.gameId,10),networkId:Number.parseInt(E.networkId,10),instanceId:E.instanceId,playerId:E.playerId,language:E.countryCode,date:(new Date).toUTCString(),zoneId:E.zoneId,actionType:t},a=r.id,i=r.start_date,u=r.end_date,s=r.title;(o=c({},o,n)).id=a,o.scheduleStart=new Date(i).toUTCString(),o.scheduleEnd=new Date(u).toUTCString(),o.name=s,I.log(P,JSON.stringify(o,null,4)),E.emit(P,o)},OPEN_ANNOUNCEMENTS:"click",ANNOUNCEMENT_READY:"announcement_ready",CLOSE_CROSS:"close_cross",CLOSE_REGULAR:"close_regular",DONT_SHOW_AGAIN_ACTIVATE:"dont_show_again_activate",DONT_SHOW_AGAIN_DEACTIVATE:"dont_show_again_deactivate",SCROLL:"scroll",LOADED:"loaded"}).tracking,R=w.DONT_SHOW_AGAIN_ACTIVATE,U=w.DONT_SHOW_AGAIN_DEACTIVATE;function G(t){var e=t.hash,n=t.wasRead,r=j(e.key),o=n?R:U,a=!0,i=!1,c=void 0;try{for(var u,s=_[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var l=u.value;k(o,l)}}catch(t){i=!0,c=t}finally{try{a||null==s.return||s.return()}finally{if(i)throw c}}var f=n?r.concat(e.hashList):A(r,e.hashList);0===f.length?localStorage.removeItem(e.key):localStorage.setItem(e.key,JSON.stringify(f))}function M(t){localStorage.removeItem(L),_=void 0,t.emit(b)}function j(t){var e=localStorage.getItem(t)||"[]";return JSON.parse(e)}function D(){var t=localStorage.getItem(L)||"[]";return JSON.parse(t)}var F=function(t,e){return e.start_date-t.start_date};function K(t){var e=t.frameId,n=D().sort(F);if(n&&n.length>0){var r=document.getElementById(e).contentWindow;_=n;var o=Date.now();r.postMessage({messages:n,triggeredTimestamp:o},"*"),localStorage.setItem(L,JSON.stringify([]))}}var J=new Map([["okBtn",w.CLOSE_REGULAR],["crossBtn",w.CLOSE_CROSS],["scrolled",w.SCROLL],["loaded",w.LOADED]]);(m={addWindowListeners:function(t){window.addEventListener("message",(function(e){if(e.data&&e.data.name)switch(e.data.name){case S.MARK_AS_READ:G(e.data),t.emit(T);break;case S.CLOSE_POPUP:M(t);break;case S.SHOW_ANNOUNCEMENTS:K(e.data);break;case S.TRACKING:var n=!0,r=!1,o=void 0;try{for(var a,i=_[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var c=a.value;if("scrolled"===e.data.action)e.data.params.scrolledAnnouncements.includes(c.id)&&k(J.get(e.data.action),c,e.data.params);else k(J.get(e.data.action),c,e.data.params)}}catch(t){r=!0,o=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw o}}}}),!1)},getDoNotShowMessages:j}).__internals={markAsRead:G,getDoNotShowMessages:j,getMessages:D,closeFrame:M,showAllMessages:K,setAllActiveAnnouncements:function(t){_=t}};var B,H=m.addWindowListeners,z=f.logger,V=v.GAME;r.register("6G6uw",(function(t,e){t.exports={getPlayerInfo:function(t){var e=JSON.parse(t[1]);return{playername:e.gpi.PN,level:e.gxp.LVL}},getLevel:function(t){return JSON.parse(t[1]).LVL},lastTutorialLevel:5,loginCmd:"gbd",levelUpCmd:"gxp"}})),r.register("6j118",(function(t,e){t.exports={getPlayerInfo:function(t){return{playername:t.playerIdentity.name,level:t.xp.level}},getLevel:function(t){return t.newLevel},lastTutorialLevel:1,loginCmd:"LOGIN_BASIC_DATA",levelUpCmd:"LEVEL_UP"}})),r.register("48Zgp",(function(t,e){t.exports={getPlayerInfo:function(t){var e=JSON.parse(t[1]);return{playername:e.gpi.PN,level:e.gxp.LVL}},getLevel:function(t){return JSON.parse(t[1]).LVL},lastTutorialLevel:5,loginCmd:"gbd",levelUpCmd:"gxp",logoutCmd:"LOGOUT"}}));var W=(i(B={},V.EMPIRE,r("6G6uw")),i(B,V.BIG_FARM,r("6j118")),i(B,V.E4K,r("48Zgp")),B),X=v.OPEN,Y=v.GET,q=w.init;r.register("1u8Ob",(function(t,e){var n=r("2AL7D"),o=(n.mark(C),r("7hs5J"),r("15hBX").acronym),i=f.appendLoginParams,u=f.ANNOUNCEMENTS_LOCALSTORAGE_KEY,l=f.hashCode,h=f.getHashKey,g=f.logger,d=m.getDoNotShowMessages,p=y.CXF_DIALOG_OPEN,E=v.GAME_CALLBACK,_=w.tracking,N=w.OPEN_ANNOUNCEMENTS,O=w.ANNOUNCEMENT_READY,A=function(t){var e=t.game,n=t.playername,r=t.network,o=t.instance,a=h(e,n,r,o);return d(a)},S=function(t){return function(e){return e.filter((function(e){return!t.includes(l(e.title+e.message))}))}},L=function(t){return t&&t.Count>0||!1},b=function(t,e){return function(n,r){var o=r.network,a=r.instance,i=r.lang,s=r.playername,l=e.game;if(L(n)){var f=A({game:l,playername:s,network:o,instance:a}),d=S(f)(n.Items);g.info("Received ".concat(d.length>0?d.length:0," valid announcements"));var m=d.map((function(t){return c({},t,{body:t.message})}));localStorage.setItem(u,JSON.stringify(m));var y=h(l,s,o,a),v=new URLSearchParams({game:l,lang:i,network:o,instance:a,hash:y}),w="".concat(t,"/").concat(l,"_announcement.html?").concat(v.toString());e.emit(p,w)}}};function C(){return(C=a(n.mark((function t(e,r,o){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i(e,o),t.abrupt("return",fetch(e).then((function(t){return t.json()})).then((function(t){if(0!==Object.keys(t).length&&0!==t.Count)return r(t,o);g.info("".concat(e," shows empty response"))})).catch((function(t){return g.log("failed loading ".concat(e,": ").concat(t))})));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t,e,n){return C.apply(this,arguments)}var T=function(t,e){(!t||!Array.isArray(t)||t.length<4)&&g.error("Received invalid payload from game - ".concat(t," \n the valid payload is [userdata, lang, network, instance]"));var n=s(t),r=n[0],o=n[1],a=n[2],i=n[3];return{userdata:e.getPlayerInfo(r),lang:o,network:a,instance:i}};t.exports=function(t,e){var r,i=b("https://s3-eu-west-1.amazonaws.com/cap-announcements-staging.ggs-stp.com",t),c=o(t.game)||"",u=function(t){!function(t){x("https://bcybh10xrg.execute-api.eu-west-1.amazonaws.com/staging/messages/"+c,i,t)}(t)},s={},l=function(n){if(n||0!==Object.keys(s).length){if(n){var r=T(n,e);Object.assign(s,{lang:r.lang,network:r.network,instance:r.instance,game:t.game,playername:r.userdata.playername})}}else g.warn(" saveLoginData - the user data has not been set/initialized ".concat(s))},f=function(t){l(t),g.log("[getNewAnnouncements] - ".concat(JSON.stringify(s,null,4)));return x("https://bcybh10xrg.execute-api.eu-west-1.amazonaws.com/staging/messages/"+c,(function(t){var e=0;return L(t)&&(e=function(t,e){return S(A(t))(e).length}(s,t.Items),r=t),g.log(" Has announcements: ",e>0),e}),s)},h=function(o){return a(n.mark((function a(i){var c;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return g.log(" onGetMessageStatus - ".concat(o),i),n.next=3,f(i);case 3:c=n.sent,t.gameApi.invokeFn(E.UNREAD_ANNOUNCEMENTS,c),o===e.loginCmd&&c&&_(O,r),g.log(" call ".concat(E.UNREAD_ANNOUNCEMENTS," - ").concat(c));case 7:case"end":return n.stop()}}),a)})))};return{onLogin:function(t){return g.info(" onLogin",t),l(t),u(s)},onLogout:function(){t.once(e.loginCmd,h(e.loginCmd))},placeholder:function(){},onGetMessageStatus:h,onOpenAnnouncements:function(){0!==Object.keys(s).length?(u(s),g.info("onOpenAnnouncement handler for user ".concat(s)),_(N,r)):g.info(" onOpenAnnouncement handler - the user data has not been set/initialized ".concat(s))}}},t.exports.__internals={loadCurrentMessages:x,handleAnnouncementMessage:b,getHashKey:h,hashCode:l,getRootGamePayload:T,hasAnnouncements:L}})),r.register("2AL7D",(function(t,e){var n=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),i=new C(r||[]);return a._invoke=function(t,e,n){var r=f;return function(o,a){if(r===g)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw a;return T()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=S(i,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=l(t,e,n);if("normal"===u.type){if(r=n.done?d:h,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f="suspendedStart",h="suspendedYield",g="executing",d="completed",p={};function m(){}function y(){}function v(){}var w={};w[a]=function(){return this};var E=Object.getPrototypeOf,_=E&&E(E(x([])));_&&_!==n&&r.call(_,a)&&(w=_);var N=v.prototype=m.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=l(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function x(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:T}}function T(){return{value:e,done:!0}}return y.prototype=N.constructor=v,v.constructor=y,y.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(N),t},t.awrap=function(t){return{__await:t}},O(A.prototype),A.prototype[i]=function(){return this},t.AsyncIterator=A,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new A(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(N),u(N,c,"Generator"),N[a]=function(){return this},N.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(b),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;b(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}})),r.register("7hs5J",(function(e,n){ | ||
!function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},e={},n={},r=t.parcelRequireb657;function o(t,e,n,r,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var i=t.apply(e,n);function c(t){o(i,r,a,c,u,"next",t)}function u(t){o(i,r,a,c,u,"throw",t)}c(void 0)}))}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){i(t,e,n[e])}))}return t}function u(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||u(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}null==r&&((r=function(t){if(t in e)return e[t].exports;if(t in n){let r=n[t];delete n[t];let o={id:t,exports:{}};return e[t]=o,r.call(o.exports,o,o.exports),o.exports}var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(t,e){n[t]=e},t.parcelRequireb657=r);var f,h,g={};Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=new Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o<n;){var a=e[o];if(t.call(r,a,o,e))return a;o++}},configurable:!0,writable:!0});var d,p,m,y,v,E="CXF-ANNOUNCEMENT",w={info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n]},log:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n]},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n]},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(h=console).error.apply(h,["%c ".concat(E," ->"),"background: red; color: yellow"].concat(l(e)))}},N=(f={containsInstance:function(t,e,n){var r=t.find((function(t){return t.id===e}));return!!r&&(r=r.instances.find((function(t){return t===n})),Boolean(r))},sharedCommands:{CLOSE_POPUP:"cxf.announcements.closePopup",MARK_AS_READ:"cxf.announcements.markAsRead",SHOW_ANNOUNCEMENTS:"cxf.announcements.getAllAnnouncements",TRACKING:"cxf.announcements.tracking"},appendLoginParams:function(t,e){return t+"/"+e.network+"/"+e.instance+"/"+e.lang},ANNOUNCEMENTS_LOCALSTORAGE_KEY:"ggs.cxf.announcements.fetchedAnnouncements",hashCode:function(t){for(var e=0,n=0;n<t.length;n++)e=Math.imul(31,e)+t.charCodeAt(n)|0;return e},getHashKey:function(t,e,n,r){var o=[t,e,n,r].join("_");return"ggs.cxf.announcements.".concat(o,".messageHash")},logger:w,subtractArray:function(t,e){return t.filter((function(t){return!e.includes(t)}))}}).subtractArray,_=f.sharedCommands,O=f.ANNOUNCEMENTS_LOCALSTORAGE_KEY,A=(d={CXF_DIALOG_OPEN:"cxf.dialog.open",CXF_DIALOG_CLOSE:"cxf.dialog.close"}).CXF_DIALOG_CLOSE,S="game.button.clicked.",L={GET_ANNOUNCEMENTS:"".concat(S,"getAnnouncements"),OPEN_ANNOUNCEMENTS:"".concat(S,"openAnnouncements")},b=(p={GAME_CALLBACK:{UNREAD_ANNOUNCEMENTS:"setCapToolNotifications"},GAME:{BIG_FARM:"bigfarm",EMPIRE:"empire",E4K:"empirefourkingdoms"},GAME_BUTTON_CLICKED_PREFIX:S,GAME_ANNOUNCEMENTS_EVENT:L,OPEN:L.OPEN_ANNOUNCEMENTS,GET:L.GET_ANNOUNCEMENTS}).GET,C=f.logger,T="cxf.tracking.message",x=(m={init:function(t){C.log("tracking has been initialized",t),y=t},tracking:function(t,e,n){var r=function(t){var e;return t&&(e=Array.isArray(t.Items)?t.Items[0]:t),e}(e),o={eventId:1236,gameId:Number.parseInt(y.gameId,10),networkId:Number.parseInt(y.networkId,10),instanceId:y.instanceId,playerId:y.playerId,language:y.countryCode,date:(new Date).toUTCString(),zoneId:y.zoneId,actionType:t},a=r.id,i=r.start_date,u=r.end_date,s=r.title;(o=c({},o,n)).id=a,o.scheduleStart=new Date(i).toUTCString(),o.scheduleEnd=new Date(u).toUTCString(),o.name=s,C.log(T,JSON.stringify(o,null,4)),y.emit(T,o)},OPEN_ANNOUNCEMENTS:"click",ANNOUNCEMENT_READY:"announcement_ready",CLOSE_CROSS:"close_cross",CLOSE_REGULAR:"close_regular",DONT_SHOW_AGAIN_ACTIVATE:"dont_show_again_activate",DONT_SHOW_AGAIN_DEACTIVATE:"dont_show_again_deactivate",SCROLL:"scroll",LOADED:"loaded"}).tracking,I=m.DONT_SHOW_AGAIN_ACTIVATE,P=m.DONT_SHOW_AGAIN_DEACTIVATE;function k(t){var e=t.hash,n=t.wasRead,r=R(e.key),o=n?I:P,a=!0,i=!1,c=void 0;try{for(var u,s=v[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var l=u.value;x(o,l)}}catch(t){i=!0,c=t}finally{try{a||null==s.return||s.return()}finally{if(i)throw c}}var f=n?r.concat(e.hashList):N(r,e.hashList);0===f.length?localStorage.removeItem(e.key):localStorage.setItem(e.key,JSON.stringify(f))}function U(t){localStorage.removeItem(O),v=void 0,t.emit(A)}function R(t){var e=localStorage.getItem(t)||"[]";return JSON.parse(e)}function M(){var t=localStorage.getItem(O)||"[]";return JSON.parse(t)}var G=function(t,e){return e.start_date-t.start_date};function j(t){var e=t.frameId,n=M().sort(G);if(n&&n.length>0){var r=document.getElementById(e).contentWindow;v=n;var o=Date.now();r.postMessage({messages:n,triggeredTimestamp:o},"*"),localStorage.setItem(O,JSON.stringify([]))}}var D=new Map([["okBtn",m.CLOSE_REGULAR],["crossBtn",m.CLOSE_CROSS],["scrolled",m.SCROLL],["loaded",m.LOADED]]);(g={addWindowListeners:function(t){window.addEventListener("message",(function(e){if(e.data&&e.data.name)switch(e.data.name){case _.MARK_AS_READ:k(e.data),t.emit(b);break;case _.CLOSE_POPUP:U(t);break;case _.SHOW_ANNOUNCEMENTS:j(e.data);break;case _.TRACKING:var n=!0,r=!1,o=void 0;try{for(var a,i=v[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var c=a.value;if("scrolled"===e.data.action)e.data.params.scrolledAnnouncements.includes(c.id)&&x(D.get(e.data.action),c,e.data.params);else x(D.get(e.data.action),c,e.data.params)}}catch(t){r=!0,o=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw o}}}}),!1)},getDoNotShowMessages:R}).__internals={markAsRead:k,getDoNotShowMessages:R,getMessages:M,closeFrame:U,showAllMessages:j,setAllActiveAnnouncements:function(t){v=t}};var F,K=g.addWindowListeners,B=f.logger,J=p.GAME;r.register("6ZLt0",(function(t,e){t.exports={getPlayerInfo:function(t){var e=JSON.parse(t[1]);return{playername:e.gpi.PN,level:e.gxp.LVL}},getLevel:function(t){return JSON.parse(t[1]).LVL},lastTutorialLevel:5,loginCmd:"gbd",levelUpCmd:"gxp"}})),r.register("50uAK",(function(t,e){t.exports={getPlayerInfo:function(t){return{playername:t.playerIdentity.name,level:t.xp.level}},getLevel:function(t){return t.newLevel},lastTutorialLevel:1,loginCmd:"LOGIN_BASIC_DATA",levelUpCmd:"LEVEL_UP"}})),r.register("6i5QU",(function(t,e){t.exports={getPlayerInfo:function(t){var e=JSON.parse(t[1]);return{playername:e.gpi.PN,level:e.gxp.LVL}},getLevel:function(t){return JSON.parse(t[1]).LVL},lastTutorialLevel:5,loginCmd:"gbd",levelUpCmd:"gxp",logoutCmd:"LOGOUT"}}));var V=(i(F={},J.EMPIRE,r("6ZLt0")),i(F,J.BIG_FARM,r("50uAK")),i(F,J.E4K,r("6i5QU")),F),H=p.OPEN,W=p.GET,z=m.init;r.register("3SvNV",(function(t,e){var n=r("6NiCk"),o=(n.mark(C),r("4OoSh"),r("7gxoB").acronym),i=f.appendLoginParams,u=f.ANNOUNCEMENTS_LOCALSTORAGE_KEY,l=f.hashCode,h=f.getHashKey,y=f.logger,v=g.getDoNotShowMessages,E=d.CXF_DIALOG_OPEN,w=p.GAME_CALLBACK,N=m.tracking,_=m.OPEN_ANNOUNCEMENTS,O=m.ANNOUNCEMENT_READY,A=function(t){var e=t.game,n=t.playername,r=t.network,o=t.instance,a=h(e,n,r,o);return v(a)},S=function(t){return function(e){return e.filter((function(e){return!t.includes(l(e.title+e.message))}))}},L=function(t){return t&&t.Count>0||!1},b=function(t,e){return function(n,r){var o=r.network,a=r.instance,i=r.lang,s=r.playername,l=e.game;if(L(n)){var f=A({game:l,playername:s,network:o,instance:a}),g=S(f)(n.Items);y.info("Received ".concat(g.length>0?g.length:0," valid announcements"));var d=g.map((function(t){return c({},t,{body:t.message})}));localStorage.setItem(u,JSON.stringify(d));var p=h(l,s,o,a),m=new URLSearchParams({game:l,lang:i,network:o,instance:a,hash:p}),v="".concat(t,"/").concat(l,"_announcement.html?").concat(m.toString());e.emit(E,v)}}};function C(){return(C=a(n.mark((function t(e,r,o){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i(e,o),t.abrupt("return",fetch(e).then((function(t){return t.json()})).then((function(t){if(0!==Object.keys(t).length&&0!==t.Count)return r(t,o);y.info("".concat(e," shows empty response"))})).catch((function(t){return y.log("failed loading ".concat(e,": ").concat(t))})));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function T(t,e,n){return C.apply(this,arguments)}var x=function(t,e){(!t||!Array.isArray(t)||t.length<4)&&y.error("Received invalid payload from game - ".concat(t," \n the valid payload is [userdata, lang, network, instance]"));var n=s(t),r=n[0],o=n[1],a=n[2],i=n[3];return{userdata:e.getPlayerInfo(r),lang:o,network:a,instance:i}};t.exports=function(t,e){var r,i=b("https://community-announcement-template.ggs-stp.com",t),c=o(t.game)||"",u=function(t){!function(t){T("https://community-announcements.ggs-stp.com/"+c,i,t)}(t)},s={},l=function(n){if(n||0!==Object.keys(s).length){if(n){var r=x(n,e);Object.assign(s,{lang:r.lang,network:r.network,instance:r.instance,game:t.game,playername:r.userdata.playername})}}else y.warn(" saveLoginData - the user data has not been set/initialized ".concat(s))},f=function(t){l(t),y.log("[getNewAnnouncements] - ".concat(JSON.stringify(s,null,4)));return T("https://community-announcements.ggs-stp.com/"+c,(function(t){var e=0;return L(t)&&(e=function(t,e){return S(A(t))(e).length}(s,t.Items),r=t),y.log(" Has announcements: ",e>0),e}),s)},h=function(o){return a(n.mark((function a(i){var c;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return y.log(" onGetMessageStatus - ".concat(o),i),n.next=3,f(i);case 3:c=n.sent,t.gameApi.invokeFn(w.UNREAD_ANNOUNCEMENTS,c),o===e.loginCmd&&c&&N(O,r),y.log(" call ".concat(w.UNREAD_ANNOUNCEMENTS," - ").concat(c));case 7:case"end":return n.stop()}}),a)})))};return{onLogin:function(t){return y.info(" onLogin",t),l(t),u(s)},onLogout:function(){t.once(e.loginCmd,h(e.loginCmd))},placeholder:function(){},onGetMessageStatus:h,onOpenAnnouncements:function(){0!==Object.keys(s).length?(u(s),y.info("onOpenAnnouncement handler for user ".concat(s)),N(_,r)):y.info(" onOpenAnnouncement handler - the user data has not been set/initialized ".concat(s))}}},t.exports.__internals={loadCurrentMessages:T,handleAnnouncementMessage:b,getHashKey:h,hashCode:l,getRootGamePayload:x,hasAnnouncements:L}})),r.register("6NiCk",(function(t,e){var n=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),i=new C(r||[]);return a._invoke=function(t,e,n){var r=f;return function(o,a){if(r===g)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw a;return x()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=S(i,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=l(t,e,n);if("normal"===u.type){if(r=n.done?d:h,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f="suspendedStart",h="suspendedYield",g="executing",d="completed",p={};function m(){}function y(){}function v(){}var E={};E[a]=function(){return this};var w=Object.getPrototypeOf,N=w&&w(w(T([])));N&&N!==n&&r.call(N,a)&&(E=N);var _=v.prototype=m.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=l(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function T(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:x}}function x(){return{value:e,done:!0}}return y.prototype=_.constructor=v,v.constructor=y,y.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},O(A.prototype),A.prototype[i]=function(){return this},t.AsyncIterator=A,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new A(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(_),u(_,c,"Generator"),_[a]=function(){return this},_.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(b),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;b(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}})),r.register("4OoSh",(function(e,n){ | ||
/** | ||
@@ -9,3 +9,2 @@ * | ||
*/ | ||
!function(t){var e,n=function(){try{if(t.URLSearchParams&&"bar"===new t.URLSearchParams("foo=bar").get("foo"))return t.URLSearchParams}catch(t){}return null}(),r=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),a=!n||((e=new n).append("s"," &"),"s=+%26"===e.toString()),i=l.prototype,c=!(!t.Symbol||!t.Symbol.iterator);if(!(n&&r&&o&&a)){var u;i.append=function(t,e){p(this.__URLSearchParams__,t,e)},i.delete=function(t){delete this.__URLSearchParams__[t]},i.get=function(t){var e=this.__URLSearchParams__;return this.has(t)?e[t][0]:null},i.getAll=function(t){var e=this.__URLSearchParams__;return this.has(t)?e[t].slice(0):[]},i.has=function(t){return y(this.__URLSearchParams__,t)},i.set=function(t,e){this.__URLSearchParams__[t]=[""+e]},i.toString=function(){var t,e,n,r,o=this.__URLSearchParams__,a=[];for(e in o)for(n=f(e),t=0,r=o[e];t<r.length;t++)a.push(n+"="+f(r[t]));return a.join("&")},!!o&&n&&!r&&t.Proxy?(u=new Proxy(n,{construct:function(t,e){return new t(new l(e[0]).toString())}})).toString=Function.prototype.toString.bind(l):u=l,Object.defineProperty(t,"URLSearchParams",{value:u});var s=t.URLSearchParams.prototype;s.polyfill=!0,s.forEach=s.forEach||function(t,e){var n=d(this.toString());Object.getOwnPropertyNames(n).forEach((function(r){n[r].forEach((function(n){t.call(e,n,r,this)}),this)}),this)},s.sort=s.sort||function(){var t,e,n,r=d(this.toString()),o=[];for(t in r)o.push(t);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var a=o[e],i=r[a];for(n=0;n<i.length;n++)this.append(a,i[n])}},s.keys=s.keys||function(){var t=[];return this.forEach((function(e,n){t.push(n)})),g(t)},s.values=s.values||function(){var t=[];return this.forEach((function(e){t.push(e)})),g(t)},s.entries=s.entries||function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),g(t)},c&&(s[t.Symbol.iterator]=s[t.Symbol.iterator]||s.entries)}function l(t){((t=t||"")instanceof URLSearchParams||t instanceof l)&&(t=t.toString()),this.__URLSearchParams__=d(t)}function f(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,(function(t){return e[t]}))}function h(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,(function(t){return decodeURIComponent(t)}))}function g(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return c&&(n[t.Symbol.iterator]=function(){return n}),n}function d(t){var e={};if("object"==typeof t)if(m(t))for(var n=0;n<t.length;n++){var r=t[n];if(!m(r)||2!==r.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");p(e,r[0],r[1])}else for(var o in t)t.hasOwnProperty(o)&&p(e,o,t[o]);else{0===t.indexOf("?")&&(t=t.slice(1));for(var a=t.split("&"),i=0;i<a.length;i++){var c=a[i],u=c.indexOf("=");-1<u?p(e,h(c.slice(0,u)),h(c.slice(u+1))):c&&p(e,h(c),"")}}return e}function p(t,e,n){var r="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);y(t,e)?t[e].push(r):t[e]=[r]}function m(t){return!!t&&"[object Array]"===Object.prototype.toString.call(t)}function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(void 0!==t?t:"undefined"!=typeof window?window:e.exports)})),r.register("15hBX",(function(t,e){!function(){var e;function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var r={1:["poker","poker2","poker"],12:["empire","castle","em"],15:["bigfarm","ranch","bf"],16:["empirefourkingdoms","fourkingdoms","e4k"],23:["legendsofhonor",void 0,"loh"],41:["empiremillenniumwars",void 0,"emmw"]},o=Object.entries(r).reduce((function(t,e){var r=n(e,2),o=r[0],a=r[1];return o=parseInt(o,10),t[o]=o,a.forEach((function(e){t[e]=o})),t}),{}),a=function(t,e){return(e=o[e])&&r[e][t]},i=a.bind(null,0),c=a.bind(null,1),u=a.bind(null,2);e={id:function(t){t=t.toString().toLowerCase();var e=o[t];return e&&0|e},name:i,codename:c,acronym:u},"object"==typeof t.exports?t.exports=e:"function"==typeof define&&define.amd&&define((function(){return e}))}()})),function(t){z.log(" initialized successfully - waiting for player login",t.game),q(t);var e=W[t.game],n=r("1u8Ob")(t,e);H(t),e.logoutCmd&&t.on(e.logoutCmd,n.onLogout),t.once(3,n.placeholder),t.once(24,n.placeholder),t.on(Y,n.onGetMessageStatus(Y)),t.once(e.loginCmd,n.onGetMessageStatus(e.loginCmd)),t.on(X,n.onOpenAnnouncements)}(window.CXF)}(); | ||
//# sourceMappingURL=announcements.js.map | ||
!function(t){var e,n=function(){try{if(t.URLSearchParams&&"bar"===new t.URLSearchParams("foo=bar").get("foo"))return t.URLSearchParams}catch(t){}return null}(),r=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),a=!n||((e=new n).append("s"," &"),"s=+%26"===e.toString()),i=l.prototype,c=!(!t.Symbol||!t.Symbol.iterator);if(!(n&&r&&o&&a)){var u;i.append=function(t,e){p(this.__URLSearchParams__,t,e)},i.delete=function(t){delete this.__URLSearchParams__[t]},i.get=function(t){var e=this.__URLSearchParams__;return this.has(t)?e[t][0]:null},i.getAll=function(t){var e=this.__URLSearchParams__;return this.has(t)?e[t].slice(0):[]},i.has=function(t){return y(this.__URLSearchParams__,t)},i.set=function(t,e){this.__URLSearchParams__[t]=[""+e]},i.toString=function(){var t,e,n,r,o=this.__URLSearchParams__,a=[];for(e in o)for(n=f(e),t=0,r=o[e];t<r.length;t++)a.push(n+"="+f(r[t]));return a.join("&")},!!o&&n&&!r&&t.Proxy?(u=new Proxy(n,{construct:function(t,e){return new t(new l(e[0]).toString())}})).toString=Function.prototype.toString.bind(l):u=l,Object.defineProperty(t,"URLSearchParams",{value:u});var s=t.URLSearchParams.prototype;s.polyfill=!0,s.forEach=s.forEach||function(t,e){var n=d(this.toString());Object.getOwnPropertyNames(n).forEach((function(r){n[r].forEach((function(n){t.call(e,n,r,this)}),this)}),this)},s.sort=s.sort||function(){var t,e,n,r=d(this.toString()),o=[];for(t in r)o.push(t);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var a=o[e],i=r[a];for(n=0;n<i.length;n++)this.append(a,i[n])}},s.keys=s.keys||function(){var t=[];return this.forEach((function(e,n){t.push(n)})),g(t)},s.values=s.values||function(){var t=[];return this.forEach((function(e){t.push(e)})),g(t)},s.entries=s.entries||function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),g(t)},c&&(s[t.Symbol.iterator]=s[t.Symbol.iterator]||s.entries)}function l(t){((t=t||"")instanceof URLSearchParams||t instanceof l)&&(t=t.toString()),this.__URLSearchParams__=d(t)}function f(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,(function(t){return e[t]}))}function h(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,(function(t){return decodeURIComponent(t)}))}function g(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return c&&(n[t.Symbol.iterator]=function(){return n}),n}function d(t){var e={};if("object"==typeof t)if(m(t))for(var n=0;n<t.length;n++){var r=t[n];if(!m(r)||2!==r.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");p(e,r[0],r[1])}else for(var o in t)t.hasOwnProperty(o)&&p(e,o,t[o]);else{0===t.indexOf("?")&&(t=t.slice(1));for(var a=t.split("&"),i=0;i<a.length;i++){var c=a[i],u=c.indexOf("=");-1<u?p(e,h(c.slice(0,u)),h(c.slice(u+1))):c&&p(e,h(c),"")}}return e}function p(t,e,n){var r="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);y(t,e)?t[e].push(r):t[e]=[r]}function m(t){return!!t&&"[object Array]"===Object.prototype.toString.call(t)}function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(void 0!==t?t:"undefined"!=typeof window?window:e.exports)})),r.register("7gxoB",(function(t,e){!function(){var e;function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var r={1:["poker","poker2","poker"],12:["empire","castle","em"],15:["bigfarm","ranch","bf"],16:["empirefourkingdoms","fourkingdoms","e4k"],23:["legendsofhonor",void 0,"loh"],41:["empiremillenniumwars",void 0,"emmw"]},o=Object.entries(r).reduce((function(t,e){var r=n(e,2),o=r[0],a=r[1];return o=parseInt(o,10),t[o]=o,a.forEach((function(e){t[e]=o})),t}),{}),a=function(t,e){return(e=o[e])&&r[e][t]},i=a.bind(null,0),c=a.bind(null,1),u=a.bind(null,2);e={id:function(t){t=t.toString().toLowerCase();var e=o[t];return e&&0|e},name:i,codename:c,acronym:u},"object"==typeof t.exports?t.exports=e:"function"==typeof define&&define.amd&&define((function(){return e}))}()})),function(t){B.log(" initialized successfully - waiting for player login",t.game),z(t);var e=V[t.game],n=r("3SvNV")(t,e);K(t),e.logoutCmd&&t.on(e.logoutCmd,n.onLogout),t.once(3,n.placeholder),t.once(24,n.placeholder),t.on(W,n.onGetMessageStatus(W)),t.once(e.loginCmd,n.onGetMessageStatus(e.loginCmd)),t.on(H,n.onOpenAnnouncements)}(window.CXF)}(); |
{ | ||
"name": "@goodgamestudios/cxf-announcements", | ||
"version": "0.19.1-qa.28", | ||
"version": "0.19.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "serve:locally": "http-server dist --port 4002", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1129606
7
75