@applitools/dom-capture
Advanced tools
Comparing version 11.4.0 to 11.5.0
@@ -6,2 +6,9 @@ # Changelog | ||
## [11.5.0](https://github.com/Applitools-Dev/sdk/compare/js/dom-capture@11.4.0...js/dom-capture@11.5.0) (2024-09-16) | ||
### Features | ||
* ability to capture element properties ([#2525](https://github.com/Applitools-Dev/sdk/issues/2525)) ([ab35e1d](https://github.com/Applitools-Dev/sdk/commit/ab35e1dc929ba4bd82e99081527b277c8090f1e0)) | ||
## [11.4.0](https://github.com/Applitools-Dev/sdk/compare/js/dom-capture@11.3.1...js/dom-capture@11.4.0) (2024-09-10) | ||
@@ -8,0 +15,0 @@ |
@@ -1,8 +0,8 @@ | ||
/* @applitools/dom-capture@11.4.0 */ | ||
/* @applitools/dom-capture@11.5.0 */ | ||
function __captureDom() { | ||
var captureDom=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let a=0;a<e.length;++a){const s=t(e,a);let c=0;s>0&&(c=s<128?1:s<2048?2:s<65536?3:s<2097152?4:s<67108864?5:6),r+c>n?(o.push(a),r=c):r+=c}return o};const o=n,r="WIP",a="SUCCESS",s="SUCCESS_CHUNKED",c="ERROR";var u=function(e,t,n={}){const u=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks)try{const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}catch(e){return{status:c,error:e.message}}if(e.from>=0)return{status:s,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:a,value:e.value}}return e.error?{status:c,error:e.error}:{status:r}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(u.status===a||u.status===c||u.status===s&&u.done)&&(e[t]=null),u};const i=u;var l={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},Promise.resolve().then((()=>e.apply(null,arguments))).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:u,absolutizeUrl:function(e,t){if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;let n=!0;try{n=e!==decodeURI(e)}catch(e){n=!0}try{const o=new URL(e,t).href;return n?o:decodeURI(o)}catch(t){return n?e:decodeURI(e)}},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}};const d=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;var f={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","font-family","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index","pointer-events","cursor"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const{NODE_TYPES:m}=f;function h(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var p=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},g=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},y=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const w=g,C=y;const{absolutizeUrl:E,isInlineFrame:T}=l,b=p,N=g,S=y,{NODE_TYPES:A}=f;const{absolutizeUrl:$,isInlineFrame:v}=l,R=function(e){const t=e?e.match(d):void 0;return t?t[1]:t},P=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},_=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,a=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==m.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${h(o)}]/${n}`,o=o.parentNode;return a&&(n=`${e(a)},${n}`),n.replace(/\/$/,"")},D=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function a(s,c){let u,i="";try{const l=e(s);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),s=o(t);if(void 0!==s){const{bundledCss:e,unfetchedResources:n}=a(s,t);n&&(u=new Set(n)),i=`${i}${e}`}else u=new Set([t]),i=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return i=`${i}${l=s,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:i,unfetchedResources:u}}},U=p,O=function(e,t){try{return["before","after"].reduce(((n,o)=>{const r=e.ownerDocument.defaultView.getComputedStyle(e,`:${o}`);if(r&&"none"!==r.getPropertyValue("content")){(n=n??{})[o]={};for(const e of t)n[o][e]=r.getPropertyValue(e)}return n}),void 0)}catch(e){return}},F=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},I=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,a,s;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),a=o;else if(n&&C(n)){const c=w(n);c?function(e){return e&&e.startsWith("data:")}(c)?(a=o,r=c.match(/,(.+)/)[1]):(a=t(c,o),r=e(a)):r="",s=void 0===r}return{cssText:r,styleBaseUrl:a,isUnfetched:s}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:a,cssText:s,isUnfetched:c}=e(o,r);let u,i="";if(s){const{bundledCss:e,unfetchedResources:n}=t(s,a);i+=e,u=new Set(n)}else c&&(i+=`${n}${a}${n}`,u=new Set([a]));return{bundledCss:i,unfetchedResources:u}}},L=function(t){return async function(n=e){const o={},r=Date.now(),a=[];return function e(n,o,r,a){function c(e){if(a.push(async function(e,n,o){let r,a;e&&S(e)&&(a=E(N(e),n),r=await t(a),void 0!==r&&(o[a]=r)),r&&await s(r,a,o)}(e,o,r)),e.nodeType===A.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?i(e):u(e)}async function u(e){Array.prototype.map.call(e.childNodes,c)}async function i(t){if(u(t),t.contentDocument)try{const n=T(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,a)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,a),await Promise.all(a),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function s(e,n,o){try{const r=b(e),a=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&a.push((async()=>{const r=E(e.href,n),a=await t(r);o[r]=a,void 0!==a&&await s(a,r,o)})());await Promise.all(a)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:x,DEFAULT_STYLE_PROPS:M,DEFAULT_RECT_PROPS:V,DEFAULT_IGNORED_TAG_NAMES:B}=f;return function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((async function({doc:t=e,styleProps:n=M,rectProps:o=V,ignoredTagNames:r=B,capturePseudo:a=!1,addStats:s=!1,fetchTimeLimit:c=3e4}={}){ | ||
var captureDom=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="WIP",s="SUCCESS",a="SUCCESS_CHUNKED",c="ERROR";var u=function(e,t,n={}){const u=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks)try{const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}catch(e){return{status:c,error:e.message}}if(e.from>=0)return{status:a,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:s,value:e.value}}return e.error?{status:c,error:e.error}:{status:r}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(u.status===s||u.status===c||u.status===a&&u.done)&&(e[t]=null),u};const i=u;var l={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},Promise.resolve().then((()=>e.apply(null,arguments))).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:u,absolutizeUrl:function(e,t){if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;let n=!0;try{n=e!==decodeURI(e)}catch(e){n=!0}try{const o=new URL(e,t).href;return n?o:decodeURI(o)}catch(t){return n?e:decodeURI(e)}},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}};const d=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;var f={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","font-family","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index","pointer-events","cursor"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const{NODE_TYPES:m}=f;function h(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var p=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},g=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},y=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const w=g,C=y;const{absolutizeUrl:E,isInlineFrame:T}=l,b=p,N=g,S=y,{NODE_TYPES:A}=f;const{absolutizeUrl:$,isInlineFrame:v}=l,R=function(e){const t=e?e.match(d):void 0;return t?t[1]:t},P=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},_=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==m.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${h(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},D=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let u,i="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(u=new Set(n)),i=`${i}${e}`}else u=new Set([t]),i=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return i=`${i}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:i,unfetchedResources:u}}},U=p,O=function(e,t){try{return["before","after"].reduce(((n,o)=>{const r=e.ownerDocument.defaultView.getComputedStyle(e,`:${o}`);if(r&&"none"!==r.getPropertyValue("content")){(n=n??{})[o]={};for(const e of t)n[o][e]=r.getPropertyValue(e)}return n}),void 0)}catch(e){return}},F=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},I=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&C(n)){const c=w(n);c?function(e){return e&&e.startsWith("data:")}(c)?(s=o,r=c.match(/,(.+)/)[1]):(s=t(c,o),r=e(s)):r="",a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let u,i="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);i+=e,u=new Set(n)}else c&&(i+=`${n}${s}${n}`,u=new Set([s]));return{bundledCss:i,unfetchedResources:u}}},L=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=E(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===A.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?i(e):u(e)}async function u(e){Array.prototype.map.call(e.childNodes,c)}async function i(t){if(u(t),t.contentDocument)try{const n=T(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=b(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=E(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:x,DEFAULT_STYLE_PROPS:M,DEFAULT_RECT_PROPS:V,DEFAULT_IGNORED_TAG_NAMES:B}=f;return function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((async function({doc:t=e,styleProps:n=M,rectProps:o=V,elementProps:r=[],ignoredTagNames:s=B,capturePseudo:a=!1,addStats:c=!1,fetchTimeLimit:u=3e4}={}){ | ||
/* MARKER FOR TEST - DO NOT DELETE */ | ||
arguments[1]&&(t=arguments[1]),arguments[2]&&(s=arguments[2]),arguments[3]&&(c=arguments[3]),!0===n&&(n=[...getComputedStyle(t.body)]);const u={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function i(e){e.startTime=Date.now()}function l(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const d=[];i(u.total);const f=new Set,m=[],h="@@@@@",p="#####",g="-----";i(u.prefetchCss);const y=L(F(fetch,{fetchTimeLimit:c})),w=await y(t);l(u.prefetchCss);const C=D({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:w,absolutizeUrl:$,unfetchedToken:p}),E=I({getCssFromCache:w,absolutizeUrl:$}),T=k({extractCssFromNode:E,getBundledCssFromCssText:C,unfetchedToken:p});i(u.doCaptureDoc);const b=function s(c,u=c.location&&c.location.href){const i=new Set;let l="";const p=g(c.documentElement||c);return p.css=l,d.push(P({bgImages:i}).then((e=>p.images=e))),p;function g(t){if(t.hasAttribute&&t.hasAttribute("data-applitools-skip"))return null;const{bundledCss:n,unfetchedResources:o}=T(t,u);if(l+=n,o)for(const e of o)f.add(e);switch(t.nodeType){case x.TEXT:return function(t){const n=e.createRange();n.selectNode(t);const o=n.getClientRects();return{tagName:"#text",text:t.textContent,rects:o&&o.length?Array.from(o).map((e=>({width:e.width,height:e.height,top:e.top,left:e.left}))):void 0}}(t);case x.ELEMENT:return"IFRAME"===t.tagName.toUpperCase()?function(e){const t=y(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[s(n,v(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=_(e);m.push(n),t.childNodes=[`${h}${n}${h}`]}}(t):y(t);case x.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(t.childNodes,g).filter(Boolean)};default:return null}}function y(e){const c=Array.prototype.map.call(e.childNodes,g).filter(Boolean),l=e.shadowRoot&&s(e.shadowRoot,u),d=e.tagName.toUpperCase();if(r.indexOf(d)>-1)return null;const f=t.defaultView.getComputedStyle(e),m=e.getBoundingClientRect(),h={};for(const e of n)h[e]=f.getPropertyValue(e);h["border-width"]||(h["border-width"]=`${f.getPropertyValue("border-top-width")} ${f.getPropertyValue("border-right-width")} ${f.getPropertyValue("border-bottom-width")} ${f.getPropertyValue("border-left-width")}`);const p={};for(const e of o)p[e]=m[e];const y=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{});"INPUT"!==d&&"TEXTAREA"!==d||!e.value||(y.value&&console.log(`[captureFrame] Overriding element attributes value from ${y.value} to ${e.value}`),y.value=e.value);const w=R(f.getPropertyValue("background-image"));w&&i.add(w);const C=O(e,n),E=a?C:void 0;C&&(y["data-applitools-has-pseudo"]=Object.keys(C).join("_and_"));const T={tagName:d,style:Y(h),rect:Y(p),attributes:Y(y),childNodes:c,pseudo:E};return l&&(T.shadowRoot=l),T}}(t);l(u.doCaptureDoc),i(u.waitForImages),await Promise.all(d),l(u.waitForImages),b.version="1.3.0",b.scriptVersion="11.4.0";const N=m.length?`${m.join("\n")}\n`:"",S=f.size?`${Array.from(f).join("\n")}\n`:"",A=JSON.stringify({separator:g,cssStartToken:p,cssEndToken:p,iframeStartToken:`"${h}`,iframeEndToken:`${h}"`});l(u.total);const z=`${A}\n${S}${g}\n${N}${g}\n${JSON.stringify(b)}${s?`\n${g}\n${JSON.stringify(u)}`:""}`;return console.log("[captureFrame]",JSON.stringify(u)),z;function Y(e){return Object.keys(e).length?e:void 0}}))}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const a=n.contentWindow[`ctor-${o}`];if("function"!=typeof a)throw new Error("Sandbox failed to extract function");return t=!1,a(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};return e(t)}(); | ||
arguments[1]&&(t=arguments[1]),arguments[2]&&(c=arguments[2]),arguments[3]&&(u=arguments[3]),!0===n&&(n=[...getComputedStyle(t.body)]);const i={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function l(e){e.startTime=Date.now()}function d(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const f=[];l(i.total);const m=new Set,h=[],p="@@@@@",g="#####",y="-----";l(i.prefetchCss);const w=L(F(fetch,{fetchTimeLimit:u})),C=await w(t);d(i.prefetchCss);const E=D({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:C,absolutizeUrl:$,unfetchedToken:g}),T=I({getCssFromCache:C,absolutizeUrl:$}),b=k({extractCssFromNode:T,getBundledCssFromCssText:E,unfetchedToken:g});l(i.doCaptureDoc);const N=function c(u,i=u.location&&u.location.href){const l=new Set;let d="";const g=y(u.documentElement||u);return g.css=d,f.push(P({bgImages:l}).then((e=>g.images=e))),g;function y(t){if(t.hasAttribute&&t.hasAttribute("data-applitools-skip"))return null;const{bundledCss:n,unfetchedResources:r}=b(t,i);if(d+=n,r)for(const e of r)m.add(e);switch(t.nodeType){case x.TEXT:return function(t){const n=e.createRange();n.selectNode(t);const r=n.getClientRects();return{tagName:"#text",text:t.textContent,rects:r&&r.length&&o.length?Array.from(r).map((e=>{const t={};for(const n of o)t[n]=e[n];return t})):void 0}}(t);case x.ELEMENT:return"IFRAME"===t.tagName.toUpperCase()?function(e){const t=w(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[c(n,v(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=_(e);h.push(n),t.childNodes=[`${p}${n}${p}`]}}(t):w(t);case x.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(t.childNodes,y).filter(Boolean)};default:return null}}function w(e){const u=Array.prototype.map.call(e.childNodes,y).filter(Boolean),d=e.shadowRoot&&c(e.shadowRoot,i),f=e.tagName.toUpperCase();if(s.indexOf(f)>-1)return null;const m=t.defaultView.getComputedStyle(e),h=e.getBoundingClientRect(),p={};for(const e of n)p[e]=m.getPropertyValue(e);!p["border-width"]&&n.includes("border-width")&&(p["border-width"]=`${m.getPropertyValue("border-top-width")} ${m.getPropertyValue("border-right-width")} ${m.getPropertyValue("border-bottom-width")} ${m.getPropertyValue("border-left-width")}`);const g={};for(const e of o)g[e]=h[e];const w=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{});"INPUT"!==f&&"TEXTAREA"!==f||!e.value||(w.value&&console.log(`[captureFrame] Overriding element attributes value from ${w.value} to ${e.value}`),w.value=e.value);const C=R(m.getPropertyValue("background-image"));C&&l.add(C);const E=O(e,n),T=a?E:void 0;E&&(w["data-applitools-has-pseudo"]=Object.keys(E).join("_and_"));const b={};for(const t of r)b[t]=e[t];const N={tagName:f,style:j(p),rect:j(g),attributes:j(w),properties:j(b),childNodes:u,pseudo:T};return d&&(N.shadowRoot=d),N}}(t);d(i.doCaptureDoc),l(i.waitForImages),await Promise.all(f),d(i.waitForImages),N.version="1.3.0",N.scriptVersion="11.5.0";const S=h.length?`${h.join("\n")}\n`:"",A=m.size?`${Array.from(m).join("\n")}\n`:"",z=JSON.stringify({separator:y,cssStartToken:g,cssEndToken:g,iframeStartToken:`"${p}`,iframeEndToken:`${p}"`});d(i.total);const Y=`${z}\n${A}${y}\n${S}${y}\n${JSON.stringify(N)}${c?`\n${y}\n${JSON.stringify(i)}`:""}`;return console.log("[captureFrame]",JSON.stringify(i)),Y;function j(e){return Object.keys(e).length?e:void 0}}))}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];if("function"!=typeof s)throw new Error("Sandbox failed to extract function");return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};return e(t)}(); | ||
return captureDom.apply(this, arguments); | ||
} |
@@ -1,8 +0,8 @@ | ||
/* @applitools/dom-capture@11.4.0 */ | ||
/* @applitools/dom-capture@11.5.0 */ | ||
function __captureDomPoll() { | ||
var captureDomPoll=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="WIP",s="SUCCESS",a="SUCCESS_CHUNKED",c="ERROR";var u=function(e,t,n={}){const u=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks)try{const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}catch(e){return{status:c,error:e.message}}if(e.from>=0)return{status:a,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:s,value:e.value}}return e.error?{status:c,error:e.error}:{status:r}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(u.status===s||u.status===c||u.status===a&&u.done)&&(e[t]=null),u};const i=u;var l={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},Promise.resolve().then((()=>e.apply(null,arguments))).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:u,absolutizeUrl:function(e,t){if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;let n=!0;try{n=e!==decodeURI(e)}catch(e){n=!0}try{const o=new URL(e,t).href;return n?o:decodeURI(o)}catch(t){return n?e:decodeURI(e)}},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}},d={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","font-family","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index","pointer-events","cursor"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const f=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;const{NODE_TYPES:m}=d;function h(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var p=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},g=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},y=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const w=g,E=y;const{absolutizeUrl:C,isInlineFrame:T}=l,b=p,N=g,S=y,{NODE_TYPES:A}=d;const{absolutizeUrl:R,isInlineFrame:$}=l,P=function(e){const t=e?e.match(f):void 0;return t?t[1]:t},v=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},_=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==m.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${h(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},D=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let u,i="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(u=new Set(n)),i=`${i}${e}`}else u=new Set([t]),i=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return i=`${i}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:i,unfetchedResources:u}}},U=p,O=function(e,t){try{return["before","after"].reduce(((n,o)=>{const r=e.ownerDocument.defaultView.getComputedStyle(e,`:${o}`);if(r&&"none"!==r.getPropertyValue("content")){(n=n??{})[o]={};for(const e of t)n[o][e]=r.getPropertyValue(e)}return n}),void 0)}catch(e){return}},F=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},I=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&E(n)){const c=w(n);c?function(e){return e&&e.startsWith("data:")}(c)?(s=o,r=c.match(/,(.+)/)[1]):(s=t(c,o),r=e(s)):r="",a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let u,i="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);i+=e,u=new Set(n)}else c&&(i+=`${n}${s}${n}`,u=new Set([s]));return{bundledCss:i,unfetchedResources:u}}},L=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=C(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===A.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?i(e):u(e)}async function u(e){Array.prototype.map.call(e.childNodes,c)}async function i(t){if(u(t),t.contentDocument)try{const n=T(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=b(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=C(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:x,DEFAULT_STYLE_PROPS:M,DEFAULT_RECT_PROPS:V,DEFAULT_IGNORED_TAG_NAMES:B}=d;const{pollify:Y}=l,{EYES_NAMESPACE:z,DOM_CAPTURE_KEY:j}=d,G=async function({doc:t=e,styleProps:n=M,rectProps:o=V,ignoredTagNames:r=B,capturePseudo:s=!1,addStats:a=!1,fetchTimeLimit:c=3e4}={}){ | ||
var captureDomPoll=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="WIP",s="SUCCESS",a="SUCCESS_CHUNKED",c="ERROR";var u=function(e,t,n={}){const u=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks)try{const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}catch(e){return{status:c,error:e.message}}if(e.from>=0)return{status:a,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:s,value:e.value}}return e.error?{status:c,error:e.error}:{status:r}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(u.status===s||u.status===c||u.status===a&&u.done)&&(e[t]=null),u};const i=u;var l={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},Promise.resolve().then((()=>e.apply(null,arguments))).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:u,absolutizeUrl:function(e,t){if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;let n=!0;try{n=e!==decodeURI(e)}catch(e){n=!0}try{const o=new URL(e,t).href;return n?o:decodeURI(o)}catch(t){return n?e:decodeURI(e)}},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}},d={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","font-family","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index","pointer-events","cursor"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const f=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;const{NODE_TYPES:m}=d;function h(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var p=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},g=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},y=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const w=g,E=y;const{absolutizeUrl:C,isInlineFrame:T}=l,b=p,N=g,S=y,{NODE_TYPES:A}=d;const{absolutizeUrl:P,isInlineFrame:R}=l,$=function(e){const t=e?e.match(f):void 0;return t?t[1]:t},v=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},_=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==m.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${h(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},D=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let u,i="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(u=new Set(n)),i=`${i}${e}`}else u=new Set([t]),i=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return i=`${i}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:i,unfetchedResources:u}}},U=p,O=function(e,t){try{return["before","after"].reduce(((n,o)=>{const r=e.ownerDocument.defaultView.getComputedStyle(e,`:${o}`);if(r&&"none"!==r.getPropertyValue("content")){(n=n??{})[o]={};for(const e of t)n[o][e]=r.getPropertyValue(e)}return n}),void 0)}catch(e){return}},F=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},I=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&E(n)){const c=w(n);c?function(e){return e&&e.startsWith("data:")}(c)?(s=o,r=c.match(/,(.+)/)[1]):(s=t(c,o),r=e(s)):r="",a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let u,i="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);i+=e,u=new Set(n)}else c&&(i+=`${n}${s}${n}`,u=new Set([s]));return{bundledCss:i,unfetchedResources:u}}},L=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=C(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===A.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?i(e):u(e)}async function u(e){Array.prototype.map.call(e.childNodes,c)}async function i(t){if(u(t),t.contentDocument)try{const n=T(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=b(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=C(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:x,DEFAULT_STYLE_PROPS:M,DEFAULT_RECT_PROPS:V,DEFAULT_IGNORED_TAG_NAMES:B}=d;const{pollify:Y}=l,{EYES_NAMESPACE:z,DOM_CAPTURE_KEY:j}=d,G=async function({doc:t=e,styleProps:n=M,rectProps:o=V,elementProps:r=[],ignoredTagNames:s=B,capturePseudo:a=!1,addStats:c=!1,fetchTimeLimit:u=3e4}={}){ | ||
/* MARKER FOR TEST - DO NOT DELETE */ | ||
arguments[1]&&(t=arguments[1]),arguments[2]&&(a=arguments[2]),arguments[3]&&(c=arguments[3]),!0===n&&(n=[...getComputedStyle(t.body)]);const u={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function i(e){e.startTime=Date.now()}function l(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const d=[];i(u.total);const f=new Set,m=[],h="@@@@@",p="#####",g="-----";i(u.prefetchCss);const y=L(F(fetch,{fetchTimeLimit:c})),w=await y(t);l(u.prefetchCss);const E=D({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:w,absolutizeUrl:R,unfetchedToken:p}),C=I({getCssFromCache:w,absolutizeUrl:R}),T=k({extractCssFromNode:C,getBundledCssFromCssText:E,unfetchedToken:p});i(u.doCaptureDoc);const b=function a(c,u=c.location&&c.location.href){const i=new Set;let l="";const p=g(c.documentElement||c);return p.css=l,d.push(v({bgImages:i}).then((e=>p.images=e))),p;function g(t){if(t.hasAttribute&&t.hasAttribute("data-applitools-skip"))return null;const{bundledCss:n,unfetchedResources:o}=T(t,u);if(l+=n,o)for(const e of o)f.add(e);switch(t.nodeType){case x.TEXT:return function(t){const n=e.createRange();n.selectNode(t);const o=n.getClientRects();return{tagName:"#text",text:t.textContent,rects:o&&o.length?Array.from(o).map((e=>({width:e.width,height:e.height,top:e.top,left:e.left}))):void 0}}(t);case x.ELEMENT:return"IFRAME"===t.tagName.toUpperCase()?function(e){const t=y(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[a(n,$(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=_(e);m.push(n),t.childNodes=[`${h}${n}${h}`]}}(t):y(t);case x.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(t.childNodes,g).filter(Boolean)};default:return null}}function y(e){const c=Array.prototype.map.call(e.childNodes,g).filter(Boolean),l=e.shadowRoot&&a(e.shadowRoot,u),d=e.tagName.toUpperCase();if(r.indexOf(d)>-1)return null;const f=t.defaultView.getComputedStyle(e),m=e.getBoundingClientRect(),h={};for(const e of n)h[e]=f.getPropertyValue(e);h["border-width"]||(h["border-width"]=`${f.getPropertyValue("border-top-width")} ${f.getPropertyValue("border-right-width")} ${f.getPropertyValue("border-bottom-width")} ${f.getPropertyValue("border-left-width")}`);const p={};for(const e of o)p[e]=m[e];const y=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{});"INPUT"!==d&&"TEXTAREA"!==d||!e.value||(y.value&&console.log(`[captureFrame] Overriding element attributes value from ${y.value} to ${e.value}`),y.value=e.value);const w=P(f.getPropertyValue("background-image"));w&&i.add(w);const E=O(e,n),C=s?E:void 0;E&&(y["data-applitools-has-pseudo"]=Object.keys(E).join("_and_"));const T={tagName:d,style:z(h),rect:z(p),attributes:z(y),childNodes:c,pseudo:C};return l&&(T.shadowRoot=l),T}}(t);l(u.doCaptureDoc),i(u.waitForImages),await Promise.all(d),l(u.waitForImages),b.version="1.3.0",b.scriptVersion="11.4.0";const N=m.length?`${m.join("\n")}\n`:"",S=f.size?`${Array.from(f).join("\n")}\n`:"",A=JSON.stringify({separator:g,cssStartToken:p,cssEndToken:p,iframeStartToken:`"${h}`,iframeEndToken:`${h}"`});l(u.total);const Y=`${A}\n${S}${g}\n${N}${g}\n${JSON.stringify(b)}${a?`\n${g}\n${JSON.stringify(u)}`:""}`;return console.log("[captureFrame]",JSON.stringify(u)),Y;function z(e){return Object.keys(e).length?e:void 0}};window[z]=window[z]||{};const J=Y(G,window[z],j);return function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){return JSON.stringify(J(e)(e))}))}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];if("function"!=typeof s)throw new Error("Sandbox failed to extract function");return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};return e(t)}(); | ||
arguments[1]&&(t=arguments[1]),arguments[2]&&(c=arguments[2]),arguments[3]&&(u=arguments[3]),!0===n&&(n=[...getComputedStyle(t.body)]);const i={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function l(e){e.startTime=Date.now()}function d(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const f=[];l(i.total);const m=new Set,h=[],p="@@@@@",g="#####",y="-----";l(i.prefetchCss);const w=L(F(fetch,{fetchTimeLimit:u})),E=await w(t);d(i.prefetchCss);const C=D({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:E,absolutizeUrl:P,unfetchedToken:g}),T=I({getCssFromCache:E,absolutizeUrl:P}),b=k({extractCssFromNode:T,getBundledCssFromCssText:C,unfetchedToken:g});l(i.doCaptureDoc);const N=function c(u,i=u.location&&u.location.href){const l=new Set;let d="";const g=y(u.documentElement||u);return g.css=d,f.push(v({bgImages:l}).then((e=>g.images=e))),g;function y(t){if(t.hasAttribute&&t.hasAttribute("data-applitools-skip"))return null;const{bundledCss:n,unfetchedResources:r}=b(t,i);if(d+=n,r)for(const e of r)m.add(e);switch(t.nodeType){case x.TEXT:return function(t){const n=e.createRange();n.selectNode(t);const r=n.getClientRects();return{tagName:"#text",text:t.textContent,rects:r&&r.length&&o.length?Array.from(r).map((e=>{const t={};for(const n of o)t[n]=e[n];return t})):void 0}}(t);case x.ELEMENT:return"IFRAME"===t.tagName.toUpperCase()?function(e){const t=w(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[c(n,R(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=_(e);h.push(n),t.childNodes=[`${p}${n}${p}`]}}(t):w(t);case x.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(t.childNodes,y).filter(Boolean)};default:return null}}function w(e){const u=Array.prototype.map.call(e.childNodes,y).filter(Boolean),d=e.shadowRoot&&c(e.shadowRoot,i),f=e.tagName.toUpperCase();if(s.indexOf(f)>-1)return null;const m=t.defaultView.getComputedStyle(e),h=e.getBoundingClientRect(),p={};for(const e of n)p[e]=m.getPropertyValue(e);!p["border-width"]&&n.includes("border-width")&&(p["border-width"]=`${m.getPropertyValue("border-top-width")} ${m.getPropertyValue("border-right-width")} ${m.getPropertyValue("border-bottom-width")} ${m.getPropertyValue("border-left-width")}`);const g={};for(const e of o)g[e]=h[e];const w=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{});"INPUT"!==f&&"TEXTAREA"!==f||!e.value||(w.value&&console.log(`[captureFrame] Overriding element attributes value from ${w.value} to ${e.value}`),w.value=e.value);const E=$(m.getPropertyValue("background-image"));E&&l.add(E);const C=O(e,n),T=a?C:void 0;C&&(w["data-applitools-has-pseudo"]=Object.keys(C).join("_and_"));const b={};for(const t of r)b[t]=e[t];const N={tagName:f,style:j(p),rect:j(g),attributes:j(w),properties:j(b),childNodes:u,pseudo:T};return d&&(N.shadowRoot=d),N}}(t);d(i.doCaptureDoc),l(i.waitForImages),await Promise.all(f),d(i.waitForImages),N.version="1.3.0",N.scriptVersion="11.5.0";const S=h.length?`${h.join("\n")}\n`:"",A=m.size?`${Array.from(m).join("\n")}\n`:"",Y=JSON.stringify({separator:y,cssStartToken:g,cssEndToken:g,iframeStartToken:`"${p}`,iframeEndToken:`${p}"`});d(i.total);const z=`${Y}\n${A}${y}\n${S}${y}\n${JSON.stringify(N)}${c?`\n${y}\n${JSON.stringify(i)}`:""}`;return console.log("[captureFrame]",JSON.stringify(i)),z;function j(e){return Object.keys(e).length?e:void 0}};window[z]=window[z]||{};const J=Y(G,window[z],j);return function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){return JSON.stringify(J(e)(e))}))}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];if("function"!=typeof s)throw new Error("Sandbox failed to extract function");return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};return e(t)}(); | ||
return captureDomPoll.apply(this, arguments); | ||
} |
@@ -1,4 +0,4 @@ | ||
/* @applitools/dom-capture@11.4.0 */ | ||
"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="WIP",s="SUCCESS",a="SUCCESS_CHUNKED",c="ERROR";var u=function(e,t,n={}){const u=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks)try{const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}catch(e){return{status:c,error:e.message}}if(e.from>=0)return{status:a,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:s,value:e.value}}return e.error?{status:c,error:e.error}:{status:r}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(u.status===s||u.status===c||u.status===a&&u.done)&&(e[t]=null),u};const i=u;var l={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},Promise.resolve().then((()=>e.apply(null,arguments))).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:u,absolutizeUrl:function(e,t){if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;let n=!0;try{n=e!==decodeURI(e)}catch(e){n=!0}try{const o=new URL(e,t).href;return n?o:decodeURI(o)}catch(t){return n?e:decodeURI(e)}},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}},d={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","font-family","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index","pointer-events","cursor"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const f=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;const{NODE_TYPES:m}=d;function h(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var p=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},g=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},y=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const w=g,E=y;const{absolutizeUrl:C,isInlineFrame:T}=l,b=p,N=g,S=y,{NODE_TYPES:A}=d;const{absolutizeUrl:R,isInlineFrame:$}=l,P=function(e){const t=e?e.match(f):void 0;return t?t[1]:t},_=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},v=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==m.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${h(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},U=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let u,i="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(u=new Set(n)),i=`${i}${e}`}else u=new Set([t]),i=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return i=`${i}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:i,unfetchedResources:u}}},D=p,O=function(e,t){try{return["before","after"].reduce(((n,o)=>{const r=e.ownerDocument.defaultView.getComputedStyle(e,`:${o}`);if(r&&"none"!==r.getPropertyValue("content")){(n=n??{})[o]={};for(const e of t)n[o][e]=r.getPropertyValue(e)}return n}),void 0)}catch(e){return}},F=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},I=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&E(n)){const c=w(n);c?function(e){return e&&e.startsWith("data:")}(c)?(s=o,r=c.match(/,(.+)/)[1]):(s=t(c,o),r=e(s)):r="",a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let u,i="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);i+=e,u=new Set(n)}else c&&(i+=`${n}${s}${n}`,u=new Set([s]));return{bundledCss:i,unfetchedResources:u}}},L=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=C(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===A.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?i(e):u(e)}async function u(e){Array.prototype.map.call(e.childNodes,c)}async function i(t){if(u(t),t.contentDocument)try{const n=T(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=b(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=C(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:x,DEFAULT_STYLE_PROPS:M,DEFAULT_RECT_PROPS:V,DEFAULT_IGNORED_TAG_NAMES:B}=d;const{pollify:Y}=l,{EYES_NAMESPACE:z,DOM_CAPTURE_KEY:j}=d,G=async function({doc:t=e,styleProps:n=M,rectProps:o=V,ignoredTagNames:r=B,capturePseudo:s=!1,addStats:a=!1,fetchTimeLimit:c=3e4}={}){ | ||
/* @applitools/dom-capture@11.5.0 */ | ||
"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="WIP",s="SUCCESS",a="SUCCESS_CHUNKED",c="ERROR";var u=function(e,t,n={}){const u=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks)try{const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}catch(e){return{status:c,error:e.message}}if(e.from>=0)return{status:a,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:s,value:e.value}}return e.error?{status:c,error:e.error}:{status:r}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(u.status===s||u.status===c||u.status===a&&u.done)&&(e[t]=null),u};const i=u;var l={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},Promise.resolve().then((()=>e.apply(null,arguments))).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:u,absolutizeUrl:function(e,t){if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;let n=!0;try{n=e!==decodeURI(e)}catch(e){n=!0}try{const o=new URL(e,t).href;return n?o:decodeURI(o)}catch(t){return n?e:decodeURI(e)}},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}},d={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","font-family","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index","pointer-events","cursor"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const f=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;const{NODE_TYPES:m}=d;function h(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var p=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},g=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},y=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const w=g,E=y;const{absolutizeUrl:C,isInlineFrame:T}=l,b=p,N=g,S=y,{NODE_TYPES:A}=d;const{absolutizeUrl:R,isInlineFrame:$}=l,P=function(e){const t=e?e.match(f):void 0;return t?t[1]:t},_=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},v=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==m.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${h(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},U=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let u,i="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(u=new Set(n)),i=`${i}${e}`}else u=new Set([t]),i=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return i=`${i}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:i,unfetchedResources:u}}},D=p,O=function(e,t){try{return["before","after"].reduce(((n,o)=>{const r=e.ownerDocument.defaultView.getComputedStyle(e,`:${o}`);if(r&&"none"!==r.getPropertyValue("content")){(n=n??{})[o]={};for(const e of t)n[o][e]=r.getPropertyValue(e)}return n}),void 0)}catch(e){return}},F=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},I=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&E(n)){const c=w(n);c?function(e){return e&&e.startsWith("data:")}(c)?(s=o,r=c.match(/,(.+)/)[1]):(s=t(c,o),r=e(s)):r="",a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let u,i="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);i+=e,u=new Set(n)}else c&&(i+=`${n}${s}${n}`,u=new Set([s]));return{bundledCss:i,unfetchedResources:u}}},L=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=C(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===A.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?i(e):u(e)}async function u(e){Array.prototype.map.call(e.childNodes,c)}async function i(t){if(u(t),t.contentDocument)try{const n=T(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=b(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=C(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:x,DEFAULT_STYLE_PROPS:M,DEFAULT_RECT_PROPS:V,DEFAULT_IGNORED_TAG_NAMES:B}=d;const{pollify:Y}=l,{EYES_NAMESPACE:z,DOM_CAPTURE_KEY:j}=d,G=async function({doc:t=e,styleProps:n=M,rectProps:o=V,elementProps:r=[],ignoredTagNames:s=B,capturePseudo:a=!1,addStats:c=!1,fetchTimeLimit:u=3e4}={}){ | ||
/* MARKER FOR TEST - DO NOT DELETE */ | ||
arguments[1]&&(t=arguments[1]),arguments[2]&&(a=arguments[2]),arguments[3]&&(c=arguments[3]),!0===n&&(n=[...getComputedStyle(t.body)]);const u={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function i(e){e.startTime=Date.now()}function l(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const d=[];i(u.total);const f=new Set,m=[],h="@@@@@",p="#####",g="-----";i(u.prefetchCss);const y=L(F(fetch,{fetchTimeLimit:c})),w=await y(t);l(u.prefetchCss);const E=U({parseCss:D,CSSImportRule:CSSImportRule,getCssFromCache:w,absolutizeUrl:R,unfetchedToken:p}),C=I({getCssFromCache:w,absolutizeUrl:R}),T=k({extractCssFromNode:C,getBundledCssFromCssText:E,unfetchedToken:p});i(u.doCaptureDoc);const b=function a(c,u=c.location&&c.location.href){const i=new Set;let l="";const p=g(c.documentElement||c);return p.css=l,d.push(_({bgImages:i}).then((e=>p.images=e))),p;function g(t){if(t.hasAttribute&&t.hasAttribute("data-applitools-skip"))return null;const{bundledCss:n,unfetchedResources:o}=T(t,u);if(l+=n,o)for(const e of o)f.add(e);switch(t.nodeType){case x.TEXT:return function(t){const n=e.createRange();n.selectNode(t);const o=n.getClientRects();return{tagName:"#text",text:t.textContent,rects:o&&o.length?Array.from(o).map((e=>({width:e.width,height:e.height,top:e.top,left:e.left}))):void 0}}(t);case x.ELEMENT:return"IFRAME"===t.tagName.toUpperCase()?function(e){const t=y(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[a(n,$(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=v(e);m.push(n),t.childNodes=[`${h}${n}${h}`]}}(t):y(t);case x.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(t.childNodes,g).filter(Boolean)};default:return null}}function y(e){const c=Array.prototype.map.call(e.childNodes,g).filter(Boolean),l=e.shadowRoot&&a(e.shadowRoot,u),d=e.tagName.toUpperCase();if(r.indexOf(d)>-1)return null;const f=t.defaultView.getComputedStyle(e),m=e.getBoundingClientRect(),h={};for(const e of n)h[e]=f.getPropertyValue(e);h["border-width"]||(h["border-width"]=`${f.getPropertyValue("border-top-width")} ${f.getPropertyValue("border-right-width")} ${f.getPropertyValue("border-bottom-width")} ${f.getPropertyValue("border-left-width")}`);const p={};for(const e of o)p[e]=m[e];const y=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{});"INPUT"!==d&&"TEXTAREA"!==d||!e.value||(y.value&&console.log(`[captureFrame] Overriding element attributes value from ${y.value} to ${e.value}`),y.value=e.value);const w=P(f.getPropertyValue("background-image"));w&&i.add(w);const E=O(e,n),C=s?E:void 0;E&&(y["data-applitools-has-pseudo"]=Object.keys(E).join("_and_"));const T={tagName:d,style:z(h),rect:z(p),attributes:z(y),childNodes:c,pseudo:C};return l&&(T.shadowRoot=l),T}}(t);l(u.doCaptureDoc),i(u.waitForImages),await Promise.all(d),l(u.waitForImages),b.version="1.3.0",b.scriptVersion="11.4.0";const N=m.length?`${m.join("\n")}\n`:"",S=f.size?`${Array.from(f).join("\n")}\n`:"",A=JSON.stringify({separator:g,cssStartToken:p,cssEndToken:p,iframeStartToken:`"${h}`,iframeEndToken:`${h}"`});l(u.total);const Y=`${A}\n${S}${g}\n${N}${g}\n${JSON.stringify(b)}${a?`\n${g}\n${JSON.stringify(u)}`:""}`;return console.log("[captureFrame]",JSON.stringify(u)),Y;function z(e){return Object.keys(e).length?e:void 0}};window[z]=window[z]||{};const J=Y(G,window[z],j);return function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){return JSON.stringify(J(e)(e))}))}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];if("function"!=typeof s)throw new Error("Sandbox failed to extract function");return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}},n=e(t);module.exports=n; | ||
arguments[1]&&(t=arguments[1]),arguments[2]&&(c=arguments[2]),arguments[3]&&(u=arguments[3]),!0===n&&(n=[...getComputedStyle(t.body)]);const i={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function l(e){e.startTime=Date.now()}function d(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const f=[];l(i.total);const m=new Set,h=[],p="@@@@@",g="#####",y="-----";l(i.prefetchCss);const w=L(F(fetch,{fetchTimeLimit:u})),E=await w(t);d(i.prefetchCss);const C=U({parseCss:D,CSSImportRule:CSSImportRule,getCssFromCache:E,absolutizeUrl:R,unfetchedToken:g}),T=I({getCssFromCache:E,absolutizeUrl:R}),b=k({extractCssFromNode:T,getBundledCssFromCssText:C,unfetchedToken:g});l(i.doCaptureDoc);const N=function c(u,i=u.location&&u.location.href){const l=new Set;let d="";const g=y(u.documentElement||u);return g.css=d,f.push(_({bgImages:l}).then((e=>g.images=e))),g;function y(t){if(t.hasAttribute&&t.hasAttribute("data-applitools-skip"))return null;const{bundledCss:n,unfetchedResources:r}=b(t,i);if(d+=n,r)for(const e of r)m.add(e);switch(t.nodeType){case x.TEXT:return function(t){const n=e.createRange();n.selectNode(t);const r=n.getClientRects();return{tagName:"#text",text:t.textContent,rects:r&&r.length&&o.length?Array.from(r).map((e=>{const t={};for(const n of o)t[n]=e[n];return t})):void 0}}(t);case x.ELEMENT:return"IFRAME"===t.tagName.toUpperCase()?function(e){const t=w(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[c(n,$(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=v(e);h.push(n),t.childNodes=[`${p}${n}${p}`]}}(t):w(t);case x.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(t.childNodes,y).filter(Boolean)};default:return null}}function w(e){const u=Array.prototype.map.call(e.childNodes,y).filter(Boolean),d=e.shadowRoot&&c(e.shadowRoot,i),f=e.tagName.toUpperCase();if(s.indexOf(f)>-1)return null;const m=t.defaultView.getComputedStyle(e),h=e.getBoundingClientRect(),p={};for(const e of n)p[e]=m.getPropertyValue(e);!p["border-width"]&&n.includes("border-width")&&(p["border-width"]=`${m.getPropertyValue("border-top-width")} ${m.getPropertyValue("border-right-width")} ${m.getPropertyValue("border-bottom-width")} ${m.getPropertyValue("border-left-width")}`);const g={};for(const e of o)g[e]=h[e];const w=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{});"INPUT"!==f&&"TEXTAREA"!==f||!e.value||(w.value&&console.log(`[captureFrame] Overriding element attributes value from ${w.value} to ${e.value}`),w.value=e.value);const E=P(m.getPropertyValue("background-image"));E&&l.add(E);const C=O(e,n),T=a?C:void 0;C&&(w["data-applitools-has-pseudo"]=Object.keys(C).join("_and_"));const b={};for(const t of r)b[t]=e[t];const N={tagName:f,style:j(p),rect:j(g),attributes:j(w),properties:j(b),childNodes:u,pseudo:T};return d&&(N.shadowRoot=d),N}}(t);d(i.doCaptureDoc),l(i.waitForImages),await Promise.all(f),d(i.waitForImages),N.version="1.3.0",N.scriptVersion="11.5.0";const S=h.length?`${h.join("\n")}\n`:"",A=m.size?`${Array.from(m).join("\n")}\n`:"",Y=JSON.stringify({separator:y,cssStartToken:g,cssEndToken:g,iframeStartToken:`"${p}`,iframeEndToken:`${p}"`});d(i.total);const z=`${Y}\n${A}${y}\n${S}${y}\n${JSON.stringify(N)}${c?`\n${y}\n${JSON.stringify(i)}`:""}`;return console.log("[captureFrame]",JSON.stringify(i)),z;function j(e){return Object.keys(e).length?e:void 0}};window[z]=window[z]||{};const J=Y(G,window[z],j);return function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){return JSON.stringify(J(e)(e))}))}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];if("function"!=typeof s)throw new Error("Sandbox failed to extract function");return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}},n=e(t);module.exports=n; |
@@ -1,2 +0,2 @@ | ||
/* @applitools/dom-capture@11.4.0 */ | ||
/* @applitools/dom-capture@11.5.0 */ | ||
function __pollResult() { | ||
@@ -3,0 +3,0 @@ var pollResult=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e=function(){const t=function(t){return function(){function t(t,e=0){const n=t.charCodeAt(e);return n>=55296&&n<56320?1024*(n-55296)+(t.charCodeAt(e+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var e=function(e,n){const r=[];let o=0;for(let u=0;u<e.length;++u){const c=t(e,u);let a=0;c>0&&(a=c<128?1:c<2048?2:c<65536?3:c<2097152?4:c<67108864?5:6),o+a>n?(r.push(u),o=a):o+=a}return r};const n=e,r="WIP",o="SUCCESS",u="SUCCESS_CHUNKED",c="ERROR";var a=function(t,e,a={}){const i=function(t,{chunkByteLength:e=0}={}){if(t){if(t.value){if(e){if(!t.chunks)try{const r=JSON.stringify(t.value);t.chunks=n(r,e),t.chunks.length>0&&(t.from=0,t.value=r)}catch(t){return{status:c,error:t.message}}if(t.from>=0)return{status:u,value:t.value.substring(t.from,t.from=t.chunks.shift()),done:!t.from}}return{status:o,value:t.value}}return t.error?{status:c,error:t.error}:{status:r}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((t=t||{})[e],a);return(i.status===o||i.status===c||i.status===u&&i.done)&&(t[e]=null),i};const i=a;var l={chunkify:e,pollify:function(t,e,n){return r=>function(){return e[n]||(e[n]={},Promise.resolve().then((()=>t.apply(null,arguments))).then((t=>e[n].value=t)).catch((t=>e[n].error=t.message))),i(e,n,r)}},poll:a,absolutizeUrl:function(t,e){if(function(t){try{return new URL(t),!0}catch(t){return!1}}(t))return t;let n=!0;try{n=t!==decodeURI(t)}catch(t){n=!0}try{const r=new URL(t,e).href;return n?r:decodeURI(r)}catch(e){return n?t:decodeURI(t)}},isInlineFrame:function(t){return t.contentDocument&&t.contentDocument.location&&!/^https?:$/.test(t.contentDocument.location.protocol)},isAccessibleFrame:function(t){try{const e=t.contentDocument;return Boolean(e&&e.defaultView&&e.defaultView.frameElement)}catch(t){return!1}}};const{poll:s}=l,{EYES_NAMESPACE:d,DOM_CAPTURE_KEY:f}={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","font-family","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index","pointer-events","cursor"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};return function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){return JSON.stringify(s(window[d],f,t))}))}()};let e=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const r=window.crypto.getRandomValues(new Uint32Array(1))[0],o=n.contentDocument.createElement("script");o.textContent=`window['ctor-${r}'] = ${t.toString()};`,n.contentDocument.head.appendChild(o);const u=n.contentWindow[`ctor-${r}`];if("function"!=typeof u)throw new Error("Sandbox failed to extract function");return e=!1,u(document).apply(null,arguments)}catch(n){try{return t(document).apply(null,arguments)}catch(t){throw e?t:n}}};return t(e)}(); |
@@ -1,2 +0,2 @@ | ||
/* @applitools/dom-capture@11.4.0 */ | ||
/* @applitools/dom-capture@11.5.0 */ | ||
"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e=function(){const t=function(t){return function(){function t(t,e=0){const n=t.charCodeAt(e);return n>=55296&&n<56320?1024*(n-55296)+(t.charCodeAt(e+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var e=function(e,n){const r=[];let o=0;for(let u=0;u<e.length;++u){const c=t(e,u);let a=0;c>0&&(a=c<128?1:c<2048?2:c<65536?3:c<2097152?4:c<67108864?5:6),o+a>n?(r.push(u),o=a):o+=a}return r};const n=e,r="WIP",o="SUCCESS",u="SUCCESS_CHUNKED",c="ERROR";var a=function(t,e,a={}){const i=function(t,{chunkByteLength:e=0}={}){if(t){if(t.value){if(e){if(!t.chunks)try{const r=JSON.stringify(t.value);t.chunks=n(r,e),t.chunks.length>0&&(t.from=0,t.value=r)}catch(t){return{status:c,error:t.message}}if(t.from>=0)return{status:u,value:t.value.substring(t.from,t.from=t.chunks.shift()),done:!t.from}}return{status:o,value:t.value}}return t.error?{status:c,error:t.error}:{status:r}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((t=t||{})[e],a);return(i.status===o||i.status===c||i.status===u&&i.done)&&(t[e]=null),i};const i=a;var s={chunkify:e,pollify:function(t,e,n){return r=>function(){return e[n]||(e[n]={},Promise.resolve().then((()=>t.apply(null,arguments))).then((t=>e[n].value=t)).catch((t=>e[n].error=t.message))),i(e,n,r)}},poll:a,absolutizeUrl:function(t,e){if(function(t){try{return new URL(t),!0}catch(t){return!1}}(t))return t;let n=!0;try{n=t!==decodeURI(t)}catch(t){n=!0}try{const r=new URL(t,e).href;return n?r:decodeURI(r)}catch(e){return n?t:decodeURI(t)}},isInlineFrame:function(t){return t.contentDocument&&t.contentDocument.location&&!/^https?:$/.test(t.contentDocument.location.protocol)},isAccessibleFrame:function(t){try{const e=t.contentDocument;return Boolean(e&&e.defaultView&&e.defaultView.frameElement)}catch(t){return!1}}};const{poll:l}=s,{EYES_NAMESPACE:d,DOM_CAPTURE_KEY:f}={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","font-family","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index","pointer-events","cursor"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};return function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){return JSON.stringify(l(window[d],f,t))}))}()};let e=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const r=window.crypto.getRandomValues(new Uint32Array(1))[0],o=n.contentDocument.createElement("script");o.textContent=`window['ctor-${r}'] = ${t.toString()};`,n.contentDocument.head.appendChild(o);const u=n.contentWindow[`ctor-${r}`];if("function"!=typeof u)throw new Error("Sandbox failed to extract function");return e=!1,u(document).apply(null,arguments)}catch(n){try{return t(document).apply(null,arguments)}catch(t){throw e?t:n}}},n=t(e);module.exports=n; |
{ | ||
"name": "@applitools/dom-capture", | ||
"version": "11.4.0", | ||
"version": "11.5.0", | ||
"homepage": "https://applitools.com", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
657008
2438