@givefreely/adunit 2.6.3-rc.0 → 2.7.0-rc.0

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,2 +1,2 @@
1
- "use strict";const e=Symbol("solid-proxy"),t="function"==typeof Proxy,n={equals:(e,t)=>e===t};let r=O;const o=1,i=2,a={owned:null,cleanups:null,context:null,owner:null},s={};var l=null;let c=null,d=null,u=null,g=null,p=0;function h(e,t){const n=d,r=l,o=0===e.length,i=void 0===t?r:t,s=o?a:{owned:null,cleanups:null,context:i?i.context:null,owner:i},c=o?e:()=>e((()=>b((()=>N(s)))));l=s,d=null;try{return L(c,!0)}finally{d=n,l=r}}function f(e,t){const r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},n,t):n).equals||void 0};return[P.bind(r),e=>("function"==typeof e&&(e=e(r.value)),S(r,e))]}function m(e,t,n){T(E(e,t,!1,o))}function v(e,t,n){r=I;const i=E(e,t,!1,o);i.user=!0,g?g.push(i):T(i)}function y(e,t,r){r=r?Object.assign({},n,r):n;const o=E(e,t,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=r.equals||void 0,T(o),P.bind(o)}function x(e,t,n){let r,i,a;"function"==typeof t?(r=e,i=t,a={}):(r=!0,i=e,a=t||{});let l=null,c=s,d=!1,u="initialValue"in a,g="function"==typeof r&&y(r);const p=new Set,[h,m]=(a.storage||f)(a.initialValue),[v,x]=f(void 0),[A,w]=f(void 0,{equals:!1}),[C,k]=f(u?"ready":"unresolved");function P(e,t,n,r){return l===e&&(l=null,void 0!==r&&(u=!0),e!==c&&t!==c||!a.onHydrated||queueMicrotask((()=>a.onHydrated(r,{value:t}))),c=s,function(e,t){L((()=>{void 0===t&&m((()=>e)),k(void 0!==t?"errored":u?"ready":"unresolved"),x(t);for(const e of p.keys())e.decrement();p.clear()}),!1)}(t,n)),t}function S(){const e=h(),t=v();if(void 0!==t&&!l)throw t;return e}function D(e=!0){if(!1!==e&&d)return;d=!1;const t=g?g():r;if(null==t||!1===t)return void P(l,b(h));const n=c!==s?c:b((()=>i(t,{value:h(),refetching:e})));return(o=n)&&"object"==typeof o&&"then"in o?(l=n,"value"in n?("success"===n.status?P(l,n.value,void 0,t):P(l,void 0,H(n.value),t),n):(d=!0,queueMicrotask((()=>d=!1)),L((()=>{k(u?"refreshing":"pending"),w()}),!1),n.then((e=>P(n,e,void 0,t)),(e=>P(n,void 0,H(e),t))))):(P(l,n,void 0,t),n);var o}return Object.defineProperties(S,{state:{get:()=>C()},error:{get:()=>v()},loading:{get(){const e=C();return"pending"===e||"refreshing"===e}},latest:{get(){if(!u)return S();const e=v();if(e&&!l)throw e;return h()}}}),g?T(E((()=>D(!1)),void 0,!0,o)):D(!1),[S,{refetch:D,mutate:m}]}function b(e){if(null===d)return e();const t=d;d=null;try{return e()}finally{d=t}}function A(e){v((()=>b(e)))}function w(e){return null===l||(null===l.cleanups?l.cleanups=[e]:l.cleanups.push(e)),e}function C(e){let t;return l&&l.context&&void 0!==(t=l.context[e.id])?t:e.defaultValue}function k(e){const t=y(e),n=y((()=>U(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function P(){if(this.sources&&this.state)if(this.state===o)T(this);else{const e=u;u=null,L((()=>M(this)),!1),u=e}if(d){const e=this.observers?this.observers.length:0;d.sources?(d.sources.push(this),d.sourceSlots.push(e)):(d.sources=[this],d.sourceSlots=[e]),this.observers?(this.observers.push(d),this.observerSlots.push(d.sources.length-1)):(this.observers=[d],this.observerSlots=[d.sources.length-1])}return this.value}function S(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&L((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=c&&c.running;r&&c.disposed.has(n),(r?n.tState:n.state)||(n.pure?u.push(n):g.push(n),n.observers&&$(n)),r||(n.state=o)}if(u.length>1e6)throw u=[],new Error}),!1)),t}function T(e){if(!e.fn)return;N(e);const t=p;!function(e,t,n){let r;const i=l,a=d;d=l=e;try{r=e.fn(t)}catch(t){return e.pure&&(e.state=o,e.owned&&e.owned.forEach(N),e.owned=null),e.updatedAt=n+1,R(t)}finally{d=a,l=i}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?S(e,r):e.value=r,e.updatedAt=n)}(e,e.value,t)}function E(e,t,n,r=o,i){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:l,context:l?l.context:null,pure:n};return null===l||l!==a&&(l.owned?l.owned.push(s):l.owned=[s]),s}function D(e){if(0===e.state)return;if(e.state===i)return M(e);if(e.suspense&&b(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<p);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===o)T(e);else if(e.state===i){const n=u;u=null,L((()=>M(e,t[0])),!1),u=n}}function L(e,t){if(u)return e();let n=!1;t||(u=[]),g?n=!0:g=[],p++;try{const t=e();return function(e){if(u&&(O(u),u=null),e)return;const t=g;g=null,t.length&&L((()=>r(t)),!1)}(n),t}catch(e){n||(g=null),u=null,R(e)}}function O(e){for(let t=0;t<e.length;t++)D(e[t])}function I(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:D(r)}for(t=0;t<n;t++)D(e[t])}function M(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const e=r.state;e===o?r!==t&&(!r.updatedAt||r.updatedAt<p)&&D(r):e===i&&M(r,t)}}}function $(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=i,n.pure?u.push(n):g.push(n),n.observers&&$(n))}}function N(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)N(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)N(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function H(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function R(e,t=l){throw H(e)}function U(e){if("function"==typeof e&&!e.length)return U(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=U(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function _(e,t){return function(t){let n;return m((()=>n=b((()=>(l.context={...l.context,[e]:t.value},k((()=>t.children)))))),void 0),n}}const F=Symbol("fallback");function G(e){for(let t=0;t<e.length;t++)e[t]()}function B(e,t){return b((()=>e(t||{})))}function j(){return!0}const z={get:(t,n,r)=>n===e?r:t.get(n),has:(t,n)=>n===e||t.has(n),set:j,deleteProperty:j,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:j,deleteProperty:j}),ownKeys:e=>e.keys()};function W(e){return(e="function"==typeof e?e():e)?e:{}}function q(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function V(...n){let r=!1;for(let t=0;t<n.length;t++){const o=n[t];r=r||!!o&&e in o,n[t]="function"==typeof o?(r=!0,y(o)):o}if(t&&r)return new Proxy({get(e){for(let t=n.length-1;t>=0;t--){const r=W(n[t])[e];if(void 0!==r)return r}},has(e){for(let t=n.length-1;t>=0;t--)if(e in W(n[t]))return!0;return!1},keys(){const e=[];for(let t=0;t<n.length;t++)e.push(...Object.keys(W(n[t])));return[...new Set(e)]}},z);const o={},i=Object.create(null);for(let e=n.length-1;e>=0;e--){const t=n[e];if(!t)continue;const r=Object.getOwnPropertyNames(t);for(let e=r.length-1;e>=0;e--){const n=r[e];if("__proto__"===n||"constructor"===n)continue;const a=Object.getOwnPropertyDescriptor(t,n);if(i[n]){const e=o[n];e&&(a.get?e.push(a.get.bind(t)):void 0!==a.value&&e.push((()=>a.value)))}else i[n]=a.get?{enumerable:!0,configurable:!0,get:q.bind(o[n]=[a.get.bind(t)])}:void 0!==a.value?a:void 0}}const a={},s=Object.keys(i);for(let e=s.length-1;e>=0;e--){const t=s[e],n=i[t];n&&n.get?Object.defineProperty(a,t,n):a[t]=n?n.value:void 0}return a}const K=e=>`Stale read from <${e}>.`;function Y(e){const t="fallback"in e&&{fallback:()=>e.fallback};return y(function(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return w((()=>G(i))),()=>{let l,c,d=e()||[],u=d.length;return b((()=>{let e,t,p,f,m,v,y,x,b;if(0===u)0!==a&&(G(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[F],o[0]=h((e=>(i[0]=e,n.fallback()))),a=1);else if(0===a){for(o=new Array(u),c=0;c<u;c++)r[c]=d[c],o[c]=h(g);a=u}else{for(p=new Array(u),f=new Array(u),s&&(m=new Array(u)),v=0,y=Math.min(a,u);v<y&&r[v]===d[v];v++);for(y=a-1,x=u-1;y>=v&&x>=v&&r[y]===d[x];y--,x--)p[x]=o[y],f[x]=i[y],s&&(m[x]=s[y]);for(e=new Map,t=new Array(x+1),c=x;c>=v;c--)b=d[c],l=e.get(b),t[c]=void 0===l?-1:l,e.set(b,c);for(l=v;l<=y;l++)b=r[l],c=e.get(b),void 0!==c&&-1!==c?(p[c]=o[l],f[c]=i[l],s&&(m[c]=s[l]),c=t[c],e.set(b,c)):i[l]();for(c=v;c<u;c++)c in p?(o[c]=p[c],i[c]=f[c],s&&(s[c]=m[c],s[c](c))):o[c]=h(g);o=o.slice(0,a=u),r=d.slice(0)}return o}));function g(e){if(i[c]=e,s){const[e,n]=f(c);return s[c]=n,t(d[c],e)}return t(d[c])}}}((()=>e.each),e.children,t||void 0))}function X(e){const t=e.keyed,n=y((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return y((()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?b((()=>o(t?r:()=>{if(!b(n))throw K("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}function Z(e){let t=!1;const n=k((()=>e.children)),r=y((()=>{let e=n();Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++){const r=e[n].when;if(r)return t=!!e[n].keyed,[n,r,e[n]]}return[-1]}),void 0,{equals:(e,n)=>(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return y((()=>{const[n,o,i]=r();if(n<0)return e.fallback;const a=i.children;return"function"==typeof a&&a.length>0?b((()=>a(t?o:()=>{if(b(r)[0]!==n)throw K("Match");return i.when}))):a}),void 0,void 0)}function J(e){return e}const Q="_$DX_DELEGATE";function ee(e,t,n,r={}){let o;return h((r=>{o=r,t===document?e():se(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}function te(e,t,n){let r;const o=()=>(r||(r=(()=>{const t=document.createElement("template");return t.innerHTML=e,t.content.firstChild})())).cloneNode(!0);return o.cloneNode=o,o}function ne(e,t=window.document){const n=t[Q]||(t[Q]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,le))}}function re(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function oe(e,t,n,r){Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n}function ie(e,t,n){if(!t)return n?re(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function ae(e,t,n){return b((()=>e(t,n)))}function se(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return ce(e,t,r,n);m((r=>ce(e,t(),r,n)),r)}function le(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),a=()=>{const r=t[n];if(r&&!t.disabled){const o=t[`${n}Data`];if(void 0!==o?r.call(t,o,e):r.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){const n=e.composedPath();i(n[0]);for(let e=0;e<n.length-2&&(t=n[e],a());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(r)}function ce(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,a=void 0!==r;if(e=a&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i){if("number"===i&&(t=t.toString())===n)return n;if(a){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=ge(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i)n=ge(e,n,r);else{if("function"===i)return m((()=>{let o=t();for(;"function"==typeof o;)o=o();n=ce(e,o,n,r)})),()=>n;if(Array.isArray(t)){const i=[],s=n&&Array.isArray(n);if(de(i,t,n,o))return m((()=>n=ce(e,i,n,r,!0))),()=>n;if(0===i.length){if(n=ge(e,n,r),a)return n}else s?0===n.length?ue(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,l=t[o-1].nextSibling,c=null;for(;a<o||s<i;)if(t[a]!==n[s]){for(;t[o-1]===n[i-1];)o--,i--;if(o===a){const t=i<r?s?n[s-1].nextSibling:n[i-s]:l;for(;s<i;)e.insertBefore(n[s++],t)}else if(i===s)for(;a<o;)c&&c.has(t[a])||t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=s;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[a]);if(null!=r)if(s<r&&r<i){let l,d=a,u=1;for(;++d<o&&d<i&&null!=(l=c.get(t[d]))&&l===r+u;)u++;if(u>r-s){const o=t[a];for(;s<r;)e.insertBefore(n[s++],o)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}else a++,s++}(e,n,i):(n&&ge(e),ue(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=ge(e,n,r,t);ge(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function de(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let a,s=t[i],l=n&&n[e.length];if(null==s||!0===s||!1===s);else if("object"==(a=typeof s)&&s.nodeType)e.push(s);else if(Array.isArray(s))o=de(e,s,l)||o;else if("function"===a)if(r){for(;"function"==typeof s;)s=s();o=de(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o}else e.push(s),o=!0;else{const t=String(s);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return o}function ue(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ge(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const t=a.parentNode===e;r||i?t&&a.remove():t?e.replaceChild(o,a):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}const pe={top:"50px",left:"calc(100% - 700px)",margin:"0",width:"640px","max-height":"80vh",padding:"2px 5px 10px 5px","background-color":"white",border:"none","border-radius":"24px","box-shadow":"0px 4px 44px rgba(0, 0, 0, 0.25)","font-family":"Arial","line-height":"1","vertical-align":"baseline","box-sizing":"border-box",color:"rgb(34, 34, 34)","@media (max-width: 600px), (max-height: 480px)":{display:"none !important"}},he={height:"100%","overflow-x":"hidden","overlfow-y":"auto",position:"relative",padding:"0px 15px"},fe={},me={display:"flex","flex-direction":"column-reverse","align-items":"center","margin-bottom":"10px"},ve={flex:"1","font-size":"24px","font-weight":"700","margin-top":"5px","margin-bottom":"0px"},ye={background:"none",border:"none",padding:"4px 8px","align-self":"flex-end",color:"#666464","font-size":"38px",cursor:"pointer","line-height":"1"},xe={color:"#707070","align-self":"flex-end","margin-top":"5px","max-width":"40%"},be={color:"#707070",cursor:"default","pointer-events":"none","text-decoration":"none"},Ae={"font-size":"18px","font-weight":"400","margin-top":"0px","margin-bottom":"0px"},we={display:"flex",gap:"10px",width:"100%","margin-top":"20px","margin-bottom":"20px","flex-wrap":"wrap","justify-content":"space-between"},Ce={width:"30%",position:"relative",display:"flex","flex-direction":"column","align-items":"center","justify-content":"space-between",background:"none",border:"1px solid #ccc","border-radius":"5px",padding:"5px",gap:"5px","text-align":"center","font-size":"14px",cursor:"pointer",transition:"background-color 0.2s ease"},ke={color:"white","background-color":"lightgray",cursor:"default","pointer-events":"none"},Pe={"max-width":"120px","max-height":"70px","margin-bottom":"5px","object-fit":"contain"},Se={"background-color":"#0052FF",cursor:"pointer","border-radius":"32px",padding:"8px",color:"white","min-width":"100px",border:"0","font-weight":"600",width:"120px"},Te={display:"block",color:"white",border:"0","border-radius":"999px",padding:"14px 40px","font-size":"15px","font-weight":"700",cursor:"pointer","margin-top":"12px","margin-bottom":"16px","margin-left":"auto","margin-right":"auto"},Ee={display:"flex","flex-direction":"column",gap:"10px",width:"100%","color-scheme":"light"},De={display:"flex","align-items":"center",gap:"5px",border:"1px solid #ddd",padding:"15px","border-radius":"5px","font-weight":"600",cursor:"pointer","margin-bottom":"8px"},Le={"background-color":"#eef2ff",border:"1.5px solid #3b5bdb"},Oe={"text-align":"right"},Ie={background:"none",border:"none",color:"blue","text-decoration":"underline",padding:"0",cursor:"pointer","margin-bottom":"15px"},Me={display:"flex","justify-content":"space-between","align-items":"center",position:"relative",margin:"20px 0px 10px 0px","font-size":"14px"},$e={margin:"5px 0px 5px 0px","font-size":"14px","text-align":"center"},Ne={color:"#666464","text-decoration":"underline"},He={color:"rgb(102, 100, 100)","text-decoration":"underline",margin:"0",cursor:"pointer"},Re={position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"8px",height:"8px","border-radius":"50%"},Ue={width:"100%","background-color":"#f2f2f2",border:"1px solid black","border-radius":"10px","border-top":"1px solid #bbb7b7","margin-top":"10px","margin-bottom":"20px","box-sizing":"border-box"},_e={padding:"0 5px 0 10px",width:"100%","font-size":"12px","box-sizing":"border-box"},Fe={display:"grid","grid-template-columns":"4fr 1fr","padding-right":"15px","padding-bottom":"5px"},Ge={color:"#000","margin-bottom":"4px"},Be={"font-size":"14px",color:"#555","text-align":"right"},je={display:"flex","justify-content":"space-between","margin-top":"8px","margin-bottom":"4px"},ze={"font-size":"20px","text-align":"center","margin-bottom":"20px",color:"#333c5e","line-height":"1.3"},We={"font-size":"15px","font-weight":"400","text-align":"center",color:"#555","margin-bottom":"20px"},qe={color:"#000000","font-size":"11px","text-align":"right","text-decoration":"none","white-space":"nowrap"},Ve={position:"relative",display:"inline-block"},Ke={background:"none",border:"none",cursor:"pointer",padding:"2px 4px",display:"inline-flex","align-items":"center"},Ye={position:"absolute",top:"100%",right:"0","z-index":"1000",background:"#fff","border-radius":"8px","box-shadow":"0 2px 12px rgba(0,0,0,0.18)","min-width":"200px",padding:"4px 0"},Xe={display:"block",padding:"12px 20px",color:"#222","text-decoration":"none","font-size":"14px",cursor:"pointer","white-space":"nowrap"},Ze={display:"grid","grid-template-columns":"repeat(4, 1fr)",gap:"12px",width:"100%","margin-top":"16px","margin-bottom":"16px"},Je={display:"flex","flex-direction":"column","align-items":"center","justify-content":"space-between",border:"1px solid #c4c4c4","border-radius":"12px",padding:"16px 10px",gap:"10px","text-align":"center","font-size":"14px",cursor:"pointer",background:"white",position:"relative",transition:"background-color 0.2s ease","box-shadow":"0 2px 12px rgba(0, 0, 0, 0.18)"},Qe={"background-color":"#3a67ab",cursor:"pointer","border-radius":"999px",padding:"10px 0",color:"white",width:"100%",border:"0","font-weight":"600","font-size":"15px"},et={"background-color":"#f7f7f8","border-top":"1px solid #b0b0b0","border-radius":"0 0 24px 24px",margin:"0 -20px -10px -20px",padding:"0 20px 10px 20px","font-size":"13px"},tt={display:"flex","flex-direction":"row","justify-content":"space-evenly","align-items":"center",gap:"10px",padding:"14px 0"},nt={display:"inline-block",width:"8px",height:"8px","border-radius":"50%","flex-shrink":"0"},rt={color:"#1a1a1a","text-decoration":"underline",cursor:"pointer"};function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var it={exports:{}};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,function(e){if(!(globalThis.chrome&&globalThis.chrome.runtime&&globalThis.chrome.runtime.id))throw new Error("This script should only be loaded in a browser extension.");if(globalThis.browser&&globalThis.browser.runtime&&globalThis.browser.runtime.id)e.exports=globalThis.browser;else{const t="The message port closed before a response was received.",n=e=>{const n={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(0===Object.keys(n).length)throw new Error("api-metadata.json has not been included in browser-polyfill");class r extends WeakMap{constructor(e,t=void 0){super(t),this.createItem=e}get(e){return this.has(e)||this.set(e,this.createItem(e)),super.get(e)}}const o=(t,n)=>(...r)=>{e.runtime.lastError?t.reject(new Error(e.runtime.lastError.message)):n.singleCallbackArg||r.length<=1&&!1!==n.singleCallbackArg?t.resolve(r[0]):t.resolve(r)},i=e=>1==e?"argument":"arguments",a=(e,t,n)=>new Proxy(t,{apply:(t,r,o)=>n.call(r,e,...o)});let s=Function.call.bind(Object.prototype.hasOwnProperty);const l=(e,t={},n={})=>{let r=Object.create(null),c={has:(t,n)=>n in e||n in r,get(c,d,u){if(d in r)return r[d];if(!(d in e))return;let g=e[d];if("function"==typeof g)if("function"==typeof t[d])g=a(e,e[d],t[d]);else if(s(n,d)){let t=((e,t)=>function(n,...r){if(r.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${r.length}`);if(r.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${r.length}`);return new Promise(((i,a)=>{if(t.fallbackToNoCallback)try{n[e](...r,o({resolve:i,reject:a},t))}catch(o){console.warn(`${e} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,o),n[e](...r),t.fallbackToNoCallback=!1,t.noCallback=!0,i()}else t.noCallback?(n[e](...r),i()):n[e](...r,o({resolve:i,reject:a},t))}))})(d,n[d]);g=a(e,e[d],t)}else g=g.bind(e);else if("object"==typeof g&&null!==g&&(s(t,d)||s(n,d)))g=l(g,t[d],n[d]);else{if(!s(n,"*"))return Object.defineProperty(r,d,{configurable:!0,enumerable:!0,get:()=>e[d],set(t){e[d]=t}}),g;g=l(g,t[d],n["*"])}return r[d]=g,g},set:(t,n,o,i)=>(n in r?r[n]=o:e[n]=o,!0),defineProperty:(e,t,n)=>Reflect.defineProperty(r,t,n),deleteProperty:(e,t)=>Reflect.deleteProperty(r,t)},d=Object.create(e);return new Proxy(d,c)},c=e=>({addListener(t,n,...r){t.addListener(e.get(n),...r)},hasListener:(t,n)=>t.hasListener(e.get(n)),removeListener(t,n){t.removeListener(e.get(n))}}),d=new r((e=>"function"!=typeof e?e:function(t){const n=l(t,{},{getContent:{minArgs:0,maxArgs:0}});e(n)})),u=new r((e=>"function"!=typeof e?e:function(t,n,r){let o,i,a=!1,s=new Promise((e=>{o=function(t){a=!0,e(t)}}));try{i=e(t,n,o)}catch(e){i=Promise.reject(e)}const l=!0!==i&&((c=i)&&"object"==typeof c&&"function"==typeof c.then);var c;if(!0!==i&&!l&&!a)return!1;return(l?i:s).then((e=>{r(e)}),(e=>{let t;t=e&&(e instanceof Error||"string"==typeof e.message)?e.message:"An unexpected error occurred",r({__mozWebExtensionPolyfillReject__:!0,message:t})})).catch((e=>{console.error("Failed to send onMessage rejected reply",e)})),!0})),g=({reject:n,resolve:r},o)=>{e.runtime.lastError?e.runtime.lastError.message===t?r():n(new Error(e.runtime.lastError.message)):o&&o.__mozWebExtensionPolyfillReject__?n(new Error(o.message)):r(o)},p=(e,t,n,...r)=>{if(r.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${r.length}`);if(r.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${r.length}`);return new Promise(((e,t)=>{const o=g.bind(null,{resolve:e,reject:t});r.push(o),n.sendMessage(...r)}))},h={devtools:{network:{onRequestFinished:c(d)}},runtime:{onMessage:c(u),onMessageExternal:c(u),sendMessage:p.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:p.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},f={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return n.privacy={network:{"*":f},services:{"*":f},websites:{"*":f}},l(e,h,n)};e.exports=n(chrome)}}(it);var at,st,browser=ot(it.exports);class lt{constructor(){this.isLocal=!0}log({level:e,message:t,timestamp:n,data:r,title:o}){let i;switch(e){case"debug":default:i="log";break;case"info":i="info";break;case"warn":i="warn";break;case"error":case"critical":case"fatal":i="error"}const a=o?`[${o}]`:"";void 0!==r?console[i](`[${n}] - ${lt.LOGGER_PREFIX} ${a} ${t}`,r):console[i](`[${n}] - ${lt.LOGGER_PREFIX} ${a} ${t}`)}}lt.LOGGER_PREFIX="[DonationPopup] -",function(e){e.checkoutPopupShown="CHECKOUT-POPUP-SHOWN",e.checkoutPopupNotShown="CHECKOUT-POPUP-NOT-SHOWN",e.checkoutPopupSupressed="CHECKOUT-POPUP-SUPRESSED",e.checkoutPopupDonation="CHECKOUT-POPUP-DONATION",e.checkoutPopupFailedActivation="CHECKOUT-POPUP-FAILED-ACTIVATION",e.checkoutPopupPurchaseConfirmed="CHECKOUT-POPUP-PURCHASE-CONFIRMED",e.checkoutPopupHealthCheck="CHECKOUT-POPUP-HEALTH-CHECK",e.checkouPopupActivationFailed="CHECKOUT-POPUP-ACTIVATION-FAILED",e.checkoutPopupOfferDetailsClicked="CHECKOUT-POPUP-OFFER-DETAILS-CLICKED",e.checkoutPopupWhyAmISeeingThisClicked="CHECKOUT-POPUP-WHY-AM-I-SEEING-THIS-CLICKED",e.checkoutPopupLooserExtension="CHECKOUT-POPUP-LOOSER-EXTENSION",e.checkoutPopupActiveDomain="CHECKOUT-POPUP-ACTIVE-DOMAIN",e.checkoutPopupSiteMatches="CHECKOUT-POPUP-SITE-MATCHES",e.checkoutPopupMerchantInResultsFound="CHECKOUT-MERCHANT-IN-RESULTS-FOUND",e.checkoutPopupNotShownPerViewportSize="CHECKOUT-POPUP-NOT-SHOWN-PER-VIEWPORT-SIZE",e.checkoutPopupHiddenProgrammatically="CHECKOUT-POPUP-HIDDEN-PROGRAMMATICALLY",e.checkoutPopupGoogleSearch="CHECKOUT-POPUP-GOOGLE-SEARCH",e.checkoutPopupGooglePartnerAnnCreated="CHECKOUT-POPUP-GOOGLE-PARTNER-ANN-CREATED",e.checkoutPopupGooglePartnerAnnClicked="CHECKOUT-POPUP-GOOGLE-PARTNER-ANN-CLICKED",e.checkoutPopupGooglePartnerAnnHidden="CHECKOUT-POPUP-GOOGLE-PARTNER-ANN-HIDDEN",e.checkoutPopupStoodDown="CHECKOUT-POPUP-STOOD-DOWN",e.checkoutPopupFooterDismiss="CHECKOUT-POPUP-FOOTER-DISMISS",e.checkoutPopupMenuItemClicked="CHECKOUT-POPUP-MENU-ITEM-CLICKED"}(at||(at={})),function(e){e.libLog="GFLIB-LOG"}(st||(st={}));const ct=["debug","info","warn","error","critical","fatal"];class dt{constructor(e){this.config={minLevel:e?.minLevel??"error",enabled:e?.enabled??!1,transports:e?.transports??[new lt],title:e?.title??""}}static getInstance(e){return dt.instance||(dt.instance=new dt(e)),dt.instance}configure(e){this.config={...this.config,...e}}shouldLog(e){return!!this.config.enabled&&ct.indexOf(e)>=ct.indexOf(this.config.minLevel)}createLogMessage(e,t,n){return{level:e,version:"2.6.3",message:t,timestamp:(new Date).toISOString(),data:n,title:this.config.title}}log(e,t,n,r){if(!this.shouldLog(e))return;const o=this.createLogMessage(e,t,r);this.config.transports.filter((e=>!n||e.isLocal)).forEach((e=>e.log(o)))}debug(e,t,n=!1){this.log("debug",e,n,t)}info(e,t,n=!1){this.log("info",e,n,t)}warn(e,t,n=!1){this.log("warn",e,n,t)}error(e,t,n=!1){this.log("error",e,n,t)}critical(e,t,n=!1){this.log("critical",e,n,t)}fatal(e,t,n=!1){this.log("fatal",e,n,t)}addTransport(e){this.config.transports.push(e)}clearTransports(){this.config.transports=[]}disable(){this.config.enabled=!1}enable(){this.config.enabled=!0}}const ut=3,gt=e=>1e3*e,pt=browser;async function ht(e,t){return await pt.runtime.sendMessage(e)}async function ft(e,t,n){return async function(e,t={}){const{maxAttempts:n=ut,delayFn:r=gt}=t;let o=null;for(let t=1;t<=n;t+=1)try{return await e()}catch(e){o=e,t<n&&await new Promise((e=>{setTimeout(e,r(t))}))}throw o&&t.logger&&t.operationName&&t.logger.error(`Operation ${t.operationName} failed after ${n} attempts.`,o,!0),o||new Error("Operation failed after multiple attempts")}((async()=>{const n=await ht(e);if(void 0===n){const n=e.type,r="string"==typeof n?n:"unknown",o=void 0!==t?.tabId?`tabId=${t.tabId}`:"runtime";throw new Error(`No response from background service worker for message type "${r}" (target: ${o})`)}return n}),{maxAttempts:ut,delayFn:gt})}const mt="GF_TRACK_EVENT",vt="GF_HIDE_POPUP",yt="GF_GET_POPUP_CONFIG",xt="GF_IS_ACTIVE_DOMAIN",bt="GF_LOG_MERCHANTS_IN_SEARCH_RESULTS",At="GF_SHOULD_STAND_DOWN",wt="GF_ACTIVATE_OFFER",Ct="GF_STORE_SHOPIFY_SHOP_ID",kt="GF_GET_DOMAIN_BY_SHOP_ID",Pt="GF_GET_LANGUAGE_CONTENT",St="GF_GET_ACTIVE_DOMAINS",Tt="GF_MUTE_PARTNER_SERP_BOX",Et="GF_GET_GF_DATA",Dt="countryCode",Lt="gf_event_history",Ot="gf_popup_everywhere",It={ein:"0",tpi:"0"},Mt="us",$t="GIVE_FREELY_",Nt={async get(e){const t=`${$t}${e}`;return(await browser.storage.local.get(t))[t]||null},async set(e,t){const n=`${$t}${e}`;await browser.storage.local.set({[n]:t})},async remove(e){const t=Array.isArray(e)?e.map((e=>`${$t}${e}`)):`${$t}${e}`;await browser.storage.local.remove(t)}},Ht=()=>String("2.6.3");class Rt{constructor(e,t,n,r=60){this.track=async(e,t,n=!1,r=!1)=>{const o={partner:`gfLib_${this._partnerApiKey}`,eventType:e,eventData:{userId:n?void 0:this._userService?.user?.id,libVersion:Ht(),...t}};try{const e=JSON.stringify(o,((e,t)=>t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t)),t=await this.getEventsUrl();return t?await this.BroadcastEvent(t,e,o,r):(this._logger.info("Cant broadcast event. eventsUrl cant be retrieved from config",o,!0),!1)}catch(e){return this._logger.error("Something unexpected happened when dispatching a gf event",{error:e,event:o},!0),!1}},this.getEventsHistory=async()=>{const e=await Nt.get(Lt),t=(e=>{const t=new Date;return t.setTime(t.getTime()+60*e*1e3),t.getTime()})(-this._debounceWindowInMinutes),n=(e||[]).filter((e=>e.createdAt>t));return await Nt.set(Lt,n),n},this.shouldBroadcastEvent=async(e,t)=>!!t||!(await this.getEventsHistory()).some((t=>t.payload===e)),this.pushEventToHistory=async e=>{const t=await this.getEventsHistory();t.push({createdAt:Date.now(),payload:e}),await Nt.set(Lt,t)},this._partnerApiKey=e,this._userService=t,this._debounceWindowInMinutes=r,this._logger=dt.getInstance({title:"Analytics"}),this._configService=n}async BroadcastEvent(e,t,n,r){if(await this.shouldBroadcastEvent(t,r)){const r=await fetch(e,{headers:{"Content-Type":"application/json"},method:"POST",body:t,cache:"no-store"});return r.ok?(await this.pushEventToHistory(t),!0):(this._logger.error("Something unexpected happened when dispatching an event",{status:r.status,statusText:r.statusText,event:n},!0),!1)}return this._logger.info("This event has already been broadcasted during the past hour",n,!0),!1}async getEventsUrl(){const e=await this._configService.getCachedConfig();return e?.eventsUrl}}function Ut(e,t,n){return e?{...t,...n}:t}Rt.trackEvent=async(e,t,n=!1,r=!1)=>{await ht({type:mt,payload:{eventType:e,eventData:t,anonymous:n,skipThrottling:r}})};const _t=(e,t)=>((e,t)=>{let n=parseFloat(t);return n<1&&(n=1),n=Math.floor(n),"PERCENTAGE"===e?`${n}%`:`$${n}`})(e,parseFloat(t).toString());var Ft=te("<span>");function Gt(e){return t=Ft(),m((()=>{return t.innerHTML=(n=e.title,r=e.activeDomain,n.replace("{0}",_t(r.commission.kind,r.commission.amount.toString())));var n,r})),t;var t}const Bt=function(){const e=Symbol("context");return{id:e,Provider:_(e),defaultValue:()=>({translate:e=>"",translateArray:e=>[],getAllCharities:()=>[]})}}(),jt=Bt,zt=()=>{const e=C(jt)();if(!e)throw new Error("Content provider context is undefined");return t=>e.translate(t)};class Wt{static formatMessage(e,...t){return e.replace(/{(\d+)}/g,((e,n)=>{const r=Number(n);return void 0!==t[r]?String(t[r]):`{${r}}`}))}}var qt=te("<div>"),Vt=te("<p><span>"),Kt=te("<div><div class=gf-offer-details><p><span></span></p><p><span></span></p><p><span></span></p><p><span></span></p><p><span></span></p><p><a target=_blank rel=noreferrer><span>"),Yt=te("<div class=gf-offer-details-rate-item><div></div><div>");const Xt=e=>{const t=zt();return n=Kt(),o=(r=n.firstChild).firstChild,i=o.firstChild,a=o.nextSibling,s=a.firstChild,l=a.nextSibling,c=l.firstChild,d=l.nextSibling,u=d.firstChild,g=d.nextSibling,p=g.firstChild,h=g.nextSibling,f=h.firstChild,v=f.firstChild,se(r,B(X,{get when(){return!!e.merchantRateDetail?.length},get children(){var t=qt();return se(t,(()=>e.merchantRateDetail?.map((e=>{return t=Yt(),n=t.firstChild,r=n.nextSibling,se(n,(()=>e.Name||"")),se(r,(()=>((e,t=1,n=1)=>{const r=e.BoostedOffer??null;let o=parseFloat(e?.Amount??"");if(r?.EndDate&&new Date(r.EndDate)<new Date&&(o=parseFloat(r.OriginalMaxRate)),Number.isNaN(o))return"";const i=o*t;return"PERCENTAGE"===e?.Kind?`${i.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n})}%`:"FLAT"===e?.Kind?i.toLocaleString("en-US",{style:"currency",currency:e.Currency}):""})(e))),m((e=>{var o=Fe,i=Ge,a=Be;return e.e=ie(t,o,e.e),e.t=ie(n,i,e.t),e.a=ie(r,a,e.a),e}),{e:void 0,t:void 0,a:void 0}),t;var t,n,r})))),t}}),d),se(r,B(X,{get when(){return e.additionalHtml},get children(){var t=Vt(),n=t.firstChild;return m((()=>n.innerHTML=e.additionalHtml)),t}}),h),m((o=>{var a=Ue,l=_e,d=t("offerDetails.intro"),g=t("offerDetails.eligible"),h=e.parsedMaxRate?Wt.formatMessage(t("offerDetails.donationRatesWithValue"),e.parsedMaxRate):Wt.formatMessage(t("offerDetails.donationRates")),m=t("offerDetails.donationAmounts"),y=t("offerDetails.donationTiming"),x=Ne,b=e.termsUrl,A=t("offerDetails.termsAndConditions");return o.e=ie(n,a,o.e),o.t=ie(r,l,o.t),d!==o.a&&(i.innerHTML=o.a=d),g!==o.o&&(s.innerHTML=o.o=g),h!==o.i&&(c.innerHTML=o.i=h),m!==o.n&&(u.innerHTML=o.n=m),y!==o.s&&(p.innerHTML=o.s=y),o.h=ie(f,x,o.h),b!==o.r&&re(f,"href",o.r=b),A!==o.d&&(v.innerHTML=o.d=A),o}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),n;var n,r,o,i,a,s,l,c,d,u,g,p,h,f,v},Zt=()=>{const e=C(Bt)();if(!e)throw new Error("Content provider context is undefined");return()=>e.getAllCharities()};function Jt(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return`hsl(${(t%360+360)%360}, 55%, 50%)`}var Qt=te("<a href=#!>"),en=te("<button class=give-freely-close-button aria-label=Close>×"),tn=te('<div><div><div></div></div><div></div><div><div><div><span></span></div><button aria-label="Don\'t show again"><span></span></button></div></div><div><p><span></span></p><span></span><a class=give-freely-footer-link target=_blank rel="noopener noreferrer"><span>'),nn=te("<div><div><img><span></span></div><button><span>"),rn=te("<div>"),on=te("<div><span>");function an(e){const t=zt(),n=Zt();return[(o=tn(),i=o.firstChild,a=i.firstChild,s=i.nextSibling,l=s.nextSibling,c=l.firstChild,d=c.firstChild,u=d.firstChild,g=d.nextSibling,p=g.firstChild,h=l.nextSibling,f=h.firstChild,v=f.firstChild,x=f.nextSibling,b=x.nextSibling,A=b.firstChild,se(i,B(X,{get when(){return e.checkoutPopupConf.checkoutPopupActivateAndClose},get children(){var n=Qt();return n.$$click=()=>e.onCharityClick(It,!0),m((r=>{var o=Ut(e.isCharitySelected,xe,be),i=t("main.activateAndClose.v2");return r.e=ie(n,o,r.e),i!==r.t&&(n.innerHTML=r.t=i),r}),{e:void 0,t:void 0}),n}}),null),se(i,B(X,{get when(){return e.checkoutPopupConf.checkoutPopupMainCloseButtonVisible&&!e.checkoutPopupConf.checkoutPopupActivateAndClose},get children(){var t=en();return t.$$click=()=>e.onClose(),m((e=>ie(t,ye,e))),t}}),null),se(s,B(Gt,{get title(){return t("main.subTitle.v2")},get activeDomain(){return e.activeDomain}})),se(l,(()=>n().reduce(((n,r)=>{var o,i,a,s,l,c,d;return r?.title&&""!==r?.title?n.push((a=(i=nn()).firstChild,s=a.firstChild,l=s.nextSibling,c=a.nextSibling,d=c.firstChild,i.$$click=()=>!e.isCharitySelected&&e.onCharityClick(r),se(i,(o=y((()=>!!(r.decorator&&r.decoratorLeftStyle&&r.decoratorRightStyle))),()=>{return o()&&[(t=rn(),m((e=>{var n=r.decoratorLeftStyle,o=r.decorator;return e.e=ie(t,n,e.e),o!==e.t&&(t.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),t),(e=rn(),m((t=>{var n=r.decoratorRightStyle,o=r.decorator;return t.e=ie(e,n,t.e),o!==t.t&&(e.innerHTML=t.t=o),t}),{e:void 0,t:void 0}),e)];var e,t}),a),a.style.setProperty("text-align","center"),a.style.setProperty("display","flex"),a.style.setProperty("flex-direction","column"),a.style.setProperty("align-items","center"),a.style.setProperty("gap","7px"),m((n=>{var o=Ut(e.isCharitySelected,Ce,{cursor:"default"}),a=r.logo,u=Pe,g=r.title,p=r.title,h=Ut(e.isCharitySelected,{...Se,"background-color":e.checkoutPopupConf?.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},ke),f=e.isCharitySelected,m=`Select charity: ${r.title}`,v=t("main.charitySelect");return n.e=ie(i,o,n.e),a!==n.t&&re(s,"src",n.t=a),n.a=ie(s,u,n.a),g!==n.o&&re(s,"alt",n.o=g),p!==n.i&&(l.innerHTML=n.i=p),n.n=ie(c,h,n.n),f!==n.s&&(c.disabled=n.s=f),m!==n.h&&re(c,"aria-label",n.h=m),v!==n.r&&(d.innerHTML=n.r=v),n}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),i)):e.logger.error(`Translation was not found for EIN ${r?.ein}`),n}),[])),c),c.$$click=()=>!e.isCharitySelected&&e.onSuppressClick(),d.style.setProperty("text-align","center"),d.style.setProperty("display","flex"),d.style.setProperty("align-items","center"),d.style.setProperty("height","100%"),f.$$click=()=>e.onOfferDetailsClickInternal(),oe(b,"click",e.onWhyAmISeeingThisClick),se(o,(r=y((()=>!!e.checkoutPopupConf.checkoutPopupDisplayNameInFooter)),()=>{return r()&&(e=on(),n=e.firstChild,m((r=>{var o=$e,i=t("main.footer");return r.e=ie(e,o,r.e),i!==r.t&&(n.innerHTML=r.t=i),r}),{e:void 0,t:void 0}),e);var e,n}),null),m((n=>{var r=fe,d=me,m={...ve,"font-weight":800},y=t("main.title.v2"),w=Ae,C=we,k=Ut(e.isCharitySelected,Ce,{cursor:"default","justify-content":"flex-end"}),P=t("main.sixthBox"),S=Ut(e.isCharitySelected,{...Se,"background-color":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},ke),T=e.isCharitySelected,E=t("main.settings.v2"),D=Me,L=He,O=t("main.offerDetails"),I={...Re,"background-color":Jt(e.activeDomain.provider)},M=Ne,$=e.checkoutPopupConf.externalUrls.giveFreelyWhyAmISeeingThis,N=t("main.whyAmISeeingThis");return n.e=ie(o,r,n.e),n.t=ie(i,d,n.t),n.a=ie(a,m,n.a),y!==n.o&&(a.innerHTML=n.o=y),n.i=ie(s,w,n.i),n.n=ie(l,C,n.n),n.s=ie(c,k,n.s),P!==n.h&&(u.innerHTML=n.h=P),n.r=ie(g,S,n.r),T!==n.d&&(g.disabled=n.d=T),E!==n.l&&(p.innerHTML=n.l=E),n.u=ie(h,D,n.u),n.c=ie(f,L,n.c),O!==n.w&&(v.innerHTML=n.w=O),n.m=ie(x,I,n.m),n.f=ie(b,M,n.f),$!==n.y&&re(b,"href",n.y=$),N!==n.g&&(A.innerHTML=n.g=N),n}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0}),o),B(X,{get when(){return e.detailsDisplayed},get children(){return B(Xt,{get merchantName(){return e.activeDomain.merchantName},get extensionName(){return e.checkoutPopupConf.displayName},get termsUrl(){return e.checkoutPopupConf.externalUrls.giveFreelyTermsAndConditions},get parsedMaxRate(){return _t(e.activeDomain.commission.kind,e.activeDomain.commission.amount.toString())},get merchantRateDetail(){return e.merchantRates},get additionalHtml(){return e.checkoutPopupConf.checkoutPopupOfferDetailsAdditionalHtml},onClose:()=>e.onOfferDetailsClose()})}})];var r,o,i,a,s,l,c,d,u,g,p,h,f,v,x,b,A}ne(["click"]);var sn=te("<a href=#!>");function ln(e){return B(X,{get when(){return!!e.label&&!!e.action},get children(){var t=sn();return t.$$click=t=>(t.preventDefault(),"donateclose"===e.action?e.onCharityClick(It,!0):e.onClose()),m((n=>{var r=Ut(e.isCharitySelected,qe,{cursor:"default","pointer-events":"none"}),o=e.label;return n.e=ie(t,r,n.e),o!==n.t&&(t.innerHTML=n.t=o),n}),{e:void 0,t:void 0}),t}})}ne(["click"]);var cn=te('<svg width=24 height=24 viewBox="0 0 16 16"xmlns=http://www.w3.org/2000/svg fill=#3B82F6><circle cx=2.5 cy=8 r=1.5></circle><circle cx=8 cy=8 r=1.5></circle><circle cx=13.5 cy=8 r=1.5>');function dn(){return cn()}var un=te("<div data-testid=meatball-dropdown>"),gn=te('<div><button aria-label="More options">'),pn=te("<button>"),hn=te('<a target=_blank rel="noopener noreferrer">');const fn="settings";function mn(e,t){return Object.entries(t).reduce(((e,[t,n])=>e.replaceAll(t,n)),e)}function vn(e){const[t,n]=f(!1);let r;const o=e=>{r&&!e.composedPath().includes(r)&&n(!1)};v((()=>{if(!t())return;const e=setTimeout((()=>{document.addEventListener("click",o)}),0);w((()=>{clearTimeout(e),document.removeEventListener("click",o)}))})),w((()=>document.removeEventListener("click",o)));const i=y((()=>e.items.map(((t,n)=>({url:t,label:mn(e.labels[n]??"",e.substitutions??{})}))).filter((e=>!!e.label)))),a=async(t,r)=>{if(n(!1),t===fn)return Rt.trackEvent(at.checkoutPopupMenuItemClicked,{url:t,label:r}),void e.onSuppressClick();let o=e.substitutions??{};if(t.includes("$url")&&e.getActivationUrl){const t=await e.getActivationUrl();o={...o,$url:encodeURIComponent(t)}}const i=mn(t,o);(function(e){try{const{protocol:t}=new URL(e);return"http:"===t||"https:"===t}catch{return!1}})(i)&&(Rt.trackEvent(at.checkoutPopupMenuItemClicked,{url:i,label:r}),window.open(i,"_blank","noopener,noreferrer"))};return s=gn(),l=s.firstChild,"function"==typeof r?ae(r,s):r=s,l.$$click=e=>{e.stopPropagation(),n((e=>!e))},se(l,B(dn,{})),se(s,B(X,{get when(){return t()},get children(){var t=un();return se(t,B(Y,{get each(){return i()},children:(t,n)=>{const r=t.url===fn,o=t.url.includes("$url"),s={...Xe,...n()<i().length-1?{"border-bottom":"1px solid #e5e7eb"}:{}};return B(X,{when:r||o,get fallback(){return(n=hn()).$$click=e=>{e.preventDefault(),a(t.url,t.label)},m((r=>{var o=mn(t.url,e.substitutions??{}),i=s,a=t.label;return o!==r.e&&re(n,"href",r.e=o),r.t=ie(n,i,r.t),a!==r.a&&(n.innerHTML=r.a=a),r}),{e:void 0,t:void 0,a:void 0}),n;var n},get children(){var e=pn();return e.$$click=()=>{a(t.url,t.label)},m((n=>{var r={border:"none",background:"none",width:"100%","text-align":"left",...s},o=t.label;return n.e=ie(e,r,n.e),o!==n.t&&(e.innerHTML=n.t=o),n}),{e:void 0,t:void 0}),e}})}})),m((e=>ie(t,Ye,e))),t}}),null),m((e=>{var n=Ve,r=Ke,o=t();return e.e=ie(s,n,e.e),e.t=ie(l,r,e.t),o!==e.a&&re(l,"aria-expanded",e.a=o),e}),{e:void 0,t:void 0,a:void 0}),s;var s,l}ne(["click"]);const yn=async(e,t,n,r,o,i=!0)=>{e.debug("Activating offer",{activeDomain:t,selectedCharity:r});try{const a=await ft({type:wt,payload:{activeDomain:t,originalUrl:n,selectedCharity:r,gfCommissionUniqueId:o,openTab:i}});return e.debug("Activate offer response",{response:a}),a}catch(n){return e.error("Failed to activate offer",{activeDomain:t,error:n}),{type:wt,payload:{response:!1}}}};var xn=te("<div>"),bn=te("<span><span>"),An=te('<a class=give-freely-footer-link target=_blank rel="noopener noreferrer"><span>'),wn=te("<span data-testid=dismiss-link>"),Cn=te("<span>"),kn=te("<div><span>"),Pn=te("<div><div><div></div><div></div></div><div></div><div></div><div></div><div><div>"),Sn=te("<div><div><img><div style=flex:1;display:flex;align-items:center;justify-content:center;><div></div></div></div><button><span>");function Tn(e){const t=zt(),n=(()=>{const e=C(jt)();if(!e)throw new Error("Content provider context is undefined");return t=>e.translateArray(t)})(),r=Zt(),o=async()=>{const t=e.selectedCharity?.charity,n=await yn(e.logger,e.activeDomain,window.location.href,{ein:t?.ein??It.ein,thirdPartyId:t?.tpi??It.tpi},crypto.randomUUID(),!1);return n.payload.response&&n.payload.activationLink?n.payload.activationLink:window.location.href};return i=Pn(),l=(s=(a=i.firstChild).firstChild).nextSibling,c=a.nextSibling,d=c.nextSibling,u=d.nextSibling,g=u.nextSibling,p=g.firstChild,se(s,B(ln,{get action(){return e.checkoutPopupConf.topLeftAction},get label(){return t("main.topLeftActionString")},get isCharitySelected(){return e.isCharitySelected},get onClose(){return e.onClose},get onCharityClick(){return e.onCharityClick}})),l.style.setProperty("display","flex"),l.style.setProperty("align-items","center"),l.style.setProperty("gap","8px"),se(l,B(X,{get when(){return(e.checkoutPopupConf.meatBallMenu?.length??0)>0},get children(){return B(vn,{get items(){return e.checkoutPopupConf.meatBallMenu},get labels(){return n("meatBallMenuLabels")},get onSuppressClick(){return e.onSuppressClick},get substitutions(){return{$partner:e.checkoutPopupConf.displayName??"",$storename:e.activeDomain.merchantName??"",$activedomainid:String(e.activeDomain.id??""),$activedomainhost:e.activeDomain.domain??"",$providerid:e.activeDomain.provider??""}},getActivationUrl:o})}}),null),se(l,B(ln,{get action(){return e.checkoutPopupConf.topRightAction},get label(){return t("main.topRightActionString")},get isCharitySelected(){return e.isCharitySelected},get onClose(){return e.onClose},get onCharityClick(){return e.onCharityClick}}),null),se(c,B(Gt,{get activeDomain(){return e.activeDomain},get title(){return t("main.title.v3")}})),se(d,B(Gt,{get activeDomain(){return e.activeDomain},get title(){return t("main.subTitle.v3")}})),se(u,(()=>r().slice(0,4).reduce(((n,r)=>{var o,i,a,s,l,c,d;return r?.title&&""!==r?.title?n.push((a=(i=Sn()).firstChild,s=a.firstChild,l=s.nextSibling.firstChild,c=a.nextSibling,d=c.firstChild,i.$$click=()=>!e.isCharitySelected&&e.onCharityClick(r),se(i,(o=y((()=>!!(r.decorator&&r.decoratorLeftStyle&&r.decoratorRightStyle))),()=>{return o()&&[(t=xn(),m((e=>{var n=r.decoratorLeftStyle,o=r.decorator;return e.e=ie(t,n,e.e),o!==e.t&&(t.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),t),(e=xn(),m((t=>{var n=r.decoratorRightStyle,o=r.decorator;return t.e=ie(e,n,t.e),o!==t.t&&(e.innerHTML=t.t=o),t}),{e:void 0,t:void 0}),e)];var e,t}),a),a.style.setProperty("text-align","center"),a.style.setProperty("display","flex"),a.style.setProperty("flex-direction","column"),a.style.setProperty("align-items","center"),a.style.setProperty("gap","7px"),a.style.setProperty("flex-grow","1"),m((n=>{var o=Ut(e.isCharitySelected,Je,{cursor:"default"}),a=r.logo,u=Pe,g=r.title,p=r.title,h=Ut(e.isCharitySelected,{...Qe,"background-color":e.checkoutPopupConf?.checkoutPopupSelectCharityButtonBgColor||"#2563EB"},ke),f=e.isCharitySelected,m=`Select charity: ${r.title}`,v=t("main.charitySelect");return n.e=ie(i,o,n.e),a!==n.t&&re(s,"src",n.t=a),n.a=ie(s,u,n.a),g!==n.o&&re(s,"alt",n.o=g),p!==n.i&&(l.innerHTML=n.i=p),n.n=ie(c,h,n.n),f!==n.s&&(c.disabled=n.s=f),m!==n.h&&re(c,"aria-label",n.h=m),v!==n.r&&(d.innerHTML=n.r=v),n}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),i)):e.logger.error(`Translation was not found for EIN ${r?.ein}`),n}),[]))),se(i,B(X,{get when(){return!e.checkoutPopupConf.donationStatsOff},get children(){var n=xn();return n.style.setProperty("margin-bottom","25px"),n.style.setProperty("text-align","center"),se(n,B(X,{get when(){return e.gfData},children:e=>{return n=Cn(),m((()=>n.innerHTML=function(e,t,n){return e.replace("{0}",function(e){return`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`}(t)).replace("{1}",function(e){if(!e)return"";let t;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[n,r,o]=e.split("-").map(Number);t=new Date(n,r-1,o)}else t=new Date(e);const n=new Intl.DateTimeFormat("en-US",{month:"short"}).format(t),r=t.getDate(),o=t.getFullYear();return`${n} ${r}${function(e){const t=e%100;if(t>=11&&t<=13)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(r)}, ${o}`}(n))}(t("main.donationStats"),e().totalDonationsAmount,e().calculationDate))),n;var n}})),m((t=>null!=(t=null!==e.gfData?"visible":"hidden")?n.style.setProperty("visibility",t):n.style.removeProperty("visibility"))),n}}),g),se(p,B(X,{get when(){return!!t("main.offerDetails")},get children(){var n=bn(),r=n.firstChild;return n.$$click=()=>e.onOfferDetailsClickInternal(),m((e=>{var o=rt,i=t("main.offerDetails");return e.e=ie(n,o,e.e),i!==e.t&&(r.innerHTML=e.t=i),e}),{e:void 0,t:void 0}),n}}),null),se(p,B(X,{get when(){return!!t("main.whyAmISeeingThis")},get children(){var n=An(),r=n.firstChild;return oe(n,"click",e.onWhyAmISeeingThisClick),m((o=>{var i=rt,a=e.checkoutPopupConf.externalUrls.giveFreelyWhyAmISeeingThis,s=t("main.whyAmISeeingThis");return o.e=ie(n,i,o.e),a!==o.t&&re(n,"href",o.t=a),s!==o.a&&(r.innerHTML=o.a=s),o}),{e:void 0,t:void 0,a:void 0}),n}}),null),se(p,B(X,{get when(){return e.checkoutPopupConf.dismissVisible},get children(){var n=wn();return n.$$click=()=>e.onDismissClick(),m((e=>{var r=rt,o=t("main.dismiss");return e.e=ie(n,r,e.e),o!==e.t&&(n.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),n}}),null),se(p,B(X,{get when(){return!!t("main.settings.v3")},get children(){var n=Cn();return n.$$click=()=>e.onSuppressClick(),m((e=>{var r=rt,o=t("main.settings.v3");return e.e=ie(n,r,e.e),o!==e.t&&(n.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),n}}),null),se(g,B(X,{get when(){return y((()=>!!e.checkoutPopupConf.checkoutPopupDisplayNameInFooter))()&&!!t("main.footer")},get children(){var e=kn(),n=e.firstChild;return m((r=>{var o={...$e,"text-align":"center",margin:"0",padding:"4px 0 8px 0"},i=t("main.footer");return r.e=ie(e,o,r.e),i!==r.t&&(n.innerHTML=r.t=i),r}),{e:void 0,t:void 0}),e}}),null),se(g,B(X,{get when(){return e.detailsDisplayed},get children(){var t=kn(),n=t.firstChild;return t.style.setProperty("position","relative"),se(t,B(Xt,{get merchantName(){return e.activeDomain.merchantName},get extensionName(){return e.checkoutPopupConf.displayName},get termsUrl(){return e.checkoutPopupConf.externalUrls.giveFreelyTermsAndConditions},get parsedMaxRate(){return _t(e.activeDomain.commission.kind,e.activeDomain.commission.amount.toString())},get merchantRateDetail(){return e.merchantRates},get additionalHtml(){return e.checkoutPopupConf.checkoutPopupOfferDetailsAdditionalHtml},onClose:()=>e.onOfferDetailsClose()}),null),m((t=>ie(n,{...nt,"background-color":Jt(e.activeDomain.provider),position:"absolute",top:"10px",right:"10px"},t))),t}}),null),m((e=>{var t=fe,n=je,r=ze,o=We,s=Ze,l=et,h=tt;return e.e=ie(i,t,e.e),e.t=ie(a,n,e.t),e.a=ie(c,r,e.a),e.o=ie(d,o,e.o),e.i=ie(u,s,e.i),e.n=ie(g,l,e.n),e.s=ie(p,h,e.s),e}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i;var i,a,s,l,c,d,u,g,p}function En(e){const[t,n]=f(!1),[r,o]=f(null),[i,a]=f(null);"v2"===e.checkoutPopupConf.checkoutPopupDesignVersion&&async function(){try{const e=await ht({type:Et,payload:{}});return e?.payload?.data??null}catch{return null}}().then(a);const s=()=>{const t=!!e.checkoutPopupConf.containerStyle?.backdropColor||!!e.checkoutPopupConf.containerStyle?.showAsModal,n=e.checkoutPopupConf.containerStyle?.clickAction??"hide-opacity";t&&"ignore"!==n&&("donate"===n?u(It,!0):e.setBackdropHidden(!0))},l=t=>{const n=!!e.checkoutPopupConf.containerStyle?.backdropColor||!!e.checkoutPopupConf.containerStyle?.showAsModal,r=e.checkoutPopupConf.containerStyle?.clickAction??"hide-opacity";n&&"donate"===r&&t.stopPropagation()};v((()=>{window.addEventListener("click",s),e.mainContainerRef?.addEventListener("click",l),w((()=>{setTimeout((()=>{window.removeEventListener("click",s),e.mainContainerRef?.removeEventListener("click",l)}),500)}))})),v((()=>{t()&&e.dialogRef&&e.dialogRef.scroll({top:e.dialogRef.offsetHeight,behavior:"smooth"})})),v((()=>{const t=r();t&&Promise.resolve(e.onCharitySelect(t.charity,t.closeOnDonation?e.checkoutPopupConf.checkoutPopupActivateAndCloseSkipSuccess:void 0)).catch((t=>{e.logger.error("Error during charity selection",{error:t}),o(null)}))}));const c=()=>{Rt.trackEvent(at.checkoutPopupWhyAmISeeingThisClicked,{domain:globalThis.window.location.hostname})},d=()=>{e.onClose(),Rt.trackEvent(at.checkoutPopupFooterDismiss,{activeDomain:e.activeDomain.domain})},u=(e,t)=>o({charity:e,closeOnDonation:t}),g=()=>!!r()?.charity,p=()=>{const r=!t();e.onOfferDetailsClick(r),n(r)},h=()=>n(!1);return B(Z,{get fallback(){return B(an,V(e,{get detailsDisplayed(){return t()},setDetailsDisplayed:n,get selectedCharity(){return r()},setSelectedCharity:o,get isCharitySelected(){return g()},onCharityClick:u,onSuppressClick:()=>e.onSuppress(),onWhyAmISeeingThisClick:c,onOfferDetailsClickInternal:p,onOfferDetailsClose:h}))},get children(){return B(J,{get when(){return"v2"===e.checkoutPopupConf.checkoutPopupDesignVersion},get children(){return B(Tn,V(e,{get detailsDisplayed(){return t()},setDetailsDisplayed:n,get selectedCharity(){return r()},setSelectedCharity:o,get isCharitySelected(){return g()},onCharityClick:u,onSuppressClick:()=>e.onSuppress(),onWhyAmISeeingThisClick:c,onDismissClick:d,onOfferDetailsClickInternal:p,onOfferDetailsClose:h,get gfData(){return i()}}))}})}})}ne(["click"]);var Dn=te("<div><div></div><span></span><div>");function Ln(e){return n=(t=Dn()).firstChild,o=(r=n.nextSibling).nextSibling,t.style.setProperty("display","flex"),t.style.setProperty("align-items","center"),t.style.setProperty("gap","8px"),t.style.setProperty("margin","12px 0"),t.style.setProperty("color","#888"),t.style.setProperty("font-size","11px"),t.style.setProperty("letter-spacing","0.08em"),t.style.setProperty("font-weight","600"),n.style.setProperty("flex","1"),n.style.setProperty("border-top","1px solid #ddd"),o.style.setProperty("flex","1"),o.style.setProperty("border-top","1px solid #ddd"),m((()=>r.innerHTML=e.text)),t;var t,n,r,o}var On=te("<button class=give-freely-close-button aria-label=Close>×"),In=te("<label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=18250><span>"),Mn=te('<div><div><div><span></span></div></div><button class=give-freely-back-button aria-label="Back to charity selection"><span></span></button><button class=give-freely-today-button><span></span></button><div id=give-freely-goodbye-screen-options><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=7><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=30><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=90><span></span></label></div><div><button class=give-freely-submit-button><span>');function $n(e){const[t,n]=f(0),r=zt();return o=Mn(),i=o.firstChild,a=i.firstChild,s=a.firstChild,l=i.nextSibling,c=l.firstChild,d=l.nextSibling,u=d.firstChild,g=d.nextSibling,h=(p=g.firstChild).firstChild,v=h.nextSibling,x=(y=p.nextSibling).firstChild,b=x.nextSibling,w=(A=y.nextSibling).firstChild,C=w.nextSibling,k=g.nextSibling,P=k.firstChild,S=P.firstChild,o.style.setProperty("font-size","14px"),se(i,B(X,{get when(){return e.checkoutPopupConf.checkoutPopupSupressCloseButtonVisible},get children(){var t=On();return t.$$click=()=>e.onGoodbye(0),m((e=>ie(t,{...ye,"align-self":"flex-start"},e))),t}}),null),l.$$click=()=>e.onBack(),d.$$click=()=>{e.onGoodbye(1),e.setScreen("main")},se(o,B(Ln,{get text(){return r("suppress.chooseLongerPeriod")}}),g),h.addEventListener("change",(()=>n(7))),x.addEventListener("change",(()=>n(30))),w.addEventListener("change",(()=>n(90))),se(g,B(X,{get when(){return e.checkoutPopupConf.checkoutPopupNeverSuppressionAllowed},get children(){var e=In(),o=e.firstChild,i=o.nextSibling;return o.addEventListener("change",(()=>n(18250))),m((n=>{var o=Ut(18250===t(),De,Le),a=r("suppress.suppressionPeriodNever");return n.e=ie(e,o,n.e),a!==n.t&&(i.innerHTML=n.t=a),n}),{e:void 0,t:void 0}),e}}),null),k.style.setProperty("text-align","center"),k.style.setProperty("margin-top","10px"),P.$$click=()=>{const n=t();n&&(e.onGoodbye(n),e.setScreen("main"))},m((n=>{var o={...me,"flex-direction":"row"},h={...ve,"margin-top":"20px",..."v2"===e.checkoutPopupConf.checkoutPopupDesignVersion?{color:ze.color}:{}},f=r("suppress.title"),m=Ie,x=r("suppress.backButton"),w={...Te,"background-color":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},k=r("suppress.suppressionPeriodToday"),T=Ee,E=Ut(7===t(),De,Le),D=r("suppress.suppressionPeriodPlural").replace("{0}","7"),L=Ut(30===t(),De,Le),O=r("suppress.suppressionPeriodPlural").replace("{0}","30"),I=Ut(90===t(),De,Le),M=r("suppress.suppressionPeriodPlural").replace("{0}","90"),$=0===t(),N={...Se,"font-weight":"700","margin-top":"0px","margin-bottom":"0px",padding:"12px 0","background-color":0===t()?"#f8f8f8":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF",color:0===t()?"#ccc":"white",border:0===t()?"1px solid #e8e8e8":"0",width:"240px",cursor:0===t()?"not-allowed":"pointer"},H=r("suppress.submitButton");return n.e=ie(i,o,n.e),n.t=ie(a,h,n.t),f!==n.a&&(s.innerHTML=n.a=f),n.o=ie(l,m,n.o),x!==n.i&&(c.innerHTML=n.i=x),n.n=ie(d,w,n.n),k!==n.s&&(u.innerHTML=n.s=k),n.h=ie(g,T,n.h),n.r=ie(p,E,n.r),D!==n.d&&(v.innerHTML=n.d=D),n.l=ie(y,L,n.l),O!==n.u&&(b.innerHTML=n.u=O),n.c=ie(A,I,n.c),M!==n.w&&(C.innerHTML=n.w=M),$!==n.m&&(P.disabled=n.m=$),n.f=ie(P,N,n.f),H!==n.y&&(S.innerHTML=n.y=H),n}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0}),o;var o,i,a,s,l,c,d,u,g,p,h,v,y,x,b,A,w,C,k,P,S}ne(["click"]);var Nn=te("<div><p><span>"),Hn=te("<div><div><div><span></span></div><button class=give-freely-close-button aria-label=Close>×</button></div><hr><div><span>");function Rn(e){const[t,n]=f(null),r=zt();let o;return w((()=>clearInterval(o))),A((()=>{e.failedDonation||(()=>{const t=e.checkoutPopupConf.checkoutPopupDonationSuccessAutoCloseInSeconds??3;n(t),o=setInterval((()=>{n((t=>null===t||t<=1?(clearInterval(o),e.onClose(),0):t-1))}),1e3)})()})),i=Hn(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=s.nextSibling,d=a.nextSibling.nextSibling,u=d.firstChild,i.style.setProperty("font-size","14px"),c.$$click=()=>e.onClose(),d.style.setProperty("padding","30px"),d.style.setProperty("height","150px"),d.style.setProperty("font-size","14px"),se(i,B(X,{get when(){return!e.failedDonation},get children(){var e=Nn(),n=e.firstChild,o=n.firstChild;return m((e=>{var i=Oe,a=Wt.formatMessage(r("donate.autoClosing"),t()??0);return e.e=ie(n,i,e.e),a!==e.t&&(o.innerHTML=e.t=a),e}),{e:void 0,t:void 0}),e}}),null),m((t=>{var n={...me,"flex-direction":"row"},o={...ve,"margin-top":"20px",..."v2"===e.checkoutPopupConf.checkoutPopupDesignVersion?{color:ze.color}:{}},i=e.failedDonation?r("donate.failTitle"):r("donate.title"),d={...ye,"align-self":"flex-start"},g=e.failedDonation?r("donate.failContent"):r("donate.content");return t.e=ie(a,n,t.e),t.t=ie(s,o,t.t),i!==t.a&&(l.innerHTML=t.a=i),t.o=ie(c,d,t.o),g!==t.i&&(u.innerHTML=t.i=g),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i;var i,a,s,l,c,d,u}ne(["click"]);var Un=te("<dialog popover=manual><div>");function _n(e){const[t,n]=f("main"),[r,o]=f(),[i,a]=f(!1),[s,l]=f(!1);let c;A((()=>{if(c)try{e.checkoutPopupConf.containerStyle?.showAsModal?c.showModal():c.showPopover(),c.focus(),c.blur()}catch(t){e.logger.error("Failed to show popup",{error:t})}}));const d=()=>{e.logger.debug("Close button clicked"),e.onClose()},u=async(t,r=!1)=>{r&&e.onClose(),e.logger.info("Charity selected",{charity:t,domain:e.activeDomain.domain}),o(t);try{const o=await e.onDonate(t,e.activeDomain);if(r)return;a(!o),n("donate")}catch(t){e.logger.error("Error during donation activation",{error:t,domain:e.activeDomain.domain}),r||(a(!0),n("donate"))}},g=()=>{e.logger.debug("Suppress button clicked"),n("goodbye")},p=()=>{e.logger.debug("Navigating back to main screen"),n("main")},h=t=>{e.logger.info("User chose to hide popup",{days:t}),e.onClose(t)};let v;return y=Un(),x=y.firstChild,"function"==typeof c?ae(c,y):c=y,"function"==typeof v?ae(v,x):v=x,se(x,B(X,{get when(){return"main"===t()},get children(){return B(En,{setBackdropHidden:l,mainContainerRef:v,dialogRef:c,get checkoutPopupConf(){return e.checkoutPopupConf},get activeDomain(){return e.activeDomain},get merchantRates(){return e.merchantRates},onClose:d,onCharitySelect:u,onSuppress:g,get onOfferDetailsClick(){return e.onOfferDetailsClick},get logger(){return e.logger}})}}),null),se(x,B(X,{get when(){return"goodbye"===t()},get children(){return B($n,{get checkoutPopupConf(){return e.checkoutPopupConf},onClose:()=>e.onClose(),onBack:p,onGoodbye:h,setScreen:n})}}),null),se(x,B(X,{get when(){return"donate"===t()},get children(){return B(Rn,{get checkoutPopupConf(){return e.checkoutPopupConf},get selectedCharity(){return r()},onClose:()=>e.onClose(),get failedDonation(){return i()},setScreen:n})}}),null),m((t=>{var n,r,o=s()?"backdrop-hidden":"",i={...pe,...e.checkoutPopupConf.containerStyle?.customStyle??{}},a=e.elementId,l={...he,..."v2"===e.checkoutPopupConf.checkoutPopupDesignVersion?{"overflow-x":"visible","overflow-y":"visible"}:{}};return o!==t.e&&(n=y,null==(r=t.e=o)?n.removeAttribute("class"):n.className=r),t.t=ie(y,i,t.t),a!==t.a&&re(y,"id",t.a=a),t.o=ie(x,l,t.o),t}),{e:void 0,t:void 0,a:void 0,o:void 0}),y;var y,x}function Fn(e){const t=["",".asp",".aspx",".php",".js",".htm",".html"],n=["cart","checkout","shopping-bag","shopping-basket","shopping-cart","basket"].flatMap((e=>t.map((t=>e+t)))).filter((e=>"basket"!==e)),r=["tote-cart","tote.cart"],o=e,i=n.filter((e=>o.includes(e))),a=o.split("/");return!a.some((e=>r.some((t=>e.includes(t)))))&&(a.some((e=>n.some((t=>e.startsWith(t)||e.endsWith(t)))))||"basket"===a[a.length-1].toLowerCase()||i.length>1||1===i.length&&o.includes("shopping"))}function Gn(e,t){const n=["book"];return e.split("/").some((e=>n.some((t=>e.startsWith(t)||e.endsWith(t)))))&&null!=t.evaluate("//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6][contains(., 'Your Reservation') or contains(., 'Your reservation')]",t,null,XPathResult.ANY_TYPE,null)?.iterateNext()}async function Bn(e){try{const t=await ht({type:kt,payload:{shopId:e}});return t.payload.found&&t.payload.domain?t.payload.domain:null}catch{return null}}function jn(e){try{const e=Array.from(document.querySelectorAll("script"));for(const t of e){if(t.dataset?.shopId&&(t.dataset?.shopId?.startsWith("gid")||t.src.includes("shopify"))){const e=parseInt(t.dataset.shopId.replace("gid://shopify/Shop/",""));if(!Number.isNaN(e)&&e>0)return e}const e=t.textContent||"";if(e.includes("ShopifyAnalytics")&&e.includes("shopId")){const t=e.match(/shopId['"]*:\s*['"]*(\d+)['"]*[,}]/);if(t&&t[1]){const e=parseInt(t[1]);if(!Number.isNaN(e)&&e>0)return e}}}const t=document.querySelector("[data-shop-id]");if(t instanceof HTMLElement){const{shopId:e}=t.dataset;if(e){const t=parseInt(e);if(!Number.isNaN(t)&&t>0)return t}}const n=window?.ShopifyAnalytics?.lib?.trekkie?.defaultAttributes?.shopId;return n&&parseInt(n)||0}catch(t){return e.error("Error accessing ShopifyAnalytics:",t),0}}function zn(){try{if(!window.location.href.startsWith("https://shop.app"))return 0;const e=document?.head?.querySelector('meta[name="store"][content]');if(!e)return 0;try{const t=JSON.parse(e.content);return t?.id||0}catch{return 0}}catch{return 0}}const Wn=dt.getInstance();function qn(e,t,n){try{Wn.debug("Checking merchant regex rules",{currentUrl:t});const r=e.merchantPopupRules.filter((e=>n===e.domain||n.endsWith(`.${e.domain}`)));if(0===r.length)return Wn.debug("No matching merchant rules found for domain",{currentUrl:t}),!1;for(const e of r)for(const n of e.rules)try{if(new RegExp(n.rule).test(t))return Wn.debug("Merchant regex rule matched",{merchant:e.name,rule:n.rule,currentUrl:t}),!0}catch(t){Wn.error("Invalid regex in merchant rule",{merchant:e.name,rule:n.rule,error:t})}return Wn.debug("No matching regex rules found",{currentUrl:t}),!1}catch(e){return Wn.error("Error in merchantRegexRule",e),!1}}function Vn(e){if(e?.customLanguageDetection&&e.customLanguageDetection.length>0){const t=window.location.href,n=document.body.textContent?.toLowerCase()||"";for(const r of e.customLanguageDetection)try{if(new RegExp(r.urlPattern).test(t))for(const[e,t]of Object.entries(r.keywords))if(n.includes(e.toLowerCase()))return t}catch(e){dt.getInstance().warn(`Invalid regex pattern in customLanguageDetection: ${r.urlPattern}`,e)}}const t=document.documentElement.lang,n=document.querySelector('meta[http-equiv="Content-Language"]')?.content,r=document.querySelector('link[rel="alternate"][hreflang]')?.getAttribute("hreflang"),o=navigator.language,i=t||n||r||o||"en";return"string"==typeof i?i.split("-")[0]:"en"}function Kn(e){return!0!==e.checkoutPopupOnlyShowLanguageMatch||"en"===Vn(e)}const Yn=(e,t=!1)=>e.length<2&&t?null:Array.from(e).filter((e=>!t||e.dataset.extensionId!==browser.runtime.id)).map((e=>e.dataset.extensionName)).join(",");const Xn=e=>{const t=y((()=>({translate:e.translate()||(e=>""),translateArray:e.translateArray()||(e=>[]),getAllCharities:e.charities()||(()=>[])})));return B(Bt.Provider,{value:t,get children(){return e.children}})},Zn=dt.getInstance(),Jn=e=>/^https?:\/\/(?:www\.)?google\.[a-z]{2,}(\.[a-z]{2})?\/search\?(?:.*&)?q=[^&]+(?:&.*)?$/.test(e),Qn='.yuRUbf a, .MjjYud a, a[jsname="UWckNb"], a[data-pcu]',er=e=>{const t=null!==e.querySelector('[data-text-ad="1"]'),n=e.querySelector('span:not(.a-no-hover-link):is(:where(*, [role="text"]))'),r=n&&(n.textContent?.includes("Sponsored")||n.textContent?.includes("Ad"));return t||(r??!1)},tr=async(e,t,n,r)=>{const{translations:o,charities:i}=await async function(e,t,n){try{t&&t.debug("Getting language content",{languageCode:e});const r=await ht({type:Pt,payload:{lang:e,activeDomain:n}});return{translations:r.payload.translations,charities:r.payload.charities}}catch(n){return t&&t.error("Error getting language content",{error:n,languageCode:e}),{translations:null,charities:null}}}(n,e,r);return{translate:e=>{const t=o?.[e];return"string"==typeof t?t:""},translateArray:e=>{const t=o?.[e];return Array.isArray(t)?t:[]},getAllCharities:()=>Object.entries(t).map((([e,t])=>{const{ein:n}=t;try{const r=i?.[n];if(!r)throw new Error(`Failed to find charity metadata for ein ${n}`);return{ein:n,tpi:r.tpi,title:r.title,order:parseInt(e,10),logo:r.logo,decorator:t.decorator,decoratorLeftStyle:t.decoratorLeftStyle,decoratorRightStyle:t.decoratorRightStyle}}catch{return{ein:n,tpi:"",title:"",order:9,logo:""}}}))}};var nr=te("<span> Loading...");const rr=3e5,or=async()=>await Nt.get(Ot)??{};var ir=te('<div><div><div></div><div><small><a target=_blank rel="noreferrer noopener"></a><br><a href=#></a></small></div></div><div><div><div><a><div><div></div><div><span></span><span></span></div></div></a></div><a><h3></h3></a></div><div>');const ar=(sr=function(e){let t;const[n,r]=f(!1),o=zt(),i={boxContainer:{"max-width":"700px",margin:"20px 0px",padding:"0px",border:(a=(()=>{if("undefined"==typeof window)return!1;if(!document.body)return!1;const e=document.body,t=window.getComputedStyle(e).backgroundColor.match(/\d+/g);if(!t||t.length<3)return window.matchMedia("(prefers-color-scheme: dark)").matches;const[n,r,o]=t.map(Number);return.299*n+.587*r+.114*o<128})())?"1.5px solid #b59410":"1.5px solid #fce68a","border-radius":"5px"},link:{color:a?"#99C3FF":"#1A0DAA"},boxHeader:{display:"flex","background-color":a?"#4a3d05":"#fffbea","border-bottom":a?"1.5px solid #b59410":"1.5px solid #fce68a",padding:"7px","border-radius":"5px 5px 0px 0px","align-items":"center",gap:"10px"},boxHeaderOptions:{"margin-left":"auto","white-space":"nowrap","font-size":"12px","padding-top":"2px"},siteName:{color:a?"#dadce0":"#202124","font-size":"14px",display:"block","line-height":"20px","white-space":"nowrap","text-overflow":"ellipsis",width:"auto"},imgContainer:{"background-color":"transparent","border-radius":"50%",display:"inline-flex","justify-content":"center","align-items":"center",height:"26px",width:"26px","margin-right":"12px","vertical-align":"middle"},img:{height:"26px",width:"26px"},description:{margin:"7px 0px 0px",color:a?"#bfbfbf":"#4d5156","line-height":1.58,"font-size":"14px"},citation:{color:a?"#bdc1c6":"#4d5156","font-size":"12px"}};var a;let s=!1;const l=async(t,n)=>{if("click"===t.type){if(t.preventDefault(),s)return;s=!0}const r=e.domainData.shouldStandDown&&!e.domainData.currentlyActivated,o=[];r||o.push((async e=>{try{const t=await or();t[e]=Date.now(),await Nt.set(Ot,t)}catch{}})(parseInt(e.domainData.activeDomain.merchantId))),e.serpLoggingEnabled&&o.push(Rt.trackEvent(at.checkoutPopupGooglePartnerAnnClicked,{url:globalThis.window.location.href,activeDomain:e.domainData.activeDomain.domain,isLinkWithNoActivation:r,clickEvent:t.type})),"click"===t.type&&(await Promise.all(o).catch((()=>{})),window.location.assign(n)),"contextmenu"===t.type&&Promise.all(o)},c=async e=>{const n=e.target.closest("a");n&&t?.contains(n)&&await l(e,n.href)};return d=ir(),u=d.firstChild,g=u.firstChild,p=g.nextSibling,h=p.firstChild.firstChild,v=h.nextSibling.nextSibling,b=(x=(y=u.nextSibling).firstChild).firstChild,w=(A=b.firstChild).firstChild,k=(C=w.firstChild).nextSibling,P=k.firstChild,S=P.nextSibling,E=(T=b.nextSibling).firstChild,D=x.nextSibling,g.style.setProperty("font-size","14px"),v.$$click=t=>{t.preventDefault(),pr(),e.serpLoggingEnabled&&Rt.trackEvent(at.checkoutPopupGooglePartnerAnnHidden,{url:globalThis.window.location.href,activeDomain:e.domainData.activeDomain.domain}),r(!0)},se(v,(()=>o("serpBanner.hide"))),y.style.setProperty("padding","10px"),x.style.setProperty("display","inline-flex"),x.style.setProperty("flex-direction","column"),x.style.setProperty("gap","10px"),A.$$contextmenu=t=>l(t,e.url),A.$$click=t=>l(t,e.url),A.style.setProperty("text-decoration","none"),w.style.setProperty("display","inline-flex"),w.style.setProperty("align-items","center"),k.style.setProperty("display","flex"),k.style.setProperty("flex-direction","column"),k.style.setProperty("gap","3px"),se(P,(()=>e.siteName)),se(S,(()=>e.citation)),T.$$contextmenu=t=>l(t,e.url),T.$$click=t=>l(t,e.url),E.style.setProperty("font-family","Google Sans, Roboto, Arial, sans-serif"),se(E,(()=>e.title)),D.$$contextmenu=c,D.$$click=c,"function"==typeof t?ae(t,D):t=D,m((t=>{var r={...i.boxContainer,display:n()?"none":"block"},a=i.boxHeader,s=lr(o("serpBanner.title"),e.siteName,e.domainData.activeDomain),l={...i.boxHeaderOptions,"text-align":"end"},c=i.link,f=e.learnMoreUrl,m=o("serpBanner.learnMore"),y=i.link,x=e.url,b=e.imgContents,w=i.siteName,k=i.citation,E=e.url,L=i.description,O=e.description||"";return t.e=ie(d,r,t.e),t.t=ie(u,a,t.t),s!==t.a&&(g.innerHTML=t.a=s),t.o=ie(p,l,t.o),t.i=ie(h,c,t.i),f!==t.n&&re(h,"href",t.n=f),m!==t.s&&(h.innerHTML=t.s=m),t.h=ie(v,y,t.h),x!==t.r&&re(A,"href",t.r=x),b!==t.d&&(C.innerHTML=t.d=b),t.l=ie(P,w,t.l),t.u=ie(S,k,t.u),E!==t.c&&re(T,"href",t.c=E),t.w=ie(D,L,t.w),O!==t.m&&(D.innerHTML=t.m=O),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0}),d;var d,u,g,p,h,v,y,x,b,A,w,C,k,P,S,T,E,D},e=>{const[t]=x((()=>({lang:e.currentLanguage,logger:e.logger,list:e.charitiesList,activeDomain:e.activeDomain})),(async e=>tr(e.logger,e.list,e.lang,e.activeDomain))),n=()=>t()?.translate,r=()=>t()?.translateArray,o=()=>t()?.getAllCharities;return B(X,{get when(){return!t.loading},get fallback(){return nr()},get children(){return B(Xn,{translate:n,translateArray:r,charities:o,get children(){return B(sr,e)}})}})});var sr;const lr=(e,t,n)=>e.replace("{0}",_t(n.commission.kind,n.commission.amount.toString())).replace("{1}",t??n.merchantName);ne(["click","contextmenu"]);const cr=async(e,t)=>{const n=((e=!0)=>{const t=((e=!0)=>{const t=Array.from(globalThis.window.document.querySelectorAll("#rso > div, #tads > div, #rso .MjjYud"));return e?t.filter((e=>!er(e))):t})(e),n=[];return t.forEach((e=>{const t=e.querySelector(Qn);if(t){let r=t.href;if(r&&r.includes("/url?q="))try{const e=new URLSearchParams(new URL(r).search).get("q");e&&(r=e)}catch{}r&&r.startsWith("http")&&n.push({url:r,container:e})}})),n})(),r=await dr(n.map((e=>e.url)));e&&Rt.trackEvent(at.checkoutPopupGoogleSearch,{url:globalThis.window.location.href,partnersFound:Object.entries(r).map((([e,t])=>({url:e,partner:t.activeDomain}))),isPartnerBoxMuted:t});const o=n.find((e=>r[e.url]));if(o){const e=(e=>{const t=e.querySelector("h3"),n=e.querySelector('.VuuXrf, span[role="text"]')?.innerText,r=e.querySelector("cite")?.textContent,o=e.querySelector(Qn),i=o?.querySelector("img")?.parentElement?.parentElement?.outerHTML,a=e.querySelector('.VwiC3b, .kb069e, div[style*="-webkit-line-clamp"]');return{title:t?.textContent?.trim()??null,siteName:n,citation:r,imgContents:i,description:a?.innerHTML?.trim()??null}})(o.container);return{...o,...e,domainData:r[o.url]}}return null},dr=async e=>{const{payload:t}=await ft({type:St,payload:{urls:e}});return t.result},ur=e=>!!e.partnerSerpBox?.enabled,gr=async()=>!!await Nt.get("gf_partner_serp_muted"),pr=async()=>{await ht({type:Tt,payload:{}})};function hr(e,t){const n={...e};for(const r of Object.keys(t)){const o=e[r],i=t[r];void 0!==i&&(Array.isArray(i)?n[r]=[...i]:n[r]=null!==i&&"object"==typeof i&&null!==o&&"object"==typeof o?hr(o,i):i)}return n}var fr=te("<div class=gf-app>");function mr(e){const[t,n]=f(void 0),[r,o]=f(!1),[i,a]=f([]),[s,l]=f(),[c,d]=f(e.popupConfig);let u,g,p;v((()=>{const n=t();if(n){e.logger.debug("Looking up config for active domain",n);const t=function(e,t,n){const r=e.providerOverrides?.[t.provider];if(!r)return e;const{siteOverrides:o,...i}=r;let a=hr(e,i);n?.debug("resolveForOffer: applied provider overrides",{provider:t.provider,providerFields:i});const s=o?.[t.domain];return s&&(a=hr(a,s),n?.debug("resolveForOffer: applied site overrides",{domain:t.domain,siteFields:s})),a}(e.popupConfig,n,e.logger);if(d(t),g=u?t.charities?.[u.toLowerCase()]??t.charities?.[Mt]:void 0,g){const r=Vn(t);tr(e.logger,g,r,n).then(l)}}})),A((async()=>{e.logger.info("Mounting GfApp component");try{(function(e){if(!e?.shouldCheckSiteMatches)return;let t;(e?.siteMatchesRegex??[]).some((e=>{var n;return n=window.location.href,!(!new RegExp(e).test(n)||(t=e,0))}))&&t&&Rt.trackEvent(at.checkoutPopupSiteMatches,{url:window.location.href,matchedRule:t,uts:Date.now()},!0)})(e.popupConfig),(async()=>{try{const e=await or();for(const t in e)e[t]&&Date.now()-e[t]>rr&&delete e[t];await Nt.set(Ot,e)}catch{}})(),u=await(async()=>await Nt.get(Dt)||(async()=>{Zn.debug("detecting country");const e={method:"GET",headers:{"Content-Type":"application/json",Authorization:"Basic OTEzOTkxOnFlYmpaWF9DOGNRY0lxSHA4WTVjNGxzU1pRSlM2VW9MMExzTF9tbWs="}};try{const t=await fetch("https://geoip.maxmind.com/geoip/v2.1/country/me",e);if(Zn.debug("Received geolocation response",{status:t.status}),!t.ok)return void Zn.error("Failed to get geolocation data",{status:t.status,statusText:t.statusText});const n=await t.json();if(!n)throw new Error("There was an error fetching geoip look up");return await Nt.set(Dt,n.country.iso_code),n.country.iso_code}catch(e){return void Zn.error("Failed to get geolocation data",{error:e},!0)}})())()??Mt;const i=e.popupConfig.charities?.[u.toLowerCase()]??e.popupConfig.charities?.[Mt];g=i,e.logger.debug("Charities for current country",{currentCountry:u,charities:i});const s=Vn(e.popupConfig);e.logger.debug("Setting content provider with translations and charity functions"),tr(e.logger,i,s).then(l);const c=Ht();if(e.popupConfig.minVersion&&((e,t)=>{if(e===t)return!1;const n=e.split(".").map((e=>parseInt(e,10))),r=t.split(".").map((e=>parseInt(e,10)));for(let e=0;e<n.length;e++){if(n[e]<r[e])return!0;if(n[e]>r[e])return!1}return!1})(c,e.popupConfig.minVersion))return void e.logger.debug(`Current version: ${c}. Minimum version ${e.popupConfig.minVersion} not met`);if(!1===e.popupConfig.checkoutPopupMasterSwitch)return void e.logger.debug("Checkout popup master switch is disabled");const d=document.getElementsByClassName("give-freely-root");let h=!1;if(d.length>1&&(e.logger.debug("There is more than one gf extension installed"),d.item(0).dataset.extensionId!==browser.runtime.id&&(e.logger.debug("Giving preference to the first gf extension injected in the DOM"),h=!0),e.logger.debug("Providing this extension preference over the other installed extensions")),!h&&Jn(window.location.href)&&(e.logger.debug("This is a google search result page."),(async(e,t,n,r)=>{if(ur(r)){const o=await gr(),i=!!r.enhancedLogging;e.debug("Serp partner box enabled. Looking for partner in search results");const a=await cr(i,o);if(!o&&a&&r.partnerSerpBox?.learnMoreUrl)return void((e=>{const t=document.querySelector('div[data-subtree="mfc"], .fG8Fp'),n=document.getElementById("atvcap")??document.getElementById("tads")??document.getElementById("search");return t?(t.insertAdjacentElement("afterend",e),!0):!!n&&(n.prepend(e),!0)})((e=>{const t=document.createElement("div");return ee((()=>B(ar,V(e,{get activeDomain(){return e.domainData.activeDomain}}))),t),t})({...a,currentLanguage:n,logger:e,learnMoreUrl:r.partnerSerpBox?.learnMoreUrl,charitiesList:t,serpLoggingEnabled:i}))?(e.info("Partner found and banner injected"),i&&Rt.trackEvent(at.checkoutPopupGooglePartnerAnnCreated,{url:globalThis.window.location.href,activeDomain:a.domainData.activeDomain})):e.warn("Partner found but banner couldn't be injected"));e.info("Couldn't find partners in search results")}})(e.logger,i,s,e.popupConfig)),!1===e.popupConfig.popupEnabled)return void e.logger.debug("Popup is disabled.");const{domain:f}=await(async e=>{const{hostname:t}=window.location;e.debug("Checking if domain is active",{hostname:t});const n=await ht({type:xt,payload:{hostname:t}});return n.payload.isActive?(e.debug("Active domain",{domain:n.payload.domain}),e.info("Domain and rates ({})ed successfully."),{isActive:!0,domain:n.payload.domain}):{isActive:!1,domain:void 0}})(e.logger);if(f&&a(f.rates),n(f),f)a(f.rates),await function(e,t){const n=jn(t)||zn();return n>0&&function(e,t,n){if(e&&!(e<=0))try{ht({type:Ct,payload:{shopId:e,domain:t}}).catch((e=>{n.error("Error sending shop ID to background:",e)}))}catch(e){n.error("Error sending Shopify shop ID:",e)}}(n,e,t),n}(f,e.logger);else{if("shop.app"!==window.location.hostname&&!window.location.hostname.endsWith(".shop.app"))return void o(!1);const t=window.location.pathname.split("/")[2];if(!t)return e.logger.error("Shop ID not found"),void o(!1);const r=await Bn(parseInt(t));if(!r)return e.logger.error("Shop domain not found"),void o(!1);e.logger.debug("Shop domain found",{shopDomain:r}),n(r)}const m=await(async e=>{const t=await Nt.get("popup_hide");if(!t)return e.debug("No expiry found in storage"),!1;const{popupHide:n}=t,r=!!n&&Date.now()<n;return e.debug("Is Donation Popup Muted?",{isMuted:r,expiry:n}),r})(e.logger);if(m)return;if(!t())return void o(!1);const{result:v,reason:y}=await(async(e,t)=>{const n=window.location.href,r=document.cookie,{payload:o}=await ht({type:At,payload:{activeDomain:t,url:n,cookies:r}});return o.result&&e.info("Stand Down detected"),o})(e.logger,t());if(v)return o(!1),void(y&&e.popupConfig.enhancedLogging&&Rt.trackEvent(at.checkoutPopupStoodDown,{reason:y,domain:t()?.domain}));const x=e.popupConfig?.anonymousActiveDomainLogging??!1,b=t()??void 0;b&&x&&!function(e){const t=`gfhv-${e}`;return!!sessionStorage.getItem(t)||(sessionStorage.setItem(t,"true"),!1)}(b.domain)&&Rt.trackEvent(at.checkoutPopupActiveDomain,{url:b.domain}),p=window.setInterval((async()=>{let t=!1;return b&&(e.logger.debug("Checking if we should popup anywhere"),t=await(async e=>{try{const t=await or();if(t[e])return Date.now()-t[e]<rr}catch{}return!1})(parseInt(b.merchantId)),e.logger.debug("We should popup anywhere",t)),t||(e.logger.debug("Checking checkout rules"),t=await(async e=>{const t=dt.getInstance();t.configure({enabled:!0,title:"Content - checkoutRulesTest"});const n=new URL(globalThis.location.href),r=n.href,{hostname:o}=n;t.debug("Checking if popup should be shown",{currentUrl:r});const i=await async function(e){const t=jn(e)||zn();return!("shop.app"!==window.location.hostname&&!window.location.hostname.endsWith(".shop.app")||!(t>0)||!await Bn(t))}(t),a=Kn(e)&&(Fn(n.pathname.toLowerCase())||Gn(r,document)||qn(e,r,o)||i);return t.debug("Popup show decision based on rules",{shouldShow:a,matchesCartRule:Fn(n.pathname.toLowerCase()),matchesBookingRule:Gn(r,document),matchesShopPayRule:i,matchesMerchantRegexRule:qn(e,r,o),matchesLanguageRule:Kn(e)}),a})(e.popupConfig),e.logger.debug("Should show popup based on checkout rules",{shouldShowResult:t})),t&&h?(Rt.trackEvent(at.checkoutPopupLooserExtension,{url:globalThis.window.location.href,winner:d.item(0).dataset.extensionName}),e.logger.debug("Standing down because, another GiveFreely extension will pop"),void clearInterval(p)):t&&globalThis.window.matchMedia("(max-width: 600px), (max-height: 480px)").matches?(e.logger.debug("Viewport too small for displaying the popup"),r()&&Rt.trackEvent(at.checkoutPopupHiddenProgrammatically,{url:globalThis.window.location.href,merchantId:b?.merchantId,reason:"Viewport size became too small"}),o(!1),void Rt.trackEvent(at.checkoutPopupNotShownPerViewportSize,{url:globalThis.window.location.href,pageLanguage:s,merchantId:b?.merchantId,viewPortSize:{height:globalThis.window.innerHeight,width:globalThis.window.innerWidth}})):(t&&!r()&&Rt.trackEvent(at.checkoutPopupShown,{url:globalThis.window.location.href,pageLanguage:s,merchantId:b?.merchantId,domainId:b?.id,provider:b?.provider,looserCompetingExtensions:Yn(d,!0)}),!t&&r()&&Rt.trackEvent(at.checkoutPopupHiddenProgrammatically,{url:globalThis.window.location.href,merchantId:b?.merchantId,domainId:b?.id,reason:"Checkout rules no longer matched"}),void o(t))}),2e3)}catch(t){o(!1),e.logger.error("An error occurred in GfApp",{error:t})}})),w((()=>{p&&window.clearInterval(p)}));const h=async(t,n)=>{e.logger.info("Processing donation",{charity:t,domain:n.domain});const r=crypto.randomUUID(),o=await yn(e.logger,n,window.location.href,{ein:t.ein,thirdPartyId:t.tpi},r);return e.logger.debug("Activate offer response",{activationResponse:o}),Rt.trackEvent(o.payload.response?at.checkoutPopupDonation:at.checkoutPopupFailedActivation,{activeDomain:n.domain,url:globalThis.window.location.href,merchantId:n?.merchantId,domainId:n?.id,provider:n?.provider,charity:{ein:t.ein,tpi:t.tpi},rate:n.commission,gfCommissionUniqueId:r}),o.payload.response},m=async n=>{o(await(async(e,t)=>{try{e.info("Hiding popup",{days:t});const n=await ft({type:vt,payload:{days:t??0}});return void 0!==t&&Rt.trackEvent(at.checkoutPopupSupressed,{url:globalThis.window.location.href,days:t}),e.info("Hiding popup response",{hideResponse:n}),n.payload.ack?(e.debug("Popup hidden successfully"),!1):(e.warn("Failed to hide popup"),!0)}catch{return!1}})(e.logger,n)),p&&window.clearInterval(p),t()&&(async e=>{try{const t=await or();t[e]&&delete t[e],await Nt.set(Ot,t)}catch{}})(parseInt(t().merchantId))},x=async e=>{Rt.trackEvent(at.checkoutPopupOfferDetailsClicked,{action:e?"opened":"closed"})};return B(Xn,{translate:()=>s()?.translate,translateArray:()=>s()?.translateArray,charities:()=>s()?.getAllCharities,get children(){var n,o=fr();return se(o,(n=y((()=>!(!t()||!r()))),()=>n()&&B(_n,{get checkoutPopupConf(){return c()},elementId:"give-freely-checkout-popup",get activeDomain(){return t()},get merchantRates(){return i()},onClose:m,onDonate:h,onOfferDetailsClick:x,get logger(){return e.logger}}))),o}})}exports.browser=browser,exports.initialize=async function(){const e=`give-freely-root-${browser.runtime.id}`;if(document.getElementById(e))return;const t=document.createElement("div");t.id=e,t.className="give-freely-root",t.style.display="block",t.dataset.extensionId=browser.runtime.id,t.dataset.extensionName=browser.runtime.getManifest().name||browser.runtime.id,document.body.appendChild(t);const n=t.attachShadow({mode:"open"}),r=document.createElement("div"),o=dt.getInstance(),i=await(async()=>{const e=await ft({type:yt,payload:{}});if(!e?.payload?.config)throw new Error("No checkout popup config found");return e.payload.config})();if(!i)return void o.error("No GF config found");o.configure({enabled:i.checkoutPopupLoggerEnabled??!0,title:"Content - Donation popup",minLevel:i.checkoutPopupMinLogLevel??"error"});const a=(s=i.containerStyle?.backdropColor,`\n :host {\n all: initial;\n }\n\n .gf-scroll-remove::-webkit-scrollbar {\n border-radius-bottom-right: 15px;\n }\n\n button {\n cursor: pointer;\n transition: transform 0.1s ease;\n }\n\n button:active {\n transform: scale(0.98);\n }\n\n .give-freely-close-button:hover {\n opacity: 0.7;\n }\n\n input[type="radio"] {\n margin-right: 8px;\n }\n\n hr {\n border: none;\n border-top: 1px solid #e5e5e5;\n margin: 1em 0;\n }\n\n dialog::backdrop {\n background-color: ${s||"revert"};\n }\n\n dialog.backdrop-hidden::backdrop {\n background-color: transparent;\n }\n`);var s;const l=document.createElement("style");l.textContent=a,n.appendChild(l),n.appendChild(r),i.countAppearances&&async function(e){try{const t=globalThis.window.location.href,n=Jn(t);if(e.debug("Is a Google search result page?",n),!n)return!1;const r=(()=>{const e=globalThis.window.document.querySelectorAll("#rso > div, #tads > div"),t=[];return e.forEach((e=>{const n=er(e),r=e.querySelector(Qn);if(r){let e=r.href;if(e&&e.includes("/url?q="))try{const t=new URLSearchParams(new URL(e).search).get("q");t&&(e=t)}catch{}e&&e.startsWith("http")&&t.push({url:e,isSponsored:n??!1})}})),t})();if(e.info("The following search results were identified",r),!r||0===r.length)return!1;const o=await ht({type:bt,payload:{currentUrl:t,searchResults:r,source:"google"}});return o?.payload?.result??!1}catch(t){return e.error("Error while identifying search results",t),!1}}(o),ee((()=>B(mr,{popupConfig:i,logger:o})),r)};
1
+ "use strict";const e=Symbol("solid-proxy"),t="function"==typeof Proxy,n={equals:(e,t)=>e===t};let r=I;const o=1,i=2,a={owned:null,cleanups:null,context:null,owner:null},s={};var l=null;let c=null,d=null,u=null,g=null,p=0;function h(e,t){const n=d,r=l,o=0===e.length,i=void 0===t?r:t,s=o?a:{owned:null,cleanups:null,context:i?i.context:null,owner:i},c=o?e:()=>e((()=>x((()=>N(s)))));l=s,d=null;try{return L(c,!0)}finally{d=n,l=r}}function f(e,t){const r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},n,t):n).equals||void 0};return[P.bind(r),e=>("function"==typeof e&&(e=e(r.value)),S(r,e))]}function m(e,t,n){T(D(e,t,!1,o))}function v(e,t,n){r=O;const i=D(e,t,!1,o);i.user=!0,g?g.push(i):T(i)}function y(e,t,r){r=r?Object.assign({},n,r):n;const o=D(e,t,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=r.equals||void 0,T(o),P.bind(o)}function b(e,t,n){let r,i,a;"function"==typeof t?(r=e,i=t,a={}):(r=!0,i=e,a=t||{});let l=null,c=s,d=!1,u="initialValue"in a,g="function"==typeof r&&y(r);const p=new Set,[h,m]=(a.storage||f)(a.initialValue),[v,b]=f(void 0),[A,w]=f(void 0,{equals:!1}),[C,k]=f(u?"ready":"unresolved");function P(e,t,n,r){return l===e&&(l=null,void 0!==r&&(u=!0),e!==c&&t!==c||!a.onHydrated||queueMicrotask((()=>a.onHydrated(r,{value:t}))),c=s,function(e,t){L((()=>{void 0===t&&m((()=>e)),k(void 0!==t?"errored":u?"ready":"unresolved"),b(t);for(const e of p.keys())e.decrement();p.clear()}),!1)}(t,n)),t}function S(){const e=h(),t=v();if(void 0!==t&&!l)throw t;return e}function E(e=!0){if(!1!==e&&d)return;d=!1;const t=g?g():r;if(null==t||!1===t)return void P(l,x(h));const n=c!==s?c:x((()=>i(t,{value:h(),refetching:e})));return(o=n)&&"object"==typeof o&&"then"in o?(l=n,"value"in n?("success"===n.status?P(l,n.value,void 0,t):P(l,void 0,H(n.value),t),n):(d=!0,queueMicrotask((()=>d=!1)),L((()=>{k(u?"refreshing":"pending"),w()}),!1),n.then((e=>P(n,e,void 0,t)),(e=>P(n,void 0,H(e),t))))):(P(l,n,void 0,t),n);var o}return Object.defineProperties(S,{state:{get:()=>C()},error:{get:()=>v()},loading:{get(){const e=C();return"pending"===e||"refreshing"===e}},latest:{get(){if(!u)return S();const e=v();if(e&&!l)throw e;return h()}}}),g?T(D((()=>E(!1)),void 0,!0,o)):E(!1),[S,{refetch:E,mutate:m}]}function x(e){if(null===d)return e();const t=d;d=null;try{return e()}finally{d=t}}function A(e){v((()=>x(e)))}function w(e){return null===l||(null===l.cleanups?l.cleanups=[e]:l.cleanups.push(e)),e}function C(e){let t;return l&&l.context&&void 0!==(t=l.context[e.id])?t:e.defaultValue}function k(e){const t=y(e),n=y((()=>U(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function P(){if(this.sources&&this.state)if(this.state===o)T(this);else{const e=u;u=null,L((()=>M(this)),!1),u=e}if(d){const e=this.observers?this.observers.length:0;d.sources?(d.sources.push(this),d.sourceSlots.push(e)):(d.sources=[this],d.sourceSlots=[e]),this.observers?(this.observers.push(d),this.observerSlots.push(d.sources.length-1)):(this.observers=[d],this.observerSlots=[d.sources.length-1])}return this.value}function S(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&L((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=c&&c.running;r&&c.disposed.has(n),(r?n.tState:n.state)||(n.pure?u.push(n):g.push(n),n.observers&&$(n)),r||(n.state=o)}if(u.length>1e6)throw u=[],new Error}),!1)),t}function T(e){if(!e.fn)return;N(e);const t=p;!function(e,t,n){let r;const i=l,a=d;d=l=e;try{r=e.fn(t)}catch(t){return e.pure&&(e.state=o,e.owned&&e.owned.forEach(N),e.owned=null),e.updatedAt=n+1,R(t)}finally{d=a,l=i}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?S(e,r):e.value=r,e.updatedAt=n)}(e,e.value,t)}function D(e,t,n,r=o,i){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:l,context:l?l.context:null,pure:n};return null===l||l!==a&&(l.owned?l.owned.push(s):l.owned=[s]),s}function E(e){if(0===e.state)return;if(e.state===i)return M(e);if(e.suspense&&x(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<p);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===o)T(e);else if(e.state===i){const n=u;u=null,L((()=>M(e,t[0])),!1),u=n}}function L(e,t){if(u)return e();let n=!1;t||(u=[]),g?n=!0:g=[],p++;try{const t=e();return function(e){if(u&&(I(u),u=null),e)return;const t=g;g=null,t.length&&L((()=>r(t)),!1)}(n),t}catch(e){n||(g=null),u=null,R(e)}}function I(e){for(let t=0;t<e.length;t++)E(e[t])}function O(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:E(r)}for(t=0;t<n;t++)E(e[t])}function M(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const e=r.state;e===o?r!==t&&(!r.updatedAt||r.updatedAt<p)&&E(r):e===i&&M(r,t)}}}function $(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=i,n.pure?u.push(n):g.push(n),n.observers&&$(n))}}function N(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)N(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)N(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function H(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function R(e,t=l){throw H(e)}function U(e){if("function"==typeof e&&!e.length)return U(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=U(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function B(e,t){return function(t){let n;return m((()=>n=x((()=>(l.context={...l.context,[e]:t.value},k((()=>t.children)))))),void 0),n}}const _=Symbol("fallback");function F(e){for(let t=0;t<e.length;t++)e[t]()}function G(e,t){return x((()=>e(t||{})))}function j(){return!0}const V={get:(t,n,r)=>n===e?r:t.get(n),has:(t,n)=>n===e||t.has(n),set:j,deleteProperty:j,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:j,deleteProperty:j}),ownKeys:e=>e.keys()};function W(e){return(e="function"==typeof e?e():e)?e:{}}function z(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function q(...n){let r=!1;for(let t=0;t<n.length;t++){const o=n[t];r=r||!!o&&e in o,n[t]="function"==typeof o?(r=!0,y(o)):o}if(t&&r)return new Proxy({get(e){for(let t=n.length-1;t>=0;t--){const r=W(n[t])[e];if(void 0!==r)return r}},has(e){for(let t=n.length-1;t>=0;t--)if(e in W(n[t]))return!0;return!1},keys(){const e=[];for(let t=0;t<n.length;t++)e.push(...Object.keys(W(n[t])));return[...new Set(e)]}},V);const o={},i=Object.create(null);for(let e=n.length-1;e>=0;e--){const t=n[e];if(!t)continue;const r=Object.getOwnPropertyNames(t);for(let e=r.length-1;e>=0;e--){const n=r[e];if("__proto__"===n||"constructor"===n)continue;const a=Object.getOwnPropertyDescriptor(t,n);if(i[n]){const e=o[n];e&&(a.get?e.push(a.get.bind(t)):void 0!==a.value&&e.push((()=>a.value)))}else i[n]=a.get?{enumerable:!0,configurable:!0,get:z.bind(o[n]=[a.get.bind(t)])}:void 0!==a.value?a:void 0}}const a={},s=Object.keys(i);for(let e=s.length-1;e>=0;e--){const t=s[e],n=i[t];n&&n.get?Object.defineProperty(a,t,n):a[t]=n?n.value:void 0}return a}const K=e=>`Stale read from <${e}>.`;function Y(e){const t="fallback"in e&&{fallback:()=>e.fallback};return y(function(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return w((()=>F(i))),()=>{let l,c,d=e()||[],u=d.length;return x((()=>{let e,t,p,f,m,v,y,b,x;if(0===u)0!==a&&(F(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[_],o[0]=h((e=>(i[0]=e,n.fallback()))),a=1);else if(0===a){for(o=new Array(u),c=0;c<u;c++)r[c]=d[c],o[c]=h(g);a=u}else{for(p=new Array(u),f=new Array(u),s&&(m=new Array(u)),v=0,y=Math.min(a,u);v<y&&r[v]===d[v];v++);for(y=a-1,b=u-1;y>=v&&b>=v&&r[y]===d[b];y--,b--)p[b]=o[y],f[b]=i[y],s&&(m[b]=s[y]);for(e=new Map,t=new Array(b+1),c=b;c>=v;c--)x=d[c],l=e.get(x),t[c]=void 0===l?-1:l,e.set(x,c);for(l=v;l<=y;l++)x=r[l],c=e.get(x),void 0!==c&&-1!==c?(p[c]=o[l],f[c]=i[l],s&&(m[c]=s[l]),c=t[c],e.set(x,c)):i[l]();for(c=v;c<u;c++)c in p?(o[c]=p[c],i[c]=f[c],s&&(s[c]=m[c],s[c](c))):o[c]=h(g);o=o.slice(0,a=u),r=d.slice(0)}return o}));function g(e){if(i[c]=e,s){const[e,n]=f(c);return s[c]=n,t(d[c],e)}return t(d[c])}}}((()=>e.each),e.children,t||void 0))}function X(e){const t=e.keyed,n=y((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return y((()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?x((()=>o(t?r:()=>{if(!x(n))throw K("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}function Z(e){let t=!1;const n=k((()=>e.children)),r=y((()=>{let e=n();Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++){const r=e[n].when;if(r)return t=!!e[n].keyed,[n,r,e[n]]}return[-1]}),void 0,{equals:(e,n)=>(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return y((()=>{const[n,o,i]=r();if(n<0)return e.fallback;const a=i.children;return"function"==typeof a&&a.length>0?x((()=>a(t?o:()=>{if(x(r)[0]!==n)throw K("Match");return i.when}))):a}),void 0,void 0)}function J(e){return e}const Q="_$DX_DELEGATE";function ee(e,t,n,r={}){let o;return h((r=>{o=r,t===document?e():se(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}function te(e,t,n){let r;const o=()=>(r||(r=(()=>{const t=document.createElement("template");return t.innerHTML=e,t.content.firstChild})())).cloneNode(!0);return o.cloneNode=o,o}function ne(e,t=window.document){const n=t[Q]||(t[Q]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,le))}}function re(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function oe(e,t,n,r){Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n}function ie(e,t,n){if(!t)return n?re(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function ae(e,t,n){return x((()=>e(t,n)))}function se(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return ce(e,t,r,n);m((r=>ce(e,t(),r,n)),r)}function le(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),a=()=>{const r=t[n];if(r&&!t.disabled){const o=t[`${n}Data`];if(void 0!==o?r.call(t,o,e):r.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){const n=e.composedPath();i(n[0]);for(let e=0;e<n.length-2&&(t=n[e],a());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(r)}function ce(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,a=void 0!==r;if(e=a&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i){if("number"===i&&(t=t.toString())===n)return n;if(a){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=ge(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i)n=ge(e,n,r);else{if("function"===i)return m((()=>{let o=t();for(;"function"==typeof o;)o=o();n=ce(e,o,n,r)})),()=>n;if(Array.isArray(t)){const i=[],s=n&&Array.isArray(n);if(de(i,t,n,o))return m((()=>n=ce(e,i,n,r,!0))),()=>n;if(0===i.length){if(n=ge(e,n,r),a)return n}else s?0===n.length?ue(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,l=t[o-1].nextSibling,c=null;for(;a<o||s<i;)if(t[a]!==n[s]){for(;t[o-1]===n[i-1];)o--,i--;if(o===a){const t=i<r?s?n[s-1].nextSibling:n[i-s]:l;for(;s<i;)e.insertBefore(n[s++],t)}else if(i===s)for(;a<o;)c&&c.has(t[a])||t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=s;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[a]);if(null!=r)if(s<r&&r<i){let l,d=a,u=1;for(;++d<o&&d<i&&null!=(l=c.get(t[d]))&&l===r+u;)u++;if(u>r-s){const o=t[a];for(;s<r;)e.insertBefore(n[s++],o)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}else a++,s++}(e,n,i):(n&&ge(e),ue(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=ge(e,n,r,t);ge(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function de(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let a,s=t[i],l=n&&n[e.length];if(null==s||!0===s||!1===s);else if("object"==(a=typeof s)&&s.nodeType)e.push(s);else if(Array.isArray(s))o=de(e,s,l)||o;else if("function"===a)if(r){for(;"function"==typeof s;)s=s();o=de(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o}else e.push(s),o=!0;else{const t=String(s);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return o}function ue(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ge(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const t=a.parentNode===e;r||i?t&&a.remove():t?e.replaceChild(o,a):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}const pe={container:{top:"50px",left:"calc(100% - 700px)",margin:"0",width:"640px","max-height":"80vh",padding:"2px 5px 10px 5px","background-color":"white",border:"none","border-radius":"24px","box-shadow":"0px 4px 44px rgba(0, 0, 0, 0.25)","font-family":"Arial","line-height":"1","vertical-align":"baseline","box-sizing":"border-box",color:"rgb(34, 34, 34)","@media (max-width: 600px), (max-height: 480px)":{display:"none !important"}},scroller:{height:"100%","overflow-x":"hidden","overlfow-y":"auto",position:"relative",padding:"0px 15px"},mainContainer:{},header:{display:"flex","flex-direction":"column-reverse","align-items":"center","margin-bottom":"10px"},headingGrow:{flex:"1","font-size":"24px","font-weight":"700","margin-top":"5px","margin-bottom":"0px"},closeButton:{background:"none",border:"none",padding:"4px 8px","align-self":"flex-end",color:"#666464","font-size":"38px",cursor:"pointer","line-height":"1"},activateAndCloseLink:{color:"#707070","align-self":"flex-end","margin-top":"5px","max-width":"40%"},activateAndCloseLinkSelected:{color:"#707070",cursor:"default","pointer-events":"none","text-decoration":"none"},subheading:{"font-size":"18px","font-weight":"400","margin-top":"0px","margin-bottom":"0px"},charityGrid:{display:"flex",gap:"10px",width:"100%","margin-top":"20px","margin-bottom":"20px","flex-wrap":"wrap","justify-content":"space-between"},charityButton:{width:"30%",position:"relative",display:"flex","flex-direction":"column","align-items":"center","justify-content":"space-between",background:"none",border:"1px solid #ccc","border-radius":"5px",padding:"5px",gap:"5px","text-align":"center","font-size":"14px",cursor:"pointer",transition:"background-color 0.2s ease"},charityButtonDisabled:{color:"white","background-color":"lightgray",cursor:"default","pointer-events":"none"},charityLogo:{"max-width":"120px","max-height":"70px","margin-bottom":"5px","object-fit":"contain"},selectButton:{"background-color":"#0052FF",cursor:"pointer","border-radius":"32px",padding:"8px",color:"white","min-width":"100px",border:"0","font-weight":"600",width:"120px"},goodbyeTodayButton:{display:"block",color:"white",border:"0","border-radius":"999px",padding:"14px 40px","font-size":"15px","font-weight":"700",cursor:"pointer","margin-top":"12px","margin-bottom":"16px","margin-left":"auto","margin-right":"auto"},goodbyeOptions:{display:"flex","flex-direction":"column",gap:"10px",width:"100%","color-scheme":"light"},goodbyeItem:{display:"flex","align-items":"center",gap:"5px",border:"1px solid #ddd",padding:"15px","border-radius":"5px","font-weight":"600",cursor:"pointer","margin-bottom":"8px"},goodbyeItemSelected:{"background-color":"#eef2ff",border:"1.5px solid #3b5bdb"},autoClosingLabel:{"text-align":"right"},backButton:{background:"none",border:"none",color:"blue","text-decoration":"underline",padding:"0",cursor:"pointer","margin-bottom":"15px"},footerLinks:{display:"flex","justify-content":"space-between","align-items":"center",position:"relative",margin:"20px 0px 10px 0px","font-size":"14px"},supportedBy:{margin:"5px 0px 5px 0px","font-size":"14px","text-align":"center"},footerLink:{color:"#666464","text-decoration":"underline"},openDetailsButton:{color:"rgb(102, 100, 100)","text-decoration":"underline",margin:"0",cursor:"pointer"},providerDot:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"8px",height:"8px","border-radius":"50%"},offerDetailsContainer:{width:"100%","background-color":"#f2f2f2",border:"1px solid black","border-radius":"10px","border-top":"1px solid #bbb7b7","margin-top":"10px","margin-bottom":"20px","box-sizing":"border-box"},offerDetailsContent:{padding:"0 5px 0 10px",width:"100%","font-size":"12px","box-sizing":"border-box"},rateItem:{display:"grid","grid-template-columns":"4fr 1fr","padding-right":"15px","padding-bottom":"5px"},rateName:{color:"#000","margin-bottom":"4px"},rate:{"font-size":"14px",color:"#555","text-align":"right"},actionHeader:{display:"flex","justify-content":"space-between","margin-top":"8px","margin-bottom":"4px"},titleV2:{"font-size":"20px","text-align":"center","margin-bottom":"20px",color:"#333c5e","line-height":"1.3"},subTitleV2:{"font-size":"15px","font-weight":"400","text-align":"center",color:"#555","margin-bottom":"20px"},linkAction:{color:"#000000","font-size":"11px","text-align":"right","text-decoration":"none","white-space":"nowrap"},meatBallWrapper:{position:"relative",display:"inline-block"},meatBallButton:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",display:"inline-flex","align-items":"center"},meatBallDropdown:{position:"absolute",top:"100%",right:"0","z-index":"1000",background:"#fff","border-radius":"8px","box-shadow":"0 2px 12px rgba(0,0,0,0.18)","min-width":"200px",padding:"4px 0"},meatBallItem:{display:"block",padding:"12px 20px",color:"#222","text-decoration":"none","font-size":"14px",cursor:"pointer","white-space":"nowrap"},charityGridV2:{display:"grid","grid-template-columns":"repeat(4, 1fr)",gap:"12px",width:"100%","margin-top":"16px","margin-bottom":"16px"},charityButtonV2:{display:"flex","flex-direction":"column","align-items":"center","justify-content":"space-between",border:"1px solid #c4c4c4","border-radius":"12px",padding:"16px 10px",gap:"10px","text-align":"center","font-size":"14px",cursor:"pointer",background:"white",position:"relative",transition:"background-color 0.2s ease","box-shadow":"0 2px 12px rgba(0, 0, 0, 0.18)"},selectButtonV2:{"background-color":"#3a67ab",cursor:"pointer","border-radius":"999px",padding:"10px 0",color:"white",width:"100%",border:"0","font-weight":"600","font-size":"15px"},footerAreaV2:{"background-color":"#f7f7f8","border-top":"1px solid #b0b0b0","border-radius":"0 0 24px 24px",margin:"0 -20px -10px -20px",padding:"0 20px 10px 20px","font-size":"13px"},footerLinksV2:{display:"flex","flex-direction":"row","justify-content":"space-evenly","align-items":"center",gap:"10px",padding:"14px 0"},providerDotV2:{display:"inline-block",width:"8px",height:"8px","border-radius":"50%","flex-shrink":"0"},footerLinkV2:{color:"#1a1a1a","text-decoration":"underline",cursor:"pointer"}};function he(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var fe={exports:{}};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,function(e){if(!(globalThis.chrome&&globalThis.chrome.runtime&&globalThis.chrome.runtime.id))throw new Error("This script should only be loaded in a browser extension.");if(globalThis.browser&&globalThis.browser.runtime&&globalThis.browser.runtime.id)e.exports=globalThis.browser;else{const t="The message port closed before a response was received.",n=e=>{const n={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(0===Object.keys(n).length)throw new Error("api-metadata.json has not been included in browser-polyfill");class r extends WeakMap{constructor(e,t=void 0){super(t),this.createItem=e}get(e){return this.has(e)||this.set(e,this.createItem(e)),super.get(e)}}const o=(t,n)=>(...r)=>{e.runtime.lastError?t.reject(new Error(e.runtime.lastError.message)):n.singleCallbackArg||r.length<=1&&!1!==n.singleCallbackArg?t.resolve(r[0]):t.resolve(r)},i=e=>1==e?"argument":"arguments",a=(e,t,n)=>new Proxy(t,{apply:(t,r,o)=>n.call(r,e,...o)});let s=Function.call.bind(Object.prototype.hasOwnProperty);const l=(e,t={},n={})=>{let r=Object.create(null),c={has:(t,n)=>n in e||n in r,get(c,d,u){if(d in r)return r[d];if(!(d in e))return;let g=e[d];if("function"==typeof g)if("function"==typeof t[d])g=a(e,e[d],t[d]);else if(s(n,d)){let t=((e,t)=>function(n,...r){if(r.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${r.length}`);if(r.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${r.length}`);return new Promise(((i,a)=>{if(t.fallbackToNoCallback)try{n[e](...r,o({resolve:i,reject:a},t))}catch(o){console.warn(`${e} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,o),n[e](...r),t.fallbackToNoCallback=!1,t.noCallback=!0,i()}else t.noCallback?(n[e](...r),i()):n[e](...r,o({resolve:i,reject:a},t))}))})(d,n[d]);g=a(e,e[d],t)}else g=g.bind(e);else if("object"==typeof g&&null!==g&&(s(t,d)||s(n,d)))g=l(g,t[d],n[d]);else{if(!s(n,"*"))return Object.defineProperty(r,d,{configurable:!0,enumerable:!0,get:()=>e[d],set(t){e[d]=t}}),g;g=l(g,t[d],n["*"])}return r[d]=g,g},set:(t,n,o,i)=>(n in r?r[n]=o:e[n]=o,!0),defineProperty:(e,t,n)=>Reflect.defineProperty(r,t,n),deleteProperty:(e,t)=>Reflect.deleteProperty(r,t)},d=Object.create(e);return new Proxy(d,c)},c=e=>({addListener(t,n,...r){t.addListener(e.get(n),...r)},hasListener:(t,n)=>t.hasListener(e.get(n)),removeListener(t,n){t.removeListener(e.get(n))}}),d=new r((e=>"function"!=typeof e?e:function(t){const n=l(t,{},{getContent:{minArgs:0,maxArgs:0}});e(n)})),u=new r((e=>"function"!=typeof e?e:function(t,n,r){let o,i,a=!1,s=new Promise((e=>{o=function(t){a=!0,e(t)}}));try{i=e(t,n,o)}catch(e){i=Promise.reject(e)}const l=!0!==i&&((c=i)&&"object"==typeof c&&"function"==typeof c.then);var c;if(!0!==i&&!l&&!a)return!1;return(l?i:s).then((e=>{r(e)}),(e=>{let t;t=e&&(e instanceof Error||"string"==typeof e.message)?e.message:"An unexpected error occurred",r({__mozWebExtensionPolyfillReject__:!0,message:t})})).catch((e=>{console.error("Failed to send onMessage rejected reply",e)})),!0})),g=({reject:n,resolve:r},o)=>{e.runtime.lastError?e.runtime.lastError.message===t?r():n(new Error(e.runtime.lastError.message)):o&&o.__mozWebExtensionPolyfillReject__?n(new Error(o.message)):r(o)},p=(e,t,n,...r)=>{if(r.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${r.length}`);if(r.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${r.length}`);return new Promise(((e,t)=>{const o=g.bind(null,{resolve:e,reject:t});r.push(o),n.sendMessage(...r)}))},h={devtools:{network:{onRequestFinished:c(d)}},runtime:{onMessage:c(u),onMessageExternal:c(u),sendMessage:p.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:p.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},f={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return n.privacy={network:{"*":f},services:{"*":f},websites:{"*":f}},l(e,h,n)};e.exports=n(chrome)}}(fe);var me,ve,browser=he(fe.exports);class ye{constructor(){this.isLocal=!0}log({level:e,message:t,timestamp:n,data:r,title:o}){let i;switch(e){case"debug":default:i="log";break;case"info":i="info";break;case"warn":i="warn";break;case"error":case"critical":case"fatal":i="error"}const a=o?`[${o}]`:"";void 0!==r?console[i](`[${n}] - ${ye.LOGGER_PREFIX} ${a} ${t}`,r):console[i](`[${n}] - ${ye.LOGGER_PREFIX} ${a} ${t}`)}}ye.LOGGER_PREFIX="[DonationPopup] -",function(e){e.checkoutPopupShown="CHECKOUT-POPUP-SHOWN",e.checkoutPopupNotShown="CHECKOUT-POPUP-NOT-SHOWN",e.checkoutPopupSupressed="CHECKOUT-POPUP-SUPRESSED",e.checkoutPopupDonation="CHECKOUT-POPUP-DONATION",e.checkoutPopupFailedActivation="CHECKOUT-POPUP-FAILED-ACTIVATION",e.checkoutPopupPurchaseConfirmed="CHECKOUT-POPUP-PURCHASE-CONFIRMED",e.checkoutPopupHealthCheck="CHECKOUT-POPUP-HEALTH-CHECK",e.checkouPopupActivationFailed="CHECKOUT-POPUP-ACTIVATION-FAILED",e.checkoutPopupOfferDetailsClicked="CHECKOUT-POPUP-OFFER-DETAILS-CLICKED",e.checkoutPopupWhyAmISeeingThisClicked="CHECKOUT-POPUP-WHY-AM-I-SEEING-THIS-CLICKED",e.checkoutPopupLooserExtension="CHECKOUT-POPUP-LOOSER-EXTENSION",e.checkoutPopupActiveDomain="CHECKOUT-POPUP-ACTIVE-DOMAIN",e.checkoutPopupSiteMatches="CHECKOUT-POPUP-SITE-MATCHES",e.checkoutPopupMerchantInResultsFound="CHECKOUT-MERCHANT-IN-RESULTS-FOUND",e.checkoutPopupNotShownPerViewportSize="CHECKOUT-POPUP-NOT-SHOWN-PER-VIEWPORT-SIZE",e.checkoutPopupHiddenProgrammatically="CHECKOUT-POPUP-HIDDEN-PROGRAMMATICALLY",e.checkoutPopupGoogleSearch="CHECKOUT-POPUP-GOOGLE-SEARCH",e.checkoutPopupGooglePartnerAnnCreated="CHECKOUT-POPUP-GOOGLE-PARTNER-ANN-CREATED",e.checkoutPopupGooglePartnerAnnClicked="CHECKOUT-POPUP-GOOGLE-PARTNER-ANN-CLICKED",e.checkoutPopupGooglePartnerAnnHidden="CHECKOUT-POPUP-GOOGLE-PARTNER-ANN-HIDDEN",e.checkoutPopupStoodDown="CHECKOUT-POPUP-STOOD-DOWN",e.checkoutPopupFooterDismiss="CHECKOUT-POPUP-FOOTER-DISMISS",e.checkoutPopupMenuItemClicked="CHECKOUT-POPUP-MENU-ITEM-CLICKED"}(me||(me={})),function(e){e.libLog="GFLIB-LOG"}(ve||(ve={}));const be=["debug","info","warn","error","critical","fatal"];class xe{constructor(e){this.config={minLevel:e?.minLevel??"error",enabled:e?.enabled??!1,transports:e?.transports??[new ye],title:e?.title??""}}static getInstance(e){return xe.instance||(xe.instance=new xe(e)),xe.instance}configure(e){this.config={...this.config,...e}}shouldLog(e){return!!this.config.enabled&&be.indexOf(e)>=be.indexOf(this.config.minLevel)}createLogMessage(e,t,n){return{level:e,version:"2.7.0",message:t,timestamp:(new Date).toISOString(),data:n,title:this.config.title}}log(e,t,n,r){if(!this.shouldLog(e))return;const o=this.createLogMessage(e,t,r);this.config.transports.filter((e=>!n||e.isLocal)).forEach((e=>e.log(o)))}debug(e,t,n=!1){this.log("debug",e,n,t)}info(e,t,n=!1){this.log("info",e,n,t)}warn(e,t,n=!1){this.log("warn",e,n,t)}error(e,t,n=!1){this.log("error",e,n,t)}critical(e,t,n=!1){this.log("critical",e,n,t)}fatal(e,t,n=!1){this.log("fatal",e,n,t)}addTransport(e){this.config.transports.push(e)}clearTransports(){this.config.transports=[]}disable(){this.config.enabled=!1}enable(){this.config.enabled=!0}}const Ae=3,we=e=>1e3*e,Ce=browser;async function ke(e,t){return await Ce.runtime.sendMessage(e)}async function Pe(e,t,n){return async function(e,t={}){const{maxAttempts:n=Ae,delayFn:r=we}=t;let o=null;for(let t=1;t<=n;t+=1)try{return await e()}catch(e){o=e,t<n&&await new Promise((e=>{setTimeout(e,r(t))}))}throw o&&t.logger&&t.operationName&&t.logger.error(`Operation ${t.operationName} failed after ${n} attempts.`,o,!0),o||new Error("Operation failed after multiple attempts")}((async()=>{const n=await ke(e);if(void 0===n){const n=e.type,r="string"==typeof n?n:"unknown",o=void 0!==t?.tabId?`tabId=${t.tabId}`:"runtime";throw new Error(`No response from background service worker for message type "${r}" (target: ${o})`)}return n}),{maxAttempts:Ae,delayFn:we})}const Se="GF_TRACK_EVENT",Te="GF_HIDE_POPUP",De="GF_GET_POPUP_CONFIG",Ee="GF_IS_ACTIVE_DOMAIN",Le="GF_LOG_MERCHANTS_IN_SEARCH_RESULTS",Ie="GF_SHOULD_STAND_DOWN",Oe="GF_ACTIVATE_OFFER",Me="GF_STORE_SHOPIFY_SHOP_ID",$e="GF_GET_DOMAIN_BY_SHOP_ID",Ne="GF_GET_LANGUAGE_CONTENT",He="GF_GET_ACTIVE_DOMAINS",Re="GF_MUTE_PARTNER_SERP_BOX",Ue="GF_GET_GF_DATA",Be="countryCode",_e="gf_event_history",Fe="gf_popup_everywhere",Ge={ein:"0",tpi:"0"},je="us",Ve="GIVE_FREELY_",We={async get(e){const t=`${Ve}${e}`;return(await browser.storage.local.get(t))[t]||null},async set(e,t){const n=`${Ve}${e}`;await browser.storage.local.set({[n]:t})},async remove(e){const t=Array.isArray(e)?e.map((e=>`${Ve}${e}`)):`${Ve}${e}`;await browser.storage.local.remove(t)}},ze=()=>String("2.7.0");class qe{constructor(e,t,n,r=60){this.track=async(e,t,n=!1,r=!1)=>{const o={partner:`gfLib_${this._partnerApiKey}`,eventType:e,eventData:{userId:n?void 0:this._userService?.user?.id,libVersion:ze(),...t}};try{const e=JSON.stringify(o,((e,t)=>t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t)),t=await this.getEventsUrl();return t?await this.BroadcastEvent(t,e,o,r):(this._logger.info("Cant broadcast event. eventsUrl cant be retrieved from config",o,!0),!1)}catch(e){return this._logger.error("Something unexpected happened when dispatching a gf event",{error:e,event:o},!0),!1}},this.getEventsHistory=async()=>{const e=await We.get(_e),t=(e=>{const t=new Date;return t.setTime(t.getTime()+60*e*1e3),t.getTime()})(-this._debounceWindowInMinutes),n=(e||[]).filter((e=>e.createdAt>t));return await We.set(_e,n),n},this.shouldBroadcastEvent=async(e,t)=>!!t||!(await this.getEventsHistory()).some((t=>t.payload===e)),this.pushEventToHistory=async e=>{const t=await this.getEventsHistory();t.push({createdAt:Date.now(),payload:e}),await We.set(_e,t)},this._partnerApiKey=e,this._userService=t,this._debounceWindowInMinutes=r,this._logger=xe.getInstance({title:"Analytics"}),this._configService=n}async BroadcastEvent(e,t,n,r){if(await this.shouldBroadcastEvent(t,r)){const r=await fetch(e,{headers:{"Content-Type":"application/json"},method:"POST",body:t,cache:"no-store"});return r.ok?(await this.pushEventToHistory(t),!0):(this._logger.error("Something unexpected happened when dispatching an event",{status:r.status,statusText:r.statusText,event:n},!0),!1)}return this._logger.info("This event has already been broadcasted during the past hour",n,!0),!1}async getEventsUrl(){const e=await this._configService.getCachedConfig();return e?.eventsUrl}}function Ke(e,t,n){return e?{...t,...n}:t}qe.trackEvent=async(e,t,n=!1,r=!1)=>{await ke({type:Se,payload:{eventType:e,eventData:t,anonymous:n,skipThrottling:r}})};const Ye=(e,t)=>((e,t)=>{let n=parseFloat(t);return n<1&&(n=1),n=Math.floor(n),"PERCENTAGE"===e?`${n}%`:`$${n}`})(e,parseFloat(t).toString());var Xe=te("<span>");function Ze(e){return t=Xe(),m((()=>{return t.innerHTML=(n=e.title,r=e.activeDomain,n.replace("{0}",Ye(r.commission.kind,r.commission.amount.toString())));var n,r})),t;var t}const Je=function(){const e=Symbol("context");return{id:e,Provider:B(e),defaultValue:()=>({translate:e=>"",translateArray:e=>[],getAllCharities:()=>[]})}}(),Qe=Je,et=()=>{const e=C(Qe)();if(!e)throw new Error("Content provider context is undefined");return t=>e.translate(t)};class tt{static formatMessage(e,...t){return e.replace(/{(\d+)}/g,((e,n)=>{const r=Number(n);return void 0!==t[r]?String(t[r]):`{${r}}`}))}}var nt=te("<div>"),rt=te("<p><span>"),ot=te("<div><div class=gf-offer-details><p><span></span></p><p><span></span></p><p><span></span></p><p><span></span></p><p><span></span></p><p><a target=_blank rel=noreferrer><span>"),it=te("<div class=gf-offer-details-rate-item><div></div><div>");const at=e=>{const t=et();return n=ot(),o=(r=n.firstChild).firstChild,i=o.firstChild,a=o.nextSibling,s=a.firstChild,l=a.nextSibling,c=l.firstChild,d=l.nextSibling,u=d.firstChild,g=d.nextSibling,p=g.firstChild,h=g.nextSibling,f=h.firstChild,v=f.firstChild,se(r,G(X,{get when(){return!!e.merchantRateDetail?.length},get children(){var t=nt();return se(t,(()=>e.merchantRateDetail?.map((e=>{return t=it(),n=t.firstChild,r=n.nextSibling,se(n,(()=>e.Name||"")),se(r,(()=>((e,t=1,n=1)=>{const r=e.BoostedOffer??null;let o=parseFloat(e?.Amount??"");if(r?.EndDate&&new Date(r.EndDate)<new Date&&(o=parseFloat(r.OriginalMaxRate)),Number.isNaN(o))return"";const i=o*t;return"PERCENTAGE"===e?.Kind?`${i.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n})}%`:"FLAT"===e?.Kind?i.toLocaleString("en-US",{style:"currency",currency:e.Currency}):""})(e))),m((e=>{var o=pe.rateItem,i=pe.rateName,a=pe.rate;return e.e=ie(t,o,e.e),e.t=ie(n,i,e.t),e.a=ie(r,a,e.a),e}),{e:void 0,t:void 0,a:void 0}),t;var t,n,r})))),t}}),d),se(r,G(X,{get when(){return e.additionalHtml},get children(){var t=rt(),n=t.firstChild;return m((()=>n.innerHTML=e.additionalHtml)),t}}),h),m((o=>{var a=pe.offerDetailsContainer,l=pe.offerDetailsContent,d=t("offerDetails.intro"),g=t("offerDetails.eligible"),h=e.parsedMaxRate?tt.formatMessage(t("offerDetails.donationRatesWithValue"),e.parsedMaxRate):tt.formatMessage(t("offerDetails.donationRates")),m=t("offerDetails.donationAmounts"),y=t("offerDetails.donationTiming"),b=pe.footerLink,x=e.termsUrl,A=t("offerDetails.termsAndConditions");return o.e=ie(n,a,o.e),o.t=ie(r,l,o.t),d!==o.a&&(i.innerHTML=o.a=d),g!==o.o&&(s.innerHTML=o.o=g),h!==o.i&&(c.innerHTML=o.i=h),m!==o.n&&(u.innerHTML=o.n=m),y!==o.s&&(p.innerHTML=o.s=y),o.h=ie(f,b,o.h),x!==o.r&&re(f,"href",o.r=x),A!==o.d&&(v.innerHTML=o.d=A),o}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),n;var n,r,o,i,a,s,l,c,d,u,g,p,h,f,v},st=()=>{const e=C(Je)();if(!e)throw new Error("Content provider context is undefined");return()=>e.getAllCharities()};function lt(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return`hsl(${(t%360+360)%360}, 55%, 50%)`}var ct=te("<a href=#!>"),dt=te("<button class=give-freely-close-button aria-label=Close>×"),ut=te('<div><div><div></div></div><div></div><div><div><div><span></span></div><button aria-label="Don\'t show again"><span></span></button></div></div><div><p><span></span></p><span></span><a class=give-freely-footer-link target=_blank rel="noopener noreferrer"><span>'),gt=te("<div><div><img><span></span></div><button><span>"),pt=te("<div>"),ht=te("<div><span>");function ft(e){const t=et(),n=st();return[(o=ut(),i=o.firstChild,a=i.firstChild,s=i.nextSibling,l=s.nextSibling,c=l.firstChild,d=c.firstChild,u=d.firstChild,g=d.nextSibling,p=g.firstChild,h=l.nextSibling,f=h.firstChild,v=f.firstChild,b=f.nextSibling,x=b.nextSibling,A=x.firstChild,se(i,G(X,{get when(){return e.checkoutPopupConf.checkoutPopupActivateAndClose},get children(){var n=ct();return n.$$click=()=>e.onCharityClick(Ge,!0),m((r=>{var o=Ke(e.isCharitySelected,pe.activateAndCloseLink,pe.activateAndCloseLinkSelected),i=t("main.activateAndClose.v2");return r.e=ie(n,o,r.e),i!==r.t&&(n.innerHTML=r.t=i),r}),{e:void 0,t:void 0}),n}}),null),se(i,G(X,{get when(){return e.checkoutPopupConf.checkoutPopupMainCloseButtonVisible&&!e.checkoutPopupConf.checkoutPopupActivateAndClose},get children(){var t=dt();return t.$$click=()=>e.onClose(),m((e=>ie(t,pe.closeButton,e))),t}}),null),se(s,G(Ze,{get title(){return t("main.subTitle.v2")},get activeDomain(){return e.activeDomain}})),se(l,(()=>n().reduce(((n,r)=>{var o,i,a,s,l,c,d;return r?.title&&""!==r?.title?n.push((a=(i=gt()).firstChild,s=a.firstChild,l=s.nextSibling,c=a.nextSibling,d=c.firstChild,i.$$click=()=>!e.isCharitySelected&&e.onCharityClick(r),se(i,(o=y((()=>!!(r.decorator&&r.decoratorLeftStyle&&r.decoratorRightStyle))),()=>{return o()&&[(t=pt(),m((e=>{var n=r.decoratorLeftStyle,o=r.decorator;return e.e=ie(t,n,e.e),o!==e.t&&(t.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),t),(e=pt(),m((t=>{var n=r.decoratorRightStyle,o=r.decorator;return t.e=ie(e,n,t.e),o!==t.t&&(e.innerHTML=t.t=o),t}),{e:void 0,t:void 0}),e)];var e,t}),a),a.style.setProperty("text-align","center"),a.style.setProperty("display","flex"),a.style.setProperty("flex-direction","column"),a.style.setProperty("align-items","center"),a.style.setProperty("gap","7px"),m((n=>{var o=Ke(e.isCharitySelected,pe.charityButton,{cursor:"default"}),a=r.logo,u=pe.charityLogo,g=r.title,p=r.title,h=Ke(e.isCharitySelected,{...pe.selectButton,"background-color":e.checkoutPopupConf?.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},pe.charityButtonDisabled),f=e.isCharitySelected,m=`Select charity: ${r.title}`,v=t("main.charitySelect");return n.e=ie(i,o,n.e),a!==n.t&&re(s,"src",n.t=a),n.a=ie(s,u,n.a),g!==n.o&&re(s,"alt",n.o=g),p!==n.i&&(l.innerHTML=n.i=p),n.n=ie(c,h,n.n),f!==n.s&&(c.disabled=n.s=f),m!==n.h&&re(c,"aria-label",n.h=m),v!==n.r&&(d.innerHTML=n.r=v),n}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),i)):e.logger.error(`Translation was not found for EIN ${r?.ein}`),n}),[])),c),c.$$click=()=>!e.isCharitySelected&&e.onSuppressClick(),d.style.setProperty("text-align","center"),d.style.setProperty("display","flex"),d.style.setProperty("align-items","center"),d.style.setProperty("height","100%"),f.$$click=()=>e.onOfferDetailsClickInternal(),oe(x,"click",e.onWhyAmISeeingThisClick),se(o,(r=y((()=>!!e.checkoutPopupConf.checkoutPopupDisplayNameInFooter)),()=>{return r()&&(e=ht(),n=e.firstChild,m((r=>{var o=pe.supportedBy,i=t("main.footer");return r.e=ie(e,o,r.e),i!==r.t&&(n.innerHTML=r.t=i),r}),{e:void 0,t:void 0}),e);var e,n}),null),m((n=>{var r=pe.mainContainer,d=pe.header,m={...pe.headingGrow,"font-weight":800},y=t("main.title.v2"),w=pe.subheading,C=pe.charityGrid,k=Ke(e.isCharitySelected,pe.charityButton,{cursor:"default","justify-content":"flex-end"}),P=t("main.sixthBox"),S=Ke(e.isCharitySelected,{...pe.selectButton,"background-color":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},pe.charityButtonDisabled),T=e.isCharitySelected,D=t("main.settings.v2"),E=pe.footerLinks,L=pe.openDetailsButton,I=t("main.offerDetails"),O={...pe.providerDot,"background-color":lt(e.activeDomain.provider)},M=pe.footerLink,$=e.checkoutPopupConf.externalUrls.giveFreelyWhyAmISeeingThis,N=t("main.whyAmISeeingThis");return n.e=ie(o,r,n.e),n.t=ie(i,d,n.t),n.a=ie(a,m,n.a),y!==n.o&&(a.innerHTML=n.o=y),n.i=ie(s,w,n.i),n.n=ie(l,C,n.n),n.s=ie(c,k,n.s),P!==n.h&&(u.innerHTML=n.h=P),n.r=ie(g,S,n.r),T!==n.d&&(g.disabled=n.d=T),D!==n.l&&(p.innerHTML=n.l=D),n.u=ie(h,E,n.u),n.c=ie(f,L,n.c),I!==n.w&&(v.innerHTML=n.w=I),n.m=ie(b,O,n.m),n.f=ie(x,M,n.f),$!==n.y&&re(x,"href",n.y=$),N!==n.g&&(A.innerHTML=n.g=N),n}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0}),o),G(X,{get when(){return e.detailsDisplayed},get children(){return G(at,{get merchantName(){return e.activeDomain.merchantName},get extensionName(){return e.checkoutPopupConf.displayName},get termsUrl(){return e.checkoutPopupConf.externalUrls.giveFreelyTermsAndConditions},get parsedMaxRate(){return Ye(e.activeDomain.commission.kind,e.activeDomain.commission.amount.toString())},get merchantRateDetail(){return e.merchantRates},get additionalHtml(){return e.checkoutPopupConf.checkoutPopupOfferDetailsAdditionalHtml},onClose:()=>e.onOfferDetailsClose()})}})];var r,o,i,a,s,l,c,d,u,g,p,h,f,v,b,x,A}ne(["click"]);var mt=te("<a href=#!>");function vt(e){return G(X,{get when(){return!!e.label&&!!e.action},get children(){var t=mt();return t.$$click=t=>(t.preventDefault(),"donateclose"===e.action?e.onCharityClick(Ge,!0):e.onClose()),m((n=>{var r=Ke(e.isCharitySelected,pe.linkAction,{cursor:"default","pointer-events":"none"}),o=e.label;return n.e=ie(t,r,n.e),o!==n.t&&(t.innerHTML=n.t=o),n}),{e:void 0,t:void 0}),t}})}ne(["click"]);var yt=te('<svg width=24 height=24 viewBox="0 0 16 16"xmlns=http://www.w3.org/2000/svg fill=#3B82F6><circle cx=2.5 cy=8 r=1.5></circle><circle cx=8 cy=8 r=1.5></circle><circle cx=13.5 cy=8 r=1.5>');function bt(){return yt()}var xt=te("<div data-testid=meatball-dropdown>"),At=te('<div><button aria-label="More options">'),wt=te("<button>"),Ct=te('<a target=_blank rel="noopener noreferrer">');const kt="settings";function Pt(e,t){return Object.entries(t).reduce(((e,[t,n])=>e.replaceAll(t,n)),e)}function St(e){const[t,n]=f(!1);let r;const o=e=>{r&&!e.composedPath().includes(r)&&n(!1)};v((()=>{if(!t())return;const e=setTimeout((()=>{document.addEventListener("click",o)}),0);w((()=>{clearTimeout(e),document.removeEventListener("click",o)}))})),w((()=>document.removeEventListener("click",o)));const i=y((()=>e.items.map(((t,n)=>({url:t,label:Pt(e.labels[n]??"",e.substitutions??{})}))).filter((e=>!!e.label)))),a=async(t,r)=>{if(n(!1),t===kt)return qe.trackEvent(me.checkoutPopupMenuItemClicked,{url:t,label:r}),void e.onSuppressClick();let o=e.substitutions??{};if(t.includes("$url")&&e.getActivationUrl){const t=await e.getActivationUrl();o={...o,$url:encodeURIComponent(t)}}const i=Pt(t,o);(function(e){try{const{protocol:t}=new URL(e);return"http:"===t||"https:"===t}catch{return!1}})(i)&&(qe.trackEvent(me.checkoutPopupMenuItemClicked,{url:i,label:r}),window.open(i,"_blank","noopener,noreferrer"))};return s=At(),l=s.firstChild,"function"==typeof r?ae(r,s):r=s,l.$$click=e=>{e.stopPropagation(),n((e=>!e))},se(l,G(bt,{})),se(s,G(X,{get when(){return t()},get children(){var t=xt();return se(t,G(Y,{get each(){return i()},children:(t,n)=>{const r=t.url===kt,o=t.url.includes("$url"),s={...pe.meatBallItem,...n()<i().length-1?{"border-bottom":"1px solid #e5e7eb"}:{}};return G(X,{when:r||o,get fallback(){return(n=Ct()).$$click=e=>{e.preventDefault(),a(t.url,t.label)},m((r=>{var o=Pt(t.url,e.substitutions??{}),i=s,a=t.label;return o!==r.e&&re(n,"href",r.e=o),r.t=ie(n,i,r.t),a!==r.a&&(n.innerHTML=r.a=a),r}),{e:void 0,t:void 0,a:void 0}),n;var n},get children(){var e=wt();return e.$$click=()=>{a(t.url,t.label)},m((n=>{var r={border:"none",background:"none",width:"100%","text-align":"left",...s},o=t.label;return n.e=ie(e,r,n.e),o!==n.t&&(e.innerHTML=n.t=o),n}),{e:void 0,t:void 0}),e}})}})),m((e=>ie(t,pe.meatBallDropdown,e))),t}}),null),m((e=>{var n=pe.meatBallWrapper,r=pe.meatBallButton,o=t();return e.e=ie(s,n,e.e),e.t=ie(l,r,e.t),o!==e.a&&re(l,"aria-expanded",e.a=o),e}),{e:void 0,t:void 0,a:void 0}),s;var s,l}ne(["click"]);const Tt=async(e,t,n,r,o,i=!0)=>{e.debug("Activating offer",{activeDomain:t,selectedCharity:r});try{const a=await Pe({type:Oe,payload:{activeDomain:t,originalUrl:n,selectedCharity:r,gfCommissionUniqueId:o,openTab:i}});return e.debug("Activate offer response",{response:a}),a}catch(n){return e.error("Failed to activate offer",{activeDomain:t,error:n}),{type:Oe,payload:{response:!1}}}};var Dt=te("<div>"),Et=te("<span><span>"),Lt=te('<a class=give-freely-footer-link target=_blank rel="noopener noreferrer"><span>'),It=te("<span data-testid=dismiss-link>"),Ot=te("<span>"),Mt=te("<div><span>"),$t=te("<div><div><div></div><div></div></div><div></div><div></div><div></div><div><div>"),Nt=te("<div><div><img><div style=flex:1;display:flex;align-items:center;justify-content:center;><div></div></div></div><button><span>");function Ht(e){const t=et(),n=(()=>{const e=C(Qe)();if(!e)throw new Error("Content provider context is undefined");return t=>e.translateArray(t)})(),r=st(),o=async()=>{const t=e.selectedCharity?.charity,n=await Tt(e.logger,e.activeDomain,window.location.href,{ein:t?.ein??Ge.ein,thirdPartyId:t?.tpi??Ge.tpi},crypto.randomUUID(),!1);return n.payload.response&&n.payload.activationLink?n.payload.activationLink:window.location.href};return i=$t(),l=(s=(a=i.firstChild).firstChild).nextSibling,c=a.nextSibling,d=c.nextSibling,u=d.nextSibling,g=u.nextSibling,p=g.firstChild,se(s,G(vt,{get action(){return e.checkoutPopupConf.topLeftAction},get label(){return t("main.topLeftActionString")},get isCharitySelected(){return e.isCharitySelected},get onClose(){return e.onClose},get onCharityClick(){return e.onCharityClick}})),l.style.setProperty("display","flex"),l.style.setProperty("align-items","center"),l.style.setProperty("gap","8px"),se(l,G(X,{get when(){return(e.checkoutPopupConf.meatBallMenu?.length??0)>0},get children(){return G(St,{get items(){return e.checkoutPopupConf.meatBallMenu},get labels(){return n("meatBallMenuLabels")},get onSuppressClick(){return e.onSuppressClick},get substitutions(){return{$partner:e.checkoutPopupConf.displayName??"",$storename:e.activeDomain.merchantName??"",$activedomainid:String(e.activeDomain.id??""),$activedomainhost:e.activeDomain.domain??"",$providerid:e.activeDomain.provider??""}},getActivationUrl:o})}}),null),se(l,G(vt,{get action(){return e.checkoutPopupConf.topRightAction},get label(){return t("main.topRightActionString")},get isCharitySelected(){return e.isCharitySelected},get onClose(){return e.onClose},get onCharityClick(){return e.onCharityClick}}),null),se(c,G(Ze,{get activeDomain(){return e.activeDomain},get title(){return t("main.title.v3")}})),se(d,G(Ze,{get activeDomain(){return e.activeDomain},get title(){return t("main.subTitle.v3")}})),se(u,(()=>r().slice(0,4).reduce(((n,r)=>{var o,i,a,s,l,c,d;return r?.title&&""!==r?.title?n.push((a=(i=Nt()).firstChild,s=a.firstChild,l=s.nextSibling.firstChild,c=a.nextSibling,d=c.firstChild,i.$$click=()=>!e.isCharitySelected&&e.onCharityClick(r),se(i,(o=y((()=>!!(r.decorator&&r.decoratorLeftStyle&&r.decoratorRightStyle))),()=>{return o()&&[(t=Dt(),m((e=>{var n=r.decoratorLeftStyle,o=r.decorator;return e.e=ie(t,n,e.e),o!==e.t&&(t.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),t),(e=Dt(),m((t=>{var n=r.decoratorRightStyle,o=r.decorator;return t.e=ie(e,n,t.e),o!==t.t&&(e.innerHTML=t.t=o),t}),{e:void 0,t:void 0}),e)];var e,t}),a),a.style.setProperty("text-align","center"),a.style.setProperty("display","flex"),a.style.setProperty("flex-direction","column"),a.style.setProperty("align-items","center"),a.style.setProperty("gap","7px"),a.style.setProperty("flex-grow","1"),m((n=>{var o=Ke(e.isCharitySelected,pe.charityButtonV2,{cursor:"default"}),a=r.logo,u=pe.charityLogo,g=r.title,p=r.title,h=Ke(e.isCharitySelected,{...pe.selectButtonV2,"background-color":e.checkoutPopupConf?.checkoutPopupSelectCharityButtonBgColor||"#2563EB"},pe.charityButtonDisabled),f=e.isCharitySelected,m=`Select charity: ${r.title}`,v=t("main.charitySelect");return n.e=ie(i,o,n.e),a!==n.t&&re(s,"src",n.t=a),n.a=ie(s,u,n.a),g!==n.o&&re(s,"alt",n.o=g),p!==n.i&&(l.innerHTML=n.i=p),n.n=ie(c,h,n.n),f!==n.s&&(c.disabled=n.s=f),m!==n.h&&re(c,"aria-label",n.h=m),v!==n.r&&(d.innerHTML=n.r=v),n}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),i)):e.logger.error(`Translation was not found for EIN ${r?.ein}`),n}),[]))),se(i,G(X,{get when(){return!e.checkoutPopupConf.donationStatsOff},get children(){var n=Dt();return n.style.setProperty("margin-bottom","25px"),n.style.setProperty("text-align","center"),se(n,G(X,{get when(){return e.gfData},children:e=>{return n=Ot(),m((()=>n.innerHTML=function(e,t,n){return e.replace("{0}",function(e){return`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`}(t)).replace("{1}",function(e){if(!e)return"";let t;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[n,r,o]=e.split("-").map(Number);t=new Date(n,r-1,o)}else t=new Date(e);const n=new Intl.DateTimeFormat("en-US",{month:"short"}).format(t),r=t.getDate(),o=t.getFullYear();return`${n} ${r}${function(e){const t=e%100;if(t>=11&&t<=13)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(r)}, ${o}`}(n))}(t("main.donationStats"),e().totalDonationsAmount,e().calculationDate))),n;var n}})),m((t=>null!=(t=null!==e.gfData?"visible":"hidden")?n.style.setProperty("visibility",t):n.style.removeProperty("visibility"))),n}}),g),se(p,G(X,{get when(){return!!t("main.offerDetails.v4")},get children(){var n=Et(),r=n.firstChild;return n.$$click=()=>e.onOfferDetailsClickInternal(),m((e=>{var o=pe.footerLinkV2,i=t("main.offerDetails.v4");return e.e=ie(n,o,e.e),i!==e.t&&(r.innerHTML=e.t=i),e}),{e:void 0,t:void 0}),n}}),null),se(p,G(X,{get when(){return!!t("main.whyAmISeeingThis.v4")},get children(){var n=Lt(),r=n.firstChild;return oe(n,"click",e.onWhyAmISeeingThisClick),m((o=>{var i=pe.footerLinkV2,a=e.checkoutPopupConf.externalUrls.giveFreelyWhyAmISeeingThis,s=t("main.whyAmISeeingThis.v4");return o.e=ie(n,i,o.e),a!==o.t&&re(n,"href",o.t=a),s!==o.a&&(r.innerHTML=o.a=s),o}),{e:void 0,t:void 0,a:void 0}),n}}),null),se(p,G(X,{get when(){return y((()=>!!e.checkoutPopupConf.dismissVisible))()&&!!t("main.dismiss.v4")},get children(){var n=It();return n.$$click=()=>e.onDismissClick(),m((e=>{var r=pe.footerLinkV2,o=t("main.dismiss.v4");return e.e=ie(n,r,e.e),o!==e.t&&(n.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),n}}),null),se(p,G(X,{get when(){return!!t("main.settings.v4")},get children(){var n=Ot();return n.$$click=()=>e.onSuppressClick(),m((e=>{var r=pe.footerLinkV2,o=t("main.settings.v4");return e.e=ie(n,r,e.e),o!==e.t&&(n.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),n}}),null),se(g,G(X,{get when(){return y((()=>!!e.checkoutPopupConf.checkoutPopupDisplayNameInFooter))()&&!!t("main.footer")},get children(){var e=Mt(),n=e.firstChild;return m((r=>{var o={...pe.supportedBy,"text-align":"center",margin:"0",padding:"4px 0 8px 0"},i=t("main.footer");return r.e=ie(e,o,r.e),i!==r.t&&(n.innerHTML=r.t=i),r}),{e:void 0,t:void 0}),e}}),null),se(g,G(X,{get when(){return e.detailsDisplayed},get children(){var t=Mt(),n=t.firstChild;return t.style.setProperty("position","relative"),se(t,G(at,{get merchantName(){return e.activeDomain.merchantName},get extensionName(){return e.checkoutPopupConf.displayName},get termsUrl(){return e.checkoutPopupConf.externalUrls.giveFreelyTermsAndConditions},get parsedMaxRate(){return Ye(e.activeDomain.commission.kind,e.activeDomain.commission.amount.toString())},get merchantRateDetail(){return e.merchantRates},get additionalHtml(){return e.checkoutPopupConf.checkoutPopupOfferDetailsAdditionalHtml},onClose:()=>e.onOfferDetailsClose()}),null),m((t=>ie(n,{...pe.providerDotV2,"background-color":lt(e.activeDomain.provider),position:"absolute",top:"10px",right:"10px"},t))),t}}),null),m((t=>{var n=pe.mainContainer,r=pe.actionHeader,o=pe.titleV2,s=pe.subTitleV2,l=pe.charityGridV2,h=pe.footerAreaV2,f=e.checkoutPopupConf.footerLinksAreaStyling||pe.footerLinksV2;return t.e=ie(i,n,t.e),t.t=ie(a,r,t.t),t.a=ie(c,o,t.a),t.o=ie(d,s,t.o),t.i=ie(u,l,t.i),t.n=ie(g,h,t.n),t.s=ie(p,f,t.s),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i;var i,a,s,l,c,d,u,g,p}function Rt(e){const[t,n]=f(!1),[r,o]=f(null),[i,a]=f(null);"v2"===e.checkoutPopupConf.checkoutPopupDesignVersion&&async function(){try{const e=await ke({type:Ue,payload:{}});return e?.payload?.data??null}catch{return null}}().then(a);const s=()=>{const t=!!e.checkoutPopupConf.containerStyle?.backdropColor||!!e.checkoutPopupConf.containerStyle?.showAsModal,n=e.checkoutPopupConf.containerStyle?.clickAction??"hide-opacity";t&&"ignore"!==n&&("donate"===n?u(Ge,!0):e.setBackdropHidden(!0))},l=t=>{const n=!!e.checkoutPopupConf.containerStyle?.backdropColor||!!e.checkoutPopupConf.containerStyle?.showAsModal,r=e.checkoutPopupConf.containerStyle?.clickAction??"hide-opacity";n&&"donate"===r&&t.stopPropagation()};v((()=>{window.addEventListener("click",s),e.mainContainerRef?.addEventListener("click",l),w((()=>{setTimeout((()=>{window.removeEventListener("click",s),e.mainContainerRef?.removeEventListener("click",l)}),500)}))})),v((()=>{t()&&e.dialogRef&&e.dialogRef.scroll({top:e.dialogRef.offsetHeight,behavior:"smooth"})})),v((()=>{const t=r();t&&Promise.resolve(e.onCharitySelect(t.charity,t.closeOnDonation?e.checkoutPopupConf.checkoutPopupActivateAndCloseSkipSuccess:void 0)).catch((t=>{e.logger.error("Error during charity selection",{error:t}),o(null)}))}));const c=()=>{qe.trackEvent(me.checkoutPopupWhyAmISeeingThisClicked,{domain:globalThis.window.location.hostname})},d=()=>{e.onClose(),qe.trackEvent(me.checkoutPopupFooterDismiss,{activeDomain:e.activeDomain.domain})},u=(e,t)=>o({charity:e,closeOnDonation:t}),g=()=>!!r()?.charity,p=()=>{const r=!t();e.onOfferDetailsClick(r),n(r)},h=()=>n(!1);return G(Z,{get fallback(){return G(ft,q(e,{get detailsDisplayed(){return t()},setDetailsDisplayed:n,get selectedCharity(){return r()},setSelectedCharity:o,get isCharitySelected(){return g()},onCharityClick:u,onSuppressClick:()=>e.onSuppress(),onWhyAmISeeingThisClick:c,onOfferDetailsClickInternal:p,onOfferDetailsClose:h}))},get children(){return G(J,{get when(){return"v2"===e.checkoutPopupConf.checkoutPopupDesignVersion},get children(){return G(Ht,q(e,{get detailsDisplayed(){return t()},setDetailsDisplayed:n,get selectedCharity(){return r()},setSelectedCharity:o,get isCharitySelected(){return g()},onCharityClick:u,onSuppressClick:()=>e.onSuppress(),onWhyAmISeeingThisClick:c,onDismissClick:d,onOfferDetailsClickInternal:p,onOfferDetailsClose:h,get gfData(){return i()}}))}})}})}ne(["click"]);var Ut=te("<div><div></div><span></span><div>");function Bt(e){return n=(t=Ut()).firstChild,o=(r=n.nextSibling).nextSibling,t.style.setProperty("display","flex"),t.style.setProperty("align-items","center"),t.style.setProperty("gap","8px"),t.style.setProperty("margin","12px 0"),t.style.setProperty("color","#888"),t.style.setProperty("font-size","11px"),t.style.setProperty("letter-spacing","0.08em"),t.style.setProperty("font-weight","600"),n.style.setProperty("flex","1"),n.style.setProperty("border-top","1px solid #ddd"),o.style.setProperty("flex","1"),o.style.setProperty("border-top","1px solid #ddd"),m((()=>r.innerHTML=e.text)),t;var t,n,r,o}var _t=te("<button class=give-freely-close-button aria-label=Close>×"),Ft=te("<label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=18250><span>"),Gt=te('<div><div><div><span></span></div></div><button class=give-freely-back-button aria-label="Back to charity selection"><span></span></button><button class=give-freely-today-button><span></span></button><div id=give-freely-goodbye-screen-options><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=7><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=30><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=90><span></span></label></div><div><button class=give-freely-submit-button><span>');function jt(e){const[t,n]=f(0),r=et();return o=Gt(),i=o.firstChild,a=i.firstChild,s=a.firstChild,l=i.nextSibling,c=l.firstChild,d=l.nextSibling,u=d.firstChild,g=d.nextSibling,h=(p=g.firstChild).firstChild,v=h.nextSibling,b=(y=p.nextSibling).firstChild,x=b.nextSibling,w=(A=y.nextSibling).firstChild,C=w.nextSibling,k=g.nextSibling,P=k.firstChild,S=P.firstChild,o.style.setProperty("font-size","14px"),se(i,G(X,{get when(){return e.checkoutPopupConf.checkoutPopupSupressCloseButtonVisible},get children(){var t=_t();return t.$$click=()=>e.onGoodbye(0),m((e=>ie(t,{...pe.closeButton,"align-self":"flex-start"},e))),t}}),null),l.$$click=()=>e.onBack(),d.$$click=()=>{e.onGoodbye(1),e.setScreen("main")},se(o,G(Bt,{get text(){return r("suppress.chooseLongerPeriod")}}),g),h.addEventListener("change",(()=>n(7))),b.addEventListener("change",(()=>n(30))),w.addEventListener("change",(()=>n(90))),se(g,G(X,{get when(){return e.checkoutPopupConf.checkoutPopupNeverSuppressionAllowed},get children(){var e=Ft(),o=e.firstChild,i=o.nextSibling;return o.addEventListener("change",(()=>n(18250))),m((n=>{var o=Ke(18250===t(),pe.goodbyeItem,pe.goodbyeItemSelected),a=r("suppress.suppressionPeriodNever");return n.e=ie(e,o,n.e),a!==n.t&&(i.innerHTML=n.t=a),n}),{e:void 0,t:void 0}),e}}),null),k.style.setProperty("text-align","center"),k.style.setProperty("margin-top","10px"),P.$$click=()=>{const n=t();n&&(e.onGoodbye(n),e.setScreen("main"))},m((n=>{var o={...pe.header,"flex-direction":"row"},h={...pe.headingGrow,"margin-top":"20px",..."v2"===e.checkoutPopupConf.checkoutPopupDesignVersion?{color:pe.titleV2.color}:{}},f=r("suppress.title"),m=pe.backButton,b=r("suppress.backButton"),w={...pe.goodbyeTodayButton,"background-color":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},k=r("suppress.suppressionPeriodToday"),T=pe.goodbyeOptions,D=Ke(7===t(),pe.goodbyeItem,pe.goodbyeItemSelected),E=r("suppress.suppressionPeriodPlural").replace("{0}","7"),L=Ke(30===t(),pe.goodbyeItem,pe.goodbyeItemSelected),I=r("suppress.suppressionPeriodPlural").replace("{0}","30"),O=Ke(90===t(),pe.goodbyeItem,pe.goodbyeItemSelected),M=r("suppress.suppressionPeriodPlural").replace("{0}","90"),$=0===t(),N={...pe.selectButton,"font-weight":"700","margin-top":"0px","margin-bottom":"0px",padding:"12px 0","background-color":0===t()?"#f8f8f8":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF",color:0===t()?"#ccc":"white",border:0===t()?"1px solid #e8e8e8":"0",width:"240px",cursor:0===t()?"not-allowed":"pointer"},H=r("suppress.submitButton");return n.e=ie(i,o,n.e),n.t=ie(a,h,n.t),f!==n.a&&(s.innerHTML=n.a=f),n.o=ie(l,m,n.o),b!==n.i&&(c.innerHTML=n.i=b),n.n=ie(d,w,n.n),k!==n.s&&(u.innerHTML=n.s=k),n.h=ie(g,T,n.h),n.r=ie(p,D,n.r),E!==n.d&&(v.innerHTML=n.d=E),n.l=ie(y,L,n.l),I!==n.u&&(x.innerHTML=n.u=I),n.c=ie(A,O,n.c),M!==n.w&&(C.innerHTML=n.w=M),$!==n.m&&(P.disabled=n.m=$),n.f=ie(P,N,n.f),H!==n.y&&(S.innerHTML=n.y=H),n}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0}),o;var o,i,a,s,l,c,d,u,g,p,h,v,y,b,x,A,w,C,k,P,S}ne(["click"]);var Vt=te("<div><p><span>"),Wt=te("<div><div><div><span></span></div><button class=give-freely-close-button aria-label=Close>×</button></div><hr><div><span>");function zt(e){const[t,n]=f(null),r=et();let o;return w((()=>clearInterval(o))),A((()=>{e.failedDonation||(()=>{const t=e.checkoutPopupConf.checkoutPopupDonationSuccessAutoCloseInSeconds??3;n(t),o=setInterval((()=>{n((t=>null===t||t<=1?(clearInterval(o),e.onClose(),0):t-1))}),1e3)})()})),i=Wt(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=s.nextSibling,d=a.nextSibling.nextSibling,u=d.firstChild,i.style.setProperty("font-size","14px"),c.$$click=()=>e.onClose(),d.style.setProperty("padding","30px"),d.style.setProperty("height","150px"),d.style.setProperty("font-size","14px"),se(i,G(X,{get when(){return!e.failedDonation},get children(){var e=Vt(),n=e.firstChild,o=n.firstChild;return m((e=>{var i=pe.autoClosingLabel,a=tt.formatMessage(r("donate.autoClosing"),t()??0);return e.e=ie(n,i,e.e),a!==e.t&&(o.innerHTML=e.t=a),e}),{e:void 0,t:void 0}),e}}),null),m((t=>{var n={...pe.header,"flex-direction":"row"},o={...pe.headingGrow,"margin-top":"20px",..."v2"===e.checkoutPopupConf.checkoutPopupDesignVersion?{color:pe.titleV2.color}:{}},i=e.failedDonation?r("donate.failTitle"):r("donate.title"),d={...pe.closeButton,"align-self":"flex-start"},g=e.failedDonation?r("donate.failContent"):r("donate.content");return t.e=ie(a,n,t.e),t.t=ie(s,o,t.t),i!==t.a&&(l.innerHTML=t.a=i),t.o=ie(c,d,t.o),g!==t.i&&(u.innerHTML=t.i=g),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i;var i,a,s,l,c,d,u}ne(["click"]);var qt=te("<dialog popover=manual><div>");function Kt(e){const[t,n]=f("main"),[r,o]=f(),[i,a]=f(!1),[s,l]=f(!1);let c;A((()=>{if(c)try{e.checkoutPopupConf.containerStyle?.showAsModal?c.showModal():c.showPopover(),c.focus(),c.blur()}catch(t){e.logger.error("Failed to show popup",{error:t})}}));const d=()=>{e.logger.debug("Close button clicked"),e.onClose()},u=async(t,r=!1)=>{r&&e.onClose(),e.logger.info("Charity selected",{charity:t,domain:e.activeDomain.domain}),o(t);try{const o=await e.onDonate(t,e.activeDomain);if(r)return;a(!o),n("donate")}catch(t){e.logger.error("Error during donation activation",{error:t,domain:e.activeDomain.domain}),r||(a(!0),n("donate"))}},g=()=>{e.logger.debug("Suppress button clicked"),n("goodbye")},p=()=>{e.logger.debug("Navigating back to main screen"),n("main")},h=t=>{e.logger.info("User chose to hide popup",{days:t}),e.onClose(t)};let v;return y=qt(),b=y.firstChild,"function"==typeof c?ae(c,y):c=y,"function"==typeof v?ae(v,b):v=b,se(b,G(X,{get when(){return"main"===t()},get children(){return G(Rt,{setBackdropHidden:l,mainContainerRef:v,dialogRef:c,get checkoutPopupConf(){return e.checkoutPopupConf},get activeDomain(){return e.activeDomain},get merchantRates(){return e.merchantRates},onClose:d,onCharitySelect:u,onSuppress:g,get onOfferDetailsClick(){return e.onOfferDetailsClick},get logger(){return e.logger}})}}),null),se(b,G(X,{get when(){return"goodbye"===t()},get children(){return G(jt,{get checkoutPopupConf(){return e.checkoutPopupConf},onClose:()=>e.onClose(),onBack:p,onGoodbye:h,setScreen:n})}}),null),se(b,G(X,{get when(){return"donate"===t()},get children(){return G(zt,{get checkoutPopupConf(){return e.checkoutPopupConf},get selectedCharity(){return r()},onClose:()=>e.onClose(),get failedDonation(){return i()},setScreen:n})}}),null),m((t=>{var n,r,o=s()?"backdrop-hidden":"",i={...pe.container,...e.checkoutPopupConf.containerStyle?.customStyle??{}},a=e.elementId,l={...pe.scroller,..."v2"===e.checkoutPopupConf.checkoutPopupDesignVersion?{"overflow-x":"visible","overflow-y":"visible"}:{}};return o!==t.e&&(n=y,null==(r=t.e=o)?n.removeAttribute("class"):n.className=r),t.t=ie(y,i,t.t),a!==t.a&&re(y,"id",t.a=a),t.o=ie(b,l,t.o),t}),{e:void 0,t:void 0,a:void 0,o:void 0}),y;var y,b}function Yt(e){const t=["",".asp",".aspx",".php",".js",".htm",".html"],n=["cart","checkout","shopping-bag","shopping-basket","shopping-cart","basket"].flatMap((e=>t.map((t=>e+t)))).filter((e=>"basket"!==e)),r=["tote-cart","tote.cart"],o=e,i=n.filter((e=>o.includes(e))),a=o.split("/");return!a.some((e=>r.some((t=>e.includes(t)))))&&(a.some((e=>n.some((t=>e.startsWith(t)||e.endsWith(t)))))||"basket"===a[a.length-1].toLowerCase()||i.length>1||1===i.length&&o.includes("shopping"))}function Xt(e,t){const n=["book"];return e.split("/").some((e=>n.some((t=>e.startsWith(t)||e.endsWith(t)))))&&null!=t.evaluate("//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6][contains(., 'Your Reservation') or contains(., 'Your reservation')]",t,null,XPathResult.ANY_TYPE,null)?.iterateNext()}async function Zt(e){try{const t=await ke({type:$e,payload:{shopId:e}});return t.payload.found&&t.payload.domain?t.payload.domain:null}catch{return null}}function Jt(e){try{const e=Array.from(document.querySelectorAll("script"));for(const t of e){if(t.dataset?.shopId&&(t.dataset?.shopId?.startsWith("gid")||t.src.includes("shopify"))){const e=parseInt(t.dataset.shopId.replace("gid://shopify/Shop/",""));if(!Number.isNaN(e)&&e>0)return e}const e=t.textContent||"";if(e.includes("ShopifyAnalytics")&&e.includes("shopId")){const t=e.match(/shopId['"]*:\s*['"]*(\d+)['"]*[,}]/);if(t&&t[1]){const e=parseInt(t[1]);if(!Number.isNaN(e)&&e>0)return e}}}const t=document.querySelector("[data-shop-id]");if(t instanceof HTMLElement){const{shopId:e}=t.dataset;if(e){const t=parseInt(e);if(!Number.isNaN(t)&&t>0)return t}}const n=window?.ShopifyAnalytics?.lib?.trekkie?.defaultAttributes?.shopId;return n&&parseInt(n)||0}catch(t){return e.error("Error accessing ShopifyAnalytics:",t),0}}function Qt(){try{if(!window.location.href.startsWith("https://shop.app"))return 0;const e=document?.head?.querySelector('meta[name="store"][content]');if(!e)return 0;try{const t=JSON.parse(e.content);return t?.id||0}catch{return 0}}catch{return 0}}const en=xe.getInstance();function tn(e,t,n){try{en.debug("Checking merchant regex rules",{currentUrl:t});const r=e.merchantPopupRules.filter((e=>n===e.domain||n.endsWith(`.${e.domain}`)));if(0===r.length)return en.debug("No matching merchant rules found for domain",{currentUrl:t}),!1;for(const e of r)for(const n of e.rules)try{if(new RegExp(n.rule).test(t))return en.debug("Merchant regex rule matched",{merchant:e.name,rule:n.rule,currentUrl:t}),!0}catch(t){en.error("Invalid regex in merchant rule",{merchant:e.name,rule:n.rule,error:t})}return en.debug("No matching regex rules found",{currentUrl:t}),!1}catch(e){return en.error("Error in merchantRegexRule",e),!1}}function nn(e){if(e?.customLanguageDetection&&e.customLanguageDetection.length>0){const t=window.location.href,n=document.body.textContent?.toLowerCase()||"";for(const r of e.customLanguageDetection)try{if(new RegExp(r.urlPattern).test(t))for(const[e,t]of Object.entries(r.keywords))if(n.includes(e.toLowerCase()))return t}catch(e){xe.getInstance().warn(`Invalid regex pattern in customLanguageDetection: ${r.urlPattern}`,e)}}const t=document.documentElement.lang,n=document.querySelector('meta[http-equiv="Content-Language"]')?.content,r=document.querySelector('link[rel="alternate"][hreflang]')?.getAttribute("hreflang"),o=navigator.language,i=t||n||r||o||"en";return"string"==typeof i?i.split("-")[0]:"en"}function rn(e){return!0!==e.checkoutPopupOnlyShowLanguageMatch||"en"===nn(e)}const on=(e,t=!1)=>e.length<2&&t?null:Array.from(e).filter((e=>!t||e.dataset.extensionId!==browser.runtime.id)).map((e=>e.dataset.extensionName)).join(",");const an=e=>{const t=y((()=>({translate:e.translate()||(e=>""),translateArray:e.translateArray()||(e=>[]),getAllCharities:e.charities()||(()=>[])})));return G(Je.Provider,{value:t,get children(){return e.children}})},sn=xe.getInstance(),ln=e=>/^https?:\/\/(?:www\.)?google\.[a-z]{2,}(\.[a-z]{2})?\/search\?(?:.*&)?q=[^&]+(?:&.*)?$/.test(e),cn='.yuRUbf a, .MjjYud a, a[jsname="UWckNb"], a[data-pcu]',dn=e=>{const t=null!==e.querySelector('[data-text-ad="1"]'),n=e.querySelector('span:not(.a-no-hover-link):is(:where(*, [role="text"]))'),r=n&&(n.textContent?.includes("Sponsored")||n.textContent?.includes("Ad"));return t||(r??!1)},un=async(e,t,n,r)=>{const{translations:o,charities:i}=await async function(e,t,n){try{t&&t.debug("Getting language content",{languageCode:e});const r=await ke({type:Ne,payload:{lang:e,activeDomain:n}});return{translations:r.payload.translations,charities:r.payload.charities}}catch(n){return t&&t.error("Error getting language content",{error:n,languageCode:e}),{translations:null,charities:null}}}(n,e,r);return{translate:e=>{const t=o?.[e];return"string"==typeof t?t:""},translateArray:e=>{const t=o?.[e];return Array.isArray(t)?t:[]},getAllCharities:()=>Object.entries(t).map((([e,t])=>{const{ein:n}=t;try{const r=i?.[n];if(!r)throw new Error(`Failed to find charity metadata for ein ${n}`);return{ein:n,tpi:r.tpi,title:r.title,order:parseInt(e,10),logo:r.logo,decorator:t.decorator,decoratorLeftStyle:t.decoratorLeftStyle,decoratorRightStyle:t.decoratorRightStyle}}catch{return{ein:n,tpi:"",title:"",order:9,logo:""}}}))}};var gn=te("<span> Loading...");const pn=3e5,hn=async()=>await We.get(Fe)??{};var fn=te('<div><div><div></div><div><small><a target=_blank rel="noreferrer noopener"></a><br><a href=#></a></small></div></div><div><div><div><a><div><div></div><div><span></span><span></span></div></div></a></div><a><h3></h3></a></div><div>');const mn=(vn=function(e){let t;const[n,r]=f(!1),o=et(),i={boxContainer:{"max-width":"700px",margin:"20px 0px",padding:"0px",border:(a=(()=>{if("undefined"==typeof window)return!1;if(!document.body)return!1;const e=document.body,t=window.getComputedStyle(e).backgroundColor.match(/\d+/g);if(!t||t.length<3)return window.matchMedia("(prefers-color-scheme: dark)").matches;const[n,r,o]=t.map(Number);return.299*n+.587*r+.114*o<128})())?"1.5px solid #b59410":"1.5px solid #fce68a","border-radius":"5px"},link:{color:a?"#99C3FF":"#1A0DAA"},boxHeader:{display:"flex","background-color":a?"#4a3d05":"#fffbea","border-bottom":a?"1.5px solid #b59410":"1.5px solid #fce68a",padding:"7px","border-radius":"5px 5px 0px 0px","align-items":"center",gap:"10px"},boxHeaderOptions:{"margin-left":"auto","white-space":"nowrap","font-size":"12px","padding-top":"2px"},siteName:{color:a?"#dadce0":"#202124","font-size":"14px",display:"block","line-height":"20px","white-space":"nowrap","text-overflow":"ellipsis",width:"auto"},imgContainer:{"background-color":"transparent","border-radius":"50%",display:"inline-flex","justify-content":"center","align-items":"center",height:"26px",width:"26px","margin-right":"12px","vertical-align":"middle"},img:{height:"26px",width:"26px"},description:{margin:"7px 0px 0px",color:a?"#bfbfbf":"#4d5156","line-height":1.58,"font-size":"14px"},citation:{color:a?"#bdc1c6":"#4d5156","font-size":"12px"}};var a;let s=!1;const l=async(t,n)=>{if("click"===t.type){if(t.preventDefault(),s)return;s=!0}const r=e.domainData.shouldStandDown&&!e.domainData.currentlyActivated,o=[];r||o.push((async e=>{try{const t=await hn();t[e]=Date.now(),await We.set(Fe,t)}catch{}})(parseInt(e.domainData.activeDomain.merchantId))),e.serpLoggingEnabled&&o.push(qe.trackEvent(me.checkoutPopupGooglePartnerAnnClicked,{url:globalThis.window.location.href,activeDomain:e.domainData.activeDomain.domain,isLinkWithNoActivation:r,clickEvent:t.type})),"click"===t.type&&(await Promise.all(o).catch((()=>{})),window.location.assign(n)),"contextmenu"===t.type&&Promise.all(o)},c=async e=>{const n=e.target.closest("a");n&&t?.contains(n)&&await l(e,n.href)};return d=fn(),u=d.firstChild,g=u.firstChild,p=g.nextSibling,h=p.firstChild.firstChild,v=h.nextSibling.nextSibling,x=(b=(y=u.nextSibling).firstChild).firstChild,w=(A=x.firstChild).firstChild,k=(C=w.firstChild).nextSibling,P=k.firstChild,S=P.nextSibling,D=(T=x.nextSibling).firstChild,E=b.nextSibling,g.style.setProperty("font-size","14px"),v.$$click=t=>{t.preventDefault(),Cn(),e.serpLoggingEnabled&&qe.trackEvent(me.checkoutPopupGooglePartnerAnnHidden,{url:globalThis.window.location.href,activeDomain:e.domainData.activeDomain.domain}),r(!0)},se(v,(()=>o("serpBanner.hide"))),y.style.setProperty("padding","10px"),b.style.setProperty("display","inline-flex"),b.style.setProperty("flex-direction","column"),b.style.setProperty("gap","10px"),A.$$contextmenu=t=>l(t,e.url),A.$$click=t=>l(t,e.url),A.style.setProperty("text-decoration","none"),w.style.setProperty("display","inline-flex"),w.style.setProperty("align-items","center"),k.style.setProperty("display","flex"),k.style.setProperty("flex-direction","column"),k.style.setProperty("gap","3px"),se(P,(()=>e.siteName)),se(S,(()=>e.citation)),T.$$contextmenu=t=>l(t,e.url),T.$$click=t=>l(t,e.url),D.style.setProperty("font-family","Google Sans, Roboto, Arial, sans-serif"),se(D,(()=>e.title)),E.$$contextmenu=c,E.$$click=c,"function"==typeof t?ae(t,E):t=E,m((t=>{var r={...i.boxContainer,display:n()?"none":"block"},a=i.boxHeader,s=yn(o("serpBanner.title"),e.siteName,e.domainData.activeDomain),l={...i.boxHeaderOptions,"text-align":"end"},c=i.link,f=e.learnMoreUrl,m=o("serpBanner.learnMore"),y=i.link,b=e.url,x=e.imgContents,w=i.siteName,k=i.citation,D=e.url,L=i.description,I=e.description||"";return t.e=ie(d,r,t.e),t.t=ie(u,a,t.t),s!==t.a&&(g.innerHTML=t.a=s),t.o=ie(p,l,t.o),t.i=ie(h,c,t.i),f!==t.n&&re(h,"href",t.n=f),m!==t.s&&(h.innerHTML=t.s=m),t.h=ie(v,y,t.h),b!==t.r&&re(A,"href",t.r=b),x!==t.d&&(C.innerHTML=t.d=x),t.l=ie(P,w,t.l),t.u=ie(S,k,t.u),D!==t.c&&re(T,"href",t.c=D),t.w=ie(E,L,t.w),I!==t.m&&(E.innerHTML=t.m=I),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0}),d;var d,u,g,p,h,v,y,b,x,A,w,C,k,P,S,T,D,E},e=>{const[t]=b((()=>({lang:e.currentLanguage,logger:e.logger,list:e.charitiesList,activeDomain:e.activeDomain})),(async e=>un(e.logger,e.list,e.lang,e.activeDomain))),n=()=>t()?.translate,r=()=>t()?.translateArray,o=()=>t()?.getAllCharities;return G(X,{get when(){return!t.loading},get fallback(){return gn()},get children(){return G(an,{translate:n,translateArray:r,charities:o,get children(){return G(vn,e)}})}})});var vn;const yn=(e,t,n)=>e.replace("{0}",Ye(n.commission.kind,n.commission.amount.toString())).replace("{1}",t??n.merchantName);ne(["click","contextmenu"]);const bn=async(e,t)=>{const n=((e=!0)=>{const t=((e=!0)=>{const t=Array.from(globalThis.window.document.querySelectorAll("#rso > div, #tads > div, #rso .MjjYud"));return e?t.filter((e=>!dn(e))):t})(e),n=[];return t.forEach((e=>{const t=e.querySelector(cn);if(t){let r=t.href;if(r&&r.includes("/url?q="))try{const e=new URLSearchParams(new URL(r).search).get("q");e&&(r=e)}catch{}r&&r.startsWith("http")&&n.push({url:r,container:e})}})),n})(),r=await xn(n.map((e=>e.url)));e&&qe.trackEvent(me.checkoutPopupGoogleSearch,{url:globalThis.window.location.href,partnersFound:Object.entries(r).map((([e,t])=>({url:e,partner:t.activeDomain}))),isPartnerBoxMuted:t});const o=n.find((e=>r[e.url]));if(o){const e=(e=>{const t=e.querySelector("h3"),n=e.querySelector('.VuuXrf, span[role="text"]')?.innerText,r=e.querySelector("cite")?.textContent,o=e.querySelector(cn),i=o?.querySelector("img")?.parentElement?.parentElement?.outerHTML,a=e.querySelector('.VwiC3b, .kb069e, div[style*="-webkit-line-clamp"]');return{title:t?.textContent?.trim()??null,siteName:n,citation:r,imgContents:i,description:a?.innerHTML?.trim()??null}})(o.container);return{...o,...e,domainData:r[o.url]}}return null},xn=async e=>{const{payload:t}=await Pe({type:He,payload:{urls:e}});return t.result},An=e=>!!e.partnerSerpBox?.enabled,wn=async()=>!!await We.get("gf_partner_serp_muted"),Cn=async()=>{await ke({type:Re,payload:{}})};function kn(e,t){const n={...e};for(const r of Object.keys(t)){const o=e[r],i=t[r];void 0!==i&&(Array.isArray(i)?n[r]=[...i]:n[r]=null!==i&&"object"==typeof i&&null!==o&&"object"==typeof o?kn(o,i):i)}return n}var Pn=te("<div class=gf-app>");function Sn(e){const[t,n]=f(void 0),[r,o]=f(!1),[i,a]=f([]),[s,l]=f(),[c,d]=f(e.popupConfig);let u,g,p;v((()=>{const n=t();if(n){e.logger.debug("Looking up config for active domain",n);const t=function(e,t,n){const r=e.providerOverrides?.[t.provider];if(!r)return e;const{siteOverrides:o,...i}=r;let a=kn(e,i);n?.debug("resolveForOffer: applied provider overrides",{provider:t.provider,providerFields:i});const s=o?.[t.domain];return s&&(a=kn(a,s),n?.debug("resolveForOffer: applied site overrides",{domain:t.domain,siteFields:s})),a}(e.popupConfig,n,e.logger);if(d(t),g=u?t.charities?.[u.toLowerCase()]??t.charities?.[je]:void 0,g){const r=nn(t);un(e.logger,g,r,n).then(l)}}})),A((async()=>{e.logger.info("Mounting GfApp component");try{(function(e){if(!e?.shouldCheckSiteMatches)return;let t;(e?.siteMatchesRegex??[]).some((e=>{var n;return n=window.location.href,!(!new RegExp(e).test(n)||(t=e,0))}))&&t&&qe.trackEvent(me.checkoutPopupSiteMatches,{url:window.location.href,matchedRule:t,uts:Date.now()},!0)})(e.popupConfig),(async()=>{try{const e=await hn();for(const t in e)e[t]&&Date.now()-e[t]>pn&&delete e[t];await We.set(Fe,e)}catch{}})(),u=await(async()=>await We.get(Be)||(async()=>{sn.debug("detecting country");const e={method:"GET",headers:{"Content-Type":"application/json",Authorization:"Basic OTEzOTkxOnFlYmpaWF9DOGNRY0lxSHA4WTVjNGxzU1pRSlM2VW9MMExzTF9tbWs="}};try{const t=await fetch("https://geoip.maxmind.com/geoip/v2.1/country/me",e);if(sn.debug("Received geolocation response",{status:t.status}),!t.ok)return void sn.error("Failed to get geolocation data",{status:t.status,statusText:t.statusText});const n=await t.json();if(!n)throw new Error("There was an error fetching geoip look up");return await We.set(Be,n.country.iso_code),n.country.iso_code}catch(e){return void sn.error("Failed to get geolocation data",{error:e},!0)}})())()??je;const i=e.popupConfig.charities?.[u.toLowerCase()]??e.popupConfig.charities?.[je];g=i,e.logger.debug("Charities for current country",{currentCountry:u,charities:i});const s=nn(e.popupConfig);e.logger.debug("Setting content provider with translations and charity functions"),un(e.logger,i,s).then(l);const c=ze();if(e.popupConfig.minVersion&&((e,t)=>{if(e===t)return!1;const n=e.split(".").map((e=>parseInt(e,10))),r=t.split(".").map((e=>parseInt(e,10)));for(let e=0;e<n.length;e++){if(n[e]<r[e])return!0;if(n[e]>r[e])return!1}return!1})(c,e.popupConfig.minVersion))return void e.logger.debug(`Current version: ${c}. Minimum version ${e.popupConfig.minVersion} not met`);if(!1===e.popupConfig.checkoutPopupMasterSwitch)return void e.logger.debug("Checkout popup master switch is disabled");const d=document.getElementsByClassName("give-freely-root");let h=!1;if(d.length>1&&(e.logger.debug("There is more than one gf extension installed"),d.item(0).dataset.extensionId!==browser.runtime.id&&(e.logger.debug("Giving preference to the first gf extension injected in the DOM"),h=!0),e.logger.debug("Providing this extension preference over the other installed extensions")),!h&&ln(window.location.href)&&(e.logger.debug("This is a google search result page."),(async(e,t,n,r)=>{if(An(r)){const o=await wn(),i=!!r.enhancedLogging;e.debug("Serp partner box enabled. Looking for partner in search results");const a=await bn(i,o);if(!o&&a&&r.partnerSerpBox?.learnMoreUrl)return void((e=>{const t=document.querySelector('div[data-subtree="mfc"], .fG8Fp'),n=document.getElementById("atvcap")??document.getElementById("tads")??document.getElementById("search");return t?(t.insertAdjacentElement("afterend",e),!0):!!n&&(n.prepend(e),!0)})((e=>{const t=document.createElement("div");return ee((()=>G(mn,q(e,{get activeDomain(){return e.domainData.activeDomain}}))),t),t})({...a,currentLanguage:n,logger:e,learnMoreUrl:r.partnerSerpBox?.learnMoreUrl,charitiesList:t,serpLoggingEnabled:i}))?(e.info("Partner found and banner injected"),i&&qe.trackEvent(me.checkoutPopupGooglePartnerAnnCreated,{url:globalThis.window.location.href,activeDomain:a.domainData.activeDomain})):e.warn("Partner found but banner couldn't be injected"));e.info("Couldn't find partners in search results")}})(e.logger,i,s,e.popupConfig)),!1===e.popupConfig.popupEnabled)return void e.logger.debug("Popup is disabled.");const{domain:f}=await(async e=>{const{hostname:t}=window.location;e.debug("Checking if domain is active",{hostname:t});const n=await ke({type:Ee,payload:{hostname:t}});return n.payload.isActive?(e.debug("Active domain",{domain:n.payload.domain}),e.info("Domain and rates ({})ed successfully."),{isActive:!0,domain:n.payload.domain}):{isActive:!1,domain:void 0}})(e.logger);if(f&&a(f.rates),n(f),f)a(f.rates),await function(e,t){const n=Jt(t)||Qt();return n>0&&function(e,t,n){if(e&&!(e<=0))try{ke({type:Me,payload:{shopId:e,domain:t}}).catch((e=>{n.error("Error sending shop ID to background:",e)}))}catch(e){n.error("Error sending Shopify shop ID:",e)}}(n,e,t),n}(f,e.logger);else{if("shop.app"!==window.location.hostname&&!window.location.hostname.endsWith(".shop.app"))return void o(!1);const t=window.location.pathname.split("/")[2];if(!t)return e.logger.error("Shop ID not found"),void o(!1);const r=await Zt(parseInt(t));if(!r)return e.logger.error("Shop domain not found"),void o(!1);e.logger.debug("Shop domain found",{shopDomain:r}),n(r)}const m=await(async e=>{const t=await We.get("popup_hide");if(!t)return e.debug("No expiry found in storage"),!1;const{popupHide:n}=t,r=!!n&&Date.now()<n;return e.debug("Is Donation Popup Muted?",{isMuted:r,expiry:n}),r})(e.logger);if(m)return;if(!t())return void o(!1);const{result:v,reason:y}=await(async(e,t)=>{const n=window.location.href,r=document.cookie,{payload:o}=await ke({type:Ie,payload:{activeDomain:t,url:n,cookies:r}});return o.result&&e.info("Stand Down detected"),o})(e.logger,t());if(v)return o(!1),void(y&&e.popupConfig.enhancedLogging&&qe.trackEvent(me.checkoutPopupStoodDown,{reason:y,domain:t()?.domain}));const b=e.popupConfig?.anonymousActiveDomainLogging??!1,x=t()??void 0;x&&b&&!function(e){const t=`gfhv-${e}`;return!!sessionStorage.getItem(t)||(sessionStorage.setItem(t,"true"),!1)}(x.domain)&&qe.trackEvent(me.checkoutPopupActiveDomain,{url:x.domain}),p=window.setInterval((async()=>{let t=!1;return x&&(e.logger.debug("Checking if we should popup anywhere"),t=await(async e=>{try{const t=await hn();if(t[e])return Date.now()-t[e]<pn}catch{}return!1})(parseInt(x.merchantId)),e.logger.debug("We should popup anywhere",t)),t||(e.logger.debug("Checking checkout rules"),t=await(async e=>{const t=xe.getInstance();t.configure({enabled:!0,title:"Content - checkoutRulesTest"});const n=new URL(globalThis.location.href),r=n.href,{hostname:o}=n;t.debug("Checking if popup should be shown",{currentUrl:r});const i=await async function(e){const t=Jt(e)||Qt();return!("shop.app"!==window.location.hostname&&!window.location.hostname.endsWith(".shop.app")||!(t>0)||!await Zt(t))}(t),a=rn(e)&&(Yt(n.pathname.toLowerCase())||Xt(r,document)||tn(e,r,o)||i);return t.debug("Popup show decision based on rules",{shouldShow:a,matchesCartRule:Yt(n.pathname.toLowerCase()),matchesBookingRule:Xt(r,document),matchesShopPayRule:i,matchesMerchantRegexRule:tn(e,r,o),matchesLanguageRule:rn(e)}),a})(e.popupConfig),e.logger.debug("Should show popup based on checkout rules",{shouldShowResult:t})),t&&h?(qe.trackEvent(me.checkoutPopupLooserExtension,{url:globalThis.window.location.href,winner:d.item(0).dataset.extensionName}),e.logger.debug("Standing down because, another GiveFreely extension will pop"),void clearInterval(p)):t&&globalThis.window.matchMedia("(max-width: 600px), (max-height: 480px)").matches?(e.logger.debug("Viewport too small for displaying the popup"),r()&&qe.trackEvent(me.checkoutPopupHiddenProgrammatically,{url:globalThis.window.location.href,merchantId:x?.merchantId,reason:"Viewport size became too small"}),o(!1),void qe.trackEvent(me.checkoutPopupNotShownPerViewportSize,{url:globalThis.window.location.href,pageLanguage:s,merchantId:x?.merchantId,viewPortSize:{height:globalThis.window.innerHeight,width:globalThis.window.innerWidth}})):(t&&!r()&&qe.trackEvent(me.checkoutPopupShown,{url:globalThis.window.location.href,pageLanguage:s,merchantId:x?.merchantId,domainId:x?.id,provider:x?.provider,looserCompetingExtensions:on(d,!0)}),!t&&r()&&qe.trackEvent(me.checkoutPopupHiddenProgrammatically,{url:globalThis.window.location.href,merchantId:x?.merchantId,domainId:x?.id,reason:"Checkout rules no longer matched"}),void o(t))}),2e3)}catch(t){o(!1),e.logger.error("An error occurred in GfApp",{error:t})}})),w((()=>{p&&window.clearInterval(p)}));const h=async(t,n)=>{e.logger.info("Processing donation",{charity:t,domain:n.domain});const r=crypto.randomUUID(),o=await Tt(e.logger,n,window.location.href,{ein:t.ein,thirdPartyId:t.tpi},r);return e.logger.debug("Activate offer response",{activationResponse:o}),qe.trackEvent(o.payload.response?me.checkoutPopupDonation:me.checkoutPopupFailedActivation,{activeDomain:n.domain,url:globalThis.window.location.href,merchantId:n?.merchantId,domainId:n?.id,provider:n?.provider,charity:{ein:t.ein,tpi:t.tpi},rate:n.commission,gfCommissionUniqueId:r}),o.payload.response},m=async n=>{o(await(async(e,t)=>{try{e.info("Hiding popup",{days:t});const n=await Pe({type:Te,payload:{days:t??0}});return void 0!==t&&qe.trackEvent(me.checkoutPopupSupressed,{url:globalThis.window.location.href,days:t}),e.info("Hiding popup response",{hideResponse:n}),n.payload.ack?(e.debug("Popup hidden successfully"),!1):(e.warn("Failed to hide popup"),!0)}catch{return!1}})(e.logger,n)),p&&window.clearInterval(p),t()&&(async e=>{try{const t=await hn();t[e]&&delete t[e],await We.set(Fe,t)}catch{}})(parseInt(t().merchantId))},b=async e=>{qe.trackEvent(me.checkoutPopupOfferDetailsClicked,{action:e?"opened":"closed"})};return G(an,{translate:()=>s()?.translate,translateArray:()=>s()?.translateArray,charities:()=>s()?.getAllCharities,get children(){var n,o=Pn();return se(o,(n=y((()=>!(!t()||!r()))),()=>n()&&G(Kt,{get checkoutPopupConf(){return c()},elementId:"give-freely-checkout-popup",get activeDomain(){return t()},get merchantRates(){return i()},onClose:m,onDonate:h,onOfferDetailsClick:b,get logger(){return e.logger}}))),o}})}exports.browser=browser,exports.initialize=async function(){const e=`give-freely-root-${browser.runtime.id}`;if(document.getElementById(e))return;const t=document.createElement("div");t.id=e,t.className="give-freely-root",t.style.display="block",t.dataset.extensionId=browser.runtime.id,t.dataset.extensionName=browser.runtime.getManifest().name||browser.runtime.id,document.body.appendChild(t);const n=t.attachShadow({mode:"open"}),r=document.createElement("div"),o=xe.getInstance(),i=await(async()=>{const e=await Pe({type:De,payload:{}});if(!e?.payload?.config)throw new Error("No checkout popup config found");return e.payload.config})();if(!i)return void o.error("No GF config found");o.configure({enabled:i.checkoutPopupLoggerEnabled??!0,title:"Content - Donation popup",minLevel:i.checkoutPopupMinLogLevel??"error"});const a=(s=i.containerStyle?.backdropColor,`\n :host {\n all: initial;\n }\n\n .gf-scroll-remove::-webkit-scrollbar {\n border-radius-bottom-right: 15px;\n }\n\n button {\n cursor: pointer;\n transition: transform 0.1s ease;\n }\n\n button:active {\n transform: scale(0.98);\n }\n\n .give-freely-close-button:hover {\n opacity: 0.7;\n }\n\n input[type="radio"] {\n margin-right: 8px;\n }\n\n hr {\n border: none;\n border-top: 1px solid #e5e5e5;\n margin: 1em 0;\n }\n\n dialog::backdrop {\n background-color: ${s||"revert"};\n }\n\n dialog.backdrop-hidden::backdrop {\n background-color: transparent;\n }\n`);var s;const l=document.createElement("style");l.textContent=a,n.appendChild(l),n.appendChild(r),i.countAppearances&&async function(e){try{const t=globalThis.window.location.href,n=ln(t);if(e.debug("Is a Google search result page?",n),!n)return!1;const r=(()=>{const e=globalThis.window.document.querySelectorAll("#rso > div, #tads > div"),t=[];return e.forEach((e=>{const n=dn(e),r=e.querySelector(cn);if(r){let e=r.href;if(e&&e.includes("/url?q="))try{const t=new URLSearchParams(new URL(e).search).get("q");t&&(e=t)}catch{}e&&e.startsWith("http")&&t.push({url:e,isSponsored:n??!1})}})),t})();if(e.info("The following search results were identified",r),!r||0===r.length)return!1;const o=await ke({type:Le,payload:{currentUrl:t,searchResults:r,source:"google"}});return o?.payload?.result??!1}catch(t){return e.error("Error while identifying search results",t),!1}}(o),ee((()=>G(Sn,{popupConfig:i,logger:o})),r)};
2
2
  //# sourceMappingURL=GiveFreely-content.cjs.js.map