FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
packages
/
blocks-next
/
build
/
blocks
/
cart-line-items
Edit File: index.js
!function(){"use strict";var e,t={7005:function(e,t,l){var r=l(1609),n=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,l){var r,i={},s=null,u=null;for(r in void 0!==l&&(s=""+l),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:n,type:e,key:s,ref:u,props:i,_owner:a.current}}},9255:function(e,t,l){e.exports=l(7005)},4554:function(e,t,l){var r=window.wp.blocks,n=window.wp.primitives,o=l(9255),a=(0,o.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(n.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),c=window.wp.i18n,i=window.wp.blockEditor,s=window.wp.components,u=window.wp.element,p=window.wp.data;function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)({}).hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e},f.apply(null,arguments)}function y(e){let{template:t,renderAppender:l,...r}=e;const n=(0,i.useInnerBlocksProps)(r,{template:t,__unstableDisableLayoutClassNames:!0,renderAppender:l});return React.createElement("div",n)}const d=(0,u.memo)((function(e){let{blocks:t,blockContextId:l,isHidden:r,setActiveBlockContextId:n,...o}=e;const{style:a,className:c,...s}=o||{},u=(0,i.__experimentalUseBlockPreview)({blocks:t});return React.createElement("div",f({},u,{tabIndex:0,role:"button",onClick:()=>{n(l)},style:{...a,display:r?"none":void 0},className:c},s))}));function m(e){let{clientId:t,blockContexts:l,className:r,style:n,itemProps:o,template:a,renderAppender:c,attachBlockProps:s=!0}=e;const[m,x]=(0,u.useState)(),g=(0,p.useSelect)((e=>e(i.store).getBlocks(t)),[t]),h=s?(0,i.useBlockProps)({className:r,style:n}):{style:n,className:r};return React.createElement("div",h,l&&l.map((e=>React.createElement(i.BlockContextProvider,{key:e.id,value:e},e.id===(m||l[0]?.id)&&React.createElement(y,f({template:a,renderAppender:c},o)),React.createElement(d,f({blocks:g,blockContextId:e.id,setActiveBlockContextId:x,isHidden:e.id===(m||l[0]?.id)},o))))))}var x=[["core/group",{style:{layout:{selfStretch:"fill",flexSize:null},dimensions:{minHeight:"200px"}},layout:{type:"default"}},[["core/group",{style:{layout:{selfStretch:"fit",flexSize:null}},layout:{type:"flex",flexWrap:"nowrap",verticalAlignment:"stretch"}},[["surecart/cart-line-item-image",{id:3546,width:"114px",height:"114px",scale:"cover",sizeSlug:"large",linkDestination:"none",style:{layout:{selfStretch:"fixed",flexSize:"114px"},border:{radius:"4px",width:"1px"},shadow:"none"}}],["core/group",{style:{layout:{selfStretch:"fill",flexSize:null}},layout:{type:"flex",orientation:"vertical",justifyContent:"stretch",flexWrap:"nowrap",verticalAlignment:"top"}},[["core/group",{style:{layout:{selfStretch:"fill",flexSize:null}},layout:{type:"default"}},[["core/group",{style:{layout:{selfStretch:"fill",flexSize:null}},layout:{type:"flex",flexWrap:"nowrap",verticalAlignment:"stretch",justifyContent:"space-between"}},[["core/group",{style:{layout:{selfStretch:"fixed",flexSize:"50%"},spacing:{blockGap:"10px"}},layout:{type:"default"}},[["core/paragraph",{style:{color:{text:"#4b5563"},elements:{link:{color:{text:"#4b5563"}}}},content:"<strong>Cloudnova</strong>"}],["core/paragraph",{style:{typography:{fontSize:"14px",lineHeight:"1.4"},color:{text:"#828c99"},elements:{link:{color:{text:"#828c99"}}}},content:"Black / S<br>One Time"}]]],["core/group",{style:{layout:{selfStretch:"fit",flexSize:null},spacing:{blockGap:"10px"}},layout:{type:"default"}},[["core/paragraph",{align:"right",style:{layout:{selfStretch:"fill",flexSize:null},color:{text:"#4b5563"},elements:{link:{color:{text:"#4b5563"}}}},content:"<strong>$10</strong> / mo"}],["core/paragraph",{align:"right",style:{layout:{selfStretch:"fill",flexSize:null},typography:{fontSize:"14px",lineHeight:"1.4"},color:{text:"#828c99"},elements:{link:{color:{text:"#828c99"}}}},content:"$99 Setup Fee<br>14 Day Free Trial"}]]]]]]],["core/group",{layout:{type:"flex",flexWrap:"nowrap",justifyContent:"space-between",verticalAlignment:"center"}},[["core/group",{style:{layout:{selfStretch:"fill",flexSize:null}},layout:{type:"default"}},[["core/paragraph",{style:{layout:{selfStretch:"fill",flexSize:null}},content:"Qty"}]]],["core/group",{style:{layout:{selfStretch:"fit",flexSize:null}},layout:{type:"default"}},[["core/paragraph",{style:{layout:{selfStretch:"fit",flexSize:null}},content:"Remove"}]]]]]]]]]]]],g=JSON.parse('{"UU":"surecart/slide-out-cart-line-items"}');(0,r.registerBlockType)(g.UU,{icon:a,edit:e=>{let{attributes:t,setAttributes:l,__unstableLayoutClassNames:r,clientId:n}=e;const{removable:o,editable:a,style:u}=t,{blockGap:p}=u?.spacing||{},f=scBlockData?.plugin_url+"/images/placeholder-thumbnail.jpg",y=(0,i.useBlockProps)(),d=[{id:1,quantity:2,removable:o,editable:a,price:{name:"Basic",product:{name:"Example Product",image_url:f},display_amount:scData?.currency_symbol+"12.34"}},{id:2,quantity:4,removable:o,editable:a,price:{name:"Monthly",product:{name:"Example Product",image_url:f},display_amount:scData?.currency_symbol+"123.45"}}];return React.createElement(React.Fragment,null,React.createElement(i.InspectorControls,null,React.createElement(s.PanelBody,{title:(0,c.__)("Attributes","surecart")},React.createElement(s.PanelRow,null,React.createElement(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,c.__)("Removable","surecart"),help:(0,c.__)("Allow line items to be removed.","surecart"),checked:o,onChange:e=>l({removable:e})})),React.createElement(s.PanelRow,null,React.createElement(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,c.__)("Editable","surecart"),help:(0,c.__)("Allow line item quantities to be editable.","surecart"),checked:a,onChange:e=>l({editable:e})})))),React.createElement(m,{template:x,blockContexts:d,clientId:n,blockProps:y,className:r,style:{gap:p}}))},save:function(){return React.createElement(i.InnerBlocks.Content,null)}})},1609:function(e){e.exports=window.React}},l={};function r(e){var n=l[e];if(void 0!==n)return n.exports;var o=l[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=function(t,l,n,o){if(!l){var a=1/0;for(u=0;u<e.length;u++){l=e[u][0],n=e[u][1],o=e[u][2];for(var c=!0,i=0;i<l.length;i++)(!1&o||a>=o)&&Object.keys(r.O).every((function(e){return r.O[e](l[i])}))?l.splice(i--,1):(c=!1,o<a&&(a=o));if(c){e.splice(u--,1);var s=n();void 0!==s&&(t=s)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[l,n,o]},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={7919:0,6791:0};r.O.j=function(t){return 0===e[t]};var t=function(t,l){var n,o,a=l[0],c=l[1],i=l[2],s=0;if(a.some((function(t){return 0!==e[t]}))){for(n in c)r.o(c,n)&&(r.m[n]=c[n]);if(i)var u=i(r)}for(t&&t(l);s<a.length;s++)o=a[s],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(u)},l=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))}();var n=r.O(void 0,[6791],(function(){return r(4554)}));n=r.O(n)}();
Save
Back