import{validation}from"../../Validation.js";class InjectCss{execute(e){var n=validation.string("content",e.content,void 0),e=validation.string("url",e.url,void 0);if(n){let t=!1;var a=document.getElementsByTagName("style");for(let e=0;e<a.length;e++)if(a[e].textContent===n){t=!0;break}if(!t){const s=document.createElement("style");s.appendChild(document.createTextNode(n)),document.getElementsByTagName("head")[0].appendChild(s)}}if(e){let t=!1;const c=document.createElement("a");c.href=e;var l=document.getElementsByTagName("link");for(let e=0;e<l.length;e++)if(l[e].href===c.href){t=!0;break}if(!t){const i=document.createElement("link");i.href=e,i.rel="stylesheet",i.type="text/css",document.getElementsByTagName("head")[0].appendChild(i)}}return{}}}InjectCss.action="gcx:wf:browser::InjectCss",InjectCss.suite="gcx:wf:builtin";export{InjectCss};