@highfivve/ad-tag 5.8.30 → 5.8.32

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.
@@ -2,19 +2,13 @@ import React, { Fragment } from 'react';
2
2
  import { classList } from '../util/stringUtils';
3
3
  import { SizeConfigDebug } from './sizeConfigDebug';
4
4
  import { Tag } from './tag';
5
+ import { SubHeadline, Tabs } from './ui';
5
6
  import { extractPrebidAdSlotConfigs } from '../util/prebid';
6
7
  import { SizeConfigService } from '../../ads/sizeConfigService';
7
- const defaultPanelState = {
8
- showA9: false,
9
- showPrebid: false,
10
- showGeneral: false,
11
- showSizeConfig: false
12
- };
13
8
  export class AdSlotConfig extends React.Component {
14
9
  constructor(props) {
15
10
  super(props);
16
11
  this.prebidConfig = (prebid) => {
17
- const labels = this.props.labelConfigService.getSupportedLabels();
18
12
  const prebidAdUnits = extractPrebidAdSlotConfigs(prebid).map(config => config.adUnit);
19
13
  const hasMultipleBids = prebidAdUnits.length > 1;
20
14
  const elements = prebidAdUnits.map((prebidAdUnit, index) => {
@@ -24,33 +18,33 @@ export class AdSlotConfig extends React.Component {
24
18
  const native = prebidAdUnit.mediaTypes.native;
25
19
  return (React.createElement("div", { key: index },
26
20
  index > 0 && React.createElement("hr", null),
27
- hasMultipleBids && React.createElement("h5", null,
21
+ hasMultipleBids && React.createElement("h5", { className: "mb-1 mt-3 text-sm font-bold" },
28
22
  index + 1,
29
23
  ". config"),
30
- React.createElement("div", { className: "MoliDebug-tagContainer" },
31
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "Code"),
24
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
25
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "Code"),
32
26
  React.createElement(Tag, { variant: "green" }, prebidAdUnit.code || this.props.slot.domId)),
33
- banner && (React.createElement("div", { className: "MoliDebug-tagContainer" },
34
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "Banner sizes"),
27
+ banner && (React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
28
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "Banner sizes"),
35
29
  this.validateSlotSizes(banner.sizes).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slotSizeConfig)))),
36
- video && (React.createElement("div", { className: "MoliDebug-tagContainer" },
37
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "Video"),
30
+ video && (React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
31
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "Video"),
38
32
  React.createElement(Tag, { variant: "green" }, video.context),
39
33
  !!video.playerSize &&
40
34
  this.validateSlotSizes(this.isSingleVideoSize(video.playerSize) ? [video.playerSize] : video.playerSize).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slotSizeConfig)))),
41
- native && (React.createElement("div", { className: "MoliDebug-tagContainer" },
42
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "Native"),
35
+ native && (React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
36
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "Native"),
43
37
  React.createElement(Tag, { variant: "green" }, "true"))),
44
38
  prebidAdUnit.bids.map((bid, idx) => (React.createElement(Fragment, { key: idx },
45
39
  React.createElement("hr", null),
46
- React.createElement("div", { className: "MoliDebug-tagContainer" },
47
- React.createElement("span", { className: "MoliDebug-tagLabel" },
40
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
41
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" },
48
42
  "Bidder #",
49
43
  idx + 1),
50
44
  React.createElement(Tag, { variant: "blue" }, bid.bidder ?? bid.module)),
51
- React.createElement("div", { className: "MoliDebug-tagContainer" }, this.labelConfig(bid)),
52
- React.createElement("div", { className: "MoliDebug-tagContainer" },
53
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "Params"),
45
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" }, this.labelConfig(bid)),
46
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
47
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "Params"),
54
48
  React.createElement(Tag, null, JSON.stringify(bid.params))))))));
55
49
  });
56
50
  if (elements.length === 1) {
@@ -58,7 +52,7 @@ export class AdSlotConfig extends React.Component {
58
52
  }
59
53
  else {
60
54
  return (React.createElement("div", null,
61
- React.createElement("h5", null,
55
+ React.createElement("h5", { className: "mb-1 mt-3 text-sm font-bold" },
62
56
  elements.length,
63
57
  " bid configurations"),
64
58
  elements));
@@ -67,19 +61,39 @@ export class AdSlotConfig extends React.Component {
67
61
  this.a9Config = (a9) => {
68
62
  const slotSizeConfig = this.props.slot.sizeConfig;
69
63
  return (React.createElement("div", null,
70
- React.createElement("div", { className: "MoliDebug-tagContainer" },
71
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "Sizes"),
64
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
65
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "Sizes"),
72
66
  this.validateSlotSizes(this.props.slot.sizes.filter(AdSlotConfig.isFixedSize)).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slotSizeConfig))),
73
- React.createElement("div", { className: "MoliDebug-tagContainer" }, this.labelConfig(a9))));
67
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" }, this.labelConfig(a9))));
68
+ };
69
+ this.countMatchedSizeConfigs = () => {
70
+ const supportedLabels = this.props.labelConfigService.getSupportedLabels();
71
+ return (this.props.slot.sizeConfig ?? []).filter(entry => window.matchMedia(entry.mediaQuery).matches &&
72
+ (!entry.labelAll || entry.labelAll.every(label => supportedLabels.includes(label))) &&
73
+ (!entry.labelNone || !entry.labelNone.some(label => supportedLabels.includes(label)))).length;
74
+ };
75
+ this.countRequestedBidders = (slotVisible) => {
76
+ const supportedLabels = this.props.labelConfigService.getSupportedLabels();
77
+ const matchesLabels = (bid) => {
78
+ if (bid.labelAll) {
79
+ return bid.labelAll.every(label => supportedLabels.includes(label));
80
+ }
81
+ if (bid.labelAny) {
82
+ return bid.labelAny.some(label => supportedLabels.includes(label));
83
+ }
84
+ return true;
85
+ };
86
+ const prebidBidders = this.props.slot.prebid
87
+ ? extractPrebidAdSlotConfigs(this.props.slot.prebid)
88
+ .flatMap(config => config.adUnit.bids)
89
+ .filter(matchesLabels).length
90
+ : 0;
91
+ const a9Bidder = this.props.slot.a9 && slotVisible && this.isVisibleA9() ? 1 : 0;
92
+ return prebidBidders + a9Bidder;
74
93
  };
75
- this.toggleGeneral = () => this.setState({ showGeneral: !this.state.showGeneral });
76
- this.toggleA9 = () => this.setState({ showA9: !this.state.showA9 });
77
- this.togglePrebid = () => this.setState({ showPrebid: !this.state.showPrebid });
78
- this.toggleSizeConfig = () => this.setState({ showSizeConfig: !this.state.showSizeConfig });
79
94
  this.isVisiblePrebid = () => {
80
95
  const prebid = this.props.slot.prebid;
81
96
  if (prebid) {
82
- const labels = this.props.labelConfigService.getSupportedLabels();
83
97
  return extractPrebidAdSlotConfigs(prebid)
84
98
  .map(config => config.adUnit)
85
99
  .some(prebidAdUnit => {
@@ -138,48 +152,28 @@ export class AdSlotConfig extends React.Component {
138
152
  const labelAnyMatches = !!labelAny && labelAny.some(label => supportedLabels.indexOf(label) > -1);
139
153
  return (React.createElement("div", null,
140
154
  labelAll && labelAll.length > 0 && (React.createElement("div", null,
141
- React.createElement("span", { className: classList('MoliDebug-tagLabel', [labelAllMatches, 'MoliDebug-tag--greenText'], [!labelAllMatches, 'MoliDebug-tag--redText']) }, "labelAll"),
155
+ React.createElement("span", { className: classList('inline-block min-w-36 max-w-96 pr-1 font-medium', [labelAllMatches, 'text-success'], [!labelAllMatches, 'text-error']) }, "labelAll"),
142
156
  labelAll.map(label => (React.createElement(Tag, { key: label, variant: supportedLabels.indexOf(label) > -1 ? 'green' : 'red' }, label))))),
143
157
  labelAny && labelAny.length > 0 && (React.createElement("div", null,
144
- React.createElement("span", { className: classList('MoliDebug-tagLabel', [labelAnyMatches, 'MoliDebug-tag--greenText'], [!labelAnyMatches, 'MoliDebug-tag--redText']) }, "labelAny"),
158
+ React.createElement("span", { className: classList('inline-block min-w-36 max-w-96 pr-1 font-medium', [labelAnyMatches, 'text-success'], [!labelAnyMatches, 'text-error']) }, "labelAny"),
145
159
  labelAll && labelAll.length > 0 && (React.createElement(Tag, { variant: 'yellow' }, "labelAll was already evaluated, labelAny is ignored")),
146
160
  labelAny.map(label => {
147
161
  const labelFound = supportedLabels.indexOf(label) > -1;
148
162
  return (React.createElement(Tag, { key: label, variant: labelFound ? 'green' : 'red' }, label));
149
163
  })))));
150
164
  };
151
- if (props.parentElement) {
152
- props.parentElement.classList.add('MoliDebug-posRelative');
153
- const { width, height } = props.parentElement.getBoundingClientRect();
154
- this.state = {
155
- dimensions: { width, height },
156
- ...defaultPanelState
157
- };
158
- }
159
- else {
160
- this.state = defaultPanelState;
161
- }
165
+ this.state = {
166
+ expanded: !!props.initiallyExpanded,
167
+ activeTab: 'overview'
168
+ };
162
169
  }
163
170
  render() {
164
- const { labelConfigService, slot, parentElement } = this.props;
165
- const { dimensions, showGeneral, showA9, showPrebid, showSizeConfig } = this.state;
171
+ const { labelConfigService, slot } = this.props;
172
+ const { expanded, activeTab } = this.state;
166
173
  const slotValid = slot.behaviour.loaded === 'infinite' ? true : labelConfigService.filterSlot(slot);
167
174
  const slotElementExists = !!document.getElementById(slot.domId);
168
175
  const slotVisible = slotValid && slotElementExists;
169
176
  const isConfiguredInfiniteSlot = slot.behaviour.loaded === 'infinite' && !slotVisible;
170
- const prebidValid = this.isVisiblePrebid();
171
- const a9Valid = slotVisible && this.isVisibleA9();
172
- function setSlotVisibilityIcon(slotVisible, loadingBehaviour) {
173
- if (slotVisible) {
174
- return '✔';
175
- }
176
- else if (isConfiguredInfiniteSlot) {
177
- return '?';
178
- }
179
- else {
180
- return 'x';
181
- }
182
- }
183
177
  const getBucketName = (bucket) => {
184
178
  if (!bucket) {
185
179
  return 'default';
@@ -189,35 +183,69 @@ export class AdSlotConfig extends React.Component {
189
183
  }
190
184
  return bucket[labelConfigService.getDeviceLabel()] ?? 'default';
191
185
  };
192
- return (React.createElement("div", { className: classList('MoliDebug-adSlot', [!!parentElement, 'MoliDebug-adSlot--overlay'], [!parentElement && slotVisible, 'is-rendered'], [!parentElement && !slotVisible, 'is-notRendered'], [isConfiguredInfiniteSlot, 'is-configuredInfinite']), style: dimensions },
193
- React.createElement("div", { className: "MoliDebug-adSlot-buttons" },
194
- !parentElement && (React.createElement("button", { title: slot.behaviour.loaded === 'infinite'
195
- ? `Configuration only used to copy on slots with infinite selector`
196
- : `Slot ${slotVisible ? '' : 'not '}rendered`, className: classList('MoliDebug-adSlot-button', [slotVisible, 'is-rendered'], [!slotVisible, 'is-notRendered'], [isConfiguredInfiniteSlot, 'is-configuredInfinite']), onClick: this.toggleGeneral }, setSlotVisibilityIcon(slotVisible, slot.behaviour.loaded))),
197
- React.createElement("button", { title: "Show general slot info", className: classList('MoliDebug-adSlot-button', [showGeneral, 'is-active']), onClick: this.toggleGeneral }, "\u24D8"),
198
- slot.a9 && (React.createElement("button", { title: "Show A9 config", className: classList('MoliDebug-adSlot-button', [showA9, 'is-active'], [a9Valid, 'is-rendered'], [!a9Valid, 'is-notRendered']), onClick: this.toggleA9 }, "A9")),
199
- slot.prebid && (React.createElement("button", { title: "Show Prebid config", className: classList('MoliDebug-adSlot-button', [showPrebid, 'is-active'], [prebidValid, 'is-rendered'], [!prebidValid, 'is-notRendered']), onClick: this.togglePrebid }, "pb")),
200
- slot.sizeConfig && (React.createElement("button", { title: "Show sizeConfig", className: classList('MoliDebug-adSlot-button MoliDebug-adSlot-button--sizeConfig', [slotValid, 'is-rendered'], [!slotValid, 'is-notRendered'], [showSizeConfig, 'is-active']), onClick: this.toggleSizeConfig })),
201
- isConfiguredInfiniteSlot && (React.createElement("p", null, "Looking up infinite slots is currently not implemented"))),
202
- showGeneral && (React.createElement("div", { className: "MoliDebug-panel MoliDebug-panel--blue MoliDebug-panel--collapsible" },
203
- React.createElement("div", { className: "MoliDebug-tagContainer" },
204
- React.createElement(Tag, { variant: "green" }, slot.position),
205
- React.createElement(Tag, { variant: "yellow" }, slot.behaviour.loaded),
206
- slot.behaviour.bucket && (React.createElement(Tag, { variant: "blue" }, getBucketName(slot.behaviour.bucket)))),
207
- React.createElement("div", { className: "MoliDebug-tagContainer" },
208
- React.createElement("span", { className: classList('MoliDebug-tagLabel', [slotElementExists, 'MoliDebug-tag--greenText'], [!slotElementExists, 'MoliDebug-tag--redText']) }, "DOM ID"),
209
- React.createElement(Tag, { variant: slotElementExists ? 'green' : 'red', title: `Slot ${slotElementExists ? '' : 'not '}found in DOM` }, slot.domId)),
210
- React.createElement("div", { className: "MoliDebug-tagContainer" },
211
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "AdUnit path"),
212
- React.createElement(Tag, null, slot.adUnitPath)),
213
- slot.sizes.length > 0 && (React.createElement("div", { className: "MoliDebug-tagContainer" },
214
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "Sizes"),
215
- this.validateSlotSizes(slot.sizes).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slot.sizeConfig)))),
216
- React.createElement("div", { className: "MoliDebug-tagContainer" }, this.labelConfig(slot)))),
217
- showA9 && slot.a9 && (React.createElement("div", { className: "MoliDebug-panel MoliDebug-panel--blue MoliDebug-panel--collapsible" }, this.a9Config(slot.a9))),
218
- showPrebid && slot.prebid && (React.createElement("div", { className: "MoliDebug-panel MoliDebug-panel--blue MoliDebug-panel--collapsible" }, this.prebidConfig(slot.prebid))),
219
- showSizeConfig && slot.sizeConfig && (React.createElement("div", { className: "MoliDebug-panel MoliDebug-panel--blue MoliDebug-panel--collapsible" },
220
- React.createElement(SizeConfigDebug, { sizeConfig: slot.sizeConfig, supportedLabels: labelConfigService.getSupportedLabels() })))));
186
+ const tabItems = [
187
+ { id: 'overview', label: 'Overview' },
188
+ ...(slot.sizeConfig
189
+ ? [
190
+ {
191
+ id: 'sizeConfig',
192
+ label: (React.createElement(React.Fragment, null,
193
+ "Size Configs ",
194
+ React.createElement(Tag, { variant: "grey" }, this.countMatchedSizeConfigs())))
195
+ }
196
+ ]
197
+ : []),
198
+ ...(slot.prebid || slot.a9
199
+ ? [
200
+ {
201
+ id: 'bidders',
202
+ label: (React.createElement(React.Fragment, null,
203
+ "Bidder Params ",
204
+ React.createElement(Tag, { variant: "grey" }, this.countRequestedBidders(slotVisible))))
205
+ }
206
+ ]
207
+ : [])
208
+ ];
209
+ return (React.createElement("div", { className: classList('d-collapse d-collapse-arrow mb-2 rounded-md border-y-0 border-l-4 border-r-0 border-solid bg-base-200', [slotVisible, 'border-l-primary'], [!slotVisible, 'border-l-base-300']), title: slotVisible
210
+ ? 'Slot requested'
211
+ : isConfiguredInfiniteSlot
212
+ ? 'Configuration only used to copy on slots with infinite selector'
213
+ : 'Slot not requested' },
214
+ React.createElement("input", { type: "checkbox", checked: expanded, onChange: () => this.setState({ expanded: !expanded }), "aria-label": `toggle slot ${slot.domId}` }),
215
+ React.createElement("div", { className: "d-collapse-title flex min-h-0 flex-wrap items-center gap-1 py-2 text-sm font-semibold" },
216
+ React.createElement("span", { className: "break-all" }, slot.domId)),
217
+ React.createElement("div", { className: "d-collapse-content text-sm" },
218
+ React.createElement(Tabs, { tabs: tabItems, active: activeTab, onSelect: tab => this.setState({ activeTab: tab }), className: "mb-2" }),
219
+ activeTab === 'overview' && (React.createElement("div", null,
220
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
221
+ React.createElement(Tag, { variant: "green" }, slot.position),
222
+ React.createElement(Tag, { variant: "yellow" }, slot.behaviour.loaded),
223
+ slot.behaviour.bucket && (React.createElement(Tag, { variant: "blue" }, getBucketName(slot.behaviour.bucket)))),
224
+ isConfiguredInfiniteSlot && (React.createElement("p", { className: "mt-2" }, "Looking up infinite slots is currently not implemented")),
225
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
226
+ React.createElement("span", { className: classList('inline-block min-w-36 max-w-96 pr-1 font-medium', [slotElementExists, 'text-success'], [!slotElementExists, 'text-error']) }, "DOM ID"),
227
+ React.createElement(Tag, { variant: slotElementExists ? 'green' : 'red', title: `Slot ${slotElementExists ? '' : 'not '}found in DOM` }, slot.domId)),
228
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
229
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "AdUnit path"),
230
+ React.createElement("pre", { className: "m-0 whitespace-pre-wrap break-all rounded bg-base-300 px-1.5 py-0.5 text-xs" }, slot.adUnitPath)),
231
+ slot.sizes.length > 0 && (React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
232
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "Sizes"),
233
+ this.validateSlotSizes(slot.sizes).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slot.sizeConfig)))),
234
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" }, this.labelConfig(slot)))),
235
+ activeTab === 'sizeConfig' && slot.sizeConfig && (React.createElement(SizeConfigDebug, { sizeConfig: slot.sizeConfig, supportedLabels: labelConfigService.getSupportedLabels() })),
236
+ activeTab === 'bidders' && (React.createElement("div", null,
237
+ slot.prebid && (React.createElement(React.Fragment, null,
238
+ React.createElement(SubHeadline, null,
239
+ "Prebid",
240
+ ' ',
241
+ React.createElement(Tag, { variant: this.isVisiblePrebid() ? 'green' : 'red' }, this.isVisiblePrebid() ? 'valid' : 'invalid')),
242
+ this.prebidConfig(slot.prebid))),
243
+ slot.a9 && (React.createElement(React.Fragment, null,
244
+ React.createElement(SubHeadline, null,
245
+ "A9",
246
+ ' ',
247
+ React.createElement(Tag, { variant: slotVisible && this.isVisibleA9() ? 'green' : 'red' }, slotVisible && this.isVisibleA9() ? 'valid' : 'invalid')),
248
+ this.a9Config(slot.a9))))))));
221
249
  }
222
250
  static isFixedSize(size) {
223
251
  return size !== 'fluid';
@@ -65,7 +65,7 @@ export const ConsentConfig = () => {
65
65
  const cmpVendor = cmpVendors[consentState.tcModel.cmpId.toString()];
66
66
  if (cmpVendor) {
67
67
  return (React.createElement(Tag, { variant: "grey" },
68
- React.createElement("a", { href: cmpVendor.website },
68
+ React.createElement("a", { className: "d-link", href: cmpVendor.website },
69
69
  cmpVendor.name,
70
70
  " (id: ",
71
71
  consentState.tcModel.cmpId.toString(),
@@ -82,42 +82,44 @@ export const ConsentConfig = () => {
82
82
  const consent = () => {
83
83
  const { gdprApplies, tcModel } = consentState;
84
84
  return (React.createElement("div", null,
85
- React.createElement("div", { className: "MoliDebug-tagContainer" },
86
- React.createElement("span", { className: "MoliDebug-tagLabel" },
85
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
86
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" },
87
87
  React.createElement("a", { href: "https://iabeurope.eu/cmp-list/" }, "GDPR")),
88
88
  !!gdprApplies),
89
- React.createElement("div", { className: "MoliDebug-tagContainer" },
90
- React.createElement("span", { className: "MoliDebug-tagLabel" },
89
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
90
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" },
91
91
  React.createElement("a", { href: "https://iabeurope.eu/cmp-list/" }, "CMP ID")),
92
92
  cmpVendorTag()),
93
- React.createElement("div", { className: "MoliDebug-tagContainer" },
94
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "Last updated"),
93
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
94
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "Last updated"),
95
95
  tcModel ? (React.createElement(Tag, null, tcModel.lastUpdated.toLocaleString())) : (React.createElement(Tag, { variant: "red" }, "Unknown"))),
96
- React.createElement("div", { className: "MoliDebug-tagContainer" },
97
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "TCF Policy Version"),
96
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
97
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "TCF Policy Version"),
98
98
  tcModel ? (React.createElement(Tag, null, tcModel.policyVersion.toString())) : (React.createElement(Tag, { variant: "red" }, "Unknown")))));
99
99
  };
100
100
  const isCmpFunctionAvailable = () => window.__tcfapi || typeof window.__tcfapi === 'function';
101
101
  const consentData = () => {
102
102
  if (isCmpFunctionAvailable()) {
103
103
  return (React.createElement("div", null,
104
- React.createElement("div", { className: "MoliDebug-tagContainer" },
105
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "vendor list version"),
104
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
105
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "vendor list version"),
106
106
  React.createElement(Tag, null, consentState.tcModel
107
107
  ? consentState.tcModel.vendorListVersion.toString()
108
108
  : 'not found')),
109
- React.createElement("div", { className: "MoliDebug-tagContainer" },
110
- React.createElement("span", { className: "MoliDebug-tagLabel" }, "num vendors allowed"),
109
+ React.createElement("div", { className: "mt-2 flex flex-wrap items-center gap-y-1" },
110
+ React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 font-medium" }, "num vendors allowed"),
111
111
  React.createElement(Tag, null, consentState.tcModel
112
112
  ? consentState.tcModel.vendorConsents.size.toString()
113
113
  : 'not found')),
114
- React.createElement("div", { className: "MoliDebug-tagContainer" },
115
- React.createElement("span", { className: "MoliDebug-tagLabelBtn", "data-toggle": "collapse", "data-target": "#collapsePurposes", "aria-expanded": "false", "aria-controls": "collapsePurposes" }, "allowed purposes"),
116
- React.createElement(Tag, null, consentState.tcModel
117
- ? consentState.tcModel.purposeConsents.size.toString()
118
- : 'not found'),
119
- React.createElement("div", { className: "collapse", id: "collapsePurposes" },
120
- React.createElement("a", { href: "https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#Appendix_A_Purposes_and_Features_Definitions" }, "Purpose and Feature definitions"),
114
+ React.createElement("div", { className: "d-collapse d-collapse-arrow mt-2 rounded-md bg-base-200" },
115
+ React.createElement("input", { type: "checkbox", "aria-label": "toggle allowed purposes" }),
116
+ React.createElement("div", { className: "d-collapse-title min-h-0 py-2 text-sm font-medium" },
117
+ "allowed purposes",
118
+ React.createElement(Tag, null, consentState.tcModel
119
+ ? consentState.tcModel.purposeConsents.size.toString()
120
+ : 'not found')),
121
+ React.createElement("div", { className: "d-collapse-content text-sm" },
122
+ React.createElement("a", { className: "d-link", href: "https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#Appendix_A_Purposes_and_Features_Definitions" }, "Purpose and Feature definitions"),
121
123
  React.createElement("br", null),
122
124
  consentState.tcModel &&
123
125
  Array.from(consentState.tcModel.purposeConsents).map(([id, accepted]) => {
@@ -126,9 +128,10 @@ export const ConsentConfig = () => {
126
128
  ": ",
127
129
  accepted ? 'accepted' : 'denied'));
128
130
  }))),
129
- React.createElement("div", { className: "MoliDebug-tagContainer" },
130
- React.createElement("span", { className: "MoliDebug-tagLabelBtn", "data-toggle": "collapse", "data-target": "#collapseConsentString", "aria-expanded": "false", "aria-controls": "collapseConsentString" }, "consent string"),
131
- React.createElement("div", { className: "collapse", id: "collapseConsentString" },
131
+ React.createElement("div", { className: "d-collapse d-collapse-arrow mt-2 rounded-md bg-base-200" },
132
+ React.createElement("input", { type: "checkbox", "aria-label": "toggle consent string" }),
133
+ React.createElement("div", { className: "d-collapse-title min-h-0 py-2 text-sm font-medium" }, "consent string"),
134
+ React.createElement("div", { className: "d-collapse-content text-sm" },
132
135
  React.createElement(Tag, null, consentState.tcString ? consentState.tcString : 'not found')))));
133
136
  }
134
137
  };