« Back to History
view.min.js
|
20261118_125741.php
Initial Domain Snapshot
Copy Code
import*as t from"@wordpress/interactivity";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const n=(t=>{var n={};return e.d(n,t),n})({getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store});let o=!1,r=0;function a(t){const e=i.metadata[t];return Object.hasOwn(i.metadata,t)?e:void 0}const{state:i,actions:l,callbacks:g}=(0,n.store)("core/image",{state:{currentImageId:null,get currentImage(){return a(i.currentImageId)},get overlayOpened(){return null!==i.currentImageId},get roleAttribute(){return i.overlayOpened?"dialog":null},get ariaModal(){return i.overlayOpened?"true":null},get enlargedSrc(){return i.currentImage.uploadedSrc||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},get figureStyles(){return i.overlayOpened&&`${i.currentImage.figureStyles?.replace(/margin[^;]*;?/g,"")};`},get imgStyles(){return i.overlayOpened&&`${i.currentImage.imgStyles?.replace(/;$/,"")}; object-fit:cover;`},get imageButtonRight(){const{imageId:t}=(0,n.getContext)();return a(t)?.imageButtonRight},get imageButtonTop(){const{imageId:t}=(0,n.getContext)();return a(t)?.imageButtonTop},get isContentHidden(){const t=(0,n.getContext)();return i.overlayEnabled&&i.currentImageId===t.imageId},get isContentVisible(){const t=(0,n.getContext)();return!i.overlayEnabled&&i.currentImageId===t.imageId}},actions:{showLightbox(){const{imageId:t}=(0,n.getContext)();a(t)?.imageRef?.complete&&(i.scrollTopReset=document.documentElement.scrollTop,i.scrollLeftReset=document.documentElement.scrollLeft,i.overlayEnabled=!0,i.currentImageId=t,g.setOverlayStyles())},hideLightbox(){i.overlayEnabled&&(i.showClosingAnimation=!0,i.overlayEnabled=!1,setTimeout((function(){i.currentImage.buttonRef.focus({preventScroll:!0}),i.currentImageId=null}),450))},handleKeydown(t){if(i.overlayEnabled){if("Tab"===t.key){t.preventDefault();const{ref:e}=(0,n.getElement)();e.querySelector("button").focus()}"Escape"===t.key&&l.hideLightbox()}},handleTouchMove(t){i.overlayEnabled&&t.preventDefault()},handleTouchStart(){o=!0},handleTouchEnd(){r=Date.now(),o=!1},handleScroll(){i.overlayOpened&&!o&&Date.now()-r>450&&window.scrollTo(i.scrollLeftReset,i.scrollTopReset)}},callbacks:{setOverlayStyles(){if(!i.overlayEnabled)return;let{naturalWidth:t,naturalHeight:e,offsetWidth:n,offsetHeight:o}=i.currentImage.imageRef,{x:r,y:a}=i.currentImage.imageRef.getBoundingClientRect();const l=t/e;let g=n/o;if("contain"===i.currentImage.scaleAttr)if(l>g){const t=n/l;a+=(o-t)/2,o=t}else{const t=o*l;r+=(n-t)/2,n=t}g=n/o;let c=parseFloat("none"!==i.currentImage.targetWidth?i.currentImage.targetWidth:t),s=parseFloat("none"!==i.currentImage.targetHeight?i.currentImage.targetHeight:e),d=c/s,u=c,m=s,h=c,p=s;if(l.toFixed(2)!==d.toFixed(2)){if(l>d){const t=c/l;s-t>c?(s=t,c=t*l):s=c/l}else{const t=s*l;c-t>s?(c=t,s=t/l):c=s*l}h=c,p=s,d=c/s,g>d?(u=c,m=u/g):(m=s,u=m*g)}(n>h||o>p)&&(h=n,p=o);let f=0;window.innerWidth>480?f=80:window.innerWidth>1920&&(f=160);const y=Math.min(window.innerWidth-f,h),b=Math.min(window.innerHeight-80,p);g>y/b?(h=y,p=h/g):(p=b,h=p*g);const w=n/h,I=c*(h/u),x=s*(p/m);i.overlayStyles=`\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${a}px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${r}px;\n\t\t\t\t\t--wp--lightbox-container-width: ${h+1}px;\n\t\t\t\t\t--wp--lightbox-container-height: ${p+1}px;\n\t\t\t\t\t--wp--lightbox-image-width: ${I}px;\n\t\t\t\t\t--wp--lightbox-image-height: ${x}px;\n\t\t\t\t\t--wp--lightbox-scale: ${w};\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${window.innerWidth-document.documentElement.clientWidth}px;\n\t\t\t\t}\n\t\t\t`},setButtonStyles(){const{imageId:t}=(0,n.getContext)(),e=a(t);if(!e)return;const{ref:o}=(0,n.getElement)();e.imageRef=o,e.currentSrc=o.currentSrc;const{naturalWidth:r,naturalHeight:i,offsetWidth:l,offsetHeight:g}=o;if(0===r||0===i)return;const c=o.parentElement,s=o.parentElement.clientWidth;let d=o.parentElement.clientHeight;const u=c.querySelector("figcaption");if(u){const t=window.getComputedStyle(u);["absolute","fixed"].includes(t.position)||(d=d-u.offsetHeight-parseFloat(t.marginTop)-parseFloat(t.marginBottom))}const m=d-g,h=s-l;let p=m+16,f=h+16;if("contain"===e.scaleAttr){const t=r/i;if(t>=l/g){p=(g-l/t)/2+m+16,f=h+16}else{p=m+16,f=(l-g*t)/2+h+16}}e.imageButtonTop=p,e.imageButtonRight=f},setOverlayFocus(){if(i.overlayEnabled){const{ref:t}=(0,n.getElement)();t.focus()}},initTriggerButton(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)(),o=a(t);o&&(o.buttonRef=e)}}},{lock:!0});