1(()=>{"use strict";const e=window.wp.element,t=window.wp.hooks,o=window.ReactJSXRuntime,r=e=>{const{fill:t="#0FA961",...r}=e;return(0,o.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[(0,o.jsx)("path",{d:"M97.0156 9.74499C120.404 0.0570803 146.141 -2.47884 170.971 2.45983C195.8 7.39873 218.609 19.59 236.51 37.4911L200.307 73.6942C189.566 62.9535 175.88 55.64 160.982 52.6766C146.085 49.7134 130.643 51.233 116.609 57.0458C102.576 62.8586 90.5814 72.7032 82.1426 85.3329C73.7038 97.9625 69.1992 112.811 69.1992 128.001C69.1992 140.594 72.2983 152.952 78.166 164.007C78.2596 164.006 78.3534 164.001 78.4473 164.001C89.4146 164.001 98.5033 172.026 100.17 182.524C105.185 179.335 111.141 177.497 117.525 177.518C133.572 177.572 146.835 189.36 149.221 204.729C153.155 204.564 157.087 204.1 160.982 203.325C175.88 200.362 189.566 193.046 200.307 182.306L236.51 218.511C218.609 236.412 195.8 248.603 170.971 253.542C146.141 258.48 120.404 255.945 97.0156 246.257C73.6273 236.569 53.6369 220.163 39.5723 199.114C25.5075 178.065 18 153.317 18 128.001C18 102.685 25.5074 77.9371 39.5723 56.8876C53.6369 35.8385 73.6272 19.433 97.0156 9.74499Z",fill:t}),(0,o.jsx)("path",{d:"M164 140.001C170.627 140.001 176 145.373 176 152.001C176 158.628 170.627 164.001 164 164.001C157.373 164.001 152 158.628 152 152.001C152 145.373 157.373 140.001 164 140.001Z",fill:t}),(0,o.jsx)("path",{d:"M108 108.001C114.627 108.001 120 113.373 120 120.001C120 126.628 114.627 132.001 108 132.001C101.373 132.001 96.0004 126.628 96 120.001C96 113.373 101.373 108.001 108 108.001Z",fill:t}),(0,o.jsx)("path",{d:"M152 76.0008C158.627 76.0008 164 81.3734 164 88.0008C164 94.6279 158.627 100.001 152 100.001C145.373 100.001 140 94.6279 140 88.0008C140 81.3734 145.373 76.0008 152 76.0008Z",fill:t})]})},n=window.wp.i18n,s=window.React,i=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,o)=>o?o.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},a=(...e)=>e.filter((e,t,o)=>Boolean(e)&&""!==e.trim()&&o.indexOf(e)===t).join(" ").trim(),c=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const d=(0,s.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:n="",children:i,iconNode:d,...u},h)=>(0,s.createElement)("svg",{ref:h,...l,width:t,height:t,stroke:e,strokeWidth:r?24*Number(o)/Number(t):o,className:a("lucide",n),...!i&&!c(u)&&{"aria-hidden":"true"},...u},[...d.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(i)?i:[i]])),u=(e,t)=>{const o=(0,s.forwardRef)(({className:o,...r},n)=>{return(0,s.createElement)(d,{ref:n,iconNode:t,className:a(`lucide-${c=i(e),c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...r});var c});return o.displayName=i(e),o},h=u("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),b=u("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),k=u("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),p=u("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),g=e=>{const t=/^#?([a-f\d]{3}|[a-f\d]{6})$/i.exec(e||"");if(!t)return!1;const o=3===t[1].length?t[1].replace(/(.)/g,"$1$1"):t[1];return(.299*parseInt(o.slice(0,2),16)+.587*parseInt(o.slice(2,4),16)+.114*parseInt(o.slice(4,6),16))/255<.5},m=(e,{source:t=window.location?.hostname||"surecookie_plugin",medium:o="wordpress_plugin",campaign:r="core_plugin",content:n}={})=>{if(!e)return e;try{const s=new URL(e);return s.searchParams.set("utm_source",t),s.searchParams.set("utm_medium",o),s.searchParams.set("utm_campaign",r),n&&s.searchParams.set("utm_content",n),s.toString()}catch(t){return e}},f=window?.surecookieAdminData?.cookieCategories,_=(Array.isArray(f),window?.surecookieAdminData?.colorPalettes||{}
1),w=(Object.values(_),m("https://surecookie.com/share-usage-data/",{content:"usage_optin"}),(e,t="")=>{const o=window?.surecookieAdminData||window?.surecookieOnboardingData||window?.surecookiePublicSettings;return e&&o?.website_links?.[e]?o.website_links[e]:m(`https://surecookie.com/${t}`,{content:e})}),y=((0,n.__)("30 days","surecookie"),(0,n.__)("60 days","surecookie"),(0,n.__)("90 days","surecookie"),(0,n.__)("365 days","surecookie"),(0,n.__)("Never","surecookie"),new Set(["a","strong","em","b","i","u","s","br","hr","p","ul","ol","li","span","h1","h2","h3","h4","h5","h6","blockquote","pre"])),v={a:new Set(["href","title","target","rel"]),span:new Set(["style"]),strong:new Set,em:new Set,b:new Set,i:new Set,u:new Set,br:new Set,hr:new Set,p:new Set(["style"]),ul:new Set,ol:new Set,li:new Set},x=e=>{if(!e)return!1;const t=e.trim();if(t.startsWith("/")||t.startsWith("#")||t.startsWith("?"))return!0;try{const e=new URL(t,window.location.origin);return["http:","https:","mailto:","tel:"].includes(e.protocol)}catch{return!1}},C=(e,t)=>{if(1!==e.nodeType)return;const o=e.tagName.toLowerCase();if(!y.has(o)){for(const o of[...e.childNodes])C(o,t);const o=t.createDocumentFragment();for(;e.firstChild;)o.appendChild(e.firstChild);return void e.replaceWith(o)}for(const t of[...e.attributes]){const r=t.name.toLowerCase();(v[o]||new Set).has(r)?"a"!==o||"href"!==r||x(t.value)?"a"===o&&"target"===r&&"_blank"!==t.value&&e.removeAttribute("target"):e.removeAttribute("href"):e.removeAttribute(t.name)}if("a"===o){const t=e.getAttribute("rel")||"",o=new Set(t.split(/\s+/).map(e=>e.trim().toLowerCase()).filter(Boolean));"_blank"===e.getAttribute("target")&&(o.add("noopener"),o.add("noreferrer")),o.add("nofollow"),e.setAttribute("rel",[...o].join(" "))}for(const o of[...e.childNodes])C(o,t)},S=e=>{if(!e)return"";if("undefined"==typeof window||"undefined"==typeof DOMParser)return"";const t=String(e),o=(new DOMParser).parseFromString(`<div>${t}</div>`,"text/html"),r=o.body.firstElementChild;if(!r)return"";for(const e of[...r.childNodes])C(e,o);return r.innerHTML},j=e=>String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),N=({modalDescription:e,cookiePolicyUrl:t,cookiePolicyTitle:o})=>{const r=S(e||"");if(!r.includes("{cookie_policy_link}"))return r;if(!t)return r.replace(/\s*\{cookie_policy_link\}\s*/g," ").replace(/\s+/g," ").trim();const s='<a href="'+j(t)+'" target="_blank" rel="noopener noreferrer" class="surecookie-modal-policy-link">'+j(o||(0,n.__)("Cookie Policy","surecookie"))+"</a>";return r.split("{cookie_policy_link}").join(s)},E=({isOpen:t,onClose:s,onSave:i,settings:a={},isPreview:c=!1})=>{const[l,d]=(0,e.useState)({}),[u,g]=(0,e.useState)([]),[m,f]=(0,e.useState)([]),[_,y]=(0,e.useState)([]),[v,x]=(0,e.useState)([]),[C,j]=(0,e.useState)(!0),[E,A]=(0,e.useState)(""),[O,P]=(0,e.useState)(window.innerWidth<=768),[D,M]=(0,e.useState)("cookies"),[I,L]=(0,e.useState)(!1),T=(0,e.useRef)(null),B=(0,e.useRef)(null),R=(0,e.useRef)(null);(0,e.useEffect)(()=>{t&&R.current&&(B.current=R.current.ownerDocument.activeElement)},[t]),(0,e.useEffect)(()=>{!t&&B.current&&(B.current.focus?.(),B.current=null)},[t]),(0,e.useEffect)(()=>{const e=window.matchMedia("(max-width: 768px)"),t=e=>P(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,e.useEffect)(()=>{const e=window.surecookiePublicSettings?.cookie_categories||{},t=a.cookie_categories&&Object.keys(a.cookie_categories).length?Object.values(a.cookie_categories):Object.values(e);g(t);const o=Object.values(a?.custom_cookies||{});f(o);const r={};t.forEach(e=>{r[e.id]="essential"===e.id});const n=localStorage.getItem("surecookie_preferences");if(n)try{const e=JSON.parse(n);t.forEach(t=>{"essential"===t.id?r[t.id]=!0:void 0!==e[t.id]&&(r[t.id]=e[t.id])}),d(r)}catch(e){d(r)}else d(r);j(!1)},[a.cookie_categories,a.custom_cookies,t]),(0,e.useEffect)(()=>{t||(y([]),M("cookies"),L(!1))},[t]);const q=Boolean(a.consent_forwarding_enabled??window?.surecookiePublicSettings?.consent_forwarding_enabled),$=Boolean(a.consent_forwarding_show_sites??window?.surecookiePublicSettings?.consent_forwarding_show_sites),W=a.consent_forwarding_partner_sites??window?.surecookiePublicSettings?.consent_forwarding_partner_sites,z=Array.isArray(W)?W:W&&"object"==typeof W?Object.values(W):[],U=[...new Set(z.filter(e=>"string"==typeof e&&/^https?:\/\//i.test(e)&&e.replace(/\/+$/,"")!==window.location.origin))],F=a.consent_forwarding_description??window?.surecookiePublicSettings?.consent_forwarding_description??"",J=(0,e.useMemo)(()=>S(F||""),[F]),K=q&&$;(0,e.useEffect)(()=>
1{if(t&&T.current){const e=setTimeout(()=>{T.current.focus()},100);return()=>clearTimeout(e)}},[t]);const H=(0,e.useCallback)(e=>e?Array.from(e.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')):[],[]),G=(0,e.useCallback)(e=>{if(!t)return;if("Escape"===e.key)return e.preventDefault(),void s();if("Tab"!==e.key)return;const o=H(T.current);if(0===o.length)return;const r=o[0],n=o[o.length-1];e.shiftKey?T.current.ownerDocument.activeElement===r&&(e.preventDefault(),n.focus()):T.current.ownerDocument.activeElement===n&&(e.preventDefault(),r.focus())},[t,s,H]);(0,e.useEffect)(()=>(document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)),[G]);const Z=()=>{const e={};u.forEach(t=>{e[t.id]=!0}),d(e),localStorage.setItem("surecookie_preferences",JSON.stringify(e)),window.surecookieManager&&window.surecookieManager.saveConsent(e,"accepted"),A((0,n.__)("All cookies accepted.","surecookie")),i(e)},X=()=>{const e={};u.forEach(t=>{"essential"===t.id?e[t.id]=!0:e[t.id]=!1}),d(e),localStorage.setItem("surecookie_preferences",JSON.stringify(e)),window.surecookieManager&&window.surecookieManager.saveConsent(e,"declined"),A((0,n.__)("Non-essential cookies rejected.","surecookie")),i(e)},Y=()=>{localStorage.setItem("surecookie_preferences",JSON.stringify(l)),window.surecookieManager&&window.surecookieManager.saveConsent(l,"partially_accepted"),A((0,n.__)("Preferences saved successfully.","surecookie")),i(l)},V=a.cookie_policy_page_url||window?.surecookiePublicSettings?.cookie_policy_page_url||"",Q=a.cookie_policy_page_title||window?.surecookiePublicSettings?.cookie_policy_page_title||"",ee=a.preferences_modal_heading||window?.surecookiePublicSettings?.preferences_modal_heading||"",te=a.preferences_modal_description||window?.surecookiePublicSettings?.preferences_modal_description||"",oe=a.text_color||"var(--surecookie-banner-text-color, #374151)",re=a.text_color||"var(--surecookie-banner-text-color, #ffffff)",ne=a.banner_bg_color||"var(--surecookie-banner-background-color, #111827)",se="#37415126",ie=(0,o.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"surecookie-sr-only",children:E});return t?(0,o.jsxs)("div",{ref:R,children:[ie,(0,o.jsx)("div",{className:"surecookie-modal-backdrop",onClick:s,children:(0,o.jsx)("div",{className:"surecookie-modal-wrapper",children:(0,o.jsxs)("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"surecookie-modal-title","aria-describedby":"surecookie-modal-description",className:"surecookie-preferences-modal",style:{backgroundColor:ne,color:oe,...a.banner_bg_color&&{"--surecookie-banner-background-color":a.banner_bg_color},...a.text_color&&{"--surecookie-banner-text-color":a.text_color},...a.accept_btn_color&&{"--surecookie-banner-primary-color":a.accept_btn_color},...a.decline_btn_color&&{"--surecookie-banner-secondary-color":a.decline_btn_color}},onClick:e=>e.stopPropagation(),tabIndex:"-1",children:[(0,o.jsxs)("div",{className:"surecookie-modal-header",children:[(0,o.jsxs)("div",{className:"surecookie-modal-header-text",children:[(0,o.jsx)("h2",{id:"surecookie-modal-title",className:"surecookie-modal-title",children:ee}),(0,o.jsx)("div",{id:"surecookie-modal-description",className:"surecookie-modal-description",dangerouslySetInnerHTML:{__html:N({modalDescription:te,cookiePolicyUrl:V,cookiePolicyTitle:Q})}})]}),(0,o.jsx)("button",{type:"button",className:"surecookie-modal-close-btn",onClick:s,"aria-label":(0,n.__)("Close privacy preferences dialog","surecookie"),children:(0,o.jsx)(h,{size:20,"aria-hidden":"true"})})]}),K&&(0,o.jsxs)("div",{className:"surecookie-modal-tabs",role:"tablist","aria-label":(0,n.__)("Preference sections","surecookie"),tabIndex:-1,onKeyDown:e=>{let t=null;"ArrowRight"===e.key||"ArrowLeft"===e.key?t="cookies"===D?"forwarding":"cookies":"Home"===e.key?t="cookies":"End"===e.key&&(t="forwarding"),t&&t!==D&&(e.preventDefault(),M(t),T.current?.ownerDocument?.getElementById(`surecookie-tab-btn-${t}`)?.focus())},children:[(0,o.jsx)("button",{type:"button",role:"tab","aria-selected":"cookies"===D,"aria-controls":"surecookie-tab-cookies",id:"surecookie-tab-btn-cookies",tabIndex:"cookies"===D?0:-1,className:"surecookie-modal-tab "+("cookies"===D?"active":""),onClick:()=>M("cookies"),children:(0,n.__)("Cookies","surecookie")}),(0,o.jsx)("button",{type:"button",role:"tab","aria-selected":"forwarding"===D,"aria-controls":"surecookie-tab-forwarding",id:"surecookie-tab-btn-forwarding",tabIndex:"forwarding"===D?0:-1,className:"surecookie-modal-tab "+("forwarding"===D?"active":""),onClick:()=>M("forwarding"),children:(0,n.__)("Consent Forwarding","surecookie")})]}),K&&(0,o.jsxs)("div",{id:"surecookie-tab-forwarding",role:"tabpanel","aria-labelledby":"surecookie-tab-btn-forwarding",className:"surecookie-forwarding-panel",hidden:"forwarding"!==D,children:[J&&(0,o.jsx)("div",{className:"surecookie-forwarding-description",dangerouslySetInnerHTML:{__html:J}}),U.length>0?(0,o.jsxs)("div",{className:"surecookie-forwarding-accordion",children:[(0,o.jsxs)("button",{type:"button",className:"surecookie-forwarding-toggle","aria-expanded":I,"aria-controls":"surecookie-forwarding-sites-list",onClick:()=>L(e=>!e),children:[(0,o.jsx)("span",{className:"surecookie-forwarding-count",children:(0,n.sprintf)(/* translators: %d: number of partner sites */ /* translators: %d: number of partner sites */ 2(0,n.__)("%d connected site(s)","surecookie"),U.length)}),(0,o.jsx)("span",{className:"surecookie-forwarding-chevron "+(I?"expanded":""),"aria-hidden":"true",children:(0,o.jsx)(b,{size:14,strokeWidth:2.5,focusable:"false"})})]}),(0,o.jsx)("ul",{id:"surecookie-forwarding-sites-list",className:"surecookie-forwarding-sites",hidden:!I,"aria-label":(0,n.__)("Sites that will receive your consent","surecookie"),children:I&&U.map(e=>(0,o.jsx)("li",{className:"surecookie-forwarding-site",children:(0,o.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"surecookie-forwarding-site-link",children:[(0,o.jsx)(k,{size:13,"aria-hidden":"true",focusable:"false",className:"surecookie-forwarding-site-globe"}),(0,o.jsx)("span",{className:"surecookie-forwarding-site-url",children:e}),(0,o.jsx)(p,{size:11,"aria-hidden":"true",focusable:"false",className:"surecookie-forwarding-site-ext"})]})},e))})]}):(0,o.jsx)("p",{className:"surecookie-forwarding-note",children:(0,n.__)("No partner sites configured.","surecookie")})]}),(0,o.jsx)("div",{id:"surecookie-tab-cookies",role:K?"tabpanel":void 0,"aria-labelledby":K?"surecookie-tab-btn-cookies":void 0,hidden:K&&"cookies"!==D,className:"surecookie-categories-wrapper",children:(0,o.jsx)("div",{className:"surecookie-categories-scroll",children:(0,o.jsxs)("div",{className:"surecookie-categories-list",role:"status","aria-live":"polite","aria-busy":C,children:[C&&[1,2,3,4].map(e=>(0,o.jsx)("div",{className:"surecookie-category-item",style:{borderBottomColor:se},children:(0,o.jsxs)("div",{className:"surecookie-category-header",children:[(0,o.jsxs)("div",{className:"surecookie-category-trigger",children:[(0,o.jsx)("span",{className:"surecookie-skeleton
2surecookie-skeleton-icon"}),(0,o.jsx)("span",{className:"surecookie-skeleton surecookie-skeleton-title"})]}),1===e?(0,o.jsx)("span",{className:"surecookie-skeleton surecookie-skeleton-badge"}):(0,o.jsx)("span",{className:"surecookie-skeleton surecookie-skeleton-toggle"})]})},e)),!C&&u.map(e=>{const t=l[e.id],r=(s=e.id,m.filter(e=>e.category===s));var s;const i=_.includes(e.id),a=`surecookie-category-details-${e.id}`,c=`surecookie-cookie-table-${e.id}`;return(0,o.jsxs)("div",{className:"surecookie-category-item",style:{borderBottomColor:se},children:[(0,o.jsxs)("div",{className:"surecookie-category-header",children:[(0,o.jsxs)("button",{type:"button",className:"surecookie-category-trigger",onClick:()=>(e=>{y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])})(e.id),"aria-expanded":i,"aria-controls":a,children:[(0,o.jsx)("span",{className:"surecookie-expand-icon "+(i?"expanded":""),style:{color:oe},"aria-hidden":"true",children:(0,o.jsx)(b,{size:18,strokeWidth:2.5,focusable:"false"})}),(0,o.jsx)("span",{className:"surecookie-category-name",style:{color:re},children:e.name})]}),(0,o.jsxs)("div",{className:"surecookie-category-controls",children:["essential"===e.id&&(0,o.jsx)("span",{className:"surecookie-always-active","aria-hidden":"true",children:(0,n.__)("Always Active","surecookie")}),(0,o.jsx)("button",{type:"button",className:"surecookie-toggle-btn",role:"switch","aria-checked":t?"true":"false","aria-label":"essential"===e.id?(0,n.sprintf)(/* translators: %s: cookie category name */ /* translators: %s: cookie category name */ 3(0,n.__)("%s: always active, cannot be disabled","surecookie"),e.name):e.name,onClick:()=>(e=>{const t=u.find(t=>t.id===e);t&&"essential"===t.id||d(t=>({...t,[e]:!t[e]}))})(e.id),"aria-disabled":"essential"===e.id,style:{backgroundColor:t?"var(--surecookie-banner-primary-color, #2563eb)":"#D1D5DB"},children:(0,o.jsx)("span",{className:"surecookie-toggle-knob "+(t?"checked":""),"aria-hidden":"true"})})]})]}),(0,o.jsx)("div",{id:a,className:"surecookie-category-details",hidden:!i,children:i&&(0,o.jsxs)(o.Fragment,{children:[e.description&&(0,o.jsx)("p",{className:"surecookie-category-desc",children:e.description}),r.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("button",{type:"button",className:"surecookie-cookie-table-toggle",onClick:t=>{t.stopPropagation(),(e=>{x(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])})(e.id)},"aria-expanded":v.includes(e.id),"aria-controls":c,children:[(0,o.jsx)("span",{className:"surecookie-cookie-table-label",children:(0,n.__)("View Cookies","surecookie")}),(0,o.jsx)("span",{className:"surecookie-table-chevron "+(v.includes(e.id)?"expanded":""),"aria-hidden":"true",children:(0,o.jsx)(b,{size:16,strokeWidth:2.5,focusable:"false"})})]}),(0,o.jsx)("div",{id:c,className:"surecookie-cookie-table-wrapper",hidden:!v.includes(e.id),children:v.includes(e.id)&&(0,o.jsxs)("table",{className:"surecookie-cookie-table","aria-label":(0,n.sprintf)(/* translators: %s: cookie category name */ /* translators: %s: cookie category name */ 4(0,n.__)("%s cookies details","surecookie"),e.name),children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{scope:"col",children:(0,n.__)("Name","surecookie")}),(0,o.jsx)("th",{scope:"col",children:(0,n.__)("Provider","surecookie")}),(0,o.jsx)("th",{scope:"col",children:(0,n.__)("Duration","surecookie")}),(0,o.jsx)("th",{scope:"col",children:(0,n.__)("Expiry","surecookie")})]})}),(0,o.jsx)("tbody",{children:r.map(e=>(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{children:e.name}),(0,o.jsx)("td",{children:e.provider||"-"}),(0,o.jsx)("td",{children:e.duration||"-"}),(0,o.jsx)("td",{children:e.expires||"-"})]},e.id||`${e.category}-${e.name}`))})]})})]})]})})]},e.id)})]})})}),(0,o.jsx)("div",{className:"surecookie-modal-footer",children:O?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[(0,o.jsx)("button",{type:"button",className:"surecookie-btn-outline surecookie-btn-sm",onClick:c?void 0:Z,"aria-disabled":c?"true":void 0,children:(0,n.__)("Accept All","surecookie")}),(0,o.jsx)("button",{type:"button",className:"surecookie-btn-outline-secondary surecookie-btn-sm",onClick:c?void 0:X,"aria-disabled":c?"true":void 0,children:(0,n.__)("Reject All","surecookie")})]}),(0,o.jsx)("button",{type:"button",className:"surecookie-btn-primary surecookie-btn-sm",onClick:c?void 0:Y,"aria-disabled":c?"true":void 0,children:(0,n.__)("Confirm My Choices","surecookie")})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"surecookie-footer-actions",children:[(0,o.jsx)("button",{type:"button",className:"surecookie-btn-outline",onClick:c?void 0:Z,"aria-disabled":c?"true":void 0,children:(0,n.__)("Accept All","surecookie")}),(0,o.jsx)("button",{type:"button",className:"surecookie-btn-outline-secondary",onClick:c?void 0:X,"aria-disabled":c?"true":void 0,children:(0,n.__)("Reject All","surecookie")})]}),(0,o.jsx)("button",{type:"button",className:"surecookie-btn-primary",onClick:c?void 0:Y,"aria-disabled":c?"true":void 0,children:(0,n.__)("Confirm My Choices","surecookie")})]})}),!a.remove_branding&&(0,o.jsx)("div",{className:"surecookie-modal-footer-branding",style:{borderTopColor:"#37415126",justifyContent:"flex-end"},children:(0,o.jsxs)("a",{href:w("preferences_modal_branding"),target:"_blank",rel:"noopener noreferrer",className:"surecookie-modal-branding-content","aria-label":(0,n.__)("Powered by SureCookie (opens in new tab)","surecookie"),children:[(0,o.jsx)("span",{"aria-hidden":"true",children:(0,n.__)("Powered by","surecookie")}),(0,o.jsx)(r,{width:"10",height:"12","aria-hidden":!0,focusable:"false"}),(0,o.jsx)("span",{"aria-hidden":"true",children:"SureCookie"})]})})]})})})]}):ie},A=e=>{try{window.localStorage.setItem("surecookie_preferences",JSON.stringify(e))}catch(e){}};class O extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){console.warn("SureCookie: floating widget crashed and was disabled.",e)}render(){return this.state.hasError?null:this.props.children}}const P=({publicSettings:e,showBanner:o,bannerEnabled:r})=>(0,t.applyFilters)("surecookie.floatingWidget",null,{publicSettings:e,showBanner:o,bannerEnabled:r}),D=()=>{const s=(0,e.useMemo)(()=>window.surecookiePublicSettings||{},[]),i=(0,e.useMemo)(()=>{const e=(0,t.applyFilters)("surecookie.publicSettingsResolvers",[]);return Array.isArray(e)?e.filter(e=>"function"==typeof e):[]},[]),[a,c]=(0,e.useState)(s),[l,d]=(0,e.useState)(!1),[u,h]=(0,e.useState)(!1),b=(0,e.useRef)(null),k=(0,e.useRef)(null),p=(0,e.useRef)(null),[m,f]=(0,e.useState)(0===i.length),_=(0,e.useMemo)(()=>void 0===a.show_settings_btn_enabled||Boolean(a.show_settings_btn_enabled),[a.show_settings_btn_enabled]),y=Boolean(s?.is_banner_visibility_hidden),v=Boolean(s?.banner_enabled||s?.enable_banner),[x,C]=(0,e.useState)(!y&&(a.banner_enabled||a.enable_banner||!1)),j=y||v&&!x,N=a.message_heading||"",D=a.message_description??(0,n.__)("This website uses co
4okies to enhance your browsing experience, personalize content, provide social media features, and analyze our traffic. You can review and manage your cookie settings at any time, or accept all cookies to proceed.","surecookie"),M=(0,e.useMemo)(()=>S(D),[D]),I=!!a.consent_forwarding_enabled,L=a.consent_forwarding_description||"",T=(0,e.useMemo)(()=>S(L),[L]),B=a.notice_type||"banner",R=a.notice_position||"bottom",q=a.banner_width||"650",$=!!a.banner_overlay_enabled,W=(0,e.useMemo)(()=>a.locale?a.locale.replace("_","-"):document.documentElement.lang||void 0,[a.locale]),z="var(--surecookie-banner-text-color, #374151)",U=a.banner_logo||"",F=(e=>{const t=e?.accept_all_enabled;return!0===t||1===t||"1"===t})(a),J=a.banner_animation||"fade",K=a.active_law_id,H="opt-out"===(a.consent_model||"opt-in"),G=(0,e.useMemo)(()=>({accept:(0,n.__)("Only Essential","surecookie"),accept_all:(0,n.__)("Accept All","surecookie"),decline:(0,n.__)("Decline","surecookie"),preferences:(0,n.__)("Preferences","surecookie")}),[]),Z=(e,t)=>{if(a.button_labels?.[e])return a.button_labels[e];const o=a.law_default_labels?.[e];return K&&o?o:t||G[e]||""},X=Z("accept",a.accept_btn_text),Y=Z("accept_all",a.accept_all_btn_text),V=Z("decline",a.decline_btn_text),Q=Z("preferences",a.preferences_btn_text),ee=(0,e.useMemo)(()=>{let e;return e=a.button_config&&Array.isArray(a.button_config)?a.button_config:H&&!a.button_config?["accept","decline"]:a.button_order||"accept_all,accept,preferences,decline",((e,{acceptAllEnabled:t})=>{const o=Array.isArray(e)?e.slice():String(e||"").split(",").map(e=>e.trim()).filter(Boolean);return t?o:o.filter(e=>"accept_all"!==e)})(e,{acceptAllEnabled:F})},[a.button_order,a.button_config,H,F]),te=(0,e.useMemo)(()=>Object.values(a.cookie_categories||{}),[a.cookie_categories]),oe=(0,e.useMemo)(()=>Object.values(a.custom_cookies||{}),[a.custom_cookies]),re=(0,e.useMemo)(()=>a.scanned_cookies||[],[a.scanned_cookies]),ne=(0,e.useMemo)(()=>{const e=new Set(oe.map(e=>e.name)),t=re.filter(t=>!e.has(t.name));return[...oe,...t]},[oe,re]);(0,e.useEffect)(()=>{if(m||0===i.length)return;let e=!1;const t=(t={})=>{e||(Object.keys(t).length>0&&(c(e=>({...e,...t})),y?C(!1):void 0!==t.banner_enabled?C(Boolean(t.banner_enabled)):void 0!==t.enable_banner&&C(Boolean(t.enable_banner))),f(!0))};(async()=>{let e={};for(const t of i)try{const o=await t({...s,...e});o&&"object"==typeof o&&(e={...e,...o})}catch(e){}t(e)})();const o=setTimeout(()=>{e||t()},4e3);return()=>{e=!0,clearTimeout(o)}},[s,m,i]),(0,e.useEffect)(()=>{if(!m)return;if(!x)return void d(!1);(()=>{if(window.surecookieManager&&window.surecookieManager.hasConsent()){if(se())return void d(!0);d(!1)}else d(!0)})();const e=()=>{!document.hidden&&x&&window.surecookieManager&&window.surecookieManager.hasConsent()&&se()&&d(!0)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[x,oe,_,m]),(0,e.useEffect)(()=>{const e=e=>{e.detail?d(!1):x&&d(!0)};return window.addEventListener("surecookie_changed",e),()=>{window.removeEventListener("surecookie_changed",e)}},[x]),(0,e.useEffect)(()=>{const e=e=>{e.detail&&"object"==typeof e.detail&&(c(t=>({...t,...e.detail})),void 0!==e.detail.banner_enabled&&C(!y&&Boolean(e.detail.banner_enabled)))};return window.addEventListener("surecookie_settings_changed",e),()=>{window.removeEventListener("surecookie_settings_changed",e)}},[]),(0,e.useEffect)(()=>{const e=()=>{j||(b.current=k.current?.ownerDocument?.activeElement??null,H&&x?(h(!1),d(!0)):(d(!1),h(!0)))},t=t=>{document.querySelector("[data-surecookie-reconsent]")&&t.target.closest("[data-surecookie-reconsent]")&&(t.preventDefault(),e())},o=t=>{" "===t.key&&document.querySelector("[data-surecookie-reconsent]")&&t.target.closest("[data-surecookie-reconsent]")&&(t.preventDefault(),e())};return document.addEventListener("surecookie_open_preferences",e),document.addEventListener("click",t),document.addEventListener("keydown",o),()=>{document.removeEventListener("surecookie_open_preferences",e),document.removeEventListener("click",t),document.removeEventListener("keydown",o)}},[H,x,j]),(0,e.useEffect)(()=>
4{if(!l)return;const e=e=>{if("Escape"===e.key){if(e.preventDefault(),$)return;return void d(!1)}if("Tab"!==e.key)return;const t=Array.from(p.current?.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')??[]);if(0===t.length)return;const o=t[0],r=t[t.length-1],n=p.current?.ownerDocument?.activeElement;e.shiftKey?n!==o&&p.current?.contains(n)||(e.preventDefault(),r.focus()):n!==r&&p.current?.contains(n)||(e.preventDefault(),o.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[l,$]),(0,e.useEffect)(()=>{if(!l||!p.current)return;const e=setTimeout(()=>{const e=p.current?.querySelector("button:not([disabled])");e?e.focus():p.current?.focus()},100);return()=>clearTimeout(e)},[l]),(0,e.useEffect)(()=>{const e=k.current;if(!e)return;const t=e.ownerDocument||document,o=Array.from(t.body.children),r=e.closest("#surecookie-public-root");return o.forEach(e=>{e===r||e.contains(r)||(u||l&&$?(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")):l?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","true")):(e.removeAttribute("inert"),e.removeAttribute("aria-hidden")))}),()=>{o.forEach(e=>{e.removeAttribute("inert"),e.removeAttribute("aria-hidden")})}},[l,u,$]),(0,e.useEffect)(()=>{if(!($&&l&&x||u))return;const{body:e}=document,t=e.style.overflow;return e.style.overflow="hidden",()=>{e.style.overflow=t}},[$,l,x,u]);const se=()=>{if(!oe||0===oe.length)return!1;const e=window.surecookieManager.getConsent();if(!e||!e.preferences)return!1;const t=e.timestamp?new Date(e.timestamp):null,o=new Date;for(const r of oe)if(r.expires){const n=new Date(r.expires);if(n<o&&(!t||n>t)&&e.preferences[r.category])return!0}return!1},ie=(0,e.useCallback)(()=>{const e={};H?(te&&te.length>0?te.forEach(t=>{e[t.id]=!0}):(e.essential=!0,e.functional=!0,e.analytics=!0,e.marketing=!0,e.uncategorized=!0),A(e),window.surecookieManager&&window.surecookieManager.saveConsent(e,"accepted")):(te&&te.length>0?te.forEach(t=>{e[t.id]="essential"===t.id}):(e.essential=!0,e.functional=!1,e.analytics=!1,e.marketing=!1,e.uncategorized=!1),A(e),window.surecookieManager&&window.surecookieManager.saveConsent(e,"partially_accepted")),d(!1)},[te,_,H]),ae=(0,e.useCallback)(()=>{if(!F)return;const e={};te&&te.length>0?te.forEach(t=>{e[t.id]=!0}):(e.essential=!0,e.functional=!0,e.analytics=!0,e.marketing=!0,e.uncategorized=!0),A(e),window.surecookieManager&&window.surecookieManager.saveConsent(e,"accepted"),d(!1)},[F,te,_]),ce=(0,e.useCallback)(()=>{const e={};te&&te.length>0?te.forEach(t=>{"essential"===t.id?e[t.id]=!0:e[t.id]=!1}):(e.essential=!0,e.functional=!1,e.analytics=!1,e.marketing=!1,e.uncategorized=!1),A(e),window.surecookieManager&&window.surecookieManager.saveConsent(e,"declined"),d(!1)},[te,_]),le=(0,e.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),b.current=k.current?.ownerDocument?.activeElement??null,d(!1),h(!0)},[]),de=(0,e.useCallback)(()=>{h(!1),b.current&&(b.current.focus(),b.current=null),window.surecookieManager&&window.surecookieManager.hasConsent()||!x||d(!0)},[x]),ue=(0,e.useCallback)(()=>{h(!1),d(!1)},[_]),he=(e,t)=>({color:e,...t&&{borderColor:t}});return(0,o.jsxs)("div",{ref:k,className:"surecookie-public-banner-wrapper surecookie-styles",style:{...a.banner_bg_color&&{"--surecookie-banner-background-color":a.banner_bg_color},...a.text_color&&{"--surecookie-banner-text-color":a.text_color},...a.accept_btn_color&&{"--surecookie-banner-primary-color":a.accept_btn_color},...a.accept_btn_hover_color&&{"--surecookie-banner-primary-hover-color":a.accept_btn_hover_color},...a.decline_btn_color&&{"--surecookie-banner-secondary-color":a.decline_btn_color}},children:[x&&l&&$&&(0,o.jsx)("div",{className:"surecookie-banner-overlay","data-overlay":"true","aria-hidden":"true"}),x&&l&&(0,o.jsx)("div",{ref:p,role:"dialog","aria-modal":"true",lang:W,tabIndex:"-1","aria-labelledby":N?"surecookie-banner-heading":void 0,"aria-label":N?void 0:(0,n.__)("Cookie Consent","surecookie"),"aria-describedby":"surecookie-banner-description",style:{backgroundColor:"var(--surecookie-banner-background-color, #111827)",color:z,..."box"===B&&{width:`${q}px`}},className:`surecookie-public-banner surecookie-banner surecookie-container-mobile surecookie-banner-container ${"banner"===B?"surecookie-banner-container-banner":U?"surecookie-banner-container-box-with-logo":"surecookie-banner-container-box"} ${(()=>{if("banner"===B)return"top"===R?"surecookie-banner-position-top":"surecookie-banner-position-bottom";if("box"===B){const e="surecookie-banner-position-box-base";switch(R){case"bottom-left":return`${e} surecookie-banner-position-bottom-left`;case"bottom-center":return"surecookie-banner-position-bottom-center";case"bottom-right":default:return`${e} surecookie-banner-position-bottom-right`;case"middle":return"surecookie-banner-position-middle"}}return"surecookie-banner-position-bottom"})()}
4 ${"slide"===J?"surecookie-banner-animation-slide":"surecookie-banner-animation-fade"}`,"data-banner":"true","data-dark-mode":g(a.banner_bg_color)||!a.banner_bg_color?"true":"false",children:(0,o.jsxs)("div",{className:"surecookie-banner-inner "+("box"===B?"surecookie-banner-inner-box":"surecookie-banner-inner-banner"),style:{..."box"===B&&{maxWidth:`${q}px`}},children:[U&&(0,o.jsx)("div",{className:"surecookie-banner-logo-wrapper",children:(0,o.jsx)("img",{src:U,alt:(0,n.__)("Banner logo","surecookie"),className:"surecookie-banner-logo"})}),(0,o.jsxs)("div",{className:"surecookie-content-mobile surecookie-banner-content "+("box"===B?"surecookie-banner-content-box":"surecookie-banner-content-banner"),children:[(0,o.jsxs)("div",{className:"surecookie-banner-text-wrapper",children:[N&&(0,o.jsx)("h3",{id:"surecookie-banner-heading",className:"surecookie-banner-heading",style:{color:z},children:N}),(0,o.jsxs)("div",{id:"surecookie-banner-description",className:"surecookie-banner-description",style:{color:z},children:[(0,o.jsx)("div",{dangerouslySetInnerHTML:{__html:M}}),I&&T&&(0,o.jsx)("div",{className:"surecookie-forwarding-description",dangerouslySetInnerHTML:{__html:T}})]}),"banner"===B&&!a.remove_branding&&(0,o.jsxs)("a",{href:w("banner_branding"),target:"_blank",rel:"noopener noreferrer",className:"surecookie-branding-mobile surecookie-branding",tabIndex:"-1","aria-label":(0,n.__)("Powered by SureCookie (opens in new tab)","surecookie"),children:[(0,o.jsx)("span",{"aria-hidden":"true",children:a.branding_powered_by||"Powered by"}),(0,o.jsx)(r,{width:"10",height:"12","aria-hidden":!0,focusable:"false"}),(0,o.jsx)("span",{"aria-hidden":"true",children:"SureCookie"})]})]}),(0,o.jsx)("div",{className:"surecookie-buttons-mobile surecookie-banner-buttons "+("box"===B?"surecookie-banner-buttons-box":"surecookie-banner-buttons-banner"),children:(()=>{const e={decline:(0,o.jsx)("button",{type:"button",className:"surecookie-decline-btn surecookie-button-mobile surecookie-btn-base",onClick:ce,"aria-label":(0,n.__)("Decline all non-essential cookies","surecookie"),style:he("#ffffff"),children:V},"decline"),preferences:(0,o.jsx)("button",{type:"button",className:"surecookie-preferences-btn surecookie-button-mobile surecookie-btn-base surecookie-btn-trans
4parent surecookie-btn-font-semibold",onClick:le,"aria-label":(0,n.__)("Manage cookie preferences","surecookie"),style:he("var(--surecookie-banner-text-color, "+z+")"),children:Q},"preferences"),accept:(0,o.jsx)("button",{type:"button",className:"surecookie-accept-btn surecookie-button-mobile surecookie-btn-base",onClick:ie,"aria-label":(0,n.__)("Accept only essential cookies","surecookie"),style:he("#ffffff"),children:X},"accept"),accept_all:F?(0,o.jsx)("button",{type:"button",className:"surecookie-accept-all-btn surecookie-button-mobile surecookie-btn-base",onClick:ae,"aria-label":(0,n.__)("Accept all cookies","surecookie"),style:he("#ffffff"),children:Y},"accept_all"):null},t=ee.map(t=>e[t]).filter(Boolean);return"banner"===B||a.remove_branding?t:[...t,(0,o.jsxs)("a",{href:w("preferences_modal_branding"),target:"_blank",rel:"noopener noreferrer",className:"surecookie-branding-mobile surecookie-branding","aria-label":(0,n.__)("Powered by SureCookie (opens in new tab)","surecookie"),children:[(0,o.jsx)("span",{"aria-hidden":"true",children:(0,n.__)("Powered by","surecookie")}),(0,o.jsx)(r,{width:"10",height:"12","aria-hidden":!0,focusable:"false"}),(0,o.jsx)("span",{"aria-hidden":"true",children:"SureCookie"})]},"branding")]})()})]})]})}),m&&x&&(0,o.jsx)(O,{children:(0,o.jsx)(P,{publicSettings:a,showBanner:l,bannerEnabled:x})}),(0,o.jsx)(E,{isOpen:u,onClose:de,onSave:ue,settings:{banner_bg_color:a.banner_bg_color,text_color:a.text_color,accept_btn_color:a.accept_btn_color,accept_btn_text_color:"#ffffff",decline_btn_color:a.decline_btn_color,decline_btn_text_color:"#ffffff",preferences_btn_text_color:a.text_color,decline_btn_border_color:a.decline_btn_border_color,cookie_categories:te,custom_cookies:ne,remove_branding:a.remove_branding,consent_forwarding_enabled:a.consent_forwarding_enabled,consent_forwarding_mode:a.consent_forwarding_mode,consent_forwarding_partner_sites:a.consent_forwarding_partner_sites,consent_forwarding_description:a.consent_forwarding_description,consent_forwarding_show_sites:a.consent_forwarding_show_sites}})]})},M=(e,t)=>{console.warn(`SureCookie: consent log request failed (HTTP ${e}).`);const o=new Error(t?.message||`Consent log request failed with status ${e}.`);throw o.status=e,t?.code&&(o.code=t.code),o},I=new Set(["text/javascript","module","application/javascript","application/ecmascript","text/ecmascript","importmap","speculationrules"]);function L(e,t){const o=e.getAttribute(t);if(!o||"none"===o)return null;const r=o.toLowerCase().trim();return I.has(r)?r:null}"undefined"!=typeof window&&(window.surecookieManager=new class{constructor(){this.CONSENT_COOKIE_NAME="surecookie_user_consent",this.SESSION_COOKIE_NAME="surecookie_session_id",this.CONSENT_COOKIE_EXPIRY=365,this.SESSION_COOKIE_EXPIRY=365,this.consentData=null,this.sessionId=null,this.dynamicObserver=null,this.loadConsent(),this.loadOrCreateSessionId()}loadOrCreateSessionId(){const e=this.getCookie(this.SESSION_COOKIE_NAME);return e?this.sessionId=e:(this.sessionId=this.generateUUID(),this.setCookie(this.SESSION_COOKIE_NAME,this.sessionId,this.SESSION_COOKIE_EXPIRY)),this.sessionId}generateUUID(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.floor(16*Math.random());return("x"===e?t:t%4+8).toString(16)})}getSessionId(){return this.sessionId}loadConsent(){const e=this.getCookie(this.CONSENT_COOKIE_NAME);if(e)try{this.consentData=JSON.parse(decodeURIComponent(e))}catch(e){this.consentData=null}if(this.consentData&&this.isRenewalRequired()){this.deleteCookie(this.CONSENT_COOKIE_NAME),this.consentData=null;try{"undefined"!=typeof localStorage&&localStorage.removeItem("surecookie_preferences")}catch(e){}}}isRenewalRequired(){const e=parseInt(window.surecookiePublicSettings?.consent_renewed_at,10)||0;if(!e||!this.consentData)return!1;const t=Date.parse(this.consentData.timestamp);return isNaN(t)||t<1e3*e}saveConsent(e,t="custom"){const o=this.determineAction(e,t),r=this.consentData?JSON.stringify(this.consentData.preferences):null,n=this.consentData?this.consentData.action:null,s=null!==r&&r===JSON.stringify(e)&&n===o,i={preferences:e,action:o,timestamp:(new Date).toISOString()};this.consentData=i;const a=this.getConsentDuration(),c=encodeURIComponent(JSON.stringify(i));return this.setCookie(this.CONSENT_COOKIE_NAME,c,a),s||this.saveToDatabase(e,o),this.deleteDeclinedCookies(e),this.applyConsent(),this.updateGoogleConsent(e),this.updateWpConsentApi(e),setTimeout(()=>{this.triggerConsentChange(i)},0),i}updateGoogleConsent(e){if(!window.surecookiePublicSettings?.gcm_enabled||"function"!=typeof window.gtag)return;const t={ad_storage:e.marketing?"granted":"denied",ad_user_data:e.marketing?"granted":"denied",ad_personalization:e.marketing?"granted":"denied",personalization_storage:e.marketing?"granted":"denied",analytics_storage:e.anal
4ytics?"granted":"denied",functionality_storage:e.functional?"granted":"denied",security_storage:"granted"};window.gtag("consent","update",t),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"surecookie_consent_updated",consentState:t,surecookiePreferences:e}),window.dispatchEvent(new CustomEvent("surecookie_gcm_updated",{detail:{consentState:t,preferences:e,timestamp:Date.now()}}))}updateWpConsentApi(e){if("function"==typeof window.wp_set_consent)try{const t=window.surecookiePublicSettings?.wpConsentCategoryMap||{essential:"functional",functional:"preferences",analytics:"statistics",marketing:"marketing"},o=new Set;Object.entries(t).forEach(([t,r])=>{if(!(t in e))return;const n="essential"===t||e[t]?"allow":"deny";o.has(r)||(window.wp_set_consent(r,n),o.add(r))}),Object.keys(e).forEach(r=>{if(t[r])return;const n="marketing",s=e[r]?"allow":"deny";o.has(n)||(window.wp_set_consent(n,s),o.add(n))})}catch(e){console.error("SureCookie: WP Consent API sync failed",e)}}hasGlobalPrivacyControl(){return!0===navigator.globalPrivacyControl}getConsentDuration(){if(window.surecookiePublicSettings&&void 0!==window.surecookiePublicSettings.consent_duration_days){const e=parseInt(window.surecookiePublicSettings.consent_duration_days,10);if(!isNaN(e)&&e>=1&&e<=3650)return e}return 365}saveToDatabase(e,t){window.surecookiePublicSettings&&window.surecookiePublicSettings.consent_logging_enabled&&((e,t,o)=>{const r=window.surecookiePublicSettings?.api?.create_log||"/?rest_route=/surecookie/v1/consent-logs/create-log",n=n=>fetch(r,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:JSON.stringify(e),action_type:t,session_id:o,consent_log_token:n})}),s=window.surecookiePublicSettings?.consent_log_token??"",i=e=>e.json().catch(()=>({})).then(t=>M(e.status,t));return n(s).then(e=>e.ok?e.json():403!==e.status?i(e):e.json().catch(()=>({})).then(t=>s&&"surecookie_invalid_token"===t?.code?(e=>{const t=window.surecookiePublicSettings?.api?.token||"/?rest_route=/surecookie/v1/consent-logs/token";return fetch(t,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({stale_token:e})}).then(e=>e.ok?e.json():Promise.reject(new Error(`Token exchange failed (HTTP ${e.status}).`))).then(e=>{const t=e?.token;if(!t)throw new Error("Token exchange returned no token.");return window.surecookiePublicSettings&&(window.surecookiePublicSettings.consent_log_token=t),t})})(s).catch(()=>M(e.status,t)).then(e=>n(e)).then(e=>e.ok?e.json():i(e)):M(e.status,t))).catch(e=>{throw e.status||console.warn("SureCookie: consent log request failed (network error)."),e})})(e,t,this.sessionId).then(e=>{if(!e.success)throw e}).catch(e=>{})}getConsent(){return this.consentData}hasConsent(){return null!==this.consentData}isAllowed(e){if("quarantine"===e)return!1;const t=window.surecookiePublicSettings?.consent_model||"opt-in";return this.consentData?!0===this.consentData.preferences[e]:"opt-out"===t||"essential"===e}acceptAll(e){const t={};return e.forEach(e=>{t[e.id]=!0}),this.saveConsent(t,"accepted")}declineAll(e){const t={};return e.forEach(e=>{"essential"===e.id?t[e.id]=!0:t[e.id]=!1}),this.saveConsent(t,"declined")}saveCustomPreferences(e){return this.saveConsent(e,"partially_accepted")}clearConsent(){this.deleteCookie(this.CONSENT_COOKIE_NAME),this.consentData=null,this.triggerConsentChange(null)}applyConsent(){const e=window.surecookiePublicSettings?.consent_model||"opt-in";this.reflowCollapsedPlaceholders(),this.matchPlaceholderSizes(),this.consentData||"opt-out"===e?(document.querySelectorAll("script[data-consent]").forEach(e=>{const t=e.getAttribute("data-consent");this.isAllowed(t)&&this.executeScript(e)}),document.querySelectorAll('script[type="text/plain"][data-surecookie-category]').forEach(e=>{const t=e.getAttribute("data-surecookie-category");this.isAllowed(t)&&this.executeBlockedScript(e)}),document.querySelectorAll("iframe[data-surecookie-src], embed[data-surecookie-src]").forEach(e=>{const t=e.getAttribute("data-surecookie-category");this.isAllowed(t)&&this.loadBlockedSrcElement(e)}),document.querySelectorAll("object[data-surecookie-data]").forEach(e
4=>{const t=e.getAttribute("data-surecookie-category");this.isAllowed(t)&&this.loadBlockedObject(e)}),this.showPendingPlaceholders(),window.dispatchEvent(new CustomEvent("surecookie_applied",{detail:this.consentData}))):this.showPendingPlaceholders()}startDynamicObserver(){if(this.dynamicObserver)return;const e=e=>{1===e.nodeType&&("SCRIPT"===e.tagName&&"text/plain"===e.getAttribute("type")?.toLowerCase()&&e.hasAttribute("data-surecookie-category")?this.isAllowed(e.getAttribute("data-surecookie-category"))&&this.executeBlockedScript(e):"SCRIPT"===e.tagName&&e.hasAttribute("data-consent")?this.isAllowed(e.getAttribute("data-consent"))&&this.executeScript(e):"IFRAME"!==e.tagName&&"EMBED"!==e.tagName||!e.hasAttribute("data-surecookie-src")||!this.isAllowed(e.getAttribute("data-surecookie-category"))?"OBJECT"===e.tagName&&e.hasAttribute("data-surecookie-data")&&this.isAllowed(e.getAttribute("data-surecookie-category"))&&this.loadBlockedObject(e):this.loadBlockedSrcElement(e))};this.dynamicObserver=new MutationObserver(t=>{for(const o of t)for(const t of o.addedNodes)1===t.nodeType&&(t.classList?.contains("surecookie-placeholder")?(this.reflowCollapsedPlaceholders(t.parentNode||document),this.matchPlaceholderSizes(t.parentNode||document)):(this.reflowCollapsedPlaceholders(t),this.matchPlaceholderSizes(t)),e(t),t.querySelectorAll?.("script[data-surecookie-category], script[data-consent], iframe[data-surecookie-src], embed[data-surecookie-src], object[data-surecookie-data]")?.forEach(e),this.restorePrestoPlaceholders(t));this.showPendingPlaceholders(),this.hasConsent()&&this.areAllCategoriesAllowed()&&this.stopDynamicObserver()}),this.dynamicObserver.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("pagehide",()=>this.stopDynamicObserver(),{once:!0})}stopDynamicObserver(){this.dynamicObserver&&(this.dynamicObserver.disconnect(),this.dynamicObserver=null)}areAllCategoriesAllowed(){const e=window.surecookiePublicSettings?.cookie_categories||{},t=Object.values(e).map(e=>e.id);return 0!==t.length&&t.every(e=>this.isAllowed(e))}loadBlockedSrcElement(e){const t=e.getAttribute("data-surecookie-src");if(!t)return;e.setAttribute("src",t),e.style.display="",e.removeAttribute("data-surecookie-src"),e.removeAttribute("data-surecookie-name"),e.removeAttribute("data-surecookie-category");const o=e.closest(".surecookie-placeholder");o&&o.parentNode&&o.replaceWith(e)}loadBlockedObject(e){const t=e.getAttribute("data-surecookie-data");if(!t)return;e.querySelectorAll("param[data-surecookie-param-name]").forEach(e=>{const t=e.getAttribute("data-surecookie-param-name");t&&(e.setAttribute("name",t),e.removeAttribute("data-surecookie-param-name"))}),e.setAttribute("data",t),e.removeAttribute("data-surecookie-data"),e.removeAttribute("data-surecookie-name"),e.removeAttribute("data-surecookie-category"),e.style.display="";const o=e.cloneNode(!0),r=e.closest(".surecookie-placeholder");r&&r.parentNode?r.replaceWith(o):e.parentNode?.replaceChild(o,e)}showPendingPlaceholders(){document.querySelectorAll(".surecookie-placeholder").forEach(e=>{e.classList.add("surecookie-pending")})}restorePrestoPlaceholders(e=document){const t=[];e.matches?.(".surecookie-placeholder-presto")&&t.push(e),e.querySelectorAll?.(".surecookie-placeholder-presto")?.forEach(e=>t.push(e)),t.forEach(e=>{const t=e.getAttribute("data-surecookie-category");if(!t||!this.isAllowed(t))return;const o=e.querySelector("template.surecookie-presto-restore");if(!o)return;const r=o.content.cloneNode(!0);r.querySelectorAll("script").forEach(e=>{const t=document.createElement("script");Array.from(e.attributes).forEach(e=>{t.setAttribute(e.name,e.value)}),t.textContent=e.textContent,e.parentNode.replaceChild(t,e)}),e.replaceWith(r)})}reflowCollapsedPlaceholders(e=document){const t=e.querySelectorAll?.(".surecookie-placeholder:not(.surecookie-reflowed)");if(!t||0===t.length)return;const o=[];t.forEach(e=>{const t=e.parentElement;if(!t||null===t.offsetParent)return;if(t.getBoundingClientRect().height>0)return;const r=parseInt(e.getAttribute("data-surecookie-width")||"0",10),n=parseInt(e.getAttribute("data-surecookie-height")||"0",10);!Number.isFinite(r)||!Number.isFinite(n)||r<=0||n<=0||o.push({ph:e,w:r,h:n})}),o.forEach(({ph:e,w:t,h:o})=>{e.style.position="relative",e.style.width="100%",e.style.maxWidth=t+"px",e.style.height="auto",e.style.aspectRatio=t+" / "+o,e.classList.add("surecookie-reflowed")})}matchPlaceholderSizes(e=document){const t=e.querySelectorAll?.(".surecookie-placeholder");
4t&&0!==t.length&&t.forEach(e=>{if(null===e.offsetParent)return;const t=e.querySelector("[data-surecookie-src], [data-surecookie-data]");if(!t)return;const o=t.style.display,r=t.style.visibility;t.style.visibility="hidden",t.style.display="";const n=t.offsetHeight;t.style.display=o,t.style.visibility=r,150!==n||t.hasAttribute("height")?n>0&&150!==n&&(e.style.height=n+"px",e.style.aspectRatio="auto"):(e.style.height="auto",e.style.aspectRatio="16 / 9")})}acceptCategoryFromPlaceholder(e){if(!e)return;const t=window.surecookiePublicSettings?.cookie_categories||{},o=this.consentData?.preferences||{},r=window.surecookiePublicSettings?.consent_model||"opt-in",n={};let s="partially_accepted";"opt-out"===r?(Object.values(t).forEach(e=>{n[e.id]=!0}),s="accepted"):Object.values(t).forEach(t=>{"essential"===t.id||t.id===e?n[t.id]=!0:n[t.id]=o[t.id]||!1}),localStorage.setItem("surecookie_preferences",JSON.stringify(n)),this.saveConsent(n,s)}executeScript(e){const t=document.createElement("script");Array.from(e.attributes).forEach(e=>{"data-consent"!==e.name&&"type"!==e.name&&t.setAttribute(e.name,e.value)}),e.textContent&&(t.textContent=e.textContent);const o=L(e,"data-original-type");null!==o&&t.setAttribute("type",o),e.parentNode.replaceChild(t,e)}executeBlockedScript(e){const t=document.createElement("script");Array.from(e.attributes).forEach(e=>{"type"===e.name||e.name.startsWith("data-surecookie")||t.setAttribute(e.name,e.value)});const o=L(e,"data-surecookie-original-type");null!==o&&t.setAttribute("type",o);const r=e.getAttribute("data-surecookie-src");r?t.src=r:e.textContent&&(t.textContent=e.textContent),e.parentNode.replaceChild(t,e)}triggerConsentChange(e){window.dispatchEvent(new CustomEvent("surecookie_changed",{detail:e}))}setCookie(e,t,o){const r=new Date;r.setTime(r.getTime()+24*o*60*60*1e3);let n=`${e}=${t};expires=${r.toUTCString()};path=/;SameSite=Lax`;"https:"===window.location.protocol&&(n+=";Secure"),document.cookie=n}getCookie(e){const t=e+"=",o=document.cookie.split(";");for(let e=0;e<o.length;e++){let r=o[e];for(;" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return null}deleteCookie(e){document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;`}deleteDeclinedCookies(e){const t=window.surecookiePublicSettings?.custom_cookies;if(!t)return;const o=Array.isArray(t)?t:Object.values(t);Object.keys(e).forEach(t=>{e[t]||"essential"===t||o.filter(e=>e.category===t).forEach(e=>{this.deleteCookie(e.name)})})}getConsentSummary(){if(!this.consentData)return"No consent given";const{action:e,timestamp:t,preferences:o}=this.consentData;return{action:e,timestamp:t,allowed:Object.keys(o).filter(e=>o[e]),preferences:o}}determineAction(e,t){if("accepted"===t||"declined"===t||"partially_accepted"===t||"custom"===t)return t;const o=Object.values(e);if(o.every(e=>!0===e))return"accepted";const r=o.every(e=>!1===e),n=Object.keys(e).every(t=>"essential"===t?!0===e[t]:!1===e[t]);return r||n?"declined":"partially_accepted"}initOnLoad(){this.applyConsent();const e=this.getConsent();if(e&&(this.updateGoogleConsent(e.preferences),this.updateWpConsentApi(e.preferences)),this.hasGlobalPrivacyControl()){const e={essential:!0,functional:!1,analytics:!1,marketing:!1};this.updateGoogleConsent(e),this.updateWpConsentApi(e)}this.startDynamicObserver()}},document.addEventListener("click",e=>{const t=e.target;if(!t||"function"!=typeof t.closest)return;const o=t.closest(".surecookie-placeholder-button");if(!o)return;const r=o.getAttribute("data-surecookie-category");r&&window.surecookieManager.acceptCategoryFromPlaceholder(r)}),window.addEventListener("surecookie_applied",()=>{window.surecookieManager.restorePrestoPlaceholders()}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{window.surecookieManager.initOnLoad()}):window.surecookieManager.initOnLoad());const T=()=>{const t=document.getElementById("surecookie-public-root");t&&(0,e.createRoot)(t).render((0,o.jsx)(D,{}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",T):T()})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.