@lavamoat/lavadome-core
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -1,2 +0,2 @@ | ||
(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{LavaDome:()=>K,LavaDomeDebug:()=>V});const{Object:o,Array:n,Function:a,Math:r,parseInt:s,WeakMap:l,Error:i,JSON:p,Symbol:u}=globalThis,{defineProperties:c,assign:d,getOwnPropertyDescriptor:y,entries:b,create:f,hasOwn:g}=o,{from:h}=n,{random:m}=r,{stringify:v}=p,w=(e,t,o)=>e&&a.prototype.call.bind(y(e,t)[o]),T=w(globalThis?.Element?.prototype,"attachShadow","value"),S=w(globalThis?.Document?.prototype,"createElement","value"),O=w(globalThis?.Node?.prototype,"appendChild","value"),M=w(globalThis?.Node?.prototype,"textContent","set"),x=w(globalThis?.Element?.prototype,"setAttribute","value"),I=w(globalThis?.String?.prototype,"toUpperCase","value"),D=w(globalThis?.Array?.prototype,"map","value"),j=w(globalThis?.Array?.prototype,"join","value"),k=w(globalThis?.Array?.prototype,"keys","value"),L=w(globalThis?.Array?.prototype,"at","value"),A=w(globalThis?.WeakMap?.prototype,"get","value"),C=w(globalThis?.WeakMap?.prototype,"set","value"),P=(w(globalThis?.WeakMap?.prototype,"has","value"),w(globalThis?.Number?.prototype,"toFixed","value")),_={isInnerInstance:Symbol("isInnerInstance"),unsafeOpenModeShadow:"unsafeOpenModeShadow"},E=e=>function(t,o,n){const a=e[t];return g(e,t)?typeof a!==o?n:a:n},N="abcdefghijklmnopqrstuvwxyz",$="0123456789",F="!@#$%^&*()?.;:\"'[]{}+=-_/",R={letters:N,digits:$,symbols:F,alphanumeric:N+$,all:N+I(N)+$+F},{letters:W,alphanumeric:q,all:z}=R,B=(e,t)=>e[s(P(m()*t))];function U(e,t,o=""){return e=j(D(b(e),(([e,t])=>`${e}: ${t} !important`)),"; "),function(){const n=S(document,t());return x(n,"style",e),M(n,o),n}}const G=e=>()=>e(),J=G(U({"-webkit-user-modify":"unset","-webkit-user-select":"none","user-select":"none"},(()=>(7,B(W,26)+j(D(h(k(n(7))),(()=>B(q,36))),""))))),Y=G(U({top:"-10px",right:"-10px",position:"fixed","font-size":"1px"},(()=>"span"),z)),H=new l;function K(e,t){t=function(e={}){const{unsafeOpenModeShadow:t,isInnerInstance:o}=_,n=E(d(f(null),e)),a=f(null);return a.isInnerInstance=n(o,"boolean",!1),a.unsafeOpenModeShadow=n(t,"boolean",!1),a}(t),c(this,{text:{value:function(e){if("string"!=typeof e)throw new i(`LavaDome: first argument must be a string, instead got ${v(e)}`);if(void 0===L(h(e),1))return M(o,e);D(h(e),(e=>{const n=S(document,"span");t[_.isInnerInstance]=!0,new K(n,t).text(e),O(o,n)})),O(o,Y())}}});const o=J(),n=function(e,t){const{unsafeOpenModeShadow:o,isInnerInstance:n}=t;let a=A(H,e);if(!a){const t={mode:"closed"};o&&(t.mode="open",n||console.warn("LavaDome:",`Initiated with "${_.unsafeOpenModeShadow}" set to true.`,"This leaves LavaDome fully vulnerable, ONLY USE FOR TESTING!")),a=T(e,t),C(H,e,a)}return a}(e,t);O(n,o)}const{all:Q}=R,V={getTextByRoot:function(e){console.warn("LavaDomeDebug(getTextByRoot):","Call/include this function for testing/debugging purposes only!",`(remember, '${_.unsafeOpenModeShadow}' must be enabled for this function to work)`);let t="";const o=e?.shadowRoot;if(!o)return t;const n=h(o.querySelectorAll("span"));return D(n,(e=>{const o=e?.shadowRoot?.firstChild?.textContent;o&&(t+=o)})),t},stripDistractionFromText:function(e){return console.warn("LavaDomeDebug(stripDistractionFromText):","Call/include this function for testing/debugging purposes only!"),e.split(Q).join("").split("\n").join("").split("\r").join("").split("\t").join("")}};var X=exports;for(var Z in t)X[Z]=t[Z];t.__esModule&&Object.defineProperty(X,"__esModule",{value:!0})})(); | ||
(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{LavaDome:()=>K,LavaDomeDebug:()=>V});const{Object:o,Array:n,Function:r,Math:a,parseInt:s,WeakMap:i,Error:l,JSON:p,crypto:u}=globalThis,{defineProperties:c,assign:d,getOwnPropertyDescriptor:f,entries:y,create:b,hasOwn:g}=o,{from:h}=n,{random:m}=a,{stringify:v}=p,w=(u.randomUUID.bind(u),(e,t,o)=>e&&r.prototype.call.bind(f(e,t)[o])),T=w(globalThis?.Element?.prototype,"attachShadow","value"),O=w(globalThis?.Document?.prototype,"createElement","value"),S=w(globalThis?.Node?.prototype,"appendChild","value"),I=w(globalThis?.Node?.prototype,"textContent","set"),x=w(globalThis?.Element?.prototype,"setAttribute","value"),D=w(globalThis?.String?.prototype,"toUpperCase","value"),M=w(globalThis?.Array?.prototype,"map","value"),j=w(globalThis?.Array?.prototype,"join","value"),k=w(globalThis?.Array?.prototype,"keys","value"),C=w(globalThis?.Array?.prototype,"at","value"),L=w(globalThis?.WeakMap?.prototype,"get","value"),A=w(globalThis?.WeakMap?.prototype,"set","value"),P=w(globalThis?.Number?.prototype,"toFixed","value"),_={isInnerInstance:Symbol("isInnerInstance"),unsafeOpenModeShadow:"unsafeOpenModeShadow"},E=e=>function(t,o,n){const r=e[t];return g(e,t)?typeof r!==o?n:r:n},N="abcdefghijklmnopqrstuvwxyz",$="0123456789",F="!@#$%^&*()?.;:\"'[]{}+=-_/",R={letters:N,digits:$,symbols:F,alphanumeric:N+$,all:N+D(N)+$+F},{letters:U,alphanumeric:W,all:q}=R,z=(e,t)=>e[s(P(m()*t))];function B(e,t,o=""){return e=j(M(y(e),(([e,t])=>`${e}: ${t} !important`)),"; "),function(){const n=O(document,t());return x(n,"style",e),I(n,o),n}}const G=e=>()=>e(),J=G(B({"-webkit-user-modify":"unset","-webkit-user-select":"none","user-select":"none"},(()=>(7,z(U,26)+j(M(h(k(n(7))),(()=>z(W,36))),""))))),Y=G(B({top:"-10px",right:"-10px",position:"fixed","font-size":"1px"},(()=>"span"),q)),H=new i;function K(e,t){t=function(e={}){const{unsafeOpenModeShadow:t,isInnerInstance:o}=_,n=E(d(b(null),e)),r=b(null);return r.isInnerInstance=n(o,"boolean",!1),r.unsafeOpenModeShadow=n(t,"boolean",!1),r}(t),c(this,{text:{value:function(e){if("string"!=typeof e)throw new l(`LavaDomeCore: first argument must be a string, instead got ${v(e)}`);if(void 0===C(h(e),1))return I(o,e);M(h(e),(e=>{const n=O(document,"span");t[_.isInnerInstance]=!0,new K(n,t).text(e),S(o,n)})),S(o,Y())}}});const o=J(),n=function(e,t){const{unsafeOpenModeShadow:o,isInnerInstance:n}=t;let r=L(H,e);if(!r){const t={mode:"closed"};o&&(t.mode="open",n||console.warn("LavaDome:",`Initiated with "${_.unsafeOpenModeShadow}" set to true.`,"This leaves LavaDome fully vulnerable, ONLY USE FOR TESTING!")),r=T(e,t),A(H,e,r)}return r}(e,t);S(n,o)}const{all:Q}=R,V={getTextByRoot:function(e){console.warn("LavaDomeDebug(getTextByRoot):","Call/include this function for testing/debugging purposes only!",`(remember, '${_.unsafeOpenModeShadow}' must be enabled for this function to work)`);let t="";const o=e?.shadowRoot;if(!o)return t;const n=h(o.querySelectorAll("span"));return M(n,(e=>{const o=e?.shadowRoot?.firstChild?.textContent;o&&(t+=o)})),t},stripDistractionFromText:function(e){return console.warn("LavaDomeDebug(stripDistractionFromText):","Call/include this function for testing/debugging purposes only!"),e.split(Q).join("").split("\n").join("").split("\r").join("").split("\t").join("")}};var X=exports;for(var Z in t)X[Z]=t[Z];t.__esModule&&Object.defineProperty(X,"__esModule",{value:!0})})(); | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "@lavamoat/lavadome-core", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
264