PageSourceSearch

https://www.mooncalc.org/scripts/dom-to-image.min.js?v=1

js mooncalc.org collected 2026-10-02 14:55:25 UTC 15,488 bytes, 32 lines download raw bytes

1var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var f=0;return function(){return f<a.length?{done:!1,value:a[f++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var f="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return f?f.call(a):$jscomp.arrayIterator(a)};
2$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,k){a!=Array.prototype&&a!=Object.prototype&&(a[f]=k.value)};
3$jscomp.polyfill=function(a,f,k,h){if(f){k=$jscomp.global;a=a.split(".");for(h=0;h<a.length-1;h++){var d=a[h];d in k||(k[d]={});k=k[d]}a=a[a.length-1];h=k[a];f=f(h);f!=h&&null!=f&&$jscomp.defineProperty(k,a,{configurable:!0,writable:!0,value:f})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
4$jscomp.polyfill("Promise",function(a){function f(){this.batch_=null}function k(g){return g instanceof d?g:new d(function(a,c){a(g)})}if(a&&!$jscomp.FORCE_POLYFILL_PROMISE)return a;f.prototype.asyncExecute=function(a){if(null==this.batch_){this.batch_=[];var g=this;this.asyncExecuteFunction(function(){g.executeBatch_()})}this.batch_.push(a)};var h=$jscomp.global.setTimeout;f.prototype.asyncExecuteFunction=function(a){h(a,0)};f.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var a=
5this.batch_;this.batch_=[];for(var p=0;p<a.length;++p){var c=a[p];a[p]=null;try{c()}catch(n){this.asyncThrow_(n)}}}this.batch_=null};f.prototype.asyncThrow_=function(a){this.asyncExecuteFunction(function(){throw a;})};var d=function(a){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var g=this.createResolveAndReject_();try{a(g.resolve,g.reject)}catch(c){g.reject(c)}};d.prototype.createResolveAndReject_=function(){function a(a){return function(g){c||(c=!0,a.call(d,g))}}var d=this,c=!1;
6return{resolve:a(this.resolveTo_),reject:a(this.reject_)}};d.prototype.resolveTo_=function(a){if(a===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(a instanceof d)this.settleSameAsPromise_(a);else{a:switch(typeof a){case "object":var g=null!=a;break a;case "function":g=!0;break a;default:g=!1}g?this.resolveToNonPromiseObj_(a):this.fulfill_(a)}};d.prototype.resolveToNonPromiseObj_=function(a){var g=void 0;try{g=a.then}catch(c){this.reject_(c);return}"function"==typeof g?
7this.settleSameAsThenable_(g,a):this.fulfill_(a)};d.prototype.reject_=function(a){this.settle_(2,a)};d.prototype.fulfill_=function(a){this.settle_(1,a)};d.prototype.settle_=function(a,d){if(0!=this.state_)throw Error("Cannot settle("+a+", "+d+"): Promise already settled in state"+this.state_);this.state_=a;this.result_=d;this.executeOnSettledCallbacks_()};d.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var a=0;a<this.onSettledCallbacks_.length;++a)q.asyncExecute(this.onSettledCallbacks_[a]);
8this.onSettledCallbacks_=null}};var q=new f;d.prototype.settleSameAsPromise_=function(a){var d=this.createResolveAndReject_();a.callWhenSettled_(d.resolve,d.reject)};d.prototype.settleSameAsThenable_=function(a,d){var c=this.createResolveAndReject_();try{a.call(d,c.resolve,c.reject)}catch(n){c.reject(n)}};d.prototype.then=function(a,f){function c(a,c){return"function"==typeof a?function(c){try{g(a(c))}catch(b){k(b)}}:c}var g,k,h=new d(function(a,c){g=a;k=c});this.callWhenSettled_(c(a,g),c(f,k));return h};
9d.prototype.catch=function(a){return this.then(void 0,a)};d.prototype.callWhenSettled_=function(a,d){function c(){switch(f.state_){case 1:a(f.result_);break;case 2:d(f.result_);break;default:throw Error("Unexpected state: "+f.state_);}}var f=this;null==this.onSettledCallbacks_?q.asyncExecute(c):this.onSettledCallbacks_.push(c)};d.resolve=k;d.reject=function(a){return new d(function(d,c){c(a)})};d.race=function(a){return new d(function(d,c){for(var f=$jscomp.makeIterator(a),g=f.next();!g.done;g=f.next())k(g.value).callWhenSettled_(d,
10c)})};d.all=function(a){var f=$jscomp.makeIterator(a),c=f.next();return c.done?k([]):new d(function(a,d){function g(c){return function(b){h[c]=b;m--;0==m&&a(h)}}var h=[],m=0;do h.push(void 0),m++,k(c.value).callWhenSettled_(g(h.length-1),d),c=f.next();while(!c.done)})};return d},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
11$jscomp.SymbolClass=function(a,f){this.$jscomp$symbol$id_=a;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:f})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function a(k){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(k||"")+"_"+f++,k)}var f=0;return a}();
12$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
13$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};
14$jscomp.iteratorFromArray=function(a,f){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var k=0,h={next:function(){if(k<a.length){var d=k++;return{value:f(d,a[d]),done:!1}}h.next=function(){return{done:!0,value:void 0}};return h.next()}};h[Symbol.iterator]=function(){return h};return h};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");
15(function(a){function f(a,b){b=b||{};k(b);return Promise.resolve(a).then(function(a){return d(a,b.filter,!0)}).then(q).then(g).then(function(a){b.bgcolor&&(a.style.backgroundColor=b.bgcolor);b.width&&(a.style.width=b.width+"px");b.height&&(a.style.height=b.height+"px");b.style&&Object.keys(b.style).forEach(function(e){a.style[e]=b.style[e]});return a}).then(function(d){return p(d,b.width||c.width(a),b.height||c.height(a))})}function k(a){m.impl.options.imagePlaceholder="undefined"===typeof a.imagePlaceholder?
16u.imagePlaceholder:a.imagePlaceholder;m.impl.options.cacheBust="undefined"===typeof a.cacheBust?u.cacheBust:a.cacheBust}function h(a,b){return f(a,b).then(c.makeImage).then(c.delay(100)).then(function(d){var e=document.createElement("canvas");e.width=b.width||c.width(a);e.height=b.height||c.height(a);if(b.bgcolor){var l=e.getContext("2d");l.fillStyle=b.bgcolor;l.fillRect(0,0,e.width,e.height)}l=e.getContext("2d");l.drawImage(d,0,0);l.fillStyle="black";l.strokeStyle="white";l.lineWidth=5;l.font="13px sans-serif";
17l.strokeText(b.text1,5,17);l.fillText(b.text1,5,17);l.strokeText(b.text2,5,34);l.fillText(b.text2,5,34);return e})}function d(a,b,w){function e(a,e,b){a=a.childNodes;return 0===a.length?Promise.resolve(e):function(a,e,c){var b=Promise.resolve();e.forEach(function(e){b=b.then(function(){return d(e,c)}).then(function(e){e&&a.appendChild(e)})});return b}(e,c.asArray(a),b).then(function(){return e})}function l(a,e){return e instanceof Element?Promise.resolve().then(function(){(function(a,e){function b(a,
18e){c.asArray(a).forEach(function(b){e.setProperty(b,a.getPropertyValue(b),a.getPropertyPriority(b))})}a.cssText?e.cssText=a.cssText:b(a,e)})(window.getComputedStyle(a),e.style)}).then(function(){function b(b){var l=window.getComputedStyle(a,b),d=l.getPropertyValue("content");if(""!==d&&"none"!==d){d=c.uid();e.className=e.className+" "+d;var r=document.createElement("style");r.appendChild(function(a,e,b){function l(a){var e=a.getPropertyValue("content");return a.cssText+" content: "+e+";"}function d(a){return c.asArray(a).map(function(e){return e+
19": "+a.getPropertyValue(e)+(a.getPropertyPriority(e)?" !important":"")}).join("; ")+";"}a="."+a+":"+e;b=b.cssText?l(b):d(b);return document.createTextNode(a+"{"+b+"}")}(d,b,l));e.appendChild(r)}}[":before",":after"].forEach(function(a){b(a)})}).then(function(){a instanceof HTMLTextAreaElement&&(e.innerHTML=a.value);a instanceof HTMLInputElement&&e.setAttribute("value",a.value)}).then(function(){e instanceof SVGElement&&(e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e instanceof SVGRectElement&&
20["width","height"].forEach(function(a){var b=e.getAttribute(a);b&&e.style.setProperty(a,b)}))}).then(function(){return e}):e}return w||!b||b(a)?Promise.resolve(a).then(function(a){return a instanceof HTMLCanvasElement?c.makeImage(a.toDataURL()):a.cloneNode(!1)}).then(function(c){return e(a,c,b)}).then(function(e){return l(a,e)}):Promise.resolve()}function q(a){return t.resolveAll().then(function(b){var c=document.createElement("style");a.appendChild(c);c.appendChild(document.createTextNode(b));return a})}
21function g(a){return v.inlineAll(a).then(function(){return a})}function p(a,b,d){return Promise.resolve(a).then(function(a){a.setAttribute("xmlns","http://www.w3.org/1999/xhtml");return(new XMLSerializer).serializeToString(a)}).then(c.escapeXhtml).then(function(a){return'<foreignObject x="0" y="0" width="100%" height="100%">'+a+"</foreignObject>"}).then(function(a){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+b+'" height="'+d+'">'+a+"</svg>"}).then(function(a){return"data:image/svg+xml;charset=utf-8,"+
22a})}var c=function(){function a(a){return(a=/\.([^\.\/]*?)$/g.exec(a))?a[1]:""}function b(a){return new Promise(function(e){for(var b=window.atob(a.toDataURL().split(",")[1]),c=b.length,d=new Uint8Array(c),l=0;l<c;l++)d[l]=b.charCodeAt(l);e(new Blob([d],{type:"image/png"}))})}function c(a,b){a=window.getComputedStyle(a).getPropertyValue(b);return parseFloat(a.replace("px",""))}return{escape:function(a){return a.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:a,mimeType:function(e){return{woff:"application/font-woff",
23woff2:"application/font-woff",ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}[a(e).toLowerCase()]||""},dataAsUrl:function(a,b){return"data:"+b+";base64,"+a},isDataUrl:function(a){return-1!==a.search(/^(data:)/)},canvasToBlob:function(a){return a.toBlob?new Promise(function(e){a.toBlob(e)}):b(a)},resolveUrl:function(a,b){var e=document.implementation.createHTMLDocument(),c=
24e.createElement("base");e.head.appendChild(c);var d=e.createElement("a");e.body.appendChild(d);c.href=b;d.href=a;return d.href},getAndEncode:function(a){m.impl.options.cacheBust&&(a+=(/\?/.test(a)?"&":"?")+(new Date).getTime());return new Promise(function(e){var b=new XMLHttpRequest;b.onreadystatechange=function(){if(4===b.readyState)if(200!==b.status)c?e(c):(console.error("cannot fetch resource: "+a+", status: "+b.status),e(""));else{var d=new FileReader;d.onloadend=function(){var a=d.result.split(/,/)[1];
25e(a)};d.readAsDataURL(b.response)}};b.ontimeout=function(){c?e(c):(console.error("timeout of 30000ms occured while fetching resource: "+a),e(""))};b.responseType="blob";b.timeout=3E4;b.open("GET",a,!0);b.send();var c;if(m.impl.options.imagePlaceholder){var d=m.impl.options.imagePlaceholder.split(/,/);d&&d[1]&&(c=d[1])}})},uid:function(){var a=0;return function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+a++}}(),delay:function(a){return function(b){return new Promise(function(e){setTimeout(function(){e(b)},
26a)})}},asArray:function(a){for(var b=[],e=a.length,c=0;c<e;c++)b.push(a[c]);return b},escapeXhtml:function(a){return a.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(a){return new Promise(function(b,e){var c=new Image;c.onload=function(){b(c)};c.onerror=e;c.src=a})},width:function(a){var b=c(a,"border-left-width"),e=c(a,"border-right-width");return a.scrollWidth+b+e},height:function(a){var b=c(a,"border-top-width"),e=c(a,"border-bottom-width");return a.scrollHeight+b+e}}}(),n=function(){function a(a){return-1!==
27a.search(e)}function b(a){for(var b=[],d;null!==(d=e.exec(a));)b.push(d[1]);return b.filter(function(a){return!c.isDataUrl(a)})}function d(a,b,e,d){return Promise.resolve(b).then(function(a){return e?c.resolveUrl(a,e):a}).then(d||c.getAndEncode).then(function(a){return c.dataAsUrl(a,c.mimeType(b))}).then(function(e){return a.replace(new RegExp("(url\\(['\"]?)("+c.escape(b)+")(['\"]?\\))","g"),"$1"+e+"$3")})}var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,c,f){return a(e)?Promise.resolve(e).then(b).then(function(a){var b=
28Promise.resolve(e);a.forEach(function(a){b=b.then(function(b){return d(b,a,c,f)})});return b}):Promise.resolve(e)},shouldProcess:a,impl:{readUrls:b,inline:d}}}(),t=function(){function a(){function a(a){return{resolve:function(){return n.inlineAll(a.cssText,(a.parentStyleSheet||{}).href)},src:function(){return a.style.getPropertyValue("src")}}}return Promise.resolve(c.asArray(document.styleSheets)).then(function(a){var b=[];a.forEach(function(a){try{c.asArray(a.cssRules||[]).forEach(b.push.bind(b))}catch(r){console.log("Error while reading CSS rules from "+
29a.href,r.toString())}});return b}).then(function(a){return a.filter(function(a){return a.type===CSSRule.FONT_FACE_RULE}).filter(function(a){return n.shouldProcess(a.style.getPropertyValue("src"))})}).then(function(b){return b.map(a)})}return{resolveAll:function(){return a(document).then(function(a){return Promise.all(a.map(function(a){return a.resolve()}))}).then(function(a){return a.join("\n")})},impl:{readAll:a}}}(),v=function(){function a(a){return{inline:function(b){return c.isDataUrl(a.src)?
30Promise.resolve():Promise.resolve(a.src).then(b||c.getAndEncode).then(function(b){return c.dataAsUrl(b,c.mimeType(a.src))}).then(function(b){return new Promise(function(c,e){a.onload=c;a.onerror=e;a.src=b})})}}}function b(d){return d instanceof Element?function(a){var b=a.style.getPropertyValue("background");return b?n.inlineAll(b).then(function(b){a.style.setProperty("background",b,a.style.getPropertyPriority("background"))}).then(function(){return a}):Promise.resolve(a)}(d).then(function(){return d instanceof
31HTMLImageElement?a(d).inline():Promise.all(c.asArray(d.childNodes).map(function(a){return b(a)}))}):Promise.resolve(d)}return{inlineAll:b,impl:{newImage:a}}}(),u={imagePlaceholder:void 0,cacheBust:!1},m={toSvg:f,toPng:function(a,b){return h(a,b||{}).then(function(a){return a.toDataURL()})},toJpeg:function(a,b){b=b||{};return h(a,b).then(function(a){return a.toDataURL("image/jpeg",b.quality||1)})},toBlob:function(a,b){return h(a,b||{}).then(c.canvasToBlob)},toPixelData:function(a,b){return h(a,b||
32{}).then(function(b){return b.getContext("2d").getImageData(0,0,c.width(a),c.height(a)).data})},impl:{fontFaces:t,images:v,util:c,inliner:n,options:{}}};
32"undefined"!==typeof module?module.exports=m:a.domtoimage=m})(this);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.