{"version":3,"file":"encapsulateShadowDomFromGlobalStyles.cjs","names":["shadowDomHostStyles","exports","encapsulateShadowDomFromGlobalStyles","nonce","stylesRootElement","styleHostElement","document","createElement","setAttribute","innerHTML","appendChild"],"sources":["../../../src/web-component/encapsulateShadowDomFromGlobalStyles.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactRootElements } from \"./createReactRootElements.js\";\n\nexport const shadowDomHostStyles = `\n  :host {\n    all: initial;\n    contain: content;\n  }\n`;\n\nexport const encapsulateShadowDomFromGlobalStyles = ({\n  nonce,\n  stylesRootElement,\n}: {\n  nonce: string;\n  stylesRootElement: ReactRootElements[\"stylesRootElement\"];\n}) => {\n  const styleHostElement = document.createElement(\"style\");\n\n  styleHostElement.setAttribute(\"nonce\", nonce);\n\n  styleHostElement.innerHTML = shadowDomHostStyles;\n\n  stylesRootElement.appendChild(styleHostElement);\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;AACnC;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAME,oCAAoC,GAAGA,CAAC;EACnDC,KAAK;EACLC;AAIF,CAAC,KAAK;EACJ,MAAMC,gBAAgB,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAExDF,gBAAgB,CAACG,YAAY,CAAC,OAAO,EAAEL,KAAK,CAAC;EAE7CE,gBAAgB,CAACI,SAAS,GAAGT,mBAAmB;EAEhDI,iBAAiB,CAACM,WAAW,CAACL,gBAAgB,CAAC;AACjD,CAAC;AAACJ,OAAA,CAAAC,oCAAA,GAAAA,oCAAA","ignoreList":[]}