| 1 |
(()=>{"use strict";var e={20:(e,r,t)=>{var s=t(609),i=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function p(e,r,t){var s,n={},p=null,l=null;for(s in void 0!==t&&(p=""+t),void 0!==r.key&&(p=""+r.key),void 0!==r.ref&&(l=r.ref),r)o.call(r,s)&&!c.hasOwnProperty(s)&&(n[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps)void 0===n[s]&&(n[s]=r[s]);return{$$typeof:i,type:e,key:p,ref:l,props:n,_owner:a.current}}r.Fragment=n,r.jsx=p,r.jsxs=p},609:e=>{e.exports=window.React},848:(e,r,t)=>{e.exports=t(20)}},r={};const t=window.wc.blocksCheckout,s=window.wc.blocksComponents,i=window.wp.i18n,n=window.wp.plugins,o=window.wc.priceFormat;var a=function t(s){var i=r[s];if(void 0!==i)return i.exports;var n=r[s]={exports:{}};return e[s](n,n.exports,t),n.exports}(848);(0,t.registerCheckoutFilters)("sdevs-subscription",{cartItemPrice:(e,r,t,s)=>{const{cartItem:n}=t,{totals:o}=n;return void 0===o?e:"0"===o.line_total?`<price/> ${(0,i.__)("Due Today","subscription")}`:e},subtotalPriceFormat:(e,r,t,s)=>{const{sdevs_subscription:n}=r,{sdevs_subscription:o}=r;if(n&&n.type){const e=n.type.charAt(0).toUpperCase()+n.type.slice(1),r=parseInt(n.max_no_payment,10),t=!isNaN(r)&&r>0?` x ${r}`:"",s=n.time&&n.time>1?n.time+"-":"";return"<price/> "+(0,i.__)("Every","subscription")+" "+s+e+t}return e}});const c=({cart:e,extensions:r})=>{if(0===Object.keys(r).length)return;const{cartTotals:n}=e,{sdevs_subscription:c}=r;if(0===c.length)return;const p=(0,o.getCurrencyFromPriceResponse)(n),l=Math.pow(10,p.minorUnit);return(0,a.jsx)(t.TotalsWrapper,{children:(0,a.jsx)(t.TotalsItem,{className:"wc-block-components-totals-footer-item",label:(0,i.__)("Recurring totals","subscription"),description:(0,a.jsx)("div",{style:{display:"grid"},children:c.map(e=>{const r=e.type.charAt(0).toUpperCase()+e.type.slice(1),t={currency:p.code,currency_symbol:p.symbol,decimal_separator:p.decimalSeparator,thousand_separator:p.thousandSeparator,precision:p.minorUnit,price_format:p.priceFormat},n=e=>(0,o.formatPrice)(Math.round(e*l),t),c=parseInt(e.recurring_limit,10)||0,m=e.time&&e.time>1?`${e.time}-${r}`:r;return(0,a.jsxs)("div",{style:{margin:"8px 0px 0px",float:"right"},children:[(0,a.jsxs)("div",{style:{fontSize:"18px"},children:[e.has_recurring_discount&&(0,a.jsx)("del",{"aria-hidden":"true",style:{marginRight:"6px",opacity:.6},children:n(e.full_price)}),(0,a.jsx)(s.FormattedMonetaryAmount,{currency:p,value:Math.round(e.price*l)}),(0,a.jsxs)("span",{class:"wpsubs-subscription-timing",children:[" / ",e.time&&e.time>1?e.time+"-"+r+" ":r]})]}),(0,a.jsx)("small",{children:e.description}),e.has_one_time_discount&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsx)("small",{children:(0,i.sprintf)( |
| 7 |
(0,i.__)("Discount applies to your first %1$s payments. After that, %2$s.","subscription"),c,`${n(e.full_price)} / ${m}`)})]}),"yes"===e.can_user_cancel&&(""===e.max_no_payment||0===parseInt(e.max_no_payment))&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsxs)("small",{children:[(0,i.__)("You can cancel subscription at any time!","subscription")," "]})]}),parseInt(e.max_no_payment)>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsx)("small",{children:(0,i.sprintf)( |