Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-content
/
plugins
/
complianz-gdpr
/
settings
/
build
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[3078,9091,9758,1366,54],{99091:(e,t,n)=>{n.r(t),n.d(t,{UseCookieScanData:()=>o});var r=n(81621),a=n(9588);const o=(0,r.vt)(((e,t)=>({initialLoadCompleted:!1,setInitialLoadCompleted:t=>e({initialLoadCompleted:t}),iframeLoaded:!1,loading:!1,nextPage:!1,progress:0,cookies:[],lastLoadedIframe:"",setIframeLoaded:t=>e({iframeLoaded:t}),setLastLoadedIframe:t=>e((e=>({lastLoadedIframe:t}))),setProgress:t=>e({progress:t}),fetchProgress:()=>(e({loading:!0}),a.doAction("get_scan_progress",{}).then((t=>(e({initialLoadCompleted:!0,loading:!1,nextPage:t.next_page,progress:t.progress,cookies:t.cookies}),t))))})))},79758:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var r=n(86087),a=n(9588),o=n(4219),s=n(52043),c=n(56427),l=n(99091),i=n(32828);const d=(0,r.memo)((({type:e="action",style:t="tertiary",label:n,onClick:d,href:u="",target:m="",disabled:p,action:g,field:f,children:h})=>{if(!n&&!h)return null;const _=(f&&f.button_text?f.button_text:n)||h,{fetchFieldsData:b,showSavedSettingsNotice:v}=(0,o.default)(),{setInitialLoadCompleted:E,setProgress:y}=(0,l.UseCookieScanData)(),{setProgressLoaded:k}=(0,i.default)(),{selectedSubMenuItem:C}=(0,s.default)(),[w,N]=(0,r.useState)(!1),z=`button cmplz-button button--${t} button-${e}`,L=async e=>{await a.doAction(f.action,{}).then((e=>{e.success&&(b(C),"reset_settings"===e.id&&(E(!1),y(0),k(!1)),v(e.message))}))},P=f&&f.warn?f.warn:"";return"action"===e?(0,r.createElement)(r.Fragment,null,c.__experimentalConfirmDialog&&(0,r.createElement)(c.__experimentalConfirmDialog,{isOpen:w,onConfirm:async()=>{N(!1),await L()},onCancel:()=>{N(!1)}},P),(0,r.createElement)("button",{className:z,onClick:async t=>{if("action"!==e||!d)return"action"===e&&g?c.__experimentalConfirmDialog?void(f&&f.warn?N(!0):await L()):void await L():void(window.location.href=f.url);d(t)},disabled:p},_)):"link"===e?(0,r.createElement)("a",{className:z,href:u,target:m},_):void 0}))},81366:(e,t,n)=>{n.r(t),n.d(t,{default:()=>P});var r=n(86087),a=n(58168),o=n(51609),s=n(91071),c=n(62133),l=n(9957),i=n(81351),d=n(85357),u=n(31769),m=n(7971),p=n(12579);const g="Checkbox",[f,h]=(0,c.A)(g),[_,b]=f(g),v=(0,o.forwardRef)(((e,t)=>{const{__scopeCheckbox:n,name:r,checked:c,defaultChecked:d,required:u,disabled:m,value:g="on",onCheckedChange:f,...h}=e,[b,v]=(0,o.useState)(null),C=(0,s.s)(t,(e=>v(e))),w=(0,o.useRef)(!1),N=!b||Boolean(b.closest("form")),[z=!1,L]=(0,i.i)({prop:c,defaultProp:d,onChange:f}),P=(0,o.useRef)(z);return(0,o.useEffect)((()=>{const e=null==b?void 0:b.form;if(e){const t=()=>L(P.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[b,L]),(0,o.createElement)(_,{scope:n,state:z,disabled:m},(0,o.createElement)(p.sG.button,(0,a.A)({type:"button",role:"checkbox","aria-checked":y(z)?"mixed":z,"aria-required":u,"data-state":k(z),"data-disabled":m?"":void 0,disabled:m,value:g},h,{ref:C,onKeyDown:(0,l.m)(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:(0,l.m)(e.onClick,(e=>{L((e=>!!y(e)||!e)),N&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())}))})),N&&(0,o.createElement)(E,{control:b,bubbles:!w.current,name:r,value:g,checked:z,required:u,disabled:m,style:{transform:"translateX(-100%)"}}))})),E=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,c=(0,o.useRef)(null),l=(0,d.Z)(n),i=(0,u.X)(t);return(0,o.useEffect)((()=>{const e=c.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==n&&a){const t=new Event("click",{bubbles:r});e.indeterminate=y(n),a.call(e,!y(n)&&n),e.dispatchEvent(t)}}),[l,n,r]),(0,o.createElement)("input",(0,a.A)({type:"checkbox","aria-hidden":!0,defaultChecked:!y(n)&&n},s,{tabIndex:-1,ref:c,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function y(e){return"indeterminate"===e}function k(e){return y(e)?"indeterminate":e?"checked":"unchecked"}const C=v,w=(0,o.forwardRef)(((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,c=b("CheckboxIndicator",n);return(0,o.createElement)(m.C,{present:r||y(c.state)||!0===c.state},(0,o.createElement)(p.sG.span,(0,a.A)({"data-state":k(c.state),"data-disabled":c.disabled?"":void 0},s,{ref:t,style:{pointerEvents:"none",...e.style}})))}));var N=n(27723),z=n(45111),L=n(79758);const P=(0,r.memo)((({indeterminate:e,label:t,value:n,id:a,onChange:o,required:s,disabled:c,options:l={}})=>{const[i,d]=(0,r.useState)(!1),[u,m]=(0,r.useState)(!1);let p=n;Array.isArray(p)||(p=""===p?[]:[p]),(0,r.useEffect)((()=>{let e=1===Object.keys(l).length&&"true"===Object.keys(l)[0];d(e)}),[]),e&&(n=!0);const g=p;let f=!1;Object.keys(l).length>10&&(f=!0);const h=e=>i?n:g.includes(""+e)||g.includes(parseInt(e)),_=()=>{m(!u)};let b=c&&!Array.isArray(c);return 0===Object.keys(l).length?(0,r.createElement)(r.Fragment,null,(0,N.__)("No options found","complianz-gdpr")):(0,r.createElement)("div",{className:"cmplz-checkbox-group"},Object.entries(l).map((([l,d],m)=>(0,r.createElement)("div",{key:l,className:"cmplz-checkbox-group__item"+(!u&&m>9?" cmplz-hidden":"")},(0,r.createElement)(C,{className:"cmplz-checkbox-group__checkbox",id:a+"_"+l,checked:h(l),"aria-label":t,disabled:b||Array.isArray(c)&&c.includes(l),required:s,onCheckedChange:e=>((e,t)=>{if(i)o(!n);else{const e=g.includes(""+t)||g.includes(parseInt(t))?g.filter((e=>e!==""+t&&e!==parseInt(t))):[...g,t];o(e)}})(0,l)},(0,r.createElement)(w,{className:"cmplz-checkbox-group__indicator"},(0,r.createElement)(z.default,{name:e?"indeterminate":"check",size:14,color:"dark-blue"}))),(0,r.createElement)("label",{className:"cmplz-checkbox-group__label",htmlFor:a+"_"+l},d)))),!u&&f&&(0,r.createElement)(L.default,{onClick:()=>_()},(0,N.__)("Show more","complianz-gdpr")),u&&f&&(0,r.createElement)(L.default,{onClick:()=>_()},(0,N.__)("Show less","complianz-gdpr")))}))},93078:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var r=n(86087),a=n(27723),o=n(40054),s=n(81366);const c=(0,r.memo)((()=>{const[e,t]=(0,r.useState)(!1),[c,l]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null),{pagination:u,setPagination:m,paginationPerPage:p,orderBy:g,setOrderBy:f,totalRecords:h,order:_,setOrder:b,searchValue:v,setSearchValue:E,records:y,downloadUrl:k,deleteRecords:C,recordsLoaded:w,fetchData:N}=(0,o.default)(),[z,L]=(0,r.useState)(""),[P,S]=(0,r.useState)([]),x=!cmplz_settings.is_premium,[O,A]=(0,r.useState)(null);(0,r.useEffect)((()=>{n.e(3757).then(n.bind(n,83757)).then((({default:e})=>{A((()=>e))}))}),[]),(0,r.useEffect)((()=>{!w&&cmplz_settings.is_premium&&N()}),[w]);const D=async()=>{let e=y.filter((e=>P.includes(e.id)&&""!==e.poc_url));S([]);const t=async()=>{if(e.length>0){const n=e.shift(),r=k+"/"+n.poc_url;L(!0);try{let e=new XMLHttpRequest;e.responseType="blob",e.open("get",r,!0),e.send(),e.onreadystatechange=function(){if(4===this.readyState&&200===this.status){let e=window.URL.createObjectURL(this.response),t=window.document.createElement("a");t.setAttribute("href",e),t.setAttribute("download",n.filename),window.document.body.appendChild(t),t.click(),setTimeout((function(){window.URL.revokeObjectURL(e)}),6e4)}},await t()}catch(e){console.error(e),L(!1)}}};await t(),L(!1)},I=((0,a.__)("Opt-in","complianz-gdpr"),(0,a.__)("Opt-out","complianz-gdpr"),(0,a.__)("Other","complianz-gdpr"),e=>(e=e.sort(((e,t)=>e.file<t.file?-1:e.file>t.file?1:0))).filter((e=>e.ip.toLowerCase().includes(v.toLowerCase())||e.services.toLowerCase().includes(v.toLowerCase())||e.id.toLowerCase().includes(v.toLowerCase())))),R=[{name:(0,r.createElement)(s.default,{options:{true:""},indeterminate:e,value:c,onChange:e=>(e=>{if(e){l(!0);let e=u.currentPage?u.currentPage:1,t=I(y).slice((e-1)*p,e*p);S(t.map((e=>e.id)))}else l(!1),S([]);t(!1)})(e)}),selector:e=>e.selectControl,grow:1,minWidth:"50px"},{name:(0,a.__)("User ID","complianz-gdpr"),selector:e=>e.id,sortable:!0,grow:3},{name:(0,a.__)("IP Address","complianz-gdpr"),selector:e=>e.ip,sortable:!0,grow:4},{name:(0,a.__)("Region","complianz-gdpr"),selector:e=>""!==e.region?(0,r.createElement)("img",{alt:"region",width:"20px",height:"20px",src:cmplz_settings.plugin_url+"assets/images/"+e.region+".svg"}):(0,a.__)("Other","complianz-gdpr"),sortable:!0,grow:2},{name:(0,a.__)("Services","complianz-gdpr"),selector:e=>e.services,sortable:!0,grow:5},{name:(0,a.__)("Categories","complianz-gdpr"),selector:e=>(e=>{let t={do_not_track:(0,a.__)("DNT/GPC","complianz-gdpr"),no_choice:(0,a.__)("No Choice","complianz-gdpr"),no_warning:(0,a.__)("No Warning","complianz-gdpr"),functional:(0,a.__)("Functional","complianz-gdpr"),preferences:(0,a.__)("Preferences","complianz-gdpr"),statistics:(0,a.__)("Statistics","complianz-gdpr"),marketing:(0,a.__)("Marketing","complianz-gdpr")},n=[];return Object.keys(t).forEach((r=>{1===parseInt(e[r])&&n.push(t[r])})),n.join(", ")})(e),sortable:!0,grow:7},{name:(0,a.__)("Date","complianz-gdpr"),selector:e=>e.time,sortable:!0,grow:4,minWidth:"200px",right:!0}];let T=[...y];T=I(T);let U=[];return T.forEach((e=>{let n={...e};n.selectControl=(0,r.createElement)(s.default,{value:P.includes(n.id),options:{true:""},onChange:e=>((e,n)=>{let r=[...P];e?r.includes(n)||(r.push(n),S(r)):(r=[...P.filter((e=>e!==n))],S(r));let a=u.currentPage?u.currentPage:1,o=I(y).slice((a-1)*p,a*p),s=!0,c=!1;o.forEach((e=>{r.includes(e.id)?c=!0:s=!1})),s?(l(!0),t(!1)):c?(l(!1),t(!0)):t(!1)})(e,n.id)}),U.push(n)})),(0,r.createElement)(r.Fragment,null,x&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"cmplz-settings-overlay"},(0,r.createElement)("div",{className:"cmplz-settings-overlay-message"}))),(0,r.createElement)("div",{className:"cmplz-table-header"},(0,r.createElement)("div",{className:"cmplz-table-header-controls"},(0,r.createElement)("input",{className:"cmplz-datatable-search",type:"text",placeholder:(0,a.__)("Search","complianz-gdpr"),value:v,onChange:e=>(e=>{clearTimeout(i),E(e);const t=setTimeout((()=>{N(p,1,g,_)}),500);d(t)})(e.target.value)}))),P.length>0&&(0,r.createElement)("div",{className:"cmplz-selected-document"},P.length>1&&(0,a.__)("%s items selected","complianz-gdpr").replace("%s",P.length),1===P.length&&(0,a.__)("1 item selected","complianz-gdpr"),(0,r.createElement)("div",{className:"cmplz-selected-document-controls"},y.filter((e=>P.includes(e.id)&&""!==e.poc_url)).length>0&&(0,r.createElement)("button",{disabled:z,className:"button button-default cmplz-btn-reset",onClick:()=>D()},(0,a.__)("Download Proof of Consent","complianz-gdpr")),(0,r.createElement)("button",{className:"button button-default cmplz-reset-button",onClick:()=>(async e=>{S([]),await C(e)})(P)},(0,a.__)("Delete","complianz-gdpr")))),!x&&O&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(O,{columns:R,data:U,dense:!0,pagination:!0,paginationTotalRows:h,paginationServer:!0,noDataComponent:(0,r.createElement)("div",{className:"cmplz-no-documents"},(0,a.__)("No records","complianz-gdpr")),persistTableHead:!0,theme:"really-simple-plugins",customStyles:{headCells:{style:{paddingLeft:"0",paddingRight:"0"}},cells:{style:{paddingLeft:"0",paddingRight:"0"}}},paginationPerPage:p,onChangePage:e=>{m({...u,currentPage:e}),N()},paginationState:u,sortServer:!0,onSort:async(e,t)=>{f(e.orderId),b(t),N()}})))}))},40054:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(81621),a=n(9588);const o=(0,r.vt)(((e,t)=>({recordsLoaded:!1,fetching:!1,generating:!1,progress:!1,records:[],exportLink:"",downloadUrl:"",regions:[],fields:[],noData:!1,totalRecords:0,searchValue:"",setSearchValue:t=>e({searchValue:t}),paginationPerPage:10,pagination:{currentPage:1},setPagination:t=>e({pagination:t}),orderBy:"ID",setOrderBy:t=>e({orderBy:t}),order:"DESC",setOrder:t=>e({order:t}),deleteRecords:async n=>{let r=t().records.filter((e=>n.includes(e.id)));e((e=>({records:e.records.filter((e=>!n.includes(e.id)))})));let o={};o.records=r,await a.doAction("delete_records_of_consent",o).then((e=>e)).catch((e=>{console.error(e)}))},fetchData:async()=>{if(t().fetching)return;e({fetching:!0});let n={};n.per_page=t().paginationPerPage,n.page=t().pagination.currentPage,n.order=t().order.toUpperCase(),n.orderBy=t().orderBy,n.search=t().searchValue;const{records:r,totalRecords:o,regions:s,download_url:c}=await a.doAction("get_records_of_consent",n).then((e=>e)).catch((e=>{console.error(e)}));e((()=>({recordsLoaded:!0,records:r,regions:s,totalRecords:o,downloadUrl:c,fetching:!1})))},startExport:async()=>{e({generating:!0,progress:0,exportLink:""})},fetchExportRecordsOfConsentProgress:async(t,n,r)=>{(t=void 0!==t&&t)||e({generating:!0});let o={};o.startDate=n,o.endDate=r,o.statusOnly=t;const{progress:s,exportLink:c,noData:l}=await a.doAction("export_records_of_consent",o).then((e=>e)).catch((e=>{console.error(e)}));let i=!1;s<100&&(i=!0),e({progress:s,exportLink:c,generating:i,noData:l})}})))},7971:(e,t,n)=>{n.d(t,{C:()=>c});var r=n(51609),a=n(75795),o=n(91071),s=n(88200);const c=e=>{const{present:t,children:n}=e,c=function(e){const[t,n]=(0,r.useState)(),o=(0,r.useRef)({}),c=(0,r.useRef)(e),i=(0,r.useRef)("none"),d=e?"mounted":"unmounted",[u,m]=function(e,t){return(0,r.useReducer)(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,r.useEffect)((()=>{const e=l(o.current);i.current="mounted"===u?e:"none"}),[u]),(0,s.N)((()=>{const t=o.current,n=c.current;if(n!==e){const r=i.current,a=l(t);e?m("MOUNT"):"none"===a||"none"===(null==t?void 0:t.display)?m("UNMOUNT"):m(n&&r!==a?"ANIMATION_OUT":"UNMOUNT"),c.current=e}}),[e,m]),(0,s.N)((()=>{if(t){const e=e=>{const n=l(o.current).includes(e.animationName);e.target===t&&n&&(0,a.flushSync)((()=>m("ANIMATION_END")))},n=e=>{e.target===t&&(i.current=l(o.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}m("ANIMATION_END")}),[t,m]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:(0,r.useCallback)((e=>{e&&(o.current=getComputedStyle(e)),n(e)}),[])}}(t),i="function"==typeof n?n({present:c.isPresent}):r.Children.only(n),d=(0,o.s)(c.ref,i.ref);return"function"==typeof n||c.isPresent?(0,r.cloneElement)(i,{ref:d}):null};function l(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence"},85357:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(51609);function a(e){const t=(0,r.useRef)({value:e,previous:e});return(0,r.useMemo)((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}}}]);