| @@ -1 +1,10 @@ | ||
| 1 | -(()=>{"use strict";var e={20:(e,t,r)=>{var s=r(609),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var s,i={},l=null,p=null;for(s in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(p=t.ref),t)n.call(t,s)&&!a.hasOwnProperty(s)&&(i[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===i[s]&&(i[s]=t[s]);return{$$typeof:o,type:e,key:l,ref:p,props:i,_owner:c.current}}t.Fragment=i,t.jsx=l,t.jsxs=l},609:e=>{e.exports=window.React},848:(e,t,r)=>{e.exports=r(20)}},t={};const r=window.wc.blocksCheckout,s=window.wc.blocksComponents,o=window.wp.plugins,i=window.wp.i18n,n=window.wc.priceFormat;var c=function r(s){var o=t[s];if(void 0!==o)return o.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}(848);(0,r.registerCheckoutFilters)("sdevs-subscription",{cartItemPrice:(e,t,r,s)=>{const{sdevs_subscription:o}=t,{cartItem:i}=r,{totals:n}=i;return void 0===n?e:"0"===n.line_total?"<price/> Due Today":o.type?`<price/> / ${o.time&&o.time>1?" "+o.time+"-":""}${o.type}`:e},subtotalPriceFormat:(e,t,r,s)=>{const{sdevs_subscription:o}=t;return o&&o.type?`<price/> every ${o.time&&o.time>1?" "+o.time+"-":""}${o.type}`:e}});const a=({cart:e,extensions:t})=>{if(0===Object.keys(t).length)return;const{cartTotals:o}=e,{sdevs_subscription:a}=t,l=(0,n.getCurrencyFromPriceResponse)(o);return 0!==a.length?(0,c.jsx)(r.TotalsItem,{className:"wc-block-components-totals-footer-item",label:(0,i.__)("Recurring totals","sdevs_subscrpt"),description:(0,c.jsx)("div",{style:{display:"grid"},children:a.map((e=>(0,c.jsxs)("div",{style:{margin:"20px 0",float:"right"},children:[(0,c.jsxs)("div",{style:{fontSize:"18px"},children:[(0,c.jsx)(s.FormattedMonetaryAmount,{currency:l,value:parseInt(e.price,10)})," ","/"," ",e.time&&e.time>1?e.time+"-"+e.type+" ":e.type]}),(0,c.jsx)("small",{children:e.description}),"yes"===e.can_user_cancel&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("br",{}),(0,c.jsxs)("small",{children:["You can cancel subscription at any time!"," "]})]})]})))})}):void 0};(0,o.registerPlugin)("sdevs-subscription",{render:()=>(0,c.jsx)(r.ExperimentalOrderMeta,{children:(0,c.jsx)(a,{})}),scope:"woocommerce-checkout"})})(); | |
| 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)( | |
| 2 | +// translators: 1: amount paid today, 2: amount charged on each renewal. | |
| 3 | +// translators: 1: amount paid today, 2: amount charged on each renewal. | |
| 4 | +(0,i.__)("You pay %1$s today. %2$s will be charged from the next renewal.","subscription"),n(e.first_price),n(e.price))})]}),e.has_recurring_discount&&c>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsx)("small",{children:(0,i.sprintf)( | |
| 5 | +// translators: 1: number of discounted payments, 2: full price charged afterwards. | |
| 6 | +// translators: 1: number of discounted payments, 2: full price charged afterwards. | |
| 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)( | |
| 8 | +// translators: 1: number of installments, 2: total amount. | |
| 9 | +// translators: 1: number of installments, 2: total amount. | |
| 10 | +(0,i.__)("This subscription will be billed in %1$s installments, for a total of %2$s.","subscription"),e.max_no_payment,n(null!=e.split_total?e.split_total:e.price*parseInt(e.max_no_payment)))})]})]})})})})})};(0,n.registerPlugin)("sdevs-subscription",{render:()=>(0,a.jsx)(t.ExperimentalOrderMeta,{children:(0,a.jsx)(c,{})}),scope:"woocommerce-checkout"})})(); | |