{"version":3,"file":"customEvent-11ac0ffa-Cyk1Nnso.js","sources":["../../../node_modules/@trv-tds/react/node_modules/@trv-tds/webcomponents/dist/esm/customEvent-11ac0ffa.js"],"sourcesContent":["/**\n * Cross-browser (meaning IE) function to create an Event to dispatch. Creates a Custom Event\n * @param eventType {string} - The name of the event\n * @param eventInit {object} - Dictionary with the event initialization values as defined in https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent.\n * For this function, though, bubbles defaults to true\n * @return {CustomEvent} A CustomEvent object\n */\nfunction createCustomEvent(eventType, eventInit = {}) {\n eventInit = { ...eventInit };\n const additionalProperties = stripNonCustomEventInitProperties(eventInit);\n let event;\n const init = { ...{ bubbles: true, cancelable: false, detail: undefined }, ...eventInit };\n if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {\n event = new window.CustomEvent(eventType, init);\n }\n else {\n event = document.createEvent('CustomEvent');\n const bubbles = !!init.bubbles;\n const cancelable = !!init.cancelable;\n const details = init.detail;\n event.initCustomEvent(eventType, bubbles, cancelable, details);\n }\n // add any additional properties as read-only\n Object.keys(additionalProperties)\n .forEach(key => {\n Object.defineProperty(event, key, {\n get() {\n return additionalProperties[key];\n }\n });\n });\n return event;\n}\nfunction stripNonCustomEventInitProperties(eventInit) {\n const properties = 'detail bubbles cancelable composed';\n const strippedProperties = {};\n Object.keys(eventInit).forEach(key => {\n if (properties.indexOf(key) === -1) {\n strippedProperties[key] = eventInit[key];\n delete eventInit[key];\n }\n });\n return strippedProperties;\n}\n\nexport { createCustomEvent as c };\n\n//# sourceMappingURL=customEvent-11ac0ffa.js.map"],"names":["createCustomEvent","eventType","eventInit","additionalProperties","stripNonCustomEventInitProperties","event","init","bubbles","cancelable","details","key","properties","strippedProperties"],"mappings":"AAOA,SAASA,EAAkBC,EAAWC,EAAY,GAAI,CAClDA,EAAY,CAAE,GAAGA,CAAW,EAC5B,MAAMC,EAAuBC,EAAkCF,CAAS,EACxE,IAAIG,EACJ,MAAMC,EAAO,CAAO,QAAS,GAAM,WAAY,GAAO,OAAQ,OAAa,GAAGJ,CAAW,EACzF,GAAI,gBAAiB,QAAU,OAAO,OAAO,aAAgB,WACzDG,EAAQ,IAAI,OAAO,YAAYJ,EAAWK,CAAI,MAE7C,CACDD,EAAQ,SAAS,YAAY,aAAa,EAC1C,MAAME,EAAU,CAAC,CAACD,EAAK,QACjBE,EAAa,CAAC,CAACF,EAAK,WACpBG,EAAUH,EAAK,OACrBD,EAAM,gBAAgBJ,EAAWM,EAASC,EAAYC,CAAO,CACrE,CAEI,cAAO,KAAKN,CAAoB,EAC3B,QAAQO,GAAO,CAChB,OAAO,eAAeL,EAAOK,EAAK,CAC9B,KAAM,CACF,OAAOP,EAAqBO,CAAG,CAC/C,CACA,CAAS,CACT,CAAK,EACML,CACX,CACA,SAASD,EAAkCF,EAAW,CAClD,MAAMS,EAAa,qCACbC,EAAqB,CAAE,EAC7B,cAAO,KAAKV,CAAS,EAAE,QAAQQ,GAAO,CAC9BC,EAAW,QAAQD,CAAG,IAAM,KAC5BE,EAAmBF,CAAG,EAAIR,EAAUQ,CAAG,EACvC,OAAOR,EAAUQ,CAAG,EAEhC,CAAK,EACME,CACX","x_google_ignoreList":[0]}