import{t}from"./p-b75ee3ba.js";const n=new class{constructor(n){var e;if(n)this._nonce=n;else if("function"==typeof t){const n=t();if(n){const t=null===(e=n.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.content;t&&(this._nonce=t)}}}set nonce(t){this._nonce=t}get nonce(){return this._nonce}patchHeadInsertBeforeWithNonceToStencil(){const e=t();if(!e)return;const o=e.head,s=o.insertBefore;o.insertBefore=function(t,e){return n.nonce?(t.nodeType===Node.ELEMENT_NODE&&t instanceof HTMLStyleElement&&t.hasAttribute("data-styles")&&(t.innerHTML.includes("vega-")||t.innerHTML.includes(".hydrated"))&&!t.hasAttribute("nonce")&&t.setAttribute("nonce",n.nonce),s.call(this,t,e)):s.call(this,t,e)}}};function e(t){n.nonce=t}export{e as s,n as v}