@beworke/pixel 0.1.0-rc.1

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 (123) hide show
  1. package/CHANGELOG.md +194 -0
  2. package/README.md +163 -0
  3. package/RELEASE_CANDIDATE.md +256 -0
  4. package/dist/PixelLogger-B21lEjep.d.mts +8 -0
  5. package/dist/PixelLogger-B21lEjep.d.ts +8 -0
  6. package/dist/StorageFactory-BhpbB6Jj.d.mts +8 -0
  7. package/dist/StorageFactory-CAkJJqVD.d.ts +8 -0
  8. package/dist/config/index.cjs.js +3 -0
  9. package/dist/config/index.cjs.js.map +1 -0
  10. package/dist/config/index.d.mts +19 -0
  11. package/dist/config/index.d.ts +19 -0
  12. package/dist/config/index.esm.js +3 -0
  13. package/dist/config/index.esm.js.map +1 -0
  14. package/dist/events/index.cjs.js +3 -0
  15. package/dist/events/index.cjs.js.map +1 -0
  16. package/dist/events/index.d.mts +1 -0
  17. package/dist/events/index.d.ts +1 -0
  18. package/dist/events/index.esm.js +3 -0
  19. package/dist/events/index.esm.js.map +1 -0
  20. package/dist/examples/html-script/README.md +71 -0
  21. package/dist/examples/html-script/RELEASE_CANDIDATE.md +121 -0
  22. package/dist/examples/html-script/add-payment-info/README.md +46 -0
  23. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +494 -0
  24. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +478 -0
  25. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +486 -0
  26. package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +479 -0
  27. package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +492 -0
  28. package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +495 -0
  29. package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +469 -0
  30. package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +489 -0
  31. package/dist/examples/html-script/add-to-cart/README.md +36 -0
  32. package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +517 -0
  33. package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +512 -0
  34. package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +519 -0
  35. package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +514 -0
  36. package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +517 -0
  37. package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +527 -0
  38. package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +524 -0
  39. package/dist/examples/html-script/example-basic.html +350 -0
  40. package/dist/examples/html-script/example-behavior.html +435 -0
  41. package/dist/examples/html-script/example-conversion.html +479 -0
  42. package/dist/examples/html-script/example-integration.html +709 -0
  43. package/dist/examples/html-script/example-transport.html +748 -0
  44. package/dist/examples/html-script/initiate-checkout/README.md +38 -0
  45. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +485 -0
  46. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +491 -0
  47. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +493 -0
  48. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +494 -0
  49. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +497 -0
  50. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +502 -0
  51. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +496 -0
  52. package/dist/examples/html-script/lead/README.md +25 -0
  53. package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +594 -0
  54. package/dist/examples/html-script/lead/example-lead-trigger-auto.html +431 -0
  55. package/dist/examples/html-script/lead/example-lead-trigger-click.html +587 -0
  56. package/dist/examples/html-script/release-candidate.html +726 -0
  57. package/dist/examples/html-script/remove-from-cart/README.md +36 -0
  58. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +532 -0
  59. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +524 -0
  60. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +540 -0
  61. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +533 -0
  62. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +557 -0
  63. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +539 -0
  64. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +524 -0
  65. package/dist/examples/html-script/search/README.md +41 -0
  66. package/dist/examples/html-script/search/example-search-attribute.html +454 -0
  67. package/dist/examples/html-script/search/example-search-button-sync.html +455 -0
  68. package/dist/examples/html-script/search/example-search-dedupe.html +466 -0
  69. package/dist/examples/html-script/search/example-search-input.html +456 -0
  70. package/dist/examples/html-script/search/example-search-manual.html +473 -0
  71. package/dist/examples/html-script/search/example-search-submit.html +450 -0
  72. package/dist/examples/html-script/search/example-search-text.html +441 -0
  73. package/dist/examples/html-script/view-content/README.md +48 -0
  74. package/dist/examples/html-script/view-content/example-view-content-attribute.html +488 -0
  75. package/dist/examples/html-script/view-content/example-view-content-css.html +467 -0
  76. package/dist/examples/html-script/view-content/example-view-content-dedupe.html +485 -0
  77. package/dist/examples/html-script/view-content/example-view-content-empty.html +469 -0
  78. package/dist/examples/html-script/view-content/example-view-content-manual.html +496 -0
  79. package/dist/examples/html-script/view-content/example-view-content-product-card.html +478 -0
  80. package/dist/examples/html-script/view-content/example-view-content-text.html +473 -0
  81. package/dist/examples/release-candidate/README.md +14 -0
  82. package/dist/examples/v2/README.md +33 -0
  83. package/dist/index-DUfFzniE.d.mts +274 -0
  84. package/dist/index-DUfFzniE.d.ts +274 -0
  85. package/dist/index.cjs.js +3 -0
  86. package/dist/index.cjs.js.map +1 -0
  87. package/dist/index.d.mts +364 -0
  88. package/dist/index.d.ts +364 -0
  89. package/dist/index.esm.js +3 -0
  90. package/dist/index.esm.js.map +1 -0
  91. package/dist/logger/index.cjs.js +3 -0
  92. package/dist/logger/index.cjs.js.map +1 -0
  93. package/dist/logger/index.d.mts +12 -0
  94. package/dist/logger/index.d.ts +12 -0
  95. package/dist/logger/index.esm.js +3 -0
  96. package/dist/logger/index.esm.js.map +1 -0
  97. package/dist/pixel-CbeF25mD.d.mts +555 -0
  98. package/dist/pixel-CbeF25mD.d.ts +555 -0
  99. package/dist/pixel-default-config-1VgLFOiL.d.mts +5 -0
  100. package/dist/pixel-default-config-Bxb-Vdd8.d.ts +5 -0
  101. package/dist/runtime/index.cjs.js +3 -0
  102. package/dist/runtime/index.cjs.js.map +1 -0
  103. package/dist/runtime/index.d.mts +48 -0
  104. package/dist/runtime/index.d.ts +48 -0
  105. package/dist/runtime/index.esm.js +3 -0
  106. package/dist/runtime/index.esm.js.map +1 -0
  107. package/dist/services/index.cjs.js +3 -0
  108. package/dist/services/index.cjs.js.map +1 -0
  109. package/dist/services/index.d.mts +169 -0
  110. package/dist/services/index.d.ts +169 -0
  111. package/dist/services/index.esm.js +3 -0
  112. package/dist/services/index.esm.js.map +1 -0
  113. package/dist/types-CTpRvFKZ.d.ts +71 -0
  114. package/dist/types-DGlBdsAy.d.mts +71 -0
  115. package/dist/v2/global.global.js +3 -0
  116. package/dist/v2/global.global.js.map +1 -0
  117. package/dist/v2/index.cjs.js +3 -0
  118. package/dist/v2/index.cjs.js.map +1 -0
  119. package/dist/v2/index.d.mts +7 -0
  120. package/dist/v2/index.d.ts +7 -0
  121. package/dist/v2/index.esm.js +3 -0
  122. package/dist/v2/index.esm.js.map +1 -0
  123. package/package.json +101 -0
@@ -0,0 +1,3 @@
1
+ /* Pixel v2 — SDK de analytics e conversão */
2
+ "use strict";var t=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var g=(o,e)=>{for(var r in e)t(o,r,{get:e[r],enumerable:!0})},s=(o,e,r,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of f(e))!u.call(o,n)&&n!==r&&t(o,n,{get:()=>e[n],enumerable:!(d=l(e,n))||d.enumerable});return o};var p=o=>s(t({},"__esModule",{value:!0}),o);var c={};g(c,{ConsolePixelLogger:()=>i});module.exports=p(c);var i=class{constructor(e){this.debugEnabled=e}debug(...e){this.debugEnabled&&(typeof console>"u"||console.debug(...e))}info(...e){typeof console>"u"||console.info(...e)}warn(...e){typeof console>"u"||console.warn(...e)}error(...e){typeof console>"u"||console.error(...e)}};0&&(module.exports={ConsolePixelLogger});
3
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/logger/index.ts","../../src/logger/ConsolePixelLogger.ts"],"sourcesContent":["export type { PixelLogger } from './PixelLogger';\nexport { ConsolePixelLogger } from './ConsolePixelLogger';\n","import type { PixelLogger } from './PixelLogger';\n\nexport class ConsolePixelLogger implements PixelLogger {\n constructor(private readonly debugEnabled: boolean) {}\n\n debug(...args: unknown[]): void {\n if (!this.debugEnabled) return;\n if (typeof console === 'undefined') return;\n console.debug(...args);\n }\n\n info(...args: unknown[]): void {\n if (typeof console === 'undefined') return;\n console.info(...args);\n }\n\n warn(...args: unknown[]): void {\n if (typeof console === 'undefined') return;\n console.warn(...args);\n }\n\n error(...args: unknown[]): void {\n if (typeof console === 'undefined') return;\n console.error(...args);\n }\n}\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GCEO,IAAMI,EAAN,KAAgD,CACrD,YAA6BC,EAAuB,CAAvB,kBAAAA,CAAwB,CAErD,SAASC,EAAuB,CACzB,KAAK,eACN,OAAO,QAAY,KACvB,QAAQ,MAAM,GAAGA,CAAI,EACvB,CAEA,QAAQA,EAAuB,CACzB,OAAO,QAAY,KACvB,QAAQ,KAAK,GAAGA,CAAI,CACtB,CAEA,QAAQA,EAAuB,CACzB,OAAO,QAAY,KACvB,QAAQ,KAAK,GAAGA,CAAI,CACtB,CAEA,SAASA,EAAuB,CAC1B,OAAO,QAAY,KACvB,QAAQ,MAAM,GAAGA,CAAI,CACvB,CACF","names":["logger_exports","__export","ConsolePixelLogger","__toCommonJS","ConsolePixelLogger","debugEnabled","args"]}
@@ -0,0 +1,12 @@
1
+ import { P as PixelLogger } from '../PixelLogger-B21lEjep.mjs';
2
+
3
+ declare class ConsolePixelLogger implements PixelLogger {
4
+ private readonly debugEnabled;
5
+ constructor(debugEnabled: boolean);
6
+ debug(...args: unknown[]): void;
7
+ info(...args: unknown[]): void;
8
+ warn(...args: unknown[]): void;
9
+ error(...args: unknown[]): void;
10
+ }
11
+
12
+ export { ConsolePixelLogger, PixelLogger };
@@ -0,0 +1,12 @@
1
+ import { P as PixelLogger } from '../PixelLogger-B21lEjep.js';
2
+
3
+ declare class ConsolePixelLogger implements PixelLogger {
4
+ private readonly debugEnabled;
5
+ constructor(debugEnabled: boolean);
6
+ debug(...args: unknown[]): void;
7
+ info(...args: unknown[]): void;
8
+ warn(...args: unknown[]): void;
9
+ error(...args: unknown[]): void;
10
+ }
11
+
12
+ export { ConsolePixelLogger, PixelLogger };
@@ -0,0 +1,3 @@
1
+ /* Pixel v2 — SDK de analytics e conversão */
2
+ var o=class{constructor(e){this.debugEnabled=e}debug(...e){this.debugEnabled&&(typeof console>"u"||console.debug(...e))}info(...e){typeof console>"u"||console.info(...e)}warn(...e){typeof console>"u"||console.warn(...e)}error(...e){typeof console>"u"||console.error(...e)}};export{o as ConsolePixelLogger};
3
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/logger/ConsolePixelLogger.ts"],"sourcesContent":["import type { PixelLogger } from './PixelLogger';\n\nexport class ConsolePixelLogger implements PixelLogger {\n constructor(private readonly debugEnabled: boolean) {}\n\n debug(...args: unknown[]): void {\n if (!this.debugEnabled) return;\n if (typeof console === 'undefined') return;\n console.debug(...args);\n }\n\n info(...args: unknown[]): void {\n if (typeof console === 'undefined') return;\n console.info(...args);\n }\n\n warn(...args: unknown[]): void {\n if (typeof console === 'undefined') return;\n console.warn(...args);\n }\n\n error(...args: unknown[]): void {\n if (typeof console === 'undefined') return;\n console.error(...args);\n }\n}\n"],"mappings":";AAEO,IAAMA,EAAN,KAAgD,CACrD,YAA6BC,EAAuB,CAAvB,kBAAAA,CAAwB,CAErD,SAASC,EAAuB,CACzB,KAAK,eACN,OAAO,QAAY,KACvB,QAAQ,MAAM,GAAGA,CAAI,EACvB,CAEA,QAAQA,EAAuB,CACzB,OAAO,QAAY,KACvB,QAAQ,KAAK,GAAGA,CAAI,CACtB,CAEA,QAAQA,EAAuB,CACzB,OAAO,QAAY,KACvB,QAAQ,KAAK,GAAGA,CAAI,CACtB,CAEA,SAASA,EAAuB,CAC1B,OAAO,QAAY,KACvB,QAAQ,MAAM,GAAGA,CAAI,CACvB,CACF","names":["ConsolePixelLogger","debugEnabled","args"]}
@@ -0,0 +1,555 @@
1
+ type MetaBrowserDestinationConfig = {
2
+ enabled: boolean;
3
+ pixelIds: string[];
4
+ autoPageView: boolean;
5
+ loadScript: boolean;
6
+ };
7
+ type GoogleBrowserDestinationConfig = {
8
+ enabled: boolean;
9
+ tagIds: string[];
10
+ autoPageView: boolean;
11
+ loadScript: boolean;
12
+ };
13
+ type TikTokBrowserDestinationConfig = {
14
+ enabled: boolean;
15
+ pixelIds: string[];
16
+ autoPageView: boolean;
17
+ loadScript: boolean;
18
+ };
19
+ type IntegrationTestDestinationConfig = {
20
+ enabled: boolean;
21
+ };
22
+ /**
23
+ * Integration Engine — browser destinations only (pageview externo).
24
+ * Attribution is independent (`config.attribution`).
25
+ * Conversões/CAPI/server-side pertencem ao backend.
26
+ */
27
+ type IntegrationsModuleConfig = {
28
+ enabled: boolean;
29
+ debug: boolean;
30
+ concurrency: number;
31
+ timeoutMs: number;
32
+ continueOnError: boolean;
33
+ destinations: {
34
+ console: IntegrationTestDestinationConfig;
35
+ memory: IntegrationTestDestinationConfig;
36
+ mock: IntegrationTestDestinationConfig;
37
+ meta: MetaBrowserDestinationConfig;
38
+ google: GoogleBrowserDestinationConfig;
39
+ tiktok: TikTokBrowserDestinationConfig;
40
+ };
41
+ };
42
+ /** @deprecated use MetaBrowserDestinationConfig */
43
+ type MetaIntegrationConfig = MetaBrowserDestinationConfig;
44
+ /** @deprecated use GoogleBrowserDestinationConfig */
45
+ type GoogleIntegrationConfig = GoogleBrowserDestinationConfig;
46
+
47
+ type PixelSource = 'pageus' | 'gomarke' | 'bemony' | 'custom';
48
+ type PixelTarget = 'landing' | 'checkout' | 'editor' | 'preview' | 'dashboard' | 'custom';
49
+ type PixelEnvironment = 'production' | 'staging' | 'development';
50
+ type AppConfig = {
51
+ source: PixelSource;
52
+ target: PixelTarget;
53
+ environment: PixelEnvironment;
54
+ debug: boolean;
55
+ };
56
+
57
+ type IdentityConfig = {
58
+ readonly pixelId: string;
59
+ organizationId?: string;
60
+ workspaceId?: string;
61
+ projectId?: string;
62
+ pageId?: string;
63
+ funnelId?: string;
64
+ funnelStepId?: string;
65
+ offerId?: string;
66
+ checkoutId?: string;
67
+ };
68
+
69
+ type AttributionConfig = {
70
+ readonly enabled: boolean;
71
+ readonly ttlDays?: number;
72
+ readonly persist?: boolean;
73
+ readonly captureUrlParams?: boolean;
74
+ readonly captureCookies?: boolean;
75
+ readonly customClickIdParams?: string[];
76
+ };
77
+
78
+ type TransportConfig = {
79
+ apiEndpoint: string;
80
+ apiKey?: string;
81
+ timeoutMs?: number;
82
+ batch?: {
83
+ enabled: boolean;
84
+ flushIntervalMs: number;
85
+ maxBatchSize: number;
86
+ };
87
+ };
88
+
89
+ type VisitorStoragePersistence = 'memory' | 'cookie' | 'localStorage' | 'cookie_localStorage';
90
+ type SessionStoragePersistence = 'memory' | 'sessionStorage' | 'localStorage';
91
+ type AttributionStoragePersistence = 'memory' | 'localStorage' | 'cookie' | 'cookie_localStorage';
92
+ type QueueStoragePersistence = 'memory' | 'localStorage' | 'indexedDB';
93
+
94
+ type StorageKeysConfig = {
95
+ visitor?: string;
96
+ session?: string;
97
+ queue?: string;
98
+ pendingEvents?: string;
99
+ heartbeat?: string;
100
+ fingerprint?: string;
101
+ attribution?: string;
102
+ custom?: Record<string, string>;
103
+ };
104
+ type StorageConfig = {
105
+ /**
106
+ * Identificador lógico do pixel para composição de chaves de storage.
107
+ * Ex.: `"bemony-checkout"` → `__gmk:bemony-checkout:vid`
108
+ */
109
+ namespace: string;
110
+ /**
111
+ * Prefixo global das chaves de storage.
112
+ * Ex.: `"__gmk"` → `__gmk:bemony-checkout:vid`
113
+ */
114
+ prefix?: string;
115
+ persistence?: {
116
+ visitor?: VisitorStoragePersistence;
117
+ session?: SessionStoragePersistence;
118
+ attribution?: AttributionStoragePersistence;
119
+ };
120
+ queue?: {
121
+ enabled: boolean;
122
+ persistence: QueueStoragePersistence;
123
+ index?: boolean;
124
+ };
125
+ keys?: StorageKeysConfig;
126
+ };
127
+
128
+ type FingerprintMode = 'light' | 'full';
129
+
130
+ type PaymentMethod = 'CREDIT_CARD' | 'PIX' | 'BANK_SLIP';
131
+
132
+ /**
133
+ * Tipo padrão/fallback para interpretar selectors string sem prefixo.
134
+ *
135
+ * Ordem de resolução (`SelectorResolver`):
136
+ * 1. Objeto → selector.type
137
+ * 2. String com prefixo (css:, id:, class:, attr:, attribute:, text:) → prefixo
138
+ * 3. String sem prefixo → selectorType
139
+ * 4. Sem selectorType → css (DEFAULT_SELECTOR_TYPE)
140
+ */
141
+ type SelectorType = 'css' | 'id' | 'class' | 'attribute' | 'text';
142
+ /** Fallback quando `selectorType` é omitido. */
143
+ declare const DEFAULT_SELECTOR_TYPE: SelectorType;
144
+ /**
145
+ * Forma avançada de um seletor individual.
146
+ * `exact` / `caseSensitive` aplicam-se principalmente a `type: 'text'`.
147
+ * `closest` restringe a busca a um ancestral CSS (resolvido na etapa do Resolver).
148
+ */
149
+ type SelectorDescriptor = {
150
+ type: SelectorType;
151
+ value: string;
152
+ exact?: boolean;
153
+ caseSensitive?: boolean;
154
+ closest?: string;
155
+ };
156
+ /** Um seletor: string simples/prefixada ou descritor tipado. */
157
+ type SelectorInput = string | SelectorDescriptor;
158
+ /** Um ou vários seletores (OR — qualquer match dispara). */
159
+ type SelectorConfig = SelectorInput | SelectorInput[];
160
+ /**
161
+ * Extrai o valor primário de um `SelectorConfig` (utilitário de config).
162
+ * Para match/query no DOM, use `SelectorResolver`.
163
+ */
164
+ declare function getPrimarySelectorValue(selector: SelectorConfig | undefined): string | null;
165
+ /**
166
+ * Resolve o `selectorType` efetivo: config explícita → tipo do descriptor → css.
167
+ */
168
+ declare function resolveSelectorTypeFallback(selector: SelectorConfig | undefined, selectorType?: SelectorType): SelectorType;
169
+
170
+ /**
171
+ * Condição de formulário para liberar o disparo de um evento auto.
172
+ * Não representa dados de produto — apenas campos/triggers necessários.
173
+ */
174
+ type SelectorFormTrigger = 'input' | 'change' | 'submit' | 'click' | 'auto';
175
+ type SelectorFormMode = 'all' | 'any';
176
+ type SelectorFormConfig = string[] | {
177
+ fields: string[];
178
+ mode?: SelectorFormMode;
179
+ minRequired?: number;
180
+ formSelector?: string;
181
+ trigger?: SelectorFormTrigger;
182
+ debounceMs?: number;
183
+ fireOnce?: boolean;
184
+ };
185
+
186
+ /**
187
+ * Contratos globais de commerce (catálogo, checkout inicial, mappings).
188
+ * Vivem em `conversion.commerce`, fora de `auto`.
189
+ * Runtime: ProductCatalog + CommerceState + Extractors +
190
+ * CommerceResolver + OrderCalculator (Etapas 12C–12F).
191
+ */
192
+ type ProductType = 'main' | 'order_bump' | 'upsell' | 'downsell' | 'cross_sell' | 'addon' | 'subscription' | 'custom';
193
+ type CommerceProduct = {
194
+ id: string;
195
+ name?: string;
196
+ sku?: string;
197
+ type?: ProductType;
198
+ price?: number;
199
+ currency?: string;
200
+ quantity?: number;
201
+ category?: string;
202
+ variant?: string;
203
+ brand?: string;
204
+ metadata?: Record<string, unknown>;
205
+ };
206
+ type CommerceItem = {
207
+ productId: string;
208
+ quantity?: number;
209
+ price?: number;
210
+ currency?: string;
211
+ selected?: boolean;
212
+ metadata?: Record<string, unknown>;
213
+ };
214
+ type CommerceCheckoutMode = 'single_product' | 'multi_product' | 'cart' | 'funnel';
215
+ type CommerceCalculateValueFrom = 'selected_items' | 'event_items' | 'manual';
216
+ type CommerceConfig = {
217
+ currency?: string;
218
+ catalog?: {
219
+ products?: CommerceProduct[];
220
+ };
221
+ checkout?: {
222
+ mode?: CommerceCheckoutMode;
223
+ selectedItems?: CommerceItem[];
224
+ calculateValueFrom?: CommerceCalculateValueFrom;
225
+ allowDynamicItems?: boolean;
226
+ };
227
+ mappings?: {
228
+ attributes?: Record<string, string[]>;
229
+ fields?: Record<string, string[]>;
230
+ };
231
+ };
232
+ /** Default seguro: sem produtos, sem itens, sem auto-disparo implícito. */
233
+ declare const DEFAULT_COMMERCE_CONFIG: CommerceConfig;
234
+
235
+ type EngagementThresholds = {
236
+ low: number;
237
+ medium: number;
238
+ };
239
+
240
+ type EngagementWeights = {
241
+ scroll: number;
242
+ click: number;
243
+ time: number;
244
+ };
245
+
246
+ type ScrollBehaviorConfig = {
247
+ enabled: boolean;
248
+ thresholds: number[];
249
+ debounceMs: number;
250
+ };
251
+ type ClickBehaviorConfig = {
252
+ enabled: boolean;
253
+ rageClick: {
254
+ enabled: boolean;
255
+ threshold: number;
256
+ windowMs: number;
257
+ };
258
+ };
259
+ type IdleBehaviorConfig = {
260
+ enabled: boolean;
261
+ thresholdMs: number;
262
+ };
263
+ type VisibilityBehaviorConfig = {
264
+ enabled: boolean;
265
+ };
266
+ type ExitIntentBehaviorConfig = {
267
+ enabled: boolean;
268
+ };
269
+ type ViewportBehaviorConfig = {
270
+ enabled: boolean;
271
+ selector: string;
272
+ selectorType: SelectorType;
273
+ visibilityThreshold: number;
274
+ };
275
+ type HeartbeatBehaviorConfig = {
276
+ enabled: boolean;
277
+ intervalMs: number;
278
+ hiddenIntervalMs: number;
279
+ };
280
+ type EngagementBehaviorConfig = {
281
+ enabled: boolean;
282
+ weights: EngagementWeights;
283
+ thresholds: EngagementThresholds;
284
+ };
285
+ type BehaviorModuleConfig = {
286
+ enabled: boolean;
287
+ trackers: {
288
+ scroll: ScrollBehaviorConfig;
289
+ click: ClickBehaviorConfig;
290
+ idle: IdleBehaviorConfig;
291
+ visibility: VisibilityBehaviorConfig;
292
+ exitIntent: ExitIntentBehaviorConfig;
293
+ viewport: ViewportBehaviorConfig;
294
+ heartbeat: HeartbeatBehaviorConfig;
295
+ engagement: EngagementBehaviorConfig;
296
+ };
297
+ };
298
+
299
+ type ManualEventConfig = {
300
+ enabled: boolean;
301
+ };
302
+ type ManualConversionConfig = {
303
+ pageView: ManualEventConfig;
304
+ purchase: ManualEventConfig;
305
+ lead: ManualEventConfig;
306
+ addToCart: ManualEventConfig;
307
+ removeFromCart: ManualEventConfig;
308
+ initiateCheckout: ManualEventConfig;
309
+ addPaymentInfo: ManualEventConfig;
310
+ search: ManualEventConfig;
311
+ viewContent: ManualEventConfig;
312
+ };
313
+ /**
314
+ * Base compartilhada pelos auto detectors baseados em selector.
315
+ * `selectorType` é fallback para strings sem prefixo (DEFAULT_SELECTOR_TYPE = css).
316
+ */
317
+ type ConfiguredAutoDetectorConfig = {
318
+ enabled: boolean;
319
+ selector?: SelectorConfig;
320
+ selectorType?: SelectorType;
321
+ };
322
+ /**
323
+ * Detectors que podem exigir condição de formulário (`selectorForm`)
324
+ * para liberar o disparo — não é fonte de dados de produto.
325
+ */
326
+ type FormCapableAutoDetectorConfig = ConfiguredAutoDetectorConfig & {
327
+ selectorForm?: SelectorFormConfig;
328
+ };
329
+ type LeadAutoDetectorConfig = FormCapableAutoDetectorConfig;
330
+ type AddToCartAutoDetectorConfig = FormCapableAutoDetectorConfig;
331
+ type InitiateCheckoutAutoDetectorConfig = FormCapableAutoDetectorConfig;
332
+ type PurchaseAutoDetectorConfig = ConfiguredAutoDetectorConfig;
333
+ type RemoveFromCartAutoDetectorConfig = ConfiguredAutoDetectorConfig;
334
+ type SearchAutoDetectorConfig = ConfiguredAutoDetectorConfig;
335
+ type ViewContentAutoDetectorConfig = ConfiguredAutoDetectorConfig;
336
+ type AddPaymentInfoAutoDetectorConfig = {
337
+ enabled: boolean;
338
+ paymentMethod: PaymentMethod;
339
+ cardDetection: boolean;
340
+ autoDispatch: boolean;
341
+ };
342
+ type AutoConversionConfig = {
343
+ enabled: boolean;
344
+ detectors: {
345
+ lead: LeadAutoDetectorConfig;
346
+ purchase: PurchaseAutoDetectorConfig;
347
+ addToCart: AddToCartAutoDetectorConfig;
348
+ removeFromCart: RemoveFromCartAutoDetectorConfig;
349
+ initiateCheckout: InitiateCheckoutAutoDetectorConfig;
350
+ addPaymentInfo: AddPaymentInfoAutoDetectorConfig;
351
+ search: SearchAutoDetectorConfig;
352
+ viewContent: ViewContentAutoDetectorConfig;
353
+ };
354
+ };
355
+ type ConversionRulesConfig = {
356
+ enabled: boolean;
357
+ selectors: string[];
358
+ texts: string[];
359
+ urlPatterns: string[];
360
+ checkout: {
361
+ enabled: boolean;
362
+ };
363
+ card: {
364
+ enabled: boolean;
365
+ };
366
+ };
367
+ /**
368
+ * Config do módulo de conversion.
369
+ * `commerce` é global ao módulo (manual + auto), fora de `auto`.
370
+ */
371
+ type ConversionModuleConfig = {
372
+ enabled: boolean;
373
+ /** Catálogo, checkout inicial e mappings — compartilhado por manual e auto. */
374
+ commerce: CommerceConfig;
375
+ manual: ManualConversionConfig;
376
+ auto: AutoConversionConfig;
377
+ rules: ConversionRulesConfig;
378
+ };
379
+
380
+ type PageViewConfig = {
381
+ enabled: boolean;
382
+ trackInitialPageView: boolean;
383
+ spa: boolean;
384
+ dedupeMs: number;
385
+ };
386
+ type VisitorConfig = {
387
+ enabled: boolean;
388
+ persistence: VisitorStoragePersistence;
389
+ renew: boolean;
390
+ };
391
+ type SessionConfig = {
392
+ enabled: boolean;
393
+ ttlMs: number;
394
+ renewOnActivity: boolean;
395
+ renewOnPageView: boolean;
396
+ };
397
+ type FingerprintConfig = {
398
+ enabled: boolean;
399
+ mode: FingerprintMode;
400
+ cache: boolean;
401
+ };
402
+ type ConsentConfig = {
403
+ enabled: boolean;
404
+ required: boolean;
405
+ waitForConsent: boolean;
406
+ };
407
+ type DedupeConfig = {
408
+ enabled: boolean;
409
+ windowMs: number;
410
+ };
411
+ type CoordinationConfig = {
412
+ enabled: boolean;
413
+ leaderElection: boolean;
414
+ broadcastChannel: boolean;
415
+ };
416
+ type OrderingConfig = {
417
+ enabled: boolean;
418
+ preserveOrder: boolean;
419
+ };
420
+ type CoreModuleConfig = {
421
+ enabled: boolean;
422
+ pageView: PageViewConfig;
423
+ visitor: VisitorConfig;
424
+ session: SessionConfig;
425
+ fingerprint: FingerprintConfig;
426
+ consent: ConsentConfig;
427
+ dedupe: DedupeConfig;
428
+ coordination: CoordinationConfig;
429
+ ordering: OrderingConfig;
430
+ };
431
+
432
+ type PrivacyConsentConfig = {
433
+ enabled: boolean;
434
+ required: boolean;
435
+ };
436
+ type PiiConfig = {
437
+ enabled: boolean;
438
+ hashEmail: boolean;
439
+ hashPhone: boolean;
440
+ };
441
+ type AnonymizationConfig = {
442
+ enabled: boolean;
443
+ anonymizeIp: boolean;
444
+ };
445
+ type PrivacyModuleConfig = {
446
+ enabled: boolean;
447
+ consent: PrivacyConsentConfig;
448
+ pii: PiiConfig;
449
+ anonymization: AnonymizationConfig;
450
+ };
451
+
452
+ type TransportRetryConfig = {
453
+ enabled: boolean;
454
+ maxAttempts: number;
455
+ baseDelayMs: number;
456
+ maxDelayMs: number;
457
+ multiplier: number;
458
+ };
459
+ type TransportBatchConfig = {
460
+ enabled: boolean;
461
+ batchSize: number;
462
+ flushIntervalMs: number;
463
+ maxWaitMs: number;
464
+ };
465
+ type TransportTimeoutConfig = {
466
+ enabled: boolean;
467
+ timeoutMs: number;
468
+ };
469
+ type TransportOfflineConfig = {
470
+ enabled: boolean;
471
+ };
472
+ type TransportFlushConfig = {
473
+ enabled: boolean;
474
+ flushIntervalMs: number;
475
+ flushOnDestroy: boolean;
476
+ prepareUnloadHooks: boolean;
477
+ };
478
+ type TransportSenderMode = 'mock' | 'http';
479
+ type TransportSenderConfig = {
480
+ mode: TransportSenderMode;
481
+ };
482
+ type TransportPersistenceConfig = {
483
+ enabled: boolean;
484
+ };
485
+ type TransportReplayConfig = {
486
+ enabled: boolean;
487
+ };
488
+ type TransportOrderingConfig = {
489
+ enabled: boolean;
490
+ };
491
+ type TransportCoordinationConfig = {
492
+ enabled: boolean;
493
+ };
494
+ type TransportCircuitBreakerConfig = {
495
+ enabled: boolean;
496
+ failureThreshold: number;
497
+ resetTimeoutMs: number;
498
+ halfOpenMaxAttempts: number;
499
+ };
500
+ type TransportBackpressurePolicy = 'drop_oldest' | 'drop_newest' | 'reject_new' | 'sample' | 'none';
501
+ type TransportBackpressureConfig = {
502
+ enabled: boolean;
503
+ maxQueueSize: number;
504
+ policy: TransportBackpressurePolicy;
505
+ sampleRate?: number;
506
+ };
507
+ type TransportDeadLetterConfig = {
508
+ enabled: boolean;
509
+ maxEntries: number;
510
+ };
511
+ type TransportCompressionConfig = {
512
+ enabled: boolean;
513
+ strategy: 'identity';
514
+ };
515
+ type TransportModuleConfig = {
516
+ enabled: boolean;
517
+ /** @deprecated Use sender.mode instead */
518
+ mockSender: {
519
+ enabled: boolean;
520
+ };
521
+ sender: TransportSenderConfig;
522
+ persistence: TransportPersistenceConfig;
523
+ replay: TransportReplayConfig;
524
+ ordering: TransportOrderingConfig;
525
+ coordination: TransportCoordinationConfig;
526
+ circuitBreaker: TransportCircuitBreakerConfig;
527
+ backpressure: TransportBackpressureConfig;
528
+ deadLetter: TransportDeadLetterConfig;
529
+ compression: TransportCompressionConfig;
530
+ retry: TransportRetryConfig;
531
+ batch: TransportBatchConfig;
532
+ timeout: TransportTimeoutConfig;
533
+ offline: TransportOfflineConfig;
534
+ flush: TransportFlushConfig;
535
+ };
536
+
537
+ type ModulesConfig = {
538
+ core: CoreModuleConfig;
539
+ behavior: BehaviorModuleConfig;
540
+ conversion: ConversionModuleConfig;
541
+ transport: TransportModuleConfig;
542
+ integrations: IntegrationsModuleConfig;
543
+ privacy: PrivacyModuleConfig;
544
+ };
545
+
546
+ type PixelConfig = {
547
+ app: AppConfig;
548
+ identity: IdentityConfig;
549
+ transport: TransportConfig;
550
+ storage: StorageConfig;
551
+ attribution: AttributionConfig;
552
+ modules: ModulesConfig;
553
+ };
554
+
555
+ export { type FingerprintConfig as $, type AttributionStoragePersistence as A, type BehaviorModuleConfig as B, type ConversionModuleConfig as C, DEFAULT_SELECTOR_TYPE as D, type EngagementThresholds as E, type FingerprintMode as F, DEFAULT_COMMERCE_CONFIG as G, getPrimarySelectorValue as H, type IntegrationsModuleConfig as I, resolveSelectorTypeFallback as J, type AddPaymentInfoAutoDetectorConfig as K, type AddToCartAutoDetectorConfig as L, type AnonymizationConfig as M, type AutoConversionConfig as N, type ClickBehaviorConfig as O, type PixelConfig as P, type QueueStoragePersistence as Q, type ConfiguredAutoDetectorConfig as R, type SessionStoragePersistence as S, type TransportModuleConfig as T, type ConsentConfig as U, type VisitorStoragePersistence as V, type ConversionRulesConfig as W, type CoordinationConfig as X, type DedupeConfig as Y, type EngagementBehaviorConfig as Z, type ExitIntentBehaviorConfig as _, type AttributionConfig as a, type FormCapableAutoDetectorConfig as a0, type GoogleBrowserDestinationConfig as a1, type GoogleIntegrationConfig as a2, type HeartbeatBehaviorConfig as a3, type IdleBehaviorConfig as a4, type InitiateCheckoutAutoDetectorConfig as a5, type IntegrationTestDestinationConfig as a6, type LeadAutoDetectorConfig as a7, type ManualConversionConfig as a8, type ManualEventConfig as a9, type MetaBrowserDestinationConfig as aa, type MetaIntegrationConfig as ab, type ModulesConfig as ac, type TikTokBrowserDestinationConfig as ad, type OrderingConfig as ae, type PageViewConfig as af, type PiiConfig as ag, type PrivacyConsentConfig as ah, type PurchaseAutoDetectorConfig as ai, type RemoveFromCartAutoDetectorConfig as aj, type ScrollBehaviorConfig as ak, type SearchAutoDetectorConfig as al, type SessionConfig as am, type TransportBatchConfig as an, type TransportFlushConfig as ao, type TransportOfflineConfig as ap, type TransportRetryConfig as aq, type TransportTimeoutConfig as ar, type ViewContentAutoDetectorConfig as as, type ViewportBehaviorConfig as at, type VisibilityBehaviorConfig as au, type VisitorConfig as av, type CoreModuleConfig as b, type PrivacyModuleConfig as c, type AppConfig as d, type PixelEnvironment as e, type PixelSource as f, type PixelTarget as g, type IdentityConfig as h, type TransportConfig as i, type StorageConfig as j, type StorageKeysConfig as k, type EngagementWeights as l, type PaymentMethod as m, type SelectorConfig as n, type SelectorDescriptor as o, type SelectorInput as p, type SelectorType as q, type SelectorFormConfig as r, type SelectorFormMode as s, type SelectorFormTrigger as t, type CommerceCalculateValueFrom as u, type CommerceCheckoutMode as v, type CommerceConfig as w, type CommerceItem as x, type CommerceProduct as y, type ProductType as z };