Submit
Path:
~
/
home
/
getwphos
/
public_html
/
almajd
/
wp-content
/
plugins
/
woocommerce
/
assets
/
client
/
blocks
/
woocommerce
/
File Content:
product-gallery.js
import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(i={getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store,withScope:()=>e.withScope},l={},t.d(l,i),l),r=e=>{if(!e)return{top:!1,bottom:!1,left:!1,right:!1};const{scrollTop:t,scrollHeight:o,clientHeight:r,scrollLeft:n,scrollWidth:c,clientWidth:a}=e;return{top:t>3,bottom:t+r<o-3,left:n>3,right:n+a<c-3}},n=e=>(0,o.getContext)(e),c={state:{get imageIndex(){const{imageData:e,selectedImageId:t}=n();return e.indexOf(t)}},actions:{selectImage:e=>{const t=n(),{imageData:r}=t,c=r[e],{disableLeft:a,disableRight:i}={disableLeft:0===(l=e),disableRight:l===r.length-1};var l;t.disableLeft=a,t.disableRight=i,t.selectedImageId=c,-1!==c&&((e=>{if(!e)return;const t=(0,o.getElement)()?.ref;if(!t)return;const r=t.closest(".wp-block-woocommerce-product-gallery");if(!r)return;const n=r.querySelector(".wc-block-product-gallery-large-image__container");if(!n)return;const c=n.querySelector(`img[data-image-id="${e}"]`);if(c){const e=n.getBoundingClientRect(),t=c.getBoundingClientRect(),o=n.scrollLeft+(t.left-e.left)-(e.width-t.width)/2;n.scrollTo({left:o,behavior:"smooth"})}})(c),(e=>{if(!e)return;const t=(0,o.getElement)()?.ref;if(!t)return;const r=t.closest(".wp-block-woocommerce-product-gallery");if(!r)return;const n=r.querySelector(`.wc-block-product-gallery-thumbnails__thumbnail img[data-image-id="${e}"]`);if(!n)return;const c=n.closest(".wc-block-product-gallery-thumbnails__scrollable");if(!c)return;const a=n.closest(".wc-block-product-gallery-thumbnails__thumbnail");if(!a)return;const i=c.getBoundingClientRect(),l=a.getBoundingClientRect(),s=c.scrollTop+(l.top-i.top)-(i.height-l.height)/2,g=c.scrollLeft+(l.left-i.left)-(i.width-l.width)/2;c.scrollTo({top:s,left:g,behavior:"smooth"})})(c))},selectCurrentImage:e=>{e&&e.stopPropagation();const t=(0,o.getElement)()?.ref;if(!t)return;const r=t.getAttribute("data-image-id");if(!r)return;const c=parseInt(r,10),{imageData:i}=n(),l=i.indexOf(c);a.selectImage(l)},selectNextImage:e=>{e&&e.stopPropagation();const{imageData:t,selectedImageId:o}=n(),r=t.indexOf(o),c=Math.min(t.length-1,r+1);a.selectImage(c)},selectPreviousImage:e=>{e&&e.stopPropagation();const{imageData:t,selectedImageId:o}=n(),r=t.indexOf(o),c=Math.max(0,r-1);a.selectImage(c)},onSelectedLargeImageKeyDown:e=>{"Enter"!==e.code&&"Space"!==e.code&&"NumpadEnter"!==e.code||("Space"===e.code&&e.preventDefault(),a.openDialog()),"ArrowRight"===e.code&&a.selectNextImage(),"ArrowLeft"===e.code&&a.selectPreviousImage()},onDialogKeyDown:e=>{if("Escape"===e.code&&a.closeDialog(),"Tab"===e.code){const t='a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])',r=(0,o.getElement)()?.ref,n=r.querySelectorAll(t);if(!n.length)return;const c=n[0],a=n[n.length-1];if(!e.shiftKey&&e.target===a)return e.preventDefault(),void c.focus();if(e.shiftKey&&e.target===c)return e.preventDefault(),void a.focus();e.target===r&&(e.preventDefault(),c.focus())}},openDialog:()=>{n().isDialogOpen=!0,document.body.classList.add("wc-block-product-gallery-dialog-open")},closeDialog:()=>{n().isDialogOpen=!1,document.body.classList.remove("wc-block-product-gallery-dialog-open")},onTouchStart:e=>{const t=n(),{clientX:o}=e.touches[0];t.touchStartX=o,t.touchCurrentX=o,t.isDragging=!0},onTouchMove:e=>{const t=n();if(!t.isDragging)return;const{clientX:o}=e.touches[0];t.touchCurrentX=o;const r=o-t.touchStartX;Math.abs(r)>10&&e.preventDefault()},onTouchEnd:()=>{const e=n();if(!e.isDragging)return;const t=e.touchCurrentX-e.touchStartX,r=(0,o.getElement)()?.ref,c=r?.offsetWidth||0;Math.abs(t)>.2*c&&(t>0&&!e.disableLeft?a.selectPreviousImage():t<0&&!e.disableRight&&a.selectNextImage()),e.isDragging=!1,e.touchStartX=0,e.touchCurrentX=0},onScroll:()=>{const e=(0,o.getElement)()?.ref;if(!e)return;const t=n(),c=r(e);t.thumbnailsOverflow=c},onArrowsKeyDown:e=>{"ArrowRight"===e.code&&(e.preventDefault(),a.selectNextImage()),"ArrowLeft"===e.code&&(e.preventDefault(),a.selectPreviousImage())},onThumbnailsArrowsKeyDown:e=>{a.onArrowsKeyDown(e);const t=(0,o.getElement)()?.ref,{selectedImageId:r}=n();if(t){const e=t.closest(".wp-block-woocommerce-product-gallery");if(e){const t=e.querySelector(`img[data-image-id="${r}"]`);t&&t.focus({preventScroll:!0})}}}},callbacks:{watchForChangesOnAddToCartForm:()=>{const e=n(),t=document.querySelector(`form[data-product_id="${e.productId}"]`);if(!t)return;const r=()=>(0,o.withScope)((()=>a.selectImage(0))),c=new MutationObserver((0,o.withScope)((function(e){for(const t of e){const{imageData:e}=n(),o=t.target.getAttribute("current-image"),r=o?parseInt(o,10):null;if("attributes"===t.type&&r&&e.includes(r)){const t=e.indexOf(r);a.selectImage(t)}else a.selectImage(0)}})));c.observe(t,{attributes:!0});const i=document.querySelector(".wp-block-add-to-cart-form .reset_variations");return i&&i.addEventListener("click",r),()=>{c.disconnect(),document.removeEventListener("click",r)}},dialogStateChange:()=>{const{selectedImageId:e,isDialogOpen:t}=n(),{ref:r}=(0,o.getElement)()||{};if(t&&r instanceof HTMLElement){r.focus();const t=r.querySelector(`[data-image-id="${e}"]`);t instanceof HTMLElement&&t.scrollIntoView({behavior:"auto",block:"center"})}},toggleActiveThumbnailAttributes:()=>{const e=(0,o.getElement)()?.ref;if(!e)return!1;const t=e.getAttribute("data-image-id");if(!t)return!1;const{selectedImageId:r}=n();r===Number(t)?(e.classList.add("wc-block-product-gallery-thumbnails__thumbnail__image--is-active"),e.setAttribute("tabIndex","0")):(e.classList.remove("wc-block-product-gallery-thumbnails__thumbnail__image--is-active"),e.setAttribute("tabIndex","-1"))},initResizeObserver:()=>{const e=(0,o.getElement)()?.ref;if(!e)return;const t=n(),c=new ResizeObserver((()=>{const o=r(e);t.thumbnailsOverflow=o}));return c.observe(e),e.parentElement&&c.observe(e.parentElement),()=>{c.disconnect()}}}},{actions:a}=(0,o.store)("woocommerce/product-gallery",c,{lock:!0});var i,l;
Submit
FILE
FOLDER
Name
Size
Permission
Action
accordion-group-style-rtl.css
1793 bytes
0644
accordion-group-style.css
1792 bytes
0644
accordion-group.js
679 bytes
0644
add-to-cart-form-editor-rtl.css
856 bytes
0644
add-to-cart-form-editor.css
857 bytes
0644
add-to-cart-form-style-rtl.css
7150 bytes
0644
add-to-cart-form-style.css
7153 bytes
0644
add-to-cart-form.js
1016 bytes
0644
add-to-cart-with-options-editor-rtl.css
949 bytes
0644
add-to-cart-with-options-editor.css
949 bytes
0644
add-to-cart-with-options-grouped-product-item-selector-style-rtl.css
2528 bytes
0644
add-to-cart-with-options-grouped-product-item-selector-style.css
2528 bytes
0644
add-to-cart-with-options-grouped-product-item-style-rtl.css
112 bytes
0644
add-to-cart-with-options-grouped-product-item-style.css
112 bytes
0644
add-to-cart-with-options-quantity-selector-style-rtl.css
2427 bytes
0644
add-to-cart-with-options-quantity-selector-style.css
2427 bytes
0644
add-to-cart-with-options-style-rtl.css
2858 bytes
0644
add-to-cart-with-options-style.css
2860 bytes
0644
add-to-cart-with-options-variation-selector-attribute-name-style-rtl.css
186 bytes
0644
add-to-cart-with-options-variation-selector-attribute-name-style.css
186 bytes
0644
add-to-cart-with-options-variation-selector-attribute-options-style-rtl.css
2141 bytes
0644
add-to-cart-with-options-variation-selector-attribute-options-style.css
2141 bytes
0644
add-to-cart-with-options-variation-selector-attribute-options.js
3154 bytes
0644
add-to-cart-with-options.js
5827 bytes
0644
mini-cart-footer-block-editor-rtl.css
90 bytes
0644
mini-cart-footer-block-editor.css
90 bytes
0644
mini-cart.js
20673 bytes
0644
product-button-style-rtl.css
3868 bytes
0644
product-button-style.css
3867 bytes
0644
product-button.js
3107 bytes
0644
product-collection-editor-rtl.css
6962 bytes
0644
product-collection-editor.css
6960 bytes
0644
product-collection-rtl.css
232 bytes
0644
product-collection-style-rtl.css
232 bytes
0644
product-collection-style.css
232 bytes
0644
product-collection.css
232 bytes
0644
product-collection.js
2136 bytes
0644
product-elements.js
23224 bytes
0644
product-filter-active.js
838 bytes
0644
product-filter-attribute-style-rtl.css
231 bytes
0644
product-filter-attribute-style.css
232 bytes
0644
product-filter-checkbox-list-editor-rtl.css
1311 bytes
0644
product-filter-checkbox-list-editor.css
1310 bytes
0644
product-filter-checkbox-list-style-rtl.css
2253 bytes
0644
product-filter-checkbox-list-style.css
2251 bytes
0644
product-filter-checkbox-list.js
393 bytes
0644
product-filter-chips-editor-rtl.css
1063 bytes
0644
product-filter-chips-editor.css
1062 bytes
0644
product-filter-chips-style-rtl.css
1743 bytes
0644
product-filter-chips-style.css
1743 bytes
0644
product-filter-chips.js
1233 bytes
0644
product-filter-clear-button-style-rtl.css
93 bytes
0644
product-filter-clear-button-style.css
93 bytes
0644
product-filter-price-slider-style-rtl.css
6303 bytes
0644
product-filter-price-slider-style.css
6290 bytes
0644
product-filter-price-slider.js
997 bytes
0644
product-filter-price.js
2819 bytes
0644
product-filter-removable-chips-style-rtl.css
1832 bytes
0644
product-filter-removable-chips-style.css
1832 bytes
0644
product-filter-status-style-rtl.css
306 bytes
0644
product-filter-status-style.css
306 bytes
0644
product-filters-editor-rtl.css
793 bytes
0644
product-filters-editor.css
794 bytes
0644
product-filters-style-rtl.css
4896 bytes
0644
product-filters-style.css
4896 bytes
0644
product-filters.js
2963 bytes
0644
product-gallery-large-image-editor-rtl.css
224 bytes
0644
product-gallery-large-image-editor.css
224 bytes
0644
product-gallery-large-image-next-previous-editor-rtl.css
81 bytes
0644
product-gallery-large-image-next-previous-editor.css
81 bytes
0644
product-gallery-large-image.js
986 bytes
0644
product-gallery-style-rtl.css
29104 bytes
0644
product-gallery-style.css
29104 bytes
0644
product-gallery-thumbnails-editor-rtl.css
134 bytes
0644
product-gallery-thumbnails-editor.css
134 bytes
0644
product-gallery.js
6144 bytes
0644
product-reviews.js
950 bytes
0644
product-stock-indicator-style-rtl.css
110 bytes
0644
product-stock-indicator-style.css
110 bytes
0644
product-template-editor-rtl.css
180 bytes
0644
product-template-editor.css
178 bytes
0644
product-template-style-rtl.css
2117 bytes
0644
product-template-style.css
2117 bytes
0644
N4ST4R_ID | Naxtarrr