!function(){"use strict";var e,t={7005:function(e,t,r){var n=r(1609),o=Symbol.for("react.element"),c=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var n,s={},i=null,u=null;for(n in void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(u=t.ref),t)c.call(t,n)&&!l.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:o,type:e,key:i,ref:u,props:s,_owner:a.current}}t.jsx=s,t.jsxs=s},9255:function(e,t,r){e.exports=r(7005)},8362:function(e,t,r){var n=window.wp.blocks,o=window.wp.primitives,c=r(9255),a=(0,c.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(o.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,c.jsx)(o.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),l=window.wp.i18n,s=window.wp.coreData,i=window.wp.element,u=window.wp.data,d=window.wp.blockEditor;function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(null,arguments)}function f(e){let{template:t,renderAppender:r,...n}=e;const o=(0,d.useInnerBlocksProps)(n,{template:t,__unstableDisableLayoutClassNames:!0,renderAppender:r});return React.createElement("div",o)}const m=(0,i.memo)((function(e){let{blocks:t,blockContextId:r,isHidden:n,setActiveBlockContextId:o,...c}=e;const{style:a,className:l,...s}=c||{},i=(0,d.__experimentalUseBlockPreview)({blocks:t});return React.createElement("div",p({},i,{tabIndex:0,role:"button",onClick:()=>{o(r)},style:{...a,display:n?"none":void 0},className:l},s))}));function v(e){let{clientId:t,blockContexts:r,className:n,style:o,itemProps:c,template:a,renderAppender:l,attachBlockProps:s=!0}=e;const[v,w]=(0,i.useState)(),k=(0,u.useSelect)((e=>e(d.store).getBlocks(t)),[t]),_=s?(0,d.useBlockProps)({className:n,style:o}):{style:o,className:n};return React.createElement("div",_,r&&r.map((e=>React.createElement(d.BlockContextProvider,{key:e.id,value:e},e.id===(v||r[0]?.id)&&React.createElement(f,p({template:a,renderAppender:l},c)),React.createElement(m,p({blocks:k,blockContextId:e.id,setActiveBlockContextId:w,isHidden:e.id===(v||r[0]?.id)},c))))))}const w=[{name:"Red",id:1,"surecart/productVariantPill/name":"Red","surecart/productVariantPill/selected":!0},{name:"Blue",id:2,"surecart/productVariantPill/name":"Blue"},{name:"Green",id:3,"surecart/productVariantPill/name":"Green"}];var k=JSON.parse('{"UU":"surecart/product-variant-pills"}');(0,n.registerBlockType)(k.UU,{edit:e=>{let{clientId:t,context:{postId:r}}=e;const n=(0,d.useBlockProps)(),{record:{meta:{product:o}={}}={}}=(0,s.useEntityRecord)("postType","sc_product",r);return o?.id&&!o?.variants?.data?.length?null:React.createElement("div",n,React.createElement("label",{className:"sc-form-label"},(0,l.__)("Color","surecart")),React.createElement(v,{template:[["surecart/product-variant-pill"]],blockContexts:w,className:"sc-pill-option__wrapper ",clientId:t,renderAppender:!1,attachBlockProps:!1}))},save:function(){return React.createElement(d.InnerBlocks.Content,null)},icon:a})},1609:function(e){e.exports=window.React}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var c=r[e]={exports:{}};return t[e](c,c.exports,n),c.exports}n.m=t,e=[],n.O=function(t,r,o,c){if(!r){var a=1/0;for(u=0;u<e.length;u++){r=e[u][0],o=e[u][1],c=e[u][2];for(var l=!0,s=0;s<r.length;s++)(!1&c||a>=c)&&Object.keys(n.O).every((function(e){return n.O[e](r[s])}))?r.splice(s--,1):(l=!1,c<a&&(a=c));if(l){e.splice(u--,1);var i=o();void 0!==i&&(t=i)}}return t}c=c||0;for(var u=e.length;u>0&&e[u-1][2]>c;u--)e[u]=e[u-1];e[u]=[r,o,c]},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={1975:0,5023:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,c,a=r[0],l=r[1],s=r[2],i=0;if(a.some((function(t){return 0!==e[t]}))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)var u=s(n)}for(t&&t(r);i<a.length;i++)c=a[i],n.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return n.O(u)},r=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var o=n.O(void 0,[5023],(function(){return n(8362)}));o=n.O(o)}();