@walkeros/web-destination-meta 0.2.1 → 0.3.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.
@@ -205,16 +205,16 @@ var util;
205
205
  return obj;
206
206
  };
207
207
  util2.getValidEnumValues = (obj) => {
208
- const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
208
+ const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
209
209
  const filtered = {};
210
- for (const k2 of validKeys) {
211
- filtered[k2] = obj[k2];
210
+ for (const k of validKeys) {
211
+ filtered[k] = obj[k];
212
212
  }
213
213
  return util2.objectValues(filtered);
214
214
  };
215
215
  util2.objectValues = (obj) => {
216
- return util2.objectKeys(obj).map(function(e) {
217
- return obj[e];
216
+ return util2.objectKeys(obj).map(function(e2) {
217
+ return obj[e2];
218
218
  });
219
219
  };
220
220
  util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
@@ -278,8 +278,8 @@ var ZodParsedType = util.arrayToEnum([
278
278
  "set"
279
279
  ]);
280
280
  var getParsedType = (data) => {
281
- const t = typeof data;
282
- switch (t) {
281
+ const t2 = typeof data;
282
+ switch (t2) {
283
283
  case "undefined":
284
284
  return ZodParsedType.undefined;
285
285
  case "string":
@@ -1081,7 +1081,7 @@ function isValidJWT(jwt, alg) {
1081
1081
  if (alg && decoded.alg !== alg)
1082
1082
  return false;
1083
1083
  return true;
1084
- } catch (e) {
1084
+ } catch (e2) {
1085
1085
  return false;
1086
1086
  }
1087
1087
  }
@@ -1240,7 +1240,7 @@ var ZodString = class _ZodString extends ZodType {
1240
1240
  } else if (check.kind === "url") {
1241
1241
  try {
1242
1242
  new URL(input.data);
1243
- } catch (e) {
1243
+ } catch (e2) {
1244
1244
  ctx = this._getOrReturnCtx(input, ctx);
1245
1245
  addIssueToContext(ctx, {
1246
1246
  validation: "url",
@@ -1892,7 +1892,7 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
1892
1892
  if (this._def.coerce) {
1893
1893
  try {
1894
1894
  input.data = BigInt(input.data);
1895
- } catch (e) {
1895
+ } catch (e2) {
1896
1896
  return this._getInvalidInput(input);
1897
1897
  }
1898
1898
  }
@@ -2984,17 +2984,17 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
2984
2984
  });
2985
2985
  }
2986
2986
  };
2987
- function mergeValues(a, b2) {
2987
+ function mergeValues(a, b) {
2988
2988
  const aType = getParsedType(a);
2989
- const bType = getParsedType(b2);
2990
- if (a === b2) {
2989
+ const bType = getParsedType(b);
2990
+ if (a === b) {
2991
2991
  return { valid: true, data: a };
2992
2992
  } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
2993
- const bKeys = util.objectKeys(b2);
2993
+ const bKeys = util.objectKeys(b);
2994
2994
  const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2995
- const newObj = { ...a, ...b2 };
2995
+ const newObj = { ...a, ...b };
2996
2996
  for (const key of sharedKeys) {
2997
- const sharedValue = mergeValues(a[key], b2[key]);
2997
+ const sharedValue = mergeValues(a[key], b[key]);
2998
2998
  if (!sharedValue.valid) {
2999
2999
  return { valid: false };
3000
3000
  }
@@ -3002,13 +3002,13 @@ function mergeValues(a, b2) {
3002
3002
  }
3003
3003
  return { valid: true, data: newObj };
3004
3004
  } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
3005
- if (a.length !== b2.length) {
3005
+ if (a.length !== b.length) {
3006
3006
  return { valid: false };
3007
3007
  }
3008
3008
  const newArray = [];
3009
3009
  for (let index = 0; index < a.length; index++) {
3010
3010
  const itemA = a[index];
3011
- const itemB = b2[index];
3011
+ const itemB = b[index];
3012
3012
  const sharedValue = mergeValues(itemA, itemB);
3013
3013
  if (!sharedValue.valid) {
3014
3014
  return { valid: false };
@@ -3016,7 +3016,7 @@ function mergeValues(a, b2) {
3016
3016
  newArray.push(sharedValue.data);
3017
3017
  }
3018
3018
  return { valid: true, data: newArray };
3019
- } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b2) {
3019
+ } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
3020
3020
  return { valid: true, data: a };
3021
3021
  } else {
3022
3022
  return { valid: false };
@@ -3386,29 +3386,29 @@ var ZodFunction = class _ZodFunction extends ZodType {
3386
3386
  const params = { errorMap: ctx.common.contextualErrorMap };
3387
3387
  const fn = ctx.data;
3388
3388
  if (this._def.returns instanceof ZodPromise) {
3389
- const me = this;
3389
+ const me2 = this;
3390
3390
  return OK(async function(...args) {
3391
3391
  const error = new ZodError([]);
3392
- const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
3393
- error.addIssue(makeArgsIssue(args, e));
3392
+ const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e2) => {
3393
+ error.addIssue(makeArgsIssue(args, e2));
3394
3394
  throw error;
3395
3395
  });
3396
3396
  const result = await Reflect.apply(fn, this, parsedArgs);
3397
- const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3398
- error.addIssue(makeReturnsIssue(result, e));
3397
+ const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e2) => {
3398
+ error.addIssue(makeReturnsIssue(result, e2));
3399
3399
  throw error;
3400
3400
  });
3401
3401
  return parsedReturns;
3402
3402
  });
3403
3403
  } else {
3404
- const me = this;
3404
+ const me2 = this;
3405
3405
  return OK(function(...args) {
3406
- const parsedArgs = me._def.args.safeParse(args, params);
3406
+ const parsedArgs = me2._def.args.safeParse(args, params);
3407
3407
  if (!parsedArgs.success) {
3408
3408
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3409
3409
  }
3410
3410
  const result = Reflect.apply(fn, this, parsedArgs.data);
3411
- const parsedReturns = me._def.returns.safeParse(result, params);
3411
+ const parsedReturns = me2._def.returns.safeParse(result, params);
3412
3412
  if (!parsedReturns.success) {
3413
3413
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3414
3414
  }
@@ -3970,10 +3970,10 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
3970
3970
  }
3971
3971
  }
3972
3972
  }
3973
- static create(a, b2) {
3973
+ static create(a, b) {
3974
3974
  return new _ZodPipeline({
3975
3975
  in: a,
3976
- out: b2,
3976
+ out: b,
3977
3977
  typeName: ZodFirstPartyTypeKind.ZodPipeline
3978
3978
  });
3979
3979
  }
@@ -4771,7 +4771,7 @@ function stringifyRegExpWithFlags(regex, refs) {
4771
4771
  }
4772
4772
  try {
4773
4773
  new RegExp(pattern);
4774
- } catch (e) {
4774
+ } catch (e2) {
4775
4775
  console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
4776
4776
  return regex.source;
4777
4777
  }
@@ -4780,7 +4780,7 @@ function stringifyRegExpWithFlags(regex, refs) {
4780
4780
 
4781
4781
  // ../../../core/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
4782
4782
  function parseRecordDef(def, refs) {
4783
- var _a, _b, _c, _d, _e, _f, _g;
4783
+ var _a, _b, _c, _d, _e2, _f, _g;
4784
4784
  if (refs.target === "openAi") {
4785
4785
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
4786
4786
  }
@@ -4817,7 +4817,7 @@ function parseRecordDef(def, refs) {
4817
4817
  ...schema,
4818
4818
  propertyNames: keyType
4819
4819
  };
4820
- } else if (((_e = def.keyType) == null ? void 0 : _e._def.typeName) === ZodFirstPartyTypeKind.ZodEnum) {
4820
+ } else if (((_e2 = def.keyType) == null ? void 0 : _e2._def.typeName) === ZodFirstPartyTypeKind.ZodEnum) {
4821
4821
  return {
4822
4822
  ...schema,
4823
4823
  propertyNames: {
@@ -5107,7 +5107,7 @@ function decideAdditionalProperties(def, refs) {
5107
5107
  function safeIsOptional(schema) {
5108
5108
  try {
5109
5109
  return schema.isOptional();
5110
- } catch (e) {
5110
+ } catch (e2) {
5111
5111
  return true;
5112
5112
  }
5113
5113
  }
@@ -5143,12 +5143,12 @@ var parsePipelineDef = (def, refs) => {
5143
5143
  ...refs,
5144
5144
  currentPath: [...refs.currentPath, "allOf", "0"]
5145
5145
  });
5146
- const b2 = parseDef(def.out._def, {
5146
+ const b = parseDef(def.out._def, {
5147
5147
  ...refs,
5148
5148
  currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
5149
5149
  });
5150
5150
  return {
5151
- allOf: [a, b2].filter((x2) => x2 !== void 0)
5151
+ allOf: [a, b].filter((x2) => x2 !== void 0)
5152
5152
  };
5153
5153
  };
5154
5154
 
@@ -5422,52 +5422,182 @@ var zodToJsonSchema = (schema, options) => {
5422
5422
  };
5423
5423
 
5424
5424
  // ../../../core/dist/index.mjs
5425
- var y = external_exports.record(external_exports.string(), external_exports.boolean()).describe("Consent requirement mapping");
5426
- var b = external_exports.lazy(() => external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean(), x, external_exports.array(b)]));
5427
- var h = external_exports.tuple([b, b]).describe("Loop: [source, transform] tuple for array transformations");
5428
- var v = external_exports.array(b).describe("Set: Array of values");
5429
- var w = external_exports.record(external_exports.string(), b).describe("Map: Object mapping keys to values");
5430
- var x = external_exports.object({ key: external_exports.string().optional().describe('Property path (e.g., "data.id")'), value: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).optional().describe("Static primitive value"), fn: external_exports.string().optional().describe("Function string for custom transformation"), map: w.optional().describe("Object with key-value mappings"), loop: h.optional().describe("Tuple [source, transform]"), set: v.optional().describe("Array of values"), consent: y.optional().describe("Required consent states"), condition: external_exports.string().optional().describe("Condition function string"), validate: external_exports.string().optional().describe("Validation function string") }).refine((e) => Object.keys(e).length > 0, { message: "ValueConfig must have at least one property" }).describe("Value configuration for transformations");
5431
- var S = h;
5432
- var O = v;
5433
- var k = w;
5434
- var E = x;
5435
- var A = zodToJsonSchema(E, { target: "jsonSchema7", $refStrategy: "relative", name: "ValueConfig" });
5436
- var L = zodToJsonSchema(S, { target: "jsonSchema7", $refStrategy: "relative", name: "Loop" });
5437
- var $ = zodToJsonSchema(O, { target: "jsonSchema7", $refStrategy: "relative", name: "Set" });
5438
- var I = zodToJsonSchema(k, { target: "jsonSchema7", $refStrategy: "relative", name: "Map" });
5439
- var _ = { merge: true, shallow: true, extend: true };
5440
- function z(e, t = {}, n = {}) {
5441
- n = { ..._, ...n };
5442
- const r = Object.entries(t).reduce((t2, [r2, o]) => {
5443
- const i = e[r2];
5444
- return n.merge && Array.isArray(i) && Array.isArray(o) ? t2[r2] = o.reduce((e2, t3) => e2.includes(t3) ? e2 : [...e2, t3], [...i]) : (n.extend || r2 in e) && (t2[r2] = o), t2;
5425
+ var e = Object.defineProperty;
5426
+ var t = (t2, n) => {
5427
+ for (var i in n) e(t2, i, { get: n[i], enumerable: true });
5428
+ };
5429
+ var h = external_exports.string();
5430
+ var y = external_exports.number();
5431
+ var S = external_exports.boolean();
5432
+ var v = external_exports.string().min(1);
5433
+ var j = external_exports.number().int().positive();
5434
+ var w = external_exports.number().int().nonnegative();
5435
+ var x = external_exports.number().describe("Tagging version number");
5436
+ var E = external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]);
5437
+ var C = E.optional();
5438
+ var P = {};
5439
+ t(P, { ErrorHandlerSchema: () => O, HandlerSchema: () => L, LogHandlerSchema: () => J, StorageSchema: () => I, StorageTypeSchema: () => $, errorHandlerJsonSchema: () => R, handlerJsonSchema: () => q, logHandlerJsonSchema: () => A, storageJsonSchema: () => M, storageTypeJsonSchema: () => T });
5440
+ var $ = external_exports.enum(["local", "session", "cookie"]).describe("Storage mechanism: local, session, or cookie");
5441
+ var I = external_exports.object({ Local: external_exports.literal("local"), Session: external_exports.literal("session"), Cookie: external_exports.literal("cookie") }).describe("Storage type constants for type-safe references");
5442
+ var O = external_exports.any().describe("Error handler function: (error, state?) => void");
5443
+ var J = external_exports.any().describe("Log handler function: (message, verbose?) => void");
5444
+ var L = external_exports.object({ Error: O.describe("Error handler function"), Log: J.describe("Log handler function") }).describe("Handler interface with error and log functions");
5445
+ var T = zodToJsonSchema($, { target: "jsonSchema7", $refStrategy: "relative", name: "StorageType" });
5446
+ var M = zodToJsonSchema(I, { target: "jsonSchema7", $refStrategy: "relative", name: "Storage" });
5447
+ var R = zodToJsonSchema(O, { target: "jsonSchema7", $refStrategy: "relative", name: "ErrorHandler" });
5448
+ var A = zodToJsonSchema(J, { target: "jsonSchema7", $refStrategy: "relative", name: "LogHandler" });
5449
+ var q = zodToJsonSchema(L, { target: "jsonSchema7", $refStrategy: "relative", name: "Handler" });
5450
+ var U = external_exports.object({ onError: O.optional().describe("Error handler function: (error, state?) => void"), onLog: J.optional().describe("Log handler function: (message, verbose?) => void") }).partial();
5451
+ var N = external_exports.object({ verbose: external_exports.boolean().describe("Enable verbose logging for debugging").optional() }).partial();
5452
+ var B = external_exports.object({ queue: external_exports.boolean().describe("Whether to queue events when consent is not granted").optional() }).partial();
5453
+ var W = external_exports.object({}).partial();
5454
+ var V = external_exports.object({ init: external_exports.boolean().describe("Whether to initialize immediately").optional(), loadScript: external_exports.boolean().describe("Whether to load external script (for web destinations)").optional() }).partial();
5455
+ var H = external_exports.object({ disabled: external_exports.boolean().describe("Set to true to disable").optional() }).partial();
5456
+ var _ = external_exports.object({ primary: external_exports.boolean().describe("Mark as primary (only one can be primary)").optional() }).partial();
5457
+ var K = external_exports.object({ settings: external_exports.any().optional().describe("Implementation-specific configuration") }).partial();
5458
+ var F = external_exports.object({ env: external_exports.any().optional().describe("Environment dependencies (platform-specific)") }).partial();
5459
+ var Z = external_exports.object({ type: external_exports.string().optional().describe("Instance type identifier"), config: external_exports.any().describe("Instance configuration") }).partial();
5460
+ var ee = external_exports.object({ collector: external_exports.any().describe("Collector instance (runtime object)"), config: external_exports.any().describe("Configuration"), env: external_exports.any().describe("Environment dependencies") }).partial();
5461
+ var te = external_exports.object({ batch: external_exports.number().optional().describe("Batch size: bundle N events for batch processing"), batched: external_exports.any().optional().describe("Batch of events to be processed") }).partial();
5462
+ var ne = external_exports.object({ ignore: external_exports.boolean().describe("Set to true to skip processing").optional(), condition: external_exports.string().optional().describe("Condition function: return true to process") }).partial();
5463
+ var ie = external_exports.object({ sources: external_exports.record(external_exports.string(), external_exports.any()).describe("Map of source instances") }).partial();
5464
+ var oe = external_exports.object({ destinations: external_exports.record(external_exports.string(), external_exports.any()).describe("Map of destination instances") }).partial();
5465
+ var re = {};
5466
+ t(re, { ConsentSchema: () => me, DeepPartialEventSchema: () => je, EntitiesSchema: () => ye, EntitySchema: () => he, EventSchema: () => Se, OrderedPropertiesSchema: () => pe, PartialEventSchema: () => ve, PropertiesSchema: () => de, PropertySchema: () => le, PropertyTypeSchema: () => ce, SourceSchema: () => fe, SourceTypeSchema: () => ue, UserSchema: () => ge, VersionSchema: () => be, consentJsonSchema: () => De, entityJsonSchema: () => Pe, eventJsonSchema: () => we, orderedPropertiesJsonSchema: () => ke, partialEventJsonSchema: () => xe, propertiesJsonSchema: () => Ce, sourceTypeJsonSchema: () => ze, userJsonSchema: () => Ee });
5467
+ var ce = external_exports.lazy(() => external_exports.union([external_exports.boolean(), external_exports.string(), external_exports.number(), external_exports.record(external_exports.string(), le)]));
5468
+ var le = external_exports.lazy(() => external_exports.union([ce, external_exports.array(ce)]));
5469
+ var de = external_exports.record(external_exports.string(), le.optional()).describe("Flexible property collection with optional values");
5470
+ var pe = external_exports.record(external_exports.string(), external_exports.tuple([le, external_exports.number()]).optional()).describe("Ordered properties with [value, order] tuples for priority control");
5471
+ var ue = external_exports.union([external_exports.enum(["web", "server", "app", "other"]), external_exports.string()]).describe("Source type: web, server, app, other, or custom");
5472
+ var me = external_exports.record(external_exports.string(), external_exports.boolean()).describe("Consent requirement mapping (group name \u2192 state)");
5473
+ var ge = de.and(external_exports.object({ id: external_exports.string().optional().describe("User identifier"), device: external_exports.string().optional().describe("Device identifier"), session: external_exports.string().optional().describe("Session identifier"), hash: external_exports.string().optional().describe("Hashed identifier"), address: external_exports.string().optional().describe("User address"), email: external_exports.string().email().optional().describe("User email address"), phone: external_exports.string().optional().describe("User phone number"), userAgent: external_exports.string().optional().describe("Browser user agent string"), browser: external_exports.string().optional().describe("Browser name"), browserVersion: external_exports.string().optional().describe("Browser version"), deviceType: external_exports.string().optional().describe("Device type (mobile, desktop, tablet)"), os: external_exports.string().optional().describe("Operating system"), osVersion: external_exports.string().optional().describe("Operating system version"), screenSize: external_exports.string().optional().describe("Screen dimensions"), language: external_exports.string().optional().describe("User language"), country: external_exports.string().optional().describe("User country"), region: external_exports.string().optional().describe("User region/state"), city: external_exports.string().optional().describe("User city"), zip: external_exports.string().optional().describe("User postal code"), timezone: external_exports.string().optional().describe("User timezone"), ip: external_exports.string().optional().describe("User IP address"), internal: external_exports.boolean().optional().describe("Internal user flag (employee, test user)") })).describe("User identification and properties");
5474
+ var be = de.and(external_exports.object({ source: h.describe('Walker implementation version (e.g., "2.0.0")'), tagging: x })).describe("Walker version information");
5475
+ var fe = de.and(external_exports.object({ type: ue.describe("Source type identifier"), id: h.describe("Source identifier (typically URL on web)"), previous_id: h.describe("Previous source identifier (typically referrer on web)") })).describe("Event source information");
5476
+ var he = external_exports.lazy(() => external_exports.object({ entity: external_exports.string().describe("Entity name"), data: de.describe("Entity-specific properties"), nested: external_exports.array(he).describe("Nested child entities"), context: pe.describe("Entity context data") })).describe("Nested entity structure with recursive nesting support");
5477
+ var ye = external_exports.array(he).describe("Array of nested entities");
5478
+ var Se = external_exports.object({ name: external_exports.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'), data: de.describe("Event-specific properties"), context: pe.describe("Ordered context properties with priorities"), globals: de.describe("Global properties shared across events"), custom: de.describe("Custom implementation-specific properties"), user: ge.describe("User identification and attributes"), nested: ye.describe("Related nested entities"), consent: me.describe("Consent states at event time"), id: v.describe("Unique event identifier (timestamp-based)"), trigger: h.describe("Event trigger identifier"), entity: h.describe("Parsed entity from event name"), action: h.describe("Parsed action from event name"), timestamp: j.describe("Unix timestamp in milliseconds since epoch"), timing: y.describe("Event processing timing information"), group: h.describe("Event grouping identifier"), count: w.describe("Event count in session"), version: be.describe("Walker version information"), source: fe.describe("Event source information") }).describe("Complete walkerOS event structure");
5479
+ var ve = Se.partial().describe("Partial event structure with all fields optional");
5480
+ var je = external_exports.lazy(() => Se.deepPartial()).describe("Deep partial event structure with all nested fields optional");
5481
+ var we = zodToJsonSchema(Se, { target: "jsonSchema7", $refStrategy: "relative", name: "Event" });
5482
+ var xe = zodToJsonSchema(ve, { target: "jsonSchema7", $refStrategy: "relative", name: "PartialEvent" });
5483
+ var Ee = zodToJsonSchema(ge, { target: "jsonSchema7", $refStrategy: "relative", name: "User" });
5484
+ var Ce = zodToJsonSchema(de, { target: "jsonSchema7", $refStrategy: "relative", name: "Properties" });
5485
+ var ke = zodToJsonSchema(pe, { target: "jsonSchema7", $refStrategy: "relative", name: "OrderedProperties" });
5486
+ var Pe = zodToJsonSchema(he, { target: "jsonSchema7", $refStrategy: "relative", name: "Entity" });
5487
+ var ze = zodToJsonSchema(ue, { target: "jsonSchema7", $refStrategy: "relative", name: "SourceType" });
5488
+ var De = zodToJsonSchema(me, { target: "jsonSchema7", $refStrategy: "relative", name: "Consent" });
5489
+ var $e = {};
5490
+ t($e, { ConfigSchema: () => Be, LoopSchema: () => Te, MapSchema: () => Re, PolicySchema: () => qe, ResultSchema: () => We, RuleSchema: () => Ue, RulesSchema: () => Ne, SetSchema: () => Me, ValueConfigSchema: () => Ae, ValueSchema: () => Je, ValuesSchema: () => Le, configJsonSchema: () => Ye, loopJsonSchema: () => _e, mapJsonSchema: () => Fe, policyJsonSchema: () => Ge, ruleJsonSchema: () => Qe, rulesJsonSchema: () => Xe, setJsonSchema: () => Ke, valueConfigJsonSchema: () => He, valueJsonSchema: () => Ve });
5491
+ var Je = external_exports.lazy(() => external_exports.union([external_exports.string().describe('String value or property path (e.g., "data.id")'), external_exports.number().describe("Numeric value"), external_exports.boolean().describe("Boolean value"), Ae, external_exports.array(Je).describe("Array of values")]));
5492
+ var Le = external_exports.array(Je).describe("Array of transformation values");
5493
+ var Te = external_exports.tuple([Je, Je]).describe("Loop transformation: [source, transform] tuple for array processing");
5494
+ var Me = external_exports.array(Je).describe("Set: Array of values for selection or combination");
5495
+ var Re = external_exports.record(external_exports.string(), Je).describe("Map: Object mapping keys to transformation values");
5496
+ var Ae = external_exports.object({ key: external_exports.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'), value: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).optional().describe("Static primitive value"), fn: external_exports.string().optional().describe("Custom transformation function as string (serialized)"), map: Re.optional().describe("Object mapping: transform event data to structured output"), loop: Te.optional().describe("Loop transformation: [source, transform] for array processing"), set: Me.optional().describe("Set of values: combine or select from multiple values"), consent: me.optional().describe("Required consent states to include this value"), condition: external_exports.string().optional().describe("Condition function as string: return true to include value"), validate: external_exports.string().optional().describe("Validation function as string: return true if value is valid") }).refine((e2) => Object.keys(e2).length > 0, { message: "ValueConfig must have at least one property" }).describe("Value transformation configuration with multiple strategies");
5497
+ var qe = external_exports.record(external_exports.string(), Je).describe("Policy rules for event pre-processing (key \u2192 value mapping)");
5498
+ var Ue = external_exports.object({ batch: external_exports.number().optional().describe("Batch size: bundle N events for batch processing"), condition: external_exports.string().optional().describe("Condition function as string: return true to process event"), consent: me.optional().describe("Required consent states to process this event"), settings: external_exports.any().optional().describe("Destination-specific settings for this event mapping"), data: external_exports.union([Je, Le]).optional().describe("Data transformation rules for event"), ignore: external_exports.boolean().optional().describe("Set to true to skip processing this event"), name: external_exports.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), policy: qe.optional().describe("Event-level policy overrides (applied after config-level policy)") }).describe("Mapping rule for specific entity-action combination");
5499
+ var Ne = external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.union([Ue, external_exports.array(Ue)])).optional()).describe("Nested mapping rules: { entity: { action: Rule | Rule[] } } with wildcard support");
5500
+ var Be = external_exports.object({ consent: me.optional().describe("Required consent states to process any events"), data: external_exports.union([Je, Le]).optional().describe("Global data transformation applied to all events"), mapping: Ne.optional().describe("Entity-action specific mapping rules"), policy: qe.optional().describe("Pre-processing policy rules applied before mapping") }).describe("Shared mapping configuration for sources and destinations");
5501
+ var We = external_exports.object({ eventMapping: Ue.optional().describe("Resolved mapping rule for event"), mappingKey: external_exports.string().optional().describe('Mapping key used (e.g., "product.view")') }).describe("Mapping resolution result");
5502
+ var Ve = zodToJsonSchema(Je, { target: "jsonSchema7", $refStrategy: "relative", name: "Value" });
5503
+ var He = zodToJsonSchema(Ae, { target: "jsonSchema7", $refStrategy: "relative", name: "ValueConfig" });
5504
+ var _e = zodToJsonSchema(Te, { target: "jsonSchema7", $refStrategy: "relative", name: "Loop" });
5505
+ var Ke = zodToJsonSchema(Me, { target: "jsonSchema7", $refStrategy: "relative", name: "Set" });
5506
+ var Fe = zodToJsonSchema(Re, { target: "jsonSchema7", $refStrategy: "relative", name: "Map" });
5507
+ var Ge = zodToJsonSchema(qe, { target: "jsonSchema7", $refStrategy: "relative", name: "Policy" });
5508
+ var Qe = zodToJsonSchema(Ue, { target: "jsonSchema7", $refStrategy: "relative", name: "Rule" });
5509
+ var Xe = zodToJsonSchema(Ne, { target: "jsonSchema7", $refStrategy: "relative", name: "Rules" });
5510
+ var Ye = zodToJsonSchema(Be, { target: "jsonSchema7", $refStrategy: "relative", name: "MappingConfig" });
5511
+ var Ze = {};
5512
+ t(Ze, { BatchSchema: () => dt, ConfigSchema: () => nt, ContextSchema: () => rt, DLQSchema: () => St, DataSchema: () => pt, DestinationPolicySchema: () => ot, DestinationsSchema: () => bt, InitDestinationsSchema: () => gt, InitSchema: () => mt, InstanceSchema: () => ut, PartialConfigSchema: () => it, PushBatchContextSchema: () => st, PushContextSchema: () => at, PushEventSchema: () => ct, PushEventsSchema: () => lt, PushResultSchema: () => ht, RefSchema: () => ft, ResultSchema: () => yt, batchJsonSchema: () => Et, configJsonSchema: () => vt, contextJsonSchema: () => wt, instanceJsonSchema: () => Ct, partialConfigJsonSchema: () => jt, pushContextJsonSchema: () => xt, resultJsonSchema: () => kt });
5513
+ var nt = external_exports.object({ consent: me.optional().describe("Required consent states to send events to this destination"), settings: external_exports.any().describe("Implementation-specific configuration").optional(), data: external_exports.union([Je, Le]).optional().describe("Global data transformation applied to all events for this destination"), env: external_exports.any().describe("Environment dependencies (platform-specific)").optional(), id: v.describe("Destination instance identifier (defaults to destination key)").optional(), init: external_exports.boolean().describe("Whether to initialize immediately").optional(), loadScript: external_exports.boolean().describe("Whether to load external script (for web destinations)").optional(), mapping: Ne.optional().describe("Entity-action specific mapping rules for this destination"), policy: qe.optional().describe("Pre-processing policy rules applied before event mapping"), queue: external_exports.boolean().describe("Whether to queue events when consent is not granted").optional(), verbose: external_exports.boolean().describe("Enable verbose logging for debugging").optional(), onError: O.optional(), onLog: J.optional() }).describe("Destination configuration");
5514
+ var it = nt.deepPartial().describe("Partial destination configuration with all fields deeply optional");
5515
+ var ot = qe.describe("Destination policy rules for event pre-processing");
5516
+ var rt = external_exports.object({ collector: external_exports.any().describe("Collector instance (runtime object)"), config: nt.describe("Destination configuration"), data: external_exports.union([external_exports.any(), external_exports.undefined(), external_exports.array(external_exports.union([external_exports.any(), external_exports.undefined()]))]).optional().describe("Transformed event data"), env: external_exports.any().describe("Environment dependencies") }).describe("Destination context for init and push functions");
5517
+ var at = rt.extend({ mapping: Ue.optional().describe("Resolved mapping rule for this specific event") }).describe("Push context with event-specific mapping");
5518
+ var st = at.describe("Batch push context with event-specific mapping");
5519
+ var ct = external_exports.object({ event: Se.describe("The event to process"), mapping: Ue.optional().describe("Mapping rule for this event") }).describe("Event with optional mapping for batch processing");
5520
+ var lt = external_exports.array(ct).describe("Array of events with mappings");
5521
+ var dt = external_exports.object({ key: external_exports.string().describe('Batch key (usually mapping key like "product.view")'), events: external_exports.array(Se).describe("Array of events in batch"), data: external_exports.array(external_exports.union([external_exports.any(), external_exports.undefined(), external_exports.array(external_exports.union([external_exports.any(), external_exports.undefined()]))])).describe("Transformed data for each event"), mapping: Ue.optional().describe("Shared mapping rule for batch") }).describe("Batch of events grouped by mapping key");
5522
+ var pt = external_exports.union([external_exports.any(), external_exports.undefined(), external_exports.array(external_exports.union([external_exports.any(), external_exports.undefined()]))]).describe("Transformed event data (Property, undefined, or array)");
5523
+ var ut = external_exports.object({ config: nt.describe("Destination configuration"), queue: external_exports.array(Se).optional().describe("Queued events awaiting consent"), dlq: external_exports.array(external_exports.tuple([Se, external_exports.any()])).optional().describe("Dead letter queue (failed events with errors)"), type: external_exports.string().optional().describe("Destination type identifier"), env: external_exports.any().optional().describe("Environment dependencies"), init: external_exports.any().optional().describe("Initialization function"), push: external_exports.any().describe("Push function for single events"), pushBatch: external_exports.any().optional().describe("Batch push function"), on: external_exports.any().optional().describe("Event lifecycle hook function") }).describe("Destination instance (runtime object with functions)");
5524
+ var mt = external_exports.object({ code: ut.describe("Destination instance with implementation"), config: it.optional().describe("Partial configuration overrides"), env: external_exports.any().optional().describe("Partial environment overrides") }).describe("Destination initialization configuration");
5525
+ var gt = external_exports.record(external_exports.string(), mt).describe("Map of destination IDs to initialization configurations");
5526
+ var bt = external_exports.record(external_exports.string(), ut).describe("Map of destination IDs to runtime instances");
5527
+ var ft = external_exports.object({ id: external_exports.string().describe("Destination ID"), destination: ut.describe("Destination instance") }).describe("Destination reference (ID + instance)");
5528
+ var ht = external_exports.object({ queue: external_exports.array(Se).optional().describe("Events queued (awaiting consent)"), error: external_exports.any().optional().describe("Error if push failed") }).describe("Push operation result");
5529
+ var yt = external_exports.object({ successful: external_exports.array(ft).describe("Destinations that processed successfully"), queued: external_exports.array(ft).describe("Destinations that queued events"), failed: external_exports.array(ft).describe("Destinations that failed to process") }).describe("Overall destination processing result");
5530
+ var St = external_exports.array(external_exports.tuple([Se, external_exports.any()])).describe("Dead letter queue: [(event, error), ...]");
5531
+ var vt = zodToJsonSchema(nt, { target: "jsonSchema7", $refStrategy: "relative", name: "DestinationConfig" });
5532
+ var jt = zodToJsonSchema(it, { target: "jsonSchema7", $refStrategy: "relative", name: "PartialDestinationConfig" });
5533
+ var wt = zodToJsonSchema(rt, { target: "jsonSchema7", $refStrategy: "relative", name: "DestinationContext" });
5534
+ var xt = zodToJsonSchema(at, { target: "jsonSchema7", $refStrategy: "relative", name: "PushContext" });
5535
+ var Et = zodToJsonSchema(dt, { target: "jsonSchema7", $refStrategy: "relative", name: "Batch" });
5536
+ var Ct = zodToJsonSchema(ut, { target: "jsonSchema7", $refStrategy: "relative", name: "DestinationInstance" });
5537
+ var kt = zodToJsonSchema(yt, { target: "jsonSchema7", $refStrategy: "relative", name: "DestinationResult" });
5538
+ var Pt = {};
5539
+ t(Pt, { CommandTypeSchema: () => $t, ConfigSchema: () => It, DestinationsSchema: () => Mt, InitConfigSchema: () => Jt, InstanceSchema: () => Rt, PushContextSchema: () => Lt, SessionDataSchema: () => Ot, SourcesSchema: () => Tt, commandTypeJsonSchema: () => At, configJsonSchema: () => qt, initConfigJsonSchema: () => Nt, instanceJsonSchema: () => Wt, pushContextJsonSchema: () => Bt, sessionDataJsonSchema: () => Ut });
5540
+ var $t = external_exports.union([external_exports.enum(["action", "config", "consent", "context", "destination", "elb", "globals", "hook", "init", "link", "run", "user", "walker"]), external_exports.string()]).describe("Collector command type: standard commands or custom string for extensions");
5541
+ var It = external_exports.object({ run: external_exports.boolean().describe("Whether to run collector automatically on initialization").optional(), tagging: x, globalsStatic: de.describe("Static global properties that persist across collector runs"), sessionStatic: external_exports.record(external_exports.any()).describe("Static session data that persists across collector runs"), verbose: external_exports.boolean().describe("Enable verbose logging for debugging"), onError: O.optional(), onLog: J.optional() }).describe("Core collector configuration");
5542
+ var Ot = de.and(external_exports.object({ isStart: external_exports.boolean().describe("Whether this is a new session start"), storage: external_exports.boolean().describe("Whether storage is available"), id: v.describe("Session identifier").optional(), start: j.describe("Session start timestamp").optional(), marketing: external_exports.literal(true).optional().describe("Marketing attribution flag"), updated: j.describe("Last update timestamp").optional(), isNew: external_exports.boolean().describe("Whether this is a new session").optional(), device: v.describe("Device identifier").optional(), count: w.describe("Event count in session").optional(), runs: w.describe("Number of runs").optional() })).describe("Session state and tracking data");
5543
+ var Jt = It.partial().extend({ consent: me.optional().describe("Initial consent state"), user: ge.optional().describe("Initial user data"), globals: de.optional().describe("Initial global properties"), sources: external_exports.any().optional().describe("Source configurations"), destinations: external_exports.any().optional().describe("Destination configurations"), custom: de.optional().describe("Initial custom implementation-specific properties") }).describe("Collector initialization configuration with initial state");
5544
+ var Lt = external_exports.object({ mapping: Be.optional().describe("Source-level mapping configuration") }).describe("Push context with optional source mapping");
5545
+ var Tt = external_exports.record(external_exports.string(), external_exports.any()).describe("Map of source IDs to source instances");
5546
+ var Mt = external_exports.record(external_exports.string(), external_exports.any()).describe("Map of destination IDs to destination instances");
5547
+ var Rt = external_exports.object({ push: external_exports.any().describe("Push function for processing events"), command: external_exports.any().describe("Command function for walker commands"), allowed: external_exports.boolean().describe("Whether event processing is allowed"), config: It.describe("Current collector configuration"), consent: me.describe("Current consent state"), count: external_exports.number().describe("Event count (increments with each event)"), custom: de.describe("Custom implementation-specific properties"), sources: Tt.describe("Registered source instances"), destinations: Mt.describe("Registered destination instances"), globals: de.describe("Current global properties"), group: external_exports.string().describe("Event grouping identifier"), hooks: external_exports.any().describe("Lifecycle hook functions"), on: external_exports.any().describe("Event lifecycle configuration"), queue: external_exports.array(Se).describe("Queued events awaiting processing"), round: external_exports.number().describe("Collector run count (increments with each run)"), session: external_exports.union([external_exports.undefined(), Ot]).describe("Current session state"), timing: external_exports.number().describe("Event processing timing information"), user: ge.describe("Current user data"), version: external_exports.string().describe("Walker implementation version") }).describe("Collector instance with state and methods");
5548
+ var At = zodToJsonSchema($t, { target: "jsonSchema7", $refStrategy: "relative", name: "CommandType" });
5549
+ var qt = zodToJsonSchema(It, { target: "jsonSchema7", $refStrategy: "relative", name: "CollectorConfig" });
5550
+ var Ut = zodToJsonSchema(Ot, { target: "jsonSchema7", $refStrategy: "relative", name: "SessionData" });
5551
+ var Nt = zodToJsonSchema(Jt, { target: "jsonSchema7", $refStrategy: "relative", name: "InitConfig" });
5552
+ var Bt = zodToJsonSchema(Lt, { target: "jsonSchema7", $refStrategy: "relative", name: "CollectorPushContext" });
5553
+ var Wt = zodToJsonSchema(Rt, { target: "jsonSchema7", $refStrategy: "relative", name: "CollectorInstance" });
5554
+ var Vt = {};
5555
+ t(Vt, { BaseEnvSchema: () => Kt, ConfigSchema: () => Ft, InitSchema: () => Xt, InitSourceSchema: () => Yt, InitSourcesSchema: () => Zt, InstanceSchema: () => Qt, PartialConfigSchema: () => Gt, baseEnvJsonSchema: () => en, configJsonSchema: () => tn, initSourceJsonSchema: () => rn, initSourcesJsonSchema: () => an, instanceJsonSchema: () => on, partialConfigJsonSchema: () => nn });
5556
+ var Kt = external_exports.object({ push: external_exports.any().describe("Collector push function"), command: external_exports.any().describe("Collector command function"), sources: external_exports.any().optional().describe("Map of registered source instances"), elb: external_exports.any().describe("Public API function (alias for collector.push)") }).catchall(external_exports.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this");
5557
+ var Ft = Be.extend({ settings: external_exports.any().describe("Implementation-specific configuration").optional(), env: Kt.optional().describe("Environment dependencies (platform-specific)"), id: v.describe("Source identifier (defaults to source key)").optional(), onError: O.optional(), disabled: external_exports.boolean().describe("Set to true to disable").optional(), primary: external_exports.boolean().describe("Mark as primary (only one can be primary)").optional() }).describe("Source configuration with mapping and environment");
5558
+ var Gt = Ft.deepPartial().describe("Partial source configuration with all fields deeply optional");
5559
+ var Qt = external_exports.object({ type: external_exports.string().describe('Source type identifier (e.g., "browser", "dataLayer")'), config: Ft.describe("Current source configuration"), push: external_exports.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"), destroy: external_exports.any().optional().describe("Cleanup function called when source is removed"), on: external_exports.any().optional().describe("Lifecycle hook function for event types") }).describe("Source instance with push handler and lifecycle methods");
5560
+ var Xt = external_exports.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>");
5561
+ var Yt = external_exports.object({ code: Xt.describe("Source initialization function"), config: Gt.optional().describe("Partial configuration overrides"), env: Kt.partial().optional().describe("Partial environment overrides"), primary: external_exports.boolean().optional().describe("Mark as primary source (only one can be primary)") }).describe("Source initialization configuration");
5562
+ var Zt = external_exports.record(external_exports.string(), Yt).describe("Map of source IDs to initialization configurations");
5563
+ var en = zodToJsonSchema(Kt, { target: "jsonSchema7", $refStrategy: "relative", name: "SourceBaseEnv" });
5564
+ var tn = zodToJsonSchema(Ft, { target: "jsonSchema7", $refStrategy: "relative", name: "SourceConfig" });
5565
+ var nn = zodToJsonSchema(Gt, { target: "jsonSchema7", $refStrategy: "relative", name: "PartialSourceConfig" });
5566
+ var on = zodToJsonSchema(Qt, { target: "jsonSchema7", $refStrategy: "relative", name: "SourceInstance" });
5567
+ var rn = zodToJsonSchema(Yt, { target: "jsonSchema7", $refStrategy: "relative", name: "InitSource" });
5568
+ var an = zodToJsonSchema(Zt, { target: "jsonSchema7", $refStrategy: "relative", name: "InitSources" });
5569
+ var hn = { merge: true, shallow: true, extend: true };
5570
+ function yn(e2, t2 = {}, n = {}) {
5571
+ n = { ...hn, ...n };
5572
+ const i = Object.entries(t2).reduce((t3, [i2, o]) => {
5573
+ const r = e2[i2];
5574
+ return n.merge && Array.isArray(r) && Array.isArray(o) ? t3[i2] = o.reduce((e3, t4) => e3.includes(t4) ? e3 : [...e3, t4], [...r]) : (n.extend || i2 in e2) && (t3[i2] = o), t3;
5445
5575
  }, {});
5446
- return n.shallow ? { ...e, ...r } : (Object.assign(e, r), e);
5576
+ return n.shallow ? { ...e2, ...i } : (Object.assign(e2, i), e2);
5447
5577
  }
5448
- function K(e) {
5449
- return Array.isArray(e);
5578
+ function vn(e2) {
5579
+ return Array.isArray(e2);
5450
5580
  }
5451
- function B(e) {
5452
- return "object" == typeof e && null !== e && !K(e) && "[object Object]" === Object.prototype.toString.call(e);
5581
+ function Pn(e2) {
5582
+ return "object" == typeof e2 && null !== e2 && !vn(e2) && "[object Object]" === Object.prototype.toString.call(e2);
5453
5583
  }
5454
- function ne(e = {}) {
5584
+ function Mn(e2 = {}) {
5455
5585
  var _a;
5456
- const t = e.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e.group || "gr0up", r = e.count || 1, o = z({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${r}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: r, version: { source: "0.2.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e, { merge: false });
5457
- if (e.name) {
5458
- const [t2, n2] = (_a = e.name.split(" ")) != null ? _a : [];
5459
- t2 && n2 && (o.entity = t2, o.action = n2);
5586
+ const t2 = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", i = e2.count || 1, o = yn({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t2}-${n}-${i}`, trigger: "test", entity: "entity", action: "action", timestamp: t2, timing: 3.14, group: n, count: i, version: { source: "0.3.0", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
5587
+ if (e2.name) {
5588
+ const [t3, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
5589
+ t3 && n2 && (o.entity = t3, o.action = n2);
5460
5590
  }
5461
5591
  return o;
5462
5592
  }
5463
- function re(e = "entity action", t = {}) {
5464
- const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), r = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, o = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
5465
- return ne({ ...{ "cart view": { data: { currency: "EUR", value: 2 * r.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...r.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: r.data.price + o.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.elbwalker.com/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...r, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...r, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...r.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[e], ...t, name: e });
5593
+ function Rn(e2 = "entity action", t2 = {}) {
5594
+ const n = t2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), i = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, o = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
5595
+ return Mn({ ...{ "cart view": { data: { currency: "EUR", value: 2 * i.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...i.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: i.data.price + o.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...i, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...i, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.elbwalker.com/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...i, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...i, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...i.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[e2], ...t2, name: e2 });
5466
5596
  }
5467
5597
 
5468
5598
  // src/examples/events.ts
5469
5599
  function Purchase() {
5470
- const event = re("order complete");
5600
+ const event = Rn("order complete");
5471
5601
  return [
5472
5602
  "track",
5473
5603
  "Purchase",
@@ -5482,7 +5612,7 @@ function Purchase() {
5482
5612
  ];
5483
5613
  }
5484
5614
  function AddToCart() {
5485
- const event = re("product add");
5615
+ const event = Rn("product add");
5486
5616
  return [
5487
5617
  "track",
5488
5618
  "AddToCart",
@@ -5496,7 +5626,7 @@ function AddToCart() {
5496
5626
  ];
5497
5627
  }
5498
5628
  function InitiateCheckout() {
5499
- const event = re("cart view");
5629
+ const event = Rn("cart view");
5500
5630
  return [
5501
5631
  "track",
5502
5632
  "InitiateCheckout",
@@ -5513,7 +5643,7 @@ function InitiateCheckout() {
5513
5643
  ];
5514
5644
  }
5515
5645
  function ViewContent() {
5516
- const event = re("product view");
5646
+ const event = Rn("product view");
5517
5647
  return [
5518
5648
  "track",
5519
5649
  "ViewContent",
@@ -5546,7 +5676,7 @@ var Purchase2 = {
5546
5676
  loop: [
5547
5677
  "nested",
5548
5678
  {
5549
- condition: (entity) => B(entity) && entity.entity === "product",
5679
+ condition: (entity) => Pn(entity) && entity.entity === "product",
5550
5680
  map: {
5551
5681
  id: "data.id",
5552
5682
  quantity: { key: "data.quantity", value: 1 }
@@ -5593,7 +5723,7 @@ var InitiateCheckout2 = {
5593
5723
  loop: [
5594
5724
  "nested",
5595
5725
  {
5596
- condition: (entity) => B(entity) && entity.entity === "product",
5726
+ condition: (entity) => Pn(entity) && entity.entity === "product",
5597
5727
  map: {
5598
5728
  id: "data.id",
5599
5729
  quantity: { key: "data.quantity", value: 1 }