OwlCyberSecurity - MANAGER
Edit File: mini-cart.js
import*as t from"@wordpress/interactivity";var e,r,o,n,a={9156:(t,e,r)=>{r.a(t,(async(t,e)=>{try{var o=r(2833),n=r(1064),a=r(9385),c=r(8520),i=t([n]);n=(i.then?(await i)():i)[0];const s="I acknowledge that using a private store means my plugin will inevitably break on the next store release.",{state:m}=(0,o.store)("woocommerce",{},{lock:s});(0,a.A)();const{state:l}=(0,o.store)("woocommerce/mini-cart",{},{lock:!0});(0,o.store)("woocommerce/mini-cart",{state:{get totalItemsInCart(){return m.cart.items.reduce(((t,{quantity:e})=>t+e),0)},get drawerOverlayClass(){const{isOpen:t}=(0,o.getContext)(),e="wc-block-components-drawer__screen-overlay wc-block-components-drawer__screen-overlay--with-slide-out";return t?`${e} wc-block-components-drawer__screen-overlay--with-slide-in`:`${e} wc-block-components-drawer__screen-overlay--is-hidden`},get badgeIsVisible(){const t=l.totalItemsInCart>0,{productCountVisibility:e}=(0,o.getContext)();return"always"===e||"greater_than_zero"===e&&t},get cartIsEmpty(){return 0===l.totalItemsInCart}},callbacks:{openDrawer(){(0,o.getContext)().isOpen=!0},closeDrawer(){(0,o.getContext)().isOpen=!1},overlayCloseDrawer(t){t.target===t.currentTarget&&((0,o.getContext)().isOpen=!1)}}},{lock:s});const{state:u}=(0,o.store)("woocommerce/mini-cart-items-block",{state:{get reduceQuantityLabel(){const{cartItem:t}=(0,o.getContext)(),{reduceQuantityLabel:e}=(0,o.getConfig)("woocommerce/mini-cart-items-block");return e.replace("%s",t.name)},get increaseQuantityLabel(){const{cartItem:t}=(0,o.getContext)(),{increaseQuantityLabel:e}=(0,o.getConfig)("woocommerce/mini-cart-items-block");return e.replace("%s",t.name)},get quantityDescriptionLabel(){const{cartItem:t}=(0,o.getContext)(),{quantityDescriptionLabel:e}=(0,o.getConfig)("woocommerce/mini-cart-items-block");return e.replace("%s",t.name)},get removeFromCartLabel(){const{cartItem:t}=(0,o.getContext)(),{removeFromCartLabel:e}=(0,o.getConfig)("woocommerce/mini-cart-items-block");return e.replace("%s",t.name)},get cartItemName(){const{cartItem:t}=(0,o.getContext)(),e=document.createElement("textarea");return e.innerHTML=t.name,e.value},get itemThumbnail(){const{cartItem:t}=(0,o.getContext)();return t.images[0]?.thumbnail||""},get cartItems(){return m.cart.items},itemShortDescription(){const t=(0,o.getElement)(),{cartItem:e}=(0,o.getContext)();if(t.ref){const r=t.ref.querySelector(".wc-block-components-product-metadata__description");r&&(r.innerHTML=e.short_description)}},get itemPrice(){const{cartItem:t}=(0,o.getContext)(),{currency:e}=(0,o.getConfig)("woocommerce"),r=(0,c.a)(m.cart.totals,e);return(0,c.U)(t.prices.price,r)},get lineItemTotal(){const{cartItem:t}=(0,o.getContext)(),{displayCartPriceIncludingTax:e}=(0,o.getConfig)("woocommerce/mini-cart"),{currency:r}=(0,o.getConfig)("woocommerce"),n=(0,c.a)(m.cart.totals,r),a=t.totals,i=e?parseInt(a.line_subtotal,10)+parseInt(a.line_subtotal_tax,10):parseInt(a.line_subtotal,10);return(0,c.U)(i,n)}},actions:{*incrementQuantity(){const{cartItem:t}=(0,o.getContext)(),{actions:e}=(0,o.store)("woocommerce",{},{lock:s});yield e.addCartItem({id:t.id,quantity:t.quantity+1})},*decrementQuantity(){const{cartItem:t}=(0,o.getContext)(),{actions:e}=(0,o.store)("woocommerce",{},{lock:s});yield e.addCartItem({id:t.id,quantity:t.quantity-1})}}},{lock:!0});(0,o.store)("woocommerce/mini-cart-title-items-counter-block",{state:{get cartItems(){return u.cartItems},get itemsInCartText(){const{singularItemsText:t,pluralItemsText:e}=(0,o.getConfig)("woocommerce/mini-cart-title-items-counter-block"),r=l.totalItemsInCart;return(1===r?t:e).replace("%d",r.toString())}}},{lock:!0}),(0,o.store)("woocommerce/mini-cart-footer-block",{state:{get formattedSubtotal(){const{displayCartPriceIncludingTax:t}=(0,o.getConfig)("woocommerce/mini-cart-footer-block"),{currency:e}=(0,o.getConfig)("woocommerce"),r=t?parseInt(m.cart.totals.total_items,10)+parseInt(m.cart.totals.total_items_tax,10):parseInt(m.cart.totals.total_items,10),n=(0,c.a)(m.cart.totals,e);return(0,c.U)(r,n)}}},{lock:!0}),e()}catch(t){e(t)}}))},9385:(t,e,r)=>{function o(t,e){if(!t)return null;const r=window.getComputedStyle(t)[e];if("rgba(0, 0, 0, 0)"!==r&&"transparent"!==r){const t=r.match(/\d+/g);if(!t||t.length<3)return null;const[e,o,n]=t.slice(0,3);return`rgb(${e}, ${o}, ${n})`}return o(t.parentElement,e)}r.d(e,{A:()=>n});const n=function(){const t=document.createElement("style"),e=getComputedStyle(document.body).backgroundColor,r=document.querySelector(".wc-block-mini-cart__button"),n=o(r,"backgroundColor")||"#fff",a=o(r,"color")||"#000";t.appendChild(document.createTextNode(`:where(.wp-block-woocommerce-mini-cart-contents) {\n\t\t\t\tbackground-color: ${e};\n\t\t\t}\n\t\t\t:where(.wc-block-mini-cart__badge) {\n\t\t\t\tbackground-color: ${a};\n\t\t\t\tcolor: ${n};\n\t\t\t}`)),document.head.appendChild(t)}},8520:(t,e,r)=>{r.d(e,{U:()=>n,a:()=>o});const o=(t,e)=>{if(!t?.currency_code)return e;const{currency_code:r,currency_symbol:o,currency_thousand_separator:n,currency_decimal_separator:a,currency_minor_unit:c,currency_prefix:i,currency_suffix:s}=t;return{code:r||e.code,symbol:o||e.symbol,thousandSeparator:"string"==typeof n?n:e.thousandSeparator,decimalSeparator:"string"==typeof a?a:e.decimalSeparator,minorUnit:Number.isFinite(c)?c:e.minorUnit,prefix:"string"==typeof i?i:e.prefix,suffix:"string"==typeof s?s:e.suffix}},n=(t,e,r)=>{if(""===t||void 0===t)return"";const o="number"==typeof t?t:parseInt(t,10);return Number.isFinite(o)?((t,e)=>{const{minorUnit:r,prefix:o,suffix:n,decimalSeparator:a,thousandSeparator:c}=e,i=t/10**r,{beforeDecimal:s,afterDecimal:m}=(t=>{const e=t.split(".");return{beforeDecimal:e[0],afterDecimal:e[1]||""}})(i.toString()),l=`${o}${((t,e)=>t.replace(/\B(?=(\d{3})+(?!\d))/g,e))(s,c)}${((t,e,r)=>t?`${e}${t.padEnd(r,"0")}`:r>0?`${e}${"0".repeat(r)}`:"")(m,a,r)}${n}`,u=document.createElement("textarea");return u.innerHTML=l,u.value})(o,{...e,...r}):""}},1064:t=>{t.exports=import("@woocommerce/stores/woocommerce/cart")},2833:(e,r,o)=>{var n,a;e.exports=(n={getConfig:()=>t.getConfig,getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store},a={},o.d(a,n),a)}},c={};function i(t){var e=c[t];if(void 0!==e)return e.exports;var r=c[t]={exports:{}};return a[t](r,r.exports,i),r.exports}e="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",r="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",o="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",n=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},i.a=(t,a,c)=>{var i;c&&((i=[]).d=-1);var s,m,l,u=new Set,p=t.exports,d=new Promise(((t,e)=>{l=e,m=t}));d[r]=p,d[e]=t=>(i&&t(i),u.forEach(t),d.catch((t=>{}))),t.exports=d,a((t=>{var a;s=(t=>t.map((t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){var a=[];a.d=0,t.then((t=>{c[r]=t,n(a)}),(t=>{c[o]=t,n(a)}));var c={};return c[e]=t=>t(a),c}}var i={};return i[e]=t=>{},i[r]=t,i})))(t);var c=()=>s.map((t=>{if(t[o])throw t[o];return t[r]})),m=new Promise((t=>{(a=()=>t(c)).r=0;var r=t=>t!==i&&!u.has(t)&&(u.add(t),t&&!t.d&&(a.r++,t.push(a)));s.map((t=>t[e](r)))}));return a.r?m:c()}),(t=>(t?l(d[o]=t):m(p),n(i)))),i&&i.d<0&&(i.d=0)},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s=i(9156);s=await s;