@consenti/api 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +578 -143
  2. package/dist/chunk-COR72NFQ.js +2 -0
  3. package/dist/chunk-COR72NFQ.js.map +1 -0
  4. package/dist/chunk-S2IEYESR.js +2 -0
  5. package/dist/chunk-S2IEYESR.js.map +1 -0
  6. package/dist/dashboard/assets/ApiConfig-CZMtYRfK.js +1 -0
  7. package/dist/dashboard/assets/ArchivedProfileList-BlQ2gEWz.js +1 -0
  8. package/dist/dashboard/assets/AuditLog-BpZoAFOe.js +1 -0
  9. package/dist/dashboard/assets/ChangePassword-BZkP2dXQ.js +1 -0
  10. package/dist/dashboard/assets/ConfirmDialog-BDlnfTdx.js +1 -0
  11. package/dist/dashboard/assets/ConsentList-DgJMrhih.js +1 -0
  12. package/dist/dashboard/assets/ConsentTemplateEditor-DA7B5aI_.js +1 -0
  13. package/dist/dashboard/assets/ConsentTemplateList-DMPd2y5s.js +1 -0
  14. package/dist/dashboard/assets/HeadingTagInput-D2S9xDMJ.js +1 -0
  15. package/dist/dashboard/assets/HowItWorks-CJCrdr3o.js +1 -0
  16. package/dist/dashboard/assets/PermissionGate-C69dhwV1.js +1 -0
  17. package/dist/dashboard/assets/PreviewPane-D7mDeBT8.js +38 -0
  18. package/dist/dashboard/assets/ProfileEditor-CSFdOweN.js +2 -0
  19. package/dist/dashboard/assets/ProfileList-C4cIDrM6.js +1 -0
  20. package/dist/dashboard/assets/ProfileVersionHistory-CX5-Oupy.js +3 -0
  21. package/dist/dashboard/assets/RecordDetailModal-DIpGxfqA.js +1 -0
  22. package/dist/dashboard/assets/Reports-B1Ww0ovT.js +1 -0
  23. package/dist/dashboard/assets/RoleList-CQ1GjR0W.js +1 -0
  24. package/dist/dashboard/assets/Select-C_JusbT5.js +1 -0
  25. package/dist/dashboard/assets/Settings-sIMVWQ0V.js +1 -0
  26. package/dist/dashboard/assets/SetupWizard-ChFBxqo3.js +1 -0
  27. package/dist/dashboard/assets/Table-BUxoz0YR.js +1 -0
  28. package/dist/dashboard/assets/TenantList-DCsT7ghb.js +1 -0
  29. package/dist/dashboard/assets/UITemplateEditor-BAaMnuOU.js +2 -0
  30. package/dist/dashboard/assets/UITemplateList-C3UMbnfs.js +1 -0
  31. package/dist/dashboard/assets/UserList-CHGNnS50.js +1 -0
  32. package/dist/dashboard/assets/VendorList-C-sswM1A.js +1 -0
  33. package/dist/dashboard/assets/VisitorList-DNB9Ia72.js +1 -0
  34. package/dist/dashboard/assets/check-D0g4XvmN.js +1 -0
  35. package/dist/dashboard/assets/client-CYntrO2g.js +1 -0
  36. package/dist/dashboard/assets/copy-DEi_W2TM.js +1 -0
  37. package/dist/dashboard/assets/createLucideIcon-DAiYBrnd.js +1 -0
  38. package/dist/dashboard/assets/de-jwngydrC.js +25 -0
  39. package/dist/dashboard/assets/debounce-DlvAAT2V.js +1 -0
  40. package/dist/dashboard/assets/dist-GoiMJCTt.js +1 -0
  41. package/dist/dashboard/assets/es-B6Jp0OPe.js +25 -0
  42. package/dist/dashboard/assets/external-link-CFZxxe3W.js +1 -0
  43. package/dist/dashboard/assets/fr-CshYcQPW.js +25 -0
  44. package/dist/dashboard/assets/index-Cr5M1Qy_.css +2 -0
  45. package/dist/dashboard/assets/index-Tr_BcjkN.js +26 -0
  46. package/dist/dashboard/assets/ja-CgjZNBrc.js +25 -0
  47. package/dist/dashboard/assets/profiles-C_SuoLJD.js +1 -0
  48. package/dist/dashboard/assets/roles-D7L936FV.js +1 -0
  49. package/dist/dashboard/assets/rotate-ccw-clock-6y2NDrJ7.js +1 -0
  50. package/dist/dashboard/assets/search-DKwfLBOv.js +1 -0
  51. package/dist/dashboard/assets/templates-CIyMjskA.js +1 -0
  52. package/dist/dashboard/assets/templates-DY68xNys.js +1 -0
  53. package/dist/dashboard/assets/trash-2-eX9s6x8V.js +1 -0
  54. package/dist/dashboard/assets/trash-O30ycMcz.js +1 -0
  55. package/dist/dashboard/assets/useHashQuery-BDjUPXDR.js +1 -0
  56. package/dist/dashboard/assets/users-BRrNOK0W.js +1 -0
  57. package/dist/dashboard/assets/x-BhZiH8AL.js +1 -0
  58. package/dist/dashboard/assets/zh-CN-BnLZkfBC.js +25 -0
  59. package/dist/dashboard/index.html +4 -2
  60. package/dist/dist-QJYW5KUK.js +2 -0
  61. package/dist/dist-QJYW5KUK.js.map +1 -0
  62. package/dist/index.cjs +90 -101
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.cts +847 -150
  65. package/dist/index.d.ts +847 -150
  66. package/dist/index.js +90 -101
  67. package/dist/index.js.map +1 -1
  68. package/dist/profiles-FCX454HS.js +2 -0
  69. package/dist/profiles-FCX454HS.js.map +1 -0
  70. package/dist/widget/widget.css +1 -1
  71. package/dist/widget/widget.js +1 -1
  72. package/package.json +32 -17
  73. package/dist/dashboard/assets/de-DwE2aQfW.js +0 -5
  74. package/dist/dashboard/assets/es-Dq88TWkB.js +0 -5
  75. package/dist/dashboard/assets/fr-o_Pyg8eR.js +0 -5
  76. package/dist/dashboard/assets/index-BSsYDdb9.js +0 -40
  77. package/dist/dashboard/assets/index-bOTGevzl.css +0 -2
  78. package/dist/dashboard/assets/ja-CwgXYmpD.js +0 -5
  79. package/dist/dashboard/assets/zh-CN-ety9KoQ0.js +0 -5
@@ -0,0 +1 @@
1
+ import{a as e,c as t,l as n,p as r}from"./createLucideIcon-DAiYBrnd.js";import{h as i,o as a,s as o}from"./index-Tr_BcjkN.js";import{t as s}from"./Table-BUxoz0YR.js";import{t as c}from"./profiles-C_SuoLJD.js";function l({current:l}){let u=o();a(u(`profiles.archived.title`));let[d,f]=t([]),[p,m]=t(!0);return n(()=>{c.listArchived().then(f).catch(()=>f([])).finally(()=>m(!1))},[]),e(r,{children:[e(`div`,{class:`mb-4`,children:e(`a`,{href:`#/banners/profiles`,class:`inline-flex items-center gap-1 text-sm text-gray-500 hover:text-gray-700 transition-colors`,children:[e(i,{size:14,"aria-hidden":`true`}),u(`profiles.archived.back`)]})}),e(`p`,{class:`text-xs text-gray-500 mb-4`,children:u(`profiles.archived.hint`)}),e(s,{loading:p,keyFn:e=>e.id,rows:d,emptyText:u(`profiles.archived.empty`),search:{placeholder:u(`profiles.archived.searchPlaceholder`),keys:e=>[e.id]},columns:[{key:`id`,label:u(`profiles.archived.col.id`),render:t=>e(`span`,{class:`font-mono text-sm text-gray-700`,children:t.id})},{key:`versionCount`,label:u(`profiles.archived.col.versions`),render:t=>e(`span`,{class:`text-sm text-gray-700`,children:t.versionCount})},{key:`lastModified`,label:u(`profiles.archived.col.lastModified`),render:t=>e(`span`,{class:`text-sm text-gray-500`,children:new Date(t.lastModified).toLocaleString()})},{key:`actions`,label:``,render:t=>e(`a`,{href:`#/banners/profiles/${t.id}/history`,class:`text-blue-600 hover:underline text-sm`,children:u(`profiles.archived.viewHistory`)})}]})]})}export{l as ArchivedProfileList};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,l as n,o as r,p as i}from"./createLucideIcon-DAiYBrnd.js";import{a,r as o}from"./client-CYntrO2g.js";import{t as s}from"./rotate-ccw-clock-6y2NDrJ7.js";import{o as c,s as l}from"./index-Tr_BcjkN.js";import{n as u,t as d}from"./useHashQuery-BDjUPXDR.js";import{n as f,t as p}from"./RecordDetailModal-DIpGxfqA.js";var m={list:e=>{let t=new URLSearchParams;return e?.action&&t.set(`action`,e.action),e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.q&&t.set(`q`,e.q),a(`/audit?${t}`)},get:e=>a(`/audit/${e}`)},h=`#/audit`,g=new Set([`profile:created`,`profile:updated`]);function _(e){if(e.resourceType!==`profile`||!g.has(e.action)||!e.resourceId)return null;let t=e.newData?.version;if(t===void 0)return null;let n=new URLSearchParams({version:String(t)});return t>1&&n.set(`compare`,String(t-1)),`#/banners/profiles/${e.resourceId}/history?${n}`}function v({current:a}){let g=l();c(g(`audit.title`));let{params:v,setParams:y}=d(h),[b,x]=t([]),[S,C]=t(0),[w,T]=t(()=>Number(v.get(`page`))||1),[E,D]=t(()=>Number(v.get(`limit`))||25),[O,k]=t(!0),[A,j]=t(()=>v.get(`q`)??``),[M,N]=t(null),P=(e,t,n)=>{k(!0),m.list({page:e,limit:t,...n?{q:n}:{}}).then(e=>{x(e.items),C(e.total)}).catch(()=>{}).finally(()=>k(!1))};n(()=>{P(w,E,A)},[w,E]);let F=r(!0);n(()=>{if(F.current){F.current=!1;return}let e=setTimeout(()=>{T(1),P(1,E,A)},300);return()=>clearTimeout(e)},[A]),n(()=>{y({page:w>1?w:void 0,limit:E===25?void 0:E,q:A||void 0})},[w,E,A]);let I=e=>{m.get(e).then(N).catch(()=>{})};return e(i,{children:[e(f,{open:!!M,title:g(`audit.detail.title`),onClose:()=>N(null),fields:M?[{label:g(`audit.col.time`),value:new Date(M.createdAt).toLocaleString()},{label:g(`audit.col.action`),value:M.action},{label:g(`audit.col.resource`),value:M.resourceType},{label:g(`audit.col.resourceId`),value:M.resourceId?e(`span`,{class:`font-mono text-xs`,children:M.resourceId}):`—`},{label:g(`audit.col.actor`),value:M.userId?e(`span`,{class:`font-mono text-xs`,children:M.userId}):e(`span`,{class:`text-gray-400`,children:g(`audit.actor.system`)})},..._(M)?[{label:``,value:e(`a`,{href:_(M),class:`inline-flex items-center gap-1 text-xs text-blue-600 hover:underline`,children:[e(s,{size:12,"aria-hidden":`true`}),` `,g(`audit.viewHistory`)]})}]:[],{label:g(`audit.detail.oldData`),value:e(p,{value:M.oldData})},{label:g(`audit.detail.newData`),value:e(p,{value:M.newData})}]:[]}),e(u,{loading:O,rows:b,keyFn:e=>e.id,searchValue:A,onSearchChange:j,searchPlaceholder:g(`audit.searchPlaceholder`),total:S,page:w,pageSize:E,onPage:T,onPageSize:e=>{D(e),T(1)},toolbarEnd:e(`button`,{onClick:()=>{o(`/export/audit?format=csv`)},class:`text-sm text-blue-600 hover:underline`,children:g(`common.exportCsv`)}),columns:[{key:`createdAt`,label:g(`audit.col.time`),render:e=>new Date(e.createdAt).toLocaleString()},{key:`action`,label:g(`audit.col.action`)},{key:`resourceType`,label:g(`audit.col.resource`)},{key:`resourceId`,label:g(`audit.col.resourceId`),render:t=>{let n=t;return n.resourceId?e(`button`,{onClick:()=>I(n.id),class:`font-mono text-xs text-blue-600 dark:text-blue-400 hover:underline`,children:[n.resourceId.slice(0,12),`…`]}):`—`}},{key:`userId`,label:g(`audit.col.actor`),render:t=>{let n=t.userId;return n?e(`span`,{class:`font-mono text-xs`,children:n.slice(0,8)}):e(`span`,{class:`text-gray-400`,children:g(`audit.actor.system`)})}}],emptyText:g(`audit.empty`)})]})}export{v as AuditLogPage};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,p as n}from"./createLucideIcon-DAiYBrnd.js";import{o as r,s as i,y as a}from"./index-Tr_BcjkN.js";import{t as o}from"./users-BRrNOK0W.js";function s({current:s}){let{user:c}=a(),l=i();r(l(`changePassword.title`));let[u,d]=t(``),[f,p]=t(``),[m,h]=t(null),[g,_]=t(!1),[v,y]=t(!1),b=()=>u.length<12?l(`changePassword.error.minLength`):u===f?null:l(`changePassword.error.mismatch`);return e(n,{children:e(`div`,{class:`max-w-md`,children:e(`div`,{class:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6`,children:[e(`p`,{class:`text-sm text-gray-500 dark:text-gray-400 mb-5`,children:l(`changePassword.hint`)}),g&&e(`div`,{role:`status`,"aria-live":`polite`,class:`mb-4 p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg text-sm text-green-700 dark:text-green-400`,children:l(`changePassword.success`)}),m&&e(`div`,{role:`alert`,class:`mb-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-sm text-red-700 dark:text-red-400`,children:m}),e(`form`,{onSubmit:async e=>{e.preventDefault(),h(null),_(!1);let t=b();if(t){h(t);return}if(c?.sub){y(!0);try{await o.update(c.sub,{password:u}),_(!0),d(``),p(``)}catch(e){h(e instanceof Error?e.message:l(`changePassword.error.failed`))}finally{y(!1)}}},class:`space-y-4`,children:[e(`div`,{children:[e(`label`,{for:`new-password`,class:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:l(`changePassword.newPassword`)}),e(`input`,{id:`new-password`,type:`password`,value:u,onInput:e=>d(e.target.value),minLength:12,required:!0,autocomplete:`new-password`,class:`w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500`,placeholder:l(`changePassword.newPasswordPlaceholder`)})]}),e(`div`,{children:[e(`label`,{for:`confirm-password`,class:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:l(`changePassword.confirmPassword`)}),e(`input`,{id:`confirm-password`,type:`password`,value:f,onInput:e=>p(e.target.value),required:!0,autocomplete:`new-password`,class:`w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500`,placeholder:l(`changePassword.confirmPasswordPlaceholder`)})]}),e(`div`,{class:`flex items-center gap-3 pt-1`,children:[e(`button`,{type:`submit`,disabled:v,class:`bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:l(v?`changePassword.submitting`:`changePassword.submit`)}),e(`a`,{href:`#/settings`,class:`text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200`,children:l(`common.cancel`)})]})]})]})})})}export{s as ChangePassword};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,l as n,n as r,o as i,t as a}from"./createLucideIcon-DAiYBrnd.js";import{s as o}from"./index-Tr_BcjkN.js";var s=a(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c=`confirm-dialog-title`;function l({open:t,title:a,message:l,confirmLabel:u,cancelLabel:d,danger:f=!0,onConfirm:p,onCancel:m}){let h=o(),g=i(null),_=i(null),v=u??h(`common.confirm`),y=d??h(`common.cancel`);return n(()=>{if(!t)return;g.current?.focus();let e=e=>{if(e.key===`Escape`){m();return}if(e.key!==`Tab`)return;let t=_.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button, [href], input, [tabindex]:not([tabindex="-1"])`)).filter(e=>!e.hasAttribute(`disabled`));if(!n.length)return;let r=n[0],i=n[n.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),i.focus()):document.activeElement===i&&(e.preventDefault(),r.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,m]),t?r(e(`div`,{class:`fixed inset-0 z-50 flex items-center justify-center`,children:[e(`div`,{class:`absolute inset-0 bg-black/40`,onClick:m,"aria-hidden":`true`}),e(`div`,{ref:_,role:`dialog`,"aria-modal":`true`,"aria-labelledby":c,class:`relative bg-white rounded-xl shadow-2xl p-6 w-full max-w-sm mx-4`,children:[e(`div`,{class:`flex items-start gap-4`,children:[f&&e(`div`,{class:`shrink-0 w-10 h-10 rounded-full bg-red-100 flex items-center justify-center`,"aria-hidden":`true`,children:e(s,{size:20,className:`text-red-600`})}),e(`div`,{class:`flex-1 min-w-0`,children:[e(`h3`,{id:c,class:`text-sm font-semibold text-gray-900`,children:a}),l&&e(`p`,{class:`text-sm text-gray-500 mt-1`,children:l})]})]}),e(`div`,{class:`flex justify-end gap-3 mt-5`,children:[e(`button`,{ref:g,type:`button`,onClick:m,class:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-100 rounded-lg transition-colors`,children:y}),e(`button`,{type:`button`,onClick:p,class:`px-4 py-2 text-sm font-medium rounded-lg transition-colors text-white ${f?`bg-red-600 hover:bg-red-700`:`bg-blue-600 hover:bg-blue-700`}`,children:v})]})]})]}),document.body):null}function u(){let[n,r]=t(null);return{requestConfirm:e=>new Promise(t=>r({opts:e,resolve:t})),dialog:e(l,{open:!!n,title:n?.opts.title??``,message:n?.opts.message,confirmLabel:n?.opts.confirmLabel,cancelLabel:n?.opts.cancelLabel,danger:n?.opts.danger,onConfirm:()=>{n?.resolve(!0),r(null)},onCancel:()=>{n?.resolve(!1),r(null)}})}}export{u as t};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,l as n,o as r,p as i}from"./createLucideIcon-DAiYBrnd.js";import{a,r as o}from"./client-CYntrO2g.js";import{c as s,o as c,s as l}from"./index-Tr_BcjkN.js";import{n as u,t as d}from"./useHashQuery-BDjUPXDR.js";import{n as f,t as p}from"./RecordDetailModal-DIpGxfqA.js";var m={list:e=>{let t=new URLSearchParams;return e?.profileId&&t.set(`profileId`,e.profileId),e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.from&&t.set(`from`,e.from),e?.to&&t.set(`to`,e.to),e?.q&&t.set(`q`,e.q),a(`/consents?${t}`)},get:e=>a(`/consents/${e}`),history:e=>a(`/consents/${e}/history`)},h=`#/consents`;function g({current:a}){let g=l();c(g(`consents.title`));let{params:_,setParams:v}=d(h),[y,b]=t([]),[x,S]=t(0),[C,w]=t(()=>Number(_.get(`page`))||1),[T,E]=t(()=>Number(_.get(`limit`))||25),[D,O]=t(!0),[k,A]=t(()=>_.get(`from`)??``),[j,M]=t(()=>_.get(`to`)??``),[N,P]=t(!1),[F,I]=t(()=>_.get(`q`)??``),[L,R]=t(null),z=(e,t,n,r,i)=>{O(!0),m.list({page:e,limit:t,from:r||void 0,to:i||void 0,q:n||void 0}).then(e=>{b(e.items),S(e.total)}).catch(()=>{}).finally(()=>O(!1))};n(()=>{z(C,T,F,k,j)},[C,T,k,j]);let B=r(!0);n(()=>{if(B.current){B.current=!1;return}let e=setTimeout(()=>{w(1),z(1,T,F,k,j)},300);return()=>clearTimeout(e)},[F]),n(()=>{v({page:C>1?C:void 0,limit:T===25?void 0:T,q:F||void 0,from:k||void 0,to:j||void 0})},[C,T,F,k,j]);let V=e=>{m.get(e.visitorId).then(R).catch(()=>{})},H=N?y.filter(e=>e.gpcDetected):y,U=()=>{let e=new URLSearchParams({format:`csv`});return k&&e.set(`from`,k),j&&e.set(`to`,j),`/export/consents?${e.toString()}`};return e(i,{children:[e(f,{open:!!L,title:g(`consents.detail.title`),onClose:()=>R(null),fields:L?[{label:g(`consents.col.visitorId`),value:e(`span`,{class:`font-mono text-xs`,children:L.visitorId})},{label:g(`consents.col.profile`),value:e(`span`,{class:`font-mono text-xs`,children:L.profileId})},{label:g(`consents.col.locale`),value:L.locale},{label:g(`consents.col.gpc`),value:L.gpcDetected?g(`consents.gpcYes`):`—`},{label:g(`consents.col.age`),value:L.ageVerified?g(`consents.ageVerified`):`—`},{label:g(`consents.col.source`),value:L.source},{label:g(`consents.col.created`),value:new Date(L.createdAt).toLocaleString()},{label:g(`consents.detail.updated`),value:new Date(L.updatedAt).toLocaleString()},{label:g(`consents.detail.signature`),value:L.signature?e(`span`,{class:`inline-flex items-center gap-1 text-xs font-medium text-green-700 dark:text-green-400`,children:[e(s,{size:13,"aria-hidden":`true`}),` `,g(`consents.detail.signed`)]}):e(`span`,{class:`text-gray-400`,children:g(`consents.detail.unsigned`)})},{label:g(`consents.detail.consentJson`),value:e(p,{value:L.consentJson})}]:[]}),e(u,{loading:D,rows:H,keyFn:e=>e.id,searchValue:F,onSearchChange:I,searchPlaceholder:g(`consents.searchPlaceholder`),total:x,page:C,pageSize:T,onPage:w,onPageSize:e=>{E(e),w(1)},filters:e(i,{children:[e(`label`,{class:`flex items-center gap-1 text-sm text-gray-600 dark:text-gray-400`,children:[g(`consents.filterFrom`),e(`input`,{type:`date`,value:k,onInput:e=>{A(e.target.value),w(1)},class:`ml-1 border border-gray-300 dark:border-gray-600 rounded px-2 py-1 text-xs bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200`})]}),e(`label`,{class:`flex items-center gap-1 text-sm text-gray-600 dark:text-gray-400`,children:[g(`consents.filterTo`),e(`input`,{type:`date`,value:j,onInput:e=>{M(e.target.value),w(1)},class:`ml-1 border border-gray-300 dark:border-gray-600 rounded px-2 py-1 text-xs bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200`})]}),e(`label`,{class:`flex items-center gap-1 text-sm text-gray-600 dark:text-gray-400`,children:[e(`input`,{type:`checkbox`,checked:N,onChange:e=>P(e.target.checked)}),g(`consents.filterGpc`)]})]}),toolbarEnd:e(i,{children:[e(`span`,{class:`text-sm text-gray-500 dark:text-gray-400`,children:g(`consents.records`,{n:x})}),e(`button`,{onClick:()=>{o(U())},class:`text-sm text-blue-600 hover:underline`,children:g(`common.exportCsv`)})]}),columns:[{key:`visitorId`,label:g(`consents.col.visitorId`),render:t=>{let n=t;return e(`button`,{onClick:()=>V(n),class:`font-mono text-xs text-blue-600 dark:text-blue-400 hover:underline`,children:[n.visitorId.slice(0,12),`…`]})}},{key:`profileId`,label:g(`consents.col.profile`),render:t=>e(`span`,{class:`font-mono text-xs`,children:t.profileId.slice(0,8)})},{key:`locale`,label:g(`consents.col.locale`)},{key:`gpcDetected`,label:g(`consents.col.gpc`),render:t=>t.gpcDetected?e(`span`,{class:`text-amber-600 font-medium text-xs`,children:g(`consents.gpcYes`)}):``},{key:`ageVerified`,label:g(`consents.col.age`),render:t=>t.ageVerified?e(`span`,{class:`text-green-600 font-medium text-xs`,children:g(`consents.ageVerified`)}):``},{key:`source`,label:g(`consents.col.source`)},{key:`createdAt`,label:g(`consents.col.created`),render:e=>new Date(e.createdAt).toLocaleString()}],emptyText:g(`consents.empty`)})]})}export{g as ConsentList};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,l as n,o as r,p as i,s as a,t as o}from"./createLucideIcon-DAiYBrnd.js";import{a as s,i as c}from"./client-CYntrO2g.js";import{n as l,t as u}from"./HeadingTagInput-D2S9xDMJ.js";import{t as d}from"./ConfirmDialog-BDlnfTdx.js";import{c as f,o as p,s as m,u as h}from"./index-Tr_BcjkN.js";import{a as g,n as _,r as v}from"./dist-GoiMJCTt.js";import{t as y}from"./debounce-DlvAAT2V.js";import{t as b}from"./templates-DY68xNys.js";import{c as x,i as S,l as C,m as w,o as T,p as E}from"./templates-CIyMjskA.js";var D=o(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),O=o(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),k=o(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),A=o(`scale`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]),j=o(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),M=[{pattern:`security_storage`,vendor:`Google Consent Mode v2`,category:`necessary`},{pattern:`functionality_storage`,vendor:`Google Consent Mode v2`,category:`functional`},{pattern:`personalization_storage`,vendor:`Google Consent Mode v2`,category:`preferences`},{pattern:`analytics_storage`,vendor:`Google Consent Mode v2`,category:`analytics`},{pattern:`ad_storage`,vendor:`Google Consent Mode v2`,category:`marketing`},{pattern:`ad_user_data`,vendor:`Google Consent Mode v2`,category:`marketing`},{pattern:`ad_personalization`,vendor:`Google Consent Mode v2`,category:`marketing`},{pattern:`_ga`,vendor:`Google Analytics`,category:`analytics`},{pattern:`_ga_*`,vendor:`Google Analytics 4`,category:`analytics`},{pattern:`_gid`,vendor:`Google Analytics`,category:`analytics`},{pattern:`_gat`,vendor:`Google Analytics`,category:`analytics`},{pattern:`_gat_*`,vendor:`Google Analytics`,category:`analytics`},{pattern:`_gcl_au`,vendor:`Google Ads`,category:`marketing`},{pattern:`_gac_*`,vendor:`Google Ads`,category:`marketing`},{pattern:`_gcl_aw`,vendor:`Google Ads`,category:`marketing`},{pattern:`_fbp`,vendor:`Meta Pixel`,category:`marketing`},{pattern:`_fbc`,vendor:`Meta Pixel`,category:`marketing`},{pattern:`fr`,vendor:`Meta Pixel`,category:`marketing`},{pattern:`_hjSessionUser_*`,vendor:`Hotjar`,category:`analytics`},{pattern:`_hjSession_*`,vendor:`Hotjar`,category:`analytics`},{pattern:`_hjid`,vendor:`Hotjar`,category:`analytics`},{pattern:`hjViewportId`,vendor:`Hotjar`,category:`analytics`},{pattern:`ajs_user_id`,vendor:`Segment`,category:`analytics`},{pattern:`ajs_anonymous_id`,vendor:`Segment`,category:`analytics`},{pattern:`ajs_group_id`,vendor:`Segment`,category:`analytics`},{pattern:`intercom-id-*`,vendor:`Intercom`,category:`functional`},{pattern:`intercom-session-*`,vendor:`Intercom`,category:`functional`},{pattern:`intercom-device-id-*`,vendor:`Intercom`,category:`functional`},{pattern:`__hstc`,vendor:`HubSpot`,category:`marketing`},{pattern:`hubspotutk`,vendor:`HubSpot`,category:`marketing`},{pattern:`__hssc`,vendor:`HubSpot`,category:`marketing`},{pattern:`__hssrc`,vendor:`HubSpot`,category:`marketing`},{pattern:`mp_*`,vendor:`Mixpanel`,category:`analytics`},{pattern:`li_sugr`,vendor:`LinkedIn Insight`,category:`marketing`},{pattern:`bcookie`,vendor:`LinkedIn Insight`,category:`marketing`},{pattern:`lidc`,vendor:`LinkedIn Insight`,category:`marketing`},{pattern:`UserMatchHistory`,vendor:`LinkedIn Insight`,category:`marketing`},{pattern:`_ttp`,vendor:`TikTok Pixel`,category:`marketing`},{pattern:`_clck`,vendor:`Microsoft Clarity`,category:`analytics`},{pattern:`_clsk`,vendor:`Microsoft Clarity`,category:`analytics`},{pattern:`_pinterest_ct*`,vendor:`Pinterest Tag`,category:`marketing`},{pattern:`_pin_unauth`,vendor:`Pinterest Tag`,category:`marketing`},{pattern:`personalization_id`,vendor:`X (Twitter) Pixel`,category:`marketing`},{pattern:`amplitude_id_*`,vendor:`Amplitude`,category:`analytics`},{pattern:`__stripe_mid`,vendor:`Stripe`,category:`necessary`},{pattern:`__stripe_sid`,vendor:`Stripe`,category:`necessary`},{pattern:`__cf_bm`,vendor:`Cloudflare`,category:`necessary`},{pattern:`cf_clearance`,vendor:`Cloudflare`,category:`necessary`},{pattern:`_zendesk_*`,vendor:`Zendesk`,category:`functional`},{pattern:`drift_aid`,vendor:`Drift`,category:`functional`},{pattern:`driftt_aid`,vendor:`Drift`,category:`functional`},{pattern:`crisp-client*`,vendor:`Crisp`,category:`functional`},{pattern:`AMCV_*`,vendor:`Adobe Experience Cloud`,category:`analytics`},{pattern:`AMCVS_*`,vendor:`Adobe Experience Cloud`,category:`analytics`},{pattern:`s_cc`,vendor:`Adobe Analytics`,category:`analytics`},{pattern:`s_sq`,vendor:`Adobe Analytics`,category:`analytics`},{pattern:`s_vi`,vendor:`Adobe Analytics`,category:`analytics`},{pattern:`mbox`,vendor:`Adobe Target`,category:`preferences`},{pattern:`_mkto_trk`,vendor:`Marketo`,category:`marketing`},{pattern:`cto_bundle`,vendor:`Criteo`,category:`marketing`},{pattern:`cto_id_out`,vendor:`Criteo`,category:`marketing`},{pattern:`TTD_DEVICE_ID`,vendor:`The Trade Desk`,category:`marketing`},{pattern:`ttd_*`,vendor:`The Trade Desk`,category:`marketing`},{pattern:`id`,vendor:`Google DoubleClick`,category:`marketing`},{pattern:`IDE`,vendor:`Google DoubleClick`,category:`marketing`},{pattern:`DSID`,vendor:`Google DoubleClick`,category:`marketing`},{pattern:`KADUSERCOOKIE`,vendor:`PubMatic`,category:`marketing`},{pattern:`rubicon_user_*`,vendor:`Rubicon Project`,category:`marketing`},{pattern:`Anonymon_id`,vendor:`OpenX`,category:`marketing`},{pattern:`pdomid`,vendor:`OpenX`,category:`marketing`},{pattern:`uuid2`,vendor:`AppNexus`,category:`marketing`},{pattern:`icu`,vendor:`AppNexus`,category:`marketing`},{pattern:`_scid`,vendor:`Snap Pixel`,category:`marketing`},{pattern:`_sc_cspv`,vendor:`Snap Pixel`,category:`marketing`},{pattern:`_rdt_uuid`,vendor:`Reddit Pixel`,category:`marketing`},{pattern:`obuid`,vendor:`Outbrain`,category:`marketing`},{pattern:`t_gid`,vendor:`Taboola`,category:`marketing`},{pattern:`__kla_id`,vendor:`Klaviyo`,category:`marketing`},{pattern:`sc_anonymous_id`,vendor:`Salesforce Marketing Cloud`,category:`marketing`},{pattern:`vst`,vendor:`Salesforce Marketing Cloud`,category:`marketing`},{pattern:`visitor_id*`,vendor:`Salesforce Pardot`,category:`marketing`},{pattern:`piAId`,vendor:`Salesforce Pardot`,category:`marketing`},{pattern:`exp_last_visit`,vendor:`ActiveCampaign`,category:`marketing`},{pattern:`exp_tracker`,vendor:`ActiveCampaign`,category:`marketing`},{pattern:`_ce.s*`,vendor:`Crazy Egg`,category:`analytics`},{pattern:`lr_*`,vendor:`LogRocket`,category:`analytics`},{pattern:`_hp2_id.*`,vendor:`Heap Analytics`,category:`analytics`},{pattern:`_hp2_ses.*`,vendor:`Heap Analytics`,category:`analytics`},{pattern:`_lo_*`,vendor:`Lucky Orange`,category:`analytics`},{pattern:`fs_uid`,vendor:`FullStory`,category:`analytics`},{pattern:`_fs_*`,vendor:`FullStory`,category:`analytics`},{pattern:`ln_or`,vendor:`LiveSession`,category:`analytics`},{pattern:`_vwo_uuid*`,vendor:`Visual Website Optimizer (VWO)`,category:`analytics`},{pattern:`_vis_opt_*`,vendor:`Visual Website Optimizer (VWO)`,category:`analytics`},{pattern:`OptimizelyBuckets`,vendor:`Optimizely`,category:`analytics`},{pattern:`optimizelyEndUserId`,vendor:`Optimizely`,category:`analytics`},{pattern:`OptanonConsent`,vendor:`OneTrust`,category:`necessary`},{pattern:`OptanonAlertBoxClosed`,vendor:`OneTrust`,category:`necessary`},{pattern:`SyrenisCookieConsentDate_*`,vendor:`Syrenis Cassie`,category:`necessary`},{pattern:`SyrenisCookieFormConsent_*`,vendor:`Syrenis Cassie`,category:`necessary`},{pattern:`SyrenisCookiePrivacyLink_*`,vendor:`Syrenis Cassie`,category:`necessary`},{pattern:`SyrenisGtmConsent_*`,vendor:`Syrenis Cassie`,category:`necessary`},{pattern:`SyrenisGuid_*`,vendor:`Syrenis Cassie`,category:`necessary`},{pattern:`CookieConsent`,vendor:`Cookiebot`,category:`necessary`},{pattern:`uc_settings`,vendor:`Usercentrics`,category:`necessary`},{pattern:`uc_user_interaction`,vendor:`Usercentrics`,category:`necessary`},{pattern:`didomi_token`,vendor:`Didomi`,category:`necessary`},{pattern:`euconsent-v2`,vendor:`IAB TCF Global Vendor List`,category:`necessary`},{pattern:`cconsent`,vendor:`Cookie Consent Studio`,category:`necessary`},{pattern:`JSESSIONID`,vendor:`New Relic`,category:`necessary`},{pattern:`NRAGENT`,vendor:`New Relic`,category:`necessary`},{pattern:`_dd_s`,vendor:`Datadog`,category:`necessary`},{pattern:`dtCookie`,vendor:`Dynatrace`,category:`necessary`},{pattern:`dtPC`,vendor:`Dynatrace`,category:`necessary`},{pattern:`rxVisitor`,vendor:`Dynatrace`,category:`necessary`},{pattern:`ak_bmsc`,vendor:`Akamai`,category:`necessary`},{pattern:`_abck`,vendor:`Akamai`,category:`necessary`},{pattern:`vuid`,vendor:`Vimeo`,category:`analytics`},{pattern:`__cf_vuid`,vendor:`Vimeo`,category:`analytics`},{pattern:`VISITOR_INFO1_LIVE`,vendor:`YouTube`,category:`marketing`},{pattern:`YSC`,vendor:`YouTube`,category:`necessary`},{pattern:`GPS`,vendor:`YouTube`,category:`marketing`},{pattern:`_wistia_*`,vendor:`Wistia`,category:`analytics`},{pattern:`_elvr_*`,vendor:`Elevar`,category:`analytics`},{pattern:`stkn`,vendor:`Shopify Core Analytics`,category:`analytics`},{pattern:`rmStore*`,vendor:`Rakuten Advertising`,category:`marketing`},{pattern:`_ir_*`,vendor:`Impact Radius`,category:`marketing`},{pattern:`aw*`,vendor:`Awin`,category:`marketing`},{pattern:`bctc`,vendor:`Awin`,category:`marketing`},{pattern:`mcookie`,vendor:`CJ Affiliate`,category:`marketing`},{pattern:`_shopify_y`,vendor:`Shopify`,category:`analytics`},{pattern:`_shopify_s`,vendor:`Shopify`,category:`analytics`},{pattern:`_shopify_sa_p`,vendor:`Shopify`,category:`marketing`},{pattern:`shopify_sa_t`,vendor:`Shopify`,category:`marketing`},{pattern:`cart_sig`,vendor:`Shopify`,category:`necessary`},{pattern:`secure_customer_sig`,vendor:`Shopify`,category:`necessary`},{pattern:`wp_woocommerce_session*`,vendor:`WooCommerce`,category:`necessary`},{pattern:`woocommerce_items_in_cart`,vendor:`WooCommerce`,category:`necessary`},{pattern:`woocommerce_cart_hash`,vendor:`WooCommerce`,category:`necessary`},{pattern:`QSI_`,vendor:`Qualtrics`,category:`functional`},{pattern:`feedback_id`,vendor:`SurveyMonkey`,category:`functional`},{pattern:`usbl.`,vendor:`Usabilla`,category:`functional`}];function N(e){let t=e.trim();if(!t)return;let n=M.find(e=>!e.pattern.endsWith(`*`)&&e.pattern===t);if(n)return n;let r=M.filter(e=>e.pattern.endsWith(`*`)&&t.startsWith(e.pattern.slice(0,-1)));if(r.length!==0)return r.reduce((e,t)=>t.pattern.length>e.pattern.length?t:e)}function P({value:i,onChange:o,onSelect:s,source:c,placeholder:l,disabled:u,loadingText:d=`Searching…`,emptyText:f=`No matches`,inputClassName:p,autoFocus:m}){let[h,g]=t(!1),[_,v]=t([]),[b,x]=t(!1),S=r(null);n(()=>{let e=e=>{S.current&&!S.current.contains(e.target)&&g(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let C=a(()=>{if(c.type!==`local`)return[];let e=i.trim().toLowerCase();return e?c.items.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e)):c.items},[c,i]),w=a(()=>{if(c.type!==`server`)return null;let e=c.search;return y(t=>{x(!0),e(t).then(v).catch(()=>v([])).finally(()=>x(!1))},c.debounceMs??400)},[c.type===`server`?c.search:null]);n(()=>{if(c.type!==`server`||!w)return;let e=c.minChars??1,t=i.trim();if(t.length<e){v([]);return}w(t)},[i,c,w]);let T=c.type===`local`?C:_,E=h&&!u,D=e=>{o(e.value),s?.(e),g(!1)};return e(`div`,{class:`relative`,ref:S,children:[e(`input`,{type:`search`,value:i,placeholder:l,disabled:u,autoFocus:m,onInput:e=>{o(e.target.value),g(!0)},onFocus:()=>g(!0),class:p??`border border-gray-300 rounded px-2 py-1 text-xs w-36 disabled:bg-gray-50`,autocomplete:`off`}),E&&(b||T.length>0||c.type===`server`)&&e(`div`,{class:`absolute z-50 top-full left-0 mt-0.5 w-64 bg-white border border-gray-200 rounded shadow-lg max-h-48 overflow-y-auto text-xs`,children:[b&&e(`p`,{class:`px-3 py-2 text-gray-400`,children:d}),!b&&T.map(t=>e(`button`,{type:`button`,onMouseDown:()=>D(t),class:`w-full text-left px-3 py-2 hover:bg-blue-50 flex items-center justify-between gap-2`,children:[e(`span`,{class:`font-medium text-gray-800 truncate`,children:t.label}),t.meta&&e(`span`,{class:`shrink-0 font-mono text-gray-400 text-[10px]`,children:t.meta})]},t.key)),!b&&T.length===0&&e(`p`,{class:`px-3 py-2 text-gray-400`,children:f})]})]})}async function F(e){return e.trim()?(await s(`/tcf/vendors?q=${encodeURIComponent(e)}&limit=20`)).vendors.map(e=>({key:e.id,label:e.name,value:e.name,meta:`#${e.id}`,data:e})):[]}function I({vendorId:n,vendorName:r,onSelect:i,disabled:a}){let o=m(),[s,c]=t(``);return n&&!s?e(`div`,{class:`flex items-center gap-1 text-xs`,children:[e(`span`,{class:`font-mono text-blue-700 bg-blue-50 border border-blue-200 px-1.5 py-0.5 rounded`,children:n}),e(`span`,{class:`text-gray-600 truncate max-w-[100px]`,title:r,children:r??`Vendor ${n}`}),!a&&e(`button`,{type:`button`,onClick:()=>{i(null),c(``)},class:`text-gray-400 hover:text-red-500 ml-1 leading-none`,title:`Clear vendor`,children:`✕`})]}):e(P,{value:s,onChange:c,onSelect:e=>{e.data&&i(e.data),c(``)},source:{type:`server`,search:F,minChars:1},placeholder:o(`vendors.searchPlaceholder`),disabled:a,loadingText:o(`common.searching`),emptyText:o(`vendors.noResults`)})}var L=[{id:1,name:`Store and/or access information on a device`},{id:2,name:`Select basic ads`},{id:3,name:`Create a personalised ads profile`},{id:4,name:`Select personalised ads`},{id:5,name:`Create a personalised content profile`},{id:6,name:`Select personalised content`},{id:7,name:`Measure ad performance`},{id:8,name:`Measure content performance`},{id:9,name:`Apply market research to generate audience insights`},{id:10,name:`Develop and improve products`},{id:11,name:`Use limited data to select content`}];function R({selected:i,onChange:a}){let[o,s]=t(!1),c=r(null);n(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let l=e=>{a(i.includes(e)?i.filter(t=>t!==e).sort((e,t)=>e-t):[...i,e].sort((e,t)=>e-t))},u=i.length===0?`None selected`:i.length<=3?i.map(e=>`P${e}`).join(`, `):`${i.length} purposes`;return e(`div`,{class:`relative mt-1`,ref:c,children:[e(`button`,{type:`button`,onClick:()=>s(e=>!e),class:`flex items-center justify-between gap-1.5 w-full border rounded px-2 py-1 text-xs transition-colors ${o?`border-blue-400 ring-1 ring-blue-200`:`border-gray-300 hover:border-gray-400`} ${i.length>0?`text-blue-700 bg-blue-50`:`text-gray-500 bg-white`}`,children:[e(`span`,{class:`truncate`,children:u}),e(`svg`,{class:`shrink-0 w-3 h-3 text-gray-400 transition-transform ${o?`rotate-180`:``}`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,children:e(`path`,{d:`M2 4l4 4 4-4`,"stroke-linecap":`round`,"stroke-linejoin":`round`})})]}),o&&e(`div`,{class:`absolute z-50 top-full left-0 mt-0.5 w-64 bg-white border border-gray-200 rounded shadow-lg`,children:[e(`div`,{class:`flex items-center justify-between px-3 py-1.5 border-b border-gray-100`,children:[e(`span`,{class:`text-xs font-semibold text-gray-500 uppercase tracking-wide`,children:`Purposes`}),i.length>0&&e(`button`,{type:`button`,class:`text-xs text-gray-400 hover:text-red-500 transition-colors`,onClick:()=>a([]),children:`Clear all`})]}),e(`ul`,{class:`max-h-52 overflow-y-auto py-1`,children:L.map(t=>{let n=i.includes(t.id);return e(`li`,{children:e(`label`,{class:`flex items-start gap-2 px-3 py-1.5 cursor-pointer hover:bg-gray-50 transition-colors ${n?`bg-blue-50/60`:``}`,children:[e(`input`,{type:`checkbox`,class:`mt-0.5 accent-blue-600 shrink-0`,checked:n,onChange:()=>l(t.id)}),e(`span`,{class:`text-xs text-gray-700 leading-snug`,children:[e(`span`,{class:`font-semibold text-blue-700 mr-1`,children:[`P`,t.id]}),t.name]})]})},t.id)})})]})]})}function ee({cookie:t,idx:n,onChange:r,onRemove:i,duplicateIds:o,tcfEnabled:s,showCpra:c,categoryLegalBasis:l}){let u=m(),d=(e,n)=>r({...t,[e]:n}),f=(e,t)=>({...e,purpose:t,listenGpc:_[t].listenGpc,cpraCategory:_[t].cpraCategory}),p=N(t.id),h=e=>{let n=g[e.trim()]??N(e)?.category;n&&n!==t.purpose?r(f({...t,id:e},n)):r({...t,id:e})},y=a(()=>M.map(e=>({key:e.pattern,label:e.pattern,value:e.pattern,meta:e.vendor})),[]),b=!t.id.trim(),x=!b&&(o?.has(t.id.trim())??!1),S=b?`Required`:x?`Duplicate ID`:``,C=t.purpose?``:`Required`,w=t.purpose===`necessary`||l===`mandatory`,T=l!==`consent`,E=e=>{let n=e.target.value;n&&r(f(t,n))},D=n===void 0||n%2==0?`bg-white`:`bg-gray-10/50`;return e(`tr`,{class:`border-b align-top text-xs ${D}`,children:[e(`td`,{class:`py-2.5 pr-3 pl-1`,children:[e(P,{value:t.id,onChange:h,source:{type:`local`,items:y},placeholder:`analytics_storage`,emptyText:u(`consentTemplates.editor.idNoMatches`),inputClassName:`border rounded px-2 py-1.5 w-60 font-mono text-xs ${S?`border-red-400 bg-red-50`:`border-gray-300`}`}),S?e(`p`,{class:`text-xs text-red-500 mt-0.5`,children:S}):p&&e(`p`,{class:`text-xs text-gray-400 mt-0.5`,children:u(`cookieTemplates.editor.trackerDetected`,{vendor:p.vendor})})]}),e(`td`,{class:`py-2.5 pr-3`,children:[e(`select`,{class:`border rounded pl-2 pr-4 py-1.5 text-xs w-32 ${C?`border-red-400 bg-red-50`:`border-gray-300`}`,value:t.purpose??``,onChange:E,children:[e(`option`,{value:``,disabled:!0,children:u(`consentTemplates.editor.purposePlaceholder`)}),v.map(t=>e(`option`,{value:t,children:u(`consentTemplates.purpose.${t}`)},t))]}),C&&e(`p`,{class:`text-xs text-red-500 mt-0.5`,children:C})]}),e(`td`,{class:`py-2.5 pr-3 text-center`,children:e(`input`,{type:`checkbox`,class:`w-4 h-4 accent-blue-600`,checked:t.listenGpc,disabled:w,onChange:e=>d(`listenGpc`,e.target.checked),title:w?u(`consentTemplates.editor.gpcMandatoryTitle`):``})}),e(`td`,{class:`py-2.5 pr-3 text-center`,children:e(`input`,{type:`checkbox`,class:`w-4 h-4 accent-blue-600`,checked:T?!0:t.preGrant??!1,disabled:T,onChange:e=>d(`preGrant`,e.target.checked),title:T?`Already effectively pre-granted — only editable when the category legal basis is Consent`:``})}),s&&e(`td`,{class:`py-2.5 pr-3 min-w-[160px]`,children:[e(I,{vendorId:t.tcfVendorId,vendorName:t.tcfVendorName,onSelect:e=>r({...t,tcfVendorId:e?.id??void 0,tcfVendorName:e?.name??void 0,tcfPurposes:e?.purposes??void 0})}),t.tcfVendorId!=null&&e(R,{selected:t.tcfPurposes??[],onChange:e=>d(`tcfPurposes`,e.length>0?e:void 0)})]}),c&&e(`td`,{class:`py-2.5 pr-3`,children:e(`select`,{class:`border border-gray-300 rounded pl-2 pr-4 py-1.5 text-xs w-28`,value:t.cpraCategory??``,onChange:e=>{let t=e.target.value;d(`cpraCategory`,t||void 0)},children:[e(`option`,{value:``,children:`—`}),e(`option`,{value:`sale`,children:`Sale`}),e(`option`,{value:`sharing`,children:`Sharing`}),e(`option`,{value:`sensitive`,children:`Sensitive`})]})}),e(`td`,{class:`py-2.5 text-center`,children:e(`button`,{type:`button`,onClick:i,class:`text-red-400 hover:text-red-600 text-lg leading-none px-1`,title:`Remove`,children:`✕`})})]})}function z({cat:t,onChange:n,onRemove:r,cookieOptions:i}){let a=!t.id.trim();return e(`div`,{class:`border rounded-lg p-3 bg-gray-50 ${a?`border-red-200`:`border-gray-200`}`,children:e(`div`,{class:`grid grid-cols-2 lg:grid-cols-[1fr_1fr_1fr_auto] gap-3`,children:[e(`div`,{children:[e(`label`,{class:`block text-xs text-gray-500 mb-0.5`,children:[`Category ID `,e(`span`,{class:`text-red-500`,children:`*`})]}),e(`input`,{class:`w-full border rounded px-2 py-1 font-mono text-xs ${a?`border-red-300 bg-red-50`:`border-gray-300`}`,value:t.id,onInput:e=>n({id:e.target.value}),placeholder:`analytics`}),a&&e(`p`,{class:`text-xs text-red-500 mt-0.5`,children:`Required`})]}),e(u,{value:t.headingTag,onChange:e=>n({headingTag:e}),label:`Heading Tag`}),e(`div`,{children:[e(`label`,{class:`block text-xs text-gray-500 mb-0.5`,children:`Legal Basis`}),e(`select`,{class:`w-full border border-gray-300 rounded px-2 py-1 text-xs`,value:t.legalBasis,onChange:e=>n({legalBasis:e.target.value}),children:[e(`option`,{value:`consent`,children:`Consent`}),e(`option`,{value:`legitimate_interest`,children:`Legitimate Interest`}),e(`option`,{value:`mandatory`,children:`Mandatory / Strictly Necessary`})]}),t.legalBasis===`legitimate_interest`&&e(`p`,{class:`text-xs text-gray-400 mt-0.5`,children:`Balancing-test description is authored per-locale on the profile, in Preference Modal content.`})]}),e(`div`,{class:`flex items-start`,children:e(`button`,{type:`button`,onClick:r,class:`text-red-400 hover:text-red-600 text-lg leading-none p-1`,title:`Remove category`,children:`✕`})}),e(`div`,{class:`col-span-2 lg:col-span-4`,children:[e(`label`,{class:`block text-xs text-gray-500 mb-0.5`,children:[`Cookies in this category `,e(`span`,{class:`text-red-500`,children:`*`})]}),e(l,{value:t.cookies.length?t.cookies:void 0,onChange:e=>n({cookies:Array.isArray(e)?e:[]}),showSpecial:!1,extraCookies:i}),!t.cookies.length&&e(`p`,{class:`text-xs text-red-500 mt-0.5`,children:`Select at least one cookie`})]})]})})}function B(){return{id:``,listenGpc:!0}}function V(){return{id:``,headingTag:`h3`,legalBasis:`consent`,cookies:[]}}function H(e){return[{field:`ID`,label:`Cookie ID`,Icon:j,description:`A unique machine-readable identifier for this cookie or tracking purpose.`,usage:`Must match exactly what your frontend widget references (e.g. analytics_storage, ad_storage). Used in GTM / Google Consent Mode v2 consent states.`,laws:[{name:`GDPR`,text:`Each processing purpose must be clearly identified and disclosed in your privacy notice (Art. 13/14).`},{name:`ePrivacy`,text:`Non-essential cookies require prior informed consent. ID is what links consent to a specific purpose.`}],examples:`necessary · analytics_storage · ad_storage · ad_user_data · ad_personalization · functional`},{field:`Purpose`,label:`Cookie Purpose`,Icon:k,description:`A fixed classification that tells Consenti what this cookie is for. Because cookie IDs are free-form (e.g. "r_dash"), the purpose is what integrations, compliance checks and reports rely on. Selecting a purpose pre-fills GPC handling and CPRA category — you can still adjust each afterwards.`,usage:[`Necessary: strictly required to deliver the requested service or ensure security (login session, CSRF, payment, the consent cookie itself). Always granted — the visitor cannot opt out.`,`Functional: optional features that enhance the experience but are not essential (live chat widget, embedded maps, accessibility enhancements).`,`Preferences: remember user choices — "Remember me" (theme, language, currency, timezone).`,`Analytics: measure usage and performance (Google Analytics, Clarity, Hotjar, Mixpanel).`,`Marketing: advertising, profiling, cross-site tracking, retargeting (Meta Pixel, Google Ads, TikTok Pixel).`],laws:[{name:`GDPR Art. 5(1)(b)`,text:`Purpose limitation: personal data must be collected for specified, explicit and legitimate purposes and not further processed incompatibly.`},{name:`ePrivacy Dir. Art. 5(3)`,text:`Consent must be informed — the user must know what each cookie is for. A clear purpose per cookie is the basis of a valid consent request.`}],examples:`security_storage → Necessary · personalization_storage → Preferences · analytics_storage → Analytics · ad_storage → Marketing`},{field:`Listen GPC`,label:`Honor GPC Signal`,Icon:h,description:`When enabled, this cookie is automatically denied if the visitor's browser sends a Global Privacy Control signal.`,usage:`GPC is signalled via the Sec-GPC: 1 HTTP header or navigator.globalPrivacyControl. When honored, non-essential cookies are pre-denied before showing any banner.`,laws:[{name:`CCPA / CPRA (California)`,text:`Legally required to honor GPC as a valid opt-out of sale/sharing. CA AG has enforced this.`},{name:`Colorado CPA`,text:`Must honor universal opt-out signals including GPC from July 2024.`},{name:`Connecticut CTDPA`,text:`Must honor GPC from 2024.`},{name:`GDPR`,text:`No legal obligation, but highly recommended as a privacy-friendly practice.`}],examples:`Enable for all non-mandatory cookies. Disable only for strictly necessary (mandatory) cookies.`},{field:`Pre Grant`,label:`Pre Grant`,Icon:O,description:`Pre-grant means that the cookie is enabled by default and the user must actively opt-out to disable it.`,usage:[`Pre grant "consent" cookies if you are creating a opt-in style profile`,`Legitimate interest cookies are pre-granted by default, meaning users must actively opt-out to disable them.`,`Mandatory cookies are pre-granted by default, and users cannot opt-out of them.`],laws:[{name:``,text:`Check with guidlines for the by default opt-in for the cookies`}],examples:`server-side analytics`},{field:`TCF Vendors`,label:`TCF Vendor IDs`,Icon:D,description:`Links this cookie purpose to one or more IAB-registered ad-tech vendor IDs from the Global Vendor List (GVL). Required to generate a valid TC String.`,usage:[`Enable the "TCF Vendors" column to expose a vendor ID input per cookie row.`,`Enter the numeric GVL ID(s) for every ad-tech vendor that processes data under this purpose (e.g. 755 for Google, 32 for AppNexus).`,`Consenti encodes these IDs along with the accepted purposes into a Base64 TC String, which ad platforms read from the cookie to determine which vendors are authorised to fire.`,`Without vendor IDs, the TC String will be invalid and compliant ad platforms will refuse to fire their tags.`],laws:[{name:`IAB TCF v2.3`,text:`A TC String must encode both purpose consents and vendor consents. Each vendor must be explicitly listed by its GVL ID — blanket consent is not permitted.`},{name:`GDPR Art. 6(1)(a)`,text:`Consent must be specific to each vendor and each purpose. Bundling all vendors into one consent decision is invalid.`},{name:`GDPR Art. 13/14`,text:`Your privacy notice must name every processor. TCF vendor IDs correspond to the processors you must disclose.`},{name:`ePrivacy Dir.`,text:`TCF is the standard mechanism for obtaining valid ad-tech consent under ePrivacy across the EU/EEA.`}],examples:`755 (Google Advertising Products) · 32 (AppNexus) · 91 (Criteo) · 52 (IAB Europe) — look up IDs on the TCF Vendors page`,link:{url:`#/vendors`,label:`nav.vendors`}},{field:`CPRA Category`,label:`CPRA Data Category`,Icon:f,description:`Maps this cookie to a California Privacy Rights Act (CPRA) data category. Required to correctly scope Do Not Sell / Share opt-out rights and Sensitive PI restrictions.`,usage:[`Enable the "CPRA Category" column to assign a data category to each cookie row.`,`"Personal Information" (PI): standard consumer data subject to the right to opt-out of sale/sharing.`,`"Sensitive Personal Information" (SPI): a restricted subset (precise geolocation, race, health, biometrics, etc.) that triggers additional opt-out and use-limitation rights. Consumers can direct you to limit use to what is necessary for providing the service.`,`"Non-PI": data that does not meet CCPA's definition of personal information — no opt-out required.`],laws:[{name:`CPRA / CCPA § 1798.100`,text:`Consumers have the right to know what personal information is collected and to opt-out of its sale or sharing.`},{name:`CPRA § 1798.121`,text:`Consumers have the right to limit the use and disclosure of sensitive personal information. Businesses must provide a clear "Limit Use of My SPI" link.`},{name:`CPRA § 1798.140(ae)`,text:`Sensitive PI includes precise geolocation, racial/ethnic origin, religious beliefs, genetic data, biometric data, health data, sexual orientation, and contents of communications.`},{name:`CPRA / GPC`,text:`A GPC signal constitutes a valid opt-out of sale and sharing for PI. Pairing CPRA Category with the "Honor GPC" flag ensures the correct cookies are denied automatically.`}],examples:`analytics_storage → PersonalInfo · ad_storage → PersonalInfo · precise_location → SensitivePI · session → Non-PI`},{field:`Legal Basis`,label:`Legal Basis`,Icon:A,description:`The legal ground under which you process data associated with this cookie.`,usage:[`Consent (default): The user actively opts in. Required for advertising, most analytics, and non-essential cookies. Show the banner before any processing.`,`Legitimate Interest: You may process on a compelling business need, but must pass a 3-part balancing test, document it, and provide an easy objection mechanism. The balancing-test description is entered per-profile, per-locale in the Preference Modal content step.`,e(`cookieTemplates.editor.legalBasis.mandatoryUsage`)],laws:[{name:`GDPR Art. 6(1)(a)`,text:`Consent as a lawful basis. Must be freely given, specific, informed, and unambiguous.`},{name:`GDPR Art. 6(1)(f)`,text:`Legitimate interests. Cannot override fundamental rights/freedoms of data subjects.`},{name:`ePrivacy Dir. Art. 5(3)`,text:`For cookies: consent is the default rule. LI is generally NOT available for tracking cookies under ePrivacy.`},{name:e(`cookieTemplates.editor.legalBasis.mandatoryLawName`),text:e(`cookieTemplates.editor.legalBasis.mandatoryLawText`)}],examples:e(`cookieTemplates.editor.legalBasis.examples`)}]}function U({id:r,current:o}){let s=m(),l=H(s),u=!r||r===`new`;p(s(u?`consentTemplates.editor.title.new`:`consentTemplates.editor.title.edit`));let[f,h]=t(``),[g,_]=t(``),[v,y]=t([]),[D,O]=t([]),[k,A]=t(``),[j,M]=t([]),[N,P]=t(0),[F,I]=t(!1),[L,R]=t(!1),[U,W]=t(!1),[G,K]=t(!u),{requestConfirm:q,dialog:J}=d();n(()=>{!u&&r&&b.get(r).then(e=>{h(e.name),y(w(e.cookies)),O(E(e.categories))}).catch(()=>A(s(`consentTemplates.editor.error.notFound`))).finally(()=>K(!1))},[r,u]);let Y=v.reduce((e,t)=>{let n=t.id.trim();return n&&(e[n]=(e[n]??0)+1),e},{}),X=new Set(Object.entries(Y).filter(([,e])=>e>1).map(([e])=>e)),Z=a(()=>v.filter(e=>e.id.trim()).map(e=>({id:e.id.trim()})),[v]),Q=a(()=>{let e=new Map;for(let t of D)for(let n of t.cookies)e.set(n,t);return e},[D]),te=async()=>{let e=!0;if(f.trim()||(_(s(`consentTemplates.editor.nameRequired`)),e=!1),v.some(e=>!e.id.trim())&&(A(s(`consentTemplates.editor.error.allIds`)),e=!1),v.some(e=>!e.purpose)&&(A(s(`consentTemplates.editor.error.purpose`)),e=!1),X.size>0&&(A(s(`consentTemplates.editor.error.uniqueIds`)),e=!1),!e)return;let t=D.map(e=>e.id.trim());if(D.length===0){A(s(`consentTemplates.editor.error.noCategories`));return}if(D.some(e=>!e.id.trim())){A(s(`consentTemplates.editor.error.catIds`));return}if(new Set(t).size!==t.length){A(s(`consentTemplates.editor.error.uniqueCatIds`));return}if(D.some(e=>!e.cookies.length)){A(s(`consentTemplates.editor.error.catCookies`));return}let n=new Map;for(let e of v)n.set(e.id.trim(),0);for(let e of D)for(let t of e.cookies)n.set(t,(n.get(t)??0)+1);for(let[e,t]of n){if(t===0){A(s(`consentTemplates.editor.error.uncategorized`,{id:e}));return}if(t>1){A(s(`consentTemplates.editor.error.multiCategory`,{id:e}));return}}let i=[];for(let e of v){let t=Q.get(e.id.trim());if(t){if(t.legalBasis===`mandatory`&&e.purpose!==`necessary`){A(s(`consentTemplates.editor.error.purposeLegalBasisMismatch`,{id:e.id}));return}t.legalBasis!==`mandatory`&&e.purpose===`necessary`&&i.push(s(`consentTemplates.editor.warning.necessaryNotMandatory`,{id:e.id}))}}if(M(i),!u&&r){let e=await b.profileUsage(r).catch(()=>[]);if(e.length>0){let t=e.map(e=>`"${e.name}"`).join(`, `);if(!await q({title:s(e.length===1?`consentTemplates.editor.confirmUpdate.titleSingular`:`consentTemplates.editor.confirmUpdate.title`,{n:e.length}),message:s(`consentTemplates.editor.confirmUpdate.message`,{names:t})}))return}}A(``),_(``),W(!0);try{let e=T(v),t=S(D);u?await b.create({name:f,cookies:e,categories:t}):await b.update(r,{name:f,cookies:e,categories:t}),window.location.hash=`#/banners/consent-templates`}catch(e){A(c(e,s(`consentTemplates.editor.error.failed`)))}finally{W(!1)}},$=l[N];return e(i,{children:[J,G&&e(`p`,{class:`text-sm text-gray-400`,role:`status`,"aria-live":`polite`,children:s(`common.loading`)}),!G&&e(`div`,{class:`space-y-5`,children:e(`div`,{class:`grid grid-cols-1 xl:grid-cols-[2fr_1fr] gap-5 items-start`,children:[e(`div`,{class:`bg-white border border-gray-200 rounded-lg p-5`,children:[e(`div`,{class:`py-5`,children:[e(`label`,{for:`template-name`,class:`block text-sm font-medium text-gray-700 mb-1`,children:[s(`consentTemplates.editor.name`),` `,e(`span`,{class:`text-red-500`,"aria-hidden":`true`,children:`*`})]}),e(`input`,{id:`template-name`,class:`w-full border rounded px-3 py-2 text-sm ${g?`border-red-400 bg-red-50`:`border-gray-300`}`,value:f,onInput:e=>{h(e.target.value),_(``)},placeholder:s(`consentTemplates.editor.namePlaceholder`),required:!0,"aria-required":`true`}),g&&e(`p`,{role:`alert`,class:`text-xs text-red-500 mt-1`,children:g})]}),u&&v.length===0&&D.length===0&&e(`div`,{class:`bg-amber-50 border border-amber-200 rounded-lg p-4 flex items-center justify-between gap-4`,children:[e(`p`,{class:`text-sm text-amber-800`,children:s(`consentTemplates.editor.loadDefaultsPrompt`)}),e(`button`,{type:`button`,onClick:()=>{y(C()),O(x())},class:`shrink-0 bg-amber-700 text-white text-xs px-3 py-1.5 rounded hover:bg-amber-800 transition-colors`,children:s(`consentTemplates.editor.loadDefaultsBtn`)})]}),e(`div`,{class:`flex items-center justify-between my-4`,children:[e(`div`,{children:[e(`h3`,{class:`text-sm font-semibold text-gray-700`,children:s(`consentTemplates.editor.definitions`)}),e(`p`,{class:`text-xs text-gray-500 mt-0.5`,children:[`IDs must match what the frontend widget uses (e.g. `,e(`code`,{class:`font-mono bg-gray-100 px-1 rounded`,children:`analytics_storage`}),`).`]})]}),e(`div`,{class:`flex items-center gap-3`,children:[e(`label`,{class:`flex items-center gap-1.5 text-xs text-gray-600 cursor-pointer select-none`,children:[e(`input`,{type:`checkbox`,class:`accent-blue-600`,checked:F,onChange:e=>I(e.target.checked)}),s(`consentTemplates.editor.showTcf`)]}),e(`label`,{class:`flex items-center gap-1.5 text-xs text-gray-600 cursor-pointer select-none`,children:[e(`input`,{type:`checkbox`,class:`accent-blue-600`,checked:L,onChange:e=>R(e.target.checked)}),s(`consentTemplates.editor.showCpra`)]}),e(`button`,{type:`button`,onClick:()=>y(e=>[...e,B()]),class:`text-sm text-blue-600 hover:underline shrink-0`,children:s(`consentTemplates.editor.addCookie`)})]})]}),e(`div`,{class:`overflow-x-auto`,children:e(`table`,{class:`w-full text-xs`,children:[e(`thead`,{children:e(`tr`,{class:`text-left text-gray-500 border-b border-gray-200`,children:[e(`th`,{scope:`col`,class:`pb-2 pr-3 pl-1 font-medium`,children:e(`button`,{type:`button`,class:`hover:text-blue-600 transition-colors`,onClick:()=>P(0),children:[s(`consentTemplates.col.idShort`),` `,e(`span`,{class:`text-red-500`,"aria-hidden":`true`,children:`*`})]})}),e(`th`,{scope:`col`,class:`pb-2 pr-3 font-medium`,children:e(`button`,{type:`button`,class:`hover:text-blue-600 transition-colors`,onClick:()=>P(1),children:[s(`consentTemplates.col.purposeShort`),` `,e(`span`,{class:`text-red-500`,"aria-hidden":`true`,children:`*`})]})}),e(`th`,{scope:`col`,class:`pb-2 pr-3 font-medium text-center`,children:e(`button`,{type:`button`,class:`hover:text-blue-600 transition-colors`,onClick:()=>P(2),children:s(`consentTemplates.col.gpcShort`)})}),e(`th`,{scope:`col`,class:`pb-2 pr-3 font-medium text-center`,children:e(`button`,{type:`button`,class:`hover:text-blue-600 transition-colors`,onClick:()=>P(3),children:s(`consentTemplates.col.preGrantShort`)})}),F&&e(`th`,{scope:`col`,class:`pb-2 pr-3 font-medium text-blue-700`,children:e(`button`,{type:`button`,class:`hover:text-blue-600 transition-colors`,onClick:()=>P(4),children:s(`consentTemplates.col.tcfVendorShort`)})}),L&&e(`th`,{scope:`col`,class:`pb-2 pr-3 font-medium text-purple-700`,children:e(`button`,{type:`button`,class:`hover:text-blue-600 transition-colors`,onClick:()=>P(5),children:s(`consentTemplates.col.cpraCategoryShort`)})}),e(`th`,{scope:`col`,class:`pb-2 text-center font-medium`})]})}),e(`tbody`,{children:v.map((t,n)=>e(ee,{cookie:t,idx:n,onChange:e=>y(t=>t.map((t,r)=>r===n?e:t)),onRemove:()=>y(e=>e.filter((e,t)=>t!==n)),duplicateIds:X,tcfEnabled:F,showCpra:L,categoryLegalBasis:Q.get(t.id.trim())?.legalBasis},n))})]})}),v.length===0&&e(`p`,{class:`text-sm text-gray-400 text-center py-4`,children:[s(`consentTemplates.editor.empty`),e(`br`,{}),` `,e(`br`,{}),e(`button`,{type:`button`,onClick:()=>y(e=>[...e,B()]),class:`text-sm text-blue-600 hover:underline shrink-0`,children:s(`consentTemplates.editor.addCookie`)})]}),e(`div`,{class:`mt-8`,children:[e(`div`,{class:`flex items-center justify-between mb-2`,children:[e(`h3`,{class:`text-sm font-semibold text-gray-700`,children:s(`consentTemplates.editor.categories`)}),e(`button`,{type:`button`,onClick:()=>O(e=>[...e,V()]),class:`text-sm text-blue-600 hover:underline shrink-0`,children:s(`consentTemplates.editor.addCategory`)})]}),e(`p`,{class:`text-xs text-gray-400 mb-3`,children:`Each category groups parameters and owns their legal basis. A parameter must belong to exactly one category.`}),e(`div`,{class:`space-y-3`,children:D.map((t,n)=>e(z,{cat:t,onChange:e=>O(t=>t.map((t,r)=>r===n?{...t,...e}:t)),onRemove:()=>O(e=>e.filter((e,t)=>t!==n)),cookieOptions:Z},n))}),D.length===0&&e(`p`,{class:`text-sm text-gray-400 text-center py-4`,children:s(`consentTemplates.editor.noCategories`)})]}),e(`div`,{className:`mt-7`,children:[j.length>0&&e(`div`,{class:`mb-3 space-y-1`,children:j.map((t,n)=>e(`p`,{class:`text-sm text-amber-700 bg-amber-50 border border-amber-200 rounded px-3 py-2`,children:t},n))}),k&&e(`p`,{role:`alert`,class:`text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2 my-4`,children:k}),e(`div`,{class:`flex justify-between`,children:[e(`a`,{href:`#/banners/consent-templates`,class:`px-5 py-2 rounded-lg text-sm text-red-600 hover:bg-red-100 transition-colors`,children:s(`common.cancel`)}),e(`button`,{type:`button`,onClick:te,disabled:U,class:`bg-blue-600 text-white px-5 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:s(U?`common.saving`:u?`consentTemplates.editor.action.create`:`consentTemplates.editor.action.save`)})]})]})]}),e(`div`,{class:`bg-white border border-gray-200 rounded-lg p-5 xl:sticky xl:top-4`,children:[e(`p`,{class:`text-xs text-gray-400 mb-3 uppercase tracking-wide font-semibold`,children:s(`consentTemplates.editor.infoHint`)}),e(`div`,{class:`flex flex-wrap gap-1.5 mb-4`,children:l.map((t,n)=>e(`button`,{type:`button`,onClick:()=>P(n),class:`text-xs px-2.5 py-1 rounded-full border transition-colors ${N===n?`bg-blue-600 text-white border-blue-600`:`border-gray-300 text-gray-600 hover:border-blue-400`}`,children:t.field},n))}),$&&e(`div`,{class:`space-y-3`,children:[e(`div`,{class:`flex items-center gap-2`,children:[e($.Icon,{size:18,className:`text-gray-600 shrink-0`}),e(`h4`,{class:`font-semibold text-gray-800 text-sm`,children:$.label}),e(`a`,{href:$.link?.url,target:$.link?.url?.startsWith(`http`)?`_blank`:void 0,class:`text-xs text-blue-600 hover:underline whitespace-nowrap shrink-0 ml-auto`,children:s($.link?.label)})]}),e(`p`,{class:`text-xs text-gray-600 leading-relaxed`,children:$.description}),e(`div`,{class:`bg-blue-50 border border-blue-100 rounded p-3`,children:[e(`p`,{class:`text-xs font-semibold text-blue-700 mb-1`,children:s(`consentTemplates.editor.infoUsage`)}),Array.isArray($.usage)?e(`ul`,{class:`list-decimal list-inside`,children:$.usage.map((t,n)=>e(`li`,{class:`text-xs text-blue-800 leading-relaxed whitespace-pre-line`,children:t},n))}):e(`p`,{class:`text-xs text-blue-800 leading-relaxed whitespace-pre-line`,children:$.usage})]}),e(`div`,{children:[e(`p`,{class:`text-xs font-semibold text-gray-600 mb-2`,children:s(`consentTemplates.editor.infoLaws`)}),e(`div`,{class:`space-y-2`,children:$.laws.map((t,n)=>e(`div`,{class:`bg-amber-50 border border-amber-100 rounded p-2.5`,children:[e(`span`,{class:`text-xs font-bold text-amber-700`,children:[t.name,` `]}),e(`span`,{class:`text-xs text-amber-800`,children:t.text})]},n))})]}),e(`div`,{class:`bg-gray-50 border border-gray-200 rounded p-2.5`,children:[e(`p`,{class:`text-xs font-semibold text-gray-600 mb-1`,children:s(`consentTemplates.editor.infoExamples`)}),e(`p`,{class:`text-xs text-gray-500 font-mono leading-relaxed`,children:$.examples})]})]})]})]})})]})}export{U as ConsentTemplateEditor};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,l as n,n as r,p as i}from"./createLucideIcon-DAiYBrnd.js";import{t as a}from"./client-CYntrO2g.js";import{t as o}from"./copy-DEi_W2TM.js";import{n as s,t as c}from"./trash-O30ycMcz.js";import{t as l}from"./ConfirmDialog-BDlnfTdx.js";import{o as u,s as d}from"./index-Tr_BcjkN.js";import{t as f}from"./Table-BUxoz0YR.js";import{c as p,o as m}from"./dist-GoiMJCTt.js";import{t as h}from"./templates-DY68xNys.js";function g({current:g}){let _=d();u(_(`consentTemplates.title`));let[v,y]=t([]),[b,x]=t(!0),[S,C]=t(null),[w,T]=t(null),{requestConfirm:E,dialog:D}=l(),O=()=>{x(!0),h.list().then(y).catch(()=>y([])).finally(()=>x(!1))};n(()=>{O()},[]);let k=async(e,t)=>{if(await E({title:_(`consentTemplates.dialog.delete.title`,{name:t}),message:_(`consentTemplates.dialog.delete.message`)}))try{await h.delete(e),O()}catch(e){if(e instanceof a&&e.status===422)try{let t=JSON.parse(e.message);if(t.details?.profiles?.length){C(t.details.profiles);return}}catch{}}},A=async(e,t)=>{try{let n=await h.profileUsage(e);if(n.length>0){T({id:e,name:t,profiles:n.map(e=>({id:e.id,name:e.name,isActive:e.isActive??!1}))});return}}catch{}window.location.hash=`#/banners/consent-templates/${e}`},j=async(e,t)=>{await h.copy(e,`${t} (Copy)`).catch(()=>null),O()},M=v.length,N=_(M===1?`consentTemplates.countSingular`:`consentTemplates.count`,{n:M});return e(i,{children:[D,S&&r(e(`div`,{class:`fixed inset-0 z-50 flex items-center justify-center`,children:[e(`div`,{class:`absolute inset-0 bg-black/40`,onClick:()=>C(null),"aria-hidden":`true`}),e(`div`,{class:`relative bg-white rounded-xl shadow-2xl p-6 w-full max-w-md mx-4 space-y-4`,children:[e(`h3`,{class:`text-sm font-semibold text-gray-900`,children:`Cannot delete template`}),e(`p`,{class:`text-sm text-gray-600`,children:`This consent template is used by the following profiles. Delete or reassign those profiles first:`}),e(`ul`,{class:`space-y-1 max-h-48 overflow-y-auto`,children:S.map(t=>e(`li`,{class:`flex items-center gap-2 text-sm`,children:[e(`span`,{class:`text-xs px-1.5 py-0.5 rounded-full font-medium ${t.isActive?`bg-green-100 text-green-700`:`bg-gray-100 text-gray-500`}`,children:t.isActive?`Active`:`Inactive`}),e(`a`,{href:`#/banners/profiles/${t.id}`,class:`text-blue-600 hover:underline`,onClick:()=>C(null),children:t.name})]},t.id))}),e(`button`,{type:`button`,onClick:()=>C(null),class:`w-full border border-gray-300 text-gray-700 px-4 py-2 rounded-lg text-sm hover:bg-gray-50 transition-colors`,children:_(`common.close`)})]})]}),document.body),w&&r(e(`div`,{class:`fixed inset-0 z-50 flex items-center justify-center`,children:[e(`div`,{class:`absolute inset-0 bg-black/40`,onClick:()=>T(null),"aria-hidden":`true`}),e(`div`,{class:`relative bg-white rounded-xl shadow-2xl p-6 w-full max-w-md mx-4 space-y-4`,children:[e(`h3`,{class:`text-sm font-semibold text-gray-900`,children:`Template used in profiles`}),e(`p`,{class:`text-sm text-gray-600`,children:`This template is used in the following profiles. After editing, open and save each profile for changes to take effect in their JSON files:`}),e(`ul`,{class:`space-y-1 max-h-48 overflow-y-auto`,children:w.profiles.map(t=>e(`li`,{class:`flex items-center gap-2 text-sm`,children:[e(`span`,{class:`text-xs px-1.5 py-0.5 rounded-full font-medium ${t.isActive?`bg-green-100 text-green-700`:`bg-gray-100 text-gray-500`}`,children:t.isActive?`Active`:`Inactive`}),e(`span`,{class:`text-gray-700`,children:t.name})]},t.id))}),e(`div`,{class:`flex flex-col gap-2`,children:[e(`button`,{type:`button`,onClick:()=>{let e=w.id;T(null),window.location.hash=`#/banners/consent-templates/${e}`},class:`w-full bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 transition-colors`,children:`Continue to edit`}),e(`button`,{type:`button`,onClick:()=>T(null),class:`w-full border border-gray-300 text-gray-700 px-4 py-2 rounded-lg text-sm hover:bg-gray-50 transition-colors`,children:_(`common.cancel`)})]})]})]}),document.body),e(`div`,{class:`flex justify-between items-center mb-4`,children:[e(`p`,{class:`text-sm text-gray-500`,children:N}),e(`a`,{href:`#/banners/consent-templates/new`,class:`bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 transition-colors`,children:_(`consentTemplates.new`)})]}),e(f,{loading:b,keyFn:e=>e.id,rows:v,emptyText:_(`consentTemplates.empty.title`),search:{placeholder:_(`consentTemplates.search.placeholder`),keys:e=>{let t=e;return[t.name,...Object.keys(t.cookies),...Object.values(t.categories).map(e=>e.heading)]}},columns:[{key:`name`,label:_(`consentTemplates.col.name`),render:t=>e(`span`,{class:`font-medium text-sm text-gray-900`,children:t.name})},{key:`categories`,label:_(`consentTemplates.col.categories`),render:t=>e(`div`,{class:`flex flex-wrap gap-1 max-w-xs`,children:Object.values(t.categories).map(t=>e(`span`,{class:`text-xs px-2 py-0.5 rounded-full bg-purple-100 text-purple-700`,children:t.heading},t.heading))})},{key:`cookies`,label:_(`consentTemplates.col.cookies`),render:t=>{let n=t,r=Object.entries(n.cookies),i=m(n.categories);return e(`div`,{class:`flex flex-wrap gap-1 max-w-xl`,children:r.map(([t,n])=>{let r=p(t,i);return e(`span`,{class:`text-xs px-2 py-0.5 rounded-full ${r?`bg-blue-100 text-blue-700`:`bg-gray-100 text-gray-600`}`,children:[t,r?` (${_(`consentTemplates.required`)})`:``,n.tcfVendorId?` TCF:${n.tcfVendorId}`:``,n.cpraCategory?` CPRA:${n.cpraCategory}`:``]},t)})})}},{key:`meta`,label:_(`common.updated`),render:t=>{let n=t,r=Object.entries(n.cookies),i=m(n.categories),a=r.filter(([e])=>p(e,i)).length;return e(`span`,{class:`text-xs text-gray-500`,children:[r.length,` `,_(`consentTemplates.col.id`).toLowerCase(),` — `,a,` `,_(`common.mandatory`),` · `,new Date(n.updatedAt).toLocaleDateString()]})}},{key:`actions`,label:``,render:t=>{let n=t;return e(`div`,{class:`flex items-center gap-3 justify-end`,children:[e(`button`,{onClick:()=>j(n.id,n.name),class:`text-gray-400 hover:text-blue-600 transition-colors`,title:_(`common.duplicate`),"aria-label":_(`common.duplicate`),children:e(o,{size:14,"aria-hidden":`true`})}),e(`button`,{onClick:()=>A(n.id,n.name),class:`text-blue-600 hover:text-blue-800 transition-colors`,title:_(`common.edit`),"aria-label":_(`common.edit`),children:e(s,{size:14,"aria-hidden":`true`})}),e(`button`,{onClick:()=>k(n.id,n.name),class:`text-red-400 hover:text-red-600 transition-colors`,title:_(`common.delete`),"aria-label":_(`common.delete`),children:e(c,{size:14,"aria-hidden":`true`})})]})}}]})]})}export{g as ConsentTemplateList};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,l as n,n as r,o as i,t as a}from"./createLucideIcon-DAiYBrnd.js";import{t as o}from"./check-D0g4XvmN.js";import{g as s}from"./index-Tr_BcjkN.js";import{t as c}from"./templates-DY68xNys.js";var l=a(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);function u(e){return e===`*`?`* — Accept all cookies`:e===`!`?`! — Deny non mandatory cookies`:Array.isArray(e)&&e.length>0?e.join(`, `):``}function d({value:a,onChange:d,showSpecial:f=!0,extraCookies:p,disabled:m=!1,placeholder:h=`Select cookies/parameters…`}){let[g,_]=t(!1),[v,y]=t(null),[b,x]=t([]),S=i(null),C=i(null);n(()=>{c.list().then(x).catch(()=>{})},[]),n(()=>{let e=e=>{let t=S.current?.contains(e.target),n=C.current?.contains(e.target);!t&&!n&&_(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),n(()=>{if(!g)return;let e=e=>{C.current?.contains(e.target)||_(!1)};return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>window.removeEventListener(`scroll`,e,!0)},[g]);let w=()=>{if(!m){if(!g&&S.current){let e=S.current.getBoundingClientRect();window.innerHeight-e.bottom>=280?y({top:e.bottom+4,left:e.left}):y({bottom:window.innerHeight-e.top+4,left:e.left})}_(e=>!e)}},T=b.flatMap(e=>Object.keys(e.cookies).map(t=>({id:t,source:e.name}))),E=[...p??[],...T].filter((e,t,n)=>n.findIndex(t=>t.id===e.id)===t),D=e=>e===`*`?a===`*`:e===`!`?a===`!`:Array.isArray(a)&&a.includes(e),O=e=>{if(e===`*`){d(a===`*`?void 0:`*`);return}if(e===`!`){d(a===`!`?void 0:`!`);return}let t=Array.isArray(a)?[...a]:[],n=t.includes(e)?t.filter(t=>t!==e):[...t,e];d(n.length?n:void 0)},k=u(a),A={position:`fixed`,zIndex:9999,left:`${v?.left??0}px`,width:`288px`,...v?.top===void 0?{bottom:`${v?.bottom??0}px`}:{top:`${v.top}px`}};return e(`div`,{class:`relative`,ref:S,children:[e(`button`,{type:`button`,disabled:m,onClick:w,class:`w-full text-left border rounded px-2 py-1.5 text-xs flex items-center justify-between gap-1 ${m?`bg-gray-50 text-gray-400 border-gray-200 cursor-not-allowed`:`bg-white border-gray-300 hover:border-blue-400 cursor-pointer transition-colors`}`,children:[e(`span`,{class:k?`font-mono text-gray-800`:`text-gray-400`,children:k||h}),e(`span`,{class:`text-gray-400 shrink-0 ml-1`,children:e(g?l:s,{size:12})})]}),g&&v&&r(e(`div`,{ref:C,style:A,class:`bg-white border border-gray-200 rounded-lg shadow-xl max-h-64 overflow-y-auto`,children:[f&&e(`div`,{class:`border-b border-gray-100`,children:[e(`p`,{class:`text-xs font-semibold text-gray-400 px-3 pt-2 pb-1 uppercase tracking-wide`,children:`Special`}),[{id:`*`,label:`Accept all cookies`,sub:`Grants every cookie in this profile`},{id:`!`,label:`Reject non mandatory cookies`,sub:`Denies non mandatory cookies in this profile`}].map(t=>e(`button`,{type:`button`,class:`w-full text-left flex items-center gap-2.5 px-3 py-2 hover:bg-gray-50 ${D(t.id)?`bg-blue-50`:``}`,onClick:()=>O(t.id),children:[e(`span`,{class:`w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center text-xs ${D(t.id)?`bg-blue-600 border-blue-600 text-white`:`border-gray-300`}`,children:D(t.id)?e(o,{size:10}):null}),e(`div`,{class:`min-w-0`,children:[e(`span`,{class:`font-mono text-xs font-semibold text-gray-700`,children:t.id}),e(`span`,{class:`text-xs text-gray-400 ml-1.5`,children:t.label}),e(`p`,{class:`text-xs text-gray-400`,children:t.sub})]})]},t.id))]}),e(`div`,{children:[e(`p`,{class:`text-xs font-semibold text-gray-400 px-3 pt-2 pb-1 uppercase tracking-wide`,children:`Cookie/Parameter IDs`}),E.length===0?e(`p`,{class:`text-xs text-gray-400 px-3 pb-3`,children:[`No cookies/parameters defined yet.`,` `,e(`a`,{href:`#/banners/consent-templates/new`,class:`text-blue-600 hover:underline`,target:`_blank`,children:`Create a template ↗`})]}):E.map(t=>e(`button`,{type:`button`,class:`w-full text-left flex items-center gap-2.5 px-3 py-1.5 hover:bg-gray-50 ${D(t.id)?`bg-blue-50`:``}`,onClick:()=>O(t.id),children:[e(`span`,{class:`w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center text-xs ${D(t.id)?`bg-blue-600 border-blue-600 text-white`:`border-gray-300`}`,children:D(t.id)?e(o,{size:10}):null}),e(`div`,{class:`min-w-0 flex items-baseline gap-1.5`,children:[e(`span`,{class:`font-mono text-xs text-gray-800`,children:t.id}),t.source&&e(`span`,{class:`text-xs text-gray-400 truncate`,children:[`· `,t.source]})]})]},t.id))]})]}),document.body)]})}var f=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function p(e){return/^[a-zA-Z][a-zA-Z0-9-]*$/.test(e)}function m({value:r,onChange:i,label:a=`Heading Tag`,required:o}){let[s,c]=t(()=>!f.includes(r)),[l,u]=t(``);n(()=>{f.includes(r)&&c(!1)},[r]);let d=e=>{c(e),u(``),e||i(f.includes(r)?r:`h2`)},m=e=>{i(e),u(e&&!p(e)?`Invalid HTML tag name (letters, digits, hyphens only)`:``)};return e(`div`,{children:[e(`div`,{class:`flex items-center justify-between mb-1`,children:[e(`label`,{class:`text-xs font-medium text-gray-600`,children:[a,o&&e(`span`,{class:`text-red-500 ml-0.5`,children:`*`})]}),e(`label`,{class:`flex items-center gap-1.5 text-xs text-gray-500 cursor-pointer select-none`,children:[e(`input`,{type:`checkbox`,class:`w-3.5 h-3.5`,checked:s,onChange:e=>d(e.target.checked)}),`Custom tag`]})]}),s?e(`div`,{children:[e(`input`,{class:`w-full border rounded px-2 py-1.5 text-sm font-mono ${l?`border-red-400 bg-red-50`:`border-gray-300`}`,value:r,onInput:e=>m(e.target.value),placeholder:`e.g. p, div, span`}),l&&e(`p`,{class:`text-xs text-red-500 mt-0.5`,children:l})]}):e(`select`,{class:`w-full border border-gray-300 rounded px-2 py-1.5 text-sm font-mono`,value:f.includes(r)?r:`h2`,onChange:e=>i(e.target.value),children:f.map(t=>e(`option`,{value:t,children:t},t))})]})}export{d as n,m as t};
@@ -0,0 +1 @@
1
+ import{a as e,p as t}from"./createLucideIcon-DAiYBrnd.js";import{o as n,s as r}from"./index-Tr_BcjkN.js";var i=[`howItWorks.workflow.step1`,`howItWorks.workflow.step2`,`howItWorks.workflow.step3`,`howItWorks.workflow.step4`,`howItWorks.workflow.step5`],a=[`howItWorks.consentFlow.step1`,`howItWorks.consentFlow.step2`,`howItWorks.consentFlow.step3`,`howItWorks.consentFlow.step4`,`howItWorks.consentFlow.step5`,`howItWorks.consentFlow.step6`],o=[`howItWorks.profileResolution.step1`,`howItWorks.profileResolution.step2`,`howItWorks.profileResolution.step3`,`howItWorks.profileResolution.step4`,`howItWorks.profileResolution.step5`],s=[{key:`optIn`,color:`bg-blue-100 text-blue-800`},{key:`optInDPDPA`,color:`bg-violet-100 text-violet-800`},{key:`optInChina`,color:`bg-red-100 text-red-800`},{key:`optOutCalifornia`,color:`bg-orange-100 text-orange-800`},{key:`optOutUSState`,color:`bg-amber-100 text-amber-800`},{key:`generalPrivacyConsent`,color:`bg-green-100 text-green-800`},{key:`hybridBrazil`,color:`bg-emerald-100 text-emerald-800`},{key:`noticeOnly`,color:`bg-gray-100 text-gray-600`}],c=[`mandatory`,`consent`,`legitimateInterest`],l=[`granted`,`denied`,`objected`],u=[`default`,`language`,`geoip`,`hostedGeoipLite`,`maxmind`,`custom`],d=[`dashboard`,`reports`,`consentTemplates`,`uiTemplates`,`profiles`,`consents`,`visitors`,`users`,`roles`,`vendors`,`audit`,`api`,`settings`];function f({current:f}){let p=r();return n(p(`howItWorks.title`)),e(t,{children:e(`div`,{class:`space-y-4`,children:[e(`div`,{class:`bg-white rounded-lg border border-gray-200 p-5`,children:e(`p`,{class:`text-sm text-gray-600 leading-relaxed`,children:p(`howItWorks.intro`)})}),e(`div`,{class:`grid md:grid-cols-2 gap-4`,children:[e(`div`,{class:`bg-white rounded-lg border border-gray-200 p-5`,children:[e(`h2`,{class:`text-sm font-semibold text-gray-700 mb-4`,children:p(`howItWorks.workflow.heading`)}),e(`ol`,{class:`space-y-4`,children:i.map((t,n)=>e(`li`,{class:`flex gap-4 hover:bg-gray-50 p-1`,children:[e(`span`,{class:`flex-shrink-0 w-7 h-7 rounded-full bg-blue-600 text-white text-xs font-bold flex items-center justify-center mt-0.5`,children:n+1}),e(`div`,{children:[e(`p`,{class:`text-sm font-semibold text-gray-800`,children:p(`${t}.title`)}),e(`p`,{class:`text-xs text-gray-500 mt-0.5 leading-relaxed`,children:p(`${t}.desc`)})]})]},t))})]}),e(`div`,{class:`bg-white rounded-lg border border-gray-200 p-5`,children:[e(`h2`,{class:`text-sm font-semibold text-gray-700 mb-4`,children:p(`howItWorks.consentFlow.heading`)}),e(`ol`,{class:`space-y-4`,children:a.map((t,n)=>e(`li`,{class:`flex gap-4 hover:bg-gray-50 p-1`,children:[e(`span`,{class:`flex-shrink-0 w-7 h-7 rounded-full bg-indigo-600 text-white text-xs font-bold flex items-center justify-center mt-0.5`,children:n+1}),e(`div`,{children:[e(`p`,{class:`text-sm font-semibold text-gray-800`,children:p(`${t}.title`)}),e(`p`,{class:`text-xs text-gray-500 mt-0.5 leading-relaxed`,children:p(`${t}.desc`)})]})]},t))})]})]}),e(`div`,{class:`grid md:grid-cols-2 gap-4`,children:[e(`div`,{class:`bg-white rounded-lg border border-gray-200 p-5`,children:[e(`h2`,{class:`text-sm font-semibold text-gray-700 mb-1`,children:p(`howItWorks.profileResolution.heading`)}),e(`p`,{class:`text-xs text-gray-500 mb-4 leading-relaxed`,children:p(`howItWorks.profileResolution.intro`)}),e(`ol`,{class:`space-y-4`,children:o.map((t,n)=>e(`li`,{class:`flex gap-4 hover:bg-gray-50 p-1`,children:[e(`span`,{class:`flex-shrink-0 w-7 h-7 rounded-full bg-teal-600 text-white text-xs font-bold flex items-center justify-center mt-0.5`,children:n+1}),e(`div`,{children:[e(`p`,{class:`text-sm font-semibold text-gray-800`,children:p(`${t}.title`)}),e(`p`,{class:`text-xs text-gray-500 mt-0.5 leading-relaxed`,children:p(`${t}.desc`)})]})]},t))})]}),e(`div`,{class:`bg-white rounded-lg border border-gray-200 p-5`,children:[e(`h2`,{class:`text-sm font-semibold text-gray-700 mb-4`,children:p(`howItWorks.enums.heading`)}),e(`div`,{class:`space-y-5`,children:[e(`div`,{class:`hover:bg-gray-50 p-1`,children:[e(`p`,{class:`text-xs font-semibold text-gray-600 uppercase tracking-wide mb-2`,children:p(`howItWorks.enums.legalBasis.heading`)}),e(`ul`,{class:`space-y-1.5`,children:c.map(t=>e(`li`,{class:`text-xs text-gray-500 leading-relaxed pl-3 border-l-2 border-gray-200`,children:p(`howItWorks.enums.legalBasis.${t}`)},t))})]}),e(`div`,{class:`hover:bg-gray-50 p-1`,children:[e(`p`,{class:`text-xs font-semibold text-gray-600 uppercase tracking-wide mb-2`,children:p(`howItWorks.enums.consentStatus.heading`)}),e(`ul`,{class:`space-y-1.5`,children:l.map(t=>e(`li`,{class:`text-xs text-gray-500 leading-relaxed pl-3 border-l-2 border-gray-200`,children:p(`howItWorks.enums.consentStatus.${t}`)},t))})]}),e(`div`,{class:`hover:bg-gray-50 p-1`,children:[e(`p`,{class:`text-xs font-semibold text-gray-600 uppercase tracking-wide mb-2`,children:p(`howItWorks.enums.geoProvider.heading`)}),e(`ul`,{class:`space-y-1.5`,children:u.map(t=>e(`li`,{class:`text-xs text-gray-500 leading-relaxed pl-3 border-l-2 border-gray-200`,children:p(`howItWorks.enums.geoProvider.${t}`)},t))})]})]})]})]}),e(`div`,{class:`bg-white rounded-lg border border-gray-200 p-5`,children:[e(`h2`,{class:`text-sm font-semibold text-gray-700 mb-1`,children:p(`howItWorks.complianceGroups.heading`)}),e(`p`,{class:`text-xs text-gray-500 mb-4 leading-relaxed`,children:p(`howItWorks.complianceGroups.intro`)}),e(`div`,{class:`space-y-4 grid md:grid-cols-2 gap-4`,children:s.map(({key:t,color:n})=>e(`div`,{class:`border border-gray-100 rounded-md p-4 hover:bg-gray-50`,children:e(`div`,{class:`flex items-start gap-3`,children:e(`div`,{class:`min-w-0`,children:[e(`span`,{class:`flex-shrink-0 text-xs font-mono font-semibold px-2 py-0.5 rounded ${n}`,children:t}),e(`p`,{class:`text-sm font-semibold text-gray-800`,children:p(`howItWorks.complianceGroups.${t}.title`)}),e(`p`,{class:`text-xs text-gray-500 mt-1 leading-relaxed`,children:p(`howItWorks.complianceGroups.${t}.desc`)}),e(`p`,{class:`text-xs text-gray-400 mt-2`,children:[e(`span`,{class:`font-medium text-gray-500`,children:`Laws: `}),p(`howItWorks.complianceGroups.${t}.laws`)]}),e(`p`,{class:`text-xs text-gray-400 mt-0.5`,children:[e(`span`,{class:`font-medium text-gray-500`,children:`Countries: `}),p(`howItWorks.complianceGroups.${t}.countries`)]})]})})},t))})]}),e(`div`,{class:`bg-white rounded-lg border border-gray-200 p-5`,children:[e(`h2`,{class:`text-sm font-semibold text-gray-700 mb-4`,children:p(`howItWorks.features.heading`)}),e(`div`,{class:`divide-y divide-gray-100 grid md:grid-cols-2 gap-8`,children:d.map(t=>e(`div`,{class:`py-3 first:pt-0 last:pb-0 hover:bg-gray-50 p-1`,children:[e(`p`,{class:`text-sm font-semibold text-gray-800`,children:p(`howItWorks.features.${t}.title`)}),e(`p`,{class:`text-xs text-gray-500 mt-0.5 leading-relaxed`,children:p(`howItWorks.features.${t}.desc`)})]},t))})]}),e(`div`,{class:`bg-blue-50 border border-blue-200 rounded-lg p-5`,children:[e(`h2`,{class:`text-sm font-semibold text-blue-800 mb-1`,children:p(`howItWorks.docs.heading`)}),e(`p`,{class:`text-xs text-blue-700 mb-3 leading-relaxed`,children:p(`howItWorks.docs.text`)}),e(`a`,{href:`https://consenti.dev/docs?utm_source=dashboard&utm_medium=how-it-works&utm_campaign=consenti-api`,target:`_blank`,rel:`noopener noreferrer`,class:`inline-flex items-center gap-1 text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline transition-colors`,children:[p(`howItWorks.docs.link`),e(`svg`,{class:`w-3.5 h-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:[e(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}),e(`polyline`,{points:`15 3 21 3 21 9`}),e(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]})]})]})]})})}export{f as HowItWorks};
@@ -0,0 +1 @@
1
+ import{a as e,p as t}from"./createLucideIcon-DAiYBrnd.js";import{y as n}from"./index-Tr_BcjkN.js";function r({perm:r,children:i,fallback:a=null}){let{user:o}=n();return o?.permissions.includes(r)?e(t,{children:i}):e(t,{children:a})}export{r as t};