1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22030,(e,t,n)=>{function s(e,t,n,s){return Math.round(e/n)+" "+s+(t>=1.5*n?"s":"")}t.exports=function(e,t){t=t||{};var n,i,r,a,o=typeof e;if("string"===o&&e.length>0){var c=e;if(!((c=String(c)).length>100)){var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(l){var d=parseFloat(l[1]);switch((l[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*d;case"weeks":case"week":case"w":return 6048e5*d;case"days":case"day":case"d":return 864e5*d;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*d;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*d;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:break}}}return}if("number"===o&&isFinite(e)){return t.long?(i=Math.abs(n=e))>=864e5?s(n,i,864e5,"day"):i>=36e5?s(n,i,36e5,"hour"):i>=6e4?s(n,i,6e4,"minute"):i>=1e3?s(n,i,1e3,"second"):n+" ms":(a=Math.abs(r=e))>=864e5?Math.round(r/864e5)+"d":a>=36e5?Math.round(r/36e5)+"h":a>=6e4?Math.round(r/6e4)+"m":a>=1e3?Math.round(r/1e3)+"s":r+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},69872,(e,t,n)=>{t.exports=function(t){function n(e){let t,i,r,a=null;function o(...e){if(!o.enabled)return;let s=Number(new Date);o.diff=s-(t||s),o.prev=t,o.curr=s,t=s,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,s)=>{if("%%"===t)return"%";i++;let r=n.formatters[s];if("function"==typeof r){let n=e[i];t=r.call(o,n),e.splice(i,1),i--}return t}),n.formatArgs.call(o,e),(o.log||n.log).apply(o,e)}return o.namespace=e,o.useColors=n.useColors(),o.color=n.selectColor(e),o.extend=s,o.destroy=n.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(i!==n.namespaces&&(i=n.namespaces,r=n.enabled(e)),r),set:e=>{a=e}}),"function"==typeof n.init&&n.init(o),o}function s(e,t){let s=n(this.namespace+(void 0===t?":":t)+e);return s.log=this.log,s}function i(e,t){let n=0,s=0,i=-1,r=0;for(;n<e.length;)if(s<t.length&&(t[s]===e[n]||"*"===t[s]))"*"===t[s]?(i=s,r=n):n++,s++;else{if(-1===i)return!1;s=i+1,n=++r}for(;s<t.length&&"*"===t[s];)s++;return s===t.length}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){let e=[...n.names,...n.skips.map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){for(let t of(n.save(e),n.namespaces=e,n.names=[],n.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===t[0]?n.skips.push(t.slice(1)):n.names.push(t)},n.enabled=function(e){for(let t of n.skips)if(i(e,t))return!1;for(let t of n.names)if(i(e,t))return!0;return!1},n.humanize=e.r(22030),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(e=>{n[e]=t[e]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n}},516227,(e,t,n)=>{let s;var i=e.i(731382);n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let n="color: "+this.color;e.splice(1,0,n,"color: inherit");let s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==i.default&&"env"in i.default&&(e=i.default.env.DEBUG),e},n.useColors=function(){let e;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&
1("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),s=!1,n.destroy=()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),t.exports=e.r(69872)(n);let{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},253425,e=>{"use strict";e.s(["default",0,function(){return!("u">typeof window&&window.document)}])},995420,e=>{"use strict";var t,n=e.i(731382),s=e.i(516227),i=e.i(253425);let r=s.default,a="content-sdk";(0,i.default)()&&(null==(t=null===n.default||void 0===n.default?void 0:n.default.env)?void 0:t.DEBUG_MULTILINE)==="true"&&s.default.formatters.o&&s.default.formatters.O&&(s.default.formatters.o=s.default.formatters.O);let o={common:(0,s.default)(`${a}:common`),http:(0,s.default)(`${a}:http`),init:(0,s.default)(`${a}:init`)};e.s(["debugModule",0,r,"debugNamespace",0,a,"default",0,o])},914464,e=>{"use strict";e.s(["CLAIMS",0,"https://auth.sitecorecloud.io/claims","DEFAULT_SITECORE_AUTH_AUDIENCE",0,"https://api.sitecorecloud.io","DEFAULT_SITECORE_AUTH_BASE_URL",0,"https://edge-platform.sitecorecloud.io/cs/api","DEFAULT_SITECORE_AUTH_DOMAIN",0,"https://auth.sitecorecloud.io","ERROR_MESSAGES",0,{IV_001:'[IV-001] Incorrect value for "edgeUrl". Set the value to a valid URL.',IV_002:'[IV-002] Incorrect value for "timeout". Set the value to an integer greater than or equal to 0.',IV_003:'[IV-003] Incorrect value for "dob". Format the value according to ISO 8601.',IV_004:'[IV-004] Incorrect value for "email". Set the value to a valid email address.',IV_005:'[IV-005] Incorrect value for "expiryDate". Format the value according to ISO 8601.',IV_006:e=>`[IV-006] "extensionData" supports maximum ${e} attributes. Reduce the number of attributes.`,IV_007:e=>`[IV-007] Site "${e}" does not exist or site item tree is missing.`,IE_001:(e,t)=>`[IE-001] "${e}" also requires "${t}". Add the missing dependency.`,IE_002:'[IE-002] SDK not initialized. You must first initialize the SDK using "initContentSdk()".',IE_003:"[IE-003] Timeout exceeded. The server did not respond within the allotted time.",IE_004:e=>`[IE-004] Plugin not registered. You must first add "${e}" to the "initContentSdk()" "plugins" array.`,IE_005:'[IE-005] Unable to set the "sc_cid" cookie because the client ID could not be retrieved from the server. Make sure to set the correct values for "contextId" and "siteName". If the issue persists, try again later or use try-catch blocks to handle this error.',IE_006:'[IE-006] Unable to set the "sc_cid_personalize" cookie because the visitor ID could not be retrieved from the server. Make sure to set the correct values for "contextId" and "siteName". If the issue persists, try again later or use try-catch blocks to handle this error.',IE_007:e=>`[IE-007] Could not resolve site for host "${e}".`,MV_001:'[MV-001] "contextId" is required.',MV_002:'[MV-002] "siteName" is required.',MV_003:'[MV-003] "identifiers" is required.',MV_004:'[MV-004] "friendlyId" is required.',MV_005:e=>`[MV-005] The "sitecore.cli.config" file is missing a "${e}". Please add it to use this command.`,MV_006:'[MV-006] "clientContextId" is missing. Client-side functionalities may be limited.',MV_007:'[MV-007] Provide either "contextId" or both "apiHost" and "apiKey".',MV_008:"[MV-008] Verify that sitecore.config is properly imported and correctly referenced.",MV_009:'[MV-009] "language" is required.',CONTACT_SUPPORT:"If the issue persists, please contact Sitecore Support."},"SITECORE_EDGE_PLATFORM_URL_DEFAULT",0,"https://edge-platform.sitecorecloud.io","SITECORE_EXPERIENCE_EDGE_URL_DEFAULT",0,"https://edge.sitecorecloud.io"])},212121,e=>{"use strict";var t=e.i(914464);class n{constructor(e){this.timeout=e,this.timeoutId=void 0}
1get start(){return new Promise((e,n)=>{if(!Number.isInteger(this.timeout)||this.timeout<0)throw Error(t.ERROR_MESSAGES.IV_002);this.timeoutId=setTimeout(()=>{let e=Error(t.ERROR_MESSAGES.IE_003);e.name="AbortError",n(e)},this.timeout)})}clear(){this.timeoutId&&clearTimeout(this.timeoutId)}}e.s(["default",()=>n])},993244,e=>{"use strict";var t=e.i(995420),n=e.i(212121),s=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)0>t.indexOf(s[i])&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]]);return n};e.s(["NativeDataFetcher",0,class{constructor(e={}){this.config=e}async fetch(e,i={}){var r;let a=this.config,{debugger:o,fetch:c}=a,l=s(a,["debugger","fetch"]),d=Date.now(),u=c||fetch,g=o||t.default.http,p=this.getRequestInit(Object.assign(Object.assign({},l),i)),f=[u(e,p)];l.timeout&&(this.abortTimeout=new n.default(l.timeout),f.push(this.abortTimeout.start)),g("Request initiated: %o",Object.assign({url:e,headers:this.extractDebugHeaders(p.headers)},p));try{let e=await Promise.race(f).then(e=>{var t;return null==(t=this.abortTimeout)||t.clear(),e}),t=await this.parseResponse(e,g);if(!e.ok){let n=this.createError(e,t);throw g("Response error: %o",n.response),n}return g("Response in %dms: %o",Date.now()-d,{status:e.status,statusText:e.statusText,headers:this.extractDebugHeaders(e.headers),url:e.url,data:t}),{data:t,headers:e.headers,status:e.status,statusText:e.statusText}}catch(e){throw null==(r=this.abortTimeout)||r.clear(),g("Request failed: %o",e),e}}async get(e,t={}){return this.fetch(e,Object.assign({method:"GET"},t))}async post(e,t,n={}){return this.fetch(e,Object.assign({method:"POST",body:JSON.stringify(t)},n))}async delete(e,t={}){return this.fetch(e,Object.assign({method:"DELETE"},t))}async put(e,t,n={}){return this.fetch(e,Object.assign({method:"PUT",body:JSON.stringify(t)},n))}head(e,t={}){return this.fetch(e,Object.assign({method:"HEAD"},t))}getRequestInit(e={}){let t=new Headers(e.headers);return e.method||(e.method=e.body?"POST":"GET"),t.set("Content-Type","application/json"),e.headers=t,e}extractDebugHeaders(e={}){let t={};return"string"!=typeof(null==e?void 0:e.forEach)&&e.forEach&&(null==e||e.forEach((e,n)=>{t[n]=e})),t}async parseResponse(e,t){let n=e.headers.get("Content-Type")||"";try{if(n.includes("application/json"))return await e.json();return await e.text()}catch(e){t("Response parsing error: %o",e);return}}createError(e,t){let n=Error(`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`);return{name:n.name,message:n.message,stack:n.stack,response:{status:e.status,statusText:e.statusText,headers:this.extractDebugHeaders(e.headers),data:t}}}}])},211270,e=>{"use strict";var t=e.i(914464);e.s(["constants",0,t])},922271,e=>{"use strict";var t=e.i(995420);e.s(["debug",()=>t.default])},634759,e=>{"use strict";let t;var n=e.i(995420),s=e.i(914464);let i=n.default.init;async function r(e){var t;for(let n of(i(`Initializing ${e.size}
1 plugins`),e.values())){if(n.dependencies){for(let t of n.dependencies)if(!e.has(t))throw Error(s.ERROR_MESSAGES.IE_001(n.name,t));i(`All required dependencies for "${n.name}" are present`)}await (null==(t=n.init)?void 0:t.call(n)),i(`Successfully initialized "${n.name}"`)}i(`Successfully initialized ${e.size} plugins`)}async function a(e){n.default.init("Initializing Content SDK with params:",e);let{config:a,plugins:o}=e,c=function(e){var t;let{contextId:n,siteName:r,edgeUrl:a}=e;if(!n||0===n.trim().length)throw Error(s.ERROR_MESSAGES.MV_001);if(!r||0===r.trim().length)throw Error(s.ERROR_MESSAGES.MV_002);if(void 0!==a)try{new URL(a)}catch(e){throw Error(s.ERROR_MESSAGES.IV_001)}return i("Configuration is valid"),Object.assign(Object.assign({},e),{edgeUrl:null!=(t=null==a?void 0:a.trim())?t:s.SITECORE_EDGE_PLATFORM_URL_DEFAULT})}(a);for(let e of(0===o.length&&n.default.init("No plugins provided to the plugins array"),t={config:c,plugins:new Map,readyPromise:null},o))t.plugins.set(e.name,e);n.default.init(`Registered ${t.plugins.size} plugins`),t.readyPromise=r(t.plugins),await t.readyPromise,n.default.init("Content SDK initialization complete")}e.s(["getCoreContext",0,function(){if(!t)throw Error(s.ERROR_MESSAGES.IE_002);return t},"initContentSdk",0,a],634759)},9427,(e,t,n)=>{t.exports={author:{name:"Sitecore Corporation",url:"https://doc.sitecore.com/xmc/en/developers/content-sdk/index.html"},bugs:{url:"https://github.com/sitecore/content-sdk/issues"},dependencies:{"@sitecore-content-sdk/core":"^2.0.1",debug:"^4.4.3"},description:"Provides shared logic and runtime initialization. Required for the Content SDK 'events' and 'personalize' packages to function.",devDependencies:{"@jest/types":"^29.6.3","@stylistic/eslint-plugin":"^5.2.2","@types/debug":"^4.1.12","@types/jest":"^29.5.12","@typescript-eslint/eslint-plugin":"8.39.0","@typescript-eslint/parser":"8.39.0","del-cli":"^6.0.0",eslint:"^9.32.0","eslint-config-prettier":"^10.1.8","eslint-plugin-import":"2.32.0","eslint-plugin-jsdoc":"52.0.3","eslint-plugin-prettier":"^4.0.0",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-environment-node":"^29.7.0","ts-jest":"^29.1.0","ts-node":"^10.9.2"},main:"dist/cjs/index.js",module:"dist/esm/index.js",types:"types/src/index.d.ts",exports:{".":{import:"./dist/esm/src/index.js",require:"./dist/cjs/src/index.js",types:"./types/src/index.d.ts"},"./internal":{import:"./dist/esm/src/internal.js",require:"./dist/cjs/src/internal.js",types:"./types/src/internal.d.ts"},"./utils":{import:"./dist/esm/src/utils.js",require:"./dist/cjs/src/utils.js",types:"./types/src/utils.d.ts"}},files:["dist","types","/*.d.ts"],homepage:"https://doc.sitecore.com/xmc/en/developers/content-sdk/index.html",license:"Apache-2.0",name:"@sitecore-content-sdk/analytics-core",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},scripts:{build:"npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",clean:"del-cli dist types",coverage:"jest --config jest.config.ts --coverage","generate-docs":"npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/analytics-core --entryPoints src/index.ts --entryPoints src/internal.ts --entryPoints src/utils.ts --githubPages false",lint:'eslint "./src/**/*.ts"',prepublishOnly:"npm run build",test:"jest --config jest.config.ts","api-extractor":"npm run build && api-extractor run --local --verbose","api-extractor:verify":"api-extractor run"},version:"2.0.1",gitHead:"fc12774027a7aa86b870d5da278426b9cdfbfffb"}},639514,193329,e=>{"use strict";let t=e.i(9427).default.version;e.s(["API_VERSION",0,"v1.2","CLIENT_ID_COOKIE_NAME",0,"cid","COOKIE_NAME_PREFIX",0,"sc_","DAILY_SECONDS",0,86400,"DEFAULT_COOKIE_EXPIRY_DAYS",0,730,"LIBRARY_VERSION",0,t],639514),e.s(["ANALYTICS_PLUGIN_NAME",0,"AnalyticsPlugin"],193329)},467594,(e,t,n)=>{t.exports={author:{name:"Sitecore Corporation",url:"https://doc.sitecore.com/xmc/en/developers/content-sdk/index.html"},bugs:{url:"https://github.com/Sitecore/content-sdk/issues"},dependencies:{"@sitecore-content-sdk/analytics-core":"^2.0.1","@sitecore-content-sdk/core":"^2.0.1",debug:"^4.4.3"},description:"Enables real-time, unified tracking to send events to Sitecore.",devDependencies:{"@jest/globals":"^30.2.0","@jest/types":"^29.6.3","@stylistic/eslint-plugin":"^5.2.2","@types/debug":"^4.1.12","@types/jest":"^29.5.12","@typescript-eslint/eslint-plugin":"8.39.0","@typescript-eslint/parser":"8.39.0","del-cli":"^6.0.0",eslint:"^9.32.0","eslint-config-prettier":"^10.1.8","eslint-plugin-import":"2.32.0","eslint-plugin-jsdoc":"52.0.3","eslint-plugin-
1prettier":"^4.0.0",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-environment-node":"^29.7.0","ts-jest":"^29.4.6","ts-node":"^10.9.2"},main:"dist/cjs/index.js",module:"dist/esm/index.js",types:"types/src/index.d.ts",exports:{".":{import:"./dist/esm/src/index.js",require:"./dist/cjs/src/index.js",types:"./types/src/index.d.ts"},"./browser":{import:"./dist/esm/src/browser.js",require:"./dist/cjs/src/browser.js",types:"./types/src/browser.d.ts"},"./internal":{import:"./dist/esm/src/internal.js",require:"./dist/cjs/src/internal.js",types:"./types/src/internal.d.ts"}},files:["dist","types","/*.d.ts"],homepage:"https://doc.sitecore.com/xmc/en/developers/content-sdk/index.html",license:"Apache-2.0",name:"@sitecore-content-sdk/events",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},scripts:{build:"npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",clean:"del-cli dist types",coverage:"jest --config jest.config.ts --coverage","generate-docs":"npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/events --entryPoints src/browser.ts --entryPoints src/internal.ts --entryPoints src/index.ts --githubPages false",lint:'eslint "./src/**/*.ts"',prepublishOnly:"npm run build",test:"jest --config jest.config.ts","api-extractor":"npm run build && api-extractor run --local --verbose","api-extractor:verify":"api-extractor run"},version:"2.0.1",gitHead:"fc12774027a7aa86b870d5da278426b9cdfbfffb"}},973329,83717,317188,763467,570356,36235,435378,e=>{"use strict";e.s(["form",()=>K],435378),e.s(["analyticsPlugin",()=>l,"getAnalyticsPlugin",()=>u],83717);var t=e.i(639514),n=e.i(193329),s=e.i(634759),i=e.i(922271),r=e.i(211270);function a(){return u().adapter.getClientId()||""}let o=i.debug.init,{ERROR_MESSAGES:c}=r.constants;function l(e){var s;let{options:i,adapter:r}=e,a={cookies:{domain:null==i?void 0:i.cookieDomain,enabled:null!=(s=null==i?void 0:i.enableCookie)&&s,expiryDays:(null==i?void 0:i.cookieExpiryDays)||t.DEFAULT_COOKIE_EXPIRY_DAYS,name:`${t.COOKIE_NAME_PREFIX}${t.CLIENT_ID_COOKIE_NAME}`,path:(null==i?void 0:i.cookiePath)||"/"},timeout:null==i?void 0:i.timeout};return{name:n.ANALYTICS_PLUGIN_NAME,init:d,options:a,adapter:r}}async function d(){o(`Initializing ${n.ANALYTICS_PLUGIN_NAME}`);let e=(0,s.getCoreContext)(),i=u();if(!i.options.cookies.enabled)return void o(`Cookies are disabled for ${n.ANALYTICS_PLUGIN_NAME}. If this was not intentional, set "enableCookie" to "true".`);let r=i.adapter;r.getClientId()&&"browser"===i.adapter.type||(await r.setClientId(),o(`Cookie set for ${n.ANALYTICS_PLUGIN_NAME}`)),"browser"===i.adapter.type&&(window.scContentSDK=Object.assign(Object.assign({},window.scContentSDK),{analytics_core:{getClientId:a,options:{siteName:e.config.siteName,contextId:e.config.contextId,edgeUrl:e.config.edgeUrl},version:t.LIBRARY_VERSION}}))}function u(){let e=(0,s.getCoreContext)().plugins.get(n.ANALYTICS_PLUGIN_NAME);if(!e)throw Error(c.IE_004(n.ANALYTICS_PLUGIN_NAME));return e}var g=e.i(467594);let p=g.default.version,f=g.default.name,h=`${f} ${p}`;var m=e.i(993244),y=e.i(995420);let E={events:(0,y.debugModule)(`${y.debugNamespace}:events`)};async function b(e,n){let s=`${n.edgeUrl}/v1/events/${t.API_VERSION}/events?siteId=${n.siteName}`,i={body:JSON.stringify(e),headers:{"Content-Type":"application/json","X-Client-Software-ID":h,"X-Library-Version":p,"x-sitecore-contextid":n.contextId},method:"POST"},r=new m.NativeDataFetcher({debugger:E.events});return await r.fetch(s,i).then(async e=>e.data).catch(()=>null)}function v(e){var t;let{currentKey:n,object:s}=e,i=null!=(t=e.newObject)?t:{};for(let e in s){let t=s[e];void 0!==t&&("object"!=typeof t||Array.isArray(t)?i[n?`${n}_${e}`:e]=t:v({currentKey:`${n?`${n}_${e}`:e}`,newObject:i,object:t}))}return i}function C(){return"u"<typeof window||window.document.documentElement.lang.length<=1?void 0:new Intl.Locale(window.document.documentElement.lang).language.toLocaleUpperCase()}function I(){return"u"<typeof window?"":"/"===window.location.pathname?"Home Page":window.location.pathname.split("/").pop()}e.s(["language",0,C,"pageName",0,I],317188);class w{constructor(e,t){var n,s;this.baseEventData=e,this.clientId=t,this.language=null!=(n=this.baseEventData.language)?n:C(),this.page=null!=(s=this.baseEventData.page)?s:I()}mapBaseEventPayload(){return{browser_id:this.clientId,channel:this.baseEventData.channel,client_key:"",currency:this.baseEventData.currency,language:this.language,page:this.page,pos:"",requested_at:new Date().toISOString()}}}var _=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)0>t.indexOf(s[i])&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]]);return n};let{ERROR_MESSAGES:x}=r.constants;class O extends w{constructor(e){const t=e.eventData,{channel:n,currency:s,language:i,page:r,type:a,extensionData:o,searchData:c}=t,l=_(t,["channel","currency","language","page","type","extensionData","
1searchData"]);super({channel:n,currency:s,language:i,page:r},e.id),this.extensionData={},this.sendEvent=e.sendEvent,this.config=e.config,this.customEventPayload=Object.assign({type:a},l),o&&(this.extensionData=v({object:o}));const d=Object.entries(this.extensionData).length;if(d>50)throw Error(x.IV_006(50));d>0&&(this.customEventPayload.ext=this.extensionData),c&&(this.customEventPayload.sc_search={data:c,metadata:{ut_api_version:"1.0"}})}async send(){let e=this.mapBaseEventPayload(),t=Object.assign({},this.customEventPayload,e);return await this.sendEvent(t,this.config)}}e.s(["eventsPlugin",()=>z,"getEventsPlugin",()=>G],36235);let S="EventsPlugin";async function j(e){let t=(0,s.getCoreContext)();await t.readyPromise,G();let{options:n,adapter:i}=u();return new O({eventData:e,id:i.getClientId()||"",sendEvent:b,config:Object.assign(Object.assign({},t.config),n)}).send()}function P(e){try{return new Date(e+"Z").toISOString().substring(0,16)===e}catch(e){return!1}}e.s(["EVENTS_PLUGIN_NAME",0,S],763467);let{ERROR_MESSAGES:D}=r.constants;class A extends w{constructor(e){const{channel:t,currency:n,language:s,page:i,extensionData:r}=e.identityData;if(super({channel:t,currency:n,language:s,page:i},e.id),this.extensionData={},this.numberOfExtensionDataProperties=0,this.validateAttributes(e.identityData),this.identityData=e.identityData,this.sendEvent=e.sendEvent,this.config=e.config,r&&(this.extensionData=v({object:r})),this.numberOfExtensionDataProperties=Object.entries(this.extensionData).length,this.numberOfExtensionDataProperties>50)throw Error(D.IV_006(50))}async send(){let e=this.mapBaseEventPayload(),t=Object.assign({},this.mapAttributes(),e);return await this.sendEvent(t,this.config)}validateAttributes(e){var t;if(0===e.identifiers.length)throw Error(D.MV_003);if(void 0!==e.dob&&!P(e.dob))throw Error(D.IV_003);if(e.identifiers.forEach(e=>{if(e.expiryDate&&!P(e.expiryDate))throw Error(D.IV_005)}),e.email&&!((t=e.email)&&!(t.length>320)&&/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(t)))throw Error(D.IV_004)}mapAttributes(){let e={city:this.identityData.city,country:this.identityData.country,dob:this.identityData.dob,email:this.identityData.email,firstname:this.identityData.firstName,gender:this.identityData.gender,identifiers:this.identityData.identifiers.map(e=>({expiry_date:e.expiryDate,id:e.id,provider:e.provider})),lastname:this.identityData.lastName,mobile:this.identityData.mobile,phone:this.identityData.phone,postal_code:this.identityData.postalCode,state:this.identityData.state,street:this.identityData.street,title:this.identityData.title,type:"IDENTITY"};return this.numberOfExtensionDataProperties>0&&(e.ext=this.extensionData),e}}async function R(e){let t=(0,s.getCoreContext)();await t.readyPromise,G();let{options:n,adapter:i}=u();return new A({id:i.getClientId()||"",identityData:e,sendEvent:b,config:Object.assign(Object.assign({},t.config),n)}).send()}e.s(["pageView",()=>T],570356);let{ERROR_MESSAGES:F}=r.constants;class k extends w{constructor(e){var t;const{channel:n,currency:s,language:i,page:r,extensionData:a}=Object.assign({},e.pageViewData);if(super({channel:n,currency:s,language:i,page:r},e.id),this.extensionData={},this.pageViewData=e.pageViewData,this.sendEvent=e.sendEvent,this.config=e.config,this.urlSearchParams=new URLSearchParams(decodeURI(e.searchParams)),a&&(this.extensionData=v({object:a})),Object.entries(this.extensionData).length>50)throw Error(F.IV_006(50));this.includeUTMParameters=null==(t=e.pageViewData&&e.pageViewData.includeUTMParameters)||t}async send(){let e=this.mapBaseEventPayload(),t=this.mapAttributes();return k.isFirstPageView=!1,await this.sendEvent(Object.assign(Object.assign({},e),t),this.config)}getPageVariantId(e,t){if(e)return e;let n=this.urlSearchParams.get("variantid");return n||t||null}getReferrer(){var e;if(null==(e=this.pageViewData)?void 0:e.referrer)return this.pageViewData.referrer;if("u"<typeof window||!k.isFirstPageView||!document.referrer)return null;let{hostname:t,href:n}=new URL(document.referrer);return window.location.hostname!==t?n:null}mapAttributes(){var e;let t={type:"VIEW"},n=this.pageViewData&&this.getPageVariantId(this.pageViewData.pageVariantId,this.extensionData.pageVariantId);if(null!==n&&(t.ext=Object.assign(Object.assign({},t.ext),{pageVariantId:n})),Object.keys(this.extensionData).length>0&&(delete this.extensionData.pageVariantId,t.ext=Object.assign(Object.assign({},t.ext),this.extensionData)),this.includeUTMParameters){let e=this.getUTMParameters();t=Object.assign(Object.assign({},t),e)}let s=this.getReferrer();return null!==s&&(t=Object.assign(Object.assign({},t),{referrer:s})),(null==(e=this.pageViewData)?void 0:e.searchData)&&(t.sc_search={data:this.pageViewData.searchData,metadata:{ut_api_version:"1.0"}}),t}getUTMParameters(){let e={};
1return this.urlSearchParams.forEach((t,n)=>{let s=n.toLowerCase();0===s.indexOf("utm_")&&(e[s]=t)}),e}}async function T(e){let t=(0,s.getCoreContext)();await t.readyPromise,G();let{options:n,adapter:i}=u();return new k({id:i.getClientId()||"",pageViewData:e,searchParams:i.location.getSearchParams(),sendEvent:b,config:Object.assign(Object.assign({},t.config),n)}).send()}k.isFirstPageView=!0;let N=new class{constructor(){this.key="EventQueue"}enqueueEvent(e){var t,n;let s=this.getSessionStorage();e.eventData.page=null!=(t=e.eventData.page)?t:I(),e.eventData.language=null!=(n=e.eventData.language)?n:C(),new O(Object.assign({sendEvent:b},e));let i=this.getEventQueue();i.push(e),s.setItem(this.key,JSON.stringify(i))}async sendAllEvents(){for(let e of this.getEventQueue())await new O({eventData:e.eventData,id:e.id,sendEvent:b,config:e.config}).send();this.clearQueue()}clearQueue(){this.getSessionStorage().removeItem(this.key)}getEventQueue(){var e;let t=null!=(e=this.getSessionStorage().getItem(this.key))?e:'""';try{let e=JSON.parse(t);return Array.isArray(e)?e:[]}catch(e){return[]}}getSessionStorage(){return sessionStorage}};async function M(e){let t=(0,s.getCoreContext)();await t.readyPromise,G();let{options:n,adapter:i}=u(),r={eventData:e,id:i.getClientId()||"",config:Object.assign(Object.assign({},t.config),n)};N.enqueueEvent(r)}async function V(){await (0,s.getCoreContext)().readyPromise,G(),N.clearQueue()}async function U(){await (0,s.getCoreContext)().readyPromise,G(),N.sendAllEvents()}let{ERROR_MESSAGES:L}=r.constants;async function $(){"u">typeof window&&(window.scContentSDK=Object.assign(Object.assign({},window.scContentSDK),{events:{addToEventQueue:M,clearEventQueue:V,event:j,form:K,identity:R,pageView:T,processEventQueue:U,version:p}}))}function z(){return{name:S,init:$,dependencies:[n.ANALYTICS_PLUGIN_NAME]}}function G(){let e=(0,s.getCoreContext)().plugins.get(S);if(!e)throw Error(L.IE_004(S));return e}async function K(e,t,n){let i=(0,s.getCoreContext)();await i.readyPromise,G();let{options:r,adapter:a}=u(),o=a.getClientId()||"",c=new O({eventData:{extensionData:{componentInstanceId:n,formId:e,interactionType:t.toUpperCase()},type:"FORM"},id:o,sendEvent:b,config:Object.assign(Object.assign({},i.config),r)});return c.page=void 0,c.send()}e.s([],973329)},835857,(e,t,n)=>{t.exports={author:{name:"Sitecore Corporation",url:"https://doc.sitecore.com/xmc/en/developers/content-sdk/index.html"},bugs:{url:"https://github.com/sitecore/content-sdk/issues"},dependencies:{"@sitecore-content-sdk/analytics-core":"^2.0.1","@sitecore-content-sdk/core":"^2.0.1","@sitecore-content-sdk/events":"^2.0.1",debug:"^4.4.3"},description:"Provides personalization capabilities to build tailored experiences for site visitors.",devDependencies:{"@jest/types":"^29.6.3","@stylistic/eslint-plugin":"^5.2.2","@types/debug":"^4.1.12","@types/jest":"^29.5.12","@typescript-eslint/eslint-plugin":"8.39.0","@typescript-eslint/parser":"8.39.0","del-cli":"^6.0.0",eslint:"^9.32.0","eslint-config-prettier":"^10.1.8","eslint-plugin-import":"2.32.0","eslint-plugin-jsdoc":"52.0.3","eslint-plugin-prettier":"^4.0.0",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-environment-node":"^29.7.0","ts-jest":"^29.1.0","ts-node":"^10.9.2"},main:"dist/cjs/src/index.js",module:"dist/esm/src/index.js",types:"types/src/index.d.ts",exports:{".":{import:"./dist/esm/src/index.js",require:"./dist/cjs/src/index.js",types:"./types/src/index.d.ts"},"./internal":{import:"./dist/esm/src/internal.js",require:"./dist/cjs/src/internal.js",types:"./types/src/internal.d.ts"}},files:["dist","types","/*.d.ts"],homepage:"https://doc.sitecore.com/xmc/en/developers/content-sdk/index.html",license:"Apache-2.0",name:"@sitecore-content-sdk/personalize",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},scripts:{build:"npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",clean:"del-cli dist types",coverage:"jest --config jest.config.ts --coverage","generate-docs":"npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/personalize --entryPoints src/internal.ts --entryPoints src/index.ts --githubPages false",lint:'eslint "./src/**/*.ts"',prepublishOnly:"npm run build",test:"jest --config jest.config.ts","api-extractor":"npm run build && api-extractor run --local --verbose","api-extractor:verify":"api-extractor run"}
1,version:"2.0.1",gitHead:"fc12774027a7aa86b870d5da278426b9cdfbfffb"}},657604,e=>{"use strict";e.i(731382);var t=e.i(26685),n=e.i(634759),s=e.i(639514),i=e.i(993244),r=e.i(211270);let{ERROR_MESSAGES:a}=r.constants;async function o(e,t,n){let r={headers:{"X-Library-Version":s.LIBRARY_VERSION,"x-sitecore-contextid":t}},o=`${e}/v1/events/${s.API_VERSION}/browser/create.json?client_key=`,c=new i.NativeDataFetcher({timeout:n}),l=await c.fetch(o,r).then(e=>e.data||null).catch(e=>{if(e.message===a.IV_002||e.message===a.IE_003)throw Error(e.message);return null});if(!(null==l?void 0:l.ref))throw Error(a.IE_005);let{ref:d,customer_ref:u}=l;return{clientId:d,profileId:u}}function c(e=s.DEFAULT_COOKIE_EXPIRY_DAYS,t){return{domain:t,maxAge:e*s.DAILY_SECONDS,path:"/",sameSite:"None",secure:!0}}function l(e,t,n){let s=`${e}=${t};`;return s+=` Max-Age=${n.maxAge}; SameSite=${n.sameSite};`,s+=n.secure?" Secure;":"",s+=n.path?` Path=${n.path};`:"",s+=n.domain?` Domain=${n.domain};`:"",s=s.substring(0,s.length-1)}function d(e){var t;let n=function(e,t){if(!e)return;let n=e.split("; ").find(e=>e.indexOf("=")>0&&e.split("=")[0]===t);return void 0!==n?{name:n.split("=")[0],value:n.split("=")[1]}:void 0}(document.cookie,e);return null!=(t=null==n?void 0:n.value)?t:""}var u=e.i(83717);e.i(973329);var g=e.i(36235),p=e.i(317188),f=e.i(835857);let h=f.default.version;f.default.name;let m="utm_";var y=e.i(995420);let E={personalize:(0,y.debugModule)(`${y.debugNamespace}:personalize`)},{ERROR_MESSAGES:b}=r.constants;async function v(e,t,n){let s=`${t.edgeUrl}/v1/personalize?siteId=${t.siteName}`,r={body:JSON.stringify(e),headers:{"Content-Type":"application/json","X-Library-Version":h,"x-sc-correlation-id":globalThis.crypto.randomUUID().replace(/-/g,""),"x-sitecore-contextid":t.contextId},method:"POST"};return(null==n?void 0:n.userAgent)&&(r.headers["User-Agent"]=n.userAgent),new i.NativeDataFetcher({timeout:null==n?void 0:n.timeout,debugger:E.personalize}).fetch(s,r).then(e=>e?e.data:null).catch(e=>{if(e.message.includes(b.IV_002)||e.message.includes(b.IE_003))throw Error(e.message);return null})}let{ERROR_MESSAGES:C}=r.constants;class I{constructor(e,t){this.clientId=e,this.profileId=t}async getInteractiveExperienceData(e,t,n,s){var i;this.validate(e);let r=this.sanitizeInput(e);!n.includes(m)||(null==(i=r.params)?void 0:i.utm)||(r.params=r.params||{},r.params.utm=this.extractUrlParamsWithPrefix(n,m));let a=this.mapPersonalizeInputToEPData(r);return a.email||a.identifiers||(a.browserId=this.clientId),await v(a,t,s)}sanitizeInput(e){var t;let n={channel:e.channel,currency:e.currency,friendlyId:e.friendlyId,language:e.language};return e.identifier&&e.identifier.id&&e.identifier.id.trim().length>0&&(n.identifier=e.identifier),e.email&&e.email.trim().length>0&&(n.email=e.email),e.params&&Object.keys(e.params).length>0&&(n.params=e.params),e.geo&&Object.keys(e.geo).length>0&&(n.params=Object.assign(Object.assign({},e.params),{geo:Object.assign({},e.geo)})),(null==(t=e.pageVariantIds)?void 0:t.length)&&(n.pageVariantIds=e.pageVariantIds),n}mapPersonalizeInputToEPData(e){var t;return{channel:e.channel,clientKey:"",currencyCode:e.currency,email:e.email,friendlyId:e.friendlyId,guestRef:this.profileId,identifiers:e.identifier,language:null!=(t=e.language)?t:(0,p.language)(),params:e.params,pointOfSale:"",variants:e.pageVariantIds}}validate(e){if(!e.friendlyId||0===e.friendlyId.trim().length)throw Error(C.MV_004)}extractUrlParamsWithPrefix(e,t){let n=new URLSearchParams(decodeURI(e)),s={};return n.forEach((e,n)=>{let i=n.toLowerCase();0===i.indexOf(t)&&(s[i.substring(t.length)]=e)}),s}}let w="PersonalizePlugin",{ERROR_MESSAGES:_}=r.constants;function x(){let e=(0,n.getCoreContext)().plugins.get(w);if(!e)throw Error(_.IE_004(w));return e}async function O(e,t){var s;let{config:i,readyPromise:r}=(0,n.getCoreContext)();await r;let{adapter:a}=x(),{adapter:o}=(0,u.getAnalyticsPlugin)(),c=o.getClientId()||"",l=a.getProfileId()||"",d=o.location.getSearchParams(),g=null==(s=a.getUserAgent)?void 0:s.call(a);return new I(c,l).getInteractiveExperienceData(e,i,d,{userAgent:g,timeout:null==t?void 0:t.t
1imeout})}var S=e.i(763467);async function j(e,t){let n=`${t}/v1/personalize/cdn-url?client_key=`;try{let t=await fetch(n,{headers:{"x-sitecore-contextid":e}});if(!t.ok)return null;return await t.text()}catch(e){return null}}var P=e.i(193329);let{ERROR_MESSAGES:D}=r.constants;async function A(e,t,n){let i=`${n}/v1/events/${s.API_VERSION}/browser/${e}/show.json?client_key=&api_token=`,r=await fetch(i,{headers:{"X-Library-Version":h,"x-sitecore-contextid":t}}),a=await r.json();if(!r.ok){let{error_msg:e,moreInfo:t}=a;throw Error(`${e}, for more info: ${t}`)}if(!a.customer.ref)throw Error(D.IE_006);return a.customer.ref}async function R(){let{config:e}=(0,n.getCoreContext)();return A((0,u.getAnalyticsPlugin)().adapter.getClientId()||"",e.contextId,e.edgeUrl)}async function F(){var e,t;let s=(0,n.getCoreContext)().config,i=x(),r=i.options;if((0,u.getAnalyticsPlugin)().options.cookies.enabled&&r.cookies.enabled&&(!i.adapter.getProfileId()||"browser"!==i.adapter.type)&&await i.adapter.setProfileId(),"u"<typeof window||(window.scContentSDK=Object.assign(Object.assign({},window.scContentSDK),{personalize:{personalize:O,version:h,options:r.webPersonalization?r.webPersonalization:{}},analytics_core:Object.assign(Object.assign({},null==(e=window.scContentSDK)?void 0:e.analytics_core),{getProfileId:R})}),!r.webPersonalization))return;window.scContentSDK.personalize.options=r.webPersonalization;let a=await j(s.contextId,s.edgeUrl);if(a){let e;t={async:r.webPersonalization.async,src:a},(e=document.createElement("script")).type="text/javascript",e.src=t.src,e.async=t.async,document.head.appendChild(e)}}var k=e.i(594302);e.s(["default",0,({siteName:e,isPreviewMode:i})=>{let r=(0,t.useRef)(!1);return(0,t.useEffect)(()=>{if(!r.current){if(i)return void console.debug("Browser Events SDK is not initialized in edit and preview modes");k.PUBLIC_SITECORE_CONTEXT_ID?(r.current=!0,(0,n.initContentSdk)({config:{contextId:k.PUBLIC_SITECORE_CONTEXT_ID,edgeUrl:k.PUBLIC_SITECORE_EDGE_URL,siteName:e||k.PUBLIC_DEFAULT_SITE_NAME},plugins:[(0,u.analyticsPlugin)({options:{enableCookie:!0,cookieDomain:window.location.hostname.replace(/^www\./,"")},adapter:{type:"browser",getClientId:()=>d((0,u.getAnalyticsPlugin)().options.cookies.name),setClientId:async()=>{let e=(0,n.getCoreContext)().config,t=(0,u.getAnalyticsPlugin)().options,i=c(t.cookies.expiryDays,t.cookies.domain),r=d(`${s.COOKIE_NAME_PREFIX}${e.contextId}`);if(r){var a;document.cookie=l(t.cookies.name,r,i),a=`${s.COOKIE_NAME_PREFIX}${e.contextId}`,document.cookie=a+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";return}let g=await o(e.edgeUrl,e.contextId,t.timeout);t.visitorIds=g,document.cookie=l(t.cookies.name,g.clientId,i)},location:{getSearchParams:()=>window.location.search}}}),(0,g.eventsPlugin)(),function(e){var t,n,i,r;let a,{adapter:o,options:c}=e,l={enabled:null!=(t=null==c?void 0:c.enablePersonalizeCookie)&&t,name:`${s.COOKIE_NAME_PREFIX}${s.CLIENT_ID_COOKIE_NAME}_personalize`},d=[P.ANALYTICS_PLUGIN_NAME];return(null==c?void 0:c.webPersonalization)&&(d.push(S.EVENTS_PLUGIN_NAME),a={async:null==(n=c.webPersonalization.async)||n,defer:null!=(i=c.webPersonalization.defer)&&i,language:null!=(r=c.webPersonalization.language)?r:void 0}),null!=a||(a=!1),{name:w,init:F,dependencies:d,options:{webPersonalization:a,cookies:l},adapter:o}}({options:{enablePersonalizeCookie:!0},adapter:{type:"browser",getProfileId:()=>d(x().options.cookies.name),setProfileId:async()=>{let e=(0,n.getCoreContext)().config,t=(0,u.getAnalyticsPlugin)().options,i=x().options.cookies.name,r=`${s.COOKIE_NAME_PREFIX}${e.contextId}_personalize`,a=c(t.cookies.expiryDays,t.cookies.domain),o=d(r);if(o){document.cookie=l(i,o,a),document.cookie=l(r,"",Object.assign(Object.assign({},a),{maxAge:0}));return}let g=(0,u.getAnalyticsPlugin)().options.visitorIds,p=d(i),f=d(t.cookies.name);if(!p){if(null==g?void 0:g.profileId)document.cookie=l(i,g.profileId,a);else if(f){let t=await A(f,e.contextId,e.edgeUrl);document.cookie=l(i,t,a)}}}}})]}).catch(e=>{r.current=!1,console.error("Content SDK analytics initialization failed",e)})):console.error("Client Edge API settings missing from configuration")}},[e,i]),null}],657604)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.