(function(){"use strict";var zi,Ai,Mi;var Cs={exports:{}},hr={},bs={exports:{}},ve={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var zo;function xu(){if(zo)return ve;zo=1;var o=Symbol.for("react.element"),i=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),g=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.iterator;function L(N){return N===null||typeof N!="object"?null:(N=S&&N[S]||N["@@iterator"],typeof N=="function"?N:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,b={};function k(N,I,ue){this.props=N,this.context=I,this.refs=b,this.updater=ue||D}k.prototype.isReactComponent={},k.prototype.setState=function(N,I){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,I,"setState")},k.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function E(){}E.prototype=k.prototype;function M(N,I,ue){this.props=N,this.context=I,this.refs=b,this.updater=ue||D}var A=M.prototype=new E;A.constructor=M,T(A,k.prototype),A.isPureReactComponent=!0;var H=Array.isArray,$=Object.prototype.hasOwnProperty,V={current:null},Z={key:!0,ref:!0,__self:!0,__source:!0};function W(N,I,ue){var fe,O={},ce=null,ye=null;if(I!=null)for(fe in I.ref!==void 0&&(ye=I.ref),I.key!==void 0&&(ce=""+I.key),I)$.call(I,fe)&&!Z.hasOwnProperty(fe)&&(O[fe]=I[fe]);var we=arguments.length-2;if(we===1)O.children=ue;else if(1>>1,I=G[N];if(0>>1;Nd(O,q))ced(ye,O)?(G[N]=ye,G[ce]=q,N=ce):(G[N]=O,G[fe]=q,N=fe);else if(ced(ye,q))G[N]=ye,G[ce]=q,N=ce;else break e}}return le}function d(G,le){var q=G.sortIndex-le.sortIndex;return q!==0?q:G.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;o.unstable_now=function(){return m.now()}}else{var g=Date,h=g.now();o.unstable_now=function(){return g.now()-h}}var v=[],w=[],j=1,S=null,L=3,D=!1,T=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(G){for(var le=c(w);le!==null;){if(le.callback===null)p(w);else if(le.startTime<=G)p(w),le.sortIndex=le.expirationTime,i(v,le);else break;le=c(w)}}function H(G){if(b=!1,A(G),!T)if(c(v)!==null)T=!0,he($);else{var le=c(w);le!==null&&me(H,le.startTime-G)}}function $(G,le){T=!1,b&&(b=!1,E(W),W=-1),D=!0;var q=L;try{for(A(le),S=c(v);S!==null&&(!(S.expirationTime>le)||G&&!de());){var N=S.callback;if(typeof N=="function"){S.callback=null,L=S.priorityLevel;var I=N(S.expirationTime<=le);le=o.unstable_now(),typeof I=="function"?S.callback=I:S===c(v)&&p(v),A(le)}else p(v);S=c(v)}if(S!==null)var ue=!0;else{var fe=c(w);fe!==null&&me(H,fe.startTime-le),ue=!1}return ue}finally{S=null,L=q,D=!1}}var V=!1,Z=null,W=-1,Y=5,z=-1;function de(){return!(o.unstable_now()-zG||125N?(G.sortIndex=q,i(w,G),c(v)===null&&G===c(w)&&(b?(E(W),W=-1):b=!0,me(H,q-N))):(G.sortIndex=I,i(v,G),T||D||(T=!0,he($))),G},o.unstable_shouldYield=de,o.unstable_wrapCallback=function(G){var le=L;return function(){var q=L;L=le;try{return G.apply(this,arguments)}finally{L=q}}}})(Ds)),Ds}var Bo;function Nu(){return Bo||(Bo=1,Es.exports=ku()),Es.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Oo;function Su(){if(Oo)return tn;Oo=1;var o=Ls(),i=Nu();function c(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,w=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j={},S={};function L(e){return v.call(S,e)?!0:v.call(j,e)?!1:w.test(e)?S[e]=!0:(j[e]=!0,!1)}function D(e,n,r,l){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function T(e,n,r,l){if(n===null||typeof n>"u"||D(e,n,r,l))return!0;if(l)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function b(e,n,r,l,s,a,u){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=a,this.removeEmptyString=u}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){k[e]=new b(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];k[n]=new b(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){k[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){k[e]=new b(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){k[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){k[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){k[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){k[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){k[e]=new b(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function M(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(E,M);k[n]=new b(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(E,M);k[n]=new b(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(E,M);k[n]=new b(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){k[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),k.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){k[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function A(e,n,r,l){var s=k.hasOwnProperty(n)?k[n]:null;(s!==null?s.type!==0:l||!(2f||s[u]!==a[f]){var y=` `+s[u].replace(" at new "," at ");return e.displayName&&y.includes("")&&(y=y.replace("",e.displayName)),y}while(1<=u&&0<=f);break}}}finally{ue=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?I(e):""}function O(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=fe(e.type,!1),e;case 11:return e=fe(e.type.render,!1),e;case 1:return e=fe(e.type,!0),e;default:return""}}function ce(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case V:return"Portal";case Y:return"Profiler";case W:return"StrictMode";case ie:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case de:return(e.displayName||"Context")+".Consumer";case z:return(e._context.displayName||"Context")+".Provider";case _e:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return n=e.displayName||null,n!==null?n:ce(e.type)||"Memo";case he:n=e._payload,e=e._init;try{return ce(e(n))}catch{}}return null}function ye(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(n);case 8:return n===W?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function be(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Je(e){var n=be(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return s.call(this)},set:function(u){l=""+u,a.call(this,u)}}),Object.defineProperty(e,n,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(u){l=""+u},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function En(e){e._valueTracker||(e._valueTracker=Je(e))}function ml(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),l="";return e&&(l=be(e)?e.checked?"true":"false":e.value),e=l,e!==r?(n.setValue(e),!0):!1}function wn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _r(e,n){var r=n.checked;return q({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function gl(e,n){var r=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;r=we(n.value!=null?n.value:r),e._wrapperState={initialChecked:l,initialValue:r,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function xr(e,n){n=n.checked,n!=null&&A(e,"checked",n,!1)}function Ft(e,n){xr(e,n);var r=we(n.value),l=n.type;if(r!=null)l==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Bt(e,n.type,r):n.hasOwnProperty("defaultValue")&&Bt(e,n.type,we(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function jr(e,n,r){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,r||n===e.value||(e.value=n),e.defaultValue=n}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Bt(e,n,r){(n!=="number"||wn(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var xt=Array.isArray;function Qn(e,n,r,l){if(e=e.options,n){n={};for(var s=0;s"+n.valueOf().toString()+"",n=jt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function qn(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var Zn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},vl=["Webkit","ms","Moz","O"];Object.keys(Zn).forEach(function(e){vl.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Zn[n]=Zn[e]})});function Sr(e,n,r){return n==null||typeof n=="boolean"||n===""?"":r||typeof n!="number"||n===0||Zn.hasOwnProperty(e)&&Zn[e]?(""+n).trim():n+"px"}function Cr(e,n){e=e.style;for(var r in n)if(n.hasOwnProperty(r)){var l=r.indexOf("--")===0,s=Sr(r,n[r],l);r==="float"&&(r="cssFloat"),l?e.setProperty(r,s):e[r]=s}}var yl=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $t(e,n){if(n){if(yl[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(c(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(c(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(c(61))}if(n.style!=null&&typeof n.style!="object")throw Error(c(62))}}function Wt(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Te=null;function Qs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ys=null,Ht=null,Vt=null;function Ii(e){if(e=Qr(e)){if(typeof Ys!="function")throw Error(c(280));var n=e.stateNode;n&&(n=Ul(n),Ys(e.stateNode,e.type,n))}}function Fi(e){Ht?Vt?Vt.push(e):Vt=[e]:Ht=e}function Bi(){if(Ht){var e=Ht,n=Vt;if(Vt=Ht=null,Ii(e),n)for(e=0;e>>=0,e===0?32:31-(J2(e)/e3|0)|0}var kl=64,Nl=4194304;function Er(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sl(e,n){var r=e.pendingLanes;if(r===0)return 0;var l=0,s=e.suspendedLanes,a=e.pingedLanes,u=r&268435455;if(u!==0){var f=u&~s;f!==0?l=Er(f):(a&=u,a!==0&&(l=Er(a)))}else u=r&~s,u!==0?l=Er(u):a!==0&&(l=Er(a));if(l===0)return 0;if(n!==0&&n!==l&&(n&s)===0&&(s=l&-l,a=n&-n,s>=a||s===16&&(a&4194240)!==0))return n;if((l&4)!==0&&(l|=r&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0r;r++)n.push(e);return n}function Dr(e,n,r){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-kn(n),e[n]=r}function l3(e,n){var r=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0=Br),fc=" ",hc=!1;function mc(e,n){switch(e){case"keyup":return T3.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qt=!1;function z3(e,n){switch(e){case"compositionend":return gc(n);case"keypress":return n.which!==32?null:(hc=!0,fc);case"textInput":return e=n.data,e===fc&&hc?null:e;default:return null}}function A3(e,n){if(Qt)return e==="compositionend"||!fa&&mc(e,n)?(e=oc(),El=oa=tt=null,Qt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=kc(r)}}function Sc(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Sc(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Cc(){for(var e=window,n=wn();n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=wn(e.document)}return n}function ga(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function H3(e){var n=Cc(),r=e.focusedElem,l=e.selectionRange;if(n!==r&&r&&r.ownerDocument&&Sc(r.ownerDocument.documentElement,r)){if(l!==null&&ga(r)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in r)r.selectionStart=n,r.selectionEnd=Math.min(e,r.value.length);else if(e=(n=r.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,a=Math.min(l.start,s);l=l.end===void 0?a:Math.min(l.end,s),!e.extend&&a>l&&(s=l,l=a,a=s),s=Nc(r,a);var u=Nc(r,l);s&&u&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(n=n.createRange(),n.setStart(s.node,s.offset),e.removeAllRanges(),a>l?(e.addRange(n),e.extend(u.node,u.offset)):(n.setEnd(u.node,u.offset),e.addRange(n)))}}for(n=[],e=r;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Yt=null,va=null,Wr=null,ya=!1;function bc(e,n,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ya||Yt==null||Yt!==wn(l)||(l=Yt,"selectionStart"in l&&ga(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Wr&&$r(Wr,l)||(Wr=l,l=Fl(va,"onSelect"),0er||(e.current=Ea[er],Ea[er]=null,er--)}function Le(e,n){er++,Ea[er]=e.current,e.current=n}var at={},Ye=st(at),rn=st(!1),Nt=at;function nr(e,n){var r=e.type.contextTypes;if(!r)return at;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=n[a];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=s),s}function ln(e){return e=e.childContextTypes,e!=null}function $l(){Ee(rn),Ee(Ye)}function $c(e,n,r){if(Ye.current!==at)throw Error(c(168));Le(Ye,n),Le(rn,r)}function Wc(e,n,r){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return r;l=l.getChildContext();for(var s in l)if(!(s in n))throw Error(c(108,ye(e)||"Unknown",s));return q({},r,l)}function Wl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||at,Nt=Ye.current,Le(Ye,e),Le(rn,rn.current),!0}function Hc(e,n,r){var l=e.stateNode;if(!l)throw Error(c(169));r?(e=Wc(e,n,Nt),l.__reactInternalMemoizedMergedChildContext=e,Ee(rn),Ee(Ye),Le(Ye,e)):Ee(rn),Le(rn,r)}var Un=null,Hl=!1,Da=!1;function Vc(e){Un===null?Un=[e]:Un.push(e)}function t0(e){Hl=!0,Vc(e)}function ot(){if(!Da&&Un!==null){Da=!0;var e=0,n=Se;try{var r=Un;for(Se=1;e>=u,s-=u,$n=1<<32-kn(n)+s|r<pe?(Ve=oe,oe=null):Ve=oe.sibling;var ke=F(C,oe,P[pe],K);if(ke===null){oe===null&&(oe=Ve);break}e&&oe&&ke.alternate===null&&n(C,oe),_=a(ke,_,pe),ae===null?re=ke:ae.sibling=ke,ae=ke,oe=Ve}if(pe===P.length)return r(C,oe),De&&Ct(C,pe),re;if(oe===null){for(;pepe?(Ve=oe,oe=null):Ve=oe.sibling;var gt=F(C,oe,ke.value,K);if(gt===null){oe===null&&(oe=Ve);break}e&&oe&>.alternate===null&&n(C,oe),_=a(gt,_,pe),ae===null?re=gt:ae.sibling=gt,ae=gt,oe=Ve}if(ke.done)return r(C,oe),De&&Ct(C,pe),re;if(oe===null){for(;!ke.done;pe++,ke=P.next())ke=U(C,ke.value,K),ke!==null&&(_=a(ke,_,pe),ae===null?re=ke:ae.sibling=ke,ae=ke);return De&&Ct(C,pe),re}for(oe=l(C,oe);!ke.done;pe++,ke=P.next())ke=X(oe,C,pe,ke.value,K),ke!==null&&(e&&ke.alternate!==null&&oe.delete(ke.key===null?pe:ke.key),_=a(ke,_,pe),ae===null?re=ke:ae.sibling=ke,ae=ke);return e&&oe.forEach(function(M0){return n(C,M0)}),De&&Ct(C,pe),re}function Ie(C,_,P,K){if(typeof P=="object"&&P!==null&&P.type===Z&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case $:e:{for(var re=P.key,ae=_;ae!==null;){if(ae.key===re){if(re=P.type,re===Z){if(ae.tag===7){r(C,ae.sibling),_=s(ae,P.props.children),_.return=C,C=_;break e}}else if(ae.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===he&&Zc(re)===ae.type){r(C,ae.sibling),_=s(ae,P.props),_.ref=Yr(C,ae,P),_.return=C,C=_;break e}r(C,ae);break}else n(C,ae);ae=ae.sibling}P.type===Z?(_=zt(P.props.children,C.mode,K,P.key),_.return=C,C=_):(K=ys(P.type,P.key,P.props,null,C.mode,K),K.ref=Yr(C,_,P),K.return=C,C=K)}return u(C);case V:e:{for(ae=P.key;_!==null;){if(_.key===ae)if(_.tag===4&&_.stateNode.containerInfo===P.containerInfo&&_.stateNode.implementation===P.implementation){r(C,_.sibling),_=s(_,P.children||[]),_.return=C,C=_;break e}else{r(C,_);break}else n(C,_);_=_.sibling}_=Po(P,C.mode,K),_.return=C,C=_}return u(C);case he:return ae=P._init,Ie(C,_,ae(P._payload),K)}if(xt(P))return ne(C,_,P,K);if(le(P))return te(C,_,P,K);Ql(C,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,_!==null&&_.tag===6?(r(C,_.sibling),_=s(_,P),_.return=C,C=_):(r(C,_),_=Lo(P,C.mode,K),_.return=C,C=_),u(C)):r(C,_)}return Ie}var sr=Xc(!0),Jc=Xc(!1),Yl=st(null),ql=null,ar=null,Ia=null;function Fa(){Ia=ar=ql=null}function Ba(e){var n=Yl.current;Ee(Yl),e._currentValue=n}function Oa(e,n,r){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===r)break;e=e.return}}function or(e,n){ql=e,Ia=ar=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(sn=!0),e.firstContext=null)}function yn(e){var n=e._currentValue;if(Ia!==e)if(e={context:e,memoizedValue:n,next:null},ar===null){if(ql===null)throw Error(c(308));ar=e,ql.dependencies={lanes:0,firstContext:e}}else ar=ar.next=e;return n}var bt=null;function Ua(e){bt===null?bt=[e]:bt.push(e)}function e1(e,n,r,l){var s=n.interleaved;return s===null?(r.next=r,Ua(n)):(r.next=s.next,s.next=r),n.interleaved=r,Hn(e,l)}function Hn(e,n){e.lanes|=n;var r=e.alternate;for(r!==null&&(r.lanes|=n),r=e,e=e.return;e!==null;)e.childLanes|=n,r=e.alternate,r!==null&&(r.childLanes|=n),r=e,e=e.return;return r.tag===3?r.stateNode:null}var it=!1;function $a(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function n1(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Vn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function ct(e,n,r){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(je&2)!==0){var s=l.pending;return s===null?n.next=n:(n.next=s.next,s.next=n),l.pending=n,Hn(e,r)}return s=l.interleaved,s===null?(n.next=n,Ua(l)):(n.next=s.next,s.next=n),l.interleaved=n,Hn(e,r)}function Zl(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,r|=l,n.lanes=r,ta(e,r)}}function t1(e,n){var r=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var u={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=u:a=a.next=u,r=r.next}while(r!==null);a===null?s=a=n:a=a.next=n}else s=a=n;r={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:l.shared,effects:l.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}function Xl(e,n,r,l){var s=e.updateQueue;it=!1;var a=s.firstBaseUpdate,u=s.lastBaseUpdate,f=s.shared.pending;if(f!==null){s.shared.pending=null;var y=f,R=y.next;y.next=null,u===null?a=R:u.next=R,u=y;var B=e.alternate;B!==null&&(B=B.updateQueue,f=B.lastBaseUpdate,f!==u&&(f===null?B.firstBaseUpdate=R:f.next=R,B.lastBaseUpdate=y))}if(a!==null){var U=s.baseState;u=0,B=R=y=null,f=a;do{var F=f.lane,X=f.eventTime;if((l&F)===F){B!==null&&(B=B.next={eventTime:X,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var ne=e,te=f;switch(F=n,X=r,te.tag){case 1:if(ne=te.payload,typeof ne=="function"){U=ne.call(X,U,F);break e}U=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=te.payload,F=typeof ne=="function"?ne.call(X,U,F):ne,F==null)break e;U=q({},U,F);break e;case 2:it=!0}}f.callback!==null&&f.lane!==0&&(e.flags|=64,F=s.effects,F===null?s.effects=[f]:F.push(f))}else X={eventTime:X,lane:F,tag:f.tag,payload:f.payload,callback:f.callback,next:null},B===null?(R=B=X,y=U):B=B.next=X,u|=F;if(f=f.next,f===null){if(f=s.shared.pending,f===null)break;F=f,f=F.next,F.next=null,s.lastBaseUpdate=F,s.shared.pending=null}}while(!0);if(B===null&&(y=U),s.baseState=y,s.firstBaseUpdate=R,s.lastBaseUpdate=B,n=s.shared.interleaved,n!==null){s=n;do u|=s.lane,s=s.next;while(s!==n)}else a===null&&(s.shared.lanes=0);Et|=u,e.lanes=u,e.memoizedState=U}}function r1(e,n,r){if(e=n.effects,n.effects=null,e!==null)for(n=0;nr?r:4,e(!0);var l=Ka.transition;Ka.transition={};try{e(!1),n()}finally{Se=r,Ka.transition=l}}function w1(){return _n().memoizedState}function a0(e,n,r){var l=ft(e);if(r={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null},k1(e))N1(n,r);else if(r=e1(e,n,r,l),r!==null){var s=nn();Pn(r,e,l,s),S1(r,n,l)}}function o0(e,n,r){var l=ft(e),s={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null};if(k1(e))N1(n,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=n.lastRenderedReducer,a!==null))try{var u=n.lastRenderedState,f=a(u,r);if(s.hasEagerState=!0,s.eagerState=f,Nn(f,u)){var y=n.interleaved;y===null?(s.next=s,Ua(n)):(s.next=y.next,y.next=s),n.interleaved=s;return}}catch{}finally{}r=e1(e,n,s,l),r!==null&&(s=nn(),Pn(r,e,l,s),S1(r,n,l))}}function k1(e){var n=e.alternate;return e===ze||n!==null&&n===ze}function N1(e,n){Jr=ns=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function S1(e,n,r){if((r&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,r|=l,n.lanes=r,ta(e,r)}}var ls={readContext:yn,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},i0={readContext:yn,useCallback:function(e,n){return zn().memoizedState=[e,n===void 0?null:n],e},useContext:yn,useEffect:h1,useImperativeHandle:function(e,n,r){return r=r!=null?r.concat([e]):null,ts(4194308,4,v1.bind(null,n,e),r)},useLayoutEffect:function(e,n){return ts(4194308,4,e,n)},useInsertionEffect:function(e,n){return ts(4,2,e,n)},useMemo:function(e,n){var r=zn();return n=n===void 0?null:n,e=e(),r.memoizedState=[e,n],e},useReducer:function(e,n,r){var l=zn();return n=r!==void 0?r(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=a0.bind(null,ze,e),[l.memoizedState,e]},useRef:function(e){var n=zn();return e={current:e},n.memoizedState=e},useState:p1,useDebugValue:eo,useDeferredValue:function(e){return zn().memoizedState=e},useTransition:function(){var e=p1(!1),n=e[0];return e=s0.bind(null,e[1]),zn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,r){var l=ze,s=zn();if(De){if(r===void 0)throw Error(c(407));r=r()}else{if(r=n(),He===null)throw Error(c(349));(Pt&30)!==0||o1(l,n,r)}s.memoizedState=r;var a={value:r,getSnapshot:n};return s.queue=a,h1(c1.bind(null,l,a,e),[e]),l.flags|=2048,tl(9,i1.bind(null,l,a,r,n),void 0,null),r},useId:function(){var e=zn(),n=He.identifierPrefix;if(De){var r=Wn,l=$n;r=(l&~(1<<32-kn(l)-1)).toString(32)+r,n=":"+n+"R"+r,r=el++,0<\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=u.createElement(r,{is:l.is}):(e=u.createElement(r),r==="select"&&(u=e,l.multiple?u.multiple=!0:l.size&&(u.size=l.size))):e=u.createElementNS(e,r),e[Tn]=n,e[Kr]=l,V1(e,n,!1,!1),n.stateNode=e;e:{switch(u=Wt(r,l),r){case"dialog":Pe("cancel",e),Pe("close",e),s=l;break;case"iframe":case"object":case"embed":Pe("load",e),s=l;break;case"video":case"audio":for(s=0;spr&&(n.flags|=128,l=!0,rl(a,!1),n.lanes=4194304)}else{if(!l)if(e=Jl(u),e!==null){if(n.flags|=128,l=!0,r=e.updateQueue,r!==null&&(n.updateQueue=r,n.flags|=4),rl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!De)return Ze(n),null}else 2*Me()-a.renderingStartTime>pr&&r!==1073741824&&(n.flags|=128,l=!0,rl(a,!1),n.lanes=4194304);a.isBackwards?(u.sibling=n.child,n.child=u):(r=a.last,r!==null?r.sibling=u:n.child=u,a.last=u)}return a.tail!==null?(n=a.tail,a.rendering=n,a.tail=n.sibling,a.renderingStartTime=Me(),n.sibling=null,r=Re.current,Le(Re,l?r&1|2:r&1),n):(Ze(n),null);case 22:case 23:return So(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(mn&1073741824)!==0&&(Ze(n),n.subtreeFlags&6&&(n.flags|=8192)):Ze(n),null;case 24:return null;case 25:return null}throw Error(c(156,n.tag))}function g0(e,n){switch(Ra(n),n.tag){case 1:return ln(n.type)&&$l(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ir(),Ee(rn),Ee(Ye),Ga(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Ha(n),null;case 13:if(Ee(Re),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(c(340));lr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Ee(Re),null;case 4:return ir(),null;case 10:return Ba(n.type._context),null;case 22:case 23:return So(),null;case 24:return null;default:return null}}var is=!1,Xe=!1,v0=typeof WeakSet=="function"?WeakSet:Set,ee=null;function ur(e,n){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(l){Ae(e,n,l)}else r.current=null}function fo(e,n,r){try{r()}catch(l){Ae(e,n,l)}}var Q1=!1;function y0(e,n){if(Na=Ll,e=Cc(),ga(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var s=l.anchorOffset,a=l.focusNode;l=l.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var u=0,f=-1,y=-1,R=0,B=0,U=e,F=null;n:for(;;){for(var X;U!==r||s!==0&&U.nodeType!==3||(f=u+s),U!==a||l!==0&&U.nodeType!==3||(y=u+l),U.nodeType===3&&(u+=U.nodeValue.length),(X=U.firstChild)!==null;)F=U,U=X;for(;;){if(U===e)break n;if(F===r&&++R===s&&(f=u),F===a&&++B===l&&(y=u),(X=U.nextSibling)!==null)break;U=F,F=U.parentNode}U=X}r=f===-1||y===-1?null:{start:f,end:y}}else r=null}r=r||{start:0,end:0}}else r=null;for(Sa={focusedElem:e,selectionRange:r},Ll=!1,ee=n;ee!==null;)if(n=ee,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ee=e;else for(;ee!==null;){n=ee;try{var ne=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ne!==null){var te=ne.memoizedProps,Ie=ne.memoizedState,C=n.stateNode,_=C.getSnapshotBeforeUpdate(n.elementType===n.type?te:Cn(n.type,te),Ie);C.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var P=n.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(c(163))}}catch(K){Ae(n,n.return,K)}if(e=n.sibling,e!==null){e.return=n.return,ee=e;break}ee=n.return}return ne=Q1,Q1=!1,ne}function ll(e,n,r){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var s=l=l.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&fo(n,r,a)}s=s.next}while(s!==l)}}function cs(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&e)===e){var l=r.create;r.destroy=l()}r=r.next}while(r!==n)}}function ho(e){var n=e.ref;if(n!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof n=="function"?n(e):n.current=e}}function Y1(e){var n=e.alternate;n!==null&&(e.alternate=null,Y1(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Tn],delete n[Kr],delete n[Pa],delete n[e0],delete n[n0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function q1(e){return e.tag===5||e.tag===3||e.tag===4}function Z1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||q1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function mo(e,n,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?r.nodeType===8?r.parentNode.insertBefore(e,n):r.insertBefore(e,n):(r.nodeType===8?(n=r.parentNode,n.insertBefore(e,r)):(n=r,n.appendChild(e)),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=Ol));else if(l!==4&&(e=e.child,e!==null))for(mo(e,n,r),e=e.sibling;e!==null;)mo(e,n,r),e=e.sibling}function go(e,n,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(go(e,n,r),e=e.sibling;e!==null;)go(e,n,r),e=e.sibling}var Ge=null,bn=!1;function ut(e,n,r){for(r=r.child;r!==null;)X1(e,n,r),r=r.sibling}function X1(e,n,r){if(Dn&&typeof Dn.onCommitFiberUnmount=="function")try{Dn.onCommitFiberUnmount(wl,r)}catch{}switch(r.tag){case 5:Xe||ur(r,n);case 6:var l=Ge,s=bn;Ge=null,ut(e,n,r),Ge=l,bn=s,Ge!==null&&(bn?(e=Ge,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ge.removeChild(r.stateNode));break;case 18:Ge!==null&&(bn?(e=Ge,r=r.stateNode,e.nodeType===8?La(e.parentNode,r):e.nodeType===1&&La(e,r),Mr(e)):La(Ge,r.stateNode));break;case 4:l=Ge,s=bn,Ge=r.stateNode.containerInfo,bn=!0,ut(e,n,r),Ge=l,bn=s;break;case 0:case 11:case 14:case 15:if(!Xe&&(l=r.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){s=l=l.next;do{var a=s,u=a.destroy;a=a.tag,u!==void 0&&((a&2)!==0||(a&4)!==0)&&fo(r,n,u),s=s.next}while(s!==l)}ut(e,n,r);break;case 1:if(!Xe&&(ur(r,n),l=r.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=r.memoizedProps,l.state=r.memoizedState,l.componentWillUnmount()}catch(f){Ae(r,n,f)}ut(e,n,r);break;case 21:ut(e,n,r);break;case 22:r.mode&1?(Xe=(l=Xe)||r.memoizedState!==null,ut(e,n,r),Xe=l):ut(e,n,r);break;default:ut(e,n,r)}}function J1(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new v0),n.forEach(function(l){var s=b0.bind(null,e,l);r.has(l)||(r.add(l),l.then(s,s))})}}function Ln(e,n){var r=n.deletions;if(r!==null)for(var l=0;ls&&(s=u),l&=~a}if(l=s,l=Me()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*x0(l/1960))-l,10e?16:e,pt===null)var l=!1;else{if(e=pt,pt=null,hs=0,(je&6)!==0)throw Error(c(331));var s=je;for(je|=4,ee=e.current;ee!==null;){var a=ee,u=a.child;if((ee.flags&16)!==0){var f=a.deletions;if(f!==null){for(var y=0;yMe()-_o?Tt(e,0):yo|=r),on(e,n)}function pu(e,n){n===0&&((e.mode&1)===0?n=1:(n=Nl,Nl<<=1,(Nl&130023424)===0&&(Nl=4194304)));var r=nn();e=Hn(e,n),e!==null&&(Dr(e,n,r),on(e,r))}function C0(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),pu(e,r)}function b0(e,n){var r=0;switch(e.tag){case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(c(314))}l!==null&&l.delete(n),pu(e,r)}var fu;fu=function(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps||rn.current)sn=!0;else{if((e.lanes&r)===0&&(n.flags&128)===0)return sn=!1,h0(e,n,r);sn=(e.flags&131072)!==0}else sn=!1,De&&(n.flags&1048576)!==0&&Gc(n,Gl,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;os(e,n),e=n.pendingProps;var s=nr(n,Ye.current);or(n,r),s=Ya(null,n,l,e,s,r);var a=qa();return n.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,ln(l)?(a=!0,Wl(n)):a=!1,n.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,$a(n),s.updater=ss,n.stateNode=s,s._reactInternals=n,to(n,l,e,r),n=ao(null,n,l,!0,a,r)):(n.tag=0,De&&a&&Ta(n),en(null,n,s,r),n=n.child),n;case 16:l=n.elementType;e:{switch(os(e,n),e=n.pendingProps,s=l._init,l=s(l._payload),n.type=l,s=n.tag=P0(l),e=Cn(l,e),s){case 0:n=so(null,n,l,e,r);break e;case 1:n=B1(null,n,l,e,r);break e;case 11:n=z1(null,n,l,e,r);break e;case 14:n=A1(null,n,l,Cn(l.type,e),r);break e}throw Error(c(306,l,""))}return n;case 0:return l=n.type,s=n.pendingProps,s=n.elementType===l?s:Cn(l,s),so(e,n,l,s,r);case 1:return l=n.type,s=n.pendingProps,s=n.elementType===l?s:Cn(l,s),B1(e,n,l,s,r);case 3:e:{if(O1(n),e===null)throw Error(c(387));l=n.pendingProps,a=n.memoizedState,s=a.element,n1(e,n),Xl(n,l,null,r);var u=n.memoizedState;if(l=u.element,a.isDehydrated)if(a={element:l,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},n.updateQueue.baseState=a,n.memoizedState=a,n.flags&256){s=cr(Error(c(423)),n),n=U1(e,n,l,r,s);break e}else if(l!==s){s=cr(Error(c(424)),n),n=U1(e,n,l,r,s);break e}else for(hn=lt(n.stateNode.containerInfo.firstChild),fn=n,De=!0,Sn=null,r=Jc(n,null,l,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(lr(),l===s){n=Gn(e,n,r);break e}en(e,n,l,r)}n=n.child}return n;case 5:return l1(n),e===null&&Aa(n),l=n.type,s=n.pendingProps,a=e!==null?e.memoizedProps:null,u=s.children,Ca(l,s)?u=null:a!==null&&Ca(l,a)&&(n.flags|=32),F1(e,n),en(e,n,u,r),n.child;case 6:return e===null&&Aa(n),null;case 13:return $1(e,n,r);case 4:return Wa(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=sr(n,null,l,r):en(e,n,l,r),n.child;case 11:return l=n.type,s=n.pendingProps,s=n.elementType===l?s:Cn(l,s),z1(e,n,l,s,r);case 7:return en(e,n,n.pendingProps,r),n.child;case 8:return en(e,n,n.pendingProps.children,r),n.child;case 12:return en(e,n,n.pendingProps.children,r),n.child;case 10:e:{if(l=n.type._context,s=n.pendingProps,a=n.memoizedProps,u=s.value,Le(Yl,l._currentValue),l._currentValue=u,a!==null)if(Nn(a.value,u)){if(a.children===s.children&&!rn.current){n=Gn(e,n,r);break e}}else for(a=n.child,a!==null&&(a.return=n);a!==null;){var f=a.dependencies;if(f!==null){u=a.child;for(var y=f.firstContext;y!==null;){if(y.context===l){if(a.tag===1){y=Vn(-1,r&-r),y.tag=2;var R=a.updateQueue;if(R!==null){R=R.shared;var B=R.pending;B===null?y.next=y:(y.next=B.next,B.next=y),R.pending=y}}a.lanes|=r,y=a.alternate,y!==null&&(y.lanes|=r),Oa(a.return,r,n),f.lanes|=r;break}y=y.next}}else if(a.tag===10)u=a.type===n.type?null:a.child;else if(a.tag===18){if(u=a.return,u===null)throw Error(c(341));u.lanes|=r,f=u.alternate,f!==null&&(f.lanes|=r),Oa(u,r,n),u=a.sibling}else u=a.child;if(u!==null)u.return=a;else for(u=a;u!==null;){if(u===n){u=null;break}if(a=u.sibling,a!==null){a.return=u.return,u=a;break}u=u.return}a=u}en(e,n,s.children,r),n=n.child}return n;case 9:return s=n.type,l=n.pendingProps.children,or(n,r),s=yn(s),l=l(s),n.flags|=1,en(e,n,l,r),n.child;case 14:return l=n.type,s=Cn(l,n.pendingProps),s=Cn(l.type,s),A1(e,n,l,s,r);case 15:return M1(e,n,n.type,n.pendingProps,r);case 17:return l=n.type,s=n.pendingProps,s=n.elementType===l?s:Cn(l,s),os(e,n),n.tag=1,ln(l)?(e=!0,Wl(n)):e=!1,or(n,r),b1(n,l,s),to(n,l,s,r),ao(null,n,l,!0,e,r);case 19:return H1(e,n,r);case 22:return I1(e,n,r)}throw Error(c(156,n.tag))};function hu(e,n){return Ki(e,n)}function L0(e,n,r,l){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,n,r,l){return new L0(e,n,r,l)}function bo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function P0(e){if(typeof e=="function")return bo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_e)return 11;if(e===se)return 14}return 2}function mt(e,n){var r=e.alternate;return r===null?(r=jn(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ys(e,n,r,l,s,a){var u=2;if(l=e,typeof e=="function")bo(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case Z:return zt(r.children,s,a,n);case W:u=8,s|=8;break;case Y:return e=jn(12,r,n,s|2),e.elementType=Y,e.lanes=a,e;case ie:return e=jn(13,r,n,s),e.elementType=ie,e.lanes=a,e;case J:return e=jn(19,r,n,s),e.elementType=J,e.lanes=a,e;case me:return _s(r,s,a,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case z:u=10;break e;case de:u=9;break e;case _e:u=11;break e;case se:u=14;break e;case he:u=16,l=null;break e}throw Error(c(130,e==null?e:typeof e,""))}return n=jn(u,r,n,s),n.elementType=e,n.type=l,n.lanes=a,n}function zt(e,n,r,l){return e=jn(7,e,l,n),e.lanes=r,e}function _s(e,n,r,l){return e=jn(22,e,l,n),e.elementType=me,e.lanes=r,e.stateNode={isHidden:!1},e}function Lo(e,n,r){return e=jn(6,e,null,n),e.lanes=r,e}function Po(e,n,r){return n=jn(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function E0(e,n,r,l,s){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=na(0),this.expirationTimes=na(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=na(0),this.identifierPrefix=l,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Eo(e,n,r,l,s,a,u,f,y){return e=new E0(e,n,r,f,y),n===1?(n=1,a===!0&&(n|=8)):n=0,a=jn(3,null,null,n),e.current=a,a.stateNode=e,a.memoizedState={element:l,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},$a(a),e}function D0(e,n,r){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(i){console.error(i)}}return o(),Ps.exports=Su(),Ps.exports}var Wo;function Cu(){if(Wo)return cl;Wo=1;var o=$o();return cl.createRoot=o.createRoot,cl.hydrateRoot=o.hydrateRoot,cl}var bu=Cu(),x=Ls();function Lu({tabs:o,activeTab:i,onTabChange:c}){return t.jsx("div",{className:"cn-tab-nav",children:o.map(p=>t.jsx("button",{className:`cn-tab-nav__item${i===p.id?" cn-tab-nav__item--active":""}`,onClick:()=>c(p.id),type:"button",children:p.label},p.id))})}function Pu({type:o="info",dismissible:i=!1,onDismiss:c,children:p}){const d={success:"notice-success",error:"notice-error",warning:"notice-warning",info:"notice-info"}[o]||"notice-info";return t.jsxs("div",{className:`notice ${d}${i?" is-dismissible":""}`,children:[t.jsx("p",{children:p}),i&&c&&t.jsx("button",{type:"button",className:"notice-dismiss",onClick:c,children:t.jsx("span",{className:"screen-reader-text",children:"Dismiss this notice."})})]})}function Ue(){const o=window.cnReactData||{},i=o.app_id||"",c=(o.subscription||"").toLowerCase(),p=!!i;let d="basic";return p&&c==="pro"?d="pro":p&&(d="free"),{tier:d,isBasic:d==="basic",isFree:d==="free",isPro:d==="pro",isConnected:p,version:o.version||""}}const Eu={basic:"Basic (Not Connected)",free:"Free Plan",pro:"Pro Plan"};function Du(){const{tier:o,version:i}=Ue();return t.jsxs("div",{className:"cn-footer",children:[t.jsxs("span",{className:"cn-footer__version",children:["Compliance by Hu-manity.co v",i||"—"," — ",Eu[o]||""]}),t.jsxs("span",{className:"cn-footer__links",children:[t.jsx("a",{href:"https://cookie-compliance.co/documentation/",target:"_blank",rel:"noopener noreferrer",children:"Documentation"})," | ",t.jsx("a",{href:"https://cookie-compliance.co/support/",target:"_blank",rel:"noopener noreferrer",children:"Support"})," | ",t.jsx("a",{href:"https://cookie-compliance.co/privacy-policy/",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})]})]})}const Ho=x.createContext({dashboard:null,refetchDashboard:()=>{},isLoadingDashboard:!1});function vt(){return x.useContext(Ho)}const Vo=x.createContext({config:null,isLoadingConfig:!1,refetchConfig:()=>{}});function At(){return x.useContext(Vo)}const Ts=o=>"cn_setup_wizard_complete_"+(o||"default"),Rs=o=>"cn_has_platform_config_"+(o||""),Tu=o=>"cn_setup_just_finished_"+(o||"default"),Go=x.createContext(null);function Ru({onLawSave:o,onConsentClose:i,children:c}){const[p,d]=x.useState(!1),[m,g]=x.useState(0),[h,v]=x.useState(!1),[w,j]=x.useState(!1),[S,L]=x.useState(0),[D,T]=x.useState(!1),[b,k]=x.useState(!1),[E,M]=x.useState(0),[A,H]=x.useState(!1),$=x.useMemo(()=>{var J,se;try{const he=((se=(J=window.cnReactData)==null?void 0:J.options)==null?void 0:se.app_id)||"";return!!he&&localStorage.getItem(Rs(he))==="1"}catch{return!1}},[]),V=x.useCallback(()=>{d(!1),v(!1),j(!1),T(!1),k(!1),H(!1)},[]),Z=x.useCallback(()=>{V(),d(!0),g(J=>J+1)},[V]),W=x.useCallback(()=>{V(),j(!0),L(J=>J+1)},[V]),Y=x.useCallback(()=>{V(),k(!0),M(J=>J+1)},[V]),z=x.useCallback(()=>{v(!0),setTimeout(()=>{d(!1),v(!1)},160)},[]),de=x.useCallback(()=>{T(!0),setTimeout(()=>{j(!1),T(!1),o&&o()},160)},[o]),_e=x.useCallback(()=>{H(!0),setTimeout(()=>{k(!1),H(!1),i&&i()},160)},[i]),ie={showBannerWizard:p,bannerScrollTrigger:m,bannerClosing:h,showLawWizard:w,lawScrollTrigger:S,lawClosing:D,showConsentPanel:b,consentScrollTrigger:E,consentClosing:A,hasPlatformConfig:$,openBannerWizard:Z,openLawWizard:W,openConsentPanel:Y,closeBannerWizard:z,closeLawWizard:de,closeConsentPanel:_e,closeAllPanels:V};return t.jsx(Go.Provider,{value:ie,children:c})}function mr(){const o=x.useContext(Go);if(!o)throw new Error("usePanels() must be used inside .");return o}async function cn(o,i={}){var g;const c=window.cnReactData||{},p=new FormData;p.append("action",o),p.append("nonce",c.nonce||""),c.network&&p.append("cn_network","1"),Object.entries(i).forEach(([h,v])=>{p.append(h,v)});const d=await fetch(c.ajaxURL||"/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",body:p});if(!d.ok)throw new Error(`AJAX error: ${d.status}`);const m=await d.json();if(!m.success)throw new Error(((g=m.data)==null?void 0:g.error)||"Request failed");return m.data}async function Mn(o,i={},c="",p=""){const d=window.cnReactData||{},m=new FormData;m.append("action","cn_api_request"),m.append("nonce",p||d.welcomeNonce||""),m.append("request",o),m.append("cn_nonce",c),d.network&&m.append("cn_network","1"),Object.entries(i).forEach(([v,w])=>{m.append(v,w)});const g=await fetch(d.ajaxURL||"/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",body:m});if(!g.ok)throw new Error(`Request failed: ${g.status}`);const h=await g.json();if(h&&h.error)throw new Error(h.error);return h}const zu=()=>{const o=window.cnReactData||{},i={};if(o.devMode){const p=new URLSearchParams(window.location.search).get("cn_usage");p!==null&&(i.cn_usage=p)}return cn("cn_react_dashboard",i)},Au=()=>cn("cn_react_config"),Mu=(o={})=>cn("cn_react_consent_logs",o),Iu=(o={})=>cn("cn_react_export_consent_logs",o),zs=(o={})=>cn("cn_react_save_options",o),Fu=()=>cn("cn_react_dismiss_welcome"),As=()=>cn("cn_react_complete_setup_wizard"),Bu=o=>cn("cn_react_apply_template",{template:o}),Ou=o=>cn("cn_react_rule_values",{param:o}),Uu=(o=[])=>{const i={};return o.forEach((c,p)=>{i[`languages[${p}]`]=c}),cn("cn_react_apply_languages",i)},ul=(o={},i={},c={})=>{const p={};return Object.entries(o).forEach(([d,m])=>{p[`design[${d}]`]=m}),Object.entries(i).forEach(([d,m])=>{p[`config[${d}]`]=m}),Object.entries(c).forEach(([d,m])=>{p[`consentConfig[${d}]`]=m}),cn("cn_react_update_design",p)},$u=()=>cn("cn_react_rescan_scripts"),Wu=()=>cn("cn_react_dev_reset"),Hu=()=>{const o=window.cnReactData||{},i={};return o.network&&(i.cn_network="1"),Mn("sync_config",i,"",o.welcomeNonce||"")},Vu=async()=>{const o=window.cnReactData||{},i=new FormData;i.append("action","cn_purge_cache"),i.append("nonce",o.purgeNonce||""),o.network&&i.append("cn_network","1");const c=await fetch(o.ajaxURL||"/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",body:i});if(!c.ok)throw new Error(`Purge cache failed: ${c.status}`)},Qe=((zi=window.cnReactData)==null?void 0:zi.appUrl)||"https://app.hu-manity.co",Ms={gdpr:"GDPR",ccpa:"CCPA",otherus:"US State Laws",ukpecr:"UK PECR",lgpd:"LGPD",pipeda:"PIPEDA",popia:"POPIA"},Ko={GDPR:{flag:"🇪🇺",geo:"EU"},CCPA:{flag:"🇺🇸",geo:"US"},"US State Laws":{flag:"🇺🇸",geo:"US"},"UK PECR":{flag:"🇬🇧",geo:"UK"},LGPD:{flag:"🇧🇷",geo:"Brazil"},PIPEDA:{flag:"🇨🇦",geo:"Canada"},POPIA:{flag:"🇿🇦",geo:"South Africa"}};function Qo(o){return o?Object.entries(o).filter(([,i])=>!!i).map(([i])=>i):[]}function Yo(o={}){const i=o.google_consent_default,c=o.facebook_consent_default,p=o.microsoft_consent_default;return{google:!!i&&Object.keys(i).length>0,facebook:!!c&&Object.keys(c).length>0,microsoft:!!p&&Object.keys(p).length>0,gpc:!!o.gpc_support,dnt:!!o.do_not_track}}function qo(o={}){const i=o.providers||[],c=i.length,p=i.filter(m=>!m.CategoryID).length,d=c-p;return{total:c,uncategorized:p,categorized:d,allCategorized:c>0&&p===0}}function yt({children:o,sidebar:i}){return t.jsxs("div",{className:"cn-page-layout",children:[t.jsx("div",{className:"cn-main",children:o}),i&&t.jsx("div",{className:"cn-sidebar",children:i})]})}function In({title:o,children:i}){return t.jsxs("div",{className:"cn-side-card",children:[o&&t.jsx("h3",{children:o}),i]})}function $e({variant:o="primary",size:i="md",children:c,...p}){return t.jsx("button",{className:`cn-button cn-button--${o} cn-button--${i}`,type:"button",...p,children:c})}function Ne({label:o,type:i="text",value:c,onChange:p,placeholder:d,options:m,error:g,helper:h,required:v,children:w,...j}){const S=j.id||`cn-field-${o==null?void 0:o.toLowerCase().replace(/\s+/g,"-")}`,L=()=>i==="textarea"?t.jsx("textarea",{id:S,className:`cn-form-field__input cn-form-field__textarea${g?" cn-form-field__input--error":""}`,value:c,onChange:D=>p==null?void 0:p(D.target.value),placeholder:d,...j}):i==="select"?t.jsx("select",{id:S,className:`cn-form-field__input cn-form-field__select${g?" cn-form-field__input--error":""}`,value:c,onChange:D=>p==null?void 0:p(D.target.value),...j,children:m==null?void 0:m.map(D=>t.jsx("option",{value:D.value,children:D.label},D.value))}):t.jsx("input",{id:S,type:i,className:`cn-form-field__input${g?" cn-form-field__input--error":""}`,value:c,onChange:D=>p==null?void 0:p(D.target.value),placeholder:d,...j});return t.jsxs("div",{className:"cn-form-field",children:[o&&t.jsxs("label",{className:"cn-form-field__label",htmlFor:S,children:[o,v&&t.jsx("span",{className:"cn-form-field__req",children:"*"})]}),w||L(),g&&t.jsx("div",{className:"cn-form-field__error",children:g}),h&&!g&&t.jsx("div",{className:"cn-form-field__helper",children:h})]})}function Fn(){return t.jsx("span",{className:"cn-pro-badge",children:"PRO"})}const Zo={basic:0,free:1,pro:2};function Xo({requiredTier:o="pro",children:i,message:c,onCta:p}){const{tier:d}=Ue();if(Zo[d]>=Zo[o])return i;const g=o==="free"?"Connect to Cookie Compliance to unlock this feature.":"Upgrade to Cookie Compliance Pro to unlock this feature.",h=o==="free"?"Connect Now":"Upgrade Now",v=p?t.jsx("button",{type:"button",onClick:p,className:`cn-button cn-button--${o==="free"?"primary":"upgrade"}`,children:h}):t.jsx("a",{href:o==="free"?"#":"https://cookie-compliance.co/pricing/",className:`cn-button cn-button--${o==="free"?"primary":"upgrade"}`,target:o==="pro"?"_blank":void 0,rel:o==="pro"?"noopener noreferrer":void 0,children:h});return t.jsxs("div",{className:"cn-tier-gate",children:[t.jsx("div",{className:"cn-tier-gate__content",children:i}),t.jsx("div",{className:"cn-tier-gate__overlay",children:t.jsxs("div",{className:"cn-tier-gate__cta",children:[o==="pro"&&t.jsx(Fn,{}),t.jsx("p",{children:c||g}),v]})})]})}const Ce={thumb:"_thumb_1g9ys_1",chrome:"_chrome_1g9ys_12",dot:"_dot_1g9ys_23",urlBar:"_urlBar_1g9ys_31",page:"_page_1g9ys_39",lines:"_lines_1g9ys_45",banner:"_banner_1g9ys_57","bar-bottom":"_bar-bottom_1g9ys_69","bar-top":"_bar-top_1g9ys_75",floating:"_floating_1g9ys_81",fixed:"_fixed_1g9ys_87","panel-left":"_panel-left_1g9ys_92","panel-right":"_panel-right_1g9ys_99",panelFloating:"_panelFloating_1g9ys_106",panelFixed:"_panelFixed_1g9ys_110",popup:"_popup_1g9ys_115",bannerHeader:"_bannerHeader_1g9ys_124",toolbarDots:"_toolbarDots_1g9ys_131",pills:"_pills_1g9ys_143",pill:"_pill_1g9ys_143",pillDot:"_pillDot_1g9ys_160",saveBtn:"_saveBtn_1g9ys_167",footerLinks:"_footerLinks_1g9ys_174",link:"_link_1g9ys_181","anim-slide-bottom":"_anim-slide-bottom_1g9ys_188",huPreviewSlideUp:"_huPreviewSlideUp_1g9ys_1","anim-slide-top":"_anim-slide-top_1g9ys_192",huPreviewSlideDown:"_huPreviewSlideDown_1g9ys_1","anim-slide-left":"_anim-slide-left_1g9ys_196",huPreviewSlideLeft:"_huPreviewSlideLeft_1g9ys_1","anim-slide-right":"_anim-slide-right_1g9ys_200",huPreviewSlideRight:"_huPreviewSlideRight_1g9ys_1","anim-slide-center":"_anim-slide-center_1g9ys_204",huPreviewScaleIn:"_huPreviewScaleIn_1g9ys_1","anim-fade":"_anim-fade_1g9ys_208",huPreviewFade:"_huPreviewFade_1g9ys_1"},Gu=["#c4c4c4","#d5b565","#9891b1"];function Ku(o){const i=o.replace("#",""),c=parseInt(i.slice(0,2),16),p=parseInt(i.slice(2,4),16),d=parseInt(i.slice(4,6),16);return(c*299+p*587+d*114)/1e3>155}function Jo({preset:o,isActive:i}){const{position:c="bottom",displayType:p="floating",bannerColor:d="#4d4d4d",primaryColor:m="#20c19e",btnBorderRadius:g="25px",animation:h="fade"}=o,v=Ku(d),w=v?"rgba(0,0,0,.25)":"rgba(255,255,255,.4)",j=v?"rgba(0,0,0,.18)":"rgba(255,255,255,.35)",S=c==="left"||c==="right",L=c==="center",D=p==="floating",T=Math.max(2,Math.round(parseInt(g)*.18))+"px",b=h==="slide"?Ce[`anim-slide-${c}`]:Ce["anim-fade"],k=[Ce.banner,S?Ce[`panel-${c}`]:null,S&&D?Ce.panelFloating:null,S&&!D?Ce.panelFixed:null,L?Ce.popup:null,!S&&!L?Ce[`bar-${c}`]:null,!S&&!L&&D?Ce.floating:null,!S&&!L&&!D?Ce.fixed:null,Ce[b]||b].filter(Boolean).join(" ");return t.jsxs("div",{className:Ce.thumb,children:[t.jsxs("div",{className:Ce.chrome,children:[t.jsx("span",{className:Ce.dot}),t.jsx("span",{className:Ce.dot}),t.jsx("span",{className:Ce.dot}),t.jsx("div",{className:Ce.urlBar})]}),t.jsxs("div",{className:Ce.page,children:[t.jsxs("div",{className:Ce.lines,children:[t.jsx("div",{style:{width:"75%"}}),t.jsx("div",{style:{width:"55%"}}),t.jsx("div",{style:{width:"65%"}}),t.jsx("div",{style:{width:"45%"}})]}),t.jsxs("div",{className:k,style:{backgroundColor:d},children:[t.jsx("div",{className:Ce.bannerHeader,children:t.jsxs("div",{className:Ce.toolbarDots,style:{"--dot-color":w},children:[t.jsx("span",{}),t.jsx("span",{}),t.jsx("span",{})]})}),t.jsx("div",{className:Ce.pills,children:Gu.map((E,M)=>t.jsx("div",{className:Ce.pill,style:{borderColor:E},children:t.jsx("span",{className:Ce.pillDot,style:{backgroundColor:E}})},M))}),t.jsx("div",{className:Ce.saveBtn,style:{backgroundColor:m,borderRadius:T}}),t.jsxs("div",{className:Ce.footerLinks,children:[t.jsx("div",{className:Ce.link,style:{background:j}}),t.jsx("div",{className:Ce.link,style:{background:j}})]})]})]})]})}const gr=[{key:"minimal",label:"Minimal",position:"left",displayType:"floating",bannerColor:"#f0f0f0",primaryColor:"#20c19e"},{key:"standard",label:"Standard",position:"bottom",displayType:"floating",bannerColor:"#2d3436",primaryColor:"#20c19e"},{key:"bold",label:"Bold",position:"top",displayType:"fixed",bannerColor:"#1a1a2e",primaryColor:"#20c19e"},{key:"popup",label:"Popup",position:"center",displayType:"floating",bannerColor:"#2c3e50",primaryColor:"#20c19e"},{key:"panel",label:"Side Panel",position:"right",displayType:"floating",bannerColor:"#34495e",primaryColor:"#3498db"},{key:"compact",label:"Compact",position:"top",displayType:"floating",bannerColor:"#1a1a2e",primaryColor:"#e67e22"}];function Qu(o){if(!o||!o.position)return null;const i=gr.find(c=>c.position===o.position&&(c.bannerColor||"").toLowerCase()===(o.bannerColor||"").toLowerCase()&&(c.primaryColor||"").toLowerCase()===(o.primaryColor||"").toLowerCase());return i?i.key:"custom"}const Yu={"left|floating":"Left Panel · Floating","bottom|floating":"Bottom Bar · Floating","top|fixed":"Top Bar · Fixed","center|floating":"Center Modal","right|floating":"Right Panel · Floating","top|floating":"Top Bar · Floating","bottom|fixed":"Bottom Bar · Fixed"};function ei(o,i){return Yu[`${o}|${i}`]||`${o} · ${i}`}const qu={google:"Google",facebook:"Facebook",microsoft:"Microsoft",gpc:"GPC",dnt:"DNT"},Zu=["google","facebook","microsoft","gpc","dnt"];function ni({appliedTemplateKey:o,onTemplateApplied:i,siteUrl:c,onOpenTrackers:p,autoblockingEnabled:d,onTabChange:m}){var N,I,ue,fe;const{isConnected:g}=Ue(),{dashboard:h}=vt(),{config:v}=At(),{openBannerWizard:w,openLawWizard:j,openConsentPanel:S,hasPlatformConfig:L}=mr(),D=gr.find(O=>O.key===o)||null,T=o?"ok":"warn",b=o?"Active":"No template set",k=D?`${D.label} · ${ei(D.position,D.displayType)}`:o?"Custom template":"Choose a template to go live",E=((N=h==null?void 0:h.appConfig)==null?void 0:N.regulations)||{},A=Qo(E).map(O=>Ms[O]||O),$=((I=h==null?void 0:h.appConfig)!=null&&I.language?Array.isArray(h.appConfig.language)?h.appConfig.language:[h.appConfig.language]:["en"]).length,V=`${$} language${$!==1?"s":""}`,Z=A.length,W=Z>0||L?"ok":"crit",Y=[...new Set(A.map(O=>{var ce;return(ce=Ko[O])==null?void 0:ce.geo}).filter(Boolean))],z=Z>0?`${Z} law${Z!==1?"s":""} · ${V}`:"No laws set",de=Z>0&&Y.length>0?`Covering ${Y.join(", ")}`:L?"Configured in portal":"Add your applicable laws below",_e=(v==null?void 0:v.blocking)||{},ie=Yo(_e),{total:J,uncategorized:se,allCategorized:he}=qo(_e),me=d!==void 0?!!d:!!((fe=(ue=window.cnReactData)==null?void 0:ue.options)!=null&&fe.app_blocking),G=se>0?"warn":me?"ok":"warn",le=se>0?`${se} uncategorized`:J>0?`${J} tracked`:"Protected",q=se>0?`${se} tracker${se!==1?"s":""} firing without consent`:me?he&&J>0?"All trackers categorized ✓":"Consent modes active":"Autoblocking off — trackers may fire unblocked";return t.jsxs("div",{className:"cn-card-grid cn-card-grid--3",children:[t.jsxs("div",{className:"cn-card",children:[t.jsxs("div",{className:"cn-card__top",children:[t.jsx("div",{className:"cn-card__icon",children:t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"4",width:"16",height:"10",rx:"2",stroke:`var(--cn-${T}-icon)`,strokeWidth:"1.5"}),t.jsx("line",{x1:"7",y1:"19",x2:"15",y2:"19",stroke:`var(--cn-${T}-icon)`,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("line",{x1:"11",y1:"14",x2:"11",y2:"19",stroke:`var(--cn-${T}-icon)`,strokeWidth:"1.2"})]})}),t.jsx("div",{className:`cn-card__dot cn-card__dot--${T}`})]}),D&&t.jsx("div",{className:"cn-card__preview",children:t.jsx(Jo,{preset:D})}),t.jsx("div",{className:`cn-card__main cn-card__main--${T}`,children:b}),t.jsx("div",{className:"cn-card__sub",children:k}),t.jsxs("div",{className:"cn-card__foot",children:[c&&o&&t.jsx("a",{href:`${c}?cn_preview=1`,target:"_blank",rel:"noreferrer",children:"Preview →"}),g&&o&&!D?t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noopener noreferrer",children:"Edit in portal →"}):t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:()=>w(),children:[o?"Change template":"Choose template"," →"]}),t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noopener noreferrer",children:"Edit colors & text →"})]})]})]}),t.jsxs("div",{className:`cn-card${W==="crit"?" cn-card--crit":""}`,children:[t.jsxs("div",{className:"cn-card__top",children:[t.jsx("div",{className:"cn-card__icon",children:t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M11 2v18M5 7h12M4 7l2.5 7h9L18 7",stroke:`var(--cn-${W}-icon)`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7",cy:"14",r:"3",stroke:`var(--cn-${W}-icon)`,strokeWidth:"1.2"}),t.jsx("circle",{cx:"15",cy:"14",r:"3",stroke:`var(--cn-${W}-icon)`,strokeWidth:"1.2"})]})}),t.jsx("div",{className:`cn-card__dot cn-card__dot--${W}`})]}),t.jsx("div",{className:`cn-card__main cn-card__main--${W}`,children:z}),t.jsx("div",{className:"cn-card__sub",children:de}),t.jsx("div",{className:"cn-card__pills",children:A.map(O=>{const ce=Ko[O];return t.jsxs("span",{className:"cn-card__pill cn-card__pill--ok",children:[ce?`${ce.flag} `:"",O]},O)})}),t.jsxs("div",{className:"cn-card__foot",children:[t.jsxs("button",{type:"button",onClick:()=>j(),children:[Z>0?"Edit laws":"Add laws"," →"]}),t.jsx("a",{href:`${Qe}/#/languages`,target:"_blank",rel:"noopener noreferrer",children:"Manage Languages ↗"})]})]}),t.jsxs("div",{className:`cn-card${G==="warn"?" cn-card--warn":""}`,children:[t.jsxs("div",{className:"cn-card__top",children:[t.jsx("div",{className:"cn-card__icon",children:t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M11 2L3 5.5v5C3 15.09 6.36 19.5 11 21c4.64-1.5 8-5.91 8-10.5v-5L11 2z",stroke:`var(--cn-${G}-icon)`,strokeWidth:"1.5",strokeLinejoin:"round"}),G==="ok"?t.jsx("polyline",{points:"7.5,11 10,13.5 14.5,9",stroke:`var(--cn-${G}-icon)`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"12",stroke:`var(--cn-${G}-icon)`,strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"11",cy:"14.5",r:".8",fill:`var(--cn-${G}-icon)`})]})]})}),t.jsx("div",{className:`cn-card__dot cn-card__dot--${G}`})]}),t.jsx("div",{className:`cn-card__main cn-card__main--${G}`,children:le}),t.jsx("div",{className:`cn-card__sub${G==="warn"?" cn-card__sub--warn":""}`,children:q}),t.jsx("div",{className:"cn-card__pills",children:Zu.filter(O=>!!ie[O]).map(O=>t.jsx("span",{className:"cn-card__pill cn-card__pill--ok",children:qu[O]},O))}),t.jsxs("div",{className:"cn-card__foot",children:[t.jsx("button",{type:"button",onClick:()=>S(),children:"Consent modes →"}),p&&t.jsx("button",{type:"button",onClick:()=>p(),children:"View Trackers →"}),!me&&m&&t.jsx("button",{type:"button",onClick:()=>{m("settings"),setTimeout(()=>{const O=document.getElementById("cn-compliance-behavior");O&&O.scrollIntoView({behavior:"smooth",block:"start"})},80)},children:"Configure autoblocking →"}),t.jsx("a",{href:`${Qe}/#/autoblocking`,target:"_blank",rel:"noopener noreferrer",children:"Manage in portal ↗"})]})]})]})}function dl({showPortalLink:o=!0,addNotice:i}){var $,V,Z,W,Y;const{isPro:c,isConnected:p}=Ue(),{dashboard:d}=vt(),m=(($=window.cnReactData)==null?void 0:$.lastSynced)||"",[g,h]=x.useState(!1),[v,w]=x.useState(null),[j,S]=x.useState(((Z=(V=window.cnReactData)==null?void 0:V.options)==null?void 0:Z.app_id)||""),[L,D]=x.useState(((Y=(W=window.cnReactData)==null?void 0:W.options)==null?void 0:Y.app_key)||""),[T,b]=x.useState(!1),[k,E]=x.useState(""),M=d!=null&&d.domainUrl?(()=>{try{return new URL(d.domainUrl).hostname}catch{return window.location.hostname}})():window.location.hostname,A=async()=>{h(!0),w(null);try{await Hu(),w("success"),i&&i("Configuration synced. Reloading…","success"),setTimeout(()=>window.location.reload(),800)}catch(z){w("error"),i&&i(z.message||"Sync failed. Please try again.","error"),h(!1)}},H=async()=>{b(!0),E("");try{await zs({app_id:j,app_key:L});try{const z=await Mn("sync_config");if(z!=null&&z.success){try{await As()}catch{}try{localStorage.setItem(Ts(j),"1"),localStorage.setItem(Rs(j),"1")}catch{}}}catch{}window.location.reload()}catch(z){E(z.message||"Save failed"),b(!1)}};return t.jsxs(In,{title:"Domain Info",children:[t.jsxs("div",{className:"cn-dom-rows",children:[t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Domain"}),t.jsx("span",{className:"cn-dom-row__v",children:M})]}),t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Protection"}),t.jsx("span",{className:"cn-dom-row__v",children:p?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cn-dot cn-dot--green"})," Active"]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cn-dot cn-dot--gray"})," Not Connected"]})})]}),t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Plan"}),t.jsx("span",{className:"cn-dom-row__v",children:c?t.jsxs(t.Fragment,{children:["Pro ",t.jsx(Fn,{})]}):"Free Plan"})]})]}),t.jsxs("div",{className:"cn-dom-credentials",children:[t.jsx(Ne,{label:"App ID",value:j,onChange:S,placeholder:"Your application ID",autoComplete:"off"}),t.jsx(Ne,{label:"App Key",type:"password",value:L,onChange:D,placeholder:"Your application key",autoComplete:"new-password"}),k&&t.jsx("div",{className:"cn-conn-error",children:k}),t.jsx($e,{variant:"primary",onClick:H,disabled:T,children:T?"Saving…":"Save and Connect"})]}),t.jsxs("div",{className:"cn-pull-config",children:[t.jsxs("div",{className:"cn-pull-config__row",children:[t.jsx($e,{variant:"secondary",onClick:A,disabled:g,children:g?"Syncing…":"Pull Configuration"}),t.jsx("span",{className:"cn-pull-config__timestamp",children:m?`Last synced (UTC): ${m}`:"Not synced yet"})]}),v==="error"&&t.jsx("p",{className:"cn-pull-config__desc cn-pull-config__desc--error",children:"Sync failed. Please try again."}),!v&&t.jsx("p",{className:"cn-pull-config__desc",children:"Manually pull the latest configuration including autoblocking. Syncs automatically every 24 hours."})]}),o&&c&&t.jsx("a",{className:"cn-dom-link",href:`${Qe}/#/configuration`,target:"_blank",rel:"noopener noreferrer",children:"Advanced Configuration →"})]})}function ti(){var k,E;const{tier:o}=Ue(),{dashboard:i}=vt(),[c,p]=x.useState(()=>new Set),d=x.useCallback(M=>{p(A=>new Set([...A,M]))},[]),m=((k=window.cnReactData)==null?void 0:k.notificationRules)||[],g=i===null,h=(E=i==null?void 0:i.analytics)==null?void 0:E.cycleUsage,v=(h==null?void 0:h.visits)||0,w=(h==null?void 0:h.threshold)||0,j=w>0?v/w*100:0,S=o==="free"&&w>0&&v>=w,L=o==="free"&&w>0&&v>=w*.7&&v{var A,H;if(g)return{};const M={};for(const $ of m){if((A=$.condition)!=null&&A.tier&&$.condition.tier!==o)continue;if((H=$.condition)!=null&&H.usagePercent){const[Z,W]=$.condition.usagePercent;if(Z!==null&&j=W)continue}if(c.has($.id))continue;const V=M[$.slot];(!V||$.priority>V.priority)&&(M[$.slot]=$)}return M},[g,m,o,j,c]);function T(M){return M&&M.replace(/\{sessionTotal\}/g,w.toLocaleString()).replace(/\{sessionUsed\}/g,v.toLocaleString()).replace(/\{usagePercent\}/g,String(Math.round(j)))}function b(M){return M?{...M,title:T(M.title),description:T(M.description),headline:T(M.headline)}:null}return{topBar:b(D.topBar||null),sidebar:b(D.sidebar||null),dismiss:d,thresholdLocked:S,isNearLimit:L}}function ri({onOpenPricingModal:o}){const{sidebar:i}=ti();return i?t.jsx(In,{title:"Upgrade to Pro",children:t.jsxs("div",{className:"cn-upsell-card",children:[t.jsx("p",{className:"cn-upsell-card__headline",children:i.headline}),t.jsx("ul",{className:"cn-upsell-card__features",children:i.features.map(c=>t.jsx("li",{children:c},c))}),t.jsx("button",{type:"button",className:"cn-button cn-button--upgrade cn-button--sm cn-upsell-card__cta",onClick:()=>o&&o(),children:i.cta.label})]})}):null}function Xu({onActivate:o}){return t.jsxs("div",{className:"cn-score-hero",children:[t.jsx("div",{className:"cn-score-hero__icon","aria-hidden":"true",children:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),t.jsxs("div",{className:"cn-score-hero__body",children:[t.jsx("div",{className:"cn-score-hero__title",children:"You have a banner. Not compliance."}),t.jsx("div",{className:"cn-score-hero__summary",children:"A banner tells visitors about cookies. Compliance actually enforces the law."}),t.jsx("div",{className:"cn-score-hero__sub",children:"Free · Takes 60 seconds · No credit card"})]}),t.jsx("div",{className:"cn-score-hero__actions",children:t.jsx("button",{type:"button",className:"cn-score-hero__cta",onClick:o,children:"Activate Compliance →"})})]})}function Ju({sessionUsed:o=0,sessionTotal:i=0,activeLawsCount:c=0,uncategorizedScripts:p=0,autoblockingEnabled:d=!0}){const{tier:m,isPro:g}=Ue(),v={basic:"Connect your site to unlock compliance features.",pro:c===0?"No regulations selected — add laws to activate consent enforcement":d?p>0?`${p} uncategorized tracker${p!==1?"s":""} need review`:"All protections active — trackers blocked, consent recorded":"Autoblocking disabled — trackers may load before consent"},w=t.jsxs(t.Fragment,{children:["Your visitors","’"," choices are being recorded ","—"," trackers are blocked."]});return t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Your Compliance Dashboard"}),t.jsxs("p",{className:"cn-protection-header__subtitle",children:[m==="free"?w:v[m]||"",g&&t.jsxs(t.Fragment,{children:[" ",t.jsx(Fn,{})]})]})]})}const Is=3;function li({onApply:o}){const[i,c]=x.useState(null),[p,d]=x.useState(!1),[m,g]=x.useState(""),[h,v]=x.useState(""),[w,j]=x.useState(0),S=Math.ceil(gr.length/Is),L=gr.slice(w*Is,(w+1)*Is),D=async T=>{c(T.key),d(!0),g(""),v("");try{const b=await Bu(T.key);b.warning&&g(b.warning),o&&o(T)}catch(b){c(null),v(b.message||"Failed to apply template. Please try again.")}finally{d(!1)}};return t.jsxs("div",{className:"cn-template-presets",children:[t.jsx("span",{className:"cn-section-label",children:"Choose a Template"}),m&&t.jsx("div",{className:"cn-template-presets__warning",children:m}),h&&t.jsx("div",{className:"cn-template-presets__error",children:h}),t.jsx("div",{className:"cn-template-presets__grid",children:L.map(T=>t.jsxs("div",{className:"cn-template-presets__card"+(i===T.key?" cn-template-presets__card--active":"")+(p?" cn-template-presets__card--loading":""),onClick:()=>!p&&D(T),children:[t.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"120px"},children:t.jsx(Jo,{preset:T,isActive:i===T.key})}),t.jsx("div",{className:"cn-template-presets__label",children:T.label}),t.jsx("div",{className:"cn-template-card__descriptor",children:ei(T.position,T.displayType)})]},T.key))},w),S>1&&t.jsxs("div",{className:"cn-template-presets__pagination",children:[t.jsx("button",{className:"cn-template-presets__page-btn",disabled:w===0,onClick:()=>j(w-1),"aria-label":"Previous page",children:"‹"}),t.jsxs("span",{className:"cn-template-presets__page-count",children:["Page ",w+1," of ",S," (",gr.length," templates)"]}),t.jsx("button",{className:"cn-template-presets__page-btn",disabled:w===S-1,onClick:()=>j(w+1),"aria-label":"Next page",children:"›"})]})]})}const xe={container:"_container_nva6m_2",grid:"_grid_nva6m_8",card:"_card_nva6m_16",cardSelected:"_cardSelected_nva6m_32",geoArt:"_geoArt_nva6m_38",lawName:"_lawName_nva6m_47",jurisdiction:"_jurisdiction_nva6m_54",hiddenCheckbox:"_hiddenCheckbox_nva6m_60",checkmark:"_checkmark_nva6m_72",autoBadge:"_autoBadge_nva6m_88",detail:"_detail_nva6m_102",detailHeader:"_detailHeader_nva6m_112",detailTitle:"_detailTitle_nva6m_119",detailJurisdiction:"_detailJurisdiction_nva6m_125",detailClose:"_detailClose_nva6m_131",detailSection:"_detailSection_nva6m_144",detailSectionLabel:"_detailSectionLabel_nva6m_148",detailOverview:"_detailOverview_nva6m_157",detailList:"_detailList_nva6m_163",detailListItem:"_detailListItem_nva6m_172",detailEnforcement:"_detailEnforcement_nva6m_188",detailEmpty:"_detailEmpty_nva6m_197",detailEmptyArrow:"_detailEmptyArrow_nva6m_208",detailEmptyText:"_detailEmptyText_nva6m_215",detailDnsHelp:"_detailDnsHelp_nva6m_222",dnsInput:"_dnsInput_nva6m_263"},Fs=[{key:"gdpr",name:"GDPR",jurisdiction:"European Union",description:"General Data Protection Regulation",locales:["de","fr","it","es","nl","pl","pt","sv","el","de_DE","fr_FR","it_IT","es_ES","nl_NL","pl_PL","pt_PT","sv_SE","el_GR","da_DK","fi","ro_RO","bg_BG","cs_CZ","et","hr","hu_HU","lt_LT","lv","sk_SK","sl_SI"],overview:"The EU’s gold standard for data privacy. Applies to any site with visitors from the 27 EU member states — regardless of where your business is based.",requirements:["Prior, informed consent before any non-essential cookies","Clear opt-out that’s as easy as opting in","Right to erasure (‘be forgotten’) on request","Data processing records & DPO for large processors"],product:["Consent banner with granular category controls","Consent proof stored per visitor","GDPR-mode autoblocking holds scripts until consent"],enforcement:"Fines up to €20M or 4% of global annual revenue. Enforced by national DPAs."},{key:"ccpa",name:"CCPA / CPRA",jurisdiction:"California, USA",description:"California Consumer Privacy Act",locales:["en_US"],overview:"California’s comprehensive privacy law, upgraded by CPRA in 2023. If you serve California residents, it applies — even if you’re outside the US.",requirements:["Opt-out of sale or sharing of personal data","Honor Global Privacy Control (GPC) signals automatically","Annual privacy policy updates","Right to know, delete, and correct personal data"],product:["GPC signal detection and automatic opt-out","Do Not Sell link insertion","Consent-mode compatible analytics opt-out"],enforcement:"Fines up to $7,500 per intentional violation. Enforced by the California Privacy Protection Agency."},{key:"otherus",name:"US State Laws",jurisdiction:"United States",description:"Virginia, Colorado, Connecticut, and more",locales:["en_US"],overview:"Virginia, Colorado, Connecticut, Utah, Montana, Texas, Oregon, and more have passed comprehensive privacy laws. The landscape is evolving fast.",requirements:["Consent for sensitive data processing","Universal opt-out mechanism support (like GPC)","Right to access, correct, delete, and opt out of targeted advertising","Data protection assessments for high-risk processing"],product:["State-specific banner rules via geolocation","Opt-out of targeted advertising flow","Consent records per jurisdiction"],enforcement:"Fines from $7,500–$20,000 per violation depending on state. Enforced by state attorneys general."},{key:"ukpecr",name:"UK PECR",jurisdiction:"United Kingdom",description:"Privacy and Electronic Communications Regulations",locales:["en_GB"],overview:"The UK’s post-Brexit equivalent to GDPR’s cookie rules. Applies to any site with UK visitors. Enforced by the ICO, which has been increasingly active.",requirements:["Prior consent for analytics and marketing cookies","Clear information about what cookies do","Easy withdrawal of consent","Legitimate interest cannot be used for tracking cookies"],product:["UK-specific consent banner variant","ICO-compliant consent language","Consent proof storage"],enforcement:"Fines up to £17.5M or 4% of global turnover. Enforced by the ICO."},{key:"lgpd",name:"LGPD",jurisdiction:"Brazil",description:"Lei Geral de Proteção de Dados",locales:["pt_BR"],overview:"Brazil’s General Data Protection Law covers 214 million people. Modeled on GDPR, it requires a lawful basis for processing and strong user rights.",requirements:["Valid lawful basis for each data processing activity","Clear, granular consent for non-essential cookies","Right to access, correct, delete, and revoke consent","Report breaches within 2 business days"],product:["LGPD-mode consent banner with Portuguese language support","Consent revocation flow","Breach-ready consent audit trail"],enforcement:"Fines up to 2% of Brazil revenue, capped at R$50M per violation. Enforced by the ANPD."},{key:"pipeda",name:"PIPEDA",jurisdiction:"Canada",description:"Personal Information Protection and Electronic Documents Act",locales:["en_CA","fr_CA"],overview:"Canada’s federal privacy law. Bill C-27 (CPPA) reform is underway and will bring requirements closer to GDPR. Applies to commercial activity across Canada.",requirements:["Express consent for collection, use, and disclosure of personal data","Privacy policy clearly explaining data use","Individual access and correction rights","Breach reporting to the Privacy Commissioner"],product:["PIPEDA-compliant consent banner","English + French bilingual support","Consent records with timestamps"],enforcement:"Fines up to CAD $100,000. Enforced by the Office of the Privacy Commissioner of Canada."},{key:"popia",name:"POPIA",jurisdiction:"South Africa",description:"Protection of Personal Information Act",locales:["af_ZA"],overview:"South Africa’s Protection of Personal Information Act took full effect in 2021. Applies to any business processing data about South African residents.",requirements:["Lawful basis for all personal information processing","Consent for direct marketing and cookie use","Data subject rights: access, correction, deletion","Appoint an Information Officer"],product:["POPIA-compliant consent banner","Afrikaans language support","Consent audit trail"],enforcement:"Fines up to ZAR 10M or 10 years imprisonment. Enforced by the Information Regulator."}];function ed(o){if(!o)return[];const i=o.toLowerCase(),c=i.split("_")[0];return Fs.filter(p=>p.locales.some(d=>d.toLowerCase()===i||d.toLowerCase()===c)).map(p=>p.key)}const nd=["M40.00,4.80L40.75,6.96L43.04,7.01L41.22,8.40L41.88,10.59L40.00,9.28L38.12,10.59L38.78,8.40L36.96,7.01L39.25,6.96Z","M50.60,7.64L50.17,9.89L52.13,11.08L49.86,11.36L49.33,13.59L48.36,11.52L46.08,11.71L47.75,10.15L46.86,8.03L48.87,9.14Z","M58.36,15.40L56.86,17.13L57.97,19.14L55.85,18.25L54.29,19.92L54.48,17.64L52.41,16.67L54.64,16.14L54.92,13.87L56.11,15.83Z","M61.20,26.00L59.04,26.75L58.99,29.04L57.60,27.22L55.41,27.88L56.72,26.00L55.41,24.12L57.60,24.78L58.99,22.96L59.04,25.25Z","M58.36,36.60L56.11,36.17L54.92,38.13L54.64,35.86L52.41,35.33L54.48,34.36L54.29,32.08L55.85,33.75L57.97,32.86L56.86,34.87Z","M50.60,44.36L48.87,42.86L46.86,43.97L47.75,41.85L46.08,40.29L48.36,40.48L49.33,38.41L49.86,40.64L52.13,40.92L50.17,42.11Z","M40.00,47.20L39.25,45.04L36.96,44.99L38.78,43.60L38.12,41.41L40.00,42.72L41.88,41.41L41.22,43.60L43.04,44.99L40.75,45.04Z","M29.40,44.36L29.83,42.11L27.87,40.92L30.14,40.64L30.67,38.41L31.64,40.48L33.92,40.29L32.25,41.85L33.14,43.97L31.13,42.86Z","M21.64,36.60L23.14,34.87L22.03,32.86L24.15,33.75L25.71,32.08L25.52,34.36L27.59,35.33L25.36,35.86L25.08,38.13L23.89,36.17Z","M18.80,26.00L20.96,25.25L21.01,22.96L22.40,24.78L24.59,24.12L23.28,26.00L24.59,27.88L22.40,27.22L21.01,29.04L20.96,26.75Z","M21.64,15.40L23.89,15.83L25.08,13.87L25.36,16.14L27.59,16.67L25.52,17.64L25.71,19.92L24.15,18.25L22.03,19.14L23.14,17.13Z","M29.40,7.64L31.13,9.14L33.14,8.03L32.25,10.15L33.92,11.71L31.64,11.52L30.67,13.59L30.14,11.36L27.87,11.08L29.83,9.89Z"];function td(){return t.jsx("svg",{viewBox:"0 0 80 52",fill:"none",style:{width:"100%",height:"auto"},children:nd.map((o,i)=>t.jsx("path",{d:o,fill:"#20c19e",opacity:"0.9"},i))})}function rd(){return t.jsx("svg",{viewBox:"0 0 80 52",style:{width:"100%",height:"auto"},children:t.jsx("path",{d:"M37.513,42.904L38.238,43.379L37.825,43.645ZM37.052,44.75L37.717,45.823L37.272,45.618ZM35.977,42.471L35.977,42.471L35.977,42.471ZM35.268,39.936L35.268,39.936L35.268,39.936ZM33.989,42.904L33.989,42.904L33.989,42.904ZM33.676,39.32L34.798,39.964L33.73,39.76ZM32.497,39.347L33.222,39.384L32.807,39.892ZM31.86,39.021L31.86,39.021L31.86,39.021ZM29.205,3L32.401,3.908L38.713,5.758L41.841,6.576L41.84,6.58L38.653,18.933L41.444,23.13L44.007,26.988L48.051,33.092L52.339,39.534L52.222,40.059L52.645,40.847L52.88,42.027L53.42,42.959L52.253,43.484L51.779,44.08L51.723,45.075L51.378,45.722L50.695,46.134L50.495,47.457L51.101,47.842L50.851,48.976L50.148,49L41.666,47.998L41.371,47.343L41.515,45.403L41.115,44.386L39.247,42.072L38.422,41.969L38.28,40.638L37.359,40.575L36.115,39.635L36.034,39.084L35.246,38.245L34.184,37.993L33.352,37.495L32.221,37.309L31.791,36.609L32.419,34.386L31.689,33.643L31.931,33.211L30.973,31.644L30.057,29.011L29.65,28.484L29.661,27.639L30.53,26.451L30.232,25.596L29.675,25.538L28.998,24.284L29.024,22.847L29.328,21.783L29.707,21.754L29.599,22.695L30.309,23.509L30.302,22.525L29.816,21.111L30.434,20.929L30.14,20.407L29.328,21.612L28.616,20.617L28.022,20.414L28.453,19.444L28.184,18.476L27.692,17.819L26.886,15.851L27.158,15.473L27.119,14.107L27.54,13.351L27.621,12.162L26.58,9.935L26.661,9.167L27.876,7.733L28.302,6.532L28.962,5.414L29.033,4.098L28.808,3.838Z",fill:"rgba(32,193,158,0.15)",stroke:"#20c19e",strokeWidth:1.2,strokeLinejoin:"round"})})}function ld(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"us",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}function sd(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"gb",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}function ad(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"br",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}function od(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"ca",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}function id(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"za",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}const cd={gdpr:td,ccpa:rd,otherus:ld,ukpecr:sd,lgpd:ad,pipeda:od,popia:id};function si({selected:o,onChange:i,dnsUrl:c,onDnsUrlChange:p}){const m=(window.cnReactData||{}).siteLocale||"",[g,h]=x.useState([]),[v,w]=x.useState(null),[j,S]=x.useState(null),L=o,D=j??L;x.useEffect(()=>{const A=ed(m);h(A),o.length===0&&A.length>0&&i(A),A.length>0&&w(A[0])},[]);const T=A=>{w(A);const H=j??L,$=H.includes(A)?H.filter(V=>V!==A):[...H,A];S($),i&&i($)},b=(A,H)=>{A.stopPropagation();const $=j??L,V=$.includes(H)?$.filter(Z=>Z!==H):[...$,H];S(V),i&&i(V)},k=()=>{w(null)},E=v?Fs.find(A=>A.key===v):null,M=E&&(E.key==="ccpa"||E.key==="otherus");return t.jsxs("div",{className:xe.container,children:[t.jsx("div",{children:t.jsx("div",{className:xe.grid,children:Fs.map(A=>{const H=D.includes(A.key),$=g.includes(A.key),V=cd[A.key];return t.jsxs("div",{className:xe.card+(H?" "+xe.cardSelected:""),onClick:()=>T(A.key),role:"button",tabIndex:0,onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),T(A.key))},children:[$&&t.jsx("span",{className:xe.autoBadge,children:"Auto-detected"}),H&&t.jsx("span",{className:xe.checkmark,children:"✓"}),t.jsx("input",{type:"checkbox",className:xe.hiddenCheckbox,checked:H,onChange:Z=>b(Z,A.key),onClick:Z=>Z.stopPropagation(),tabIndex:-1,"aria-label":`Select ${A.name}`}),t.jsx("div",{className:xe.geoArt,children:V&&t.jsx(V,{})}),t.jsx("div",{className:xe.lawName,children:A.name}),t.jsx("div",{className:xe.jurisdiction,children:A.jurisdiction})]},A.key)})})}),E?t.jsxs("div",{className:xe.detail,children:[t.jsxs("div",{className:xe.detailHeader,children:[t.jsxs("div",{children:[t.jsx("div",{className:xe.detailTitle,children:E.name}),t.jsx("div",{className:xe.detailJurisdiction,children:E.jurisdiction})]}),t.jsx("button",{className:xe.detailClose,onClick:k,type:"button","aria-label":"Close detail panel",children:"×"})]}),t.jsxs("div",{className:xe.detailSection,children:[t.jsx("div",{className:xe.detailSectionLabel,children:"What it covers"}),t.jsx("div",{className:xe.detailOverview,children:E.overview})]}),t.jsxs("div",{className:xe.detailSection,children:[t.jsx("div",{className:xe.detailSectionLabel,children:"Key requirements"}),t.jsx("ul",{className:xe.detailList,children:E.requirements.map((A,H)=>t.jsx("li",{className:xe.detailListItem,children:A},H))})]}),t.jsxs("div",{className:xe.detailSection,children:[t.jsx("div",{className:xe.detailSectionLabel,children:"What Cookie Compliance does"}),t.jsx("ul",{className:xe.detailList,children:E.product.map((A,H)=>t.jsx("li",{className:xe.detailListItem,children:A},H))})]}),t.jsx("div",{className:xe.detailEnforcement,children:E.enforcement}),M&&t.jsxs("div",{className:xe.detailSection,style:{marginTop:14},children:[t.jsx("div",{className:xe.detailSectionLabel,children:"Do Not Sell URL"}),t.jsx("p",{className:xe.detailDnsHelp,children:"Required if you advertise to California residents. This is a page on your site where visitors can request you stop selling or sharing their personal data."}),t.jsx("input",{id:"cn-dns-url",type:"url",className:xe.dnsInput,value:c||"",onChange:A=>p&&p(A.target.value),placeholder:"https://example.com/do-not-sell"}),t.jsx("a",{href:"https://oag.ca.gov/privacy/ccpa",target:"_blank",rel:"noreferrer",style:{fontSize:12,color:"#0073aa",display:"inline-block",marginTop:4},children:"What is this? →"})]})]},E.key):t.jsxs("div",{className:xe.detailEmpty,children:[t.jsx("div",{className:xe.detailEmptyArrow,children:"←"}),t.jsx("div",{className:xe.detailEmptyText,children:"Select a law to see what it covers and what compliance looks like for your site."})]})]})}const ai=[{code:"fr",name:"French"},{code:"es",name:"Spanish"},{code:"de",name:"German"},{code:"it",name:"Italian"},{code:"el",name:"Greek"},{code:"nl",name:"Dutch"},{code:"pt",name:"Portuguese"},{code:"pl",name:"Polish"},{code:"sv",name:"Swedish"}];function ud({onComplete:o,onOpenPricingModal:i}){const p=(window.cnReactData||{}).siteLocale||"",{isFree:d}=Ue(),[m,g]=x.useState([]),[h,v]=x.useState(!1),[w,j]=x.useState(""),[S,L]=x.useState(!1);x.useEffect(()=>{var k;const b=(k=p.split("_")[0])==null?void 0:k.toLowerCase();b&&b!=="en"&&ai.some(E=>E.code===b)&&g([b])},[]);const D=b=>{g(k=>k.includes(b)?(L(!1),k.filter(E=>E!==b)):d?(k.length>=1&&L(!0),[b]):[...k,b])},T=async()=>{if(!h){v(!0),j("");try{await Uu(m),o&&o(m)}catch(b){j(b.message||"Failed to apply languages.")}finally{v(!1)}}};return t.jsxs("div",{className:"cn-language-picker",children:[d?t.jsxs("div",{style:{background:"#fff8f0",border:"1px solid #fed7aa",color:"#92400e",padding:"10px 14px",borderRadius:"6px",marginBottom:"12px",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"14px"},children:[t.jsx("span",{children:"Free plan: 1 language included"}),t.jsx("button",{type:"button",onClick:()=>i&&i(),style:{background:"none",border:"none",color:"#20c19e",fontWeight:600,cursor:"pointer",textDecoration:"underline",padding:0},children:"Upgrade to Pro for all 9 →"})]}):t.jsx("div",{style:{background:"#f0fdf4",border:"1px solid #a7f3d0",color:"#065f46",padding:"10px 14px",borderRadius:"6px",marginBottom:"12px",fontSize:"14px"},children:"Pro plan — all languages available ✓"}),t.jsx("p",{className:"cn-language-picker__hint",children:"Without a configured language, non-English visitors see browser-automated translations — unreviewed and potentially inaccurate. Selecting a language gives you full control over what they read."}),t.jsx("div",{className:"cn-language-picker__grid",children:ai.map(b=>{const k=m.includes(b.code),E=d&&!k&&m.length>=1;return t.jsxs("button",{type:"button",className:"cn-language-picker__badge"+(k?" cn-language-picker__badge--active":"")+(E?" cn-language-picker__badge--locked":""),onClick:()=>{E?i&&i():D(b.code)},"aria-label":E?`${b.name} — upgrade to Pro to unlock`:b.name,children:[b.name,E?" 🔒":""]},b.code)})}),S&&d&&t.jsx("div",{style:{color:"#92400e",fontSize:"13px",marginTop:"8px"},children:t.jsx("button",{type:"button",onClick:()=>i&&i(),style:{background:"none",border:"none",color:"#20c19e",fontWeight:600,cursor:"pointer",textDecoration:"underline",padding:0},children:"Upgrade to Pro to unlock all 9 languages →"})}),w&&t.jsx("div",{className:"cn-language-picker__error",children:w}),t.jsx("div",{className:"cn-language-picker__actions",children:t.jsx("button",{className:"cn-button cn-button--primary",onClick:T,disabled:h,type:"button",children:h?"Applying…":"Apply Languages"})})]})}const pl=[{key:"template",label:"Template"},{key:"laws",label:"Laws"},{key:"languages",label:"Languages"}];function dd({onTemplateApplied:o,initialLaws:i=[],onOpenPricingModal:c,totalScripts:p=0,uncategorizedScripts:d=0,isLoadingConfig:m=!1}){var ie;const g=window.cnReactData||{},[h,v]=x.useState(0),w=Ts((ie=g.options)==null?void 0:ie.app_id),[j,S]=x.useState(!!g.setupWizardComplete||localStorage.getItem(w)==="1"),[L,D]=x.useState(!1),[T,b]=x.useState(i),[k,E]=x.useState(""),[M,A]=x.useState(!1),[H,$]=x.useState(!1),[V,Z]=x.useState("");if(j)return null;const W=()=>{v(J=>Math.min(J+1,pl.length-1))},Y=async()=>{if(h===1&&T.length>0){$(!0),Z("");try{const J={};T.forEach((se,he)=>{J[`cn_laws[${he}]`]=se}),await Mn("configure",{...J,cn_revoke_consent:"1"},g.configureNonce||"")}catch{Z("Failed to save laws. Please try again."),$(!1);return}$(!1)}v(J=>Math.min(J+1,pl.length-1))},z=()=>{v(J=>Math.max(J-1,0))},de=async()=>{var J;A(!0);try{await As()}catch{}window.cnReactData&&(window.cnReactData.setupWizardComplete=!0);try{localStorage.setItem(w,"1"),localStorage.setItem("cn_setup_just_finished_"+(((J=g.options)==null?void 0:J.app_id)||"default"),"1")}catch{}window.location.reload()},_e=h===pl.length-1;return t.jsxs(t.Fragment,{children:[h===0&&t.jsxs("div",{className:"cn-first-run__connected-notice",children:[t.jsx("span",{className:"cn-first-run__connected-check",children:"✓"}),t.jsxs("div",{children:[t.jsx("strong",{children:"Your account is connected."})," ","Select your template, laws, and languages to finalize your setup.",t.jsxs("span",{className:"cn-first-run__connected-hint",children:[" ",m?t.jsx("span",{style:{opacity:.7},children:"Checking site for trackers..."}):t.jsxs(t.Fragment,{children:[p>0?`We found ${p} tracker${p!==1?"s":""} on your site. `:"","When done, you will be guided to select your consent modes",p>0?` and review ${d>0?`${d} uncategorized tracker${d!==1?"s":""}`:"your trackers"}.`:" and set up your tracker protection."]})]})]})]}),t.jsxs("div",{className:"cn-first-run",children:[t.jsxs("div",{className:"cn-first-run__header",children:[t.jsx("h2",{className:"cn-first-run__title",children:"Complete Your Setup"}),t.jsx("button",{className:"cn-first-run__dismiss",onClick:de,type:"button",children:"×"})]}),t.jsx("div",{className:"cn-first-run__progress",children:pl.map((J,se)=>t.jsxs("div",{className:"cn-first-run__step-indicator"+(se===h?" cn-first-run__step-indicator--active":"")+(se{D(!0),o&&o(J.key)}}),L&&t.jsxs("p",{className:"cn-first-run__applied",children:["✓"," Template applied"]})]}),h===1&&t.jsxs("div",{className:"cn-first-run__step",children:[t.jsx("h3",{children:"Select Your Laws"}),t.jsx("p",{children:"Choose which privacy regulations apply to your site."}),t.jsx(si,{selected:T,onChange:J=>{b(J),Z("")},dnsUrl:k,onDnsUrlChange:E}),V&&t.jsx("p",{style:{color:"var(--cn-red)",fontSize:13,marginTop:8},children:V})]}),h===2&&t.jsxs("div",{className:"cn-first-run__step",children:[t.jsx("h3",{children:"Add Languages"}),t.jsx("p",{children:"Select additional languages for your consent banner."}),t.jsx(ud,{onComplete:de,onOpenPricingModal:c})]})]}),t.jsxs("div",{className:"cn-first-run__nav",children:[h>0&&t.jsx("button",{className:"cn-button cn-button--outline",onClick:z,type:"button",children:"← Back"}),t.jsxs("div",{className:"cn-first-run__nav-right",children:[!_e&&t.jsx("button",{className:"cn-button cn-button--ghost",onClick:W,type:"button",children:"Skip"}),!_e&&t.jsx("button",{className:"cn-button cn-button--primary",onClick:Y,disabled:H,type:"button",children:H?"Saving…":"Next →"}),_e&&t.jsx("button",{className:"cn-button cn-button--primary",onClick:de,disabled:M,type:"button",children:M?"Finishing…":"Apply & Finish"})]})]})]})]})}function pd(){return"Updated "+new Date().toLocaleDateString("en-US",{month:"short",year:"numeric"})}function fd({consentModes:o={},regulations:i={}}){const c=!!o.google,p=!!(i.ccpa||i.otherus),g=[{tag:"enforcement",tagLabel:"Enforcement",title:"France fined a bakery chain €150,000 for cookie violations",desc:"The bakery’s website used Google Analytics without asking visitors first. The fine was 3× their monthly revenue.",status:c?"You’re protected — Google Analytics is blocked until visitors consent":"Unprotected — enable Google Consent Mode to fix this",statusVariant:c?"ok":"warn"},{tag:"update",tagLabel:"Update",title:"Google ending third-party cookies delayed again",desc:"Google pushed back their timeline to late 2026. Sites that already have consent management won’t need to change anything.",status:"No action needed — your consent banner already handles this",statusVariant:"ok"},{tag:"regulation",tagLabel:"Regulation",title:"New US state privacy laws take effect July 2026",desc:"Four more states are adding GDPR-like requirements. Sites serving US visitors will need consent mechanisms.",status:p?"You’re covered — your banner applies to US visitors":"No US law configured — add CCPA or US States in your regulation settings",statusVariant:p?"ok":"warn"}];return t.jsxs("div",{className:"cn-threat-section",children:[t.jsxs("div",{className:"cn-threat-section__header",children:[t.jsx("span",{className:"cn-threat-section__title",children:"Threat Intelligence"}),t.jsx("span",{className:"cn-threat-section__updated",children:pd()})]}),t.jsx("div",{className:"cn-threat-list",children:g.map((h,v)=>t.jsxs("div",{className:"cn-threat-item",children:[t.jsxs("div",{className:"cn-threat-item__title",children:[t.jsx("span",{className:`cn-threat-tag cn-threat-tag--${h.tag}`,children:h.tagLabel}),h.title]}),t.jsx("div",{className:"cn-threat-item__desc",children:h.desc}),t.jsx("div",{className:`cn-threat-item__status cn-threat-item__status--${h.statusVariant}`,children:h.status})]},v))})]})}function Mt({title:o,onClose:i,children:c,footer:p,scrollTrigger:d,isClosing:m,onExitComplete:g}){const h=x.useRef(null);return x.useEffect(()=>{var v;m||(v=h.current)==null||v.scrollIntoView({behavior:"smooth",block:"start"})},[d,m]),t.jsxs("div",{className:`cn-inline-panel${m?" cn-inline-panel--closing":""}`,ref:h,onTransitionEnd:m?g:void 0,children:[t.jsxs("div",{className:"cn-inline-panel__header",children:[t.jsx("h3",{className:"cn-inline-panel__title",children:o}),t.jsx("button",{className:"cn-inline-panel__dismiss",onClick:i,"aria-label":"Close",children:"×"})]}),t.jsx("div",{className:"cn-inline-panel__body",children:c}),p&&t.jsx("div",{className:"cn-inline-panel__footer",children:p})]})}const ge={loading:"_loading_1lg0v_1",stepContent:"_stepContent_1lg0v_8",stepDesc:"_stepDesc_1lg0v_12",scanSummary:"_scanSummary_1lg0v_19",scanStat:"_scanStat_1lg0v_30",scanStatWarn:"_scanStatWarn_1lg0v_36",scanDivider:"_scanDivider_1lg0v_40",catList:"_catList_1lg0v_45",catSection:"_catSection_1lg0v_51",catHeader:"_catHeader_1lg0v_58",catHeaderLeft:"_catHeaderLeft_1lg0v_73",catDot:"_catDot_1lg0v_79",catName:"_catName_1lg0v_87",catCount:"_catCount_1lg0v_93",catWarnBadge:"_catWarnBadge_1lg0v_98",catChevron:"_catChevron_1lg0v_107",catDesc:"_catDesc_1lg0v_112",catDescInner:"_catDescInner_1lg0v_119",catBody:"_catBody_1lg0v_126",providerRow:"_providerRow_1lg0v_130",providerInfo:"_providerInfo_1lg0v_141",providerName:"_providerName_1lg0v_148",providerUrl:"_providerUrl_1lg0v_154",providerMeta:"_providerMeta_1lg0v_163",patternCount:"_patternCount_1lg0v_170",statusPillOk:"_statusPillOk_1lg0v_175",statusPillWarn:"_statusPillWarn_1lg0v_184",issueBanner:"_issueBanner_1lg0v_193",lastSynced:"_lastSynced_1lg0v_211",portalLink:"_portalLink_1lg0v_219",basicPanel:"_basicPanel_1lg0v_229",basicIcon:"_basicIcon_1lg0v_234",basicTitle:"_basicTitle_1lg0v_239",basicDesc:"_basicDesc_1lg0v_246"},hd=[{id:1,name:"Basic Operations",color:"#20c19e",dot:"green",desc:"Essential for your site to function"},{id:2,name:"Content Personalization",color:"#3b82f6",dot:"blue",desc:"Personalize content for visitors"},{id:3,name:"Site Optimization",color:"#eab308",dot:"yellow",desc:"Measure traffic and performance"},{id:4,name:"Ad Personalization",color:"#ef4444",dot:"red",desc:"Show targeted advertising"}],md={id:0,name:"Uncategorized",color:"#9ca3af",dot:"gray",desc:"These trackers run before visitors agree — highest compliance risk"};function gd({color:o}){return t.jsx("span",{className:ge.catDot,style:{background:o}})}function vd({provider:o,patternCount:i}){return t.jsxs("div",{className:ge.providerRow,children:[t.jsxs("div",{className:ge.providerInfo,children:[t.jsx("span",{className:ge.providerName,children:o.ProviderName||o.Name||o.ProviderID||"Unknown tracker"}),o.ProviderURL&&t.jsx("span",{className:ge.providerUrl,children:o.ProviderURL})]}),t.jsxs("div",{className:ge.providerMeta,children:[t.jsxs("span",{className:ge.patternCount,children:[i," pattern",i!==1?"s":""]}),o.CategoryID>0?t.jsx("span",{className:ge.statusPillOk,children:"Categorized"}):t.jsx("span",{className:ge.statusPillWarn,children:"Fires without consent"})]})]})}function oi({category:o,providers:i,patterns:c,defaultOpen:p}){const[d,m]=x.useState(p),g=x.useMemo(()=>{const h={};return i.forEach(v=>{h[v.ProviderID]=(c||[]).filter(w=>String(w.ProviderID)===String(v.ProviderID)).length}),h},[i,c]);return t.jsxs("div",{className:ge.catSection,children:[t.jsxs("button",{className:ge.catHeader,onClick:()=>m(h=>!h),type:"button",children:[t.jsxs("div",{className:ge.catHeaderLeft,children:[t.jsx(gd,{color:o.color}),t.jsx("span",{className:ge.catName,children:o.name}),t.jsxs("span",{className:ge.catCount,children:["(",i.length,")"]}),o.id===0&&t.jsx("span",{className:ge.catWarnBadge,children:"Firing without consent"})]}),t.jsx("span",{className:ge.catChevron,children:d?"▾":"▸"})]}),!d&&t.jsx("div",{className:ge.catDesc,children:o.desc}),d&&t.jsxs("div",{className:ge.catBody,children:[t.jsx("div",{className:ge.catDescInner,children:o.desc}),i.map(h=>t.jsx(vd,{provider:h,patternCount:g[h.ProviderID]||0},h.ProviderID))]})]})}function yd({onOpenWelcomeModal:o}){return t.jsxs("div",{className:ge.basicPanel,children:[t.jsx("div",{className:ge.basicIcon,children:"🛡️"}),t.jsx("h4",{className:ge.basicTitle,children:"Your banner shows — but trackers run before visitors agree"}),t.jsx("p",{className:ge.basicDesc,children:"Without tracker protection, trackers like Google Analytics, Meta Pixel, and ad tags run immediately when your page loads — before visitors have a chance to agree or decline. This can violate GDPR, CCPA, and other privacy regulations."}),t.jsx($e,{variant:"primary",onClick:o,children:"Connect to auto-detect and block trackers →"})]})}function _d({onClose:o,onOpenWelcomeModal:i,scrollTrigger:c}){var H,$;const{config:p,isLoadingConfig:d,refetchConfig:m}=At(),{isBasic:g}=Ue(),h=(p==null?void 0:p.blocking)||{},v=h.providers||[],w=h.patterns||[],[j,S]=x.useState(!1),[L,D]=x.useState(null),T=x.useMemo(()=>{const V={};return v.forEach(Z=>{const W=Z.CategoryID||0;V[W]||(V[W]=[]),V[W].push(Z)}),V},[v]),b=T[0]||[],k=v.length,E=k-b.length,M=async()=>{S(!0),D(null),v.length;try{await $u(),await m(),D({text:"Sync complete.",type:"success"})}catch(V){D({text:(V==null?void 0:V.message)||"Sync failed. Please try again.",type:"error"})}finally{S(!1)}};if(g)return t.jsx(Mt,{title:"Your Trackers",onClose:o,scrollTrigger:c,children:t.jsx(yd,{onOpenWelcomeModal:i})});const A=t.jsxs(t.Fragment,{children:[t.jsx("a",{href:Qe+"/#/autoblocking",target:"_blank",rel:"noopener noreferrer",className:ge.portalLink,children:"Manage trackers in portal"}),t.jsx($e,{variant:"secondary",onClick:M,disabled:j,children:j?"Refreshing…":"Refresh"})]});return t.jsxs(Mt,{title:"Your Trackers",onClose:o,footer:A,scrollTrigger:c,children:[d&&t.jsx("div",{className:ge.loading,children:"Loading script data…"}),L&&t.jsx("div",{className:ge.stepContent,style:{padding:"6px 0"},children:t.jsx("p",{style:{color:L.type==="error"?"var(--cn-crit-icon, #dc3545)":"var(--cn-ok-icon, #20c19e)",margin:0,fontSize:"var(--cn-text-sm)"},children:L.text})}),!d&&v.length===0&&t.jsx("div",{className:ge.stepContent,children:t.jsx("p",{className:ge.stepDesc,children:h.lastUpdated?"No known trackers found in the provider database for your site. Your banner is active and blocking is configured.":"Your domain was recently added. Tracker data typically populates within 24–48 hours as your configuration syncs. Click Refresh to check now."})}),!d&&v.length>0&&t.jsxs("div",{className:ge.stepContent,children:[t.jsxs("div",{className:ge.scanSummary,children:[t.jsxs("span",{className:ge.scanStat,children:[k," tracker",k!==1?"s":""," detected"]}),t.jsx("span",{className:ge.scanDivider,children:"·"}),t.jsxs("span",{className:ge.scanStat,children:[E," categorized"]}),b.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:ge.scanDivider,children:"·"}),t.jsxs("span",{className:ge.scanStat+" "+ge.scanStatWarn,children:[b.length," uncategorized"]})]})]}),t.jsx("span",{className:ge.lastSynced,children:h.lastUpdated||(H=window.cnReactData)!=null&&H.lastSynced?`Last refreshed: ${h.lastUpdated||(($=window.cnReactData)==null?void 0:$.lastSynced)}`:"Not yet synced"}),b.length>0&&t.jsxs("div",{className:ge.issueBanner,children:["⚠"," ",b.length," tracker",b.length!==1?"s":""," firing without consent —"," ",t.jsx("a",{href:Qe+"/#/autoblocking",target:"_blank",rel:"noopener noreferrer",children:"manage in portal"})]}),t.jsxs("div",{className:ge.catList,children:[T[0]&&T[0].length>0&&t.jsx(oi,{category:md,providers:T[0],patterns:w,defaultOpen:!0}),hd.map(V=>{const Z=T[V.id]||[];return Z.length===0?null:t.jsx(oi,{category:V,providers:Z,patterns:w,defaultOpen:!1},V.id)})]})]})]})}function ii({onClose:o,onTemplateApplied:i,scrollTrigger:c,isClosing:p,appliedTemplateKey:d}){const[m,g]=x.useState(!1),[h,v]=x.useState(null),{hasPlatformConfig:w}=mr(),j=!d&&w,S=T=>{if(j&&!h){v(T);return}g(!0),i&&i(T.key||T)},L=()=>{h&&(g(!0),i&&i(h.key||h),v(null))},D=()=>{v(null)};return t.jsx(Mt,{title:"Banner Template",onClose:o,scrollTrigger:c,isClosing:p,children:h?t.jsxs("div",{className:"cn-wizard-confirm",children:[t.jsx("p",{className:"cn-wizard-confirm__text",children:"Your banner is currently configured in the Admin Portal. Applying this template will override your custom design."}),t.jsxs("div",{className:"cn-wizard-confirm__actions",children:[t.jsx("button",{className:"cn-button cn-button--outline",onClick:D,type:"button",children:"Cancel"}),t.jsx("button",{className:"cn-button cn-button--primary",onClick:L,type:"button",children:"Apply Template"})]})]}):m?t.jsxs("div",{className:"cn-wizard-success",children:[t.jsx("div",{className:"cn-wizard-success__icon",children:"✓"}),t.jsx("h3",{className:"cn-wizard-success__heading",children:"Template applied — your banner is live."}),t.jsx("p",{className:"cn-wizard-success__sub",children:"Customize text, colors, and advanced design in the web app."}),t.jsx("button",{className:"cn-button cn-button--primary",onClick:o,children:"Done"})]}):t.jsx(li,{onApply:S})})}function xd(){const[o,i]=x.useState(()=>{var d;const p=((d=window.cnReactData)==null?void 0:d.selectedLaws)||[];return Array.isArray(p)?p:Object.values(p)});return[o,p=>{i(p),window.cnReactData&&(window.cnReactData.selectedLaws=p)}]}function ci({onClose:o,onSave:i,scrollTrigger:c,isClosing:p}){const[d,m]=xd(),[g,h]=x.useState(""),[v,w]=x.useState(!1),[j,S]=x.useState(""),[L,D]=x.useState(!1);x.useEffect(()=>{var E,M;h(((M=(E=window.cnReactData)==null?void 0:E.options)==null?void 0:M.cn_do_not_sell_url)||""),S("")},[]);const T=async()=>{var E,M;w(!0),S("");try{const A={};d.forEach((H,$)=>{A["cn_laws["+$+"]"]=H}),await Mn("configure",{...A,cn_revoke_consent:"1"},((E=window.cnReactData)==null?void 0:E.configureNonce)||""),m(d),(M=window.cnReactData)!=null&&M.options&&(window.cnReactData.options.cn_do_not_sell_url=g),D(!0)}catch(A){S(A.message||"Failed to save laws.")}finally{w(!1)}},b=()=>{i&&i(d),o()};if(L)return t.jsx(Mt,{title:"Privacy Laws",onClose:b,scrollTrigger:c,isClosing:p,children:t.jsxs("div",{className:"cn-wizard-success",children:[t.jsx("div",{className:"cn-wizard-success__icon",children:"✓"}),t.jsx("h3",{className:"cn-wizard-success__heading",children:"Laws updated"}),t.jsx("button",{className:"cn-button cn-button--primary",onClick:b,children:"Done"})]})});const k=t.jsxs(t.Fragment,{children:[t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noreferrer",className:"cn-layer__link-btn",children:"Manage regulations in web app →"}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx($e,{variant:"secondary",onClick:o,children:"Cancel"}),t.jsx($e,{variant:"primary",onClick:T,disabled:v,children:v?"Saving…":"Save laws"})]})]});return t.jsxs(Mt,{title:"Privacy Laws",onClose:o,scrollTrigger:c,isClosing:p,footer:k,children:[t.jsx(si,{selected:d,onChange:m,dnsUrl:g,onDnsUrlChange:h}),j&&t.jsx("p",{style:{color:"var(--cn-red)",fontSize:13,marginTop:8},children:j})]})}const Q={layout:"_layout_19w0d_48",modeList:"_modeList_19w0d_55",modeSection:"_modeSection_19w0d_63",modeSectionLabel:"_modeSectionLabel_19w0d_69",modeCard:"_modeCard_19w0d_79",modeCardActive:"_modeCardActive_19w0d_94",modeCardLocked:"_modeCardLocked_19w0d_100",modeCardProOverlay:"_modeCardProOverlay_19w0d_106",lockIconLarge:"_lockIconLarge_19w0d_121",modeCardProLabel:"_modeCardProLabel_19w0d_125",modeCardTop:"_modeCardTop_19w0d_131",modeCardName:"_modeCardName_19w0d_138",modeCardDesc:"_modeCardDesc_19w0d_144",statusDot:"_statusDot_19w0d_150",statusDotOn:"_statusDotOn_19w0d_158",statusDotOff:"_statusDotOff_19w0d_162",detailCol:"_detailCol_19w0d_166",detail:"_detail_19w0d_166",detailHeader:"_detailHeader_19w0d_179",detailTitle:"_detailTitle_19w0d_186",detailDesc:"_detailDesc_19w0d_192",detailFooter:"_detailFooter_19w0d_199",enableToggle:"_enableToggle_19w0d_207",enableToggleInput:"_enableToggleInput_19w0d_215",enableToggleTrack:"_enableToggleTrack_19w0d_222",enableToggleThumb:"_enableToggleThumb_19w0d_236",enableToggleLabel:"_enableToggleLabel_19w0d_251",signalConfig:"_signalConfig_19w0d_257",signalConfigTitle:"_signalConfigTitle_19w0d_265",groupRow:"_groupRow_19w0d_274",groupLabel:"_groupLabel_19w0d_281",groupSelect:"_groupSelect_19w0d_287",groupHint:"_groupHint_19w0d_305",advancedToggle:"_advancedToggle_19w0d_312",advancedGrid:"_advancedGrid_19w0d_327",advancedRow:"_advancedRow_19w0d_336",advancedLabel:"_advancedLabel_19w0d_343",subToggles:"_subToggles_19w0d_348",subToggleTitle:"_subToggleTitle_19w0d_354",subToggleRow:"_subToggleRow_19w0d_363",proGate:"_proGate_19w0d_373",proGateLink:"_proGateLink_19w0d_387"},It=[{key:"google",name:"Google Consent Mode v2",shortName:"Google",group:"platform",pro:!1,description:"Required for GDPR compliance if you use Google Analytics, Google Ads, or Tag Manager"},{key:"facebook",name:"Facebook",shortName:"Facebook",group:"platform",pro:!0,description:"Required if you run Facebook Ads — stops Meta Pixel from firing before visitors agree"},{key:"microsoft",name:"Microsoft",shortName:"Microsoft",group:"platform",pro:!0,description:"Required if you use Microsoft Ads or Clarity — keeps Bing and analytics trackers compliant"},{key:"gpc",name:"Global Privacy Control",shortName:"GPC",group:"browser",pro:!1,description:"Honors visitors who’ve told their browser they don’t want to be tracked — required in California"},{key:"dnt",name:"Do Not Track",shortName:"DNT",group:"browser",pro:!1,description:"Honors the legacy ‘Do Not Track’ browser setting — good practice, not legally required"}];function fl(o){return o===2?[{value:1,label:"Always (even on Reject)"},{value:4,label:"On Accept"}]:[{value:1,label:"Always (even on Reject)"},{value:3,label:"Balanced or above"},{value:4,label:"Accept All only"}]}function jd(o){const i=o.google_consent_default||{},c=o.facebook_consent_default||{},p=o.microsoft_consent_default||{},d=Object.keys(i).length>0,m=Object.keys(c).length>0,g=Object.keys(p).length>0;return{googleEnabled:d,googleAdvertising:i.ad_storage??4,googleAnalytics:i.analytics_storage??3,googleFunctional:i.functionality_storage??3,googleAdStorage:i.ad_storage??4,googleAdPersonalization:i.ad_personalization??4,googleAdUserData:i.ad_user_data??4,googleAnalyticsStorage:i.analytics_storage??3,googleFunctionalityStorage:i.functionality_storage??3,googlePersonalizationStorage:i.personalization_storage??3,googleSecurityStorage:i.security_storage??3,facebookEnabled:m,facebookConsent:c.consent??4,microsoftEnabled:g,microsoftAdStorage:p.ad_storage??4,microsoftAnalyticsStorage:p.analytics_storage??3,microsoftPixie:!!p.pixie,microsoftClarity:!!p.clarity,gpcEnabled:!!(o.gpc_support??0),doNotTrack:!!(o.do_not_track??0)}}function Bs(o){return{googleConsentMapAdStorage:o.googleEnabled?o.googleAdStorage:"",googleConsentMapAdPersonalization:o.googleEnabled?o.googleAdPersonalization:"",googleConsentMapAdUserData:o.googleEnabled?o.googleAdUserData:"",googleConsentMapAnalytics:o.googleEnabled?o.googleAnalyticsStorage:"",googleConsentMapFunctionality:o.googleEnabled?o.googleFunctionalityStorage:"",googleConsentMapPersonalization:o.googleEnabled?o.googlePersonalizationStorage:"",googleConsentMapSecurity:o.googleEnabled?o.googleSecurityStorage:"",facebookConsentMapConsent:o.facebookEnabled?o.facebookConsent:"",microsoftConsentMapAdStorage:o.microsoftEnabled?o.microsoftAdStorage:"",microsoftConsentMapAnalyticsStorage:o.microsoftEnabled?o.microsoftAnalyticsStorage:"",microsoftConsentModePixie:o.microsoftPixie?1:0,microsoftConsentModeClarity:o.microsoftClarity?1:0,gpcSupport:o.gpcEnabled?1:0,doNotTrack:o.doNotTrack?1:0}}function ui({enabled:o}){return t.jsx("span",{className:`${Q.statusDot} ${o?Q.statusDotOn:Q.statusDotOff}`})}function Os({label:o,value:i,onChange:c,consentChoices:p,disabled:d}){const m=fl(p);return t.jsxs("div",{className:Q.groupRow,children:[t.jsx("span",{className:Q.groupLabel,children:o}),t.jsx("select",{className:Q.groupSelect,value:i,onChange:g=>c(Number(g.target.value)),disabled:d,children:m.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value))})]})}function vr({label:o,checked:i,onChange:c}){return t.jsxs("label",{className:Q.enableToggle,children:[t.jsx("input",{type:"checkbox",checked:i,onChange:p=>c(p.target.checked),className:Q.enableToggleInput}),t.jsx("span",{className:Q.enableToggleTrack,children:t.jsx("span",{className:Q.enableToggleThumb})}),t.jsx("span",{className:Q.enableToggleLabel,children:o})]})}function Us({locked:o,platformName:i,onUpgrade:c}){return t.jsxs("div",{className:Q.proGate,children:[t.jsx("span",{children:o==="pro"?`Upgrade to Pro to enable ${i} Consent Mode.`:`Monthly visit limit reached — ${i} Consent Mode is paused until your visit count resets. Upgrade for unlimited visits.`}),t.jsx("button",{type:"button",className:Q.proGateLink,onClick:c,children:"Upgrade →"})]})}function $s({onApply:o,hasChanges:i,saving:c,savedFlash:p,locked:d}){return t.jsx("div",{className:Q.detailFooter,children:t.jsx($e,{variant:"primary",size:"sm",onClick:o,disabled:!i||c||d,children:c?"Applying…":p?"Saved ✓":"Apply"})})}function wd({staged:o,set:i,consentChoices:c,proLocked:p,saving:d,hasChanges:m,savedFlash:g,onApply:h,onUpgrade:v}){const[w,j]=x.useState(!1),S=k=>{i("googleAdvertising",k),i("googleAdStorage",k),i("googleAdPersonalization",k),i("googleAdUserData",k)},L=k=>{i("googleAnalytics",k),i("googleAnalyticsStorage",k)},D=k=>{i("googleFunctional",k),i("googleFunctionalityStorage",k),i("googlePersonalizationStorage",k),i("googleSecurityStorage",k)},T=p,b=fl(c);return t.jsxs("div",{className:Q.detail,children:[t.jsxs("div",{className:Q.detailHeader,children:[t.jsx("div",{className:Q.detailTitle,children:"Google Consent Mode v2"}),T==="pro"&&t.jsx(Fn,{})]}),t.jsx("p",{className:Q.detailDesc,children:"If you use Google Analytics, Google Ads, or Tag Manager, this tells Google how to handle your visitors’ data based on whether they consented. Required for GDPR compliance with Google tools."}),T?t.jsx(Us,{locked:T,platformName:"Google",onUpgrade:v}):t.jsxs(t.Fragment,{children:[t.jsx(vr,{label:o.googleEnabled?"Enabled":"Disabled",checked:o.googleEnabled,onChange:k=>i("googleEnabled",k)}),o.googleEnabled&&t.jsxs("div",{className:Q.signalConfig,children:[t.jsx("div",{className:Q.signalConfigTitle,children:"Signal mapping"}),t.jsx(Os,{label:"Advertising",value:o.googleAdvertising,onChange:S,consentChoices:c}),t.jsx("p",{className:Q.groupHint,children:"ad_storage, ad_personalization, ad_user_data — default: Accept All only. Most conservative."}),t.jsx(Os,{label:"Analytics",value:o.googleAnalytics,onChange:L,consentChoices:c}),t.jsx("p",{className:Q.groupHint,children:"analytics_storage — default: Balanced or above."}),t.jsx(Os,{label:"Functional",value:o.googleFunctional,onChange:D,consentChoices:c}),t.jsx("p",{className:Q.groupHint,children:"functionality_storage, personalization_storage, security_storage — default: Balanced or above."}),t.jsx("button",{className:Q.advancedToggle,onClick:()=>j(k=>!k),type:"button",children:w?"▾ Hide per-signal controls":"▸ Advanced — per-signal control"}),w&&t.jsx("div",{className:Q.advancedGrid,children:[["Ad Storage","googleAdStorage",b],["Ad Personalization","googleAdPersonalization",b],["Ad User Data","googleAdUserData",b],["Analytics Storage","googleAnalyticsStorage",b],["Functionality Storage","googleFunctionalityStorage",b],["Personalization Storage","googlePersonalizationStorage",b],["Security Storage","googleSecurityStorage",b]].map(([k,E,M])=>t.jsxs("div",{className:Q.advancedRow,children:[t.jsx("span",{className:Q.advancedLabel,children:k}),t.jsx("select",{className:Q.groupSelect,value:o[E],onChange:A=>i(E,Number(A.target.value)),children:M.map(A=>t.jsx("option",{value:A.value,children:A.label},A.value))})]},E))})]})]}),t.jsx($s,{onApply:h,hasChanges:m,saving:d,savedFlash:g,locked:T})]})}function kd({staged:o,set:i,consentChoices:c,proLocked:p,saving:d,hasChanges:m,savedFlash:g,onApply:h,onUpgrade:v}){const w=fl(c);return t.jsxs("div",{className:Q.detail,children:[t.jsxs("div",{className:Q.detailHeader,children:[t.jsx("div",{className:Q.detailTitle,children:"Facebook"}),p==="pro"&&t.jsx(Fn,{})]}),t.jsx("p",{className:Q.detailDesc,children:"Stops the Meta Pixel from tracking your visitors until they agree. Without this, Facebook can receive data about visitors who never consented — a GDPR violation if you serve EU visitors."}),p?t.jsx(Us,{locked:p,platformName:"Facebook",onUpgrade:v}):t.jsxs(t.Fragment,{children:[t.jsx(vr,{label:o.facebookEnabled?"Enabled":"Disabled",checked:o.facebookEnabled,onChange:j=>i("facebookEnabled",j)}),o.facebookEnabled&&t.jsxs("div",{className:Q.signalConfig,children:[t.jsx("div",{className:Q.signalConfigTitle,children:"Signal mapping"}),t.jsxs("div",{className:Q.groupRow,children:[t.jsx("span",{className:Q.groupLabel,children:"Grant Pixel at"}),t.jsx("select",{className:Q.groupSelect,value:o.facebookConsent,onChange:j=>i("facebookConsent",Number(j.target.value)),children:w.map(j=>t.jsx("option",{value:j.value,children:j.label},j.value))})]}),t.jsx("p",{className:Q.groupHint,children:"Default: Accept All only."})]})]}),t.jsx($s,{onApply:h,hasChanges:m,saving:d,savedFlash:g,locked:p})]})}function Nd({staged:o,set:i,consentChoices:c,proLocked:p,saving:d,hasChanges:m,savedFlash:g,onApply:h,onUpgrade:v}){const w=fl(c);return t.jsxs("div",{className:Q.detail,children:[t.jsxs("div",{className:Q.detailHeader,children:[t.jsx("div",{className:Q.detailTitle,children:"Microsoft"}),p==="pro"&&t.jsx(Fn,{})]}),t.jsx("p",{className:Q.detailDesc,children:"Keeps Microsoft Advertising (Bing) and Clarity analytics compliant with consent rules. Trackers only fire after visitors agree."}),p?t.jsx(Us,{locked:p,platformName:"Microsoft",onUpgrade:v}):t.jsxs(t.Fragment,{children:[t.jsx(vr,{label:o.microsoftEnabled?"Enabled":"Disabled",checked:o.microsoftEnabled,onChange:j=>i("microsoftEnabled",j)}),o.microsoftEnabled&&t.jsxs("div",{className:Q.signalConfig,children:[t.jsx("div",{className:Q.signalConfigTitle,children:"Signal mapping"}),t.jsxs("div",{className:Q.groupRow,children:[t.jsx("span",{className:Q.groupLabel,children:"Advertising (UET)"}),t.jsx("select",{className:Q.groupSelect,value:o.microsoftAdStorage,onChange:j=>i("microsoftAdStorage",Number(j.target.value)),children:w.map(j=>t.jsx("option",{value:j.value,children:j.label},j.value))})]}),t.jsxs("div",{className:Q.groupRow,style:{marginTop:8},children:[t.jsx("span",{className:Q.groupLabel,children:"Analytics"}),t.jsx("select",{className:Q.groupSelect,value:o.microsoftAnalyticsStorage,onChange:j=>i("microsoftAnalyticsStorage",Number(j.target.value)),children:w.map(j=>t.jsx("option",{value:j.value,children:j.label},j.value))})]}),t.jsxs("div",{className:Q.subToggles,children:[t.jsx("div",{className:Q.subToggleTitle,children:"Sub-products"}),t.jsxs("label",{className:Q.subToggleRow,children:[t.jsx("input",{type:"checkbox",checked:o.microsoftPixie,onChange:j=>i("microsoftPixie",j.target.checked)}),t.jsx("span",{children:"Pixie"})]}),t.jsxs("label",{className:Q.subToggleRow,children:[t.jsx("input",{type:"checkbox",checked:o.microsoftClarity,onChange:j=>i("microsoftClarity",j.target.checked)}),t.jsx("span",{children:"Clarity"})]})]})]})]}),t.jsx($s,{onApply:h,hasChanges:m,saving:d,savedFlash:g,locked:p})]})}function Sd({staged:o,set:i,saving:c,hasChanges:p,savedFlash:d,onApply:m}){return t.jsxs("div",{className:Q.detail,children:[t.jsx("div",{className:Q.detailHeader,children:t.jsx("div",{className:Q.detailTitle,children:"Global Privacy Control (GPC)"})}),t.jsx(vr,{label:o.gpcEnabled?"Enabled":"Disabled",checked:o.gpcEnabled,onChange:g=>i("gpcEnabled",g)}),t.jsx("p",{className:Q.detailDesc,style:{marginTop:16},children:"Some visitors set their browser to automatically opt out of tracking. This setting respects that choice — and it’s legally required in California (CPRA). When a visitor sends this signal, tracking is blocked automatically without showing the banner."}),t.jsx("div",{className:Q.detailFooter,children:t.jsx($e,{variant:"primary",size:"sm",onClick:m,disabled:!p||c,children:c?"Applying…":d?"Saved ✓":"Apply"})})]})}function Cd({staged:o,set:i,saving:c,hasChanges:p,savedFlash:d,onApply:m}){return t.jsxs("div",{className:Q.detail,children:[t.jsx("div",{className:Q.detailHeader,children:t.jsx("div",{className:Q.detailTitle,children:"Do Not Track (DNT)"})}),t.jsx("p",{className:Q.detailDesc,style:{color:"#b56e00",marginBottom:12},children:"Do Not Track is an older browser setting that most sites ignore. Enabling this is a good-faith gesture but isn’t required by any law. When a visitor has DNT enabled, tracking is blocked automatically."}),t.jsx(vr,{label:o.doNotTrack?"Enabled":"Disabled",checked:o.doNotTrack,onChange:g=>i("doNotTrack",g)}),t.jsxs("p",{className:Q.detailDesc,style:{marginTop:12},children:["When enabled, visitors with DNT set receive ",t.jsx("strong",{children:"Private (level 1)"})," consent automatically."]}),t.jsx("div",{className:Q.detailFooter,children:t.jsx($e,{variant:"primary",size:"sm",onClick:m,disabled:!p||c,children:c?"Applying…":d?"Saved ✓":"Apply"})})]})}function di({isOpen:o,onClose:i,isWizard:c=!1,addNotice:p,onOpenPricingModal:d,onApplied:m,scrollTrigger:g}){var ue,fe;const{config:h,refetchConfig:v}=At(),{dashboard:w}=vt(),{tier:j}=Ue(),S=(h==null?void 0:h.blocking)||{},L=((ue=w==null?void 0:w.appConfig)==null?void 0:ue.consentChoices)??3,[D,T]=x.useState({}),[b,k]=x.useState("google"),[E,M]=x.useState(!1),[A,H]=x.useState(null),[$,V]=x.useState(!1),Z=x.useRef(null);if(x.useEffect(()=>{if(c?h:o){const O=jd(S);T(O),H(JSON.stringify(Bs(O))),k("google")}},[c?h:o,h]),!c&&!o)return null;const W=(O,ce)=>T(ye=>({...ye,[O]:ce})),Y=JSON.stringify(Bs(D)),z=Y!==A,de=async()=>{M(!0),V(!1);try{await ul({googleConsentMode:D.googleEnabled?"1":"0",facebookConsentMode:D.facebookEnabled?"1":"0",microsoftConsentMode:D.microsoftEnabled?"1":"0"},{},Bs(D)),H(Y),m&&m({google:D.googleEnabled,facebook:D.facebookEnabled,microsoft:D.microsoftEnabled,gpc:D.gpcEnabled,dnt:D.doNotTrack}),V(!0),clearTimeout(Z.current),Z.current=setTimeout(()=>V(!1),2e3),v()}catch(O){p&&p((O==null?void 0:O.message)||"Could not save — please try again.")}finally{M(!1)}},_e=(fe=w==null?void 0:w.analytics)==null?void 0:fe.cycleUsage,ie=(_e==null?void 0:_e.visits)||0,J=(_e==null?void 0:_e.threshold)||0,se=J>0&&ie>=J,he=j==="pro",me=O=>O.pro&&!he?"pro":O.key==="google"&&se?"threshold":!1,G={google:D.googleEnabled,facebook:D.facebookEnabled,microsoft:D.microsoftEnabled,gpc:D.gpcEnabled,dnt:D.doNotTrack},le=t.jsxs("div",{className:Q.layout,children:[t.jsxs("div",{className:Q.modeList,children:[t.jsxs("div",{className:Q.modeSection,children:[t.jsx("div",{className:Q.modeSectionLabel,children:"Platform Integrations"}),It.filter(O=>O.group==="platform").map(O=>{const ce=me(O);return t.jsxs("button",{className:Q.modeCard+(b===O.key?" "+Q.modeCardActive:"")+(ce?" "+Q.modeCardLocked:""),onClick:()=>k(O.key),type:"button",children:[t.jsxs("div",{className:Q.modeCardTop,children:[t.jsx("span",{className:Q.modeCardName,children:O.name}),ce==="pro"?t.jsx(Fn,{}):t.jsx(ui,{enabled:G[O.key]})]}),t.jsx("div",{className:Q.modeCardDesc,children:O.description}),ce&&t.jsxs("div",{className:Q.modeCardProOverlay,role:"button",tabIndex:0,onClick:ye=>{ye.stopPropagation(),d&&d()},onKeyDown:ye=>{(ye.key==="Enter"||ye.key===" ")&&(ye.stopPropagation(),d&&d())},"aria-label":ce==="pro"?`${O.name} requires Pro.`:`${O.name} paused — visit limit reached. Upgrade for unlimited visits.`,children:[t.jsx("span",{className:Q.lockIconLarge,children:"🔒"}),t.jsx("span",{className:Q.modeCardProLabel,children:ce==="pro"?"Upgrade to Pro →":"Visit limit reached →"})]})]},O.key)})]}),t.jsxs("div",{className:Q.modeSection,children:[t.jsx("div",{className:Q.modeSectionLabel,children:"Browser Signals"}),It.filter(O=>O.group==="browser").map(O=>t.jsxs("button",{className:Q.modeCard+(b===O.key?" "+Q.modeCardActive:""),onClick:()=>k(O.key),type:"button",children:[t.jsxs("div",{className:Q.modeCardTop,children:[t.jsx("span",{className:Q.modeCardName,children:O.name}),t.jsx(ui,{enabled:G[O.key]})]}),t.jsx("div",{className:Q.modeCardDesc,children:O.description})]},O.key))]})]}),t.jsxs("div",{className:Q.detailCol,children:[b==="google"&&t.jsx(wd,{staged:D,set:W,consentChoices:L,proLocked:me(It.find(O=>O.key==="google")),saving:E,hasChanges:z,savedFlash:$,onApply:de,onUpgrade:()=>d&&d()}),b==="facebook"&&t.jsx(kd,{staged:D,set:W,consentChoices:L,proLocked:me(It.find(O=>O.key==="facebook")),saving:E,hasChanges:z,savedFlash:$,onApply:de,onUpgrade:()=>d&&d()}),b==="microsoft"&&t.jsx(Nd,{staged:D,set:W,consentChoices:L,proLocked:me(It.find(O=>O.key==="microsoft")),saving:E,hasChanges:z,savedFlash:$,onApply:de,onUpgrade:()=>d&&d()}),b==="gpc"&&t.jsx(Sd,{staged:D,set:W,saving:E,hasChanges:z,savedFlash:$,onApply:de}),b==="dnt"&&t.jsx(Cd,{staged:D,set:W,saving:E,hasChanges:z,savedFlash:$,onApply:de})]})]}),q=It.filter(O=>G[O.key]).map(O=>O.shortName),N=q.length>0?`${q.length} active: ${q.join(", ")}`:"No consent modes enabled",I=t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noreferrer",className:"cn-layer__link-btn",children:"Advanced settings in web app →"}),t.jsxs("span",{style:{fontSize:"var(--cn-text-sm)",color:q.length>0?"var(--cn-ok-icon)":"var(--cn-off-val)"},children:[q.length>0?"✓ ":"",N]})]}),t.jsx($e,{variant:"primary",onClick:i,children:"Done"})]});return c?le:t.jsx(Mt,{title:"Consent Protection Settings",onClose:i,scrollTrigger:g,footer:I,children:le})}function bd({addNotice:o,onOpenWelcomeModal:i,onOpenPricingModal:c,onTabChange:p,appliedTemplateKey:d,onTemplateApplied:m}){var Ut,jt,Nr,qn,Zn,vl,Sr,Cr,yl,$t,Wt;const{tier:g}=Ue(),{dashboard:h}=vt(),{config:v,isLoadingConfig:w,refetchConfig:j}=At(),{hasPlatformConfig:S,showBannerWizard:L,bannerScrollTrigger:D,bannerClosing:T,closeBannerWizard:b,showLawWizard:k,lawScrollTrigger:E,lawClosing:M,closeLawWizard:A,showConsentPanel:H,consentScrollTrigger:$,consentClosing:V,closeConsentPanel:Z,openBannerWizard:W,openConsentPanel:Y,openLawWizard:z}=mr(),[de,_e]=x.useState(((jt=(Ut=window.cnReactData)==null?void 0:Ut.options)==null?void 0:jt.app_id)||""),[ie,J]=x.useState(((qn=(Nr=window.cnReactData)==null?void 0:Nr.options)==null?void 0:qn.app_key)||""),[se,he]=x.useState(!1),[me,G]=x.useState(""),le=async()=>{he(!0),G("");try{await zs({app_id:de,app_key:ie});try{const Te=await Mn("sync_config");if(Te!=null&&Te.success){try{await As()}catch{}try{localStorage.setItem(Ts(de),"1"),localStorage.setItem(Rs(de),"1")}catch{}}}catch{}window.location.reload()}catch(Te){G(Te.message||"Save failed"),he(!1)}},q=d||"",N=Te=>{m&&m(Te)},[I,ue]=x.useState(!1),[fe,O]=x.useState(0),ce=h==null?void 0:h.analytics,ye=(h==null?void 0:h.appConfig)||{},we=(v==null?void 0:v.blocking)||{},be=Yo(we),{total:Je,uncategorized:En}=qo(we),ml=!!((vl=(Zn=window.cnReactData)==null?void 0:Zn.options)!=null&&vl.app_blocking),wn=ce==null?void 0:ce.cycleUsage,_r=(wn==null?void 0:wn.visits)||0,gl=(wn==null?void 0:wn.threshold)||0;if(g==="basic")return t.jsxs(yt,{sidebar:t.jsxs(t.Fragment,{children:[t.jsxs(In,{title:"Domain Info",children:[t.jsxs("div",{className:"cn-dom-rows",children:[t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Domain"}),t.jsx("span",{className:"cn-dom-row__v",children:window.location.hostname})]}),t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Status"}),t.jsxs("span",{className:"cn-dom-row__v",children:[t.jsx("span",{className:"cn-dot cn-dot--gray"})," Not Connected"]})]})]}),t.jsx(Ne,{label:"App ID",value:de,onChange:_e,placeholder:"Your application ID",autoComplete:"off"}),t.jsx(Ne,{label:"Secret Key",type:"password",value:ie,onChange:J,placeholder:"Your application key",autoComplete:"new-password"}),t.jsxs("p",{className:"cn-conn-hint cn-conn-hint--returning",children:["Already have an account?"," ",t.jsx("a",{href:Qe,target:"_blank",rel:"noopener noreferrer",children:"Find your App ID and Secret Key at app.hu-manity.co"})]}),me&&t.jsx("div",{className:"cn-conn-error",children:me}),t.jsx($e,{variant:"primary",onClick:le,disabled:se,children:se?"Saving…":"Connect Your Site"})]}),t.jsxs(In,{title:"What you get with compliance",children:[t.jsxs("ul",{className:"cn-benefit-list",children:[t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Stop tracking scripts from firing before visitors agree"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Build a legal evidence trail regulators can verify"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Cover GDPR, CCPA, and 40+ global regulations automatically"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Real compliance in under 60 seconds — free to start"})]})]}),t.jsxs("div",{className:"cn-connect-cta",children:[t.jsx("button",{type:"button",className:"cn-button cn-button--primary cn-button--block",onClick:()=>i&&i(),children:"Set up compliance →"}),t.jsx("div",{className:"cn-connect-cta__caption",children:"No credit card required"})]})]})]}),children:[t.jsx(Xu,{onActivate:()=>i&&i()}),t.jsx(Xo,{requiredTier:"free",message:"Script blocking, consent records, regulatory alerts & more",onCta:i,children:t.jsx("div",{className:"cn-pro-gate-placeholder",children:t.jsx("div",{className:"cn-placeholder-charts"})})})]});const xr=((Sr=window.cnReactData)==null?void 0:Sr.siteUrl)||"",Ft=Qo(ye.regulations),jr=Ft.map(Te=>Ms[Te]||Te.toUpperCase()),Bt=Tu((yl=(Cr=window.cnReactData)==null?void 0:Cr.options)==null?void 0:yl.app_id),[xt,Qn]=x.useState(()=>{try{const Te=localStorage.getItem(Bt)==="1";return Te&&localStorage.removeItem(Bt),Te}catch{return!1}}),Ot=xr&&q?`${xr}?cn_preview=1`:"",wr=((($t=window.cnReactData)==null?void 0:$t.detectedPlugins)||[]).includes("google"),Yn=[];!q&&!S&&Yn.push("banner template"),jr.length===0&&!S&&Yn.push("laws"),En>0&&Yn.push(`${En} uncategorized tracker${En!==1?"s":""}`),wr&&!be.google&&Yn.push("Google Consent Mode review");const kr=Yn.slice(0,3);return t.jsxs(yt,{sidebar:t.jsxs(t.Fragment,{children:[t.jsx(dl,{addNotice:o}),t.jsx(ri,{onOpenPricingModal:()=>c&&c()})]}),children:[t.jsx(Ju,{sessionUsed:_r,sessionTotal:gl,activeLawsCount:jr.length,uncategorizedScripts:En,autoblockingEnabled:ml}),xt&&t.jsxs("div",{className:"cn-inline-notice cn-inline-notice--success",children:[t.jsxs("div",{className:"cn-inline-notice__message",children:[t.jsx("strong",{children:"✓ Your banner is live."})," ","Visitors will now see your selected template and your chosen laws/languages are active."]}),t.jsxs("div",{className:"cn-inline-notice__actions",children:[Ot&&t.jsx("a",{className:"cn-layer__link-btn",href:Ot,target:"_blank",rel:"noreferrer",children:"Preview your live banner →"}),t.jsx("button",{type:"button",className:"cn-layer__link-btn",onClick:()=>Qn(!1),children:"Dismiss"})]})]}),kr.length>0&&t.jsx("div",{className:"cn-inline-notice cn-inline-notice--info",children:t.jsxs("div",{className:"cn-inline-notice__message",children:[t.jsx("strong",{children:"Still missing:"})," ",kr.join(", "),"."]})}),wr&&!be.google&&t.jsxs("div",{className:"cn-inline-notice cn-inline-notice--warning",children:[t.jsxs("div",{className:"cn-inline-notice__message",children:[t.jsx("strong",{children:"Google tools detected."})," ","Review Google Consent Mode before you consider setup complete."]}),t.jsx("button",{type:"button",className:"cn-layer__link-btn",onClick:()=>Y(),children:"Review consent modes →"})]}),t.jsx(dd,{onTemplateApplied:Te=>N(Te),initialLaws:Ft,onOpenPricingModal:c,totalScripts:Je,uncategorizedScripts:En,isLoadingConfig:w}),I&&t.jsx(_d,{onClose:()=>{ue(!1),j()},onOpenWelcomeModal:i,scrollTrigger:fe}),!I&&t.jsx(ni,{appliedTemplateKey:q,onTemplateApplied:m,siteUrl:((Wt=window.cnReactData)==null?void 0:Wt.siteUrl)||"",onOpenTrackers:()=>{ue(!0),O(Te=>Te+1)},onTabChange:p}),L&&t.jsx(ii,{onClose:b,onTemplateApplied:Te=>{N(Te),b()},scrollTrigger:D,isClosing:T,appliedTemplateKey:q}),H&&t.jsx(di,{isOpen:!0,onClose:Z,addNotice:o,onOpenPricingModal:c,onApplied:()=>{},scrollTrigger:$,isClosing:V}),k&&t.jsx(ci,{onClose:A,scrollTrigger:E,isClosing:M}),t.jsx(fd,{consentModes:be,regulations:ye.regulations||{}})]})}function pi(o,i){const[c,p]=x.useState(null),[d,m]=x.useState(!0),[g,h]=x.useState(null),v=x.useRef(null),w=x.useCallback(async()=>{if(v.current){p(v.current),m(!1);return}m(!0),h(null);try{const S=await o(i);v.current=S,p(S)}catch(S){h(S.message||"An error occurred")}finally{m(!1)}},[o,i]);x.useEffect(()=>{w()},[w]);const j=x.useCallback(()=>{v.current=null,w()},[w]);return{data:c,loading:d,error:g,refetch:j}}function Ld(){return pi(zu)}function Pd(){return pi(Au)}function Ed(){const o=(window.cnReactData||{}).options||{},[i,c]=x.useState(o),[p,d]=x.useState(!1),[m,g]=x.useState(null),[h,v]=x.useState(!1),w=x.useCallback((L,D)=>{c(T=>({...T,[L]:D})),v(!1)},[]),j=x.useCallback((L,D,T)=>{c(b=>({...b,[L]:{...b[L]||{},[D]:T}})),v(!1)},[]),S=x.useCallback(async()=>{d(!0),g(null),v(!1);try{const L={};return Object.entries(i).forEach(([D,T])=>{D==="see_more_opt"&&typeof T=="object"?(L["see_more_opt[text]"]=T.text||"",L["see_more_opt[link_type]"]=T.link_type||"page",L["see_more_opt[id]"]=T.id||0,L["see_more_opt[link]"]=T.link||"",L["see_more_opt[sync]"]=T.sync?"1":""):D==="colors"&&typeof T=="object"?(L.bar_opacity=T.bar_opacity||100,L.color_bar=T.bar||"",L.color_text=T.text||"",L.color_button=T.button||""):D==="conditional_rules"?L[D]=JSON.stringify(T||[]):D==="excluded_handles"?L[D]=Array.isArray(T)?T.join(` `):T||"":D==="refuse_code"||D==="refuse_code_head"?L[D]=T||"":typeof T=="boolean"?L[D]=T?"1":"":L[D]=T}),await zs(L),window.cnReactData&&(window.cnReactData.options={...i}),v(!0),!0}catch(L){return g(L.message||"Save failed"),!1}finally{d(!1)}},[i]);return{options:i,update:w,updateNested:j,save:S,loading:p,error:m,saved:h}}function Dd(){const[o,i]=x.useState(!1),[c,p]=x.useState(null);return{exportCsv:x.useCallback(async m=>{i(!0),p(null);try{const g=await Iu(m);if(g.csv){const h=new Blob([g.csv],{type:"text/csv;charset=utf-8;"}),v=URL.createObjectURL(h),w=document.createElement("a");w.href=v,w.download=`consent-logs-${m.start_date||"export"}.csv`,w.click(),URL.revokeObjectURL(v)}return g}catch(g){throw p(g.message||"Export failed"),g}finally{i(!1)}},[]),loading:o,error:c}}const Td=[{key:"top",label:"Top",posClass:"pos-top"},{key:"bottom",label:"Bottom",posClass:"pos-bottom"}],Rd=[{key:"top",label:"Top",posClass:"pos-top"},{key:"bottom",label:"Bottom",posClass:"pos-bottom"},{key:"left",label:"Left",posClass:"pos-left"},{key:"right",label:"Right",posClass:"pos-right"},{key:"center",label:"Popup",posClass:"pos-center",proOnly:!0}];function zd({options:o,update:i,save:c,loading:p,saved:d,error:m}){const{isBasic:g,isPro:h}=Ue(),v=g?Td:Rd,[w,j]=x.useState(!1),[S,L]=x.useState(!1),[D,T]=x.useState(""),[b,k]=x.useState(!1),[E,M]=x.useState(o.displayType||"fixed"),A=Y=>{const z=o.position||"bottom";Y!==z&&(g?(i("position",Y),j(!0)):(L(!0),T(""),k(!1),ul({position:Y,displayType:E}).then(()=>{k(!0),i("position",Y)}).catch(de=>T(de.message||"Save failed.")).finally(()=>L(!1))))},H=Y=>{Y!==E&&(M(Y),g?(i("displayType",Y),j(!0)):(L(!0),T(""),k(!1),ul({position:o.position||"bottom",displayType:Y}).then(()=>{k(!0),i("displayType",Y)}).catch(z=>T(z.message||"Save failed.")).finally(()=>L(!1))))};x.useEffect(()=>{w&&g&&(j(!1),c())},[o.position,o.displayType,w,c,g]);const $=o.position||"bottom",V=g?p:S,Z=g?d:b,W=g?m:D;return t.jsxs("div",{className:"cn-banner-selector",children:[t.jsxs("div",{className:"cn-banner-selector__header",children:[t.jsx("span",{className:"cn-section-label",children:"Banner Position"}),Z&&t.jsx("span",{className:"cn-saved-indicator",children:"✓ Saved"}),W&&t.jsx("span",{className:"cn-error-indicator",children:W})]}),!g&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"cn-banner-selector__toggle-row",children:[t.jsx("span",{className:"cn-banner-selector__size-label",children:"Banner Size"}),t.jsxs("div",{className:"cn-banner-selector__size-opts",children:[t.jsx("button",{className:`cn-banner-selector__size-opt${E==="floating"?" cn-banner-selector__size-opt--on":""}`,onClick:()=>H("floating"),children:"Floating"}),t.jsx("button",{className:`cn-banner-selector__size-opt${E==="fixed"?" cn-banner-selector__size-opt--on":""}`,onClick:()=>H("fixed"),children:"Fixed"})]}),t.jsx("span",{className:"cn-banner-selector__size-desc",children:E==="floating"?"Fills only as much space as necessary.":"Expands to fill all available space."})]})}),t.jsx("div",{className:`cn-banner-selector__grid${!g&&E==="floating"?" cn-banner-selector__grid--floating":""}`,children:v.map(Y=>{const z=Y.proOnly&&!h;return t.jsxs("div",{className:"cn-banner-selector__card"+($===Y.key?" cn-banner-selector__card--active":"")+(V&&!z?" cn-banner-selector__card--saving":"")+(z?" cn-banner-selector__card--locked":""),onClick:()=>!z&&A(Y.key),title:z?"Upgrade to Pro to use the Popup position":void 0,children:[z&&t.jsx("span",{className:"cn-banner-selector__pro-badge",children:t.jsx(Fn,{})}),t.jsx("div",{className:"cn-banner-selector__thumb",children:t.jsx("div",{className:`cn-banner-selector__pos ${Y.posClass}${z?" cn-banner-selector__pos--locked":""}`})}),t.jsxs("div",{className:"cn-banner-selector__meta",children:[t.jsx("span",{className:"cn-banner-selector__name",children:Y.label}),$===Y.key&&!z&&t.jsx("span",{className:"cn-banner-selector__active-pill",children:"Active"}),z&&t.jsx("span",{className:"cn-banner-selector__locked-label",children:"Pro only"})]})]},Y.key)})}),!g&&t.jsx("div",{className:"cn-banner-selector__portal-link",children:t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noopener noreferrer",children:"Customize in Admin Portal →"})})]})}const Ws={size:24,color:"currentColor"};function un({size:o,color:i,className:c,style:p}={},d){return{xmlns:"http://www.w3.org/2000/svg",width:o||Ws.size,height:o||Ws.size,viewBox:"0 0 24 24",fill:"none",stroke:i||Ws.color,strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:c||"",style:p,...d}}function Ad(o){return t.jsxs("svg",{...un(o),children:[t.jsx("path",{d:"M12 2L3 6v5.5c0 4.5 3.8 8.7 9 10 5.2-1.3 9-5.5 9-10V6l-9-4z"}),t.jsx("polyline",{points:"8.5 12 11 14.5 15.5 9.5"})]})}function Md(o){return t.jsxs("svg",{...un(o),children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("ellipse",{cx:"12",cy:"12",rx:"4",ry:"10"}),t.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}function Id(o){return t.jsxs("svg",{...un(o),children:[t.jsx("rect",{x:"4",y:"14",width:"4",height:"7",rx:"1"}),t.jsx("rect",{x:"10",y:"9",width:"4",height:"12",rx:"1"}),t.jsx("rect",{x:"16",y:"4",width:"4",height:"17",rx:"1"})]})}function fi(o){return t.jsxs("svg",{...un(o),children:[t.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2"}),t.jsx("line",{x1:"9",y1:"8",x2:"15",y2:"8"}),t.jsx("line",{x1:"9",y1:"12",x2:"15",y2:"12"}),t.jsx("line",{x1:"9",y1:"16",x2:"13",y2:"16"})]})}function Hs(o){return t.jsxs("svg",{...un(o),children:[t.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),t.jsx("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})}function hi(o){return t.jsxs("svg",{...un(o),children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{d:"M9 12l2 2 4-4"})]})}function mi(o){return t.jsxs("svg",{...un(o),children:[t.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),t.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),t.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function Fd(o){return t.jsxs("svg",{...un(o),children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1.08-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1.08 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1.08z"})]})}function Bd(o){return t.jsxs("svg",{...un(o),children:[t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"}),t.jsx("line",{x1:"9",y1:"21",x2:"15",y2:"21"}),t.jsx("line",{x1:"3.5",y1:"8",x2:"20.5",y2:"8"}),t.jsx("line",{x1:"3.5",y1:"8",x2:"3.5",y2:"13"}),t.jsx("path",{d:"M1.5 13Q3.5 16.5 5.5 13"}),t.jsx("line",{x1:"20.5",y1:"8",x2:"20.5",y2:"13"}),t.jsx("path",{d:"M18.5 13Q20.5 16.5 22.5 13"})]})}function Od(o){return t.jsx("svg",{...un(o),children:t.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}function Ud(o){return t.jsxs("svg",{...un(o),children:[t.jsx("rect",{x:"2",y:"2",width:"20",height:"16",rx:"2.5"}),t.jsx("line",{x1:"2",y1:"13",x2:"22",y2:"13"}),t.jsx("line",{x1:"6",y1:"7",x2:"11",y2:"7"}),t.jsx("line",{x1:"6",y1:"10",x2:"9",y2:"10"}),t.jsx("rect",{x:"14",y:"14.5",width:"5",height:"2",rx:"1",fill:"currentColor",stroke:"none"}),t.jsx("line",{x1:"4",y1:"15.5",x2:"10",y2:"15.5"})]})}function $d(o){return t.jsx("svg",{...un(o),children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})}function Wd(o){return t.jsxs("svg",{...un(o),children:[t.jsx("path",{d:"M7 15l5 5 5-5"}),t.jsx("path",{d:"M7 9l5-5 5 5"})]})}function _t({title:o,subtitle:i,defaultOpen:c=!1,children:p}){return t.jsxs("details",{className:"cn-accordion",open:c||void 0,children:[t.jsxs("summary",{className:"cn-accordion__summary",children:[t.jsxs("div",{className:"cn-accordion__left",children:[t.jsx("span",{className:"cn-accordion__title",children:o}),i&&t.jsx("span",{className:"cn-accordion__subtitle",children:i})]}),t.jsx("span",{className:"cn-accordion__chevron",children:t.jsx($d,{size:16})})]}),t.jsx("div",{className:"cn-accordion__body",children:p})]})}function Vs({label:o,value:i,onChange:c}){const p=`cn-color-${o==null?void 0:o.toLowerCase().replace(/\s+/g,"-")}`;return t.jsxs("div",{className:"cn-form-field",children:[o&&t.jsx("label",{className:"cn-form-field__label",htmlFor:p,children:o}),t.jsxs("div",{className:"cn-color-picker__row",children:[t.jsx("input",{type:"color",className:"cn-color-picker__swatch",value:i||"#000000",onChange:d=>c==null?void 0:c(d.target.value)}),t.jsx("input",{id:p,type:"text",className:"cn-form-field__input",value:i||"",onChange:d=>c==null?void 0:c(d.target.value),placeholder:"#000000",style:{flex:1}})]})]})}const Hd=[{value:"bottom",label:"Bottom"},{value:"top",label:"Top"}],Vd=[{value:"fade",label:"Fade"},{value:"slide",label:"Slide"},{value:"none",label:"None"}];function hl({label:o,value:i}){return t.jsxs("div",{className:"cn-form-readonly",children:[t.jsx("label",{className:"cn-form-readonly__label",children:o}),t.jsx("span",{className:"cn-form-readonly__value",children:i||"(default)"}),t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noreferrer",className:"cn-form-readonly__link",children:"Edit text in web-app →"})]})}function Gd({options:o,update:i,updateNested:c}){const p=o.colors||{};o.see_more_opt;const{isConnected:d,isBasic:m}=Ue();return t.jsx(_t,{title:"Banner Design",subtitle:"Texts, colors, position, and animation",defaultOpen:!0,children:t.jsxs("div",{className:"cn-banner-design__grid",children:[t.jsxs("div",{className:"cn-banner-design__col",children:[d?t.jsx(hl,{label:"Banner Message",value:o.message_text}):t.jsx(Ne,{label:"Banner Message",type:"textarea",value:o.message_text||"",onChange:g=>i("message_text",g)}),d?t.jsx(hl,{label:"Accept Button",value:o.accept_text}):t.jsx(Ne,{label:"Accept Button",value:o.accept_text||"",onChange:g=>i("accept_text",g),placeholder:"Accept All"}),d?t.jsx(hl,{label:"Reject Button",value:o.refuse_text}):t.jsx(Ne,{label:"Reject Button",value:o.refuse_text||"",onChange:g=>i("refuse_text",g),placeholder:"Reject All"}),!m&&(d?t.jsx(hl,{label:"Preferences Button",value:o.revoke_text}):t.jsx(Ne,{label:"Preferences Button",value:o.revoke_text||"",onChange:g=>i("revoke_text",g),placeholder:"Manage Preferences"})),t.jsx(Ne,{label:"Banner Position",type:"select",value:o.position||"bottom",onChange:g=>i("position",g),options:Hd}),t.jsx(Ne,{label:"Dismiss Animation",type:"select",value:o.hide_effect||"fade",onChange:g=>i("hide_effect",g),options:Vd})]}),t.jsxs("div",{className:"cn-banner-design__col",children:[t.jsx(Vs,{label:"Background Color",value:p.bar||"#32323a",onChange:g=>c("colors","bar",g)}),t.jsx(Vs,{label:"Text Color",value:p.text||"#ffffff",onChange:g=>c("colors","text",g)}),t.jsx(Vs,{label:"Button Color",value:p.button||"#00a99d",onChange:g=>c("colors","button",g)})]})]})})}function Kd({onConnect:o}){return t.jsxs("div",{className:"cn-tier-gate-inline",children:[t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.5},children:[t.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),t.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Advanced features require a connection"}),t.jsx("p",{style:{margin:"4px 0 0",color:"var(--cn-muted)",fontSize:"var(--cn-text-sm)"},children:"Connect your site to unlock Autoblocking, Cookie Categories, Consent Records, and Analytics."})]}),t.jsx("button",{type:"button",className:"cn-button cn-button--primary",onClick:o,children:"Connect Your Site — It’s Free"})]})}const Qd={gpcSupportMode:{title:"GPC support",summary:"GPC (Global Privacy Control) tells browsers to signal opt-out of data sale automatically. Required for CCPA compliance.",navPath:["Compliance","Privacy Settings","GPC Support"],action:"Toggle GPC Support on, then save.",deepLink:"/#/configuration"},onClose:{title:"Accept on close",summary:"Accepting consent when users dismiss the banner is not allowed under GDPR and UK PECR.",navPath:["Compliance","Consent Settings","Accept on Close"],action:"Ensure Accept on Close is set to Off.",deepLink:"/#/configuration"},uiBlocking:{title:"Cookie wall (UI blocking)",summary:'Blocking site access until consent is given (a "cookie wall") violates GDPR — consent must be freely given.',navPath:["Compliance","Blocking Settings","Cookie Wall"],action:"Ensure Cookie Wall is set to Off.",deepLink:"/#/configuration"}},Yd=()=>t.jsxs("svg",{viewBox:"0 0 28 28",fill:"none",width:"28",height:"28","aria-hidden":"true",children:[t.jsx("path",{d:"M14 3L4 7v7c0 6.627 4.477 12.5 10 14.5C19.523 26.5 24 20.627 24 14V7L14 3z",stroke:"rgba(255,255,255,.75)",strokeWidth:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M9 14l3.5 3.5L19 11",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});function qd({settingKey:o,accountEmail:i,onClose:c,onSynced:p}){const[d,m]=x.useState(!1),[g,h]=x.useState(""),v=Qd[o];if(!v)return null;const w=v.deepLink?Qe+v.deepLink:Qe,j=async()=>{m(!0),h("");try{await Mn("sync_config"),p==null||p(),c==null||c()}catch{h("Sync failed. Please try again or refresh the page.")}finally{m(!1)}};return t.jsx("div",{className:"cn-portal-bridge-overlay",role:"dialog","aria-modal":"true","aria-label":`Configure ${v.title} in web app`,children:t.jsxs("div",{className:"cn-portal-bridge",children:[t.jsxs("div",{className:"cn-portal-bridge__header",children:[t.jsx("div",{className:"cn-portal-bridge__header-icon",children:t.jsx(Yd,{})}),t.jsxs("div",{children:[t.jsxs("div",{className:"cn-portal-bridge__header-title",children:[v.title," is configured in your web account"]}),t.jsx("div",{className:"cn-portal-bridge__header-sub",children:"Takes about 60 seconds"})]})]}),t.jsxs("div",{className:"cn-portal-bridge__body",children:[t.jsx("p",{className:"cn-portal-bridge__summary",children:v.summary}),i&&t.jsxs("div",{className:"cn-portal-bridge__context",children:[t.jsx("div",{className:"cn-portal-bridge__context-dot"}),t.jsxs("div",{className:"cn-portal-bridge__context-text",children:["Sign in with ",t.jsx("strong",{children:i})," to access this setting."]})]}),t.jsxs("div",{className:"cn-portal-bridge__steps",children:[t.jsxs("div",{className:"cn-portal-bridge__step",children:[t.jsx("div",{className:"cn-portal-bridge__step-num",children:"1"}),t.jsxs("div",{className:"cn-portal-bridge__step-body",children:[t.jsx("div",{className:"cn-portal-bridge__step-title",children:"Open your web account"}),t.jsx("div",{className:"cn-portal-bridge__step-desc",children:"Opens in a new tab."})]})]}),t.jsxs("div",{className:"cn-portal-bridge__step",children:[t.jsx("div",{className:"cn-portal-bridge__step-num",children:"2"}),t.jsxs("div",{className:"cn-portal-bridge__step-body",children:[t.jsx("div",{className:"cn-portal-bridge__step-title",children:"Navigate to the setting"}),t.jsx("div",{className:"cn-portal-bridge__step-desc",children:v.navPath.join(" → ")})]})]}),t.jsxs("div",{className:"cn-portal-bridge__step",children:[t.jsx("div",{className:"cn-portal-bridge__step-num",children:"3"}),t.jsxs("div",{className:"cn-portal-bridge__step-body",children:[t.jsx("div",{className:"cn-portal-bridge__step-title",children:"Make the change"}),t.jsx("div",{className:"cn-portal-bridge__step-desc",children:v.action})]})]})]}),g&&t.jsx("div",{className:"cn-portal-bridge__error",children:g}),t.jsxs("div",{className:"cn-portal-bridge__actions",children:[t.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"cn-portal-bridge__btn cn-portal-bridge__btn--primary",children:"Open web app →"}),t.jsx("button",{type:"button",className:"cn-portal-bridge__btn cn-portal-bridge__btn--secondary",onClick:j,disabled:d,children:d?"Checking…":"I've made the change"})]})]}),t.jsx("div",{className:"cn-portal-bridge__dismiss",children:t.jsx("button",{type:"button",onClick:c,className:"cn-portal-bridge__dismiss-btn",children:"Not now"})})]})})}const Zd=[{key:"app_blocking",wpKey:"app_blocking",label:"Autoblocking",desc:"Scripts wait for visitor consent before firing",valueType:"toggle",requiredFor:[],activeLaws:[],activeValue:!0},{key:"onScroll",label:"Accept on scroll",desc:"Consent granted automatically if visitor scrolls",valueType:"bool-inverted",requiredFor:["gdpr","ukpecr","lgpd","popia"],activeLaws:["gdpr","ukpecr","lgpd","popia"],activeValue:!1},{key:"onClick",label:"Accept on click",desc:"Consent granted automatically on any page click",valueType:"bool-inverted",requiredFor:["gdpr","ukpecr","lgpd","popia"],activeLaws:["gdpr","ukpecr","lgpd","popia"],activeValue:!1},{key:"onClose",label:"Accept on close",desc:"Consent granted automatically if banner is closed",valueType:"bool-inverted",requiredFor:["gdpr","ukpecr","popia"],activeLaws:["gdpr","ukpecr","popia"],activeValue:!1,portalOnly:!0},{key:"refuse_opt",wpKey:"refuse_opt",label:"Refuse button",desc:"Display a button allowing visitors to decline tracking",valueType:"bool",requiredFor:["gdpr","ukpecr","lgpd","pipeda","popia"],activeLaws:["gdpr","ukpecr","lgpd","pipeda","popia"],activeValue:!0},{key:"revokeConsent",label:"Revoke consent",desc:"Floating widget allowing visitors to change preferences",valueType:"bool",requiredFor:[],activeLaws:["gdpr","ccpa","otherus","ukpecr","lgpd","pipeda","popia"],activeValue:!0},{key:"gpcSupportMode",label:"GPC support",desc:"Honor browser-level opt-out signals automatically",valueType:"bool",requiredFor:[],activeLaws:["ccpa","otherus"],activeValue:!0,portalOnly:!0,globalNote:"Required for all connected sites (CCPA/CPRA mandate)"},{key:"consentExpiry",label:"Consent expiry",desc:"How long before visitors are prompted again",valueType:"expiry-array",requiredFor:["gdpr","ukpecr"],activeLaws:["gdpr","ukpecr"]},{key:"uiBlocking",label:"Cookie wall",desc:"Block access to site content until consent is given",valueType:"bool-inverted",requiredFor:["gdpr"],activeLaws:["gdpr"],activeValue:!1,portalOnly:!0}],Bn={shield:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M11 3L4 6v5c0 4 3.5 7 7 8 3.5-1 7-4 7-8V6L11 3z",stroke:o,strokeWidth:"1.5",strokeLinejoin:"round"}),t.jsx("polyline",{points:"8,11 10,13 14,9",stroke:o,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),scroll:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"4",y:"3",width:"14",height:"16",rx:"3",stroke:o,strokeWidth:"1.5"}),t.jsx("polyline",{points:"9,13 11,16 13,13",stroke:o,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("line",{x1:"11",y1:"9",x2:"11",y2:"16",stroke:o,strokeWidth:"1.2",strokeLinecap:"round"})]}),click:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M8.5 10.5V5.5a1.5 1.5 0 013 0v5",stroke:o,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8.5V5a1.5 1.5 0 013 0V10",stroke:o,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M14.5 8a1.5 1.5 0 013 0v4c0 3.314-2.686 6-6 6h-1a5 5 0 01-5-5v-2.5a1.5 1.5 0 013 0",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),close:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"3",width:"16",height:"16",rx:"3",stroke:o,strokeWidth:"1.5"}),t.jsx("line",{x1:"8",y1:"8",x2:"14",y2:"14",stroke:o,strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("line",{x1:"14",y1:"8",x2:"8",y2:"14",stroke:o,strokeWidth:"1.4",strokeLinecap:"round"})]}),refuse:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"7",width:"16",height:"8",rx:"3",stroke:o,strokeWidth:"1.5"}),t.jsx("line",{x1:"7",y1:"11",x2:"15",y2:"11",stroke:o,strokeWidth:"1.3",strokeLinecap:"round"})]}),revoke:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M4 8h7a6 6 0 110 12H6",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("polyline",{points:"4,4 4,8 8,8",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),gpc:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M8 10V5a1.5 1.5 0 013 0v5",stroke:o,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8V4.5a1.5 1.5 0 013 0V9",stroke:o,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M14 7.5a1.5 1.5 0 013 0V12c0 3.314-2.686 6-6 6h-1a5 5 0 01-5-5v-2a1.5 1.5 0 013 0",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),clock:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("circle",{cx:"11",cy:"11",r:"9",stroke:o,strokeWidth:"1.5"}),t.jsx("polyline",{points:"11,6 11,11 14,14",stroke:o,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),wall:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"5",width:"18",height:"12",rx:"2",stroke:o,strokeWidth:"1.5"}),t.jsx("line",{x1:"2",y1:"9",x2:"20",y2:"9",stroke:o,strokeWidth:"1.2"}),t.jsx("line",{x1:"11",y1:"9",x2:"11",y2:"17",stroke:o,strokeWidth:"1.2"})]})},Xd={app_blocking:Bn.shield,onScroll:Bn.scroll,onClick:Bn.click,onClose:Bn.close,refuse_opt:Bn.refuse,revokeConsent:Bn.revoke,gpcSupportMode:Bn.gpc,consentExpiry:Bn.clock,uiBlocking:Bn.wall};function Jd(o,i,c,p){return o.key==="gpcSupportMode"&&!c&&p.some(m=>m==="ccpa"||m==="otherus")||o.key==="uiBlocking"&&!c&&p.includes("gdpr")?"crit":c?"ok":"warn"}function e2({setting:o,activeLawKeys:i,wpOptions:c,configData:p,onOpenPortal:d,update:m,thresholdLocked:g,onUpgrade:h}){const{key:v,label:w,desc:j,valueType:S,activeLaws:L,portalOnly:D,wpKey:T}=o,b=L.filter(W=>i.includes(W)),k=T||v,E=T?c:p;let M,A;const H=o.key==="app_blocking"&&g;if(S==="bool"){const W=E[k],Y=k==="app_blocking"&&W===void 0?!0:!!W;M=Y?"On":"Off",A=Y===o.activeValue}else if(S==="bool-inverted"){const W=!!E[k];M=W?"On":"Off",A=W===o.activeValue}else if(S==="toggle"){const W=E[k]??!0;M=H?t.jsx("span",{style:{color:"var(--cn-warn-icon)",fontWeight:500},children:"Paused"}):t.jsxs("label",{className:"cn-toggle-row__label",style:{cursor:"pointer",margin:0,justifyContent:"flex-start"},children:[t.jsx("input",{type:"checkbox",className:"cn-toggle-row__input",checked:W,onChange:Y=>m&&m(k,Y.target.checked),style:{marginRight:"6px"}}),W?"On":"Off"]}),A=H?!1:W===o.activeValue}else if(S==="expiry-array"){const W=Array.isArray(E[k])?E[k]:[30,182,365],Y=Math.max(...W);M=W.map(z=>z>=365?`${Math.round(z/365)}y`:z>=30?`${Math.round(z/30)}mo`:`${z}d`).join(" / "),A=Y<=365}const $=Jd(o,M,A,i),V=`var(--cn-${$}-icon)`,Z=Xd[v]||null;return t.jsxs("div",{className:`cn-card${$==="crit"?" cn-card--crit":""}`,children:[t.jsxs("div",{className:"cn-card__top",children:[t.jsx("div",{className:"cn-card__icon",children:Z&&t.jsx(Z,{color:V})}),t.jsx("div",{className:`cn-card__dot cn-card__dot--${$}`})]}),t.jsx("div",{className:`cn-card__main cn-card__main--${$}`,children:M}),t.jsx("div",{className:"cn-card__sub",children:w}),j&&t.jsx("div",{className:"cn-card__desc",style:{marginTop:4,fontSize:"var(--cn-text-sm)",color:"var(--cn-muted)"},children:j}),t.jsx("div",{className:"cn-card__pills",children:b.map(W=>t.jsx("span",{className:`cn-card__pill cn-card__pill--${$}`,children:Ms[W]||W.toUpperCase()},W))}),t.jsx("div",{className:"cn-card__foot",children:D&&t.jsx("button",{type:"button",onClick:()=>d==null?void 0:d(o.key),children:"Manage in web app →"})}),H&&t.jsxs("div",{className:"cn-card__threshold-banner",style:{marginTop:8,padding:"8px 10px",background:"var(--cn-warn-bg, #fef3cd)",borderRadius:6,fontSize:"var(--cn-text-sm)"},children:["Monthly visit limit reached ","—"," autoblocking is paused until your cycle resets."," ",t.jsx("button",{type:"button",className:"cn-card__threshold-upgrade",style:{background:"none",border:"none",color:"var(--cn-link)",cursor:"pointer",padding:0,font:"inherit",textDecoration:"underline"},onClick:h,children:"Upgrade →"})]})]})}function n2({wpOptions:o,update:i,save:c,onOpenPricingModal:p}){var Z,W;const{dashboard:d,refetchDashboard:m}=vt(),{config:g,refetchConfig:h}=At(),v=(Z=d==null?void 0:d.analytics)==null?void 0:Z.cycleUsage,w=(v==null?void 0:v.visits)||0,j=(v==null?void 0:v.threshold)||0,S=j>0&&w>=j,L=x.useRef(!1),D=x.useRef(null),T=x.useRef(o==null?void 0:o.app_blocking);x.useEffect(()=>{const Y=o==null?void 0:o.app_blocking;if(Y!==T.current)return T.current=Y,L.current||(L.current=!0),L.current&&c&&(clearTimeout(D.current),D.current=setTimeout(()=>c(),300)),()=>clearTimeout(D.current)},[o==null?void 0:o.app_blocking,c]);const b=((W=d==null?void 0:d.appConfig)==null?void 0:W.regulations)||{},k=Object.entries(b).filter(([,Y])=>Y).map(([Y])=>Y),E=(d==null?void 0:d.accountEmail)||"",M=(g==null?void 0:g.config)||{},[A,H]=x.useState(null),$=k.length>0,V=Zd.filter(Y=>Y.requiredFor.length===0?!0:Y.requiredFor.some(z=>k.includes(z)));return t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"cn-compliance-behavior",className:"cn-compliance-behavior",children:[t.jsx("div",{className:"cn-card-grid cn-card-grid--auto",children:V.map(Y=>t.jsx(e2,{setting:Y,activeLawKeys:k,wpOptions:o,configData:M,onOpenPortal:H,update:i,thresholdLocked:S,onUpgrade:p},Y.key))}),t.jsxs("div",{className:"cn-compliance-behavior__footer",children:[$?"These settings were automatically configured based on your selected laws. ":"Select laws to see recommendations tied to your jurisdictions. ",t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noreferrer",className:"cn-form-readonly__link",children:$?"Configure in Admin Portal →":"Select laws in Admin Portal →"})]})]}),A&&t.jsx(qd,{settingKey:A,accountEmail:E,onClose:()=>H(null),onSynced:()=>{m(),h(),H(null)}})]})}const t2=((Ai=window.cnReactData)==null?void 0:Ai.ruleParams)||[],r2=((Mi=window.cnReactData)==null?void 0:Mi.ruleOperators)||[];function l2({rule:o,onChange:i,onRemove:c}){const[p,d]=x.useState([]),[m,g]=x.useState(!1),[h,v]=x.useState(!1),w=x.useCallback(async S=>{if(!S){d([]);return}g(!0);try{const L=await Ou(S),D=(L==null?void 0:L.values)||[];D.length>0&&D[0].group?v(!0):v(!1),d(D)}catch{d([])}finally{g(!1)}},[]);x.useEffect(()=>{w(o.param)},[o.param,w]);const j=S=>{i({...o,param:S,value:""})};return t.jsxs("div",{className:"cn-rule-row",children:[t.jsxs("select",{className:"cn-rule-row__param",value:o.param,onChange:S=>j(S.target.value),children:[t.jsx("option",{value:"",children:"-- Select --"}),t2.map(S=>t.jsx("option",{value:S.value,children:S.label},S.value))]}),t.jsx("select",{className:"cn-rule-row__operator",value:o.operator,onChange:S=>i({...o,operator:S.target.value}),children:r2.map(S=>t.jsx("option",{value:S.value,children:S.label},S.value))}),t.jsxs("select",{className:"cn-rule-row__value",value:o.value,onChange:S=>i({...o,value:S.target.value}),disabled:m,children:[t.jsx("option",{value:"",children:m?"Loading…":"-- Select --"}),h?p.map(S=>t.jsx("optgroup",{label:S.group,children:S.items.map(L=>t.jsx("option",{value:L.value,children:L.label},L.value))},S.group)):p.map(S=>t.jsx("option",{value:S.value,children:S.label},S.value))]}),t.jsx("button",{type:"button",className:"cn-rule-row__remove",onClick:c,title:"Remove rule",children:"×"})]})}function s2({group:o,groupIndex:i,onChange:c,onRemove:p}){const d=(h,v)=>{const w=[...o];w[h]=v,c(w)},m=h=>{if(o.length===1){p();return}c(o.filter((v,w)=>w!==h))},g=()=>{c([...o,{param:"",operator:"equal",value:""}])};return t.jsxs("div",{className:"cn-rule-group",children:[i>0&&t.jsx("div",{className:"cn-rule-group__or",children:"OR"}),t.jsxs("div",{className:"cn-rule-group__card",children:[o.map((h,v)=>t.jsxs("div",{children:[v>0&&t.jsx("div",{className:"cn-rule-group__and",children:"AND"}),t.jsx(l2,{rule:h,onChange:w=>d(v,w),onRemove:()=>m(v)})]},v)),t.jsx("button",{type:"button",className:"cn-rule-group__add-rule",onClick:g,children:"+ Add rule"})]})]})}function a2({rules:o,onChange:i}){const c=!o||Array.isArray(o)&&o.length===0?[]:Array.isArray(o)?o.map(w=>Array.isArray(w)?w.map(j=>({param:j.param||"",operator:j.operator||"equal",value:j.value||""})):Object.values(w).map(j=>({param:j.param||"",operator:j.operator||"equal",value:j.value||""}))):Object.values(o).map(w=>Object.values(w).map(j=>({param:j.param||"",operator:j.operator||"equal",value:j.value||""}))),[p,d]=x.useState(c),m=w=>{d(w),i(w)},g=(w,j)=>{const S=[...p];S[w]=j,m(S)},h=w=>{m(p.filter((j,S)=>S!==w))},v=()=>{m([...p,[{param:"",operator:"equal",value:""}]])};return t.jsxs("div",{className:"cn-rule-builder",children:[p.length===0&&t.jsx("p",{className:"cn-rule-builder__empty",children:"No rules configured. Add a rule group to control where the banner appears."}),p.map((w,j)=>t.jsx(s2,{group:w,groupIndex:j,onChange:S=>g(j,S),onRemove:()=>h(j)},j)),t.jsx("button",{type:"button",className:"cn-rule-builder__add-group",onClick:v,children:"+ Add rule group"})]})}const gi=[{value:"hour",label:"An hour"},{value:"day",label:"1 day"},{value:"week",label:"1 week"},{value:"month",label:"1 month"},{value:"3months",label:"3 months"},{value:"6months",label:"6 months"},{value:"year",label:"1 year"},{value:"infinity",label:"Infinity"}];function dn({label:o,checked:i,onChange:c,description:p}){const d=`cn-toggle-${o.toLowerCase().replace(/\s+/g,"-")}`;return t.jsxs("div",{className:"cn-toggle-row",children:[t.jsxs("label",{className:"cn-toggle-row__label",htmlFor:d,children:[t.jsx("input",{id:d,type:"checkbox",className:"cn-toggle-row__input",checked:i,onChange:m=>c(m.target.checked)}),t.jsx("span",{className:"cn-toggle-row__text",children:o})]}),p&&t.jsx("div",{className:"cn-toggle-row__desc",children:p})]})}function yr({label:o,name:i,value:c,options:p,onChange:d}){return t.jsxs("div",{className:"cn-radio-group",children:[o&&t.jsx("div",{className:"cn-radio-group__label",children:o}),t.jsx("div",{className:"cn-radio-group__options",children:p.map(m=>t.jsxs("label",{className:"cn-radio-group__option",children:[t.jsx("input",{type:"radio",name:i,value:m.value,checked:c===m.value,onChange:()=>d(m.value)}),t.jsx("span",{children:m.label})]},m.value))})]})}function vi({addNotice:o,options:i,update:c,updateNested:p,save:d,loading:m,saved:g,error:h,onOpenConsentPanel:v}){var k,E,M,A,H,$,V,Z,W,Y;const w=((k=window.cnReactData)==null?void 0:k.wpPages)||[],{isConnected:j}=Ue(),[S,L]=x.useState(!1),[D,T]=x.useState("head"),b=async()=>{var de,_e,ie,J;if(await d()){if(j){const se={};(de=i.colors)!=null&&de.bar&&(se.bannerColor=i.colors.bar),(_e=i.colors)!=null&&_e.text&&(se.textColor=i.colors.text),(ie=i.colors)!=null&&ie.button&&(se.primaryColor=i.colors.button),i.position&&(se.position=i.position),i.hide_effect&&(se.animation=i.hide_effect),((J=i.colors)==null?void 0:J.bar_opacity)!==void 0&&(se.bannerOpacity=(i.colors.bar_opacity??100)/100);const he={};if(i.revoke_cookies!==void 0&&(he.revokeConsent=i.revoke_cookies),i.revoke_cookies_opt&&(he.revokeMethod=i.revoke_cookies_opt),i.on_scroll!==void 0&&(he.onScroll=i.on_scroll),i.on_scroll_offset!==void 0&&(he.onScrollOffset=i.on_scroll_offset),i.on_click!==void 0&&(he.onClick=i.on_click),Object.keys(se).length||Object.keys(he).length){try{await ul(se,he),o&&o("Settings saved and published to your live site.","success")}catch{o&&o("Settings saved locally. Live banner sync failed—your live site was not updated. Please try again.","warning")}return}}o&&o("Settings saved successfully.","success")}};return t.jsxs("div",{className:"cn-plugin-settings",children:[!j&&t.jsxs(t.Fragment,{children:[t.jsxs(_t,{title:"Consent Behavior",defaultOpen:!0,children:[t.jsx(dn,{label:"Enable refuse button",checked:!!i.refuse_opt,onChange:z=>c("refuse_opt",z),description:"Allow visitors to refuse cookie consent"}),i.refuse_opt&&t.jsx(Ne,{label:"Refuse button text",value:i.refuse_text||"",onChange:z=>c("refuse_text",z),placeholder:"No"}),t.jsx(dn,{label:"Enable revoke consent",checked:!!i.revoke_cookies,onChange:z=>c("revoke_cookies",z),description:"Allow visitors to revoke their consent after accepting"}),i.revoke_cookies&&t.jsxs(t.Fragment,{children:[t.jsx(yr,{label:"Revoke method",name:"revoke_cookies_opt",value:i.revoke_cookies_opt||"automatic",options:[{value:"automatic",label:"Automatic"},{value:"manual",label:"Manual"}],onChange:z=>c("revoke_cookies_opt",z)}),t.jsx(Ne,{label:"Revoke button text",value:i.revoke_text||"",onChange:z=>c("revoke_text",z),placeholder:"Revoke consent"}),t.jsx(Ne,{label:"Revoke message",type:"textarea",value:i.revoke_message_text||"",onChange:z=>c("revoke_message_text",z)})]}),t.jsx(dn,{label:"Accept on scroll",checked:!!i.on_scroll,onChange:z=>c("on_scroll",z),description:"Automatically accept consent when the user scrolls"}),i.on_scroll&&t.jsx(Ne,{label:"Scroll distance (px)",type:"number",value:i.on_scroll_offset||100,onChange:z=>c("on_scroll_offset",parseInt(z,10)||0)}),t.jsx(dn,{label:"Accept on click",checked:!!i.on_click,onChange:z=>c("on_click",z),description:"Automatically accept consent on any page click"}),t.jsx(dn,{label:"Reload page on accept",checked:!!i.redirection,onChange:z=>c("redirection",z),description:"Reload the page after the visitor accepts consent"})]}),t.jsxs(_t,{title:"Cookie Expiry",defaultOpen:!0,children:[t.jsx(Ne,{label:"Accepted expiry",type:"select",value:i.time||"month",onChange:z=>c("time",z),options:gi}),t.jsx(Ne,{label:"Rejected expiry",type:"select",value:i.time_rejected||"month",onChange:z=>c("time_rejected",z),options:gi})]})]}),t.jsxs(_t,{title:"Privacy Policy",defaultOpen:!0,children:[t.jsx(dn,{label:"Enable privacy policy link",checked:!!i.see_more,onChange:z=>c("see_more",z)}),i.see_more&&t.jsxs(t.Fragment,{children:[t.jsx(Ne,{label:"Link text",value:((E=i.see_more_opt)==null?void 0:E.text)||"",onChange:z=>p("see_more_opt","text",z),placeholder:"Privacy policy"}),t.jsx(yr,{label:"Link type",name:"see_more_link_type",value:((M=i.see_more_opt)==null?void 0:M.link_type)||"page",options:[{value:"page",label:"Page link"},{value:"custom",label:"Custom link"}],onChange:z=>p("see_more_opt","link_type",z)}),((A=i.see_more_opt)==null?void 0:A.link_type)==="page"&&w.length>0&&t.jsx(Ne,{label:"Select page",type:"select",value:((H=i.see_more_opt)==null?void 0:H.id)||"",onChange:z=>p("see_more_opt","id",parseInt(z,10)||0),options:[{value:"",label:"— Select a page —"},...w.map(z=>({value:String(z.id),label:z.title}))]}),(($=i.see_more_opt)==null?void 0:$.link_type)==="custom"&&t.jsx(Ne,{label:"Custom URL",value:((V=i.see_more_opt)==null?void 0:V.link)||"",onChange:z=>p("see_more_opt","link",z),placeholder:"https://"}),t.jsx(dn,{label:"Sync with WordPress Privacy Page",checked:!!((Z=i.see_more_opt)!=null&&Z.sync),onChange:z=>p("see_more_opt","sync",z)}),t.jsx(yr,{label:"Open link in",name:"link_target",value:i.link_target||"_blank",options:[{value:"_blank",label:"New tab"},{value:"_self",label:"Same tab"}],onChange:z=>c("link_target",z)}),t.jsx(yr,{label:"Link position",name:"link_position",value:i.link_position||"banner",options:[{value:"banner",label:"Banner"},{value:"message",label:"Message"}],onChange:z=>c("link_position",z)})]})]}),t.jsxs(_t,{title:"Custom Scripts",defaultOpen:!0,children:[t.jsxs("div",{className:"cn-pill-toggle",children:[t.jsx("button",{type:"button",className:`cn-pill-toggle__btn${D==="head"?" cn-pill-toggle__btn--active":""}`,onClick:()=>T("head"),children:"Head"}),t.jsx("button",{type:"button",className:`cn-pill-toggle__btn${D==="body"?" cn-pill-toggle__btn--active":""}`,onClick:()=>T("body"),children:"Body"})]}),D==="head"?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"cn-pill-toggle-desc",children:"Code to be added in your site header, before the closing head tag."}),t.jsx(Ne,{type:"textarea",value:i.refuse_code_head||"",onChange:z=>c("refuse_code_head",z),placeholder:"",rows:6})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"cn-pill-toggle-desc",children:"Code to be added in your site footer, before the closing body tag."}),t.jsx(Ne,{type:"textarea",value:i.refuse_code||"",onChange:z=>c("refuse_code",z),placeholder:"",rows:6})]}),t.jsx("p",{className:"cn-pill-toggle-note",children:"Enter non-functional cookies JavaScript code (e.g. Google Analytics) to be used after the visitor consent is given."})]}),t.jsxs(_t,{title:"Display & Animation",defaultOpen:!0,children:[t.jsxs("div",{className:"cn-form-field",children:[t.jsxs("label",{className:"cn-form-field__label",htmlFor:"cn-bar-opacity",children:["Bar opacity: ",((W=i.colors)==null?void 0:W.bar_opacity)??100,"%"]}),t.jsx("input",{id:"cn-bar-opacity",type:"range",className:"cn-opacity-slider",min:50,max:100,value:((Y=i.colors)==null?void 0:Y.bar_opacity)??100,onChange:z=>p("colors","bar_opacity",parseInt(z.target.value,10))})]}),t.jsx(Ne,{label:"Custom button CSS class",value:i.css_class||"",onChange:z=>c("css_class",z),placeholder:"e.g. my-custom-btn",helper:"Add custom CSS classes to the accept button"})]}),t.jsxs(_t,{title:"Technical Settings",defaultOpen:!0,children:[j&&t.jsxs(t.Fragment,{children:[t.jsx(dn,{label:"Bot detection",checked:!!(i.bot_detection??!0),onChange:z=>c("bot_detection",z),description:"Automatically detect and handle bots/crawlers"}),t.jsx(dn,{label:"AMP support",checked:!!i.amp_support,onChange:z=>c("amp_support",z),description:"Enable AMP-compatible consent notice"}),t.jsx(dn,{label:"Caching compatibility",checked:!!(i.caching_compatibility??!0),onChange:z=>c("caching_compatibility",z),description:"Improve compatibility with caching plugins"}),t.jsx(dn,{label:"Debug mode",checked:!!i.debug_mode,onChange:z=>c("debug_mode",z),description:"Enable debug logging for troubleshooting"}),t.jsx(Ne,{label:"Excluded script handles",type:"textarea",value:Array.isArray(i.excluded_handles)?i.excluded_handles.join(` `):i.excluded_handles||"",onChange:z=>c("excluded_handles",z),placeholder:`elementor-frontend my-analytics-init`,rows:4,helper:"Enter WordPress script handles to exclude from autoblocking, one per line. These scripts will be marked as Essential (Category 1) and never blocked."})]}),!j&&t.jsx(yr,{label:"Script placement",name:"script_placement",value:i.script_placement||"header",options:[{value:"header",label:"Header"},{value:"footer",label:"Footer"}],onChange:z=>c("script_placement",z)}),t.jsx(dn,{label:"Conditional display",checked:!!i.conditional_active,onChange:z=>c("conditional_active",z),description:"Show or hide the banner on specific pages"}),i.conditional_active&&t.jsxs(t.Fragment,{children:[t.jsx(Ne,{label:"Display rule",type:"select",value:i.conditional_display||"hide",onChange:z=>c("conditional_display",z),options:[{value:"hide",label:"Hide the banner"},{value:"show",label:"Show the banner"}]}),t.jsx(a2,{rules:i.conditional_rules||[],onChange:z=>c("conditional_rules",z)})]}),t.jsx(dn,{label:"Delete data on deactivation",checked:!!i.deactivation_delete,onChange:z=>c("deactivation_delete",z),description:"Remove all plugin data when the plugin is deactivated"}),j&&t.jsxs("div",{className:"cn-purge-cache",children:[t.jsx($e,{variant:"secondary",onClick:async()=>{L(!0);try{await Vu(),o&&o("Cache purged successfully.","success")}catch(z){o&&o(z.message||"Purge failed. Please try again.","error")}finally{L(!1)}},disabled:S,children:S?"Purging…":"Purge Cache"}),t.jsx("p",{className:"cn-purge-cache__desc",children:"Click to refresh the app configuration cache."})]})]}),t.jsxs("div",{className:"cn-plugin-settings__actions",children:[t.jsx($e,{variant:"primary",onClick:b,disabled:m,children:m?"Saving…":j?"Save WordPress Settings":"Save Settings"}),g&&t.jsxs("span",{className:"cn-plugin-settings__saved",children:["✓"," Saved"]}),h&&t.jsx("span",{className:"cn-plugin-settings__error",children:h})]})]})}function o2({onConnect:o}){return t.jsxs(t.Fragment,{children:[t.jsx(In,{title:"Domain Info",children:t.jsxs("div",{className:"cn-dom-rows",children:[t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Domain"}),t.jsx("span",{className:"cn-dom-row__v",children:window.location.hostname})]}),t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Status"}),t.jsxs("span",{className:"cn-dom-row__v",children:[t.jsx("span",{className:"cn-dot cn-dot--gray"})," Not Connected"]})]})]})}),t.jsxs(In,{title:"Why Connect?",children:[t.jsxs("ul",{className:"cn-benefit-list",children:[t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Automated script blocking before visitor consent"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Cookie categorization across your entire site"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Consent proof collection for legal audit trails"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Visitor analytics and consent rate reporting"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Google Consent Mode v2, Facebook & Microsoft signals"})]})]}),t.jsx("div",{className:"cn-connect-cta",children:t.jsx("button",{className:"cn-button cn-button--primary cn-connect-cta__btn",onClick:o,type:"button",children:"Connect Your Site →"})})]})]})}function i2({addNotice:o,onOpenPricingModal:i}){return t.jsxs(t.Fragment,{children:[t.jsx(dl,{addNotice:o}),t.jsx(ri,{onOpenPricingModal:i})]})}function c2({addNotice:o,onOpenWelcomeModal:i,onTabChange:c,appliedTemplateKey:p,onTemplateApplied:d,onOpenPricingModal:m}){var V,Z;const{isBasic:g}=Ue(),h=Ed(),v=p||"",w=W=>{d&&d(W)},{showBannerWizard:j,bannerClosing:S,bannerScrollTrigger:L,closeBannerWizard:D,showLawWizard:T,lawClosing:b,lawScrollTrigger:k,closeLawWizard:E,showConsentPanel:M,consentClosing:A,consentScrollTrigger:H,closeConsentPanel:$}=mr();return g?t.jsxs(yt,{sidebar:t.jsx(o2,{onConnect:i}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Plugin Settings"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Connect your site to enable consent management features."})]}),t.jsx(zd,{options:h.options,update:h.update,save:h.save,loading:h.loading,saved:h.saved,error:h.error}),t.jsx(Gd,{options:h.options,update:h.update,updateNested:h.updateNested}),t.jsx(Kd,{onConnect:i}),t.jsx(vi,{addNotice:o,options:h.options,update:h.update,updateNested:h.updateNested,save:h.save,loading:h.loading,saved:h.saved,error:h.error})]}):t.jsxs(yt,{sidebar:t.jsx(i2,{addNotice:o,onOpenPricingModal:m}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Settings"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Manage your banner template, laws, consent modes, and languages."})]}),t.jsx(ni,{appliedTemplateKey:v,onTemplateApplied:w,siteUrl:((V=window.cnReactData)==null?void 0:V.siteUrl)||"",onOpenTrackers:null,autoblockingEnabled:!!((Z=h.options)!=null&&Z.app_blocking),onTabChange:c}),j&&t.jsx(ii,{onClose:D,onTemplateApplied:W=>{w(W),D()},scrollTrigger:L,isClosing:S,appliedTemplateKey:v}),T&&t.jsx(ci,{onClose:E,onSave:E,scrollTrigger:k,isClosing:b}),M&&t.jsx(di,{isOpen:!0,onClose:$,addNotice:o,onOpenPricingModal:m,onApplied:()=>{},scrollTrigger:H,isClosing:A}),t.jsx(n2,{wpOptions:h.options,update:h.update,save:h.save,onOpenPricingModal:m}),t.jsx(vi,{addNotice:o,options:h.options,update:h.update,updateNested:h.updateNested,save:h.save,loading:h.loading,saved:h.saved,error:h.error})]})}function yi({title:o,action:i,onAction:c}){return t.jsxs("div",{className:"cn-section-header",children:[t.jsx("h2",{children:o}),i&&t.jsx("button",{type:"button",className:"cn-section-header__action",onClick:c,children:i})]})}function u2({onActivate:o}){return t.jsxs("div",{className:"cn-empty-hero",children:[t.jsxs("svg",{className:"cn-empty-hero__icon",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("circle",{cx:"40",cy:"40",r:"40",fill:"#f0faf7"}),t.jsx("rect",{x:"22",y:"16",width:"36",height:"46",rx:"4",fill:"#fff",stroke:"#e0e4e8",strokeWidth:"1.5"}),t.jsx("rect",{x:"29",y:"26",width:"22",height:"2.5",rx:"1.25",fill:"#e0e4e8"}),t.jsx("rect",{x:"29",y:"33",width:"18",height:"2.5",rx:"1.25",fill:"#e0e4e8"}),t.jsx("rect",{x:"29",y:"40",width:"20",height:"2.5",rx:"1.25",fill:"#e0e4e8"}),t.jsx("circle",{cx:"54",cy:"56",r:"14",fill:"#20c19e"}),t.jsx("path",{d:"M54 44.5l-7 3.5v5.25c0 4.594 2.975 8.881 7 9.931 4.025-1.05 7-5.337 7-9.931V48l-7-3.5z",fill:"white",fillOpacity:"0.9"}),t.jsx("path",{d:"M52.1 56.45l-2.1-2.1.96-.96 1.14 1.14 3.06-3.06.96.96-4.02 4.02z",fill:"#20c19e"})]}),t.jsx("div",{className:"cn-empty-hero__heading",children:"No Compliance Records"}),t.jsx("div",{className:"cn-empty-hero__sub",children:"Connect to Cookie Compliance to start collecting consent proofs, audit logs, and compliance evidence."}),t.jsx($e,{variant:"primary",onClick:o,children:"Activate Protection"}),t.jsx("div",{className:"cn-empty-hero__footnote",children:"Connect your site · Free · Takes 60 seconds"})]})}function _i({breakdown:o,loading:i}){const c=o&&o.total>0,p=(o==null?void 0:o.levelLabels)||{},d=p.level3||"Accept",m=p.level2||"Custom",g=p.level1||"Reject",h=c?[{value:o.total.toLocaleString(),label:"Total Consents"},{value:`${o.acceptRate}%`,label:d},{value:`${o.customRate}%`,label:m},{value:`${o.rejectRate}%`,label:g}]:[{value:i?"…":"—",label:"Total Consents"},{value:i?"…":"—",label:d},{value:i?"…":"—",label:m},{value:i?"…":"—",label:g}];return t.jsx("div",{className:"cn-consent-stats",children:h.map(v=>t.jsxs("div",{className:"cn-consent-stat",children:[t.jsx("div",{className:"cn-consent-stat__value",children:v.value}),t.jsx("div",{className:"cn-consent-stat__label",children:v.label})]},v.label))})}function d2({columns:o,rows:i,expandable:c=!1,renderExpanded:p,pageSize:d=20,currentPage:m=1,totalPages:g=1,onPageChange:h,onSort:v,sortColumn:w,sortDirection:j="asc",emptyMessage:S="No data available"}){const[L,D]=x.useState(new Set),T=E=>{c&&D(M=>{const A=new Set(M);return A.has(E)?A.delete(E):A.add(E),A})},b=E=>{if(!E.sortable||!v)return;const M=w===E.key&&j==="asc"?"desc":"asc";v(E.key,M)},k=E=>E.sortable?w!==E.key?t.jsx("span",{className:"cn-data-table__sort",children:t.jsx(Wd,{size:14})}):t.jsx("span",{className:"cn-data-table__sort cn-data-table__sort--active",children:j==="asc"?"↑":"↓"}):null;return t.jsxs("div",{className:"cn-data-table",children:[t.jsxs("table",{className:"cn-data-table__table",children:[t.jsx("thead",{children:t.jsx("tr",{className:"cn-data-table__header",children:o.map(E=>t.jsxs("th",{className:`cn-data-table__th${E.sortable?" cn-data-table__th--sortable":""}`,onClick:()=>b(E),children:[E.label,k(E)]},E.key))})}),t.jsxs("tbody",{children:[(!i||i.length===0)&&t.jsx("tr",{children:t.jsx("td",{className:"cn-data-table__td cn-data-table__empty",colSpan:o.length,children:S})}),i==null?void 0:i.map((E,M)=>t.jsxs(t.Fragment,{children:[t.jsx("tr",{className:`cn-data-table__row${c?" cn-data-table__row--expandable":""}${L.has(M)?" cn-data-table__row--expanded":""}`,onClick:()=>T(M),children:o.map(A=>t.jsx("td",{className:"cn-data-table__td",children:E[A.key]??"—"},A.key))},M),c&&L.has(M)&&p&&t.jsx("tr",{className:"cn-data-table__expanded-row",children:t.jsx("td",{colSpan:o.length,className:"cn-data-table__expanded",children:p(E,M)})},`${M}-expanded`)]}))]})]}),g>1&&t.jsxs("div",{className:"cn-data-table__pagination",children:[t.jsx("button",{type:"button",className:"cn-data-table__page-btn",disabled:m<=1,onClick:()=>h==null?void 0:h(m-1),"aria-label":"Previous page",children:"«"}),t.jsxs("span",{className:"cn-data-table__page-info",children:["Page ",m," of ",g]}),t.jsx("button",{type:"button",className:"cn-data-table__page-btn",disabled:m>=g,onClick:()=>h==null?void 0:h(m+1),"aria-label":"Next page",children:"»"})]})]})}function xi({startDate:o,endDate:i,onChange:c,maxRange:p,disabled:d}){const m=v=>{const w=v.target.value;let j=i;if(p&&j){const S=new Date(w),L=new Date(j);if(Math.ceil((L-S)/(1e3*60*60*24))>p){const T=new Date(S);T.setDate(T.getDate()+p),j=T.toISOString().split("T")[0]}}c==null||c({startDate:w,endDate:j})},g=v=>{const w=v.target.value;let j=o;if(p&&j){const S=new Date(j),L=new Date(w);if(Math.ceil((L-S)/(1e3*60*60*24))>p){const T=new Date(L);T.setDate(T.getDate()-p),j=T.toISOString().split("T")[0]}}c==null||c({startDate:j,endDate:w})},h=new Date().toISOString().split("T")[0];return t.jsxs("div",{className:"cn-date-range",children:[t.jsx("input",{type:"date",className:"cn-form-field__input cn-date-range__input",value:o||"",onChange:m,max:i||h,disabled:d}),t.jsx("span",{className:"cn-date-range__separator",children:"to"}),t.jsx("input",{type:"date",className:"cn-form-field__input cn-date-range__input",value:i||"",onChange:g,min:o||void 0,max:h,disabled:d}),p&&t.jsxs("span",{className:"cn-date-range__limit",children:[p,"-day max"]})]})}const p2={3:"accept",2:"custom",1:"reject"},f2={Essential:"essential",Analytics:"analytics",Marketing:"marketing",Functional:"functional"},h2=[{key:"id",label:"Consent ID",sortable:!0},{key:"level",label:"Consent Level",sortable:!0},{key:"categories",label:"Categories",sortable:!1},{key:"date",label:"Date / Time",sortable:!0},{key:"ip",label:"IP Address",sortable:!1}];function m2(o){return{id:t.jsx("span",{className:"cn-consent-id",children:o.id}),level:t.jsx("span",{className:`cn-level-pill cn-level-pill--${p2[o.levelNum]||"custom"}`,children:o.level}),categories:t.jsx("div",{className:"cn-cat-tags",children:(o.categories||[]).map(i=>t.jsx("span",{className:`cn-cat-tag cn-cat-tag--${f2[i]||"essential"}`,children:i},i))}),date:o.date,ip:t.jsxs("span",{className:"cn-ip-masked",children:[o.ip," ",t.jsx(Hs,{size:14,style:{verticalAlign:"middle"}})]})}}function ji({maxRange:o,onStatsUpdate:i}){const c=new Date().toISOString().split("T")[0],p=new Date(Date.now()-10080*60*1e3).toISOString().split("T")[0],[d,m]=x.useState({startDate:p,endDate:c}),[g,h]=x.useState(1),[v,w]=x.useState("date"),[j,S]=x.useState("desc"),[L,D]=x.useState([]),[T,b]=x.useState(0),[k,E]=x.useState(0),[M,A]=x.useState(!0),[H,$]=x.useState(null),V=x.useRef(""),Z=x.useCallback(async()=>{A(!0),$(null);const z=`${d.startDate}|${d.endDate}`;try{const de=await Mu({page:g,start_date:d.startDate,end_date:d.endDate,sort:v,order:j});D((de.logs||[]).map(m2)),b(de.totalPages||0),E(de.total||0),i&&z!==V.current&&(V.current=z,i(de.consentBreakdown||null))}catch(de){$(de.message||"Failed to load consent logs."),i&&z!==V.current&&(V.current=z,i(null))}finally{A(!1)}},[g,d,v,j]);x.useEffect(()=>{Z()},[Z]);const W=z=>{m(z),h(1)},Y=(z,de)=>{w(z),S(de),h(1)};return t.jsxs("div",{className:"cn-consent-log-table",children:[t.jsxs("div",{className:"cn-consent-log-table__controls",children:[t.jsx(xi,{startDate:d.startDate,endDate:d.endDate,onChange:W,maxRange:o}),k>0&&t.jsxs("span",{className:"cn-consent-log-table__count",children:[k.toLocaleString()," record",k!==1?"s":""]})]}),H&&t.jsx("div",{className:"cn-notice cn-notice--error",children:H}),t.jsx(d2,{columns:h2,rows:L,pageSize:10,currentPage:g,totalPages:T,onPageChange:h,onSort:Y,sortColumn:v,sortDirection:j,loading:M,emptyMessage:"No consent records found for selected date range."})]})}const wi={pass:{icon:t.jsx(hi,{size:16}),cls:"pass"},warn:{icon:t.jsx(mi,{size:16}),cls:"warn"},fail:{icon:"○",cls:"fail"},na:{icon:"–",cls:"na"}};function g2({items:o}){return t.jsx("div",{className:"cn-evidence-panel",children:o.map((i,c)=>{const p=wi[i.status]||wi.na;return t.jsxs("div",{className:"cn-evidence-item",children:[t.jsx("span",{className:`cn-evidence-item__icon cn-evidence-item__icon--${p.cls}`,children:p.icon}),t.jsx("span",{className:"cn-evidence-item__text",children:i.text})]},c)})})}function ki({proLocked:o=!1,onOpenPricingModal:i}){const[c,p]=x.useState("gdpr"),{dashboard:d}=vt(),{config:m}=At(),g=(m==null?void 0:m.blocking)||{},h=g.providers||[],v=h.length>0,w=h.filter(A=>!A.CategoryID).length,j=v&&w===0,S=v&&w>0,L=!!g.gpc_support,D=(d==null?void 0:d.consentCount)??0,T=[{status:"pass",text:"Consent banner active on all pages"},{status:j?"pass":S?"warn":"na",text:j?"Cookie categories clearly defined":S?"Cookie categories — some trackers still uncategorized":"Cookie categories — run a script scan to assess"},{status:"na",text:"Data retention policy — verify in web app"},{status:"na",text:"DPO contact details — verify in web app"}],b=[{status:L?"pass":"warn",text:L?"Do Not Sell / Share signal honored (GPC active)":"Do Not Sell / Share signal — enable GPC in Consent Modes"},{status:"pass",text:"Opt-out mechanism functional"},{status:"na",text:"Privacy policy link in banner — verify in web app"},{status:"na",text:"Consumer rights request handling — verify in web app"}],k=[{status:j?"pass":S?"fail":"na",text:j?"Prior consent obtained before non-essential cookies":S?"Prior consent — uncategorized trackers firing without consent":"Prior consent — run a script scan to assess"},{status:D>0?"pass":"warn",text:D>0?"Consent withdrawal mechanism available and in use":"Consent withdrawal — no consent records yet; verify banner is live"},{status:"na",text:"Cookie lifetime disclosure — verify in web app"},{status:"na",text:"Legitimate interest assessment — verify in web app"}],E=[{key:"gdpr",label:"GDPR",items:T,locked:!1},{key:"ccpa",label:"CCPA",items:b,locked:!1},{key:"eprivacy",label:"ePrivacy",items:k,locked:o}],M=E.find(A=>A.key===c);return t.jsxs("div",{className:"cn-compliance-evidence",children:[t.jsx("nav",{className:"cn-evidence-tabs",children:E.map(A=>t.jsxs("button",{type:"button",className:`cn-evidence-tab${c===A.key?" cn-evidence-tab--active":""}`,onClick:()=>p(A.key),children:[A.label,A.locked&&t.jsx(Fn,{})]},A.key))}),M!=null&&M.locked?t.jsx("div",{className:"cn-evidence-panel cn-evidence-panel--locked",children:t.jsxs("div",{className:"cn-evidence-lock",children:[t.jsx("span",{className:"cn-evidence-lock__icon",children:t.jsx(Hs,{size:24})}),t.jsx("p",{className:"cn-evidence-lock__msg",children:"ePrivacy compliance evidence is available on Pro. Upgrade to unlock."}),t.jsx("button",{type:"button",className:"cn-button cn-button--upgrade",onClick:()=>i&&i(),children:"Upgrade to Pro"})]})}):t.jsx(g2,{items:(M==null?void 0:M.items)||[]})]})}function v2({isPro:o=!1,onOpenPricingModal:i}){const c=new Date().toISOString().split("T")[0],p=new Date(Date.now()-720*60*60*1e3).toISOString().split("T")[0],[d,m]=x.useState({startDate:p,endDate:c}),{exportCsv:g,loading:h,error:v}=Dd(),w=()=>{g==null||g({start_date:d.startDate,end_date:d.endDate})};return o?t.jsxs("div",{className:"cn-export-section",children:[t.jsx("div",{className:"cn-export-section__label",children:"Export Consent Log"}),t.jsx(xi,{startDate:d.startDate,endDate:d.endDate,onChange:m}),t.jsx($e,{variant:"primary",onClick:w,disabled:h,children:h?"Exporting…":"Export CSV"}),v&&t.jsx("div",{className:"cn-export-section__error",children:v})]}):t.jsx(Xo,{requiredTier:"pro",message:"Upgrade to Pro to export consent logs as CSV.",onCta:i,children:t.jsxs("div",{className:"cn-export-section cn-export-section--locked",children:[t.jsx("div",{className:"cn-export-section__label",children:"Export Consent Log"}),t.jsx($e,{variant:"outline",disabled:!0,children:"Export CSV"})]})})}function y2(){const o=[{id:"CID-7F2A9C",level:"Personalized",levelNum:3,date:"2026-02-26 14:37",ip:"192.168.x.x"},{id:"CID-4B1E3D",level:"Balanced",levelNum:2,date:"2026-02-26 13:58",ip:"10.0.x.x"},{id:"CID-9A0F12",level:"Private",levelNum:1,date:"2026-02-26 13:21",ip:"172.16.x.x"},{id:"CID-C3D8E5",level:"Personalized",levelNum:3,date:"2026-02-26 12:04",ip:"192.168.x.x"},{id:"CID-2E6B7A",level:"Balanced",levelNum:2,date:"2026-02-25 22:49",ip:"10.0.x.x"}],i=[{type:"banner",what:"Position changed to Bottom",when:"Feb 25, 14:03"},{type:"setting",what:"GDPR regulation enabled",when:"Feb 23, 09:41"},{type:"scan",what:"3 new scripts detected & categorized",when:"Feb 22, 16:18"},{type:"setting",what:"Google Consent Mode v2 activated",when:"Feb 20, 11:05"}],c={3:"accept",2:"custom",1:"reject"},p={banner:"Banner",setting:"Setting",scan:"Scan"};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"cn-blurred-teaser__section",children:[t.jsxs("div",{className:"cn-blurred-teaser__section-header",children:[t.jsx("span",{className:"cn-blurred-teaser__section-title",children:"Cookie Consent Log"}),t.jsx("span",{className:"cn-blurred-teaser__section-meta",children:"3,241 total records — showing 1–5"})]}),t.jsxs("table",{className:"cn-blurred-teaser__table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Consent ID"}),t.jsx("th",{children:"Consent Level"}),t.jsx("th",{children:"Date / Time"}),t.jsx("th",{children:"IP Address"})]})}),t.jsx("tbody",{children:o.map(d=>t.jsxs("tr",{children:[t.jsx("td",{children:t.jsx("span",{className:"cn-consent-id",children:d.id})}),t.jsx("td",{children:t.jsx("span",{className:`cn-level-pill cn-level-pill--${c[d.levelNum]}`,children:d.level})}),t.jsx("td",{children:d.date}),t.jsx("td",{children:t.jsx("span",{className:"cn-ip-masked",children:d.ip})})]},d.id))})]})]}),t.jsxs("div",{className:"cn-blurred-teaser__section",children:[t.jsxs("div",{className:"cn-blurred-teaser__section-header",children:[t.jsx("span",{className:"cn-blurred-teaser__section-title",children:"Config Change History"}),t.jsx("span",{className:"cn-blurred-teaser__section-meta",children:"Last 30 days"})]}),t.jsx("div",{className:"cn-blurred-teaser__timeline",children:i.map((d,m)=>t.jsxs("div",{className:"cn-blurred-teaser__tl-row",children:[t.jsx("div",{className:`cn-blurred-teaser__tl-dot cn-blurred-teaser__tl-dot--${d.type}`}),t.jsxs("div",{className:"cn-blurred-teaser__tl-text",children:[t.jsxs("div",{className:"cn-blurred-teaser__tl-what",children:[t.jsx("span",{className:`cn-change-badge cn-change-badge--${d.type}`,children:p[d.type]}),d.what]}),t.jsx("div",{className:"cn-blurred-teaser__tl-when",children:d.when})]})]},m))})]})]})}function _2(){return t.jsxs(t.Fragment,{children:[t.jsx(dl,{showPortalLink:!1}),t.jsx(In,{title:"Why Connect?",children:t.jsx("ul",{className:"cn-benefit-list",children:["Timestamped consent proofs for every visitor interaction","Searchable audit log for GDPR and CCPA regulators","Config change history — who changed what and when","Exportable compliance evidence in one click","Prove compliance if you ever face a regulatory inquiry"].map((o,i)=>t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-item__icon",children:t.jsx(hi,{size:16})}),t.jsx("span",{children:o})]},i))})})]})}function Ni({isPro:o,onOpenPricingModal:i,addNotice:c}){return t.jsxs(t.Fragment,{children:[t.jsx(dl,{addNotice:c}),t.jsxs(In,{title:"Data Retention",children:[t.jsxs("div",{className:`cn-retention-info${o?" cn-retention-info--pro":""}`,children:[t.jsxs("span",{className:"cn-retention-info__value",children:[o?"Unlimited":"7-day"," retention"]}),t.jsx("span",{className:"cn-retention-info__label",children:o?"Pro plan":"Free plan"})]}),!o&&t.jsx("p",{className:"cn-retention-info__note",children:"Upgrade to Pro for unlimited history."})]}),t.jsx(In,{title:"Export",children:t.jsx(v2,{isPro:o,onOpenPricingModal:i??void 0})})]})}function x2({addNotice:o,onOpenWelcomeModal:i,onOpenPricingModal:c}){const{isBasic:p,isFree:d}=Ue();if(p)return t.jsxs(yt,{sidebar:t.jsx(_2,{}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Audit Trail"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Consent logs, compliance evidence, and configuration history."})]}),t.jsx(u2,{onActivate:()=>i&&i()}),t.jsxs("div",{className:"cn-blurred-teaser",children:[t.jsx("div",{className:"cn-blurred-teaser__blur",children:t.jsx(y2,{})}),t.jsxs("div",{className:"cn-blurred-teaser__overlay",children:[t.jsx("span",{className:"cn-blurred-teaser__overlay-icon",children:t.jsx(fi,{size:24})}),t.jsx("div",{className:"cn-blurred-teaser__overlay-label",children:"Full Compliance Audit Trail"}),t.jsx("div",{className:"cn-blurred-teaser__overlay-sub",children:"Consent logs, config timeline, compliance evidence & more"}),t.jsx($e,{variant:"primary",onClick:()=>i&&i(),children:"Activate Protection"})]})]})]});const[m,g]=x.useState(null),[h,v]=x.useState(!0),w=j=>{g(j),v(!1)};return d?t.jsxs(yt,{sidebar:t.jsx(Ni,{isPro:!1,onOpenPricingModal:c,addNotice:o}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Audit Trail"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Consent logs and compliance evidence for your site."})]}),t.jsx(_i,{breakdown:m,loading:h}),t.jsx(ji,{maxRange:7,onStatsUpdate:w}),t.jsx(yi,{title:"Compliance Evidence"}),t.jsx(ki,{proLocked:!0,onOpenPricingModal:c})]}):t.jsxs(yt,{sidebar:t.jsx(Ni,{isPro:!0,onOpenPricingModal:c,addNotice:o}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Audit Trail"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Full consent log history, compliance evidence, and configuration timeline."})]}),t.jsx(_i,{breakdown:m,loading:h}),t.jsx(ji,{onStatsUpdate:w}),t.jsx(yi,{title:"Compliance Evidence"}),t.jsx(ki,{proLocked:!1,onOpenPricingModal:c})]})}var j2=$o();const Si={sm:480,md:720,lg:960},Ci='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function bi({isOpen:o,onClose:i,size:c="md",title:p,children:d}){const m=x.useRef(null),g=x.useRef(null),h=x.useCallback(S=>{if(S.key==="Escape"&&i){i();return}if(S.key==="Tab"&&m.current){const L=m.current.querySelectorAll(Ci);if(L.length===0){S.preventDefault();return}const D=L[0],T=L[L.length-1];S.shiftKey&&document.activeElement===D?(S.preventDefault(),T.focus()):!S.shiftKey&&document.activeElement===T&&(S.preventDefault(),D.focus())}},[i]);if(x.useEffect(()=>{let S;return o&&(g.current=document.activeElement,document.addEventListener("keydown",h),document.body.style.overflow="hidden",S=setTimeout(()=>{if(m.current){const L=m.current.querySelector(Ci);L?L.focus():m.current.focus()}},50)),()=>{clearTimeout(S),document.removeEventListener("keydown",h),document.body.style.overflow="",g.current&&typeof g.current.focus=="function"&&(g.current.focus(),g.current=null)}},[o,h]),!o)return null;const v=S=>{S.target===S.currentTarget&&i&&i()},w={position:"fixed",top:0,right:0,bottom:0,left:0,background:"rgba(0,0,0,0.6)",zIndex:1e5,display:"flex",alignItems:"center",justifyContent:"center",padding:"32px"},j=p?"cn-modal-title":void 0;return j2.createPortal(t.jsx("div",{className:"cn-modal-overlay",style:w,onClick:v,children:t.jsxs("div",{ref:m,className:`cn-modal cn-modal--${c}`,style:{maxWidth:Si[c]||Si.md},role:"dialog","aria-modal":"true","aria-labelledby":j,tabIndex:-1,children:[t.jsx("button",{className:"cn-modal__close",onClick:i,type:"button","aria-label":"Close",children:"×"}),p&&t.jsx("div",{className:"cn-modal__header",id:j,children:p}),t.jsx("div",{className:"cn-modal__content",children:d})]})}),document.body)}function w2({steps:o,currentStep:i=0,onStepClick:c}){return t.jsx("div",{className:"cn-step-dots",role:"group","aria-label":"Progress",children:o.map((p,d)=>{const m=dc(d):void 0,style:m&&c?{cursor:"pointer"}:void 0,tabIndex:m&&c?0:-1},d)})})}function k2({onBannerOnly:o,onProtect:i,onComply:c,onLearnMore:p}){var g;const m=(((g=window.cnReactData)==null?void 0:g.detectedPlugins)||[]).includes("google");return t.jsxs("div",{className:"cn-welcome-step cn-welcome-step--choose",children:[t.jsx("h1",{className:"cn-choose__heading",children:"Choose your protection level"}),m&&t.jsxs("div",{className:"cn-choose__google-notice",children:[t.jsx("strong",{children:"Google tools detected."})," ","Make sure Google Consent Mode is configured during setup."]}),t.jsxs("div",{className:"cn-protection-cards",children:[t.jsxs("div",{className:"cn-protection-card",children:[t.jsx("span",{className:"cn-protection-card__badge cn-protection-card__badge--risk",children:"Banner Only"}),t.jsx("div",{className:"cn-protection-card__icon cn-protection-card__icon--banner",children:t.jsx(Ud,{size:32})}),t.jsx("h4",{className:"cn-protection-card__title",children:"I just want a banner"}),t.jsx("p",{className:"cn-protection-card__subtitle",children:"Display-only notice, no compliance features"}),t.jsx("div",{className:"cn-protection-card__divider"}),t.jsx("div",{className:"cn-protection-card__price-label",children:"Banner Only"}),t.jsx("span",{className:"cn-protection-card__price-note cn-protection-card__price-note--danger",children:"Does not meet GDPR requirements"}),t.jsxs("ul",{className:"cn-protection-card__features",children:[t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Cookie notice banner"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Accept / Reject buttons"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Custom colors & text"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--excluded",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✗"}),"No consent records"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--excluded",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✗"}),"No script blocking"]})]}),t.jsx("div",{className:"cn-protection-card__footer",children:t.jsx("button",{type:"button",className:"cn-protection-card__btn cn-protection-card__btn--ghost",onClick:o,children:"Just the Banner"})})]}),t.jsxs("div",{className:"cn-protection-card cn-protection-card--recommended",children:[t.jsx("span",{className:"cn-protection-card__badge cn-protection-card__badge--rec",children:"Recommended"}),t.jsx("div",{className:"cn-protection-card__icon cn-protection-card__icon--protect",children:t.jsx(Ad,{size:32})}),t.jsx("h4",{className:"cn-protection-card__title",children:"For small sites"}),t.jsx("p",{className:"cn-protection-card__subtitle",children:"Essential compliance, no credit card required"}),t.jsx("div",{className:"cn-protection-card__divider"}),t.jsx("div",{className:"cn-protection-card__price-label",children:"Sign Up Free"}),t.jsx("span",{className:"cn-protection-card__price-note",children:"Up to 1,000 visits / month"}),t.jsxs("ul",{className:"cn-protection-card__features",children:[t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Best for sites without ads"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Google Consent Mode v2"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Global Privacy Control"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Tracker blocking"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Standard Support"]})]}),t.jsx("div",{className:"cn-protection-card__footer",children:t.jsx("button",{type:"button",className:"cn-protection-card__btn cn-protection-card__btn--primary",onClick:i,children:"Protect My Business"})})]}),t.jsxs("div",{className:"cn-protection-card",children:[t.jsx("span",{className:"cn-protection-card__badge cn-protection-card__badge--max",children:"Full Compliance"}),t.jsx("div",{className:"cn-protection-card__icon cn-protection-card__icon--comply",children:t.jsx(Bd,{size:32})}),t.jsx("h4",{className:"cn-protection-card__title",children:"Ensure full compliance"}),t.jsx("p",{className:"cn-protection-card__subtitle",children:"Full coverage for EU, US & growing businesses"}),t.jsx("div",{className:"cn-protection-card__divider"}),t.jsx("div",{className:"cn-protection-card__price-label",children:"$14.95/mo"}),t.jsx("span",{className:"cn-protection-card__price-note",children:"Unlimited visitors protected"}),t.jsxs("ul",{className:"cn-protection-card__features",children:[t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Best for sites with analytics"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Google, Facebook & Microsoft Consent Modes"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Geolocation rules — show right banner by country"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Lifetime audit trail & consent records"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Advanced autoblocking + script categorization"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Priority Support"]})]}),t.jsx("div",{className:"cn-protection-card__footer",children:t.jsx("button",{type:"button",className:"cn-protection-card__btn cn-protection-card__btn--secondary",onClick:c,children:"Ensure Full Compliance"})})]})]})]})}const N2=[{domains:1,monthly:14.95,yearly:149.5,perDomain:null,popular:!0},{domains:5,monthly:29.95,yearly:299.5,perDomain:5.99},{domains:10,monthly:49.95,yearly:499.5,perDomain:4.99}];function S2({onSelectPlan:o,onBack:i}){const[c,p]=x.useState("monthly");return t.jsxs("div",{className:"cn-welcome-step cn-welcome-step--pro-pricing",children:[t.jsx("button",{type:"button",className:"cn-pro-pricing__back cn-pro-pricing__back--top",onClick:i,children:"← Back to protection options"}),t.jsxs("div",{className:"cn-pro-pricing__hero",children:[t.jsx("h1",{className:"cn-pro-pricing__heading",children:"Compliance by Hu‑manity.co — Professional"}),t.jsx("p",{className:"cn-pro-pricing__sub",children:"Everything you need to protect your business from privacy regulations worldwide."})]}),t.jsxs("div",{className:"cn-pro-pricing__features-band",children:[t.jsx("span",{className:"cn-pro-pricing__features-label",children:"Everything in Free, plus:"}),t.jsxs("ul",{className:"cn-pro-pricing__features-list",children:[t.jsx("li",{children:"🌍 Geolocation rules — show the right banner by country"}),t.jsx("li",{children:"📊 Google Consent Mode v2 — required for Google Analytics & Ads"}),t.jsx("li",{children:"♾️ Unlimited visits & lifetime consent records"}),t.jsx("li",{children:"🔒 Advanced autoblocking & script categorization"})]})]}),t.jsxs("div",{className:"cn-pill-toggle",style:{margin:"0 auto 24px"},children:[t.jsx("button",{type:"button",className:`cn-pill-toggle__btn${c==="monthly"?" cn-pill-toggle__btn--active":""}`,onClick:()=>p("monthly"),children:"Monthly"}),t.jsxs("button",{type:"button",className:`cn-pill-toggle__btn${c==="yearly"?" cn-pill-toggle__btn--active":""}`,onClick:()=>p("yearly"),children:["Yearly ",t.jsx("span",{className:"cn-pill-toggle__badge",children:"Save 17%"})]})]}),t.jsx("div",{className:"cn-pro-pricing__cards",children:N2.map(d=>t.jsxs("div",{className:`cn-pro-pricing__card${d.popular?" cn-pro-pricing__card--popular":""}`,children:[d.popular&&t.jsx("span",{className:"cn-pro-pricing__card-badge",children:"Most Popular"}),t.jsx("div",{className:"cn-pro-pricing__card-domains",children:d.domains}),t.jsx("span",{className:"cn-pro-pricing__card-domains-label",children:d.domains===1?"Domain":"Domains"}),t.jsxs("div",{className:"cn-pro-pricing__card-price",children:[t.jsx("sup",{children:"$"}),c==="monthly"?d.monthly.toFixed(2):d.yearly.toFixed(2),t.jsxs("sub",{children:["/ ",c==="monthly"?"mo":"yr"]})]}),d.perDomain&&t.jsxs("span",{className:"cn-pro-pricing__card-per-domain",children:["$",d.perDomain.toFixed(2)," per domain"]}),t.jsx("button",{type:"button",className:`cn-pro-pricing__card-btn${d.popular?" cn-pro-pricing__card-btn--primary":""}`,onClick:()=>o(d.domains,c,d[c]),children:"Select Plan"})]},d.domains))}),t.jsx("p",{className:"cn-pro-pricing__guarantee",children:"✓ 30-day money-back guarantee on all plans"}),c==="yearly"&&t.jsx("p",{className:"cn-pro-pricing__billing-note",children:"Billed annually. Cancel anytime."}),t.jsxs("div",{className:"cn-pro-pricing__legal",children:[t.jsx("a",{href:"https://hu-manity.co/terms",target:"_blank",rel:"noreferrer",children:"Terms of Service"})," · ",t.jsx("a",{href:"https://hu-manity.co/privacy",target:"_blank",rel:"noreferrer",children:"Privacy Policy"})]}),t.jsx("div",{className:"cn-pro-pricing__maybe-later",children:t.jsx("button",{type:"button",className:"cn-pro-pricing__maybe-later-btn",onClick:i,children:"Maybe later — stay on free"})})]})}const C2=[{text:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Consent records"})," — no proof if a regulator asks"]})},{text:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Cookie autoblocking"})," — scripts fire before consent"]})},{text:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Audit trail"})," — no evidence if investigated"]})},{text:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Google Consent Mode"})," — EU ads may be flagged"]})}];function b2({onDismissToSettings:o,onBackToChoose:i}){const[c,p]=x.useState(!1);return t.jsx("div",{className:"cn-welcome-step cn-welcome-step--warning",children:t.jsxs("div",{className:"cn-warning-modal",children:[t.jsx("div",{className:"cn-warning-modal__icon",children:t.jsx(mi,{size:32})}),t.jsx("h3",{className:"cn-warning-modal__heading",children:"Are you sure?"}),t.jsxs("p",{className:"cn-warning-modal__text",children:["Without Cookie Compliance, ",t.jsx("strong",{children:"all liability falls on you."})]}),t.jsxs("div",{className:"cn-warning-modal__consequences",children:[t.jsx("h5",{children:"You won’t have:"}),t.jsx("ul",{children:C2.map((d,m)=>t.jsxs("li",{children:[t.jsx("span",{className:"cn-warning-modal__consequence-icon",children:"❌"}),t.jsx("span",{children:d.text})]},m))})]}),t.jsxs("label",{className:"cn-warning-modal__checkbox",children:[t.jsx("input",{type:"checkbox",checked:c,onChange:d=>p(d.target.checked)}),t.jsxs("span",{children:["I understand ",t.jsx("strong",{children:"all liability falls on me and my business."})]})]}),t.jsxs("div",{className:"cn-warning-modal__actions",children:[t.jsx("button",{type:"button",className:"cn-warning-modal__btn cn-warning-modal__btn--danger",disabled:!c,onClick:o,children:"Don’t protect my business"}),t.jsx("button",{type:"button",className:"cn-warning-modal__btn cn-warning-modal__btn--safe",onClick:i,children:"Protect my business →"})]})]})})}const Li=/^(?=.*[A-Z])(?=.*\d)[\w !"#$%&'()*+,\-./:;<=>?@[\]^\x60{|}~\\]{8,}$/;function L2({onComplete:o,onCompleteWithSubscriptions:i}){const[c,p]=x.useState("register"),[d,m]=x.useState(""),[g,h]=x.useState(""),[v,w]=x.useState(""),[j,S]=x.useState(!1),[L,D]=x.useState(!1),[T,b]=x.useState(null),k=window.cnReactData||{},E=H=>{p(H),b(null)},M=()=>{if(!d)return"Email is required.";if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d))return"Please enter a valid email address.";if(c==="register"){if(!g)return"Password is required.";if(!Li.test(g))return"Password must be 8+ characters with at least 1 capital letter and 1 number.";if(g!==v)return"Passwords do not match.";if(!j)return"Please accept the Terms of Service to continue."}else if(!g)return"Password is required.";return null},A=async H=>{H.preventDefault(),b(null);const $=M();if($){b($);return}D(!0);try{const V=c==="register"?k.registerNonce||"":k.loginNonce||"",W=await Mn(c,c==="register"?{email:d,pass:g,pass2:v,terms:"1",language:"en"}:{email:d,pass:g},V);if(W===!0||W===1)o();else if(W&&W.error)b(W.error);else if(W!=null&&W.app_has_subscription)o();else{const Y=Array.isArray(W==null?void 0:W.subscriptions)?W.subscriptions.filter(z=>parseInt(z.availablelicense,10)>0).sort((z,de)=>parseInt(de.availablelicense,10)-parseInt(z.availablelicense,10)):[];Y.length>0&&i?i(Y,W.fresh_nonce||""):o()}}catch(V){b(V.message||"Something went wrong. Please try again.")}finally{D(!1)}};return t.jsxs("div",{className:"cn-welcome-step cn-welcome-step--account",children:[t.jsx("h2",{className:"cn-account-heading",children:c==="register"?"Create your account":"Welcome back"}),t.jsx("p",{className:"cn-account-subtitle",children:c==="register"?"Takes 30 seconds. No credit card required.":"Log in to connect your existing Cookie Compliance account."}),t.jsxs("div",{className:"cn-pill-toggle",style:{minWidth:280,alignSelf:"center",marginBottom:24},children:[t.jsx("button",{type:"button",className:"cn-pill-toggle__btn"+(c==="register"?" cn-pill-toggle__btn--active":""),onClick:()=>E("register"),children:"Create Account"}),t.jsx("button",{type:"button",className:"cn-pill-toggle__btn"+(c==="login"?" cn-pill-toggle__btn--active":""),onClick:()=>E("login"),children:"Sign In"})]}),T==="email_exists"&&c==="register"?t.jsxs("div",{className:"cn-auth-form__error",children:["An account with this email already exists."," ",t.jsx("button",{type:"button",className:"cn-auth-form__switch-link",onClick:()=>{const H=d;E("login"),m(H)},children:"Sign in instead →"})]}):T?t.jsx("div",{className:"cn-auth-form__error",children:T}):null,c==="register"?t.jsxs(t.Fragment,{children:[t.jsxs("form",{className:"cn-auth-form",onSubmit:A,children:[t.jsx(Ne,{label:"Email address",type:"email",value:d,onChange:m,placeholder:"you@company.com",autoComplete:"email"}),t.jsx(Ne,{label:"Password",type:"password",value:g,onChange:h,placeholder:"Min. 8 characters, 1 capital, 1 number",autoComplete:"new-password"}),g&&!Li.test(g)&&t.jsx("p",{className:"cn-auth-form__field-hint",children:"Min. 8 characters, at least 1 capital letter and 1 number"}),t.jsx(Ne,{label:"Confirm Password",type:"password",value:v,onChange:w,placeholder:"Confirm password",autoComplete:"new-password"}),t.jsxs("label",{className:"cn-auth-form__terms",children:[t.jsx("input",{type:"checkbox",checked:j,onChange:H=>S(H.target.checked),required:!0})," ","I have read and agree to the"," ",t.jsx("a",{href:"https://hu-manity.co/terms",target:"_blank",rel:"noreferrer",children:"Terms of Service"})]}),t.jsx("div",{className:"cn-auth-form__actions",children:t.jsx("button",{type:"submit",className:"cn-button cn-button--primary cn-button--block",disabled:L||!j,children:L?"Creating account…":"Create Account"})})]}),t.jsx("div",{className:"cn-auth-or",children:t.jsx("span",{children:"OR"})}),t.jsxs("div",{className:"cn-auth-signin-teaser",children:[t.jsx("p",{className:"cn-auth-signin-teaser__heading",children:"Already have an account?"}),t.jsx("button",{type:"button",className:"cn-button cn-button--outline-primary",onClick:()=>E("login"),children:"Sign In"})]})]}):t.jsxs("form",{className:"cn-auth-form",onSubmit:A,autoComplete:"off",children:[t.jsxs("div",{"aria-hidden":"true",style:{position:"absolute",left:"-9999px",width:"1px",height:"1px",overflow:"hidden"},children:[t.jsx("input",{type:"text",name:"username",autoComplete:"username",tabIndex:-1,defaultValue:""}),t.jsx("input",{type:"password",name:"password",autoComplete:"current-password",tabIndex:-1,defaultValue:""})]}),t.jsx(Ne,{label:"Email address",type:"email",name:"cn-account-email",value:d,onChange:m,placeholder:"you@company.com",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1}),t.jsx(Ne,{label:"Password",type:"password",name:"cn-account-password",value:g,onChange:h,placeholder:"Your password",autoComplete:"new-password"}),t.jsx("div",{className:"cn-auth-form__forgot",children:t.jsx("a",{href:`${Qe}/forgot`,target:"_blank",rel:"noreferrer",children:"Forgot password?"})}),t.jsx("div",{className:"cn-auth-form__actions",children:t.jsx("button",{type:"submit",className:"cn-button cn-button--primary cn-button--block",disabled:L,children:L?"Logging in…":"Sign In"})})]})]})}async function P2({plan:o,paymentNonce:i,method:c,identifier:p}){const d=window.cnReactData||{},m=new FormData;m.append("action","cn_api_request"),m.append("nonce",d.welcomeNonce||""),m.append("request","payment"),m.append("cn_payment_nonce",d.paymentNonce||""),m.append("plan",o),m.append("payment_nonce",i),m.append("method",c),m.append("cn_payment_identifier",p||""),d.network&&m.append("cn_network","1");const g=await fetch(d.ajaxURL||"/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",body:m});if(!g.ok)throw new Error(`Payment request failed: ${g.status}`);return g.json()}const Pi="https://js.braintreegateway.com/web/3.71.0/js";function Ei(o){return new Promise((i,c)=>{if(document.querySelector(`script[src="${o}"]`)){i();return}const p=document.createElement("script");p.src=o,p.async=!0,p.onload=i,p.onerror=()=>c(new Error(`Failed to load: ${o}`)),document.head.appendChild(p)})}function Di({plan:o,onComplete:i,onBack:c=null,backLabel:p="Back"}){const[d,m]=x.useState("loading"),[g,h]=x.useState(null),[v,w]=x.useState(""),[j,S]=x.useState(!1),L=x.useRef(null);x.useEffect(()=>{let k=!1;async function E(){var $,V,Z,W;const M=["localhost","127.0.0.1"].includes(window.location.hostname);if(window.location.protocol!=="https:"&&!M){h("Secure payment requires HTTPS. Please contact your host."),m("error");return}try{await Ei(`${Pi}/client.min.js`),await Ei(`${Pi}/hosted-fields.min.js`)}catch{k||(h("Payment currently unavailable. Please try again later."),m("error"));return}if(typeof((V=($=window.braintree)==null?void 0:$.client)==null?void 0:V.create)!="function"||typeof((W=(Z=window.braintree)==null?void 0:Z.hostedFields)==null?void 0:W.create)!="function"){k||(h("Payment currently unavailable. Please try again later."),m("error"));return}let A;try{const Y=await Mn("get_bt_init_token");A=Y==null?void 0:Y.token}catch{A=null}if(!A){k||(h("Unable to initialize payment. Please refresh and try again."),m("error"));return}let H;try{H=await window.braintree.client.create({authorization:A})}catch{k||(h("Unable to initialize payment. Please refresh and try again."),m("error"));return}try{const Y=await window.braintree.hostedFields.create({client:H,styles:{input:{"font-size":"14px","font-family":"Lato, sans-serif",color:"#434f58"},"input.invalid":{color:"#e74c3c"},"input.valid":{color:"#434f58"}},fields:{number:{container:"#cn_card_number",placeholder:"•••• •••• •••• ••••"},expirationDate:{container:"#cn_expiration_date",placeholder:"MM / YY"},cvv:{container:"#cn_cvv",placeholder:"CVV"}}});if(k){Y.teardown();return}L.current=Y,Y.on("validityChange",()=>{const z=Y.getState(),de=Object.values(z.fields).every(_e=>_e.isValid);S(de)}),m("ready")}catch{k||(h("Unable to initialize payment. Please refresh and try again."),m("error"))}}return E(),()=>{k=!0,L.current&&(L.current.teardown(),L.current=null)}},[]);const D=async k=>{var E;if(k.preventDefault(),!(!L.current||d==="submitting")){m("submitting"),h(null);try{const M=await L.current.tokenize(),A=M.nonce,H=((E=M.details)==null?void 0:E.lastFour)||"",$=await P2({plan:o.planKey,paymentNonce:A,method:"credit_card",identifier:H});if($&&typeof $=="string"&&$.length>0)i();else{const V=($==null?void 0:$.error)||($==null?void 0:$.message)||"Payment failed. Please try again.";h(V),m("ready")}}catch(M){h(M.message||"Card error. Please check your details and try again."),m("ready")}}},T=(o==null?void 0:o.billing)==="yearly"?"Yearly":"Monthly",b=o?`${o.domains} Domain${o.domains>1?"s":""} — $${o.price.toFixed(2)} / ${T}`:"";return t.jsxs("div",{className:"cn-welcome-step cn-payment-step",children:[t.jsx("h2",{className:"cn-payment-step__heading",children:"Complete Your Order"}),o&&t.jsx("div",{className:"cn-payment-step__plan-pill",children:b}),g&&t.jsx("div",{className:"cn-payment-step__error",role:"alert",children:g}),d==="loading"&&!g&&t.jsx("p",{className:"cn-payment-step__loading",children:"Initializing secure payment form…"}),t.jsxs("form",{className:"cn-payment-step__form",onSubmit:D,style:{display:d==="loading"||d==="error"?"none":"block"},children:[t.jsxs("div",{className:"cn-payment-step__field",children:[t.jsx("label",{className:"cn-payment-step__label",htmlFor:"cn_card_name",children:"Cardholder Name"}),t.jsx("input",{id:"cn_card_name",type:"text",className:"cn-payment-step__input",value:v,onChange:k=>w(k.target.value),placeholder:"Name on card",autoComplete:"cc-name"})]}),t.jsxs("div",{className:"cn-payment-step__field",children:[t.jsx("label",{className:"cn-payment-step__label",children:"Card Number"}),t.jsx("div",{id:"cn_card_number",className:"cn-payment-step__hosted-field"})]}),t.jsxs("div",{className:"cn-payment-step__row",children:[t.jsxs("div",{className:"cn-payment-step__field",children:[t.jsx("label",{className:"cn-payment-step__label",children:"Expiry"}),t.jsx("div",{id:"cn_expiration_date",className:"cn-payment-step__hosted-field"})]}),t.jsxs("div",{className:"cn-payment-step__field",children:[t.jsx("label",{className:"cn-payment-step__label",children:"CVV"}),t.jsx("div",{id:"cn_cvv",className:"cn-payment-step__hosted-field"})]})]}),t.jsx("div",{className:"cn-payment-step__braintree-badge",children:"🔒 Secured by Braintree"}),t.jsx("button",{type:"submit",className:"cn-button cn-button--primary cn-button--block cn-payment-step__submit",disabled:d==="submitting"||!j||!v.trim(),children:d==="submitting"?"Processing…":"Complete Purchase"}),c&&t.jsx("button",{type:"button",className:"cn-button cn-button--outline-primary cn-button--block cn-payment-step__back",onClick:c,children:p}),t.jsx("p",{className:"cn-payment-step__guarantee",children:"🛡️ 30-day money-back guarantee"}),t.jsxs("p",{className:"cn-payment-step__legal",children:["By completing your purchase you agree to our",t.jsx("a",{href:"https://hu-manity.co/terms",target:"_blank",rel:"noopener noreferrer",className:"cn-link",children:"Terms of Service"}),"and",t.jsx("a",{href:"https://cookie-compliance.co/privacy-policy/",target:"_blank",rel:"noopener noreferrer",className:"cn-link",children:"Privacy Policy"}),"."]})]}),c&&(d==="loading"||d==="error")&&t.jsx("button",{type:"button",className:"cn-button cn-button--outline-primary cn-button--block cn-payment-step__back cn-payment-step__back--standalone",onClick:c,children:p})]})}function E2({subscriptions:o,selectedPlan:i,nonce:c,onSuccess:p,onPayInstead:d,onFreeInstead:m}){var b;const[g,h]=x.useState(((b=o[0])==null?void 0:b.subscriptionid)??null),[v,w]=x.useState(!1),[j,S]=x.useState(!1),[L,D]=x.useState(null);o.reduce((k,E)=>k+parseInt(E.availablelicense,10),0);const T=async()=>{if(!(!g||v||j)){w(!0),D(null);try{const k=await Mn("use_license",{subscriptionID:g},"",c);if(k&&k.error)D(k.error),w(!1);else{S(!0);const E=o.find(A=>A.subscriptionid===g),M=E?Math.max(0,parseInt(E.availablelicense,10)-1):null;p(M)}}catch(k){D(k.message||"Something went wrong. Please try again."),w(!1)}}};return i?t.jsxs("div",{className:"cn-welcome-step cn-license-select",children:[t.jsx("h2",{className:"cn-license-select__heading",children:"You have unused Pro licenses — do you want to use one for this domain?"}),t.jsx("p",{className:"cn-license-select__sub",children:"Your existing plan covers this site. We’ll connect it now — no payment needed."}),o.length===1?t.jsxs("div",{className:"cn-license-select__single-card",children:[t.jsx("span",{className:"cn-license-select__card-name",children:"Compliance Pro"}),t.jsxs("span",{className:"cn-license-select__card-slots",children:[parseInt(o[0].availablelicense,10)," ","domain",parseInt(o[0].availablelicense,10)!==1?"s":""," remaining"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"cn-license-select__choose-label",children:"You have multiple plans with available sites. Choose one to connect this site to:"}),t.jsx("div",{className:"cn-license-select__cards",role:"radiogroup",children:o.map(k=>{const E=parseInt(k.availablelicense,10);return t.jsxs("label",{className:"cn-license-select__card"+(g===k.subscriptionid?" cn-license-select__card--selected":""),children:[t.jsx("input",{type:"radio",name:"cn_subscription",value:k.subscriptionid,checked:g===k.subscriptionid,onChange:()=>h(k.subscriptionid),className:"cn-license-select__radio"}),t.jsxs("div",{className:"cn-license-select__card-body",children:[t.jsx("span",{className:"cn-license-select__card-name",children:"Compliance Pro"}),t.jsxs("span",{className:"cn-license-select__card-slots",children:[E," domain",E!==1?"s":""," remaining"]})]})]},k.subscriptionid)})})]}),L&&t.jsx("div",{className:"cn-license-select__error",role:"alert",children:L}),t.jsx("div",{className:"cn-license-select__actions",children:t.jsx("button",{type:"button",className:"cn-button cn-button--primary cn-button--block",onClick:T,disabled:v||j||!g,children:v?"Connecting…":o.length>1?"Connect This Site to Selected Plan":"Connect This Site"})}),d&&t.jsx("button",{type:"button",className:"cn-license-select__free-link",onClick:d,children:"Need a different plan? Purchase a new subscription instead"})]}):t.jsxs("div",{className:"cn-welcome-step cn-license-select cn-license-select--upsell",children:[t.jsx("div",{className:"cn-license-select__upsell-icon",children:"✅"}),t.jsx("h2",{className:"cn-license-select__heading",children:"Good news — your account already has a Pro plan with available slots. Activate it here, free."}),t.jsx("p",{className:"cn-license-select__sub",children:"You have unused Pro license slots available. Connect this site to your existing plan at no extra cost — or continue with the free version."}),o.length>1&&t.jsx("div",{className:"cn-license-select__cards",role:"radiogroup",children:o.map(k=>{const E=parseInt(k.availablelicense,10);return t.jsxs("label",{className:"cn-license-select__card"+(g===k.subscriptionid?" cn-license-select__card--selected":""),children:[t.jsx("input",{type:"radio",name:"cn_subscription",value:k.subscriptionid,checked:g===k.subscriptionid,onChange:()=>h(k.subscriptionid),className:"cn-license-select__radio"}),t.jsxs("div",{className:"cn-license-select__card-body",children:[t.jsx("span",{className:"cn-license-select__card-name",children:"Compliance Pro"}),t.jsxs("span",{className:"cn-license-select__card-slots",children:[E," domain",E!==1?"s":""," remaining"]})]})]},k.subscriptionid)})}),L&&t.jsx("div",{className:"cn-license-select__error",role:"alert",children:L}),t.jsx("div",{className:"cn-license-select__actions",children:t.jsx("button",{type:"button",className:"cn-button cn-button--primary cn-button--block",onClick:T,disabled:v||j||!g,children:v?"Activating…":"Upgrade to Pro — No Extra Charge"})}),t.jsx("button",{type:"button",className:"cn-license-select__free-link",onClick:m,children:"Continue with free version instead"})]})}const D2=[{label:"Choose Protection"},{label:"Confirm"},{label:"Create Account"}];function Ti(o){return o==="choose"||o==="pro-pricing"?0:o==="warning"?1:2}const T2=(o,i)=>"compliance_"+i+"_"+(o===1?"notrial":String(o));function R2({isOpen:o,onClose:i,onDismissToSettings:c}){const[p,d]=x.useState("choose"),[m,g]=x.useState(null),[h,v]=x.useState([]),[w,j]=x.useState(""),S=()=>{d("choose"),g(null),v([]),j(""),c?c():i&&i()},L=()=>{m?d("payment"):window.location.reload()},D=(k,E)=>{v(k),j(E),d("license-select")},T=k=>{const E=Ti(p);k{switch(p){case"choose":return t.jsx(k2,{onBannerOnly:()=>d("warning"),onProtect:()=>d("account"),onComply:()=>d("pro-pricing"),onLearnMore:()=>d("pro-pricing")});case"pro-pricing":return t.jsx(S2,{onSelectPlan:(k,E,M)=>{g({planKey:T2(k,E),domains:k,billing:E,price:M}),d("account")},onBack:()=>{g(null),d("choose")}});case"warning":return t.jsx(b2,{onDismissToSettings:S,onBackToChoose:()=>d("choose")});case"account":return t.jsx(L2,{onComplete:L,onCompleteWithSubscriptions:D});case"license-select":return t.jsx(E2,{subscriptions:h,selectedPlan:m,nonce:w,onSuccess:k=>{const E=new URL(window.location.href);E.searchParams.set("license_assigned","1"),k!=null&&E.searchParams.set("slots_remaining",String(k)),window.location.href=E.toString()},onPayInstead:m?()=>d("payment"):null,onFreeInstead:()=>window.location.reload()});case"payment":return t.jsx(Di,{plan:m,onComplete:()=>window.location.reload(),onBack:()=>d("account"),backLabel:"Back"});default:return null}};return t.jsxs(bi,{isOpen:o,onClose:S,size:"lg",children:[b(),t.jsx(w2,{steps:D2,currentStep:Ti(p),onStepClick:T})]})}const z2=[{icon:t.jsx(Hs,{size:24}),title:"Autoblocking",desc:"Scripts wait for visitor consent before firing."},{icon:t.jsx(Md,{size:24}),title:"Geographic Enforcement",desc:"Apply different rules by visitor location."},{icon:t.jsx(fi,{size:24}),title:"Consent Proofs",desc:"Exportable audit trail for every consent event."},{icon:t.jsx(Od,{size:24}),title:"Priority Support",desc:"Fast, expert help when you need it."},{icon:t.jsx(Id,{size:24}),title:"Advanced Analytics",desc:"Consent rates, geography, and trend data."},{icon:t.jsx(Fd,{size:24}),title:"Script Wizard",desc:"Register and manage third-party scripts easily."}],A2=[{domains:1,monthly:14.95,yearly:149.5,perDomain:null},{domains:5,monthly:29.95,yearly:299.5,perDomain:5.99,popular:!0,tagline:"Best for dev + staging + production"},{domains:10,monthly:49.95,yearly:499.5,perDomain:4.99,tagline:"For agencies & multi-site networks"}],M2=(o,i)=>"compliance_"+i+"_"+(o===1?"notrial":String(o));function I2({isOpen:o,onClose:i}){const[c,p]=x.useState("monthly"),[d,m]=x.useState(null),{isFree:g}=Ue(),h=()=>{m(null),i()};return t.jsx(bi,{isOpen:o,onClose:h,size:"lg",children:d?t.jsx("div",{className:"cn-welcome-step",children:t.jsx(Di,{plan:d,onComplete:()=>window.location.reload(),onBack:()=>m(null),backLabel:"Back to plans"})}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"cn-pricing-hero",children:[t.jsx("h2",{className:"cn-pricing-hero__heading",children:"Compliance by Hu‑manity.co — Professional"}),t.jsx("p",{className:"cn-pricing-hero__sub",children:"Everything you need to stay compliant, protect your visitors, and prove it."})]}),t.jsx("div",{className:"cn-benefit-grid",children:z2.map((v,w)=>t.jsxs("div",{className:"cn-benefit-card",children:[t.jsx("div",{className:"cn-benefit-card__icon",children:v.icon}),t.jsx("div",{className:"cn-benefit-card__title",children:v.title}),t.jsx("div",{className:"cn-benefit-card__desc",children:v.desc})]},w))}),t.jsxs("div",{className:"cn-pill-toggle",style:{margin:"0 auto 20px"},children:[t.jsx("button",{className:`cn-pill-toggle__btn${c==="monthly"?" cn-pill-toggle__btn--active":""}`,type:"button",onClick:()=>p("monthly"),children:"Monthly"}),t.jsxs("button",{className:`cn-pill-toggle__btn${c==="yearly"?" cn-pill-toggle__btn--active":""}`,type:"button",onClick:()=>p("yearly"),children:["Yearly",t.jsx("span",{className:"cn-pill-toggle__badge",children:"Save 17%"})]})]}),t.jsx("div",{className:"cn-pricing-cards",children:A2.map(v=>t.jsxs("div",{className:`cn-pricing-card${v.popular?" cn-pricing-card--popular":""}`,children:[v.popular&&t.jsx("div",{className:"cn-pricing-card__popular-badge",children:"Most Popular"}),t.jsx("div",{className:"cn-pricing-card__domains",children:v.domains}),t.jsx("div",{className:"cn-pricing-card__domains-label",children:v.domains===1?"domain":"domains"}),v.tagline&&t.jsx("div",{className:"cn-pricing-card__tagline",children:v.tagline}),t.jsxs("div",{className:"cn-pricing-card__price",children:[t.jsx("sup",{children:"$"}),c==="monthly"?v.monthly.toFixed(2):(v.yearly/12).toFixed(2),t.jsx("sub",{children:" / mo"})]}),t.jsxs("div",{className:"cn-pricing-card__billed-note",style:c==="monthly"?{visibility:"hidden"}:void 0,children:["$",v.yearly.toFixed(2)," billed annually"]}),t.jsx($e,{variant:v.popular?"primary":"outline",size:"md",style:{width:"100%"},onClick:()=>{if(g)m({planKey:M2(v.domains,c),domains:v.domains,billing:c,price:c==="monthly"?v.monthly:v.yearly});else{const w=window.cnReactData&&window.cnReactData.uiMode==="react";window.location.href=w?"?page=cookie-notice&cn_react_welcome=1":"?page=cookie-notice&welcome=1"}},children:g?"Select Plan":"Get Started"})]},v.domains))}),t.jsx("p",{className:"cn-pricing-footer__learn-more",children:t.jsx("a",{href:"https://cookie-compliance.co/pricing/",target:"_blank",rel:"noopener noreferrer",className:"cn-link",children:"Learn more about Pro plans →"})}),t.jsx("p",{className:"cn-pricing-footer__dismiss",children:t.jsx("button",{type:"button",className:"cn-link-btn",onClick:h,children:"Maybe later — stay on Free"})})]})})}function F2(){const o=!!(window.cnReactData||{}).devMode,{tier:i}=Ue(),c=new URLSearchParams(window.location.search),p=c.get("cn_tier")||i,d=parseInt(c.get("cn_usage")||"0",10),m=(window.cnReactData||{}).uiMode||"legacy",[g,h]=x.useState(d),[v,w]=x.useState(!1);if(!o)return null;function j(){window.confirm(`⚠️ Reset plugin to fresh-activation state? This clears: welcome flag, setup wizard flag, app_id, app_key, and subscription status.`)&&(w(!0),Wu().then(()=>{const b=new URL(window.location.href);b.searchParams.delete("cn_tier"),b.searchParams.delete("cn_usage"),window.location.href=b.toString()}).catch(b=>{alert("Reset failed: "+(b.message||"Unknown error")),w(!1)}))}function S(b,k=null){const E=new URLSearchParams(window.location.search);E.set("cn_tier",b),b==="free"&&k!==null?E.set("cn_usage",k):E.delete("cn_usage"),window.location.search=E.toString()}function L(b){const k=new URLSearchParams(window.location.search);k.set("ui_mode",b),b==="legacy"&&(k.delete("cn_tier"),k.delete("cn_usage")),window.location.search=k.toString()}const D=[{id:"basic",label:"Basic"},{id:"free",label:"Free"},{id:"pro",label:"Pro"}],T=[{id:"react",label:"React"},{id:"legacy",label:"Legacy"}];return t.jsxs("div",{className:"cn-dev-switcher",children:[t.jsxs("div",{className:"cn-dev-switcher__header",children:[t.jsx("span",{className:"cn-dev-switcher__icon",children:"🛠"}),t.jsx("span",{className:"cn-dev-switcher__title",children:"DEV MODE"})]}),t.jsx("div",{className:"cn-dev-switcher__label",children:"Account type"}),t.jsx("div",{className:"cn-dev-switcher__buttons",children:D.map(b=>t.jsx("button",{className:"cn-dev-switcher__btn"+(p===b.id?" cn-dev-switcher__btn--active":""),onClick:()=>S(b.id,b.id==="free"?g:null),children:b.label},b.id))}),t.jsx("div",{className:"cn-dev-switcher__label",children:"Admin UI"}),t.jsx("div",{className:"cn-dev-switcher__buttons",children:T.map(b=>t.jsx("button",{className:"cn-dev-switcher__btn"+(m===b.id?" cn-dev-switcher__btn--active":""),onClick:()=>L(b.id),children:b.label},b.id))}),p==="free"&&t.jsxs("div",{className:"cn-dev-switcher__usage",children:[t.jsxs("div",{className:"cn-dev-switcher__usage-row",children:[t.jsx("span",{className:"cn-dev-switcher__usage-label",children:"Usage"}),t.jsxs("span",{className:"cn-dev-switcher__usage-val",children:[g,"%"]})]}),t.jsx("input",{type:"range",min:"0",max:"100",value:g,className:"cn-dev-switcher__slider",onChange:b=>h(Number(b.target.value)),onMouseUp:b=>{b.stopPropagation(),S("free",g)},onTouchEnd:b=>{b.stopPropagation(),S("free",g)}})]}),t.jsx("div",{className:"cn-dev-switcher__divider"}),t.jsx("button",{className:"cn-dev-switcher__reset-btn",onClick:j,disabled:v,title:"Clears welcome flag, setup wizard, app connection & subscription status",children:v?"↺ Resetting…":"↺ Reset Plugin"})]})}class B2 extends x.Component{constructor(i){super(i),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(i,c){console.error("ErrorBoundary caught:",i,c)}render(){return this.state.hasError?t.jsxs("div",{className:"cn-error-boundary",children:[t.jsx("p",{className:"cn-error-boundary__message",children:"Something went wrong while loading this section."}),t.jsx("button",{type:"button",className:"button button-primary",onClick:()=>window.location.reload(),children:"Reload page"})]}):this.props.children}}function O2({onOpenPricingModal:o}){const{topBar:i,dismiss:c}=ti();if(i===null)return null;const d={critical:"crit",warning:"warning",info:"info"}[i.type]||"info";let m=null;return i.icon==="error"?m=t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"24",height:"24",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):i.icon==="warning"?m=t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"24",height:"24",children:[t.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),t.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),t.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}):i.icon==="info"&&(m=t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"24",height:"24",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})),t.jsxs("div",{className:`cn-alert cn-alert--${d}`,style:{marginBottom:24},children:[t.jsx("div",{className:"cn-alert__icon",children:m}),t.jsxs("div",{className:"cn-alert__content",children:[t.jsx("h3",{className:"cn-alert__title",children:i.title}),t.jsx("p",{className:"cn-alert__desc",children:i.description})]}),t.jsx("div",{className:"cn-alert__actions",children:t.jsx("button",{type:"button",className:"cn-button cn-button--upgrade",onClick:o,children:i.cta.label})}),i.dismissible&&t.jsx("button",{type:"button",className:"cn-alert__dismiss",onClick:()=>c(i.id),"aria-label":"Dismiss",children:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"18",height:"18",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const Gs=[{id:"protection",label:"Protection"},{id:"settings",label:"Settings"},{id:"audit-trail",label:"Audit Trail"}];function U2({dashboard:o,refetchDashboard:i,refetchConfig:c,notices:p,removeNotice:d,addNotice:m,activeTab:g,setActiveTab:h,appliedTemplateKey:v,handleTemplateApplied:w,showWelcomeModal:j,setShowWelcomeModal:S,showPricingModal:L,setShowPricingModal:D}){const{closeAllPanels:T}=mr(),b=x.useCallback(M=>{T(),h(M);const A=new URLSearchParams(window.location.search);A.delete("tab");const H=window.location.pathname+(A.toString()?"?"+A.toString():"")+"#"+M;window.history.replaceState({},"",H)},[T,h]),k=()=>{switch(g){case"protection":return t.jsx(bd,{addNotice:m,onOpenWelcomeModal:()=>S(!0),onOpenPricingModal:()=>D(!0),onTabChange:b,appliedTemplateKey:v,onTemplateApplied:w});case"settings":return t.jsx(c2,{addNotice:m,onOpenWelcomeModal:()=>S(!0),onTabChange:b,appliedTemplateKey:v,onTemplateApplied:w,onOpenPricingModal:()=>D(!0)});case"audit-trail":return t.jsx(x2,{addNotice:m,onOpenWelcomeModal:()=>S(!0),onOpenPricingModal:()=>D(!0)});default:return null}},E=x.useCallback(()=>{S(!1),b("settings"),Fu().catch(()=>{})},[b,S]);return t.jsxs("div",{className:"cn-admin-app",children:[t.jsx(F2,{}),p.map(M=>t.jsx(Pu,{type:M.type,dismissible:!0,onDismiss:()=>d(M.id),children:M.message},M.id)),t.jsx(Lu,{tabs:Gs,activeTab:g,onTabChange:b}),t.jsxs("div",{className:"cn-tab-content",children:[t.jsx(O2,{onOpenPricingModal:()=>D(!0)}),t.jsx(B2,{children:k()},g)]}),t.jsx(Du,{}),t.jsx(R2,{isOpen:j,onClose:()=>S(!1),onDismissToSettings:E}),t.jsx(I2,{isOpen:L,onClose:()=>D(!1)})]})}function $2(){var z,de,_e;const{data:o,refetch:i}=Ld(),{data:c,loading:p,refetch:d}=Pd(),[m,g]=x.useState([]),[h,v]=x.useState(null),w=Qu(((z=o==null?void 0:o.appConfig)==null?void 0:z.design)||((de=window.cnReactData)==null?void 0:de.bannerDesign)||null),j=h||w||"",S=x.useCallback(ie=>{v(ie)},[]),[L,D]=x.useState(()=>{var he;const ie=new URLSearchParams(window.location.search).get("tab");if(ie==="consent-logs")return"audit-trail";if(Gs.find(me=>me.id===ie))return ie;const J=window.location.hash.replace("#","");return Gs.find(me=>me.id===J)?J:!((he=window.cnReactData)!=null&&he.app_id)?"settings":"protection"}),{isBasic:T}=Ue(),b=x.useRef(Date.now()),k=x.useRef(null);x.useEffect(()=>{const ie=()=>{document.visibilityState==="visible"&&(Date.now()-b.current<1e4||(clearTimeout(k.current),k.current=setTimeout(()=>{i()},2e3)))};return document.addEventListener("visibilitychange",ie),()=>{document.removeEventListener("visibilitychange",ie),clearTimeout(k.current)}},[i]);const E=x.useRef(null);x.useEffect(()=>{var se;const ie=(se=o==null?void 0:o.appConfig)==null?void 0:se.design,J=JSON.stringify(ie||null);if(E.current===null){E.current=J;return}J!==E.current&&(E.current=J,v(null))},[(_e=o==null?void 0:o.appConfig)==null?void 0:_e.design]);const[M,A]=x.useState(()=>{const ie=new URLSearchParams(window.location.search),J=ie.get("cn_react_welcome")==="1";if(J){ie.delete("cn_react_welcome");const se=window.location.pathname+(ie.toString()?"?"+ie.toString():"")+window.location.hash;window.history.replaceState({},"",se)}return J}),[H,$]=x.useState(!1);x.useEffect(()=>{var se;if(!T)return;const ie=(se=window.cnReactData)==null?void 0:se.welcomeDismissedAt;if(!ie){A(!0);return}const J=Date.now()-720*60*60*1e3;new Date(ie).getTime(){const se=Date.now();g(he=>[...he,{id:se,message:ie,type:J}]),setTimeout(()=>g(he=>he.filter(me=>me.id!==se)),5e3)},[]),Z=x.useCallback(ie=>{g(J=>J.filter(se=>se.id!==ie))},[]),W=x.useCallback(()=>{i()},[i]),Y=x.useCallback(()=>{i(),d()},[i,d]);return t.jsx(Ho.Provider,{value:{dashboard:o,refetchDashboard:i,isLoadingDashboard:!o},children:t.jsx(Vo.Provider,{value:{config:c,isLoadingConfig:p,refetchConfig:d},children:t.jsx(Ru,{onLawSave:W,onConsentClose:Y,children:t.jsx(U2,{dashboard:o,refetchDashboard:i,refetchConfig:d,notices:m,removeNotice:Z,addNotice:V,activeTab:L,setActiveTab:D,appliedTemplateKey:j,handleTemplateApplied:S,showWelcomeModal:M,setShowWelcomeModal:A,showPricingModal:H,setShowPricingModal:$})})})})}const Ri=document.getElementById("cn-react-root");Ri&&bu.createRoot(Ri).render(t.jsx($2,{}))})();