2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
/*! For license information please see main.js.LICENSE.txt */
|
|
(()=>{"use strict";function t(){return Math.floor(100*Math.random())}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function e(){e=function(){return n};var t,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(t){f=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),c=new G(n||[]);return a(i,"_invoke",{value:A(t,e,c)}),i}function v(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var p="suspendedStart",d="suspendedYield",y="executing",m="completed",g={};function w(){}function b(){}function O(){}var S={};f(S,u,(function(){return this}));var j=Object.getPrototypeOf,L=j&&j(j(D([])));L&&L!==o&&i.call(L,u)&&(S=L);var E=O.prototype=w.prototype=Object.create(S);function x(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function P(t,e){function n(o,a,c,u){var s=v(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==r(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function A(r,e,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=v(r,e,n);if("normal"===s.type){if(o=n.done?m:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function _(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,_(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=v(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function C(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=O,a(E,"constructor",{value:O,configurable:!0}),a(O,"constructor",{value:b,configurable:!0}),b.displayName=f(O,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,f(t,l,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},x(P.prototype),f(P.prototype,s,(function(){return this})),n.AsyncIterator=P,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new P(h(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),f(E,l,"Generator"),f(E,u,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=D,G.prototype={constructor:G,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,r){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&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),C(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;C(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:D(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),g}},n}function n(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function o(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach((function(r){i(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function i(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,r)||function(t,r){if(t){if("string"==typeof t)return c(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?c(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function u(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function s(){return l.apply(this,arguments)}function l(){var t;return t=e().mark((function t(){var r;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y().catch((function(){return{gdprApplies:!0,hasGivenConsent:!1,isAdditionalPrivacyState:!0,countryCode:""}}));case 2:return r=t.sent,t.abrupt("return",new Promise((function(t){var e=r.gdprApplies,n=r.isAdditionalPrivacyState,o=r.countryCode;t({gdprApplies:e,hasGivenConsent:!1,isAdditionalPrivacyState:Boolean(n),countryCode:o})})));case 4:case"end":return t.stop()}}),t)})),l=function(){var r=this,e=arguments;return new Promise((function(n,o){var i=t.apply(r,e);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))},l.apply(this,arguments)}function f(r){var e=r.version,n=function(r){var e=r.version,n=r.betas;if(!n||0===n.length)return e;for(var o=0,i=t(),a=0;a<n.length;a++){var c=n[a];if(i<o+c.trafficPercentage)return c.version;o+=c.trafficPercentage}return e}({version:e,betas:r.betas});return n===e?{name:e,version:e}:t()<50?{name:"".concat(n,"-beta-test"),version:n}:{name:"".concat(n,"-beta-control"),version:e}}function h(t){var r=t.privacyData,e=t.version,n=t.betas;try{if(r.gdprApplies&&!r.hasGivenConsent)return{name:e,version:e};var o=function(t){var r=document.cookie.match("(^|;)\\s*".concat(t,"\\s*=\\s*([^;]+)"));return r?r.pop():""}("growme_headless_version"),i=o?JSON.parse(o):null,a=function(t){var r=t.versionsResponse,e=t.versionFromCookie;if(!e)return!1;var n=e.version===r.version,o=r.betas.some((function(t){return t.version===e.version}));return n||o}({versionsResponse:{version:e,betas:n},versionFromCookie:i});if(i&&a)return i}catch(h){0}var c=f({version:e,betas:n});try{var u=new Date;u.setTime(u.getTime()+18e5);var s="expires="+u.toUTCString(),l=JSON.stringify(c);document.cookie="growme_headless_version=".concat(l,"; path=/; ").concat(s)}catch(h){0}return c}function v(t){var r=t.name,e=t.version,n=t.siteId,o=t.scriptSrcRoot,i=document.createElement("script"),a="".concat(o,"/app.").concat(e,".js");i.type="text/javascript",i.src=a,i.defer=!0,i.setAttribute("data-grow-headless-beta-name",r),i.setAttribute("data-grow-headless-beta-version",e),i.setAttribute("data-grow-mediavine-site-id",n),document.head.appendChild(i)}var p,d="https://api.grow.me";function y(){var t=new URL("".concat(d,"/location-privacy-info"));return fetch(t.toString(),{method:"GET"}).then((function(t){if(!t.ok)throw new Error("Failed fetchLocationPrivacyInfo");return t.json()})).then((function(t){return t}))}function m(t){window.GrowHeadlessData=t}function g(t){var r;if(!(function(){try{return window.self!==window.top}catch(t){return!0}}()||function(){var t;return null!==(null===(t=document)||void 0===t?void 0:t.querySelector("script[data-grow-initializer]"))}()||function(){var t;return Boolean(null===(t=window)||void 0===t?void 0:t.growMeMainScriptLoaded)}())){var e="https://api.grow.me",n="https://scripts.grow.me";if(t){var i=null===(r=document.querySelectorAll("script[data-grow-headless-tag-name]")[0])||void 0===r?void 0:r.getAttribute("data-grow-headless-tag-name");if(window.location.search||i)try{var c=new URLSearchParams(window.location.search).get("growHeadlessVersion");if("off"===c)return;var u=c||i;if(u)return void Promise.all([s()]).then((function(r){var e=a(r,1)[0];m({gdprConsentData:e,privacyData:e,version:u}),v({name:"local",version:u,siteId:t,scriptSrcRoot:n})})).catch((function(t){console.error(t)}))}catch(p){}var l=s(),f=fetch("".concat(e,"/grow-headless-versions")).then((function(t){if(!t.ok)throw new Error("Failed to fetch versions");return t.json()}));return Promise.all([f,l]).then((function(r){var e=a(r,2),i=e[0],c=e[1],u=i.betas.filter((function(t){return!t.feature})),s=h({version:i.version,betas:u,privacyData:c});m({gdprConsentData:c,privacyData:c,version:s.version}),v(o(o({},s),{},{siteId:t,scriptSrcRoot:n}))})).catch((function(t){console.error(t)}))}console.error("$adManagement.web.model.uuid is required")}}var w=null===(p=window.$adManagementConfig)||void 0===p||null===(p=p.web)||void 0===p||null===(p=p.model)||void 0===p?void 0:p.uuid;if(w)if("loading"!==document.readyState)g(w);else{var b=function(){"loading"!==document.readyState&&(g(w),document.removeEventListener("readystatechange",b))};document.addEventListener("readystatechange",b)}})(); |