/*! For license information please see main.js.LICENSE.txt */
!function(){function t(e){return t="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},t(e)}function e(){"use strict";e=function(){return n};var n={},r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof p?e:p,i=Object.create(o.prototype),u=new T(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){var u=n.delegate;if(u){var a=x(u,n);if(a){if(a===h)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=f(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,u),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=l;var h={};function p(){}function d(){}function y(){}var v={};s(v,u,(function(){return this}));var w=Object.getPrototypeOf,g=w&&w(w(S([])));g&&g!==r&&o.call(g,u)&&(v=g);var m=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,n){function r(i,u,a,c){var s=f(e[i],e,u);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==t(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):n.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,e){function o(){return new n((function(n,o){r(t,e,n,o)}))}return i=i?i.then(o,o):o()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:L}}function L(){return{value:void 0,done:!0}}return d.prototype=y,s(m,"constructor",y),s(y,"constructor",d),d.displayName=s(y,c,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},n.awrap=function(t){return{__await:t}},b(O.prototype),s(O.prototype,a,(function(){return this})),n.AsyncIterator=O,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var u=new O(l(t,e,r,o),i);return n.isGeneratorFunction(e)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},b(m),s(m,c,"Generator"),s(m,u,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),n.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}},n.values=S,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},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 e=this;function n(n,r){return u.type="throw",u.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(u)},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),h},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),k(n),h}},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;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},n}function n(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function r(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var u=t.apply(e,r);function a(t){n(u,o,i,a,c,"next",t)}function c(t){n(u,o,i,a,c,"throw",t)}a(void 0)}))}}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,l(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),s(r,t)},u(t)}function a(t,e,n){return a=c()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&s(o,n.prototype),o},a.apply(null,arguments)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(w,t);var n,u,a,f,h,p,d,y,v=(n=w,u=c(),function(){var t,e=l(n);if(u){var r=l(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return i(this,t)});function w(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w),(t=v.call(this))._isBusy=!1,t}return a=w,f=[{key:"connectedCallback",value:function(){console.log("[OneTrust CE] connected")}},{key:"attributeChangedCallback",value:function(t,e,n){"trigger"===t&&n&&n!==e&&(console.log("[OneTrust CE] trigger received:",n),this.openWithRetry().catch((function(t){console.error("[OneTrust CE] openWithRetry failed:",t)})))}},{key:"sleep",value:function(t){return new Promise((function(e){return setTimeout(e,t)}))}},{key:"nextFrame",value:function(){return new Promise((function(t){return requestAnimationFrame((function(){return t()}))}))}},{key:"dispatchResizeBurst",value:function(){try{window.dispatchEvent(new Event("resize")),setTimeout((function(){try{window.dispatchEvent(new Event("resize"))}catch(t){}}),150),setTimeout((function(){try{window.dispatchEvent(new Event("resize"))}catch(t){}}),400)}catch(t){console.warn("[OneTrust CE] dispatchResizeBurst failed:",t)}}},{key:"waitForModalShell",value:(y=r(e().mark((function t(){var n,r,o=arguments;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=o.length>0&&void 0!==o[0]?o[0]:1200,t.prev=1,r=Date.now();case 3:if(!(Date.now()-r<n)){t.next=11;break}if(!(document.querySelector("#ot-sdk-cookie-policy")||document.querySelector("#ot-sdk-cookie-policy-v2")||document.querySelector("#onetrust-consent-sdk")||document.querySelector(".ot-sdk-container")||document.querySelector("#ot-pc-content")||document.querySelector("#ot-sdk-btn-floating"))){t.next=7;break}return t.abrupt("return",!0);case 7:return t.next=9,this.sleep(50);case 9:t.next=3;break;case 11:return t.abrupt("return",!1);case 14:return t.prev=14,t.t0=t.catch(1),t.abrupt("return",!1);case 17:case"end":return t.stop()}}),t,this,[[1,14]])}))),function(){return y.apply(this,arguments)})},{key:"openWithRetry",value:(d=r(e().mark((function t(){var n,r,o,i,u,a,c=arguments;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=c.length>0&&void 0!==c[0]?c[0]:{},r=n.timeoutMs,o=void 0===r?15e3:r,i=n.intervalMs,u=void 0===i?250:i,!this._isBusy){t.next=4;break}return console.log("[OneTrust CE] already attempting open; ignoring"),t.abrupt("return");case 4:return this._isBusy=!0,a=Date.now(),t.prev=6,t.next=9,this.tryOpenWithStabilization();case 9:if(!t.sent){t.next=11;break}return t.abrupt("return");case 11:if(!(Date.now()-a<o)){t.next=20;break}return t.next=14,this.sleep(u);case 14:return t.next=16,this.tryOpenWithStabilization();case 16:if(!t.sent){t.next=18;break}return t.abrupt("return");case 18:t.next=11;break;case 20:console.warn("[OneTrust CE] Timed out waiting for Optanon/OneTrust"),this.logSnapshot();case 22:return t.prev=22,this._isBusy=!1,t.finish(22);case 25:case"end":return t.stop()}}),t,this,[[6,,22,25]])}))),function(){return d.apply(this,arguments)})},{key:"getApi",value:function(){try{var t,e,n=null===(t=window)||void 0===t?void 0:t.Optanon;if(n&&"function"==typeof n.ToggleInfoDisplay)return n;var r=null===(e=window)||void 0===e?void 0:e.OneTrust;return r&&"function"==typeof r.ToggleInfoDisplay?r:null}catch(t){return null}}},{key:"tryOpenWithStabilization",value:(p=r(e().mark((function t(){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,n=this.getApi()){t.next=5;break}return console.log("[OneTrust CE] not ready yet (no ToggleInfoDisplay found)"),t.abrupt("return",!1);case 5:return t.next=7,this.nextFrame();case 7:return t.next=9,this.sleep(25);case 9:return console.log("[OneTrust CE] opening via ToggleInfoDisplay()"),n.ToggleInfoDisplay(),t.next=13,this.sleep(50);case 13:return this.dispatchResizeBurst(),t.next=16,this.waitForModalShell(800);case 16:return t.sent&&setTimeout((function(){try{window.dispatchEvent(new Event("resize"))}catch(t){}}),50),t.abrupt("return",!0);case 21:return t.prev=21,t.t0=t.catch(0),console.error("[OneTrust CE] error while opening:",t.t0),t.abrupt("return",!1);case 25:case"end":return t.stop()}}),t,this,[[0,21]])}))),function(){return p.apply(this,arguments)})},{key:"logSnapshot",value:function(){try{var t,e,n,r,o,i,u,a,c,s,l,f,h;console.log("[OneTrust CE] snapshot",{hasOptanon:!(null===(t=window)||void 0===t||!t.Optanon),optanonKeys:null!==(e=window)&&void 0!==e&&e.Optanon?Object.keys(window.Optanon).slice(0,25):[],hasOneTrust:!(null===(n=window)||void 0===n||!n.OneTrust),oneTrustKeys:null!==(r=window)&&void 0!==r&&r.OneTrust?Object.keys(window.OneTrust).slice(0,25):[],href:null===(o=window)||void 0===o||null===(i=o.location)||void 0===i?void 0:i.href,readyState:null===(u=document)||void 0===u?void 0:u.readyState,inner:{w:null===(a=window)||void 0===a?void 0:a.innerWidth,h:null===(c=window)||void 0===c?void 0:c.innerHeight},doc:{cw:null===(s=document)||void 0===s||null===(l=s.documentElement)||void 0===l?void 0:l.clientWidth,ch:null===(f=document)||void 0===f||null===(h=f.documentElement)||void 0===h?void 0:h.clientHeight}})}catch(t){}}}],h=[{key:"observedAttributes",get:function(){return["trigger"]}}],f&&o(a.prototype,f),h&&o(a,h),Object.defineProperty(a,"prototype",{writable:!1}),w}(u(HTMLElement));customElements.get("one-trust-button")||customElements.define("one-trust-button",f)}(); //# sourceMappingURL=https://bundler.wix-code.com/5a38f57e-7a80-4d81-88c8-6af2e8797f8a/undefined/91ae1d38-5396-4ad4-9d3d-0b348653a093/custom-elements/one-trust-button.js.map