(()=>{"use strict";var t={n:e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},d:(e,s)=>{for(var o in s)t.o(s,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.wp.data,s=window.wp.blocks,o=window.wp.apiFetch;var r=t.n(o);const a=window.ReactJSXRuntime;new class{constructor(){this.vs_injector_init(),this.initProductsStore(),this.initClubsStore()}initProductsStore(){const t={producer:null,products:[],productsOptions:[],states:[]},s={setProducts:t=>({type:"SET_PRODUCTS",payload:t}),setAll:t=>({type:"SET_ALL",payload:t})},o=(0,e.createReduxStore)("vsInjectorProductItemStore",{initialState:t,actions:s,reducer(e=t,s){if("SET_PRODUCTS"===s.type)return{...e,products:s.payload};if("SET_ALL"===s.type){const t=s.payload.products.map((t=>{const e=document.createElement("div");return e.innerHTML=t.displayName,{label:e.textContent,value:t.id,disabled:!1}}));return t.unshift({label:"Select a Product",value:null,disabled:!1}),{...e,producer:s.payload.producer,products:s.payload.products,states:s.payload.states,productsOptions:t}}return e},selectors:{getProducer:t=>t.producer,getProducts:t=>t.products,getProductsOptions:t=>t.productsOptions,getStates:t=>t.states,getAll:t=>t,getProductById(t,e){const s=t.products.findIndex((t=>t.id===e));return s>=0?t.products[s]:null}},resolvers:{getAll:async()=>await r()({method:"GET",path:"/vinoshipper-injector/v1/products"}).then((t=>s.setAll(t))).catch((t=>Promise.reject(t)))}});(0,e.register)(o)}initClubsStore(){const t={availableClubs:[],clubsAsOptions:[]},s={setAll:t=>({type:"SET_ALL",payload:t})},o=(0,e.createReduxStore)("vsInjectorClubsStore",{initialState:t,actions:s,reducer:(e=t,s)=>"SET_ALL"===s.type?{...e,availableClubs:s.payload.availableClubs}:e,selectors:{getAll:t=>t},resolvers:{getAll:async()=>await r()({method:"GET",path:"/vinoshipper-injector/v1/clubs"}).then((t=>s.setAll(t))).catch((t=>Promise.reject(t)))}});(0,e.register)(o)}vs_generate_logo(){return(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",children:[(0,a.jsxs)("defs",{children:[(0,a.jsx)("style",{children:".vs-logo-gradient{fill:url(#vs-logo-linear-gradient);}"}),(0,a.jsxs)("linearGradient",{id:"vs-logo-linear-gradient",x1:"412.34",y1:"681.61",x2:"678.24",y2:"458.49",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{offset:"0",stopColor:"#fff",stopOpacity:"0.35"}),(0,a.jsx)("stop",{offset:"0.08",stopColor:"#fff",stopOpacity:"0.46"}),(0,a.jsx)("stop",{offset:"0.21",stopColor:"#fff",stopOpacity:"0.63"}),(0,a.jsx)("stop",{offset:"0.34",stopColor:"#fff",stopOpacity:"0.76"}),(0,a.jsx)("stop",{offset:"0.47",stopColor:"#fff",stopOpacity:"0.87"}),(0,a.jsx)("stop",{offset:"0.6",stopColor:"#fff",stopOpacity:"0.94"}),(0,a.jsx)("stop",{offset:"0.74",stopColor:"#fff",stopOpacity:"0.99"}),(0,a.jsx)("stop",{offset:"0.89",stopColor:"#fff"})]})]}),(0,a.jsx)("circle",{fill:"#8031a7",cx:"512",cy:"512",r:"512"}),(0,a.jsx)("path",{fill:"#ffffff",d:"M512.58,651.42,405.75,246A40,40,0,0,0,367,216.16H323.74a40.05,40.05,0,0,0-38.67,50.5L424.21,781.25a67.22,67.22,0,0,0,64.88,49.67h47a67.15,67.15,0,0,0,53.5-26.61C553.43,803,534.37,734.91,512.58,651.42Z"}),(0,a.jsx)("path",{className:"vs-logo-gradient",d:"M701.44,216.16H658.15A40.05,40.05,0,0,0,619.42,246L512.58,651.42c21.79,83.49,40.85,151.57,77,152.89A68.32,68.32,0,0,0,601,781.25L740.1,266.66A40.05,40.05,0,0,0,701.44,216.16Z"})]})}vs_injector_init(){(0,s.updateCategory)("vinoshipper",{icon:this.vs_generate_logo()})}}})();