PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.0.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.0.0
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
subscription / build / dashboard.js

dashboard.js in Subscriptions for WooCommerce with Stripe Recurring Payments 2.0.0, at build/dashboard.js

3 lines 10.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";var s={20:(s,e,r)=>{var a=r(609),n=Symbol.for("react.element"),t=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,c=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(s,e,r){var a,t={},d=null,p=null;for(a in void 0!==r&&(d=""+r),void 0!==e.key&&(d=""+e.key),void 0!==e.ref&&(p=e.ref),e)i.call(e,a)&&!l.hasOwnProperty(a)&&(t[a]=e[a]);if(s&&s.defaultProps)for(a in e=s.defaultProps)void 0===t[a]&&(t[a]=e[a]);return{$$typeof:n,type:s,key:d,ref:p,props:t,_owner:c.current}}e.Fragment=t,e.jsx=d,e.jsxs=d},609:s=>{s.exports=window.React},848:(s,e,r)=>{s.exports=r(20)}},e={};const r=window.wp.element,a=window.wp.i18n,n=window.wp.components;var t=function r(a){var n=e[a];if(void 0!==n)return n.exports;var t=e[a]={exports:{}};return s[a](t,t.exports,r),t.exports}(848);const i={people:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,t.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,t.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"})]}),pause:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"10",y1:"15",x2:"10",y2:"9"}),(0,t.jsx)("line",{x1:"14",y1:"15",x2:"14",y2:"9"})]}),money:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("path",{d:"M14.5 9.5a2.5 2.5 0 0 0-2.5-1.5c-1.4 0-2.5.7-2.5 2s1.1 2 2.5 2 2.5.7 2.5 2-1.1 2-2.5 2a2.5 2.5 0 0 1-2.5-1.5"}),(0,t.jsx)("line",{x1:"12",y1:"6",x2:"12",y2:"18"})]}),alert:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),(0,t.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,t.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),trend:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18"}),(0,t.jsx)("polyline",{points:"17 6 23 6 23 12"})]}),chart:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),(0,t.jsx)("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),(0,t.jsx)("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]}),card:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2"}),(0,t.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),shield:(0,t.jsx)("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),check:(0,t.jsx)("polyline",{points:"20 6 9 17 4 12"}),external:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,t.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,t.jsx)("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})};function c({name:s,size:e=16}){return i[s]?(0,t.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:i[s]}):null}function l({items:s}){return(0,t.jsx)("div",{className:"subscrpt-tiles",children:s.map(s=>(0,t.jsxs)("a",{className:"subscrpt-tile"+(s.tone?` is-${s.tone}`:""),href:s.url,children:[(0,t.jsx)("span",{className:"subscrpt-tile__icon",children:(0,t.jsx)(c,{name:s.icon})}),(0,t.jsx)("span",{className:"subscrpt-tile__value",children:(new Intl.NumberFormat).format(s.value)}),(0,t.jsx)("span",{className:"subscrpt-tile__label",children:s.label})]},s.key))})}function d({chart:s}){const e=s.months||[],r=Math.max(...e.map(s=>s.total),0);return(0,t.jsxs)("div",{className:"subscrpt-chart",children:[(0,t.jsxs)("div",{className:"subscrpt-chart__total",children:[(0,t.jsx)("span",{className:"subscrpt-chart__amount",children:s.display}),(0,t.jsx)("span",{className:"subscrpt-chart__caption",children:(0,a.sprintf)(/* translators: %d: number of months. */ /* translators: %d: number of months. */
2 (0,a.__)("across the last %d months","subscription"),e.length)})]}),s.empty?(0,t.jsx)("p",{className:"subscrpt-chart__empty",children:(0,a.__)("No subscription revenue yet. Bars appear once orders come in.","subscription")}):(0,t.jsx)("div",{className:"subscrpt-chart__plot",role:"img","aria-label":e.map(s=>`${s.label}: ${s.display}`).join(", "),children:e.map(s=>{const e=r>0?s.total/r:0,a=s.total>0?Math.max(2,132*e):0;return(0,t.jsxs)("div",{className:"subscrpt-chart__col",children:[(0,t.jsx)("span",{className:"subscrpt-chart__bar-wrap",children:(0,t.jsx)("span",{className:"subscrpt-chart__bar"+(s.total>0?"":" is-empty"),style:{height:`${a}px`}})}),(0,t.jsx)("span",{className:"subscrpt-chart__value",children:s.total>0?s.display:""}),(0,t.jsx)("span",{className:"subscrpt-chart__month",children:s.label})]},s.month)})})]})}function p({health:s}){const e="clear"===s.state;return(0,t.jsxs)("div",{className:`subscrpt-banner is-${s.state}`,children:[(0,t.jsx)("span",{className:"subscrpt-banner__badge",children:(0,t.jsx)(c,{name:e?"shield":"alert",size:20})}),(0,t.jsxs)("div",{className:"subscrpt-banner__body",children:[(0,t.jsx)("p",{className:"subscrpt-banner__title",children:s.title}),(0,t.jsx)("p",{className:"subscrpt-banner__text",children:s.text})]}),s.action&&(0,t.jsx)(n.Button,{variant:"primary",href:s.action.url,children:s.action.label})]})}function o({setup:s}){return(0,t.jsx)("span",{className:"subscrpt-setup__count",children:(0,a.sprintf)(/* translators: 1: steps done, 2: steps total. */ /* translators: 1: steps done, 2: steps total. */
3 (0,a.__)("%1$d of %2$d done","subscription"),s.done,s.total)})}function u({wizard:s}){return(0,t.jsxs)("a",{className:"subscrpt-setup__wizard",href:s.url,children:[s.label,(0,t.jsx)("span",{"aria-hidden":"true",children:""})]})}function x({gateway:s}){return(0,t.jsxs)("div",{className:"subscrpt-setup__warning",children:[(0,t.jsx)("span",{className:"subscrpt-setup__warning-icon",children:(0,t.jsx)(c,{name:"alert",size:16})}),(0,t.jsxs)("div",{className:"subscrpt-setup__warning-body",children:[(0,t.jsx)("p",{className:"subscrpt-setup__warning-title",children:s.title}),(0,t.jsx)("p",{className:"subscrpt-setup__warning-text",children:s.text}),(0,t.jsx)(n.Button,{variant:"secondary",size:"small",href:s.action.url,children:s.action.label})]})]})}function h({setup:s}){if(s.complete)return(0,t.jsx)(n.Card,{className:"subscrpt-setup is-complete",children:(0,t.jsxs)(n.CardBody,{children:[(0,t.jsxs)("div",{className:"subscrpt-setup__summary",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"subscrpt-heading",children:(0,a.__)("Onboarding","subscription")}),(0,t.jsx)(o,{setup:s})]}),(0,t.jsx)(u,{wizard:s.wizard})]}),s.gateway&&(0,t.jsx)(x,{gateway:s.gateway})]})});const e=Math.round(s.done/s.total*100);return(0,t.jsxs)(n.Card,{className:"subscrpt-setup",children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"subscrpt-heading",children:(0,a.__)("Onboarding","subscription")}),(0,t.jsx)("p",{className:"subscrpt-sub",children:(0,a.__)("Your first plan, step by step.","subscription")})]}),(0,t.jsx)(o,{setup:s})]}),(0,t.jsxs)(n.CardBody,{children:[(0,t.jsx)("div",{className:"subscrpt-progress",role:"progressbar","aria-valuenow":s.done,"aria-valuemin":0,"aria-valuemax":s.total,children:(0,t.jsx)("span",{className:"subscrpt-progress__bar",style:{width:`${e}%`}})}),(0,t.jsx)("ul",{className:"subscrpt-steps",children:s.items.map(s=>(0,t.jsxs)("li",{className:"subscrpt-step"+(s.done?" is-done":""),children:[(0,t.jsx)("span",{className:"subscrpt-step__mark",children:s.done?(0,t.jsx)(c,{name:"check",size:13}):null}),(0,t.jsx)("span",{className:"subscrpt-step__label",children:s.label}),s.done?(0,t.jsx)("span",{className:"subscrpt-step__state",children:(0,a.__)("Done","subscription")}):(0,t.jsx)(n.Button,{variant:"secondary",size:"small",href:s.action.url,children:s.action.label})]},s.id))}),s.gateway&&(0,t.jsx)(x,{gateway:s.gateway}),(0,t.jsx)("div",{className:"subscrpt-setup__footer",children:(0,t.jsx)(u,{wizard:s.wizard})})]})]})}function b(){return(0,t.jsx)("span",{className:"wpsubs-badge wpsubs-badge--pro subscrpt-pro-badge",title:(0,a.__)("WPSubscription Pro required","subscription"),children:(0,a.__)("Pro","subscription")})}function j({cards:s}){return(0,t.jsxs)("section",{className:"subscrpt-build",children:[(0,t.jsx)("h2",{className:"subscrpt-heading",children:(0,a.__)("Build with WPSubscription","subscription")}),(0,t.jsx)("p",{className:"subscrpt-sub",children:(0,a.__)("Everything you need to grow recurring revenue.","subscription")}),(0,t.jsx)("div",{className:"subscrpt-build__grid",children:s.map(s=>(0,t.jsxs)("a",{className:`subscrpt-build__card is-${s.tone}`,href:s.link.url,target:s.link.external?"_blank":void 0,rel:s.link.external?"noreferrer noopener":void 0,children:[(0,t.jsx)("span",{className:"subscrpt-build__icon",children:(0,t.jsx)(c,{name:s.icon,size:18})}),(0,t.jsxs)("span",{className:"subscrpt-build__eyebrow",children:[s.eyebrow,s.pro&&" ",s.pro&&(0,t.jsx)(b,{})]}),(0,t.jsx)("span",{className:"subscrpt-build__title",children:s.title}),(0,t.jsx)("span",{className:"subscrpt-build__text",children:s.text}),(0,t.jsxs)("span",{className:"subscrpt-build__link",children:[s.link.label,s.link.external?(0,t.jsx)(c,{name:"external",size:12}):(0,t.jsx)("span",{"aria-hidden":"true",children:""})]})]},s.tone))})]})}function _({links:s}){return(0,t.jsx)("p",{className:"subscrpt-footer",children:s.map((s,e)=>(0,t.jsxs)("span",{children:[e>0&&(0,t.jsx)("span",{className:"subscrpt-footer__sep","aria-hidden":"true",children:"·"}),(0,t.jsxs)("a",{href:s.url,target:"_blank",rel:"noreferrer noopener",children:[s.label,(0,t.jsx)(c,{name:"external",size:11})]})]},s.url))})}function m({data:s}){const{pulse:e=[],chart:r,health:i,setup:c,build:o=[],footer:u=[]}=s;return(0,t.jsxs)("div",{className:"subscrpt-dash",children:[(0,t.jsxs)(n.Card,{className:"subscrpt-dash__pulse",children:[(0,t.jsx)(n.CardHeader,{children:(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"subscrpt-heading",children:(0,a.__)("Subscription pulse","subscription")}),(0,t.jsx)("p",{className:"subscrpt-sub",children:(0,a.__)("Live counts of subscriptions and renewal activity in your store.","subscription")})]})}),(0,t.jsx)(n.CardBody,{children:(0,t.jsx)(l,{items:e})})]}),(0,t.jsxs)("div",{className:"subscrpt-dash__split",children:[(0,t.jsx)("div",{className:"subscrpt-dash__main",children:r&&(0,t.jsxs)(n.Card,{children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"subscrpt-heading",children:(0,a.__)("Monthly sales","subscription")}),(0,t.jsx)("p",{className:"subscrpt-sub",children:(0,a.__)("Revenue from subscription orders.","subscription")})]}),(0,t.jsxs)(n.Button,{variant:"tertiary",href:r.url,children:[(0,a.__)("Open reports","subscription"),r.pro&&" ",r.pro&&(0,t.jsx)(b,{})]})]}),(0,t.jsx)(n.CardBody,{children:(0,t.jsx)(d,{chart:r})})]})}),(0,t.jsxs)("aside",{className:"subscrpt-dash__aside",children:[i&&(0,t.jsx)(p,{health:i}),c&&(0,t.jsx)(h,{setup:c})]})]}),(0,t.jsx)(j,{cards:o}),(0,t.jsx)(_,{links:u})]})}const y=document.getElementById("subscrpt-dashboard");y&&window.subscrptDashboard&&(0,r.createRoot)(y).render((0,t.jsx)(m,{data:window.subscrptDashboard}))})();