@compilacion/colleciones-clientos 2.0.15 → 2.0.16

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.
@@ -1 +1 @@
1
- {"version":3,"file":"browser.domainModel.gtm.config.sandbox.js","sources":["../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.config.sandbox.js"],"sourcesContent":["var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import constants from './browser.domainModel.gtm.constants.js';\n\nexport function getConfigObject(endpoint, flushInterval, flushSize, trackerName, appName, jsLibSource, jsLibUrlInput) { \n let jsLibUrl = null;\n if(jsLibSource === constants.config.unpkgHostedValue) {\n jsLibUrl = \"https://unpkg.com/@compilacion/colleciones-clientos@latest/dist/browser.gtm.min.js\";\n } else if (jsLibSource === constants.config.selfHostedValue) {\n jsLibUrl = jsLibUrlInput\n }\n return {\n type: constants.typeCastGtmVariableConfig,\n endpoint: endpoint,\n flushInterval: flushInterval,\n flushSize: flushSize,\n trackerName: trackerName,\n appName: appName,\n jsLibUrl: jsLibUrl, \n jsLibSource: jsLibSource\n };\n}\n/* return getConfigObject(endpoint, flushInterval, flushSize, trackerName, appName, jsLibSource, jsLibUrl);*/"],"names":[],"mappings":";;;IAAA,IAAI,SAAS,GAAG;IAChB,IAKI,QAAQ,EAAE;IACd,QACQ,iBAAiB,EAAE,MAAM;IACjC,QAAQ,kBAAkB,EAAE,OAMxB,CAAC;IACL,IAAI,2BAA2B,EAAE;IACjC,CAAC;;ICfM,SAAS,eAAe,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE;IACtH,IAAI,IAAI,QAAQ,GAAG,IAAI;IACvB,IAAI,GAAG,WAAW,KAAK,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE;IAC1D,QAAQ,QAAQ,GAAG,oFAAoF;IACvG,KAAK,MAAM,IAAI,WAAW,KAAK,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE;IACjE,QAAQ,QAAQ,GAAG;IACnB;IACA,IAAI,OAAO;IACX,QAAQ,IAAI,EAAE,SAAS,CAAC,yBAAyB;IACjD,QAAQ,QAAQ,EAAE,QAAQ;IAC1B,QAAQ,aAAa,EAAE,aAAa;IACpC,QAAQ,SAAS,EAAE,SAAS;IAC5B,QAAQ,WAAW,EAAE,WAAW;IAChC,QAAQ,OAAO,EAAE,OAAO;IACxB,QAAQ,QAAQ,EAAE,QAAQ;IAC1B,QAAQ,WAAW,EAAE;IACrB,KAAK;IACL;IACA;;;;;;;;;;"}
1
+ {"version":3,"file":"browser.domainModel.gtm.config.sandbox.js","sources":["../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.config.sandbox.js"],"sourcesContent":["var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import constants from './browser.domainModel.gtm.constants.js';\n\nexport function getConfigObject(endpoint, flushInterval, flushSize, trackerName, appName, jsLibSource, jsLibUrlInput) { \n let jsLibUrl = null;\n if(jsLibSource === constants.config.unpkgHostedValue) {\n jsLibUrl = \"https://unpkg.com/@compilacion/colleciones-clientos@latest/dist/browser.gtm.min.js\";\n } else if (jsLibSource === constants.config.selfHostedValue) {\n jsLibUrl = jsLibUrlInput\n }\n return {\n type: constants.typeCastGtmVariableConfig,\n endpoint: endpoint,\n flushInterval: flushInterval,\n flushSize: flushSize,\n trackerName: trackerName,\n appName: appName,\n jsLibUrl: jsLibUrl, \n jsLibSource: jsLibSource\n };\n}\n/* return getConfigObject(endpoint, flushInterval, flushSize, trackerName, appName, jsLibSource, jsLibUrl);*/"],"names":[],"mappings":";;;IAAA,IAAI,SAAS,GAAG;IAChB,IAII,QAAQ,EAAE;IACd,QACQ,iBAAiB,EAAE,MAAM;IACjC,QAAQ,kBAAkB,EAAE,OAMxB,CAAC;IACL,IACI,2BAA2B,EAAE;IACjC,CAAC;;ICfM,SAAS,eAAe,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE;IACtH,IAAI,IAAI,QAAQ,GAAG,IAAI;IACvB,IAAI,GAAG,WAAW,KAAK,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE;IAC1D,QAAQ,QAAQ,GAAG,oFAAoF;IACvG,KAAK,MAAM,IAAI,WAAW,KAAK,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE;IACjE,QAAQ,QAAQ,GAAG;IACnB;IACA,IAAI,OAAO;IACX,QAAQ,IAAI,EAAE,SAAS,CAAC,yBAAyB;IACjD,QAAQ,QAAQ,EAAE,QAAQ;IAC1B,QAAQ,aAAa,EAAE,aAAa;IACpC,QAAQ,SAAS,EAAE,SAAS;IAC5B,QAAQ,WAAW,EAAE,WAAW;IAChC,QAAQ,OAAO,EAAE,OAAO;IACxB,QAAQ,QAAQ,EAAE,QAAQ;IAC1B,QAAQ,WAAW,EAAE;IACrB,KAAK;IACL;IACA;;;;;;;;;;"}
@@ -647,7 +647,6 @@
647
647
  var constants = {
648
648
  'sharedWindowObjectNames': {
649
649
  'queue': 'compilacionCollecionesClientosGtmQueue',
650
- 'collecionesObject': 'compilacionCollecionesClientosGtm',
651
650
  'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'
652
651
  },
653
652
  'config': {
@@ -657,11 +656,12 @@
657
656
  'appName': 'appName',
658
657
  'emitterEndpoint': 'emitterEndpoint',
659
658
  },
659
+ 'collecionesObject': 'compilacionCollecionesClientosGtm',
660
660
  'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'
661
661
  };
662
662
 
663
- if (!window[constants.sharedWindowObjectNames.collecionesObject]) {
664
- window[constants.sharedWindowObjectNames.collecionesObject] = (() => {
663
+ if (!window[constants.collecionesObject]) {
664
+ window[constants.collecionesObject] = (() => {
665
665
 
666
666
  let initialized = false;
667
667
  let emitter = null;
@@ -954,7 +954,7 @@
954
954
  flush
955
955
  }
956
956
  })();
957
- window[constants.sharedWindowObjectNames.collecionesObject].flush();
957
+ window[constants.collecionesObject].flush();
958
958
  }
959
959
 
960
960
  })();
@@ -1 +1 @@
1
- {"version":3,"file":"browser.domainModel.gtm.js","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.setRefence(entity, origin);\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize || !this.flushInterval || this.flushInterval < 1) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import CollecionesEmitter from './CollecionesEmitter.js';\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesWebTracker from './CollecionesWebTracker.js';\nimport constants from './browser.domainModel.gtm.constants.js';\n\nif (!window[constants.sharedWindowObjectNames.collecionesObject]) {\n window[constants.sharedWindowObjectNames.collecionesObject] = (() => {\n\n let initialized = false;\n let emitter = null;\n let tracker = null;\n let patchedQueue = null;\n const patchedQueueFlag = '__collecionesPatchedPush__';\n const queueWaitInterval = 250;\n const queueRecoveryInterval = 2000;\n let queueWatcherTimer = null;\n let queueWatcherInterval = null;\n\n let init = () => {\n if (initialized) return true;\n if (window[constants.sharedWindowObjectNames.configVariable] === undefined) return false;\n let config = window[constants.sharedWindowObjectNames.configVariable];\n if (config.type === undefined || config.type !== constants.typeCastGtmVariableConfig) return false;\n let flushInterval = config[constants.config.flushInterval];\n let flushSize = config[constants.config.flushSize];\n let trackerName = config[constants.config.trackerName];\n let appName = config[constants.config.appName];\n let emitterEndpoint = config[constants.config.emitterEndpoint] ?? config.endpoint;\n try {\n emitter = new CollecionesEmitter(emitterEndpoint, flushSize, flushInterval);\n tracker = new CollecionesWebTracker([emitter], trackerName, appName);\n initialized = true;\n return true;\n } catch (e) {\n console.error('Error initializing CollecionesEmitter:', e);\n return false;\n }\n }\n\n let track = (arg) => {\n if (!initialized) return false;\n if (!tracker) return false;\n if (!arg || typeof arg !== 'object') return false;\n if (!arg.entity || !arg.action) return false;\n\n const normalizeIdentifiers = (identifiers) => {\n if (Array.isArray(identifiers)) {\n return identifiers.flatMap(identifier => {\n if (typeof identifier !== 'object' || identifier === null) {\n return [];\n }\n if (identifier.name !== undefined || identifier.value !== undefined) {\n return [identifier];\n }\n return Object.entries(identifier).map(([name, value]) => ({ name, value }));\n });\n }\n if (!identifiers || typeof identifiers !== 'object') {\n return [];\n }\n return Object.entries(identifiers).map(([name, value]) => ({ name, value }));\n };\n\n const collectionOperators = {\n '==': (left, right) => left == right,\n '===': (left, right) => left === right,\n '!=': (left, right) => left != right,\n '!==': (left, right) => left !== right,\n '>': (left, right) => left > right,\n '>=': (left, right) => left >= right,\n '<': (left, right) => left < right,\n '<=': (left, right) => left <= right,\n 'in': (left, right) => Array.isArray(right) && right.includes(left)\n };\n\n // Small path resolver used by evaluated collections and filters.\n const getByPath = (obj, path) => {\n if (!path || typeof path !== 'string') {\n return undefined;\n }\n return path.split('.').reduce((acc, key) => {\n return (acc && acc[key] !== undefined) ? acc[key] : undefined;\n }, obj);\n };\n\n // Collection items are stored as `{ identifierField: value }` on the event.\n const addCollectionItem = (collectionName, identifierName, identifierValue) => {\n if (!collectionName || !identifierName || identifierValue === undefined || identifierValue === null) {\n return;\n }\n const collectionKey = event.setCollectionItem(collectionName);\n event.setCollectionItemReference(collectionName, collectionKey, identifierName, identifierValue);\n };\n\n // ARRAY collections are the simplest form:\n // they are arrays of primitive values that should be copied into the event\n // using the configured identifier field.\n const applyArrayCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.array)) {\n return false;\n }\n const identifierName = collectionConfig.identifierField;\n collectionConfig.array.forEach((value) => {\n if (Array.isArray(value)) {\n value.forEach((nestedValue) => addCollectionItem(collectionName, identifierName, nestedValue));\n return;\n }\n addCollectionItem(collectionName, identifierName, value);\n });\n return true;\n };\n\n // EVALUATED collections derive their identifier value from a path on each item.\n // An optional filter object narrows the source array before mapping.\n const applyEvaluatedCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.itemsField)) {\n return false;\n }\n\n let items = collectionConfig.itemsField;\n const filter = collectionConfig.filter;\n if (\n filter &&\n typeof filter === 'object' &&\n filter.path &&\n filter.operator &&\n collectionOperators[filter.operator]\n ) {\n items = items.filter((item) => {\n return collectionOperators[filter.operator](getByPath(item, filter.path), filter.value);\n });\n }\n\n const identifierName = collectionConfig.identifierField;\n items.forEach((item) => {\n const identifierValue = getByPath(item, collectionConfig.path) ?? item?.[identifierName] ?? item?.id;\n addCollectionItem(collectionName, identifierName, identifierValue);\n });\n return true;\n };\n\n // PARAMTABLE rows use dynamic field names that are prefixed by the collection name:\n // e.g. `listingParamTableItemsField` and `listingIdentifierValueParamTable`.\n const applyParamTableCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.table)) {\n return false;\n }\n\n const identifierNameKey = `${collectionName}ParamTableItemsField`;\n const identifierValueKey = `${collectionName}IdentifierValueParamTable`;\n collectionConfig.table.forEach((row) => {\n if (!row || typeof row !== 'object') {\n return;\n }\n const identifierName = row[identifierNameKey];\n const identifierValue = row[identifierValueKey];\n addCollectionItem(collectionName, identifierName, identifierValue);\n });\n return true;\n };\n\n const applyCollectionConfig = (collectionName, collectionConfig) => {\n if (!collectionConfig || typeof collectionConfig !== 'object') {\n return;\n }\n\n if (collectionConfig.type === 'ARRAY') {\n applyArrayCollection(collectionName, collectionConfig);\n return;\n }\n if (collectionConfig.type === 'EVALUATED') {\n applyEvaluatedCollection(collectionName, collectionConfig);\n return;\n }\n if (collectionConfig.type === 'PARAMTABLE') {\n applyParamTableCollection(collectionName, collectionConfig);\n }\n };\n\n const event = new CollecionesEvent();\n event.setEntity(arg.entity);\n event.setAction(arg.action);\n\n normalizeIdentifiers(arg.identifiers).forEach(identifier => {\n if (typeof identifier !== 'object' || identifier === null) return;\n if (!identifier.name || !identifier.value) return;\n event.setIdentifier(identifier.name, identifier.value);\n });\n\n if (arg.actor?.entity) {\n event.setActor(arg.actor.entity);\n let identifiers = arg.actor?.identifiers;\n if (!Array.isArray(identifiers)) {\n identifiers = identifiers?.[arg.actor.entity] ?? identifiers;\n }\n normalizeIdentifiers(identifiers).forEach(identifier => {\n if (typeof identifier !== 'object' || identifier === null) return;\n if (!identifier.name || !identifier.value) return;\n event.setActorIdentifier(identifier.name, identifier.value);\n });\n }\n\n const relations = arg?.relations ?? arg?.rerelations;\n if (relations && typeof relations === 'object') {\n Object.keys(relations).forEach(relationName => {\n event.setReference(relationName);\n Object.keys(relations[relationName]).forEach(identifierName => {\n event.setReferenceIdentifier(relationName, identifierName, relations[relationName][identifierName]);\n });\n });\n }\n if (arg?.adjectives && typeof arg.adjectives === 'object') {\n Object.keys(arg.adjectives).forEach(adjectiveName => {\n event.addAdjective(adjectiveName, arg.adjectives[adjectiveName]);\n });\n }\n\n if (arg?.collections && typeof arg.collections === 'object') {\n Object.keys(arg.collections).forEach(collectionName => {\n applyCollectionConfig(collectionName, arg.collections[collectionName]);\n });\n }\n\n tracker.track(event);\n return true;\n }\n\n let flush = () => {\n if (!init()) {\n return;\n }\n const queue = ensureQueue();\n if (!queue) return;\n while (queue.length > 0) {\n const args = queue.shift();\n track(args);\n }\n }\n\n let patchQueuePush = (queue) => {\n if (!Array.isArray(queue) || queue[patchedQueueFlag]) {\n patchedQueue = queue;\n return queue;\n }\n\n const originalPush = queue.push.bind(queue);\n Object.defineProperty(queue, patchedQueueFlag, {\n value: true,\n configurable: true\n });\n queue.push = (...args) => {\n const result = originalPush(...args);\n flush();\n return result;\n };\n\n patchedQueue = queue;\n return queue;\n }\n\n let ensureQueue = () => {\n let queue = window[constants.sharedWindowObjectNames.queue];\n if (!Array.isArray(queue)) {\n return null;\n }\n if (queue !== patchedQueue) {\n patchQueuePush(queue);\n }\n return queue;\n }\n\n let startQueueWatcher = (interval = queueWaitInterval) => {\n if (queueWatcherInterval === interval && queueWatcherTimer) {\n return;\n }\n if (queueWatcherTimer) {\n clearInterval(queueWatcherTimer);\n }\n queueWatcherInterval = interval;\n queueWatcherTimer = setInterval(() => {\n const queue = ensureQueue();\n if (!queue) {\n return;\n }\n if (queueWatcherInterval !== queueRecoveryInterval) {\n startQueueWatcher(queueRecoveryInterval);\n }\n if (queue.length > 0) {\n flush();\n }\n }, interval);\n }\n\n startQueueWatcher(queueWaitInterval);\n\n return {\n flush\n }\n })();\n window[constants.sharedWindowObjectNames.collecionesObject].flush();\n}\n"],"names":[],"mappings":";;;EAAA;;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,QAAQ,GAAG,UAAU,GAAG,EAAE;EAChC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;EAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;EAC7D,KAAK,MAAM;EACX,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;EAC3D;EACA;;EAgBA;EACA;EACA;EACA;EACA;EACA,MAAM,iBAAiB,GAAG,WAAW;EACrC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;EAC3E,QAA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GAAG,CAAC,QAAQ,GAAG,iBAAiB,KAAK;EAClE,YAAY,IAAI,oBAAoB,KAAK,QAAQ,IAAI,iBAAiB,EAAE;EACxE,gBAAgB;EAChB;EACA,YAAY,IAAI,iBAAiB,EAAE;EACnC,gBAAgB,aAAa,CAAC,iBAAiB,CAAC;EAChD;EACA,YAAY,oBAAoB,GAAG,QAAQ;EAC3C,YAAY,iBAAiB,GAAG,WAAW,CAAC,MAAM;EAClD,gBAAgB,MAAM,KAAK,GAAG,WAAW,EAAE;EAC3C,gBAAgB,IAAI,CAAC,KAAK,EAAE;EAC5B,oBAAoB;EACpB;EACA,gBAAgB,IAAI,oBAAoB,KAAK,qBAAqB,EAAE;EACpE,oBAAoB,iBAAiB,CAAC,qBAAqB,CAAC;EAC5D;EACA,gBAAgB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;EACtC,oBAAoB,KAAK,EAAE;EAC3B;EACA,aAAa,EAAE,QAAQ,CAAC;EACxB;;EAEA,QAAQ,iBAAiB,CAAC,iBAAiB,CAAC;;EAE5C,QAAQ,OAAO;EACf,YAAY;EACZ;EACA,KAAK,GAAG;EACR,IAAI,MAAM,CAAC,SAAS,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE;EACvE;;;;;;"}
1
+ {"version":3,"file":"browser.domainModel.gtm.js","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.setRefence(entity, origin);\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize || !this.flushInterval || this.flushInterval < 1) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import CollecionesEmitter from './CollecionesEmitter.js';\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesWebTracker from './CollecionesWebTracker.js';\nimport constants from './browser.domainModel.gtm.constants.js';\n\nif (!window[constants.collecionesObject]) {\n window[constants.collecionesObject] = (() => {\n\n let initialized = false;\n let emitter = null;\n let tracker = null;\n let patchedQueue = null;\n const patchedQueueFlag = '__collecionesPatchedPush__';\n const queueWaitInterval = 250;\n const queueRecoveryInterval = 2000;\n let queueWatcherTimer = null;\n let queueWatcherInterval = null;\n\n let init = () => {\n if (initialized) return true;\n if (window[constants.sharedWindowObjectNames.configVariable] === undefined) return false;\n let config = window[constants.sharedWindowObjectNames.configVariable];\n if (config.type === undefined || config.type !== constants.typeCastGtmVariableConfig) return false;\n let flushInterval = config[constants.config.flushInterval];\n let flushSize = config[constants.config.flushSize];\n let trackerName = config[constants.config.trackerName];\n let appName = config[constants.config.appName];\n let emitterEndpoint = config[constants.config.emitterEndpoint] ?? config.endpoint;\n try {\n emitter = new CollecionesEmitter(emitterEndpoint, flushSize, flushInterval);\n tracker = new CollecionesWebTracker([emitter], trackerName, appName);\n initialized = true;\n return true;\n } catch (e) {\n console.error('Error initializing CollecionesEmitter:', e);\n return false;\n }\n }\n\n let track = (arg) => {\n if (!initialized) return false;\n if (!tracker) return false;\n if (!arg || typeof arg !== 'object') return false;\n if (!arg.entity || !arg.action) return false;\n\n const normalizeIdentifiers = (identifiers) => {\n if (Array.isArray(identifiers)) {\n return identifiers.flatMap(identifier => {\n if (typeof identifier !== 'object' || identifier === null) {\n return [];\n }\n if (identifier.name !== undefined || identifier.value !== undefined) {\n return [identifier];\n }\n return Object.entries(identifier).map(([name, value]) => ({ name, value }));\n });\n }\n if (!identifiers || typeof identifiers !== 'object') {\n return [];\n }\n return Object.entries(identifiers).map(([name, value]) => ({ name, value }));\n };\n\n const collectionOperators = {\n '==': (left, right) => left == right,\n '===': (left, right) => left === right,\n '!=': (left, right) => left != right,\n '!==': (left, right) => left !== right,\n '>': (left, right) => left > right,\n '>=': (left, right) => left >= right,\n '<': (left, right) => left < right,\n '<=': (left, right) => left <= right,\n 'in': (left, right) => Array.isArray(right) && right.includes(left)\n };\n\n // Small path resolver used by evaluated collections and filters.\n const getByPath = (obj, path) => {\n if (!path || typeof path !== 'string') {\n return undefined;\n }\n return path.split('.').reduce((acc, key) => {\n return (acc && acc[key] !== undefined) ? acc[key] : undefined;\n }, obj);\n };\n\n // Collection items are stored as `{ identifierField: value }` on the event.\n const addCollectionItem = (collectionName, identifierName, identifierValue) => {\n if (!collectionName || !identifierName || identifierValue === undefined || identifierValue === null) {\n return;\n }\n const collectionKey = event.setCollectionItem(collectionName);\n event.setCollectionItemReference(collectionName, collectionKey, identifierName, identifierValue);\n };\n\n // ARRAY collections are the simplest form:\n // they are arrays of primitive values that should be copied into the event\n // using the configured identifier field.\n const applyArrayCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.array)) {\n return false;\n }\n const identifierName = collectionConfig.identifierField;\n collectionConfig.array.forEach((value) => {\n if (Array.isArray(value)) {\n value.forEach((nestedValue) => addCollectionItem(collectionName, identifierName, nestedValue));\n return;\n }\n addCollectionItem(collectionName, identifierName, value);\n });\n return true;\n };\n\n // EVALUATED collections derive their identifier value from a path on each item.\n // An optional filter object narrows the source array before mapping.\n const applyEvaluatedCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.itemsField)) {\n return false;\n }\n\n let items = collectionConfig.itemsField;\n const filter = collectionConfig.filter;\n if (\n filter &&\n typeof filter === 'object' &&\n filter.path &&\n filter.operator &&\n collectionOperators[filter.operator]\n ) {\n items = items.filter((item) => {\n return collectionOperators[filter.operator](getByPath(item, filter.path), filter.value);\n });\n }\n\n const identifierName = collectionConfig.identifierField;\n items.forEach((item) => {\n const identifierValue = getByPath(item, collectionConfig.path) ?? item?.[identifierName] ?? item?.id;\n addCollectionItem(collectionName, identifierName, identifierValue);\n });\n return true;\n };\n\n // PARAMTABLE rows use dynamic field names that are prefixed by the collection name:\n // e.g. `listingParamTableItemsField` and `listingIdentifierValueParamTable`.\n const applyParamTableCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.table)) {\n return false;\n }\n\n const identifierNameKey = `${collectionName}ParamTableItemsField`;\n const identifierValueKey = `${collectionName}IdentifierValueParamTable`;\n collectionConfig.table.forEach((row) => {\n if (!row || typeof row !== 'object') {\n return;\n }\n const identifierName = row[identifierNameKey];\n const identifierValue = row[identifierValueKey];\n addCollectionItem(collectionName, identifierName, identifierValue);\n });\n return true;\n };\n\n const applyCollectionConfig = (collectionName, collectionConfig) => {\n if (!collectionConfig || typeof collectionConfig !== 'object') {\n return;\n }\n\n if (collectionConfig.type === 'ARRAY') {\n applyArrayCollection(collectionName, collectionConfig);\n return;\n }\n if (collectionConfig.type === 'EVALUATED') {\n applyEvaluatedCollection(collectionName, collectionConfig);\n return;\n }\n if (collectionConfig.type === 'PARAMTABLE') {\n applyParamTableCollection(collectionName, collectionConfig);\n }\n };\n\n const event = new CollecionesEvent();\n event.setEntity(arg.entity);\n event.setAction(arg.action);\n\n normalizeIdentifiers(arg.identifiers).forEach(identifier => {\n if (typeof identifier !== 'object' || identifier === null) return;\n if (!identifier.name || !identifier.value) return;\n event.setIdentifier(identifier.name, identifier.value);\n });\n\n if (arg.actor?.entity) {\n event.setActor(arg.actor.entity);\n let identifiers = arg.actor?.identifiers;\n if (!Array.isArray(identifiers)) {\n identifiers = identifiers?.[arg.actor.entity] ?? identifiers;\n }\n normalizeIdentifiers(identifiers).forEach(identifier => {\n if (typeof identifier !== 'object' || identifier === null) return;\n if (!identifier.name || !identifier.value) return;\n event.setActorIdentifier(identifier.name, identifier.value);\n });\n }\n\n const relations = arg?.relations ?? arg?.rerelations;\n if (relations && typeof relations === 'object') {\n Object.keys(relations).forEach(relationName => {\n event.setReference(relationName);\n Object.keys(relations[relationName]).forEach(identifierName => {\n event.setReferenceIdentifier(relationName, identifierName, relations[relationName][identifierName]);\n });\n });\n }\n if (arg?.adjectives && typeof arg.adjectives === 'object') {\n Object.keys(arg.adjectives).forEach(adjectiveName => {\n event.addAdjective(adjectiveName, arg.adjectives[adjectiveName]);\n });\n }\n\n if (arg?.collections && typeof arg.collections === 'object') {\n Object.keys(arg.collections).forEach(collectionName => {\n applyCollectionConfig(collectionName, arg.collections[collectionName]);\n });\n }\n\n tracker.track(event);\n return true;\n }\n\n let flush = () => {\n if (!init()) {\n return;\n }\n const queue = ensureQueue();\n if (!queue) return;\n while (queue.length > 0) {\n const args = queue.shift();\n track(args);\n }\n }\n\n let patchQueuePush = (queue) => {\n if (!Array.isArray(queue) || queue[patchedQueueFlag]) {\n patchedQueue = queue;\n return queue;\n }\n\n const originalPush = queue.push.bind(queue);\n Object.defineProperty(queue, patchedQueueFlag, {\n value: true,\n configurable: true\n });\n queue.push = (...args) => {\n const result = originalPush(...args);\n flush();\n return result;\n };\n\n patchedQueue = queue;\n return queue;\n }\n\n let ensureQueue = () => {\n let queue = window[constants.sharedWindowObjectNames.queue];\n if (!Array.isArray(queue)) {\n return null;\n }\n if (queue !== patchedQueue) {\n patchQueuePush(queue);\n }\n return queue;\n }\n\n let startQueueWatcher = (interval = queueWaitInterval) => {\n if (queueWatcherInterval === interval && queueWatcherTimer) {\n return;\n }\n if (queueWatcherTimer) {\n clearInterval(queueWatcherTimer);\n }\n queueWatcherInterval = interval;\n queueWatcherTimer = setInterval(() => {\n const queue = ensureQueue();\n if (!queue) {\n return;\n }\n if (queueWatcherInterval !== queueRecoveryInterval) {\n startQueueWatcher(queueRecoveryInterval);\n }\n if (queue.length > 0) {\n flush();\n }\n }, interval);\n }\n\n startQueueWatcher(queueWaitInterval);\n\n return {\n flush\n }\n })();\n window[constants.collecionesObject].flush();\n}\n"],"names":[],"mappings":";;;EAAA;;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,QAAQ,GAAG,UAAU,GAAG,EAAE;EAChC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;EAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;EAC7D,KAAK,MAAM;EACX,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;EAC3D;EACA;;EAgBA;EACA;EACA;EACA;EACA;EACA,MAAM,iBAAiB,GAAG,WAAW;EACrC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;EAC3E,QAAQ,OAAO,EAAE;EACjB;EACA,IAAI,OAAO;EACX,QAAQ,Q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IAAI,iBAAiB,EAAE;EACxE,gBAAgB;EAChB;EACA,YAAY,IAAI,iBAAiB,EAAE;EACnC,gBAAgB,aAAa,CAAC,iBAAiB,CAAC;EAChD;EACA,YAAY,oBAAoB,GAAG,QAAQ;EAC3C,YAAY,iBAAiB,GAAG,WAAW,CAAC,MAAM;EAClD,gBAAgB,MAAM,KAAK,GAAG,WAAW,EAAE;EAC3C,gBAAgB,IAAI,CAAC,KAAK,EAAE;EAC5B,oBAAoB;EACpB;EACA,gBAAgB,IAAI,oBAAoB,KAAK,qBAAqB,EAAE;EACpE,oBAAoB,iBAAiB,CAAC,qBAAqB,CAAC;EAC5D;EACA,gBAAgB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;EACtC,oBAAoB,KAAK,EAAE;EAC3B;EACA,aAAa,EAAE,QAAQ,CAAC;EACxB;;EAEA,QAAQ,iBAAiB,CAAC,iBAAiB,CAAC;;EAE5C,QAAQ,OAAO;EACf,YAAY;EACZ;EACA,KAAK,GAAG;EACR,IAAI,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE;EAC/C;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(){"use strict";const e=function(e){return e.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).map((e,t)=>0===t?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")};class t{constructor(){this.entity="",this.adjevtives=[],this.identifiers={},this.action="",this.actor={},this.actorIdentifiers={},this.context={},this.references={},this.collections={},this.meta={eventFormat:"CollecionesEvent",eventFormatVersion:"1"},this.meta.tracker="",this.meta.app="",this.meta.timestamps={},this.meta.timestamps.clientDatetimeUtc=(new Date).toISOString(),"undefined"!=typeof window&&"undefined"!=typeof navigator&&navigator.language?(this.meta.timestamps.clientDatetimeLocal=new Date(Date.now()-6e4*(new Date).getTimezoneOffset()).toISOString(),this.meta.timestamps.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.meta.timestamps.timeZoneOffset=(new Date).getTimezoneOffset()):(this.meta.timestamps.clientDatetimeLocal=(new Date).toISOString(),this.meta.timestamps.timeZone="UTC")}getEventFormat(){let e=this.meta?.eventFormat;return void 0!==e?e:"1"}getEventFormatVersion(){let e=this?.meta?.eventFormatVersion;return void 0!==e?e:"CollecionesEvent"}overrideDatetime(e={}){for(const[t,i]of Object.entries(e))this.meta.timestamps[t]=i}setTracker(e){this.meta.tracker=e}setAppName(e){this.meta.appName=e}setSchema(e){if("string"!=typeof e)throw new Error("Schema must be a string");this.meta.schema=e}setEntity=function(t){this.entity=e(t)};setAction=function(t){this.action=e(t)};addAdjective=function(t){if("string"!=typeof t)throw new Error("Adjective must be a string");this.adjevtives.push(e(t))};setIdentifier=function(e,t){if("string"!=typeof e)throw new Error("Identifier name must be a string");this.identifiers[e]=t};setActor=function(e){if("string"!=typeof e)throw new Error("Actor name must be a string");this.actor.name=e};setActorIdentifier=function(e,t){if("string"!=typeof e)throw new Error("Actor Identifier name must be a string");this.actorIdentifiers[e]=t};setContext=function(e,t){if("string"!=typeof e)throw new Error("Context must be a string");this.context[e]=t};setRefence=function(e,t=null){return this.setReference(e,t)};setReference=function(t,i=null){if("string"!=typeof t)throw new Error("Referenced entity must be a string");t=e(t),null!==i&&(t=`${i}.${t}`),void 0===this.references[t]&&(this.references[t]={identifiers:{},origin:i})};setRefenceIdentifier=function(e,t,i,n=null){return this.setReferenceIdentifier(e,t,i,n)};setReferenceIdentifier=function(t,i,n,r=null){if("string"!=typeof t)throw new Error("Referenced entity name must be a string");if("string"!=typeof i)throw new Error("Actor Identifier name must be a string");this.setRefence(t,r),t=e(t),null!==r&&(t=`${r}.${t}`),this.references[t].identifiers[i]=n};setCollection=function(t,i=null){t=e(t),null!==i&&(t=`${i}.${t}`),null==this.collections[t]&&(this.collections[t]={items:[],identifiers:{},origin:i})};setCollectionItem=function(t,i=null){return t=e(t),null!==i&&(t=`${i}.${t}`),this.setCollection(t),this.collections[t].items.push({}),this.collections[t].items.length-1};setCollectionItemReference=function(t,i,n,r,s=null){if(t=e(t),null!==s&&(t=`${s}.${t}`),this.setCollection(t),"object"!=typeof this.collections[t].items[i])throw new Error("bad bad man, the collection key does not exists");this.collections[t].items[i][n]=r};setCollectionIdentifier=function(t,i,n,r=null){t=e(t),null!==r&&(t=`${r}.${t}`),null==this.collections[t]&&(this.collections[t]={}),this.collections[t].identifiers[i]=n};toJSON(){return{class:"CollecionesEvent",entity:this.entity,adjectives:this.adjevtives,identifiers:this.identifiers,action:this.action,actor:this.actor,actorIdentifiers:this.actorIdentifiers,actorIds:this.actorIds,context:this.context,references:this.references,meta:this.meta,collections:this.collections}}static fromJSON(e){if(!e||"CollecionesEvent"!==e.class)throw new Error("Invalid or missing event class type");const i=new t;return i.entity=e.entity,i.adjevtives=e.adjectives||[],i.identifiers=e.identifiers||{},i.action=e.action,i.actor=e.actor,i.actorIdentifiers=e.actorIdentifiers,i.actorIds=e.actorIds,i.context=e.context||{},i.references=e.references||{},i.meta=e.meta||{},i.collections=e.collections||{},i}}class i{constructor(e="/collect",t=10,i=!1){this.endpoint=e,this.flushInterval=i,this.flushSize=t,this.buffer=[],this.timer=null,this.lastPayload=null}startTimer(){this.stopTimer(),"number"==typeof this.flushInterval&&this.flushInterval>0&&(this.timer=setInterval(()=>this.flush(),this.flushInterval))}startTimerIfStopped(){this.timer||this.startTimer()}stopTimer(){this.timer&&clearInterval(this.timer),this.timer=null}track(e){if(!(e instanceof t))throw new Error("Event must be an instance of CollecionesEvent");this.trackAsync(e)}async trackAsync(e){if(!(e instanceof t))throw new Error("Event must be an instance of CollecionesEvent");return this.startTimerIfStopped(),this.buffer.push(e),this.buffer.length>=this.flushSize||!this.flushInterval||this.flushInterval<1?this.flush():Promise.resolve()}async flush(){if(0===this.buffer.length)return;this.stopTimer();const e=this.buildBody();this.lastPayload=e,this.buffer=[];try{const t=await fetch(this.endpoint,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:e});return t.ok||console.log(`Failed to send events: ${t.statusText}`),!0}catch(e){console.log(`Network error sending events: ${e.message}`)}}buildBody(){return JSON.stringify(this.buffer.map(e=>{return t=JSON.stringify(e.toJSON()),"undefined"!=typeof window&&"function"==typeof window.btoa?window.btoa(unescape(encodeURIComponent(t))):Buffer.from(t,"utf-8").toString("base64");var t}))}}class n{constructor(e,t,i){this.emitters=e,this.trackerName=t,this.appName=i}track(e){if(!(e instanceof t))throw new Error("Event must be of type CollecionesEvent");e.setTracker(this.trackerName),e.setAppName(this.appName),this.emitters.forEach(t=>{t.track(e,this.trackerName,this.appName)})}}class r extends n{constructor(e,t,i){super(e,t,i)}track(e){if(!(e instanceof t))throw new Error("Event must be of type CollecionesEvent");e.setContext("browserContext","undefined"==typeof window||"undefined"==typeof navigator?{}:{hasFocus:document.hasFocus(),language:navigator.language,platform:navigator.platform,referrer:document.referrer,screenHeight:window.screen.height,screenWidth:window.screen.width,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,url:window.location.href,userAgent:navigator.userAgent,viewportHeight:window.innerHeight,viewportWidth:window.innerWidth}),super.track(e)}}var s={queue:"compilacionCollecionesClientosGtmQueue",collecionesObject:"compilacionCollecionesClientosGtm",configVariable:"compilacionCollecionesClientosGtmTypeCastConfig"},o={flushInterval:"flushInterval",flushSize:"flushSize",trackerName:"trackerName",appName:"appName",emitterEndpoint:"emitterEndpoint"},a="compilacionCollecionesClientosGtmTypeCastConfig";window[s.collecionesObject]||(window[s.collecionesObject]=(()=>{let e=!1,n=null,c=null,l=null;const f="__collecionesPatchedPush__";let h=null,u=null,m=i=>{if(!e)return!1;if(!c)return!1;if(!i||"object"!=typeof i)return!1;if(!i.entity||!i.action)return!1;const n=e=>Array.isArray(e)?e.flatMap(e=>"object"!=typeof e||null===e?[]:void 0!==e.name||void 0!==e.value?[e]:Object.entries(e).map(([e,t])=>({name:e,value:t}))):e&&"object"==typeof e?Object.entries(e).map(([e,t])=>({name:e,value:t})):[],r={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,in:(e,t)=>Array.isArray(t)&&t.includes(e)},s=(e,t)=>{if(t&&"string"==typeof t)return t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:void 0,e)},o=(e,t,i)=>{if(!e||!t||null==i)return;const n=l.setCollectionItem(e);l.setCollectionItemReference(e,n,t,i)},a=(e,t)=>{t&&"object"==typeof t&&("ARRAY"!==t.type?"EVALUATED"!==t.type?"PARAMTABLE"===t.type&&((e,t)=>{if(!Array.isArray(t.table))return!1;const i=`${e}ParamTableItemsField`,n=`${e}IdentifierValueParamTable`;t.table.forEach(t=>{if(!t||"object"!=typeof t)return;const r=t[i],s=t[n];o(e,r,s)})})(e,t):((e,t)=>{if(!Array.isArray(t.itemsField))return!1;let i=t.itemsField;const n=t.filter;n&&"object"==typeof n&&n.path&&n.operator&&r[n.operator]&&(i=i.filter(e=>r[n.operator](s(e,n.path),n.value)));const a=t.identifierField;i.forEach(i=>{const n=s(i,t.path)??i?.[a]??i?.id;o(e,a,n)})})(e,t):((e,t)=>{if(!Array.isArray(t.array))return!1;const i=t.identifierField;t.array.forEach(t=>{Array.isArray(t)?t.forEach(t=>o(e,i,t)):o(e,i,t)})})(e,t))},l=new t;if(l.setEntity(i.entity),l.setAction(i.action),n(i.identifiers).forEach(e=>{"object"==typeof e&&null!==e&&e.name&&e.value&&l.setIdentifier(e.name,e.value)}),i.actor?.entity){l.setActor(i.actor.entity);let e=i.actor?.identifiers;Array.isArray(e)||(e=e?.[i.actor.entity]??e),n(e).forEach(e=>{"object"==typeof e&&null!==e&&e.name&&e.value&&l.setActorIdentifier(e.name,e.value)})}const f=i?.relations??i?.rerelations;return f&&"object"==typeof f&&Object.keys(f).forEach(e=>{l.setReference(e),Object.keys(f[e]).forEach(t=>{l.setReferenceIdentifier(e,t,f[e][t])})}),i?.adjectives&&"object"==typeof i.adjectives&&Object.keys(i.adjectives).forEach(e=>{l.addAdjective(e,i.adjectives[e])}),i?.collections&&"object"==typeof i.collections&&Object.keys(i.collections).forEach(e=>{a(e,i.collections[e])}),c.track(l),!0},d=()=>{if(!(()=>{if(e)return!0;if(void 0===window[s.configVariable])return!1;let t=window[s.configVariable];if(void 0===t.type||t.type!==a)return!1;let l=t[o.flushInterval],f=t[o.flushSize],h=t[o.trackerName],u=t[o.appName],m=t[o.emitterEndpoint]??t.endpoint;try{return n=new i(m,f,l),c=new r([n],h,u),e=!0,!0}catch(e){return console.error("Error initializing CollecionesEmitter:",e),!1}})())return;const t=p();if(t)for(;t.length>0;){const e=t.shift();m(e)}},p=()=>{let e=window[s.queue];return Array.isArray(e)?(e!==l&&(e=>{if(!Array.isArray(e)||e[f])return l=e,e;const t=e.push.bind(e);Object.defineProperty(e,f,{value:!0,configurable:!0}),e.push=(...e)=>{const i=t(...e);return d(),i},l=e})(e),e):null},y=(e=250)=>{u===e&&h||(h&&clearInterval(h),u=e,h=setInterval(()=>{const e=p();e&&(2e3!==u&&y(2e3),e.length>0&&d())},e))};return y(250),{flush:d}})(),window[s.collecionesObject].flush())}();
1
+ !function(){"use strict";const e=function(e){return e.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).map((e,t)=>0===t?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")};class t{constructor(){this.entity="",this.adjevtives=[],this.identifiers={},this.action="",this.actor={},this.actorIdentifiers={},this.context={},this.references={},this.collections={},this.meta={eventFormat:"CollecionesEvent",eventFormatVersion:"1"},this.meta.tracker="",this.meta.app="",this.meta.timestamps={},this.meta.timestamps.clientDatetimeUtc=(new Date).toISOString(),"undefined"!=typeof window&&"undefined"!=typeof navigator&&navigator.language?(this.meta.timestamps.clientDatetimeLocal=new Date(Date.now()-6e4*(new Date).getTimezoneOffset()).toISOString(),this.meta.timestamps.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.meta.timestamps.timeZoneOffset=(new Date).getTimezoneOffset()):(this.meta.timestamps.clientDatetimeLocal=(new Date).toISOString(),this.meta.timestamps.timeZone="UTC")}getEventFormat(){let e=this.meta?.eventFormat;return void 0!==e?e:"1"}getEventFormatVersion(){let e=this?.meta?.eventFormatVersion;return void 0!==e?e:"CollecionesEvent"}overrideDatetime(e={}){for(const[t,i]of Object.entries(e))this.meta.timestamps[t]=i}setTracker(e){this.meta.tracker=e}setAppName(e){this.meta.appName=e}setSchema(e){if("string"!=typeof e)throw new Error("Schema must be a string");this.meta.schema=e}setEntity=function(t){this.entity=e(t)};setAction=function(t){this.action=e(t)};addAdjective=function(t){if("string"!=typeof t)throw new Error("Adjective must be a string");this.adjevtives.push(e(t))};setIdentifier=function(e,t){if("string"!=typeof e)throw new Error("Identifier name must be a string");this.identifiers[e]=t};setActor=function(e){if("string"!=typeof e)throw new Error("Actor name must be a string");this.actor.name=e};setActorIdentifier=function(e,t){if("string"!=typeof e)throw new Error("Actor Identifier name must be a string");this.actorIdentifiers[e]=t};setContext=function(e,t){if("string"!=typeof e)throw new Error("Context must be a string");this.context[e]=t};setRefence=function(e,t=null){return this.setReference(e,t)};setReference=function(t,i=null){if("string"!=typeof t)throw new Error("Referenced entity must be a string");t=e(t),null!==i&&(t=`${i}.${t}`),void 0===this.references[t]&&(this.references[t]={identifiers:{},origin:i})};setRefenceIdentifier=function(e,t,i,n=null){return this.setReferenceIdentifier(e,t,i,n)};setReferenceIdentifier=function(t,i,n,r=null){if("string"!=typeof t)throw new Error("Referenced entity name must be a string");if("string"!=typeof i)throw new Error("Actor Identifier name must be a string");this.setRefence(t,r),t=e(t),null!==r&&(t=`${r}.${t}`),this.references[t].identifiers[i]=n};setCollection=function(t,i=null){t=e(t),null!==i&&(t=`${i}.${t}`),null==this.collections[t]&&(this.collections[t]={items:[],identifiers:{},origin:i})};setCollectionItem=function(t,i=null){return t=e(t),null!==i&&(t=`${i}.${t}`),this.setCollection(t),this.collections[t].items.push({}),this.collections[t].items.length-1};setCollectionItemReference=function(t,i,n,r,s=null){if(t=e(t),null!==s&&(t=`${s}.${t}`),this.setCollection(t),"object"!=typeof this.collections[t].items[i])throw new Error("bad bad man, the collection key does not exists");this.collections[t].items[i][n]=r};setCollectionIdentifier=function(t,i,n,r=null){t=e(t),null!==r&&(t=`${r}.${t}`),null==this.collections[t]&&(this.collections[t]={}),this.collections[t].identifiers[i]=n};toJSON(){return{class:"CollecionesEvent",entity:this.entity,adjectives:this.adjevtives,identifiers:this.identifiers,action:this.action,actor:this.actor,actorIdentifiers:this.actorIdentifiers,actorIds:this.actorIds,context:this.context,references:this.references,meta:this.meta,collections:this.collections}}static fromJSON(e){if(!e||"CollecionesEvent"!==e.class)throw new Error("Invalid or missing event class type");const i=new t;return i.entity=e.entity,i.adjevtives=e.adjectives||[],i.identifiers=e.identifiers||{},i.action=e.action,i.actor=e.actor,i.actorIdentifiers=e.actorIdentifiers,i.actorIds=e.actorIds,i.context=e.context||{},i.references=e.references||{},i.meta=e.meta||{},i.collections=e.collections||{},i}}class i{constructor(e="/collect",t=10,i=!1){this.endpoint=e,this.flushInterval=i,this.flushSize=t,this.buffer=[],this.timer=null,this.lastPayload=null}startTimer(){this.stopTimer(),"number"==typeof this.flushInterval&&this.flushInterval>0&&(this.timer=setInterval(()=>this.flush(),this.flushInterval))}startTimerIfStopped(){this.timer||this.startTimer()}stopTimer(){this.timer&&clearInterval(this.timer),this.timer=null}track(e){if(!(e instanceof t))throw new Error("Event must be an instance of CollecionesEvent");this.trackAsync(e)}async trackAsync(e){if(!(e instanceof t))throw new Error("Event must be an instance of CollecionesEvent");return this.startTimerIfStopped(),this.buffer.push(e),this.buffer.length>=this.flushSize||!this.flushInterval||this.flushInterval<1?this.flush():Promise.resolve()}async flush(){if(0===this.buffer.length)return;this.stopTimer();const e=this.buildBody();this.lastPayload=e,this.buffer=[];try{const t=await fetch(this.endpoint,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:e});return t.ok||console.log(`Failed to send events: ${t.statusText}`),!0}catch(e){console.log(`Network error sending events: ${e.message}`)}}buildBody(){return JSON.stringify(this.buffer.map(e=>{return t=JSON.stringify(e.toJSON()),"undefined"!=typeof window&&"function"==typeof window.btoa?window.btoa(unescape(encodeURIComponent(t))):Buffer.from(t,"utf-8").toString("base64");var t}))}}class n{constructor(e,t,i){this.emitters=e,this.trackerName=t,this.appName=i}track(e){if(!(e instanceof t))throw new Error("Event must be of type CollecionesEvent");e.setTracker(this.trackerName),e.setAppName(this.appName),this.emitters.forEach(t=>{t.track(e,this.trackerName,this.appName)})}}class r extends n{constructor(e,t,i){super(e,t,i)}track(e){if(!(e instanceof t))throw new Error("Event must be of type CollecionesEvent");e.setContext("browserContext","undefined"==typeof window||"undefined"==typeof navigator?{}:{hasFocus:document.hasFocus(),language:navigator.language,platform:navigator.platform,referrer:document.referrer,screenHeight:window.screen.height,screenWidth:window.screen.width,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,url:window.location.href,userAgent:navigator.userAgent,viewportHeight:window.innerHeight,viewportWidth:window.innerWidth}),super.track(e)}}var s={queue:"compilacionCollecionesClientosGtmQueue",configVariable:"compilacionCollecionesClientosGtmTypeCastConfig"},o={flushInterval:"flushInterval",flushSize:"flushSize",trackerName:"trackerName",appName:"appName",emitterEndpoint:"emitterEndpoint"},a="compilacionCollecionesClientosGtm",c="compilacionCollecionesClientosGtmTypeCastConfig";window[a]||(window[a]=(()=>{let e=!1,n=null,a=null,l=null;const f="__collecionesPatchedPush__";let h=null,u=null,m=i=>{if(!e)return!1;if(!a)return!1;if(!i||"object"!=typeof i)return!1;if(!i.entity||!i.action)return!1;const n=e=>Array.isArray(e)?e.flatMap(e=>"object"!=typeof e||null===e?[]:void 0!==e.name||void 0!==e.value?[e]:Object.entries(e).map(([e,t])=>({name:e,value:t}))):e&&"object"==typeof e?Object.entries(e).map(([e,t])=>({name:e,value:t})):[],r={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,in:(e,t)=>Array.isArray(t)&&t.includes(e)},s=(e,t)=>{if(t&&"string"==typeof t)return t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:void 0,e)},o=(e,t,i)=>{if(!e||!t||null==i)return;const n=l.setCollectionItem(e);l.setCollectionItemReference(e,n,t,i)},c=(e,t)=>{t&&"object"==typeof t&&("ARRAY"!==t.type?"EVALUATED"!==t.type?"PARAMTABLE"===t.type&&((e,t)=>{if(!Array.isArray(t.table))return!1;const i=`${e}ParamTableItemsField`,n=`${e}IdentifierValueParamTable`;t.table.forEach(t=>{if(!t||"object"!=typeof t)return;const r=t[i],s=t[n];o(e,r,s)})})(e,t):((e,t)=>{if(!Array.isArray(t.itemsField))return!1;let i=t.itemsField;const n=t.filter;n&&"object"==typeof n&&n.path&&n.operator&&r[n.operator]&&(i=i.filter(e=>r[n.operator](s(e,n.path),n.value)));const a=t.identifierField;i.forEach(i=>{const n=s(i,t.path)??i?.[a]??i?.id;o(e,a,n)})})(e,t):((e,t)=>{if(!Array.isArray(t.array))return!1;const i=t.identifierField;t.array.forEach(t=>{Array.isArray(t)?t.forEach(t=>o(e,i,t)):o(e,i,t)})})(e,t))},l=new t;if(l.setEntity(i.entity),l.setAction(i.action),n(i.identifiers).forEach(e=>{"object"==typeof e&&null!==e&&e.name&&e.value&&l.setIdentifier(e.name,e.value)}),i.actor?.entity){l.setActor(i.actor.entity);let e=i.actor?.identifiers;Array.isArray(e)||(e=e?.[i.actor.entity]??e),n(e).forEach(e=>{"object"==typeof e&&null!==e&&e.name&&e.value&&l.setActorIdentifier(e.name,e.value)})}const f=i?.relations??i?.rerelations;return f&&"object"==typeof f&&Object.keys(f).forEach(e=>{l.setReference(e),Object.keys(f[e]).forEach(t=>{l.setReferenceIdentifier(e,t,f[e][t])})}),i?.adjectives&&"object"==typeof i.adjectives&&Object.keys(i.adjectives).forEach(e=>{l.addAdjective(e,i.adjectives[e])}),i?.collections&&"object"==typeof i.collections&&Object.keys(i.collections).forEach(e=>{c(e,i.collections[e])}),a.track(l),!0},d=()=>{if(!(()=>{if(e)return!0;if(void 0===window[s.configVariable])return!1;let t=window[s.configVariable];if(void 0===t.type||t.type!==c)return!1;let l=t[o.flushInterval],f=t[o.flushSize],h=t[o.trackerName],u=t[o.appName],m=t[o.emitterEndpoint]??t.endpoint;try{return n=new i(m,f,l),a=new r([n],h,u),e=!0,!0}catch(e){return console.error("Error initializing CollecionesEmitter:",e),!1}})())return;const t=p();if(t)for(;t.length>0;){const e=t.shift();m(e)}},p=()=>{let e=window[s.queue];return Array.isArray(e)?(e!==l&&(e=>{if(!Array.isArray(e)||e[f])return l=e,e;const t=e.push.bind(e);Object.defineProperty(e,f,{value:!0,configurable:!0}),e.push=(...e)=>{const i=t(...e);return d(),i},l=e})(e),e):null},y=(e=250)=>{u===e&&h||(h&&clearInterval(h),u=e,h=setInterval(()=>{const e=p();e&&(2e3!==u&&y(2e3),e.length>0&&d())},e))};return y(250),{flush:d}})(),window[a].flush())}();
2
2
  //# sourceMappingURL=browser.domainModel.gtm.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.domainModel.gtm.min.js","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.setRefence(entity, origin);\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize || !this.flushInterval || this.flushInterval < 1) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import CollecionesEmitter from './CollecionesEmitter.js';\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesWebTracker from './CollecionesWebTracker.js';\nimport constants from './browser.domainModel.gtm.constants.js';\n\nif (!window[constants.sharedWindowObjectNames.collecionesObject]) {\n window[constants.sharedWindowObjectNames.collecionesObject] = (() => {\n\n let initialized = false;\n let emitter = null;\n let tracker = null;\n let patchedQueue = null;\n const patchedQueueFlag = '__collecionesPatchedPush__';\n const queueWaitInterval = 250;\n const queueRecoveryInterval = 2000;\n let queueWatcherTimer = null;\n let queueWatcherInterval = null;\n\n let init = () => {\n if (initialized) return true;\n if (window[constants.sharedWindowObjectNames.configVariable] === undefined) return false;\n let config = window[constants.sharedWindowObjectNames.configVariable];\n if (config.type === undefined || config.type !== constants.typeCastGtmVariableConfig) return false;\n let flushInterval = config[constants.config.flushInterval];\n let flushSize = config[constants.config.flushSize];\n let trackerName = config[constants.config.trackerName];\n let appName = config[constants.config.appName];\n let emitterEndpoint = config[constants.config.emitterEndpoint] ?? config.endpoint;\n try {\n emitter = new CollecionesEmitter(emitterEndpoint, flushSize, flushInterval);\n tracker = new CollecionesWebTracker([emitter], trackerName, appName);\n initialized = true;\n return true;\n } catch (e) {\n console.error('Error initializing CollecionesEmitter:', e);\n return false;\n }\n }\n\n let track = (arg) => {\n if (!initialized) return false;\n if (!tracker) return false;\n if (!arg || typeof arg !== 'object') return false;\n if (!arg.entity || !arg.action) return false;\n\n const normalizeIdentifiers = (identifiers) => {\n if (Array.isArray(identifiers)) {\n return identifiers.flatMap(identifier => {\n if (typeof identifier !== 'object' || identifier === null) {\n return [];\n }\n if (identifier.name !== undefined || identifier.value !== undefined) {\n return [identifier];\n }\n return Object.entries(identifier).map(([name, value]) => ({ name, value }));\n });\n }\n if (!identifiers || typeof identifiers !== 'object') {\n return [];\n }\n return Object.entries(identifiers).map(([name, value]) => ({ name, value }));\n };\n\n const collectionOperators = {\n '==': (left, right) => left == right,\n '===': (left, right) => left === right,\n '!=': (left, right) => left != right,\n '!==': (left, right) => left !== right,\n '>': (left, right) => left > right,\n '>=': (left, right) => left >= right,\n '<': (left, right) => left < right,\n '<=': (left, right) => left <= right,\n 'in': (left, right) => Array.isArray(right) && right.includes(left)\n };\n\n // Small path resolver used by evaluated collections and filters.\n const getByPath = (obj, path) => {\n if (!path || typeof path !== 'string') {\n return undefined;\n }\n return path.split('.').reduce((acc, key) => {\n return (acc && acc[key] !== undefined) ? acc[key] : undefined;\n }, obj);\n };\n\n // Collection items are stored as `{ identifierField: value }` on the event.\n const addCollectionItem = (collectionName, identifierName, identifierValue) => {\n if (!collectionName || !identifierName || identifierValue === undefined || identifierValue === null) {\n return;\n }\n const collectionKey = event.setCollectionItem(collectionName);\n event.setCollectionItemReference(collectionName, collectionKey, identifierName, identifierValue);\n };\n\n // ARRAY collections are the simplest form:\n // they are arrays of primitive values that should be copied into the event\n // using the configured identifier field.\n const applyArrayCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.array)) {\n return false;\n }\n const identifierName = collectionConfig.identifierField;\n collectionConfig.array.forEach((value) => {\n if (Array.isArray(value)) {\n value.forEach((nestedValue) => addCollectionItem(collectionName, identifierName, nestedValue));\n return;\n }\n addCollectionItem(collectionName, identifierName, value);\n });\n return true;\n };\n\n // EVALUATED collections derive their identifier value from a path on each item.\n // An optional filter object narrows the source array before mapping.\n const applyEvaluatedCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.itemsField)) {\n return false;\n }\n\n let items = collectionConfig.itemsField;\n const filter = collectionConfig.filter;\n if (\n filter &&\n typeof filter === 'object' &&\n filter.path &&\n filter.operator &&\n collectionOperators[filter.operator]\n ) {\n items = items.filter((item) => {\n return collectionOperators[filter.operator](getByPath(item, filter.path), filter.value);\n });\n }\n\n const identifierName = collectionConfig.identifierField;\n items.forEach((item) => {\n const identifierValue = getByPath(item, collectionConfig.path) ?? item?.[identifierName] ?? item?.id;\n addCollectionItem(collectionName, identifierName, identifierValue);\n });\n return true;\n };\n\n // PARAMTABLE rows use dynamic field names that are prefixed by the collection name:\n // e.g. `listingParamTableItemsField` and `listingIdentifierValueParamTable`.\n const applyParamTableCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.table)) {\n return false;\n }\n\n const identifierNameKey = `${collectionName}ParamTableItemsField`;\n const identifierValueKey = `${collectionName}IdentifierValueParamTable`;\n collectionConfig.table.forEach((row) => {\n if (!row || typeof row !== 'object') {\n return;\n }\n const identifierName = row[identifierNameKey];\n const identifierValue = row[identifierValueKey];\n addCollectionItem(collectionName, identifierName, identifierValue);\n });\n return true;\n };\n\n const applyCollectionConfig = (collectionName, collectionConfig) => {\n if (!collectionConfig || typeof collectionConfig !== 'object') {\n return;\n }\n\n if (collectionConfig.type === 'ARRAY') {\n applyArrayCollection(collectionName, collectionConfig);\n return;\n }\n if (collectionConfig.type === 'EVALUATED') {\n applyEvaluatedCollection(collectionName, collectionConfig);\n return;\n }\n if (collectionConfig.type === 'PARAMTABLE') {\n applyParamTableCollection(collectionName, collectionConfig);\n }\n };\n\n const event = new CollecionesEvent();\n event.setEntity(arg.entity);\n event.setAction(arg.action);\n\n normalizeIdentifiers(arg.identifiers).forEach(identifier => {\n if (typeof identifier !== 'object' || identifier === null) return;\n if (!identifier.name || !identifier.value) return;\n event.setIdentifier(identifier.name, identifier.value);\n });\n\n if (arg.actor?.entity) {\n event.setActor(arg.actor.entity);\n let identifiers = arg.actor?.identifiers;\n if (!Array.isArray(identifiers)) {\n identifiers = identifiers?.[arg.actor.entity] ?? identifiers;\n }\n normalizeIdentifiers(identifiers).forEach(identifier => {\n if (typeof identifier !== 'object' || identifier === null) return;\n if (!identifier.name || !identifier.value) return;\n event.setActorIdentifier(identifier.name, identifier.value);\n });\n }\n\n const relations = arg?.relations ?? arg?.rerelations;\n if (relations && typeof relations === 'object') {\n Object.keys(relations).forEach(relationName => {\n event.setReference(relationName);\n Object.keys(relations[relationName]).forEach(identifierName => {\n event.setReferenceIdentifier(relationName, identifierName, relations[relationName][identifierName]);\n });\n });\n }\n if (arg?.adjectives && typeof arg.adjectives === 'object') {\n Object.keys(arg.adjectives).forEach(adjectiveName => {\n event.addAdjective(adjectiveName, arg.adjectives[adjectiveName]);\n });\n }\n\n if (arg?.collections && typeof arg.collections === 'object') {\n Object.keys(arg.collections).forEach(collectionName => {\n applyCollectionConfig(collectionName, arg.collections[collectionName]);\n });\n }\n\n tracker.track(event);\n return true;\n }\n\n let flush = () => {\n if (!init()) {\n return;\n }\n const queue = ensureQueue();\n if (!queue) return;\n while (queue.length > 0) {\n const args = queue.shift();\n track(args);\n }\n }\n\n let patchQueuePush = (queue) => {\n if (!Array.isArray(queue) || queue[patchedQueueFlag]) {\n patchedQueue = queue;\n return queue;\n }\n\n const originalPush = queue.push.bind(queue);\n Object.defineProperty(queue, patchedQueueFlag, {\n value: true,\n configurable: true\n });\n queue.push = (...args) => {\n const result = originalPush(...args);\n flush();\n return result;\n };\n\n patchedQueue = queue;\n return queue;\n }\n\n let ensureQueue = () => {\n let queue = window[constants.sharedWindowObjectNames.queue];\n if (!Array.isArray(queue)) {\n return null;\n }\n if (queue !== patchedQueue) {\n patchQueuePush(queue);\n }\n return queue;\n }\n\n let startQueueWatcher = (interval = queueWaitInterval) => {\n if (queueWatcherInterval === interval && queueWatcherTimer) {\n return;\n }\n if (queueWatcherTimer) {\n clearInterval(queueWatcherTimer);\n }\n queueWatcherInterval = interval;\n queueWatcherTimer = setInterval(() => {\n const queue = ensureQueue();\n if (!queue) {\n return;\n }\n if (queueWatcherInterval !== queueRecoveryInterval) {\n startQueueWatcher(queueRecoveryInterval);\n }\n if (queue.length > 0) {\n flush();\n }\n }, interval);\n }\n\n startQueueWatcher(queueWaitInterval);\n\n return {\n flush\n }\n })();\n window[constants.sharedWindowObjectNames.collecionesObject].flush();\n}\n"],"names":["formatToCamelCase","input","replace","trim","split","map","word","index","charAt","toUpperCase","slice","toLowerCase","join","CollecionesEvent","constructor","this","entity","adjevtives","identifiers","action","actor","actorIdentifiers","context","references","collections","meta","eventFormat","eventFormatVersion","tracker","app","timestamps","clientDatetimeUtc","Date","toISOString","window","navigator","language","clientDatetimeLocal","now","getTimezoneOffset","timeZone","Intl","DateTimeFormat","resolvedOptions","timeZoneOffset","getEventFormat","v","getEventFormatVersion","overrideDatetime","dateTimeObject","key","value","Object","entries","setTracker","name","setAppName","appName","setSchema","schema","Error","setEntity","setAction","addAdjective","adjective","push","setIdentifier","identifier","setActor","setActorIdentifier","setContext","setRefence","origin","setReference","undefined","setRefenceIdentifier","setReferenceIdentifier","setCollection","items","setCollectionItem","length","setCollectionItemReference","itemKey","setCollectionIdentifier","toJSON","class","adjectives","actorIds","fromJSON","obj","instance","CollecionesEmitter","endpoint","flushSize","flushInterval","buffer","timer","lastPayload","startTimer","stopTimer","setInterval","flush","startTimerIfStopped","clearInterval","track","event","trackAsync","Promise","resolve","body","buildBody","response","fetch","method","credentials","headers","ok","console","log","statusText","error","message","JSON","stringify","e","toBase64","str","btoa","unescape","encodeURIComponent","Buffer","from","toString","CollecionesTracker","emitters","trackerName","collecionesEvent","forEach","element","CollecionesWebTracker","super","hasFocus","document","platform","referrer","screenHeight","screen","height","screenWidth","width","timezone","url","location","href","userAgent","viewportHeight","innerHeight","viewportWidth","innerWidth","constants","queue","collecionesObject","configVariable","emitterEndpoint","initialized","emitter","patchedQueue","patchedQueueFlag","queueWatcherTimer","queueWatcherInterval","arg","normalizeIdentifiers","Array","isArray","flatMap","collectionOperators","left","right","in","includes","getByPath","path","reduce","acc","addCollectionItem","collectionName","identifierName","identifierValue","collectionKey","applyCollectionConfig","collectionConfig","type","table","identifierNameKey","identifierValueKey","row","applyParamTableCollection","itemsField","filter","operator","item","identifierField","id","applyEvaluatedCollection","array","nestedValue","applyArrayCollection","relations","rerelations","keys","relationName","adjectiveName","config","init","ensureQueue","args","shift","originalPush","bind","defineProperty","configurable","result","patchQueuePush","startQueueWatcher","interval"],"mappings":"yBASA,MA8CMA,EAAoB,SAASC,GACjC,OAAOA,EACJC,QAAQ,iBAAkB,KAC1BC,OACAC,MAAM,OACNC,IAAI,CAACC,EAAMC,IACI,IAAVA,EAAoBD,EACjBA,EAAKE,OAAO,GAAGC,cAAgBH,EAAKI,MAAM,GAAGC,eAErDC,KAAK,GACV,EC/CA,MAAMC,EAeF,WAAAC,GAEIC,KAAKC,OAAS,GACdD,KAAKE,WAAa,GAClBF,KAAKG,YAAc,CAAE,EACrBH,KAAKI,OAAS,GACdJ,KAAKK,MAAQ,CAAE,EACfL,KAAKM,iBAAmB,CAAE,EAC1BN,KAAKO,QAAU,CAAE,EACjBP,KAAKQ,WAAa,CAAE,EACpBR,KAAKS,YAAc,CAAE,EAErBT,KAAKU,KAAO,CACRC,YAAa,mBACbC,mBAAoB,KAExBZ,KAAKU,KAAKG,QAAU,GACpBb,KAAKU,KAAKI,IAAM,GAChBd,KAAK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,EAAiBtG,SAClC0G,EAAkBiD,EAAOrD,EAAiBI,kBAAoBiD,EAAOxH,SACzE,IAII,OAHAyE,EAAU,IAAI1E,EAAmBwE,EAAiBtE,EAAWC,GAC7DlE,EAAU,IAAI+G,EAAsB,CAAC0B,GAAU9B,EAAa9E,GAC5D2G,GAAc,GACP,CACV,CAAC,MAAOxC,GAEL,OADAP,QAAQG,MAAM,yCAA0CI,IACjD,CACvB,GAgMiByF,GACD,OAEJ,MAAMrD,EAAQsD,IACd,GAAKtD,EACL,KAAOA,EAAMhF,OAAS,GAAG,CACrB,MAAMuI,EAAOvD,EAAMwD,QACnBhH,EAAM+G,EACtB,GAwBYD,EAAc,KACd,IAAItD,EAAQ9H,OAAO6H,EAAkCC,OACrD,OAAKY,MAAMC,QAAQb,IAGfA,IAAUM,GA1BG,CAACN,IAClB,IAAKY,MAAMC,QAAQb,IAAUA,EAAMO,GAE/B,OADAD,EAAeN,EACRA,EAGX,MAAMyD,EAAezD,EAAM/F,KAAKyJ,KAAK1D,GACrC5G,OAAOuK,eAAe3D,EAAOO,EAAkB,CAC3CpH,OAAO,EACPyK,cAAc,IAElB5D,EAAM/F,KAAO,IAAIsJ,KACb,MAAMM,EAASJ,KAAgBF,GAE/B,OADAlH,IACOwH,GAGXvD,EAAeN,GAUX8D,CAAe9D,GAEZA,GALI,MAQX+D,EAAoB,CAACC,EAlQC,OAmQlBvD,IAAyBuD,GAAYxD,IAGrCA,GACAjE,cAAciE,GAElBC,EAAuBuD,EACvBxD,EAAoBpE,YAAY,KAC5B,MAAM4D,EAAQsD,IACTtD,IA3QiB,MA8QlBS,GACAsD,EA/QkB,KAiRlB/D,EAAMhF,OAAS,GACfqB,MAEL2H,KAKP,OAFAD,EAxR0B,KA0RnB,CACH1H,QAEP,EApS6D,GAqS9DnE,OAAO6H,EAAkCE,mBAAmB5D"}
1
+ {"version":3,"file":"browser.domainModel.gtm.min.js","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.setRefence(entity, origin);\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize || !this.flushInterval || this.flushInterval < 1) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import CollecionesEmitter from './CollecionesEmitter.js';\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesWebTracker from './CollecionesWebTracker.js';\nimport constants from './browser.domainModel.gtm.constants.js';\n\nif (!window[constants.collecionesObject]) {\n window[constants.collecionesObject] = (() => {\n\n let initialized = false;\n let emitter = null;\n let tracker = null;\n let patchedQueue = null;\n const patchedQueueFlag = '__collecionesPatchedPush__';\n const queueWaitInterval = 250;\n const queueRecoveryInterval = 2000;\n let queueWatcherTimer = null;\n let queueWatcherInterval = null;\n\n let init = () => {\n if (initialized) return true;\n if (window[constants.sharedWindowObjectNames.configVariable] === undefined) return false;\n let config = window[constants.sharedWindowObjectNames.configVariable];\n if (config.type === undefined || config.type !== constants.typeCastGtmVariableConfig) return false;\n let flushInterval = config[constants.config.flushInterval];\n let flushSize = config[constants.config.flushSize];\n let trackerName = config[constants.config.trackerName];\n let appName = config[constants.config.appName];\n let emitterEndpoint = config[constants.config.emitterEndpoint] ?? config.endpoint;\n try {\n emitter = new CollecionesEmitter(emitterEndpoint, flushSize, flushInterval);\n tracker = new CollecionesWebTracker([emitter], trackerName, appName);\n initialized = true;\n return true;\n } catch (e) {\n console.error('Error initializing CollecionesEmitter:', e);\n return false;\n }\n }\n\n let track = (arg) => {\n if (!initialized) return false;\n if (!tracker) return false;\n if (!arg || typeof arg !== 'object') return false;\n if (!arg.entity || !arg.action) return false;\n\n const normalizeIdentifiers = (identifiers) => {\n if (Array.isArray(identifiers)) {\n return identifiers.flatMap(identifier => {\n if (typeof identifier !== 'object' || identifier === null) {\n return [];\n }\n if (identifier.name !== undefined || identifier.value !== undefined) {\n return [identifier];\n }\n return Object.entries(identifier).map(([name, value]) => ({ name, value }));\n });\n }\n if (!identifiers || typeof identifiers !== 'object') {\n return [];\n }\n return Object.entries(identifiers).map(([name, value]) => ({ name, value }));\n };\n\n const collectionOperators = {\n '==': (left, right) => left == right,\n '===': (left, right) => left === right,\n '!=': (left, right) => left != right,\n '!==': (left, right) => left !== right,\n '>': (left, right) => left > right,\n '>=': (left, right) => left >= right,\n '<': (left, right) => left < right,\n '<=': (left, right) => left <= right,\n 'in': (left, right) => Array.isArray(right) && right.includes(left)\n };\n\n // Small path resolver used by evaluated collections and filters.\n const getByPath = (obj, path) => {\n if (!path || typeof path !== 'string') {\n return undefined;\n }\n return path.split('.').reduce((acc, key) => {\n return (acc && acc[key] !== undefined) ? acc[key] : undefined;\n }, obj);\n };\n\n // Collection items are stored as `{ identifierField: value }` on the event.\n const addCollectionItem = (collectionName, identifierName, identifierValue) => {\n if (!collectionName || !identifierName || identifierValue === undefined || identifierValue === null) {\n return;\n }\n const collectionKey = event.setCollectionItem(collectionName);\n event.setCollectionItemReference(collectionName, collectionKey, identifierName, identifierValue);\n };\n\n // ARRAY collections are the simplest form:\n // they are arrays of primitive values that should be copied into the event\n // using the configured identifier field.\n const applyArrayCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.array)) {\n return false;\n }\n const identifierName = collectionConfig.identifierField;\n collectionConfig.array.forEach((value) => {\n if (Array.isArray(value)) {\n value.forEach((nestedValue) => addCollectionItem(collectionName, identifierName, nestedValue));\n return;\n }\n addCollectionItem(collectionName, identifierName, value);\n });\n return true;\n };\n\n // EVALUATED collections derive their identifier value from a path on each item.\n // An optional filter object narrows the source array before mapping.\n const applyEvaluatedCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.itemsField)) {\n return false;\n }\n\n let items = collectionConfig.itemsField;\n const filter = collectionConfig.filter;\n if (\n filter &&\n typeof filter === 'object' &&\n filter.path &&\n filter.operator &&\n collectionOperators[filter.operator]\n ) {\n items = items.filter((item) => {\n return collectionOperators[filter.operator](getByPath(item, filter.path), filter.value);\n });\n }\n\n const identifierName = collectionConfig.identifierField;\n items.forEach((item) => {\n const identifierValue = getByPath(item, collectionConfig.path) ?? item?.[identifierName] ?? item?.id;\n addCollectionItem(collectionName, identifierName, identifierValue);\n });\n return true;\n };\n\n // PARAMTABLE rows use dynamic field names that are prefixed by the collection name:\n // e.g. `listingParamTableItemsField` and `listingIdentifierValueParamTable`.\n const applyParamTableCollection = (collectionName, collectionConfig) => {\n if (!Array.isArray(collectionConfig.table)) {\n return false;\n }\n\n const identifierNameKey = `${collectionName}ParamTableItemsField`;\n const identifierValueKey = `${collectionName}IdentifierValueParamTable`;\n collectionConfig.table.forEach((row) => {\n if (!row || typeof row !== 'object') {\n return;\n }\n const identifierName = row[identifierNameKey];\n const identifierValue = row[identifierValueKey];\n addCollectionItem(collectionName, identifierName, identifierValue);\n });\n return true;\n };\n\n const applyCollectionConfig = (collectionName, collectionConfig) => {\n if (!collectionConfig || typeof collectionConfig !== 'object') {\n return;\n }\n\n if (collectionConfig.type === 'ARRAY') {\n applyArrayCollection(collectionName, collectionConfig);\n return;\n }\n if (collectionConfig.type === 'EVALUATED') {\n applyEvaluatedCollection(collectionName, collectionConfig);\n return;\n }\n if (collectionConfig.type === 'PARAMTABLE') {\n applyParamTableCollection(collectionName, collectionConfig);\n }\n };\n\n const event = new CollecionesEvent();\n event.setEntity(arg.entity);\n event.setAction(arg.action);\n\n normalizeIdentifiers(arg.identifiers).forEach(identifier => {\n if (typeof identifier !== 'object' || identifier === null) return;\n if (!identifier.name || !identifier.value) return;\n event.setIdentifier(identifier.name, identifier.value);\n });\n\n if (arg.actor?.entity) {\n event.setActor(arg.actor.entity);\n let identifiers = arg.actor?.identifiers;\n if (!Array.isArray(identifiers)) {\n identifiers = identifiers?.[arg.actor.entity] ?? identifiers;\n }\n normalizeIdentifiers(identifiers).forEach(identifier => {\n if (typeof identifier !== 'object' || identifier === null) return;\n if (!identifier.name || !identifier.value) return;\n event.setActorIdentifier(identifier.name, identifier.value);\n });\n }\n\n const relations = arg?.relations ?? arg?.rerelations;\n if (relations && typeof relations === 'object') {\n Object.keys(relations).forEach(relationName => {\n event.setReference(relationName);\n Object.keys(relations[relationName]).forEach(identifierName => {\n event.setReferenceIdentifier(relationName, identifierName, relations[relationName][identifierName]);\n });\n });\n }\n if (arg?.adjectives && typeof arg.adjectives === 'object') {\n Object.keys(arg.adjectives).forEach(adjectiveName => {\n event.addAdjective(adjectiveName, arg.adjectives[adjectiveName]);\n });\n }\n\n if (arg?.collections && typeof arg.collections === 'object') {\n Object.keys(arg.collections).forEach(collectionName => {\n applyCollectionConfig(collectionName, arg.collections[collectionName]);\n });\n }\n\n tracker.track(event);\n return true;\n }\n\n let flush = () => {\n if (!init()) {\n return;\n }\n const queue = ensureQueue();\n if (!queue) return;\n while (queue.length > 0) {\n const args = queue.shift();\n track(args);\n }\n }\n\n let patchQueuePush = (queue) => {\n if (!Array.isArray(queue) || queue[patchedQueueFlag]) {\n patchedQueue = queue;\n return queue;\n }\n\n const originalPush = queue.push.bind(queue);\n Object.defineProperty(queue, patchedQueueFlag, {\n value: true,\n configurable: true\n });\n queue.push = (...args) => {\n const result = originalPush(...args);\n flush();\n return result;\n };\n\n patchedQueue = queue;\n return queue;\n }\n\n let ensureQueue = () => {\n let queue = window[constants.sharedWindowObjectNames.queue];\n if (!Array.isArray(queue)) {\n return null;\n }\n if (queue !== patchedQueue) {\n patchQueuePush(queue);\n }\n return queue;\n }\n\n let startQueueWatcher = (interval = queueWaitInterval) => {\n if (queueWatcherInterval === interval && queueWatcherTimer) {\n return;\n }\n if (queueWatcherTimer) {\n clearInterval(queueWatcherTimer);\n }\n queueWatcherInterval = interval;\n queueWatcherTimer = setInterval(() => {\n const queue = ensureQueue();\n if (!queue) {\n return;\n }\n if (queueWatcherInterval !== queueRecoveryInterval) {\n startQueueWatcher(queueRecoveryInterval);\n }\n if (queue.length > 0) {\n flush();\n }\n }, interval);\n }\n\n startQueueWatcher(queueWaitInterval);\n\n return {\n flush\n }\n })();\n window[constants.collecionesObject].flush();\n}\n"],"names":["formatToCamelCase","input","replace","trim","split","map","word","index","charAt","toUpperCase","slice","toLowerCase","join","CollecionesEvent","constructor","this","entity","adjevtives","identifiers","action","actor","actorIdentifiers","context","references","collections","meta","eventFormat","eventFormatVersion","tracker","app","timestamps","clientDatetimeUtc","Date","toISOString","window","navigator","language","clientDatetimeLocal","now","getTimezoneOffset","timeZone","Intl","DateTimeFormat","resolvedOptions","timeZoneOffset","getEventFormat","v","getEventFormatVersion","overrideDatetime","dateTimeObject","key","value","Object","entries","setTracker","name","setAppName","appName","setSchema","schema","Error","setEntity","setAction","addAdjective","adjective","push","setIdentifier","identifier","setActor","setActorIdentifier","setContext","setRefence","origin","setReference","undefined","setRefenceIdentifier","setReferenceIdentifier","setCollection","items","setCollectionItem","length","setCollectionItemReference","itemKey","setCollectionIdentifier","toJSON","class","adjectives","actorIds","fromJSON","obj","instance","CollecionesEmitter","endpoint","flushSize","flushInterval","buffer","timer","lastPayload","startTimer","stopTimer","setInterval","flush","startTimerIfStopped","clearInterval","track","event","trackAsync","Promise","resolve","body","buildBody","response","fetch","method","credentials","headers","ok","console","log","statusText","error","message","JSON","stringify","e","toBase64","str","btoa","unescape","encodeURIComponent","Buffer","from","toString","CollecionesTracker","emitters","trackerName","collecionesEvent","forEach","element","CollecionesWebTracker","super","hasFocus","document","platform","referrer","screenHeight","screen","height","screenWidth","width","timezone","url","location","href","userAgent","viewportHeight","innerHeight","viewportWidth","innerWidth","constants","queue","configVariable","emitterEndpoint","initialized","emitter","patchedQueue","patchedQueueFlag","queueWatcherTimer","queueWatcherInterval","arg","normalizeIdentifiers","Array","isArray","flatMap","collectionOperators","left","right","in","includes","getByPath","path","reduce","acc","addCollectionItem","collectionName","identifierName","identifierValue","collectionKey","applyCollectionConfig","collectionConfig","type","table","identifierNameKey","identifierValueKey","row","applyParamTableCollection","itemsField","filter","operator","item","identifierField","id","applyEvaluatedCollection","array","nestedValue","applyArrayCollection","relations","rerelations","keys","relationName","adjectiveName","config","init","ensureQueue","args","shift","originalPush","bind","defineProperty","configurable","result","patchQueuePush","startQueueWatcher","interval"],"mappings":"yBASA,MA8CMA,EAAoB,SAASC,GACjC,OAAOA,EACJC,QAAQ,iBAAkB,KAC1BC,OACAC,MAAM,OACNC,IAAI,CAACC,EAAMC,IACI,IAAVA,EAAoBD,EACjBA,EAAKE,OAAO,GAAGC,cAAgBH,EAAKI,MAAM,GAAGC,eAErDC,KAAK,GACV,EC/C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GACAhE,cAAcgE,GAElBC,EAAuBuD,EACvBxD,EAAoBnE,YAAY,KAC5B,MAAM4D,EAAQqD,IACTrD,IA3QiB,MA8QlBQ,GACAsD,EA/QkB,KAiRlB9D,EAAMhF,OAAS,GACfqB,MAEL0H,KAKP,OAFAD,EAxR0B,KA0RnB,CACHzH,QAEP,EApSqC,GAqStCnE,OAAO6H,GAA6B1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"browser.domainModel.gtm.sandbox.js","sources":["../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.sandbox.js"],"sourcesContent":["var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import constants from './browser.domainModel.gtm.constants.js';\n\nfunction init(configObject) { \n var config = copyFromWindow(constants.sharedWindowObjectNames.configVariable);\n if (config === undefined) {\n setInWindow(constants.sharedWindowObjectNames.configVariable, configObject);\n var cdn = false;\n if (configObject[constants.config.sourceName] === constants.config.selfHostedValue) {\n cdn = data.trackerConfig.jsLibSource_selfHostedUrl;\n } else if (data.trackerConfig.jsLibSource === constants.config.unpkgHostedValue) {\n cdn = \"https://unpkg.com/@compilacion/colleciones-clientos@latest/dist/browser.domainModel.gtm.js\";\n }\n if (cdn) {\n injectScript(cdn, () => {\n logToConsole('Colleciones GTM library loaded from ' + cdn);\n });\n } else {\n logToConsole('self hosted URL for Colleciones GTM library not provided, and unpkg source not selected. Please check the configuration object.');\n }\n }\n var queue = createQueue(constants.sharedWindowObjectNames.queue);\n return queue;\n}\n// init(configObject).push(o);\nexport default init;\n\n\n\n"],"names":[],"mappings":";;;IAAA,IAAI,SAAS,GAAG;IAChB,IAAI,yBAAyB,EAAE;IAC/B,QAAQ,OAAO,EAAE,wCAAwC;IACzD,QACQ,gBAAgB,EAAE;IAC1B,KAAK;IACL,IAAI,QAAQ,EAAE;IACd,QAAQ,YAAY,EAAE,aAAa;IACnC,QAAQ,iBAAiB,EAAE,MAAM;IACjC,QAAQ,kBAAkB,EAAE,OAMxB,CAEJ,CAAC;;ICfD,SAAS,IAAI,CAAC,YAAY,EAAE;IAC5B,IAAI,IAAI,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,uBAAuB,CAAC,cAAc,CAAC;IACjF,IAAI,IAAI,MAAM,KAAK,SAAS,EAAE;IAC9B,QAAQ,WAAW,CAAC,SAAS,CAAC,uBAAuB,CAAC,cAAc,EAAE,YAAY,CAAC;IACnF,QAAQ,IAAI,GAAG,GAAG,KAAK;IACvB,QAAQ,IAAI,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE;IAC5F,YAAY,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,yBAAyB;IAC9D,SAAS,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,KAAK,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE;IACzF,YAAY,GAAG,GAAG,4FAA4F;IAC9G;IACA,QAAQ,IAAI,GAAG,EAAE;IACjB,YAAY,YAAY,CAAC,GAAG,EAAE,MAAM;IACpC,gBAAgB,YAAY,CAAC,sCAAsC,GAAG,GAAG,CAAC;IAC1E,aAAa,CAAC;IACd,SAAS,MAAM;IACf,YAAY,YAAY,CAAC,iIAAiI,CAAC;IAC3J;IACA;IACA,IAAI,IAAI,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC;IACpE,IAAI,OAAO,KAAK;IAChB;;;;;;;;"}
1
+ {"version":3,"file":"browser.domainModel.gtm.sandbox.js","sources":["../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.sandbox.js"],"sourcesContent":["var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import constants from './browser.domainModel.gtm.constants.js';\n\nfunction init(configObject) { \n var config = copyFromWindow(constants.sharedWindowObjectNames.configVariable);\n if (config === undefined) {\n setInWindow(constants.sharedWindowObjectNames.configVariable, configObject);\n var cdn = false;\n if (configObject[constants.config.sourceName] === constants.config.selfHostedValue) {\n cdn = data.trackerConfig.jsLibSource_selfHostedUrl;\n } else if (data.trackerConfig.jsLibSource === constants.config.unpkgHostedValue) {\n cdn = \"https://unpkg.com/@compilacion/colleciones-clientos@latest/dist/browser.domainModel.gtm.js\";\n }\n if (cdn) {\n injectScript(cdn, () => {\n logToConsole('Colleciones GTM library loaded from ' + cdn);\n });\n } else {\n logToConsole('self hosted URL for Colleciones GTM library not provided, and unpkg source not selected. Please check the configuration object.');\n }\n }\n var queue = createQueue(constants.sharedWindowObjectNames.queue);\n return queue;\n}\n// init(configObject).push(o);\nexport default init;\n\n\n\n"],"names":[],"mappings":";;;IAAA,IAAI,SAAS,GAAG;IAChB,IAAI,yBAAyB,EAAE;IAC/B,QAAQ,OAAO,EAAE,wCAAwC;IACzD,QAAQ,gBAAgB,EAAE;IAC1B,KAAK;IACL,IAAI,QAAQ,EAAE;IACd,QAAQ,YAAY,EAAE,aAAa;IACnC,QAAQ,iBAAiB,EAAE,MAAM;IACjC,QAAQ,kBAAkB,EAAE,OAMxB,CAGJ,CAAC;;ICfD,SAAS,IAAI,CAAC,YAAY,EAAE;IAC5B,IAAI,IAAI,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,uBAAuB,CAAC,cAAc,CAAC;IACjF,IAAI,IAAI,MAAM,KAAK,SAAS,EAAE;IAC9B,QAAQ,WAAW,CAAC,SAAS,CAAC,uBAAuB,CAAC,cAAc,EAAE,YAAY,CAAC;IACnF,QAAQ,IAAI,GAAG,GAAG,KAAK;IACvB,QAAQ,IAAI,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE;IAC5F,YAAY,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,yBAAyB;IAC9D,SAAS,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,KAAK,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE;IACzF,YAAY,GAAG,GAAG,4FAA4F;IAC9G;IACA,QAAQ,IAAI,GAAG,EAAE;IACjB,YAAY,YAAY,CAAC,GAAG,EAAE,MAAM;IACpC,gBAAgB,YAAY,CAAC,sCAAsC,GAAG,GAAG,CAAC;IAC1E,aAAa,CAAC;IACd,SAAS,MAAM;IACf,YAAY,YAAY,CAAC,iIAAiI,CAAC;IAC3J;IACA;IACA,IAAI,IAAI,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC;IACpE,IAAI,OAAO,KAAK;IAChB;;;;;;;;"}
@@ -0,0 +1,17 @@
1
+ var collecionesClientosGtmSharedWindowNames = (function () {
2
+ 'use strict';
3
+
4
+ var constants = {
5
+ 'sharedWindowObjectNames': {
6
+ 'queue': 'compilacionCollecionesClientosGtmQueue',
7
+ 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'
8
+ }};
9
+
10
+ const getSharedWindowNames = () => {
11
+ return constants.sharedWindowObjectNames;
12
+ };
13
+
14
+ return getSharedWindowNames;
15
+
16
+ })();
17
+ //# sourceMappingURL=browser.domainModel.gtm.sharedWindowNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.domainModel.gtm.sharedWindowNames.js","sources":["../src/browser.domainModel.gtm.constants.js","../src/browser.domainModel.gtm.sharedWindowNames.js"],"sourcesContent":["var constants = {\n 'sharedWindowObjectNames': {\n 'queue': 'compilacionCollecionesClientosGtmQueue',\n 'configVariable': 'compilacionCollecionesClientosGtmTypeCastConfig'\n },\n 'config': {\n 'sourceName': 'jsLibSource',\n 'selfHostedValue': 'SELF',\n 'unpkgHostedValue': 'UNPKG',\n 'flushInterval': 'flushInterval',\n 'flushSize': 'flushSize',\n 'trackerName': 'trackerName',\n 'appName': 'appName',\n 'emitterEndpoint': 'emitterEndpoint',\n },\n 'collecionesObject': 'compilacionCollecionesClientosGtm',\n 'typeCastGtmVariableConfig': 'compilacionCollecionesClientosGtmTypeCastConfig'\n};\n\nexport default constants;","import constants from './browser.domainModel.gtm.constants.js';\n\nconst getSharedWindowNames = () => {\n return constants.sharedWindowObjectNames;\n};\n\nexport default getSharedWindowNames;\n"],"names":[],"mappings":";;;IAAA,IAAI,SAAS,GAAG;IAChB,IAAI,yBAAyB,EAAE;IAC/B,QAAQ,OAAO,EAAE,wCAAwC;IACzD,QAAQ,gBAAgB,EAAE;IAC1B,KAaA,CAAC;;ACfI,UAAC,oBAAoB,GAAG,MAAM;IACnC,IAAI,OAAO,SAAS,CAAC,uBAAuB;IAC5C;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilacion/colleciones-clientos",
3
- "version": "2.0.15",
3
+ "version": "2.0.16",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "exports": {