oont-contents/plugins/jetpack-boost/app/modules/image-guide/dist/guide.js
2025-02-10 13:57:45 +01:00

2 lines
No EOL
48 KiB
JavaScript

(()=>{var e={941:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(212)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},212:(e,t,n)=>{e.exports=function(e){function t(e){let n,i,r,s=null;function c(...e){if(!c.enabled)return;const o=c,i=Number(new Date),r=i-(n||i);o.diff=r,o.prev=n,o.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const r=t.formatters[i];if("function"==typeof r){const t=e[s];n=r.call(o,t),e.splice(s,1),s--}return n})),t.formatArgs.call(o,e);(o.log||t.log).apply(o,e)}return c.namespace=e,c.useColors=t.useColors(),c.color=t.selectColor(e),c.extend=o,c.destroy=t.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,r=t.enabled(e)),r),set:e=>{s=e}}),"function"==typeof t.init&&t.init(c),c}function o(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function i(e,t){let n=0,o=0,i=-1,r=0;for(;n<e.length;)if(o<t.length&&(t[o]===e[n]||"*"===t[o]))"*"===t[o]?(i=o,r=n,o++):(n++,o++);else{if(-1===i)return!1;o=i+1,r++,n=r}for(;o<t.length&&"*"===t[o];)o++;return o===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(i(e,n))return!1;for(const n of t.names)if(i(e,n))return!0;return!1},t.humanize=n(997),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},997:e=>{var t=1e3,n=60*t,o=60*n,i=24*o,r=7*i,s=365.25*i;function c(e,t,n,o){var i=t>=1.5*n;return Math.round(e/n)+" "+o+(i?"s":"")}e.exports=function(e,a){a=a||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!c)return;var a=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"weeks":case"week":case"w":return a*r;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===l&&isFinite(e))return a.long?function(e){var r=Math.abs(e);if(r>=i)return c(e,r,i,"day");if(r>=o)return c(e,r,o,"hour");if(r>=n)return c(e,r,n,"minute");if(r>=t)return c(e,r,t,"second");return e+" ms"}(e):function(e){var r=Math.abs(e);if(r>=i)return Math.round(e/i)+"d";if(r>=o)return Math.round(e/o)+"h";if(r>=n)return Math.round(e/n)+"m";if(r>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},372:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(941);const i=n.n(o)()("dops:analytics");let r,s;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const c={initialize:function(e,t,n){c.setUser(e,t),c.setSuperProps(n),c.identifyUser()},setGoogleAnalyticsEnabled:function(e,t=null){this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){s={ID:e,username:t}},setSuperProps:function(e){r=e},assignSuperProps:function(e){r=Object.assign(r||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);i("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),i('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);c.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);i("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),i('Built stat "%s" in group "%s"',t,e);return n}(e,t);c.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){c.tracks.recordPageView(e),c.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,o,i,r,s){c.ga.recordPurchase(e,t,n,o,i,r,s)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(r&&(i("- Super Props: %o",r),t=Object.assign(t,r)),i('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):i('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};c.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){c.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){i("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};c.ga.initialized||(s&&(e={userId:"u-"+s.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),c.ga.initialized=!0)},recordPageView:function(e,t){c.ga.initialize(),i("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,o){c.ga.initialize();let r="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(r+=" [Option Label: "+n+"]"),void 0!==o&&(r+=" [Option Value: "+o+"]"),i(r),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,o)},recordPurchase:function(e,t,n,o,i,r,s){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:o,currency:s}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:i,quantity:r}),window.ga("ecommerce:send")}},identifyUser:function(){s&&window._tkq.push(["identifyUser",s.ID,s.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},a=c},133:(e,t,n)=>{"use strict";n.d(t,{zI:()=>i});var o=n(372);async function i(e,t){t=r(t),o.A.tracks.recordEvent(`jetpack_boost_${e}`,t)}function r(e){const t={};return"object"==typeof Jetpack_Boost&&(t.boost_version=Jetpack_Boost.version),{...t,...e}}},499:(e,t,n)=>{"use strict";function o(e){return new URL(e).origin===window.location.origin}n.d(t,{J:()=>o})},348:(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n(723);const __=o.__;class i extends Error{constructor(e){super(e),this.name="AdminAjaxError"}}async function r(e,t=ajaxurl){const n={method:"post",body:new URLSearchParams(e),headers:{"Content-Type":"application/x-www-form-urlencoded"}},r=await fetch(t,n);if(!r.ok)throw new i((0,o.sprintf)(/* Translators: %d refers to an HTTP error code */
__("Received HTTP %d while communicating with your WordPress site","jetpack-boost"),r.status));return r}},723:e=>{"use strict";e.exports=window.wp.i18n},482:(e,t,n)=>{"use strict";n.d(t,{zo:()=>Kt});class o{constructor(e,t,n=null){this.node=e,this.getURLCallback=t,this.fetch=null!=n?n:window.fetch.bind(window)}getURL(){return this.getURLCallback(this.node)}getSizeOnPage(){const{width:e,height:t}=this.node.getBoundingClientRect();return{width:Math.round(e),height:Math.round(t)}}async getFileSize(e){const[t,{width:n,height:o}]=await Promise.all([this.fetchFileWeight(e),this.fetchFileDimensions(e)]);return{width:n,height:o,weight:t}}getPotentialSavings(e,t){const n=this.getOversizedRatio(e,t);return n<=1?null:Math.round(e.weight-e.weight/n)}getExpectedSize(e){const t=window.devicePixelRatio||1;return{width:Math.round(e.width*t),height:Math.round(e.height*t)}}getOversizedRatio(e,t){if(0===e.width||0===e.height)return 1;const{width:n,height:o}=this.getExpectedSize(t);return 0===n||0===o?1:e.width*e.height/(n*o)}async fetchFileWeight(e){const t=await this.fetch(e);return t.ok?parseInt(t.headers.get("content-length"),10)/1024:(console.log(`Can't get image size for ${e} likely due to a CORS error.`),-1)}async fetchFileDimensions(e){const t=new Image;return t.src=e,new Promise(((e,n)=>{t.onload=()=>{e({width:Math.round(t.width),height:Math.round(t.height)})},t.onerror=()=>{n("Unable to load image.")}}))}async isImageTiny(){try{const e=65,t=await this.fetchFileDimensions(this.getURL());return t.width<e||t.height<e}catch{return!0}}}function i(){}const r=e=>e;function s(e){return e()}function c(){return Object.create(null)}function a(e){e.forEach(s)}function l(e){return"function"==typeof e}function u(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let d;function f(e,t){return e===t||(d||(d=document.createElement("a")),d.href=t,e===d.href)}function p(e,...t){if(null==e){for(const e of t)e(void 0);return i}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function h(e){let t;return p(e,(e=>t=e))(),t}function g(e,t,n){e.$$.on_destroy.push(p(t,n))}function m(e,t,n,o){return e[1]&&o?function(e,t){for(const n in t)e[n]=t[n];return e}(n.ctx.slice(),e[1](o(t))):n.ctx}function w(e){const t="string"==typeof e&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}const v="undefined"!=typeof window;let y=v?()=>window.performance.now():()=>Date.now(),$=v?e=>requestAnimationFrame(e):i;const b=new Set;function C(e){b.forEach((t=>{t.c(e)||(b.delete(t),t.f())})),0!==b.size&&$(C)}function k(e){let t;return 0===b.size&&$(C),{promise:new Promise((n=>{b.add(t={c:e,f:n})})),abort(){b.delete(t)}}}function x(e,t){e.appendChild(t)}function _(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function F(e){const t=S("style");return t.textContent="/* empty */",function(e,t){x(e.head||e,t),t.sheet}(_(e),t),t.sheet}function z(e,t,n){e.insertBefore(t,n||null)}function E(e){e.parentNode&&e.parentNode.removeChild(e)}function S(e){return document.createElement(e)}function j(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function I(e){return document.createTextNode(e)}function O(){return I(" ")}function P(){return I("")}function A(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function L(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function R(e,t){t=""+t,e.data!==t&&(e.data=t)}function M(e,t,n,o){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,o?"important":"")}function T(e,t,n){e.classList.toggle(t,!!n)}function U(e,t,{bubbles:n=!1,cancelable:o=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:o})}const B=new Map;let D,N=0;function H(e,t,n,o,i,r,s,c=0){const a=16.666/o;let l="{\n";for(let e=0;e<=1;e+=a){const o=t+(n-t)*r(e);l+=100*e+`%{${s(o,1-o)}}\n`}const u=l+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}(u)}_${c}`,f=_(e),{stylesheet:p,rules:h}=B.get(f)||function(e,t){const n={stylesheet:F(t),rules:{}};return B.set(e,n),n}(f,e);h[d]||(h[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=e.style.animation||"";return e.style.animation=`${g?`${g}, `:""}${d} ${o}ms linear ${i}ms 1 both`,N+=1,d}function q(e,t){const n=(e.style.animation||"").split(", "),o=n.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),i=n.length-o.length;i&&(e.style.animation=o.join(", "),N-=i,N||$((()=>{N||(B.forEach((e=>{const{ownerNode:t}=e.stylesheet;t&&E(t)})),B.clear())})))}function V(e){D=e}function W(){if(!D)throw new Error("Function called outside component initialization");return D}function J(e){W().$$.on_mount.push(e)}function G(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e.call(this,t)))}const Z=[],K=[];let X=[];const Y=[],Q=Promise.resolve();let ee=!1;function te(e){X.push(e)}const ne=new Set;let oe,ie=0;function re(){if(0!==ie)return;const e=D;do{try{for(;ie<Z.length;){const e=Z[ie];ie++,V(e),se(e.$$)}}catch(e){throw Z.length=0,ie=0,e}for(V(null),Z.length=0,ie=0;K.length;)K.pop()();for(let e=0;e<X.length;e+=1){const t=X[e];ne.has(t)||(ne.add(t),t())}X.length=0}while(Z.length);for(;Y.length;)Y.pop()();ee=!1,ne.clear(),V(e)}function se(e){if(null!==e.fragment){e.update(),a(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(te)}}function ce(){return oe||(oe=Promise.resolve(),oe.then((()=>{oe=null}))),oe}function ae(e,t,n){e.dispatchEvent(U(`${t?"intro":"outro"}${n}`))}const le=new Set;let ue;function de(){ue={r:0,c:[],p:ue}}function fe(){ue.r||a(ue.c),ue=ue.p}function pe(e,t){e&&e.i&&(le.delete(e),e.i(t))}function he(e,t,n,o){if(e&&e.o){if(le.has(e))return;le.add(e),ue.c.push((()=>{le.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}else o&&o()}const ge={duration:0};function me(e,t,n){const o={direction:"in"};let s,c,a=t(e,n,o),u=!1,d=0;function f(){s&&q(e,s)}function p(){const{delay:t=0,duration:n=300,easing:o=r,tick:l=i,css:p}=a||ge;p&&(s=H(e,0,1,n,t,o,p,d++)),l(0,1);const h=y()+t,g=h+n;c&&c.abort(),u=!0,te((()=>ae(e,!0,"start"))),c=k((t=>{if(u){if(t>=g)return l(1,0),ae(e,!0,"end"),f(),u=!1;if(t>=h){const e=o((t-h)/n);l(e,1-e)}}return u}))}let h=!1;return{start(){h||(h=!0,q(e),l(a)?(a=a(o),ce().then(p)):p())},invalidate(){h=!1},end(){u&&(f(),u=!1)}}}function we(e,t,n,o){let s,c=t(e,n,{direction:"both"}),u=o?0:1,d=null,f=null,p=null;function h(){p&&q(e,p)}function g(e,t){const n=e.b-u;return t*=Math.abs(n),{a:u,b:e.b,d:n,duration:t,start:e.start,end:e.start+t,group:e.group}}function m(t){const{delay:n=0,duration:o=300,easing:l=r,tick:m=i,css:w}=c||ge,v={start:y()+n,b:t};t||(v.group=ue,ue.r+=1),"inert"in e&&(t?void 0!==s&&(e.inert=s):(s=e.inert,e.inert=!0)),d||f?f=v:(w&&(h(),p=H(e,u,t,o,n,l,w)),t&&m(0,1),d=g(v,o),te((()=>ae(e,t,"start"))),k((t=>{if(f&&t>f.start&&(d=g(f,o),f=null,ae(e,d.b,"start"),w&&(h(),p=H(e,u,d.b,d.duration,0,l,c.css))),d)if(t>=d.end)m(u=d.b,1-u),ae(e,d.b,"end"),f||(d.b?h():--d.group.r||a(d.group.c)),d=null;else if(t>=d.start){const e=t-d.start;u=d.a+d.d*l(e/d.duration),m(u,1-u)}return!(!d&&!f)})))}return{run(e){l(c)?ce().then((()=>{c=c({direction:e?"in":"out"}),m(e)})):m(e)},end(){h(),d=f=null}}}function ve(e){return void 0!==e?.length?e:Array.from(e)}function ye(e){e&&e.c()}function $e(e,t,n){const{fragment:o,after_update:i}=e.$$;o&&o.m(t,n),te((()=>{const t=e.$$.on_mount.map(s).filter(l);e.$$.on_destroy?e.$$.on_destroy.push(...t):a(t),e.$$.on_mount=[]})),i.forEach(te)}function be(e,t){const n=e.$$;null!==n.fragment&&(function(e){const t=[],n=[];X.forEach((o=>-1===e.indexOf(o)?t.push(o):n.push(o))),n.forEach((e=>e())),X=t}(n.after_update),a(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Ce(e,t,n,o,r,s,l=null,u=[-1]){const d=D;V(e);const f=e.$$={fragment:null,ctx:[],props:s,update:i,not_equal:r,bound:c(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(d?d.$$.context:[])),callbacks:c(),dirty:u,skip_bound:!1,root:t.target||d.$$.root};l&&l(f.root);let p=!1;if(f.ctx=n?n(e,t.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return f.ctx&&r(f.ctx[t],f.ctx[t]=i)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](i),p&&function(e,t){-1===e.$$.dirty[0]&&(Z.push(e),ee||(ee=!0,Q.then(re)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],f.update(),p=!0,a(f.before_update),f.fragment=!!o&&o(f.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);f.fragment&&f.fragment.l(e),e.forEach(E)}else f.fragment&&f.fragment.c();t.intro&&pe(e.$$.fragment),$e(e,t.target,t.anchor),re()}V(d)}class ke{$$=void 0;$$set=void 0;$destroy(){be(this,1),this.$destroy=i}$on(e,t){if(!l(t))return i;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const xe=[];function _e(e,t=i){let n;const o=new Set;function r(t){if(u(e,t)&&(e=t,n)){const t=!xe.length;for(const t of o)t[1](),xe.push(t,e);if(t){for(let e=0;e<xe.length;e+=2)xe[e][0](xe[e+1]);xe.length=0}}}function s(t){r(t(e))}return{set:r,update:s,subscribe:function(c,a=i){const l=[c,a];return o.add(l),1===o.size&&(n=t(r,s)||i),c(e),()=>{o.delete(l),0===o.size&&n&&(n(),n=null)}}}}function Fe(e,t,n){const o=!Array.isArray(e),r=o?[e]:e;if(!r.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=t.length<2;return c=(e,n)=>{let c=!1;const u=[];let d=0,f=i;const h=()=>{if(d)return;f();const r=t(o?u[0]:u,e,n);s?e(r):f=l(r)?r:i},g=r.map(((e,t)=>p(e,(e=>{u[t]=e,d&=~(1<<t),c&&h()}),(()=>{d|=1<<t}))));return c=!0,h(),function(){a(g),f(),c=!1}},{subscribe:_e(n,c).subscribe};var c}const ze="jetpack-boost-guide",Ee={active:"Active",paused:"Paused"};let Se=localStorage.getItem(ze);Se&&Ee[Se]||(localStorage.setItem(ze,"Active"),Se="active");const{set:je,update:Ie,subscribe:Oe}=_e(Se);Oe((e=>{localStorage.setItem(ze,e)}));const Pe={subscribe:Oe,set:je,update:Ie,cycle:()=>{Ie((e=>{const t=Object.keys(Ee),n=t.indexOf(e);return t[(n+1)%t.length]}))}},Ae=Fe(Pe,(e=>Ee[e]));class Le{constructor(e){this.loading=_e(!0),this.currentSrc="",this.image=e,this.node=e.node,this.url=_e(e.getURL()),this.fileSize=_e({width:0,height:0,weight:0}),this.sizeOnPage=_e({width:0,height:0}),this.potentialSavings=this.derivePotentialSavings(),this.oversizedRatio=this.deriveOversizedRatio(),this.expectedSize=this.deriveExpectedSize()}deriveOversizedRatio(){return Fe([this.fileSize,this.sizeOnPage],(([e,t])=>this.image.getOversizedRatio(e,t)))}deriveExpectedSize(){return Fe(this.sizeOnPage,(e=>this.image.getExpectedSize(e)))}derivePotentialSavings(){return Fe([this.fileSize,this.sizeOnPage],(([e,t])=>this.image.getPotentialSavings(e,t)))}async updateDimensions(){const e=this.image.getSizeOnPage();this.sizeOnPage.set(e),await this.maybeUpdateWeight()}async maybeUpdateWeight(){if(this.image.getURL()===this.currentSrc)return;let e;this.loading.set(!0),this.currentSrc=this.image.getURL();try{e=await this.image.getFileSize(this.currentSrc)}catch{e={weight:-1,height:-1,width:-1}}this.url.set(this.currentSrc),this.fileSize.set(e),this.loading.set(!1)}}class Re{static setTracksCallback(e){Re.tracksCallback=e}static async trackImageOutcome(e){return new Promise((t=>{e.loading.subscribe((n=>{if(!n){const n=h(e.oversizedRatio),o=function(e){return e>4?"red":e>2.5?"yellow":"green"}(n),i=h(e.fileSize),r=h(e.sizeOnPage),s=h(e.expectedSize),c=h(e.potentialSavings),a=h(e.url),l={severity:o,oversized_ratio:n,file_weight:i.weight,file_width:i.width,file_height:i.height,size_on_page_width:r.width,size_on_page_height:r.height,expected_width:s.width,expected_height:s.height,potential_savings:c,image_url:a};Re.tracksCallback("image_guide_image_outcome",{...l,window_width:window.innerWidth,window_height:window.innerHeight,device_pixel_ratio:window.devicePixelRatio}),t(l)}}))}))}static async trackPage(e){if(!e.length||Re.trackingComplete)return;Re.trackingComplete=!0;const t=e.map(Re.trackImageOutcome),n=await Promise.all(t),o=n.reduce(((e,t)=>e+(t.potential_savings||0)),0);Re.tracksCallback("image_guide_page_outcome",{total_potential_savings:o,red_severity_count:n.filter((e=>"red"===e.severity)).length,yellow_severity_count:n.filter((e=>"yellow"===e.severity)).length,green_severity_count:n.filter((e=>"green"===e.severity)).length,window_width:window.innerWidth,window_height:window.innerHeight,device_pixel_ratio:window.devicePixelRatio})}static trackInitialState(){Re.tracksCallback("image_guide_initial_ui_state",{image_guide_state:h(Pe)})}static trackUIStateChange(){Re.tracksCallback("image_guide_ui_state_change",{image_guide_state:h(Pe)})}}function Me(e){return Be(e.currentSrc)?e.currentSrc:Be(e.src)?e.src:null}function Te(e){const t=getComputedStyle(e).backgroundImage.match(/url\(\s*(['"])(.*?)\1\s*\)/i),n=window.location.href.split("#")[0];return t&&t[2]&&t[2]!==n&&Be(t[2])?t[2]:null}async function Ue(e,t=null){return function(e){return e.filter((e=>{if(e instanceof HTMLImageElement){if(!e.src.trim())return!1;try{if(t=e.src,new URL(t).pathname.toLowerCase().endsWith(".svg"))return!1}catch{return!1}return!0}var t;return e instanceof HTMLElement&&"none"!==getComputedStyle(e).backgroundImage}))}(e).map((e=>e instanceof HTMLImageElement?new o(e,Me,t):e instanceof HTMLElement&&Te(e)?new o(e,Te):null)).filter((e=>null!==e))}function Be(e){if(e.startsWith("/"))return!e.split("?")[0].endsWith(".svg");try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}function De(e){const t=1.70158;return--e*e*((t+1)*e+t)+1}function Ne(e){const t=e-1;return t*t*t+1}function He(e,{delay:t=0,duration:n=400,easing:o=r}={}){const i=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:o,css:e=>"opacity: "+e*i}}function qe(e,{delay:t=0,duration:n=400,easing:o=Ne,x:i=0,y:r=0,opacity:s=0}={}){const c=getComputedStyle(e),a=+c.opacity,l="none"===c.transform?"":c.transform,u=a*(1-s),[d,f]=w(i),[p,h]=w(r);return{delay:t,duration:n,easing:o,css:(e,t)=>`\n\t\t\ttransform: ${l} translate(${(1-e)*d}${f}, ${(1-e)*p}${h});\n\t\t\topacity: ${a-u*t}`}}function Ve(e){let t,n,o,r,s;return{c(){t=S("div"),n=j("svg"),o=j("path"),r=j("path"),s=j("path"),L(o,"d","M55.4 107.8C84.3397 107.8 107.8 84.3397 107.8 55.4C107.8 26.4603 84.3397 3 55.4 3C26.4603 3 3 26.4603 3 55.4C3 84.3397 26.4603 107.8 55.4 107.8Z"),L(o,"fill",e[1]),L(r,"d","M58 46.6V97.4L84.2 46.6H58Z"),L(r,"fill","white"),L(s,"d","M52.7 64.1V13.4L26.6 64.1H52.7Z"),L(s,"fill","white"),L(n,"viewBox","0 0 110 110"),L(n,"fill","none"),L(n,"xmlns","http://www.w3.org/2000/svg"),M(t,"width",e[0]+"px"),M(t,"height",e[0]+"px"),L(t,"class","svelte-f6jc8")},m(e,i){z(e,t,i),x(t,n),x(n,o),x(n,r),x(n,s)},p(e,[n]){2&n&&L(o,"fill",e[1]),1&n&&M(t,"width",e[0]+"px"),1&n&&M(t,"height",e[0]+"px")},i:i,o:i,d(e){e&&E(t)}}}function We(e,t,n){let{size:o=16}=t,{bg:i="#069E08"}=t;return e.$$set=e=>{"size"in e&&n(0,o=e.size),"bg"in e&&n(1,i=e.bg)},[o,i]}Re.trackingComplete=!1,"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class Je extends ke{constructor(e){super(),Ce(this,e,We,Ve,u,{size:0,bg:1})}}function Ge(e){let t,n,o,s;return n=new Je({props:{size:12,bg:"transparent"}}),{c(){t=S("div"),ye(n.$$.fragment),L(t,"class","spinner svelte-2eb8gc")},m(e,o){z(e,t,o),$e(n,t,null),s=!0},p:i,i(e){s||(pe(n.$$.fragment,e),o&&o.end(1),s=!0)},o(e){he(n.$$.fragment,e),e&&(o=function(e,t){const n={direction:"out"};let o,s=t(e,{duration:300},n),c=!0;const u=ue;let d;function f(){const{delay:t=0,duration:n=300,easing:l=r,tick:f=i,css:p}=s||ge;p&&(o=H(e,1,0,n,t,l,p));const h=y()+t,g=h+n;te((()=>ae(e,!1,"start"))),"inert"in e&&(d=e.inert,e.inert=!0),k((t=>{if(c){if(t>=g)return f(0,1),ae(e,!1,"end"),--u.r||a(u.c),!1;if(t>=h){const e=l((t-h)/n);f(1-e,e)}}return c}))}return u.r+=1,l(s)?ce().then((()=>{s=s(n),f()})):f(),{end(t){t&&"inert"in e&&(e.inert=d),t&&s.tick&&s.tick(1,0),c&&(o&&q(e,o),c=!1)}}}(t,He)),s=!1},d(e){e&&E(t),be(n),e&&o&&o.end()}}}class Ze extends ke{constructor(e){super(),Ce(this,e,null,Ge,u,{})}}function Ke(e){let t,n;return{c(){t=j("svg"),n=j("path"),L(n,"stroke-linecap","round"),L(n,"stroke-linejoin","round"),L(n,"stroke-width","2"),L(n,"d","M5 13l4 4L19 7"),L(t,"class","w-6 h-6 svelte-jkeb2"),L(t,"fill","none"),L(t,"stroke","white"),L(t,"width","18"),L(t,"height","18"),L(t,"viewBox","0 0 24 24"),L(t,"xmlns","http://www.w3.org/2000/svg")},m(e,o){z(e,t,o),x(t,n)},p:i,i:i,o:i,d(e){e&&E(t)}}}class Xe extends ke{constructor(e){super(),Ce(this,e,null,Ke,u,{})}}function Ye(e){let t,n,o;return n=new Ze({}),{c(){t=S("div"),ye(n.$$.fragment),L(t,"class","bubble-inner svelte-18vhu7m")},m(e,i){z(e,t,i),$e(n,t,null),o=!0},p:i,i(e){o||(pe(n.$$.fragment,e),o=!0)},o(e){he(n.$$.fragment,e),o=!1},d(e){e&&E(t),be(n)}}}function Qe(e){let t,n,o,i,r,s;const c=[nt,tt,et],a=[];function l(e,t){return e[0]>9?0:e[0]>.99?1:2}return o=l(e),i=a[o]=c[o](e),{c(){t=S("div"),n=S("div"),i.c(),L(n,"class","label"),L(t,"class","bubble-inner svelte-18vhu7m")},m(e,i){z(e,t,i),x(t,n),a[o].m(n,null),s=!0},p(e,t){let r=o;o=l(e),o===r?a[o].p(e,t):(de(),he(a[r],1,1,(()=>{a[r]=null})),fe(),i=a[o],i?i.p(e,t):(i=a[o]=c[o](e),i.c()),pe(i,1),i.m(n,null))},i(e){s||(pe(i),e&&(r||te((()=>{r=me(n,He,{delay:200,duration:300}),r.start()}))),s=!0)},o(e){he(i),s=!1},d(e){e&&E(t),a[o].d()}}}function et(e){let t,n;return{c(){t=S("span"),t.textContent="<",n=I(" 1x"),M(t,"font-size","0.75em")},m(e,o){z(e,t,o),z(e,n,o)},p:i,i:i,o:i,d(e){e&&(E(t),E(n))}}}function tt(e){let t,n,o,i;const r=[it,ot],s=[];function c(e,t){return"normal"===e[1]?0:1}return t=c(e),n=s[t]=r[t](e),{c(){n.c(),o=P()},m(e,n){s[t].m(e,n),z(e,o,n),i=!0},p(e,i){let a=t;t=c(e),t===a?s[t].p(e,i):(de(),he(s[a],1,1,(()=>{s[a]=null})),fe(),n=s[t],n?n.p(e,i):(n=s[t]=r[t](e),n.c()),pe(n,1),n.m(o.parentNode,o))},i(e){i||(pe(n),i=!0)},o(e){he(n),i=!1},d(e){e&&E(o),s[t].d(e)}}}function nt(e){let t,n,o=Math.floor(e[0])+"";return{c(){t=I(o),n=I("x")},m(e,o){z(e,t,o),z(e,n,o)},p(e,n){1&n&&o!==(o=Math.floor(e[0])+"")&&R(t,o)},i:i,o:i,d(e){e&&(E(t),E(n))}}}function ot(e){let t,n,o=e[0].toFixed(1)+"";return{c(){t=I(o),n=I("x")},m(e,o){z(e,t,o),z(e,n,o)},p(e,n){1&n&&o!==(o=e[0].toFixed(1)+"")&&R(t,o)},i:i,o:i,d(e){e&&(E(t),E(n))}}}function it(e){let t,n;return t=new Xe({}),{c(){ye(t.$$.fragment)},m(e,o){$e(t,e,o),n=!0},p:i,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){he(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function rt(e){let t,n,o,i,r,s,c,a,l;const u=[Qe,Ye],d=[];function f(e,t){return!1===e[3]?0:1}return o=f(e),i=d[o]=u[o](e),{c(){t=S("div"),n=S("div"),i.c(),L(n,"class","bubble svelte-18vhu7m"),L(t,"class",r="interaction-area "+e[1]+" svelte-18vhu7m")},m(i,r){z(i,t,r),x(t,n),d[o].m(n,null),e[10](t),c=!0,a||(l=A(t,"mouseenter",e[7]),a=!0)},p(s,[a]){let l=o;o=f(e=s),o===l?d[o].p(e,a):(de(),he(d[l],1,1,(()=>{d[l]=null})),fe(),i=d[o],i?i.p(e,a):(i=d[o]=u[o](e),i.c()),pe(i,1),i.m(n,null)),(!c||2&a&&r!==(r="interaction-area "+e[1]+" svelte-18vhu7m"))&&L(t,"class",r)},i(n){c||(pe(i),n&&te((()=>{c&&(s||(s=we(t,qe,e[6],!0)),s.run(1))})),c=!0)},o(n){he(i),n&&(s||(s=we(t,qe,e[6],!1)),s.run(0)),c=!1},d(n){n&&E(t),d[o].d(),e[10](null),n&&s&&s.end(),a=!1,l()}}}function st(e,t,n){let o,i,r,{index:s}=t,{store:c}=t;const a=c.oversizedRatio;g(e,a,(e=>n(0,o=e)));const l=c.loading;g(e,l,(e=>n(3,i=e)));const u={delay:150+50*s,duration:250,y:2,easing:De};let d;const f=function(){const e=W();return(t,n,{cancelable:o=!1}={})=>{const i=e.$$.callbacks[t];if(i){const r=U(t,n,{cancelable:o});return i.slice().forEach((t=>{t.call(e,r)})),!r.defaultPrevented}return!0}}();return e.$$set=e=>{"index"in e&&n(8,s=e.index),"store"in e&&n(9,c=e.store)},e.$$.update=()=>{1&e.$$.dirty&&n(1,r=o>4?"high":o>2.5?"medium":"normal")},[o,r,d,i,a,l,u,function(){const e=d.getBoundingClientRect();f("hover",{index:s,position:{top:e.top+e.height+10,left:e.left}})},s,c,function(e){K[e?"unshift":"push"]((()=>{d=e,n(2,d)}))}]}class ct extends ke{constructor(e){super(),Ce(this,e,st,rt,u,{index:8,store:9})}}function at(e){let t,n;const o=e[2].default,i=function(e,t,n){if(e){const o=m(e,t,n,null);return e[0](o)}}(o,e,e[1]);return{c(){t=S("div"),i&&i.c(),L(t,"class","jetpack-boost-guide-portal")},m(o,r){z(o,t,r),i&&i.m(t,null),e[3](t),n=!0},p(e,[t]){i&&i.p&&(!n||2&t)&&function(e,t,n,o,i){if(i){const r=m(t,n,o,null);e.p(r,i)}}(i,o,e,e[1],n?function(e,t){return e[2],t.dirty}(o,e[1]):function(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let e=0;e<n;e++)t[e]=-1;return t}return-1}(e[1]))},i(e){n||(pe(i,e),n=!0)},o(e){he(i,e),n=!1},d(n){n&&E(t),i&&i.d(n),e[3](null)}}}function lt(e,t,n){let o,{$$slots:i={},$$scope:r}=t;var s;return J((()=>{document.body.appendChild(o)})),s=()=>{document.body.removeChild(o)},W().$$.on_destroy.push(s),e.$$set=e=>{"$$scope"in e&&n(1,r=e.$$scope)},[o,r,i,function(e){K[e?"unshift":"push"]((()=>{o=e,n(0,o)}))}]}class ut extends ke{constructor(e){super(),Ce(this,e,lt,at,u,{})}}function dt(e){let t,n;return{c(){t=j("svg"),n=j("path"),L(n,"d","M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"),L(t,"xmlns","http://www.w3.org/2000/svg"),L(t,"viewBox","0 0 24 24"),L(t,"class","svelte-1g2gjwn")},m(e,o){z(e,t,o),x(t,n)},p:i,i:i,o:i,d(e){e&&E(t)}}}class ft extends ke{constructor(e){super(),Ce(this,e,null,dt,u,{})}}function pt(e){let t,n,o,i,r=e[27]+"";return{c(){t=S("div"),n=I("The image file is "),o=I(r),i=I("x smaller than expected on this screen. This might be\n\t\t\t\t\t\tfine, but you may want to check if the image appears blurry."),L(t,"class","explanation svelte-52p8v6")},m(e,r){z(e,t,r),x(t,n),x(t,o),x(t,i)},p(e,t){8&t&&r!==(r=e[27]+"")&&R(o,r)},d(e){e&&E(t)}}}function ht(e){let t,n,o=e[6]>1&&wt(e);return{c(){t=S("div"),n=I("The image size is very close to the size it appears in the browser.\n\t\t\t\t\t\t"),o&&o.c(),L(t,"class","explanation svelte-52p8v6")},m(e,i){z(e,t,i),x(t,n),o&&o.m(t,null)},p(e,n){e[6]>1?o?o.p(e,n):(o=wt(e),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(e){e&&E(t),o&&o.d()}}}function gt(e){let t;return{c(){t=S("div"),t.textContent="The image is exactly the correct size for this screen.",L(t,"class","explanation svelte-52p8v6")},m(e,n){z(e,t,n)},p:i,d(e){e&&E(t)}}}function mt(e){let t,n,o,i,r,s,c=e[4].weight>450&&vt();return{c(){t=S("div"),n=I("The image loaded is "),o=S("strong"),i=I(e[6]),r=I("x"),s=I(" larger than it appears in the browser.\n\t\t\t\t\t\t"),c&&c.c(),L(t,"class","explanation svelte-52p8v6")},m(e,a){z(e,t,a),x(t,n),x(t,o),x(o,i),x(o,r),x(t,s),c&&c.m(t,null)},p(e,n){64&n&&R(i,e[6]),e[4].weight>450?c||(c=vt(),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},d(e){e&&E(t),c&&c.d()}}}function wt(e){let t,n,o,i,r;return{c(){t=I("Because there are various screen sizes, it's okay for the image to be\n\t\t\t\t\t\t\t"),n=S("strong"),o=I(e[6]),i=I("x"),r=I(" than it appears on the page.")},m(e,s){z(e,t,s),z(e,n,s),x(n,o),x(n,i),z(e,r,s)},p(e,t){64&t&&R(o,e[6])},d(e){e&&(E(t),E(n),E(r))}}}function vt(e){let t;return{c(){t=I("Try using a smaller image or reduce the file size by compressing it.")},m(e,n){z(e,t,n)},d(e){e&&E(t)}}}function yt(e){let t,n;return{c(){t=S("img"),f(t.src,n=e[5])||L(t,"src",n),L(t,"alt",e[8]),M(t,"width",e[2]+"px"),M(t,"height",e[7]+"px"),L(t,"width",e[2]),L(t,"height",e[7]),L(t,"class","svelte-52p8v6")},m(e,n){z(e,t,n)},p(e,o){32&o&&!f(t.src,n=e[5])&&L(t,"src",n),256&o&&L(t,"alt",e[8]),4&o&&M(t,"width",e[2]+"px"),128&o&&M(t,"height",e[7]+"px"),4&o&&L(t,"width",e[2]),128&o&&L(t,"height",e[7])},d(e){e&&E(t)}}}function $t(e){let t;function n(e,t){return e[16]?kt:Ct}let o=n(e),i=o(e);return{c(){t=S("div"),i.c(),L(t,"class","value")},m(e,n){z(e,t,n),i.m(t,null)},p(e,r){o!==(o=n(e))&&(i.d(1),i=o(e),i&&(i.c(),i.m(t,null)))},d(e){e&&E(t),i.d()}}}function bt(e){let t,n,o,i,r=e[4].width+"",s=e[4].height+"";return{c(){t=S("div"),n=I(r),o=I(" x "),i=I(s),L(t,"class","value")},m(e,r){z(e,t,r),x(t,n),x(t,o),x(t,i)},p(e,t){16&t&&r!==(r=e[4].width+"")&&R(n,r),16&t&&s!==(s=e[4].height+"")&&R(i,s)},d(e){e&&E(t)}}}function Ct(e){let t;return{c(){t=S("em"),t.textContent="Unknown"},m(e,n){z(e,t,n)},d(e){e&&E(t)}}}function kt(e){let t;return{c(){t=I("Loading...")},m(e,n){z(e,t,n)},d(e){e&&E(t)}}}function xt(e){let t;return{c(){t=S("em"),t.textContent="Unknown"},m(e,n){z(e,t,n)},p:i,d(e){e&&E(t)}}}function _t(e){let t;return{c(){t=I("Loading...")},m(e,n){z(e,t,n)},p:i,d(e){e&&E(t)}}}function Ft(e){let t,n,o=Math.round(e[4].weight)+"";return{c(){t=I(o),n=I(" KB")},m(e,o){z(e,t,o),z(e,n,o)},p(e,n){16&n&&o!==(o=Math.round(e[4].weight)+"")&&R(t,o)},d(e){e&&(E(t),E(n))}}}function zt(e){let t;return{c(){t=S("em"),t.textContent="N/A"},m(e,n){z(e,t,n)},p:i,d(e){e&&E(t)}}}function Et(e){let t;return{c(){t=I("Loading...")},m(e,n){z(e,t,n)},p:i,d(e){e&&E(t)}}}function St(e){let t,n,o;return{c(){t=S("strong"),n=I(e[19]),o=I(" KB")},m(e,i){z(e,t,i),x(t,n),x(t,o)},p(e,t){524288&t&&R(n,e[19])},d(e){e&&E(t)}}}function jt(e){let t,n,o,i,r,s,c,a,l,u,d,f,p,h,g,m,w,v,y,$,b,C,k,_,F,j,P,T,U,B,D,N,H,q,V,W,J,G,Z,K,X,Y,Q,ee,ne,oe,ie,re,se,ce,ae,le=e[17].width+"",ue=e[17].height+"",de=e[18].width+"",fe=e[18].height+"",ge=`${e[0].top}px`,we=`${e[0].left}px`;function ve(e,t){return e[6]>=1.3?mt:1===e[6]?gt:e[6]>=.99&&e[6]<1.3?ht:pt}function Ce(e,t){return t===pt?function(e){const t=e.slice(),n=Pt(1/t[3]);return t[27]=n,t}(e):e}o=new Je({props:{size:250}});let ke=ve(e),xe=ke(Ce(e,ke)),_e=e[5]&&yt(e);function Fe(e,t){return e[4].width>0&&e[4].height>0?bt:$t}let ze=Fe(e),Ee=ze(e);function Se(e,t){return e[4].weight>0?Ft:e[16]?_t:xt}let je=Se(e),Ie=je(e);function Oe(e,t){return e[19]>0?St:e[16]?Et:zt}let Pe=Oe(e),Ae=Pe(e);return ie=new ft({}),{c(){t=S("div"),n=S("div"),ye(o.$$.fragment),i=O(),r=S("div"),s=S("div"),c=S("div"),a=S("a"),l=I(e[8]),u=O(),xe.c(),d=O(),_e&&_e.c(),f=O(),p=S("div"),h=S("div"),g=S("div"),g.textContent="Image File Dimensions",m=O(),Ee.c(),w=O(),v=S("div"),y=S("div"),y.textContent="Expected Dimensions",$=O(),b=S("div"),C=I(le),k=I(" x "),_=I(ue),F=O(),j=S("div"),P=S("div"),P.textContent="Size on screen",T=O(),U=S("div"),B=I(de),D=I(" x "),N=I(fe),H=O(),q=S("div"),V=S("div"),V.textContent="Image Size",W=O(),J=S("div"),Ie.c(),G=O(),Z=S("div"),K=S("div"),K.textContent="Potential savings",X=O(),Y=S("div"),Ae.c(),Q=O(),ee=S("div"),ne=S("a"),oe=I("Learn how to improve site speed by optimizing images "),ye(ie.$$.fragment),L(n,"class","logo svelte-52p8v6"),L(a,"href",e[5]),L(a,"target","_blank noreferrer"),L(a,"class","svelte-52p8v6"),L(c,"class","title svelte-52p8v6"),L(s,"class","description svelte-52p8v6"),L(r,"class","preview svelte-52p8v6"),L(g,"class","label"),L(h,"class","row svelte-52p8v6"),L(y,"class","label"),L(b,"class","value"),L(v,"class","row svelte-52p8v6"),L(P,"class","label"),L(U,"class","value"),L(j,"class","row svelte-52p8v6"),L(V,"class","label"),L(J,"class","value"),L(q,"class","row svelte-52p8v6"),L(K,"class","label"),L(Y,"class","value"),L(Z,"class","row svelte-52p8v6"),L(ne,"class","documentation svelte-52p8v6"),L(ne,"href",Ot),L(ne,"target","_blank noreferrer"),L(ee,"class","info svelte-52p8v6"),L(p,"class","meta"),L(t,"class","jetpack-boost-guide-popup keep-guide-open svelte-52p8v6"),M(t,"top",ge),M(t,"left",we)},m(E,S){z(E,t,S),x(t,n),$e(o,n,null),x(t,i),x(t,r),x(r,s),x(s,c),x(c,a),x(a,l),x(s,u),xe.m(s,null),x(r,d),_e&&_e.m(r,null),x(t,f),x(t,p),x(p,h),x(h,g),x(h,m),Ee.m(h,null),x(p,w),x(p,v),x(v,y),x(v,$),x(v,b),x(b,C),x(b,k),x(b,_),x(p,F),x(p,j),x(j,P),x(j,T),x(j,U),x(U,B),x(U,D),x(U,N),x(p,H),x(p,q),x(q,V),x(q,W),x(q,J),Ie.m(J,null),x(p,G),x(p,Z),x(Z,K),x(Z,X),x(Z,Y),Ae.m(Y,null),x(p,Q),x(p,ee),x(ee,ne),x(ne,oe),$e(ie,ne,null),se=!0,ce||(ae=A(t,"mouseleave",e[22]),ce=!0)},p(e,n){(!se||256&n)&&R(l,e[8]),(!se||32&n)&&L(a,"href",e[5]),ke===(ke=ve(e))&&xe?xe.p(Ce(e,ke),n):(xe.d(1),xe=ke(Ce(e,ke)),xe&&(xe.c(),xe.m(s,null))),e[5]?_e?_e.p(e,n):(_e=yt(e),_e.c(),_e.m(r,null)):_e&&(_e.d(1),_e=null),ze===(ze=Fe(e))&&Ee?Ee.p(e,n):(Ee.d(1),Ee=ze(e),Ee&&(Ee.c(),Ee.m(h,null))),(!se||131072&n)&&le!==(le=e[17].width+"")&&R(C,le),(!se||131072&n)&&ue!==(ue=e[17].height+"")&&R(_,ue),(!se||262144&n)&&de!==(de=e[18].width+"")&&R(B,de),(!se||262144&n)&&fe!==(fe=e[18].height+"")&&R(N,fe),je===(je=Se(e))&&Ie?Ie.p(e,n):(Ie.d(1),Ie=je(e),Ie&&(Ie.c(),Ie.m(J,null))),Pe===(Pe=Oe(e))&&Ae?Ae.p(e,n):(Ae.d(1),Ae=Pe(e),Ae&&(Ae.c(),Ae.m(Y,null))),1&n&&ge!==(ge=`${e[0].top}px`)&&M(t,"top",ge),1&n&&we!==(we=`${e[0].left}px`)&&M(t,"left",we)},i(e){se||(pe(o.$$.fragment,e),pe(ie.$$.fragment,e),e&&(re||te((()=>{re=me(t,qe,{duration:150,y:4,easing:De}),re.start()}))),se=!0)},o(e){he(o.$$.fragment,e),he(ie.$$.fragment,e),se=!1},d(e){e&&E(t),be(o),xe.d(),_e&&_e.d(),Ee.d(),Ie.d(),Ae.d(),be(ie),ce=!1,ae()}}}function It(e){let t,n,o,i,r,s=!1,c=()=>{s=!1};return te(e[23]),n=new ut({props:{$$slots:{default:[jt]},$$scope:{ctx:e}}}),{c(){ye(n.$$.fragment)},m(a,l){$e(n,a,l),o=!0,i||(r=A(window,"scroll",(()=>{s=!0,clearTimeout(t),t=setTimeout(c,100),e[23]()})),i=!0)},p(e,[o]){2&o&&!s&&(s=!0,clearTimeout(t),scrollTo(window.pageXOffset,e[1]),t=setTimeout(c,100));const i={};269419005&o&&(i.$$scope={dirty:o,ctx:e}),n.$set(i)},i(e){o||(pe(n.$$.fragment,e),o=!0)},o(e){he(n.$$.fragment,e),o=!1},d(e){be(n,e),i=!1,r()}}}const Ot="https://jetpack.com/support/jetpack-boost/image-performance-guide/";function Pt(e){return e%1==0?e:parseFloat(e.toFixed(2))}function At(e,t,n){let o,r,s,c,a,l,u,d,f,h,g,m,w,v,y,$,b,C,k=i,x=i,_=i,F=i,z=i,E=i,S=i;e.$$.on_destroy.push((()=>k())),e.$$.on_destroy.push((()=>x())),e.$$.on_destroy.push((()=>_())),e.$$.on_destroy.push((()=>F())),e.$$.on_destroy.push((()=>z())),e.$$.on_destroy.push((()=>E())),e.$$.on_destroy.push((()=>S()));let{store:j}=t,{size:I}=t,{position:O}=t,P=0,A=0,L=0;return J((()=>{A=P,L=O.top})),e.$$set=e=>{"store"in e&&n(20,j=e.store),"size"in e&&n(21,I=e.size),"position"in e&&n(0,O=e.position)},e.$$.update=()=>{var t;1048576&e.$$.dirty&&(n(15,o=j.loading),F(),F=p(o,(e=>n(16,y=e)))),1048576&e.$$.dirty&&(n(14,r=j.oversizedRatio),k(),k=p(r,(e=>n(3,m=e)))),1048576&e.$$.dirty&&(n(13,s=j.fileSize),x(),x=p(s,(e=>n(4,w=e)))),1048576&e.$$.dirty&&(n(12,c=j.sizeOnPage),E(),E=p(c,(e=>n(18,b=e)))),1048576&e.$$.dirty&&(n(11,a=j.potentialSavings),S(),S=p(a,(e=>n(19,C=e)))),1048576&e.$$.dirty&&(n(10,l=j.expectedSize),z(),z=p(l,(e=>n(17,$=e)))),1048576&e.$$.dirty&&(n(9,u=j.url),_(),_=p(u,(e=>n(5,v=e)))),32&e.$$.dirty&&n(8,d=v.split("/").pop()),2097152&e.$$.dirty&&n(2,f="normal"===I?100:50),20&e.$$.dirty&&n(7,h=Math.floor(f/(w.width/w.height))),8&e.$$.dirty&&n(6,g=Pt(m)),2&e.$$.dirty&&0!==(t=P)&&A!==t&&n(0,O.top=L+(A-t),O)},[O,P,f,m,w,v,g,h,d,u,l,a,c,s,r,o,y,$,b,C,j,I,function(t){G.call(this,e,t)},function(){n(1,P=window.pageYOffset)}]}class Lt extends ke{constructor(e){super(),Ce(this,e,At,It,u,{store:20,size:21,position:0})}}function Rt(e,t,n){const o=e.slice();return o[12]=t[n],o[14]=n,o}function Mt(e){let t,n,o,i,r,s,c,a=ve(e[0]),l=[];for(let t=0;t<a.length;t+=1)l[t]=Tt(Rt(e,a,t));const u=e=>he(l[e],1,1,(()=>{l[e]=null}));let d=!1!==e[1]&&Ut(e);return{c(){t=S("div"),n=S("div");for(let e=0;e<l.length;e+=1)l[e].c();o=O(),d&&d.c(),L(n,"class","previews svelte-1828btn"),L(t,"class",i="guide "+e[3]+" svelte-1828btn"),T(t,"show",!1!==e[1]),T(t,"keep-guide-open",!1!==e[1])},m(i,a){z(i,t,a),x(t,n);for(let e=0;e<l.length;e+=1)l[e]&&l[e].m(n,null);x(t,o),d&&d.m(t,null),r=!0,s||(c=A(t,"mouseleave",e[6]),s=!0)},p(e,o){if(257&o){let t;for(a=ve(e[0]),t=0;t<a.length;t+=1){const i=Rt(e,a,t);l[t]?(l[t].p(i,o),pe(l[t],1)):(l[t]=Tt(i),l[t].c(),pe(l[t],1),l[t].m(n,null))}for(de(),t=a.length;t<l.length;t+=1)u(t);fe()}!1!==e[1]?d?(d.p(e,o),2&o&&pe(d,1)):(d=Ut(e),d.c(),pe(d,1),d.m(t,null)):d&&(de(),he(d,1,1,(()=>{d=null})),fe()),(!r||8&o&&i!==(i="guide "+e[3]+" svelte-1828btn"))&&L(t,"class",i),(!r||10&o)&&T(t,"show",!1!==e[1]),(!r||10&o)&&T(t,"keep-guide-open",!1!==e[1])},i(e){if(!r){for(let e=0;e<a.length;e+=1)pe(l[e]);pe(d),r=!0}},o(e){l=l.filter(Boolean);for(let e=0;e<l.length;e+=1)he(l[e]);he(d),r=!1},d(e){e&&E(t),function(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}(l,e),d&&d.d(),s=!1,c()}}}function Tt(e){let t,n;return t=new ct({props:{index:e[14],store:e[12]}}),t.$on("hover",e[8]),{c(){ye(t.$$.fragment)},m(e,o){$e(t,e,o),n=!0},p(e,n){const o={};1&n&&(o.store=e[12]),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){he(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Ut(e){let t,n;return t=new Lt({props:{store:e[0][e[1]],size:e[3],position:e[2]}}),t.$on("mouseleave",e[6]),{c(){ye(t.$$.fragment)},m(e,o){$e(t,e,o),n=!0},p(e,n){const o={};3&n&&(o.store=e[0][e[1]]),8&n&&(o.size=e[3]),4&n&&(o.position=e[2]),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){he(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Bt(e){let t,n,o="active"===e[4]&&e[5]&&Mt(e);return{c(){o&&o.c(),t=P()},m(e,i){o&&o.m(e,i),z(e,t,i),n=!0},p(e,[n]){"active"===e[4]&&e[5]?o?(o.p(e,n),48&n&&pe(o,1)):(o=Mt(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(de(),he(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){he(o),n=!1},d(e){e&&E(t),o&&o.d(e)}}}function Dt(e,t,n){let o,i,r,s;g(e,Pe,(e=>n(4,r=e)));let{stores:c}=t,a=!1;J((()=>{c.forEach((e=>e.updateDimensions()))}));const l=c[0].sizeOnPage;g(e,l,(e=>n(10,i=e)));let u={top:0,left:0};const d=Fe(c.map((e=>e.fileSize)),(e=>e.some((e=>-1!==e.width&&-1!==e.height))));return g(e,d,(e=>n(5,s=e))),e.$$set=e=>{"stores"in e&&n(0,c=e.stores)},e.$$.update=()=>{1024&e.$$.dirty&&n(3,o=function(e=-1,t=-1){return e<200||t<200?"micro":e<400||t<400?"small":"normal"}(i.width,i.height)),2&e.$$.dirty&&function(e=!1){e?c.forEach((e=>e.node.classList.add("jetpack-boost-guide__backdrop"))):c.forEach((e=>e.node.classList.remove("jetpack-boost-guide__backdrop")))}(!1!==a)},[c,a,u,o,r,s,function(e){e.relatedTarget&&e.relatedTarget.classList.contains("keep-guide-open")||n(1,a=!1)},l,function(e){const t=e.detail,o=t.index;n(2,u=t.position),n(1,a=o)},d,i]}class Nt extends ke{constructor(e){super(),Ce(this,e,Dt,Bt,u,{stores:0})}}const Ht=[];let qt;function Vt(){window.addEventListener("resize",function(){let e;return()=>{e&&clearTimeout(e),e=setTimeout((()=>{Ht.forEach((e=>{e.updateDimensions()}))}),500)}}()),Re.trackInitialState(),Pe.subscribe((async e=>{if("paused"===e)return;const t=await Ue(Array.from(document.querySelectorAll("body *:not(.jetpack-boost-guide > *):not(.jetpack-boost-guide)")),qt),n=await Promise.all(t.map((e=>e.isImageTiny())));Ht.push(...function(e){const t=e.reduce(((e,t)=>{var n;if(!t.node.parentNode)return console.error("Image has no parent",t.node),e;const o=function(e){const t=e.node;if(!(e.node instanceof HTMLImageElement)&&["static","relative"].includes(getComputedStyle(t).position))return t.classList.contains("jetpack-boost-guide")||(t.classList.add("jetpack-boost-guide","relative"),t.dataset.jetpackBoostGuideId=(++Wt).toString()),t;if(!t.parentNode||!t.parentElement)return;const n=function(e){let t,n=e.parentElement;for(;n&&n instanceof HTMLElement&&n!==document.body;){const e=getComputedStyle(n),o="inline"!==e.display,i="static"===e.position,r="relative"===e.position,s="auto"!==e.zIndex;o&&(!t&&(i||r)||r&&s)&&(t=n),n=n.parentElement}return t}(t);if(null==n?void 0:n.classList.contains("jetpack-boost-guide"))return n;if(n){const t=getComputedStyle(n);if("relative"===t.position){const e=Array.from(n.children).find((e=>e.classList.contains("jetpack-boost-guide")));if(e&&e instanceof HTMLElement)return e}const o=document.createElement("div");return o.classList.add("jetpack-boost-guide"),o.dataset.jetpackBoostGuideId=(++Wt).toString(),"static"===t.position&&(n.style.position="relative"),e.node instanceof HTMLImageElement&&(o.style.top=`${e.node.offsetTop}px`),n.prepend(o),o}return t.parentElement}(t);if(!o)return console.error("Could not find a parent for image",t),e;const i=parseInt(o.dataset.jetpackBoostGuideId||""),r=(null===(n=e[i])||void 0===n?void 0:n.props.stores)||[],s=new Le(t);return r.push(s),1===r.length&&(e[i]={target:o,intro:!0,props:{stores:r}}),e}),{});return Object.values(t).map((e=>(new Nt(e),e.props.stores))).flat()}(t.filter(((e,t)=>!n[t])))),Re.trackPage(Ht)}))}let Wt=0;function Jt(e){let t,n,o,i,r,s,c,a,l,u;return n=new Je({}),{c(){t=S("a"),ye(n.$$.fragment),o=O(),i=S("span"),r=I("Image Guide: "),s=I(e[2]),L(t,"id","jetpack-boost-guide-bar"),L(t,"href",e[0]),L(t,"class",c="ab-item "+e[1]+" svelte-itog5b")},m(c,d){var f;z(c,t,d),$e(n,t,null),x(t,o),x(t,i),x(i,r),x(i,s),a=!0,l||(u=A(t,"click",(f=e[3],function(e){return e.preventDefault(),f.call(this,e)})),l=!0)},p(e,[n]){(!a||4&n)&&R(s,e[2]),(!a||1&n)&&L(t,"href",e[0]),(!a||2&n&&c!==(c="ab-item "+e[1]+" svelte-itog5b"))&&L(t,"class",c)},i(e){a||(pe(n.$$.fragment,e),a=!0)},o(e){he(n.$$.fragment,e),a=!1},d(e){e&&E(t),be(n),l=!1,u()}}}function Gt(e,t,n){let o,i;g(e,Pe,(e=>n(1,o=e))),g(e,Ae,(e=>n(2,i=e)));let{href:r}=t,{tracksCallback:s}=t;return e.$$set=e=>{"href"in e&&n(0,r=e.href),"tracksCallback"in e&&n(4,s=e.tracksCallback)},e.$$.update=()=>{16&e.$$.dirty&&Re.setTracksCallback(s)},[r,o,i,function(){Pe.cycle(),Re.trackUIStateChange()},s]}class Zt extends ke{constructor(e){super(),Ce(this,e,Gt,Jt,u,{href:0,tracksCallback:4})}}function Kt(e,{href:t,tracksCallback:n,fetchFunction:o}){return function(e){window.frameElement||(qt=e,window.addEventListener("load",Vt))}(o),new Zt({target:e,props:{href:t,tracksCallback:n}})}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(482),t=n(499),o=n(348),i=n(133),r=n(372);async function s(e){if(!(0,t.J)(e)){const t=await(0,o.i)({action:"boost_proxy_ig",proxy_url:e,nonce:jbImageGuide.proxyNonce},jbImageGuide.ajax_url),n=t.headers.get("content-type");if(n&&-1!==n.indexOf("application/json")){const e=await t.clone().json();if(e&&e.data["content-length"]){const n=new Headers;for(const t in e.data)Object.hasOwn(e.data,t)&&n.set(t,e.data[t]);return new Response(t.body,{status:t.status,statusText:t.statusText,headers:n})}}}return await fetch(e,{method:"HEAD",mode:"no-cors"})}document.addEventListener("DOMContentLoaded",(()=>{r.A.initialize(jetpackBoostAnalytics.tracksData.userData.userid,jetpackBoostAnalytics.tracksData.userData.username,{blog_id:jetpackBoostAnalytics.tracksData.blogId});const t=(e,t)=>{(0,i.zI)(e,t)},n=document.getElementById("wp-admin-bar-jetpack-boost-guide"),o=n?.querySelector("a");if(n&&o){const i=o.getAttribute("href");o.remove(),(0,e.zo)(n,{href:i,tracksCallback:t,fetchFunction:s})}}))})()})();