https://t.me/AnonymousX5
Server : Apache
System : Linux ls31.server.ly 3.10.0-962.3.2.lve1.5.68.el7.x86_64 #1 SMP Wed Apr 6 11:12:23 UTC 2022 x86_64
User : medchoco ( 2906)
PHP Version : 8.3.16
Disable Function : mail
Directory :  /home/medchoco/www/wp-content/plugins/woocommerce/assets/client/admin/product-editor/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/medchoco/www/wp-content/plugins/woocommerce/assets/client/admin/product-editor/index.js
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={83849:(e,t)=>{var o;!function(){"use strict";var r={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)){if(o.length){var i=n.apply(null,o);i&&e.push(i)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var l in o)r.call(o,l)&&o[l]&&e.push(l);else e.push(o.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(o=function(){return n}.apply(t,[]))||(e.exports=o)}()},74944:function(e){e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,o=Object.isFrozen,r=Object.getPrototypeOf,n=Object.getOwnPropertyDescriptor,a=Object.freeze,i=Object.seal,l=Object.create,c="undefined"!=typeof Reflect&&Reflect,s=c.apply,m=c.construct;s||(s=function(e,t,o){return e.apply(t,o)}),a||(a=function(e){return e}),i||(i=function(e){return e}),m||(m=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}return Array.from(e)}(t))))});var u,d=y(Array.prototype.forEach),p=y(Array.prototype.pop),_=y(Array.prototype.push),f=y(String.prototype.toLowerCase),h=y(String.prototype.match),g=y(String.prototype.replace),b=y(String.prototype.indexOf),w=y(String.prototype.trim),E=y(RegExp.prototype.test),v=(u=TypeError,function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return m(u,t)});function y(e){return function(t){for(var o=arguments.length,r=Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];return s(e,t,r)}}function C(e,r){t&&t(e,null);for(var n=r.length;n--;){var a=r[n];if("string"==typeof a){var i=f(a);i!==a&&(o(r)||(r[n]=i),a=i)}e[a]=!0}return e}function k(t){var o=l(null),r=void 0;for(r in t)s(e,t,[r])&&(o[r]=t[r]);return o}function S(e,t){for(;null!==e;){var o=n(e,t);if(o){if(o.get)return y(o.get);if("function"==typeof o.value)return y(o.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var x=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),N=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),P=a(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),A=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),M=a(["#text"]),R=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),O=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),D=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),F=i(/<%[\s\S]*|[\s\S]*%>/gm),V=i(/^data-[\-\w.\u00B7-\uFFFF]/),H=i(/^aria-[\-\w]+$/),z=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U=i(/^(?:\w+script|data):/i),j=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$=i(/^html$/i),G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function W(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}return Array.from(e)}var q=function(){return"undefined"==typeof window?null:window},Z=function(e,t){if("object"!==(void 0===e?"undefined":G(e))||"function"!=typeof e.createPolicy)return null;var o=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(o=t.currentScript.getAttribute(r));var n="dompurify"+(o?"#"+o:"");try{return e.createPolicy(n,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+n+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:q(),o=function(t){return e(t)};if(o.version="2.3.6",o.removed=[],!t||!t.document||9!==t.document.nodeType)return o.isSupported=!1,o;var r=t.document,n=t.document,i=t.DocumentFragment,l=t.HTMLTemplateElement,c=t.Node,s=t.Element,m=t.NodeFilter,u=t.NamedNodeMap,y=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,J=t.HTMLFormElement,K=t.DOMParser,X=t.trustedTypes,Y=s.prototype,Q=S(Y,"cloneNode"),ee=S(Y,"nextSibling"),te=S(Y,"childNodes"),oe=S(Y,"parentNode");if("function"==typeof l){var re=n.createElement("template");re.content&&re.content.ownerDocument&&(n=re.content.ownerDocument)}var ne=Z(X,r),ae=ne?ne.createHTML(""):"",ie=n,le=ie.implementation,ce=ie.createNodeIterator,se=ie.createDocumentFragment,me=ie.getElementsByTagName,ue=r.importNode,de={};try{de=k(n).documentMode?n.documentMode:{}}catch(e){}var pe={};o.isSupported="function"==typeof oe&&le&&void 0!==le.createHTMLDocument&&9!==de;var _e=B,fe=F,he=V,ge=H,be=U,we=j,Ee=z,ve=null,ye=C({},[].concat(W(x),W(T),W(N),W(I),W(M))),Ce=null,ke=C({},[].concat(W(R),W(O),W(L),W(D))),Se=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,Te=null,Ne=!0,Pe=!0,Ie=!1,Ae=!1,Me=!1,Re=!1,Oe=!1,Le=!1,De=!1,Be=!1,Fe=!0,Ve=!0,He=!1,ze={},Ue=null,je=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),$e=null,Ge=C({},["audio","video","img","source","image","track"]),We=null,qe=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ze="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml",Xe=Ke,Ye=!1,Qe=void 0,et=["application/xhtml+xml","text/html"],tt="text/html",ot=void 0,rt=null,nt=n.createElement("form"),at=function(e){return e instanceof RegExp||e instanceof Function},it=function(e){rt&&rt===e||(e&&"object"===(void 0===e?"undefined":G(e))||(e={}),e=k(e),ve="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS):ye,Ce="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR):ke,We="ADD_URI_SAFE_ATTR"in e?C(k(qe),e.ADD_URI_SAFE_ATTR):qe,$e="ADD_DATA_URI_TAGS"in e?C(k(Ge),e.ADD_DATA_URI_TAGS):Ge,Ue="FORBID_CONTENTS"in e?C({},e.FORBID_CONTENTS):je,xe="FORBID_TAGS"in e?C({},e.FORBID_TAGS):{},Te="FORBID_ATTR"in e?C({},e.FORBID_ATTR):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,Ne=!1!==e.ALLOW_ARIA_ATTR,Pe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=e.SAFE_FOR_TEMPLATES||!1,Me=e.WHOLE_DOCUMENT||!1,Le=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Oe=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,Ve=!1!==e.KEEP_CONTENT,He=e.IN_PLACE||!1,Ee=e.ALLOWED_URI_REGEXP||Ee,Xe=e.NAMESPACE||Ke,e.CUSTOM_ELEMENT_HANDLING&&at(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&at(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Qe=Qe=-1===et.indexOf(e.PARSER_MEDIA_TYPE)?tt:e.PARSER_MEDIA_TYPE,ot="application/xhtml+xml"===Qe?function(e){return e}:f,Ae&&(Pe=!1),De&&(Le=!0),ze&&(ve=C({},[].concat(W(M))),Ce=[],!0===ze.html&&(C(ve,x),C(Ce,R)),!0===ze.svg&&(C(ve,T),C(Ce,O),C(Ce,D)),!0===ze.svgFilters&&(C(ve,N),C(Ce,O),C(Ce,D)),!0===ze.mathMl&&(C(ve,I),C(Ce,L),C(Ce,D))),e.ADD_TAGS&&(ve===ye&&(ve=k(ve)),C(ve,e.ADD_TAGS)),e.ADD_ATTR&&(Ce===ke&&(Ce=k(Ce)),C(Ce,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&C(We,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(Ue===je&&(Ue=k(Ue)),C(Ue,e.FORBID_CONTENTS)),Ve&&(ve["#text"]=!0),Me&&C(ve,["html","head","body"]),ve.table&&(C(ve,["tbody"]),delete xe.tbody),a&&a(e),rt=e)},lt=C({},["mi","mo","mn","ms","mtext"]),ct=C({},["foreignobject","desc","title","annotation-xml"]),st=C({},T);C(st,N),C(st,P);var mt=C({},I);C(mt,A);var ut=function(e){var t=oe(e);t&&t.tagName||(t={namespaceURI:Ke,tagName:"template"});var o=f(e.tagName),r=f(t.tagName);if(e.namespaceURI===Je)return t.namespaceURI===Ke?"svg"===o:t.namespaceURI===Ze?"svg"===o&&("annotation-xml"===r||lt[r]):Boolean(st[o]);if(e.namespaceURI===Ze)return t.namespaceURI===Ke?"math"===o:t.namespaceURI===Je?"math"===o&&ct[r]:Boolean(mt[o]);if(e.namespaceURI===Ke){if(t.namespaceURI===Je&&!ct[r])return!1;if(t.namespaceURI===Ze&&!lt[r])return!1;var n=C({},["title","style","font","a","script"]);return!mt[o]&&(n[o]||!st[o])}return!1},dt=function(e){_(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},pt=function(e,t){try{_(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){_(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ce[e])if(Le||De)try{dt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){var t=void 0,o=void 0;if(Oe)e="<remove></remove>"+e;else{var r=h(e,/^[\r\n\t ]+/);o=r&&r[0]}"application/xhtml+xml"===Qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var a=ne?ne.createHTML(e):e;if(Xe===Ke)try{t=(new K).parseFromString(a,Qe)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(Xe,"template",null);try{t.documentElement.innerHTML=Ye?"":a}catch(e){}}var i=t.body||t.documentElement;return e&&o&&i.insertBefore(n.createTextNode(o),i.childNodes[0]||null),Xe===Ke?me.call(t,Me?"html":"body")[0]:Me?t.documentElement:i},ft=function(e){return ce.call(e.ownerDocument||e,e,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT,null,!1)},ht=function(e){return e instanceof J&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof y)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},gt=function(e){return"object"===(void 0===c?"undefined":G(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":G(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},bt=function(e,t,r){pe[e]&&d(pe[e],(function(e){e.call(o,t,r,rt)}))},wt=function(e){var t=void 0;if(bt("beforeSanitizeElements",e,null),ht(e))return dt(e),!0;if(h(e.nodeName,/[\u0080-\uFFFF]/))return dt(e),!0;var r=ot(e.nodeName);if(bt("uponSanitizeElement",e,{tagName:r,allowedTags:ve}),!gt(e.firstElementChild)&&(!gt(e.content)||!gt(e.content.firstElementChild))&&E(/<[/\w]/g,e.innerHTML)&&E(/<[/\w]/g,e.textContent))return dt(e),!0;if("select"===r&&E(/<template/i,e.innerHTML))return dt(e),!0;if(!ve[r]||xe[r]){if(!xe[r]&&vt(r)){if(Se.tagNameCheck instanceof RegExp&&E(Se.tagNameCheck,r))return!1;if(Se.tagNameCheck instanceof Function&&Se.tagNameCheck(r))return!1}if(Ve&&!Ue[r]){var n=oe(e)||e.parentNode,a=te(e)||e.childNodes;if(a&&n)for(var i=a.length-1;i>=0;--i)n.insertBefore(Q(a[i],!0),ee(e))}return dt(e),!0}return e instanceof s&&!ut(e)?(dt(e),!0):"noscript"!==r&&"noembed"!==r||!E(/<\/no(script|embed)/i,e.innerHTML)?(Ae&&3===e.nodeType&&(t=e.textContent,t=g(t,_e," "),t=g(t,fe," "),e.textContent!==t&&(_(o.removed,{element:e.cloneNode()}),e.textContent=t)),bt("afterSanitizeElements",e,null),!1):(dt(e),!0)},Et=function(e,t,o){if(Fe&&("id"===t||"name"===t)&&(o in n||o in nt))return!1;if(Pe&&!Te[t]&&E(he,t));else if(Ne&&E(ge,t));else if(!Ce[t]||Te[t]){if(!(vt(e)&&(Se.tagNameCheck instanceof RegExp&&E(Se.tagNameCheck,e)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(e))&&(Se.attributeNameCheck instanceof RegExp&&E(Se.attributeNameCheck,t)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(t))||"is"===t&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&E(Se.tagNameCheck,o)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(o))))return!1}else if(We[t]);else if(E(Ee,g(o,we,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==b(o,"data:")||!$e[e])if(Ie&&!E(be,g(o,we,"")));else if(o)return!1;return!0},vt=function(e){return e.indexOf("-")>0},yt=function(e){var t=void 0,r=void 0,n=void 0,a=void 0;bt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce};for(a=i.length;a--;){var c=t=i[a],s=c.name,m=c.namespaceURI;if(r=w(t.value),n=ot(s),l.attrName=n,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,bt("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(pt(s,e),l.keepAttr))if(E(/\/>/i,r))pt(s,e);else{Ae&&(r=g(r,_e," "),r=g(r,fe," "));var u=ot(e.nodeName);if(Et(u,n,r))try{m?e.setAttributeNS(m,s,r):e.setAttribute(s,r),p(o.removed)}catch(e){}}}bt("afterSanitizeAttributes",e,null)}},Ct=function e(t){var o=void 0,r=ft(t);for(bt("beforeSanitizeShadowDOM",t,null);o=r.nextNode();)bt("uponSanitizeShadowNode",o,null),wt(o)||(o.content instanceof i&&e(o.content),yt(o));bt("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e,n){var a=void 0,l=void 0,s=void 0,m=void 0,u=void 0;if((Ye=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!gt(e)){if("function"!=typeof e.toString)throw v("toString is not a function");if("string"!=typeof(e=e.toString()))throw v("dirty is not a string, aborting")}if(!o.isSupported){if("object"===G(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(gt(e))return t.toStaticHTML(e.outerHTML)}return e}if(Re||it(n),o.removed=[],"string"==typeof e&&(He=!1),He){if(e.nodeName){var d=ot(e.nodeName);if(!ve[d]||xe[d])throw v("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)1===(l=(a=_t("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!Le&&!Ae&&!Me&&-1===e.indexOf("<"))return ne&&Be?ne.createHTML(e):e;if(!(a=_t(e)))return Le?null:Be?ae:""}a&&Oe&&dt(a.firstChild);for(var p=ft(He?e:a);s=p.nextNode();)3===s.nodeType&&s===m||wt(s)||(s.content instanceof i&&Ct(s.content),yt(s),m=s);if(m=null,He)return e;if(Le){if(De)for(u=se.call(a.ownerDocument);a.firstChild;)u.appendChild(a.firstChild);else u=a;return Ce.shadowroot&&(u=ue.call(r,u,!0)),u}var _=Me?a.outerHTML:a.innerHTML;return Me&&ve["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&E($,a.ownerDocument.doctype.name)&&(_="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+_),Ae&&(_=g(_,_e," "),_=g(_,fe," ")),ne&&Be?ne.createHTML(_):_},o.setConfig=function(e){it(e),Re=!0},o.clearConfig=function(){rt=null,Re=!1},o.isValidAttribute=function(e,t,o){rt||it({});var r=ot(e),n=ot(t);return Et(r,n,o)},o.addHook=function(e,t){"function"==typeof t&&(pe[e]=pe[e]||[],_(pe[e],t))},o.removeHook=function(e){pe[e]&&p(pe[e])},o.removeHooks=function(e){pe[e]&&(pe[e]=[])},o.removeAllHooks=function(){pe={}},o}()}()},70861:(e,t,o)=>{var r=o(83250).Symbol;e.exports=r},29233:e=>{e.exports=function(e,t){for(var o=-1,r=null==e?0:e.length,n=Array(r);++o<r;)n[o]=t(e[o],o,e);return n}},97088:(e,t,o)=>{var r=o(86174)("length");e.exports=r},59512:e=>{e.exports=function(e){return e.split("")}},69823:(e,t,o)=>{var r=o(70861),n=o(91339),a=o(25151),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?n(e):a(e)}},58261:(e,t,o)=>{var r=o(69823),n=o(50440);e.exports=function(e){return n(e)&&"[object RegExp]"==r(e)}},86174:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},77379:e=>{e.exports=function(e,t,o){var r=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(o=o>n?n:o)<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var a=Array(n);++r<n;)a[r]=e[r+t];return a}},86245:(e,t,o)=>{var r=o(70861),n=o(29233),a=o(55589),i=o(52624),l=r?r.prototype:void 0,c=l?l.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return n(t,e)+"";if(i(t))return c?c.call(t):"";var o=t+"";return"0"==o&&1/t==-1/0?"-0":o}},21656:(e,t,o)=>{var r=o(62438),n=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(n,""):e}},31525:e=>{e.exports=function(e){return function(t){return e(t)}}},3237:(e,t,o)=>{var r=o(77379);e.exports=function(e,t,o){var n=e.length;return o=void 0===o?n:o,!t&&o>=n?e:r(e,t,o)}},20302:(e,t,o)=>{var r="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g;e.exports=r},91339:(e,t,o)=>{var r=o(70861),n=Object.prototype,a=n.hasOwnProperty,i=n.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),o=e[l];try{e[l]=void 0;var r=!0}catch(e){}var n=i.call(e);return r&&(t?e[l]=o:delete e[l]),n}},63932:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},8690:(e,t,o)=>{e=o.nmd(e);var r=o(20302),n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,i=a&&a.exports===n&&r.process,l=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l},25151:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},83250:(e,t,o)=>{var r=o(20302),n="object"==typeof self&&self&&self.Object===Object&&self,a=r||n||Function("return this")();e.exports=a},11324:(e,t,o)=>{var r=o(97088),n=o(63932),a=o(60445);e.exports=function(e){return n(e)?a(e):r(e)}},15233:(e,t,o)=>{var r=o(59512),n=o(63932),a=o(32205);e.exports=function(e){return n(e)?a(e):r(e)}},62438:e=>{var t=/\s/;e.exports=function(e){for(var o=e.length;o--&&t.test(e.charAt(o)););return o}},60445:e=>{var t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",r="[^\\ud800-\\udfff]",n="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",i="(?:"+t+"|"+o+")?",l="[\\ufe0e\\ufe0f]?",c=l+i+"(?:\\u200d(?:"+[r,n,a].join("|")+")"+l+i+")*",s="(?:"+[r+t+"?",t,n,a,"[\\ud800-\\udfff]"].join("|")+")",m=RegExp(o+"(?="+o+")|"+s+c,"g");e.exports=function(e){for(var t=m.lastIndex=0;m.test(e);)++t;return t}},32205:e=>{var t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",r="[^\\ud800-\\udfff]",n="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",i="(?:"+t+"|"+o+")?",l="[\\ufe0e\\ufe0f]?",c=l+i+"(?:\\u200d(?:"+[r,n,a].join("|")+")"+l+i+")*",s="(?:"+[r+t+"?",t,n,a,"[\\ud800-\\udfff]"].join("|")+")",m=RegExp(o+"(?="+o+")|"+s+c,"g");e.exports=function(e){return e.match(m)||[]}},55589:e=>{var t=Array.isArray;e.exports=t},93702:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},50440:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},68290:(e,t,o)=>{var r=o(58261),n=o(31525),a=o(8690),i=a&&a.isRegExp,l=i?n(i):r;e.exports=l},52624:(e,t,o)=>{var r=o(69823),n=o(50440);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==r(e)}},99558:(e,t,o)=>{var r=o(29153);e.exports=function(e){return e?Infinity===(e=r(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},96843:(e,t,o)=>{var r=o(99558);e.exports=function(e){var t=r(e),o=t%1;return t==t?o?t-o:t:0}},29153:(e,t,o)=>{var r=o(21656),n=o(93702),a=o(52624),i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var o=l.test(e);return o||c.test(e)?s(e.slice(2),o?2:8):i.test(e)?NaN:+e}},99835:(e,t,o)=>{var r=o(86245);e.exports=function(e){return null==e?"":r(e)}},56519:(e,t,o)=>{var r=o(86245),n=o(3237),a=o(63932),i=o(93702),l=o(68290),c=o(11324),s=o(15233),m=o(96843),u=o(99835),d=/\w*$/;e.exports=function(e,t){var o=30,p="...";if(i(t)){var _="separator"in t?t.separator:_;o="length"in t?m(t.length):o,p="omission"in t?r(t.omission):p}var f=(e=u(e)).length;if(a(e)){var h=s(e);f=h.length}if(o>=f)return e;var g=o-c(p);if(g<1)return p;var b=h?n(h,0,g).join(""):e.slice(0,g);if(void 0===_)return b+p;if(h&&(g+=b.length-g),l(_)){if(e.slice(g).search(_)){var w,E=b;for(_.global||(_=RegExp(_.source,u(d.exec(_))+"g")),_.lastIndex=0;w=_.exec(E);)var v=w.index;b=b.slice(0,void 0===v?g:v)}}else if(e.indexOf(r(_),g)!=g){var y=b.lastIndexOf(_);y>-1&&(b=b.slice(0,y))}return b+p}},31772:(e,t,o)=>{"use strict";var r=o(25148);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,t,o,n,a,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:n};return o.PropTypes=o,o}},7862:(e,t,o)=>{e.exports=o(31772)()},25148:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(a.exports,a,a.exports,o),a.loaded=!0,a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";o.r(r),o.d(r,{AUTO_DRAFT_NAME:()=>R,AddNewShippingClassModal:()=>Dr,DETAILS_SECTION_ID:()=>x,NEW_PRODUCT_MANAGEMENT_ENABLED_OPTION_NAME:()=>C,PRODUCT_STATUS_LABELS:()=>Wa,TAB_GENERAL_ID:()=>S,TRACKS_SOURCE:()=>T,__experimentalAttributeControl:()=>Wn,__experimentalAttributes:()=>Kn,__experimentalBlockIcon:()=>ja,__experimentalDetailsCategoriesField:()=>te,__experimentalDetailsDescriptionField:()=>ne,__experimentalDetailsFeatureField:()=>V,__experimentalDetailsNameField:()=>B,__experimentalDetailsSummaryField:()=>re,__experimentalEditor:()=>pt,__experimentalInitBlocks:()=>Ua,__experimentalProductFieldSection:()=>s,__experimentalProductMVPCESFooter:()=>Fe,__experimentalProductMVPFeedbackModal:()=>je,__experimentalProductMVPFeedbackModalContainer:()=>$e,__experimentalProductSectionLayout:()=>l,__experimentalShippingDimensionsImage:()=>Gr,__experimentalUseCurrencyInputProps:()=>Yo,__experimentalUseFeedbackBar:()=>De,__experimentalUseProductHelper:()=>D,__experimentalUseVariationsOrder:()=>ri,__experimentalWooProductFieldItem:()=>f,__experimentalWooProductMoreMenuItem:()=>le,__experimentalWooProductSectionItem:()=>h,__experimentalWooProductTabItem:()=>g,createOrderedChildren:()=>u,formatCurrencyDisplayValue:()=>Xo,getCheckboxTracks:()=>F,getCurrencySymbolProps:()=>$a,getDerivedProductType:()=>M,getHeaderTitle:()=>We,getProductStatus:()=>qa,getProductStockStatus:()=>Ea,getProductStockStatusClass:()=>va,getProductTitle:()=>Za,getProductVariationTitle:()=>Ja,getTruncatedProductVariationTitle:()=>Ka,hasAttributesUsedForVariations:()=>ra,initBlock:()=>ft,isValidEmail:()=>Be,preventLeavingProductForm:()=>ct,productApiFetchMiddleware:()=>Qa,sift:()=>qn,sortFillsByOrder:()=>d,useValidation:()=>Do,useValidations:()=>Xe});var e={};o.r(e),o.d(e,{disableComplementaryArea:()=>ke,enableComplementaryArea:()=>Ce,pinItem:()=>Se,setFeatureDefaults:()=>Pe,setFeatureValue:()=>Ne,toggleFeature:()=>Te,unpinItem:()=>xe});var t={};o.r(t),o.d(t,{getActiveComplementaryArea:()=>Ie,isFeatureActive:()=>Me,isItemPinned:()=>Ae});var n={};o.r(n),o.d(n,{attributesInit:()=>Qn,initCatalogVisibility:()=>Et,initCategory:()=>kt,initCheckbox:()=>At,initCollapsible:()=>Lt,initConditional:()=>Vt,initDescription:()=>Po,initImages:()=>Oo,initInventoryQuantity:()=>vn,initLowStockQty:()=>Ho,initName:()=>Jo,initNotice:()=>za,initPricing:()=>or,initRadio:()=>cr,initRegularPrice:()=>pr,initRequirePassword:()=>da,initSalePrice:()=>br,initScheduleSale:()=>xr,initSection:()=>Ar,initShippingClass:()=>jr,initShippingDimensions:()=>Jr,initSku:()=>Go,initSummary:()=>cn,initTab:()=>hn,initToggle:()=>xn,initVariationItems:()=>Ia,initVariationOptions:()=>La,initVariations:()=>la});const a=window.wp.element,i=window.wc.components,l=e=>{let{title:t,description:o,className:r,children:n}=e;return(0,a.createElement)(i.FormSection,{title:t,description:o,className:r},a.Children.map(n,(e=>(0,a.isValidElement)(e)&&e.props.onChange?(0,a.createElement)("div",{className:"product-field-layout"},e):e)))},c=window.wp.components,s=e=>{let{id:t,title:o,description:r,className:n,children:s}=e;return(0,a.createElement)(l,{title:o,description:r,className:n},(0,a.createElement)(c.Card,null,(0,a.createElement)(c.CardBody,null,s,(0,a.createElement)(i.__experimentalWooProductFieldItem.Slot,{section:t}))))},m=window.React;function u(e,t,o,r){const{children:n,props:i}=function(e,t,o,r){if("function"==typeof e)return{children:e({...o,order:t,...r}),props:{order:t,...r}};if((0,m.isValidElement)(e))return"function"==typeof(null==e?void 0:e.type)?{children:e,props:{...o,order:t,...r}}:{children:e,props:{order:t,...r}};throw Error("Invalid children type")}(e,t,o,r);return(0,a.cloneElement)(n,i)}const d=e=>{const t=[...e].sort(((e,t)=>e[0].props.order-t[0].props.order));return(0,a.createElement)(m.Fragment,null,t)},p=20,_=e=>{let{fieldName:t,sectionName:o,order:r,children:n}=e;const{registerFill:l,getFillHelpers:s}=(0,i.useSlotContext)(),m=`product_field/${o}/${t}`;return(0,a.useEffect)((()=>{l(m)}),[]),(0,a.createElement)(c.Fill,{name:`woocommerce_product_field_${o}`,key:m},(e=>u(n,r,{sectionName:o,...e,...s()},{_id:m})))},f=e=>{let{children:t,sections:o,id:r}=e;return(0,a.createElement)(a.Fragment,null,o.map((e=>{let{name:o,order:n=p}=e;return(0,a.createElement)(_,{fieldName:r,sectionName:o,order:n,key:o},t)})))};f.Slot=e=>{let{fillProps:t,section:o}=e;const{filterRegisteredFills:r}=(0,i.useSlotContext)();return(0,a.createElement)(c.Slot,{name:`woocommerce_product_field_${o}`,fillProps:t},(e=>{var t;return d?a.Children.map(null===(t=d(r(e)))||void 0===t?void 0:t.props.children,(e=>(0,a.createElement)("div",{className:"woocommerce-product-form__field"},e))):null}))};const h=e=>{let{children:t,tabs:o}=e;return(0,a.createElement)(a.Fragment,null,o.map((e=>{let{name:o,order:r}=e;return(0,a.createElement)(c.Fill,{name:`woocommerce_product_section_${o}`,key:o},(e=>u(t,r||20,{tabName:o,...e})))})))};h.Slot=e=>{let{fillProps:t,tab:o}=e;return(0,a.createElement)(c.Slot,{name:`woocommerce_product_section_${o}`,fillProps:t},(e=>d?d(e):null))};const g=e=>{let{children:t,tabProps:o,templates:r}=e;return r?(0,a.createElement)(a.Fragment,null,r.map((e=>(0,a.createElement)(c.Fill,{name:`woocommerce_product_tab_${e.name}`,key:e.name},(r=>u(t,e.order||20,{},{tabProps:o,templateName:e.name,order:e.order||20,...r})))))):(console.warn("WooProductTabItem fill is missing templates property."),null)};g.Slot=e=>{let{fillProps:t,template:o,children:r}=e;return(0,a.createElement)(c.Slot,{name:`woocommerce_product_tab_${o}`,fillProps:t},(e=>{const o=e.reduce(((e,o)=>{let{childrenMap:r,tabs:n}=e;var a;const i=o[0].props;if(i&&i.tabProps){r[i.tabProps.name]=o[0];const e="function"==typeof i.tabProps?i.tabProps(t):i.tabProps;n.push({...e,order:null!==(a=i.order)&&void 0!==a?a:20})}return{childrenMap:r,tabs:n}}),{childrenMap:{},tabs:[]}),n=o.tabs.sort(((e,t)=>e.order-t.order));return r(n,o.childrenMap)}))};const b=window.wp.data,w=window.wp.i18n,E=window.wp.url,v=window.wc.data,y="woocommerce_product_editor_show_feedback_bar",C="woocommerce_new_product_management_enabled",k="__ADD_NEW_SHIPPING_CLASS_OPTION__",S="tab/general",x=`${S}/details`,T="product-block-editor-v1",N=window.wc.tracks,P=e=>{let{product:t,permalinkPrefix:o,permalinkSuffix:r,onCancel:n,onSaved:i,saveHandler:l}=e;const{createNotice:s}=(0,b.useDispatch)("core/notices"),[m,u]=(0,a.useState)(!1),[d,p]=(0,a.useState)(t.slug||(0,E.cleanForSlug)(t.name)),_=o+(0,E.cleanForSlug)(d)+r;return(0,a.createElement)(c.Modal,{title:(0,w.__)("Edit product link","woocommerce"),onRequestClose:()=>n(),className:"woocommerce-product-link-edit-modal"},(0,a.createElement)("div",{className:"woocommerce-product-link-edit-modal__wrapper"},(0,a.createElement)("p",{className:"woocommerce-product-link-edit-modal__description"},(0,w.__)("Create a unique link for this product. Use simple, descriptive words and numbers. We'll replace spaces with hyphens (-).","woocommerce")),(0,a.createElement)(c.TextControl,{label:(0,w.__)("Product link","woocommerce"),name:"slug",value:d,onChange:p,hideLabelFromVision:!0,help:(0,a.createInterpolateElement)((0,w.__)("Preview: <link />","woocommerce"),{link:(0,a.createElement)("strong",null,_)})}),(0,a.createElement)("div",{className:"woocommerce-product-link-edit-modal__buttons"},(0,a.createElement)(c.Button,{isSecondary:!0,onClick:()=>n()},(0,w.__)("Cancel","woocommerce")),(0,a.createElement)(c.Button,{isPrimary:!0,isBusy:m,disabled:m||d===t.slug,onClick:async()=>{u(!0),await(async()=>{var e;(0,N.recordEvent)("product_update_slug",{source:T,product_id:t.id,product_type:t.type});const{slug:o,permalink:r}=null!==(e=await l(d))&&void 0!==e?e:{};o?s(o===(0,E.cleanForSlug)(d)?"success":"info",o===(0,E.cleanForSlug)(d)?(0,w.__)("Product link successfully updated.","woocommerce"):(0,w.__)("Product link already existed, updated to ","woocommerce")+r):s("error",(0,w.__)("Failed to update product link.","woocommerce")),i()})(),u(!1)}},(0,w.__)("Save","woocommerce")))))},I=window.wc.number,A=window.wc.currency,M=e=>{var t;return window.wcAdminFeatures["product-variation-management"]&&(null===(t=e.attributes)||void 0===t?void 0:t.find((e=>e.options.length&&e.variation)))?"variable":"simple"},R="AUTO-DRAFT";function O(e){return v.productReadOnlyProperties.forEach((t=>delete e[t])),e}function L(e,t){return"publish"===e&&t?[{label:(0,w.__)("View in store","woocommerce"),onClick:()=>{(0,N.recordEvent)("product_preview_changes",{source:T}),window.open(t,"_blank")}}]:[]}function D(){const{createProduct:e,updateProduct:t,deleteProduct:o}=(0,b.useDispatch)(v.PRODUCTS_STORE_NAME),{batchUpdateProductVariations:r,invalidateResolutionForStoreSelector:n}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME),{createNotice:i}=(0,b.useDispatch)("core/notices"),[l,c]=(0,a.useState)(!1),[s,m]=(0,a.useState)({draft:!1,publish:!1}),u=(0,a.useContext)(A.CurrencyContext),d=(0,a.useCallback)((async function(t,o){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return m({...s,[o]:!0}),e({...t,status:o,type:M(t)}).then((e=>{if(!r){const t="publish"===e.status?(0,w.__)("Product published.","woocommerce"):(0,w.__)("Product successfully created.","woocommerce");i("success",`🎉‎ ${t}`,{actions:L(e.status,e.permalink)})}return m({...s,[o]:!1}),e}),(e=>(r||i("error","publish"===o?(0,w.__)("Failed to publish product.","woocommerce"):(0,w.__)("Failed to create product.","woocommerce")),m({...s,[o]:!1}),e)))}),[s]);async function p(e,t){if(t)return r({product_id:e},{update:Object.values(t).flatMap(Object.entries).map((e=>{let[t,o]=e;return{id:t,menu_order:o}}))})}const _=(0,a.useCallback)((async function(e,o,r){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return m({...s,[r]:!0}),t(e,{...o,status:r,type:M(o)}).then((async e=>p(e.id,o.variationsOrder).then((()=>n("getProductVariations"))).then((()=>e)))).then((e=>{if(!a){const t="draft"===o.status&&"publish"===e.status?(0,w.__)("Product published.","woocommerce"):(0,w.__)("Product successfully updated.","woocommerce");i("success",`🎉‎ ${t}`,{actions:L(e.status,e.permalink)})}return m({...s,[r]:!1}),e}),(e=>(a||i("error",(0,w.__)("Failed to update product.","woocommerce")),m({...s,[r]:!1}),e)))}),[s]),f=(0,a.useCallback)((async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"draft";return d(O({...e,name:(e.name||R)+" - Copy"}),t)}),[]),h=(0,a.useCallback)((async e=>(c(!0),o(e).then((e=>{const t=(0,w.__)("Successfully moved product to Trash.","woocommerce");return i("success",`🎉‎ ${t}`),c(!1),e}),(e=>(i("error",(0,w.__)("Failed to move product to Trash.","woocommerce")),c(!1),e))))),[]),g=(0,a.useCallback)((e=>{if(!e.length)return"";const{getCurrencyConfig:t}=u,{decimalSeparator:o}=t(),r=new RegExp("[^-\\d\\%s]+".replace("%s",o),"g"),n=new RegExp("[%s](?=%s*[%s])".replaceAll("%s",o),"g");return e.replace(r,"").replace(n,"").replace(o,".")}),[u]),E=(0,a.useCallback)((e=>{const{getCurrencyConfig:t}=u,{decimalSeparator:o,thousandSeparator:r}=t();return I.numberFormat({decimalSeparator:o,thousandSeparator:r},e)}),[u]),y=(0,a.useCallback)((e=>{const{getCurrencyConfig:t}=u,{decimalSeparator:o,thousandSeparator:r}=t();return I.parseNumber({decimalSeparator:o,thousandSeparator:r},e)}),[u]);return{createProductWithStatus:d,updateProductWithStatus:_,copyProductWithStatus:f,deleteProductAndRedirect:h,sanitizePrice:g,formatNumber:E,parseNumber:y,isUpdatingDraft:s.draft,isUpdatingPublished:s.publish,isDeleting:l}}const B=e=>{let{}=e;const{updateProductWithStatus:t}=D(),[o,r]=(0,a.useState)(!1),{getInputProps:n,values:l,touched:s,errors:m,setValue:u,resetForm:d}=(0,i.useFormContext)(),{permalinkPrefix:p,permalinkSuffix:_}=(0,b.useSelect)((e=>{const{getPermalinkParts:t}=e(v.PRODUCTS_STORE_NAME);if(l.id){const e=t(l.id);return{permalinkPrefix:null==e?void 0:e.prefix,permalinkSuffix:null==e?void 0:e.suffix}}return{}}));return(0,a.createElement)("div",null,(0,a.createElement)(c.TextControl,{label:(0,a.createInterpolateElement)((0,w.__)("Name <required />","woocommerce"),{required:(0,a.createElement)("span",{className:"woocommerce-product-form__optional-input"},(0,w.__)("(required)","woocommerce"))}),name:"product-details-name",placeholder:(0,w.__)("e.g. 12 oz Coffee Mug","woocommerce"),...n("name",{onBlur:()=>{var e;!l.sku&&(null===(e=l.name)||void 0===e?void 0:e.length)&&u("sku",(0,E.cleanForSlug)(l.name))}})}),l.id&&!(Boolean(s.name)&&Boolean(m.name))&&p&&(0,a.createElement)("span",{className:"woocommerce-product-form__secondary-text product-details-section__product-link"},(0,w.__)("Product link","woocommerce"),": ",(0,a.createElement)("a",{href:l.permalink,target:"_blank",rel:"noreferrer"},p,l.slug||(0,E.cleanForSlug)(l.name),_),(0,a.createElement)(c.Button,{variant:"link",onClick:()=>r(!0)},(0,w.__)("Edit","woocommerce"))),o&&(0,a.createElement)(P,{permalinkPrefix:p||"",permalinkSuffix:_||"",product:l,onCancel:()=>r(!1),onSaved:()=>r(!1),saveHandler:async e=>{const o=await t(l.id,{slug:e},l.status,!0);if(o&&o.id)return d({...l,slug:o.slug,permalink:o.permalink},s,m),{slug:o.slug,permalink:o.permalink}}}))};function F(e){return{onChange:t=>{(0,N.recordEvent)(`product_checkbox_${e}`,{checked:t})}}}const V=()=>{const{getCheckboxControlProps:e}=(0,i.useFormContext)();return(0,a.createElement)(c.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,w.__)("Feature this product","woocommerce"),(0,a.createElement)(i.__experimentalTooltip,{text:(0,a.createInterpolateElement)((0,w.__)("Include this product in a featured section on your website with a widget or shortcode. <moreLink />","woocommerce"),{moreLink:(0,a.createElement)(i.Link,{href:"https://woocommerce.com/document/woocommerce-shortcodes/#products",target:"_blank",type:"external",onClick:()=>(0,N.recordEvent)("add_product_learn_more",{category:"product-details"})},(0,w.__)("Learn more","woocommerce"))})})),...e("featured",F("featured"))})},H=window.lodash,z={};function U(e,t){e[t.parentID]&&(e[t.parentID].isOpen=!0,0!==e[t.parentID].parentID&&U(e,e[t.parentID]))}const j=e=>e.sort(((e,t)=>e.data.count===t.data.count?e.data.name.localeCompare(t.data.name):t.data.count-e.data.count));function $(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;for(const o of t)e.push(o.data),o.children.length>0&&(o.children=j(o.children),$(e,o.children));return e}async function G(e,t){const o={},r=[];for(const t of e)o[t.id]={data:t,children:[],parentID:t.parent,isOpen:!1};if(Object.keys(o).forEach((e=>{const n=o[parseInt(e,10)];if(0!==n.parentID)if(!o[n.parentID]&&z[n.parentID]&&(o[n.parentID]={data:z[n.parentID],children:[],parentID:z[n.parentID].parent,isOpen:!1}),o[n.parentID]){o[n.parentID].children.push(n),z[n.parentID]=o[n.parentID].data;const e=new RegExp((0,H.escapeRegExp)(t),"i");t.length>0&&e.test(n.data.name)&&U(o,n)}else r.push(n.parentID)})),r.length>0)return(0,b.resolveSelect)(v.EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME).getProductCategories({include:r}).then((o=>G([...o,...e],t)));const n=j(Object.values(o).filter((e=>0===e.parentID))),a=$([],n);return Promise.resolve([a,n,o])}const W={per_page:100},q=()=>{const e=(0,a.useRef)(""),{initialCategories:t,totalCount:o}=(0,b.useSelect)((e=>{const{getProductCategories:t,getProductCategoriesTotalCount:o}=e(v.EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME);return{initialCategories:t(W),totalCount:o(W)}})),[r,n]=(0,a.useState)(!0),[i,l]=(0,a.useState)([[],[],{}]),c=!t||t.length>0&&o>100;(0,a.useEffect)((()=>{t&&t.length>0&&(0===i[0].length||0===e.current.length)&&(n(!0),G([...t],"").then((e=>{l(e),n(!1)}),(()=>{n(!1)})))}),[t]);const s=(0,a.useCallback)((async o=>{if(e.current=o||"",!c&&t.length>0)return G([...t],o||"").then((e=>(l(e),e[1])));n(!0);try{const e=await(0,b.resolveSelect)(v.EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME).getProductCategories({search:o,per_page:100}),t=await G(e,o||"");return n(!1),l(t),t[1]}catch(e){return n(!1),[]}}),[t]),m=i[2];return{searchCategories:s,getFilteredItemsForSelectTree:(0,a.useCallback)(((e,t,o)=>{const r=new RegExp((0,H.escapeRegExp)(t),"i");return e.filter((e=>o.indexOf(e)<0&&(r.test(e.label)||m[+e.value]&&m[+e.value].isOpen)))}),[i]),categoriesSelectList:i[0],categories:i[1],isSearching:r,categoryTreeKeyValues:m}},Z=window.wp.compose,J=e=>{let{initialCategoryName:t,onCancel:o,onCreate:r}=e;const{categoriesSelectList:n,isSearching:l,searchCategories:s,getFilteredItemsForSelectTree:m}=q(),{createNotice:u}=(0,b.useDispatch)("core/notices"),[d,p]=(0,a.useState)(!1),{createProductCategory:_,invalidateResolutionForStoreSelector:f}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME),[h,g]=(0,a.useState)(t||""),[E,y]=(0,a.useState)(null),[C,k]=(0,a.useState)(""),S=(0,Z.useDebounce)(s,250);return(0,a.createElement)(c.Modal,{title:(0,w.__)("Create category","woocommerce"),onRequestClose:()=>o(),className:"woocommerce-create-new-category-modal"},(0,a.createElement)("div",{className:"woocommerce-create-new-category-modal__wrapper"},(0,a.createElement)(c.TextControl,{label:(0,w.__)("Name","woocommerce"),name:"Tops",value:h,onChange:g}),(0,a.createElement)(i.__experimentalSelectTreeControl,{label:(0,a.createInterpolateElement)((0,w.__)("Parent category <optional/>","woocommerce"),{optional:(0,a.createElement)("span",{className:"woocommerce-product-form__optional-input"},(0,w.__)("(optional)","woocommerce"))}),id:"parent-category-field",isLoading:l,items:m(Q(n),C,[]),shouldNotRecursivelySelect:!0,selected:E?X(E):void 0,onSelect:e=>e&&y({id:+e.value,name:e.label,parent:e.parent?+e.parent:0}),onRemove:()=>y(null),onInputChange:e=>{S(e),k(e||"")},createValue:C}),(0,a.createElement)("div",{className:"woocommerce-create-new-category-modal__buttons"},(0,a.createElement)(c.Button,{isSecondary:!0,onClick:()=>o(),disabled:d},(0,w.__)("Cancel","woocommerce")),(0,a.createElement)(c.Button,{isPrimary:!0,disabled:0===h.length||d,isBusy:d,onClick:()=>{(async()=>{(0,N.recordEvent)("product_category_add",{source:T}),p(!0);try{const e=await _({name:h,parent:E?E.id:void 0});f("getProductCategories"),p(!1),r(e)}catch(e){u("error",(0,w.__)("Failed to create category.","woocommerce")),p(!1),o()}})()}},(0,w.__)("Save","woocommerce")))))};function K(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;e.push({id:t.id,name:t.name,parent:t.parent});const r=void 0!==t.parent?t.parent:o[t.id].parentID;return r>0&&o[r]&&!e.find((e=>e.id===r))&&K(e,o[r].data,o),e}function X(e){return e.parent?{value:String(e.id),label:e.name,parent:String(e.parent)}:{value:String(e.id),label:e.name}}function Y(e){return{id:+e.value,name:e.label,parent:e.parent?+e.parent:0}}function Q(e){return e.map(X)}const ee=e=>{let{label:t,placeholder:o,value:r=[],onChange:n}=e;const{isSearching:l,categoriesSelectList:c,categoryTreeKeyValues:s,searchCategories:m,getFilteredItemsForSelectTree:u}=q(),[d,p]=(0,a.useState)(!1),[_,f]=(0,a.useState)(""),h=e=>{f(e||""),m(e||"")},g=(0,a.useMemo)((()=>(0,H.debounce)(h,150)),[h]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.__experimentalSelectTreeControl,{id:"category-field",multiple:!0,shouldNotRecursivelySelect:!0,createValue:_,label:t,isLoading:l,onInputChange:g,placeholder:0===r.length?o:"",onCreateNew:()=>{p(!0)},shouldShowCreateButton:e=>!e||-1===c.findIndex((t=>t.name===e)),items:u(Q(c),_,Q(r)),selected:Q(r),onSelect:e=>{if(Array.isArray(e)){const t=e.filter((e=>{let{value:t}=e;return!r.some((e=>e.id===+t))})).map(Y);n([...r,...t])}},onRemove:e=>{const t=Array.isArray(e)?r.filter((t=>!e.some((e=>{let{value:o}=e;return t.id===+o})))):r.filter((t=>t.id!==+e.value));n(t)}}),d&&(0,a.createElement)(J,{initialCategoryName:_,onCancel:()=>p(!1),onCreate:e=>{n(K([...r],e,s)),p(!1),h("")}}))},te=()=>{const{getInputProps:e}=(0,i.useFormContext)();return(0,a.createElement)(ee,{label:(0,w.__)("Categories","woocommerce"),placeholder:(0,w.__)("Search or create category…","woocommerce"),...e("categories")})},oe=window.wp.blocks,re=()=>{const{setValue:e,values:t}=(0,i.useFormContext)(),[o,r]=(0,a.useState)((0,oe.parse)(t.short_description||""));return(0,a.createElement)(i.__experimentalRichTextEditor,{label:(0,w.__)("Summary","woocommerce"),blocks:o,onChange:t=>{r(t),o.length&&e("short_description",(0,oe.serialize)(t))},placeholder:(0,w.__)("Summarize this product in 1-2 short sentences. We'll show it at the top of the page.","woocommerce")})},ne=()=>{const{setValue:e,values:t}=(0,i.useFormContext)(),[o,r]=(0,a.useState)((0,oe.parse)(t.description||""));return(0,a.createElement)(i.__experimentalRichTextEditor,{label:(0,w.__)("Description","woocommerce"),blocks:o,onChange:t=>{r(t),o.length&&e("description",(0,oe.serialize)(t))},placeholder:(0,w.__)("Describe this product. What makes it unique? What are its most important features?","woocommerce")})},{Fill:ae,Slot:ie}=(0,c.createSlotFill)("WooProductMoreMenuItem");ae.Slot=e=>{let{fillProps:t}=e;return(0,a.createElement)(ie,{fillProps:t},(e=>(0,H.isEmpty)(e)?null:(0,a.createElement)(a.Fragment,null,e)))};const le=ae,ce=window.wp.plugins,se=window.wc.adminLayout,me=window.wp.coreData,ue=window.wp.keyboardShortcuts,de=e=>{let{isActive:t}=e;return(0,a.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,a.useEffect)((()=>(t?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{t&&document.body.classList.remove("is-fullscreen-mode")})),[t]),null};function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},pe.apply(this,arguments)}var _e=o(83849),fe=o.n(_e);const he=(0,a.forwardRef)((function(e,t){let{footer:o,header:r,sidebar:n,secondarySidebar:i,notices:l,content:s,drawer:m,actions:u,labels:d,className:p,shortcuts:_}=e;const f=(0,c.__unstableUseNavigateRegions)(_);!function(e){(0,a.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const h={drawer:(0,w.__)("Drawer"),header:(0,w.__)("Header"),body:(0,w.__)("Content"),secondarySidebar:(0,w.__)("Block Library"),sidebar:(0,w.__)("Settings"),actions:(0,w.__)("Publish"),footer:(0,w.__)("Footer"),...d};return(0,a.createElement)("div",pe({},f,{ref:(0,Z.useMergeRefs)([t,f.ref]),className:fe()(p,"interface-interface-skeleton",f.className,!!o&&"has-footer")}),!!m&&(0,a.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":h.drawer,tabIndex:"-1"},m),(0,a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!r&&(0,a.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":h.header,tabIndex:"-1"},r),(0,a.createElement)("div",{className:"interface-interface-skeleton__body"},!!i&&(0,a.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":h.secondarySidebar,tabIndex:"-1"},i),!!l&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},l),(0,a.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":h.body,tabIndex:"-1"},s),!!n&&(0,a.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":h.sidebar,tabIndex:"-1"},n),!!u&&(0,a.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":h.actions,tabIndex:"-1"},u))),!!o&&(0,a.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":h.footer,tabIndex:"-1"},o))})),ge=window.wp.primitives,be=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function we(e){let{as:t=c.DropdownMenu,className:o,label:r=(0,w.__)("Options"),popoverProps:n,toggleProps:i,children:l}=e;return(0,a.createElement)(t,{className:fe()("interface-more-menu-dropdown",o),icon:be,label:r,popoverProps:{position:"bottom left",...n,className:fe()("interface-more-menu-dropdown__content",null==n?void 0:n.className)},toggleProps:{tooltipPosition:"bottom",...i}},(e=>l(e)))}const Ee=window.wp.deprecated;var ve=o.n(Ee);const ye=window.wp.preferences,Ce=(e,t)=>o=>{let{registry:r}=o;t&&r.dispatch(ye.store).set(e,"complementaryArea",t)},ke=e=>t=>{let{registry:o}=t;o.dispatch(ye.store).set(e,"complementaryArea",null)},Se=(e,t)=>o=>{let{registry:r}=o;if(!t)return;const n=r.select(ye.store).get(e,"pinnedItems");!0!==(null==n?void 0:n[t])&&r.dispatch(ye.store).set(e,"pinnedItems",{...n,[t]:!0})},xe=(e,t)=>o=>{let{registry:r}=o;if(!t)return;const n=r.select(ye.store).get(e,"pinnedItems");r.dispatch(ye.store).set(e,"pinnedItems",{...n,[t]:!1})};function Te(e,t){return function(o){let{registry:r}=o;ve()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),r.dispatch(ye.store).toggle(e,t)}}function Ne(e,t,o){return function(r){let{registry:n}=r;ve()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(ye.store).set(e,t,!!o)}}function Pe(e,t){return function(o){let{registry:r}=o;ve()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),r.dispatch(ye.store).setDefaults(e,t)}}const Ie=(0,b.createRegistrySelector)((e=>(t,o)=>e(ye.store).get(o,"complementaryArea"))),Ae=(0,b.createRegistrySelector)((e=>(t,o,r)=>{var n;const a=e(ye.store).get(o,"pinnedItems");return null===(n=null==a?void 0:a[r])||void 0===n||n})),Me=(0,b.createRegistrySelector)((e=>(t,o,r)=>(ve()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(ye.store).get(o,r)))),Re=(0,b.createReduxStore)("core/interface",{reducer:()=>{},actions:e,selectors:t});(0,b.register)(Re);const Oe=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),Le=window.wc.customerEffortScore,De=()=>{const{updateOptions:e}=(0,b.useDispatch)(v.OPTIONS_STORE_NAME),{shouldShowFeedbackBar:t}=(0,b.useSelect)((e=>{var t;const{getOption:o,hasFinishedResolution:r}=e(v.OPTIONS_STORE_NAME),n=o(y);return{shouldShowFeedbackBar:!!r("getOption",[y])&&(null===(t=window.wcTracks)||void 0===t?void 0:t.isEnabled)&&"yes"===n}}),[]);return{shouldShowFeedbackBar:t,maybeShowFeedbackBar:async()=>{var t;const{showFeedbackBarOption:o}=await(async()=>{const{getOption:e}=(0,b.resolveSelect)(v.OPTIONS_STORE_NAME);return{showFeedbackBarOption:await e(y)}})();(null===(t=window.wcTracks)||void 0===t?void 0:t.isEnabled)&&"no"!==o&&e({[y]:"yes"})},hideFeedbackBar:()=>{e({[y]:"no"})}}},Be=e=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase());function Fe(e){let{product:t}=e;const{hideFeedbackBar:o,shouldShowFeedbackBar:r}=De(),{showCesModal:n,showProductMVPFeedbackModal:l}=(0,Le.useCustomerEffortScoreModal)(),s=()=>({product_type:t.type});return(0,a.createElement)(a.Fragment,null,r&&(0,a.createElement)("div",{className:"woocommerce-product-mvp-ces-footer"},(0,a.createElement)(i.Pill,null,"Beta"),(0,a.createElement)("div",{className:"woocommerce-product-mvp-ces-footer__message"},(0,a.createInterpolateElement)((0,w.__)("How is your experience with the new product form? <span><shareButton>Share feedback</shareButton> or <turnOffButton>turn it off</turnOffButton></span>","woocommerce"),{span:(0,a.createElement)("span",{className:"woocommerce-product-mvp-ces-footer__message-buttons"}),shareButton:(0,a.createElement)(c.Button,{variant:"link",onClick:()=>{(0,N.recordEvent)("product_editor_feedback_bar_share_feedback_click",{...s()}),n({action:"product_editor",showDescription:!1,title:(0,w.__)("What do you think of the new product form?","woocommerce"),firstQuestion:(0,w.__)("The product editing screen is easy to use","woocommerce"),secondQuestion:(0,w.__)("Product form is easy to use","woocommerce"),onsubmitLabel:(0,w.__)("Thanks for the feedback — we'll put it to good use!","woocommerce"),shouldShowComments:()=>!1,getExtraFieldsToBeShown:(e,t,o)=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(c.BaseControl,{id:"feedback_additional_thoughts",className:"woocommerce-product-feedback__additional-thoughts",label:(0,a.createInterpolateElement)((0,w.__)("ADDITIONAL THOUGHTS <optional />","woocommerce"),{optional:(0,a.createElement)("span",{className:"woocommerce-product-feedback__optional-input"},(0,w.__)("(OPTIONAL)","woocommerce"))})},(0,a.createElement)(c.TextareaControl,{value:e.additional_thoughts||"",onChange:o=>t({...e,additional_thoughts:o}),help:(null==o?void 0:o.additional_thoughts)||""})),(0,a.createElement)(c.BaseControl,{id:"feedback_email",className:"woocommerce-product-feedback__email",label:(0,a.createInterpolateElement)((0,w.__)("YOUR EMAIL ADDRESS <optional />","woocommerce"),{optional:(0,a.createElement)("span",{className:"woocommerce-product-feedback__optional-input"},(0,w.__)("(OPTIONAL)","woocommerce"))})},(0,a.createElement)(c.TextControl,{value:e.email||"",onChange:o=>t({...e,email:o}),help:(null==o?void 0:o.email)||""}),(0,a.createElement)("span",null,(0,w.__)("In case you want to participate in further discussion and future user research.","woocommerce")))),validateExtraFields:e=>{let{email:t="",additional_thoughts:o=""}=e;const r={};return t.length>0&&!Be(t)&&(r.email=(0,w.__)("Please enter a valid email address.","woocommerce")),(null==o?void 0:o.length)>500&&(r.additional_thoughts=(0,w.__)("Please enter no more than 500 characters.","woocommerce")),r}},{},{type:"snackbar"})}}),turnOffButton:(0,a.createElement)(c.Button,{onClick:()=>{(0,N.recordEvent)("product_editor_feedback_bar_turnoff_editor_click",{...s()}),o(),l()},variant:"link"})})),(0,a.createElement)(c.Button,{className:"woocommerce-product-mvp-ces-footer__close-button",icon:Oe,label:(0,w.__)("Hide this message","woocommerce"),onClick:()=>{(0,N.recordEvent)("product_editor_feedback_bar_dismiss_click",{...s()}),o()}})))}const Ve=window.wc.wcSettings;var He=o(7862),ze=o.n(He);const Ue=window.wc.experimental;function je(e){let{recordScoreCallback:t,onCloseModal:o}=e;const[r,n]=(0,a.useState)(!1),[i,l]=(0,a.useState)(!1),[s,m]=(0,a.useState)(!1),[u,d]=(0,a.useState)(!1),[p,_]=(0,a.useState)(!1),f=[{key:"missing-features",label:(0,w.__)("Missing features","woocommerce"),checked:r,onChange:n},{key:"missing-plugins",label:(0,w.__)("Missing plugins","woocommerce"),checked:i,onChange:l},{key:"difficult-to-use",label:(0,w.__)("It's difficult to use","woocommerce"),checked:s,onChange:m},{key:"slow-buggy-or-broken",label:(0,w.__)("It's slow, buggy, or broken","woocommerce"),checked:u,onChange:d},{key:"other",label:(0,w.__)("Other (describe below)","woocommerce"),checked:p,onChange:_}],[h,g]=(0,a.useState)(""),[E,v]=(0,a.useState)(""),y=f.filter((e=>e.checked)).map((e=>e.key)),{createSuccessNotice:C}=(0,b.useDispatch)("core/notices"),k=(0,a.createElement)("span",{className:"woocommerce-product-mvp-feedback-modal__optional"},(0,w.__)("(optional)","woocommerce"));return(0,a.createElement)(Le.FeedbackModal,{title:(0,w.__)("Thanks for trying out the new product form!","woocommerce"),onSubmit:()=>{t(y,h,E),C((0,w.__)("Thanks for the feedback — we'll put it to good use!","woocommerce"))},onModalClose:o,isSubmitButtonDisabled:!y.length,submitButtonLabel:(0,w.__)("Send","woocommerce"),cancelButtonLabel:(0,w.__)("Skip","woocommerce"),className:"woocommerce-product-mvp-feedback-modal"},(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Ue.Text,{variant:"subtitle.small",as:"p",weight:"600",size:"14",lineHeight:"20px"}),(0,a.createElement)("fieldset",{className:"woocommerce-product-mvp-feedback-modal__reason"},(0,a.createElement)("legend",null,(0,w.__)("What made you turn off the new product form?","woocommerce")),(0,a.createElement)("div",{className:"woocommerce-product-mvp-feedback-modal__checkboxes"},f.map(((e,t)=>(0,a.createElement)(c.CheckboxControl,{key:t,label:e.label,name:e.key,checked:e.checked,onChange:e.onChange}))))),(0,a.createElement)("div",{className:"woocommerce-product-mvp-feedback-modal__comments"},(0,a.createElement)(c.TextareaControl,{label:(0,a.createInterpolateElement)((0,w.__)("Additional thoughts <optional/>","woocommerce"),{optional:k}),value:h,onChange:e=>g(e),rows:5})),(0,a.createElement)("div",{className:"woocommerce-product-mvp-feedback-modal__email"},(0,a.createElement)(c.TextControl,{label:(0,a.createInterpolateElement)((0,w.__)("Your email address <optional/>","woocommerce"),{optional:k}),value:E,onChange:e=>v(e),rows:5,help:(0,w.__)("In case you want to participate in further discussion and future user research.","woocommerce")}))))}je.propTypes={recordScoreCallback:ze().func.isRequired,onCloseModal:ze().func};const $e=e=>{let{productId:t}=e;const{values:o}=(0,i.useFormContext)(),{hideProductMVPFeedbackModal:r}=(0,b.useDispatch)(Le.STORE_KEY),{isProductMVPModalVisible:n}=(0,b.useSelect)((e=>{const{isProductMVPFeedbackModalVisible:t}=e(Le.STORE_KEY);return{isProductMVPModalVisible:t()}})),l=null!=t?t:o.id,{_feature_nonce:c}=(0,Ve.getSetting)("admin",{}),s=l?(0,Ve.getAdminLink)(`post.php?post=${l}&action=edit&product_block_editor=0&_feature_nonce=${c}`):(0,Ve.getAdminLink)(`post-new.php?post_type=product&product_block_editor=0&_feature_nonce=${c}`);return n?(0,a.createElement)(je,{recordScoreCallback:(e,t,o)=>{(0,N.recordEvent)("product_mvp_feedback",{action:"disable",checked:e,comments:t||"",email:o}),r(),window.location.href=`${s}&new-product-experience-disabled=true`},onCloseModal:()=>{(0,N.recordEvent)("product_mvp_feedback",{action:"disable",checked:"",comments:""}),r(),window.location.href=s}}):null};function Ge(e){let{product:t}=e;return(0,a.createElement)(se.WooFooterItem,null,(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Fe,{product:t}),(0,a.createElement)($e,{productId:t.id})))}const We=(e,t)=>Boolean(e)&&e!==t?e:t===R?(0,w.__)("Add new product","woocommerce"):t,qe=()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(we,{toggleProps:{onClick:()=>(0,N.recordEvent)("product_dropdown_click")},popoverProps:{className:"woocommerce-product-header__more-menu"}},(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(le.Slot,{fillProps:{onClose:t}}))}))),Ze=window.wc.navigation;function Je(e){switch(e.code){case"product_invalid_sku":return(0,w.__)("Invalid or duplicated SKU.","woocommerce");case"product_create_error":return(0,w.__)("Failed to create product.","woocommerce");case"product_publish_error":return(0,w.__)("Failed to publish product.","woocommerce");case"product_preview_error":return(0,w.__)("Failed to preview product.","woocommerce");default:return(0,w.__)("Failed to save product.","woocommerce")}}const Ke=(0,a.createContext)({errors:{},registerValidator:()=>()=>{},validateField:()=>Promise.resolve(void 0),validateAll:()=>Promise.resolve({})});function Xe(){const e=(0,a.useContext)(Ke),[t,o]=(0,a.useState)(!1);return{isValidating:t,validate:async()=>(o(!0),new Promise(((t,o)=>{e.validateAll().then((e=>{!function(e){return Object.values(e).some(Boolean)}(e)?t():o(e)})).catch((()=>{o(e.errors)}))})).finally((()=>{o(!1)})))}}function Ye(e){let{productStatus:t,...o}=e;const{createErrorNotice:r}=(0,b.useDispatch)("core/notices"),n=function(e){let{productStatus:t,disabled:o,onClick:r,onSaveSuccess:n,onSaveError:i,...l}=e;const c=(0,a.useRef)(),[s]=(0,me.useEntityProp)("postType","product","id"),[m]=(0,me.useEntityProp)("postType","product","permalink"),{hasEdits:u,isDisabled:d}=(0,b.useSelect)((e=>{const{hasEditsForEntityRecord:t,isSavingEntityRecord:o}=e("core");return{isDisabled:o("postType","product",s),hasEdits:t("postType","product",s)}}),[s]),{isValidating:p,validate:_}=Xe(),f=o||d||p,{editEntityRecord:h,saveEditedEntityRecord:g}=(0,b.useDispatch)("core");let E;return"string"==typeof m&&(E=new URL(m),E.searchParams.append("preview","true")),{"aria-label":(0,w.__)("Preview in new tab","woocommerce"),children:(0,w.__)("Preview","woocommerce"),target:"_blank",...l,ref(e){"function"==typeof l.ref&&l.ref(e),c.current=e},"aria-disabled":f,href:null==E?void 0:E.toString(),variant:"tertiary",onClick:async function(e){var o;if(f)return e.preventDefault();if(r&&r(e),u){e.preventDefault();try{await _(),"auto-draft"===t&&await h("postType","product",s,{status:"draft"});const e=await g("postType","product",s,{throwOnError:!0});null===(o=c.current)||void 0===o||o.click(),n&&n(e)}catch(e){if(i){let t=e;t.code||(t={code:"product_preview_error"}),i(t)}}}}}}({productStatus:t,...o,onClick(){(0,N.recordEvent)("product_preview_changes",{source:T})},onSaveSuccess(e){if("auto-draft"===t){const t=(0,Ze.getNewPath)({},`/product/${e.id}`);(0,Ze.navigateTo)({url:t})}},onSaveError(e){const t=Je(e);r(t)}});return(0,a.createElement)(c.Button,{...n})}function Qe(e,t){const{attributes:o,categories:r,cross_sell_ids:n,description:a,dimensions:i,downloadable:l,id:c,images:s,manage_stock:m,menu_order:u,purchase_note:d,reviews_allowed:p,sale_price:_,short_description:f,tags:h,type:g,upsell_ids:b,virtual:w,weight:E}=t,v={virtual:w,downloadable:l};(0,N.recordEvent)(e,{attributes:o.length?"yes":"no",categories:r.length?"yes":"no",cross_sells:n.length?"yes":"no",description:a.length?"yes":"no",dimensions:i.length.length||i.width.length||i.height.length?"yes":"no",enable_reviews:p?"yes":"no",is_downloadable:l?"yes":"no",is_virtual:w?"yes":"no",manage_stock:m?"yes":"no",menu_order:u?"yes":"no",product_id:c,product_gallery:s.length>1?"yes":"no",product_image:s.length?"yes":"no",product_type:g,product_type_options:Object.keys(v).filter((e=>v[e])).join(","),purchase_note:d.length?"yes":"no",sale_price:_.length?"yes":"no",short_description:f.length?"yes":"no",source:"product-blocks-editor-v1",tags:h.length?"yes":"no",upsells:b.length?"yes":"no",weight:E.length?"yes":"no"})}const et=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));function tt(e){let{productStatus:t,...o}=e;const{createSuccessNotice:r,createErrorNotice:n}=(0,b.useDispatch)("core/notices"),{maybeShowFeedbackBar:i}=De(),l=function(e){let{productStatus:t,disabled:o,onClick:r,onSaveSuccess:n,onSaveError:i,...l}=e;const[s]=(0,me.useEntityProp)("postType","product","id"),{hasEdits:m,isDisabled:u}=(0,b.useSelect)((e=>{const{hasEditsForEntityRecord:t,isSavingEntityRecord:o}=e("core");return{isDisabled:o("postType","product",s),hasEdits:t("postType","product",s)}}),[s]),{isValidating:d,validate:p}=Xe(),_=o||u||"publish"!==t&&!m||d,{editEntityRecord:f,saveEditedEntityRecord:h}=(0,b.useDispatch)("core");let g;return g="publish"===t?(0,w.__)("Switch to draft","woocommerce"):m||"auto-draft"===t?(0,w.__)("Save draft","woocommerce"):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(c.Icon,{icon:et}),(0,w.__)("Saved","woocommerce")),{children:g,...l,"aria-disabled":_,variant:"tertiary",onClick:async function(e){if(_)return e.preventDefault();r&&r(e);try{await p(),await f("postType","product",s,{status:"draft"});const e=await h("postType","product",s,{throwOnError:!0});n&&n(e)}catch(e){i&&i(e)}}}}({productStatus:t,...o,onSaveSuccess(e){if(Qe("product_edit",e),r((0,w.__)("Product saved as draft.","woocommerce")),i(),"auto-draft"===t){const t=(0,Ze.getNewPath)({},`/product/${e.id}`);(0,Ze.navigateTo)({url:t})}},onSaveError(e){const t=Je(e);n(t)}});return(0,a.createElement)(c.Button,{...l})}function ot(e){let{productStatus:t,...o}=e;const{createSuccessNotice:r,createErrorNotice:n}=(0,b.useDispatch)("core/notices"),{maybeShowFeedbackBar:i}=De(),l=function(e){let{productStatus:t,disabled:o,onClick:r,onPublishSuccess:n,onPublishError:a,...i}=e;const{isValidating:l,validate:c}=Xe(),[s]=(0,me.useEntityProp)("postType","product","id"),{isSaving:m}=(0,b.useSelect)((e=>{const{isSavingEntityRecord:t}=e("core");return{isSaving:t("postType","product",s)}}),[s]),u=m||l,d="publish"===t,{editEntityRecord:p,saveEditedEntityRecord:_}=(0,b.useDispatch)("core");return{children:d?(0,w.__)("Update","woocommerce"):(0,w.__)("Add","woocommerce"),...i,isBusy:u,variant:"primary",onClick:async function(e){r&&r(e);try{await c(),d||await p("postType","product",s,{status:"publish"});const e=await _("postType","product",s,{throwOnError:!0});e&&n&&n(e)}catch(e){if(a){let t=e;t.code||(t={code:d?"product_publish_error":"product_create_error"}),a(t)}}}}}({productStatus:t,...o,onPublishSuccess(e){const o="publish"===t;o&&Qe("product_update",e);const n=o?(0,w.__)("Product updated.","woocommerce"):(0,w.__)("Product added.","woocommerce"),a={icon:"🎉",actions:[{label:(0,w.__)("View in store","woocommerce"),url:e.permalink,onClick(t){t.preventDefault(),window.open(e.permalink,"_blank")}}]};if(r(n,a),i(),"auto-draft"===t){const t=(0,Ze.getNewPath)({},`/product/${e.id}`);(0,Ze.navigateTo)({url:t})}},onPublishError(e){const t=Je(e);n(t)}});return(0,a.createElement)(c.Button,{...l})}const rt="woocommerce_product_tabs";function nt(e){let{onChange:t=(()=>{})}=e;const[o,r]=(0,a.useState)(null),n=(0,Ze.getQuery)(),[i]=(0,me.useEntityProp)("postType","product","id"),l=(0,b.useSelect)((e=>e("core").getEditedEntityRecord("postType","product",i)));return(0,a.useEffect)((()=>{t(o)}),[o]),(0,a.useEffect)((()=>{n.tab&&r(n.tab)}),[n.tab]),(0,a.createElement)(c.NavigableMenu,{role:"tablist",onNavigate:function(e,t){t.click()},className:"woocommerce-product-tabs",orientation:"horizontal"},(0,a.createElement)(c.Slot,{fillProps:{onClick:e=>{(0,Ze.navigateTo)({url:(0,Ze.getNewPath)({tab:e})}),(0,N.recordEvent)("product_tab_click",function(e,t){const o={product_tab:e,product_type:t.type,source:T};return"inventory"===e?{...o,is_store_stock_management_enabled:t.manage_stock}:o}(e,l))}},name:rt},(e=>d?(function(e){var t,n;if(!o)for(let o=0;o<e.length;o++){if(e[o][0].props.disabled)continue;const a=(null===(n=null===(t=e[o][0].props)||void 0===t?void 0:t.children)||void 0===n?void 0:n.key)||null;return void r(a)}}(e),d(e)):null)))}function at(e){let{onTabSelect:t}=e;const[o]=(0,me.useEntityProp)("postType","product","id"),r=(0,b.useSelect)((e=>{const{getEntityRecord:t}=e("core");return t("postType","product",o)}),[o]),[n]=(0,me.useEntityProp)("postType","product","name");return(0,a.createElement)("div",{className:"woocommerce-product-header",role:"region","aria-label":(0,w.__)("Product Editor top bar.","woocommerce"),tabIndex:-1},(0,a.createElement)("div",{className:"woocommerce-product-header__inner"},(0,a.createElement)("div",null),(0,a.createElement)("h1",{className:"woocommerce-product-header__title"},We(n,r.name)),(0,a.createElement)("div",{className:"woocommerce-product-header__actions"},(0,a.createElement)(tt,{productStatus:r.status}),(0,a.createElement)(Ye,{productStatus:r.status}),(0,a.createElement)(ot,{productStatus:r.status}),(0,a.createElement)(se.WooHeaderItem.Slot,{name:"product"}),(0,a.createElement)(qe,null))),(0,a.createElement)(nt,{onChange:t}))}const it=window.wp.mediaUtils,lt=window.wp.blockEditor,ct=(e,t)=>{const o=new URLSearchParams(e.search),r=new URLSearchParams(t.search);return o.delete("tab"),r.delete("tab"),o.toString()!==r.toString()};function st(e){return delete e.content,delete e.blocks,e}function mt(){const[e]=(0,me.useEntityProp)("postType","product","id"),{edits:t}=(0,b.useSelect)((t=>{const{getEntityRecordNonTransientEdits:o}=t("core");return{edits:st(o("postType","product",e))}}),[e]);return{hasEdit:function(e){return t.hasOwnProperty(e)},hasEdits:Object.keys(t).length>0}}function ut(e){let{context:t,settings:o,product:r}=e;!function(){const[e]=(0,me.useEntityProp)("postType","product","id"),{hasEdits:t}=mt(),{isSaving:o}=(0,b.useSelect)((t=>{const{isSavingEntityRecord:o}=t("core");return{isSaving:o("postType","product",e)}}),[e]);(0,Ze.useConfirmUnsavedChanges)(t||o,ct)}();const n=(0,b.useSelect)((e=>{const{canUser:t}=e("core");return!1!==t("create","media","")}),[]),i=(0,a.useMemo)((()=>n?{...o,mediaUpload(e){let{onError:t,...r}=e;(0,it.uploadMedia)({wpAllowedMimeTypes:(null==o?void 0:o.allowedMimeTypes)||void 0,onError:e=>{let{message:o}=e;return t(o)},...r})}}:o),[n,o]),[l,c,s]=(0,me.useEntityBlockEditor)("postType","product",{id:r.id});return(0,a.useLayoutEffect)((()=>{s((0,oe.synchronizeBlocksWithTemplate)([],null==o?void 0:o.template),{})}),[r.id]),l?(0,a.createElement)("div",{className:"woocommerce-product-block-editor"},(0,a.createElement)(lt.BlockContextProvider,{value:t},(0,a.createElement)(lt.BlockEditorProvider,{value:l,onInput:c,onChange:s,settings:i},(0,a.createElement)(lt.BlockEditorKeyboardShortcuts.Register,null),(0,a.createElement)(lt.BlockTools,null,(0,a.createElement)(lt.ObserveTyping,null,(0,a.createElement)(lt.BlockList,{className:"woocommerce-product-block-editor__block-list"})))))):null}function dt(e){let{initialValue:t,children:o}=e;const r=(0,a.useRef)({}),n=(0,a.useRef)({}),[i,l]=(0,a.useState)({});async function c(e){const o=r.current;return e in o?(0,o[e])(t).then((t=>(l((o=>({...o,[e]:t}))),t))):Promise.resolve(void 0)}return(0,a.createElement)(Ke.Provider,{value:{errors:i,registerValidator:function(e,t){return r.current={...r.current,[e]:t},t=>{n.current[e]=t}},validateField:c,validateAll:async function(){const e={},t=r.current;for(const o in t)e[o]=await c(o);l(e);const o=function(e,t){const o=Object.entries(e).filter((e=>{let[o,r]=e;return(null==r?void 0:r.closest('.is-selected[role="tabpanel"]'))&&Boolean(t[o])})),[r]=o.sort(((e,t)=>{let[,o]=e,[,r]=t;return o.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1})),[,n]=null!=r?r:[];return n}(n.current,e);return null==o||o.focus(),e}}},o)}function pt(e){let{product:t,settings:o}=e;const[r,n]=(0,a.useState)(null),i=(0,se.useExtendLayout)("product-block-editor");return(0,a.createElement)(se.LayoutContextProvider,{value:i},(0,a.createElement)(a.StrictMode,null,(0,a.createElement)(me.EntityProvider,{kind:"postType",type:"product",id:t.id},(0,a.createElement)(ue.ShortcutProvider,null,(0,a.createElement)(de,{isActive:!1}),(0,a.createElement)(c.SlotFillProvider,null,(0,a.createElement)(dt,{initialValue:t},(0,a.createElement)(he,{header:(0,a.createElement)(at,{onTabSelect:n}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ut,{settings:o,product:t,context:{selectedTab:r,postType:"product",postId:t.id}}),(0,a.createElement)(ce.PluginArea,{scope:"woocommerce-product-block-editor"}))}),(0,a.createElement)(c.Popover.Slot,null)))),(0,a.createElement)(Ge,{product:t}))))}const _t=window.wp.blockLibrary;function ft(e){if(!e)return;const{metadata:t,settings:o,name:r}=e;return(0,oe.registerBlockType)({name:r,...t},o)}const ht=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-catalog-visibility-field","description":"A checkbox to manage the catalog visibility of the product.","title":"Product catalog visibility","category":"widgets","keywords":["products","catalog"],"textdomain":"default","attributes":{"label":{"type":"string","__experimentalRole":"content"},"visibilty":{"type":"string","enum":["visible","catalog","search","hidden"],"default":"visible"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:gt,...bt}=ht,wt={example:{},edit:function(e){let{attributes:t}=e;const{label:o,visibilty:r}=t,n=(0,lt.useBlockProps)(),[i,l]=(0,me.useEntityProp)("postType","product","catalog_visibility"),s=i===r||"hidden"===i;return(0,a.createElement)("div",{...n},(0,a.createElement)(c.CheckboxControl,{label:o,checked:s,onChange:function(e){if(e){if("visible"===i)return void l(r);l("hidden")}else{if("hidden"===i)return"catalog"===r?void l("search"):"search"===r?void l("catalog"):void 0;l("visible")}}}))}};function Et(){return ft({name:gt,metadata:bt,settings:wt})}const vt=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-category-field","title":"Product Category","category":"widgets","description":"A field to select product categories.","keywords":["products","category"],"textdomain":"default","attributes":{"name":{"type":"string","__experimentalRole":"content"},"label":{"type":"string"},"placeholder":{"type":"string"}},"usesContext":["postType"],"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:yt}=vt,Ct={example:{},edit:function(e){let{attributes:t,context:o}=e;const r=(0,lt.useBlockProps)(),{name:n,label:i,placeholder:l}=t,[c,s]=(0,me.useEntityProp)("postType",(null==o?void 0:o.postType)||"product",n||"categories");return(0,a.createElement)("div",{...r},(0,a.createElement)(ee,{label:i||(0,w.__)("Categories","woocommerce"),placeholder:l||(0,w.__)("Search or create category…","woocommerce"),onChange:s,value:c||[]}))}},kt=()=>ft({name:yt,metadata:vt,settings:Ct}),St=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-checkbox-field","title":"Product checkbox control","category":"woocommerce","description":"The product checkbox.","keywords":["products","checkbox","input"],"textdomain":"default","attributes":{"title":{"type":"string","__experimentalRole":"content"},"label":{"type":"string"},"property":{"type":"string"},"tooltip":{"type":"string"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),xt=function(e){let{icon:t,size:o=24,...r}=e;return(0,a.cloneElement)(t,{width:o,height:o,...r})},Tt=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})),{name:Nt,...Pt}=St,It={example:{},edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)({className:"woocommerce-product-form__checkbox"}),{property:r,title:n,label:i,tooltip:l}=t,[s,m]=(0,me.useEntityProp)("postType","product",r);return(0,a.createElement)("div",{...o},(0,a.createElement)("h4",null,n),(0,a.createElement)("div",{className:"woocommerce-product-form__checkbox-wrapper"},(0,a.createElement)(c.CheckboxControl,{label:i,checked:s,onChange:e=>m(e)}),l&&(0,a.createElement)(c.Tooltip,{text:(0,a.createElement)("span",null,l),position:"top center",className:"woocommerce-product-form__checkbox-tooltip",delay:0},(0,a.createElement)("span",{className:"woocommerce-product-form__checkbox-tooltip-icon"},(0,a.createElement)(xt,{icon:Tt,size:21.94,fill:"#949494"})))))}},At=()=>ft({name:Nt,metadata:Pt,settings:It}),Mt=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-collapsible","title":"Collapsible","category":"widgets","description":"Container with collapsible inner blocks.","textdomain":"default","attributes":{"toggleText":{"type":"string","__experimentalRole":"content"},"initialCollapsed":{"type":"boolean"},"persistRender":{"type":"boolean"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}'),{name:Rt}=Mt,Ot={example:{},edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)(),{toggleText:r,initialCollapsed:n,persistRender:l=!0}=t;return(0,a.createElement)("div",{...o},(0,a.createElement)(i.CollapsibleContent,{toggleText:r,initialCollapsed:n,persistRender:l},(0,a.createElement)(lt.InnerBlocks,{templateLock:"all"})))}},Lt=()=>ft({name:Rt,metadata:Mt,settings:Ot}),Dt=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/conditional","title":"Conditional","category":"widgets","description":"Container to only conditionally render inner blocks.","textdomain":"default","attributes":{"mustMatch":{"__experimentalRole":"content","type":"array","items":{"type":"object"},"default":[]}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}'),{name:Bt}=Dt,Ft={example:{},edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)(),{mustMatch:r}=t,n=(0,me.useEntityId)("postType","product"),l=(0,b.useSelect)((e=>e("core").getEditedEntityRecord("postType","product",n))),c=(0,a.useMemo)((()=>{for(const[e,t]of Object.entries(r))if(!t.includes(l[e]))return!1;return!0}),[r,l]);return(0,a.createElement)("div",{...o},(0,a.createElement)(i.DisplayState,{state:c?"visible":"visually-hidden"},(0,a.createElement)(lt.InnerBlocks,{templateLock:"all"})))}},Vt=()=>ft({name:Bt,metadata:Dt,settings:Ft}),Ht=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-description-field","title":"Product description","category":"woocommerce","description":"The product description.","keywords":["products","description"],"textdomain":"default","attributes":{"__contentEditable":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}');var zt=o(74944);const Ut=["a","b","em","i","strong","p","br"],jt=["target","href","rel","name","download"];function $t(e,t){const o=(null==t?void 0:t.tags)||Ut,r=(null==t?void 0:t.attr)||jt;return{__html:(0,zt.sanitize)(e,{ALLOWED_TAGS:o,ALLOWED_ATTR:r})}}const Gt=["a","b","em","i","strong","p","br","img","blockquote","cite","h1","h2","h3","h4","h5","h6","ul","li","ol","div"],Wt=["target","href","rel","name","download","src","style","class"];function qt(e){let{content:t}=e;const o=(0,b.useSelect)((e=>e(lt.store).getSettings()));return(0,a.createElement)("div",{className:"woocommerce-content-preview"},(0,a.createElement)(lt.__unstableIframe,{head:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(lt.__unstableEditorStyles,{styles:null==o?void 0:o.styles}),(0,a.createElement)("style",null,"body {\n\t\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\t}")),className:"woocommerce-content-preview__iframe"},(0,a.createElement)("div",{className:"woocommerce-content-preview__content",dangerouslySetInnerHTML:$t(t,{tags:Gt,attr:Wt})})))}const Zt=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));function Jt(e){let{onClick:t}=e;return(0,a.createElement)(c.Button,{className:"woocommerce-iframe-editor__back-button",icon:Zt,onClick:t},(0,w.__)("Back","woocommerce"))}function Kt(e){let{children:t,enableResizing:o,settings:r,...n}=e;const i=(0,lt.__unstableUseMouseMoveTypingReset)();return(0,a.createElement)(lt.__unstableIframe,{head:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(lt.__unstableEditorStyles,{styles:null==r?void 0:r.styles}),(0,a.createElement)("style",null,".is-root-container {\n\t\t\t\t\t\t\t\tpadding: 36px;\n\t\t\t\t\t\t\t\tdisplay: flow-root;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbody { position: relative; }"),o&&(0,a.createElement)("style",null,".is-root-container { min-height: 0 !important; }")),ref:i,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas",...n},t)}const Xt=(0,a.createContext)({hasRedo:!1,hasUndo:!1,isDocumentOverviewOpened:!1,isInserterOpened:!1,isSidebarOpened:!0,redo:()=>{},setIsDocumentOverviewOpened:()=>{},setIsInserterOpened:()=>{},setIsSidebarOpened:()=>{},undo:()=>{}}),Yt=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Qt=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})),eo=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),to=(0,a.forwardRef)((function(e,t){const{hasRedo:o,redo:r}=(0,a.useContext)(Xt);return(0,a.createElement)(c.Button,{...e,ref:t,icon:(0,w.isRTL)()?eo:Qt,label:(0,w.__)("Redo","woocommerce"),"aria-disabled":!o,onClick:o?r:void 0,className:"editor-history__redo"})})),oo=(0,a.forwardRef)((function(e,t){const{hasUndo:o,undo:r}=(0,a.useContext)(Xt);return(0,a.createElement)(c.Button,{...e,ref:t,icon:(0,w.isRTL)()?Qt:eo,label:(0,w.__)("Undo","woocommerce"),"aria-disabled":!o,onClick:o?r:void 0,className:"editor-history__undo"})})),ro=(0,a.createElement)(ge.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(ge.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),no=(0,a.forwardRef)((function(e,t){const{isDocumentOverviewOpened:o,setIsDocumentOverviewOpened:r}=(0,a.useContext)(Xt);return(0,a.createElement)(c.Button,{...e,ref:t,icon:ro,isPressed:o,label:(0,w.__)("Document overview","woocommerce"),onClick:function(){r(!o)},className:"document-overview"})})),ao=(0,a.createElement)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false"},(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})),io=(0,a.forwardRef)((function(e,t){const{isSidebarOpened:o,setIsSidebarOpened:r}=(0,a.useContext)(Xt);return(0,a.createElement)(c.Button,{...e,ref:t,icon:ao,isPressed:o,label:(0,w.__)("Show/hide block inspector","woocommerce"),onClick:function(){r(!o)}})})),lo=()=>{const{createNotice:e}=(0,b.useDispatch)("core/notices"),{blocks:t}=(0,b.useSelect)((e=>{const{getBlocks:t}=e(lt.store);return{blocks:t()}}),[]),o=(0,Z.useCopyToClipboard)((()=>(0,oe.serialize)(t)),(()=>{e("success",(0,w.__)("All content copied.","woocommerce"))}));return(0,a.createElement)(c.MenuItem,{ref:o,role:"menuitem",onClick:()=>{(0,N.recordEvent)("product_iframe_editor_copy_all_content_menu_item_click")},disabled:!t.length},(0,w.__)("Copy all content","woocommerce"))},co=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),so=()=>(0,a.createElement)(c.MenuItem,{role:"menuitem",icon:co,href:(0,w.__)("https://wordpress.org/documentation/article/wordpress-block-editor/","woocommerce"),onClick:()=>{(0,N.recordEvent)("product_iframe_editor_help_menu_item_click")},target:"_blank",rel:"noopener noreferrer"},(0,w.__)("Help","woocommerce"),(0,a.createElement)(c.VisuallyHidden,{as:"span"},(0,w.__)("(opens in a new tab)","woocommerce"))),mo=()=>(0,a.createElement)(c.MenuGroup,{label:(0,w.__)("Tools","woocommerce")},(0,a.createElement)(lo,null),(0,a.createElement)(so,null)),uo=()=>(0,a.createElement)(we,null,(()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(mo,null))));function po(e){let{onSave:t=(()=>{}),onCancel:o=(()=>{})}=e;const{isInserterOpened:r,setIsInserterOpened:n}=(0,a.useContext)(Xt),i=(0,Z.useViewportMatch)("medium"),l=(0,a.useRef)(null),{isInserterEnabled:s,isTextModeEnabled:m}=(0,b.useSelect)((e=>{const{hasInserterItems:t,getBlockRootClientId:o,getBlockSelectionEnd:r,__unstableGetEditorMode:n}=e(lt.store);return{isTextModeEnabled:"text"===n(),isInserterEnabled:t(o(r()))}}),[]),u=(0,w.__)("Document tools","woocommerce"),d=(0,a.useCallback)((()=>{var e;r?(null===(e=l.current)||void 0===e||e.focus(),n(!1)):n(!0)}),[r,n]);return(0,a.createElement)(lt.NavigableToolbar,{className:"woocommerce-iframe-editor__header-toolbar","aria-label":u},(0,a.createElement)("div",{className:"woocommerce-iframe-editor__header-toolbar-left"},(0,a.createElement)(c.ToolbarItem,{ref:l,as:c.Button,className:"woocommerce-iframe-editor__header-toolbar-inserter-toggle",variant:"primary",isPressed:r,onMouseDown:e=>{e.preventDefault()},onClick:d,disabled:!s,icon:Yt,label:r?(0,w.__)("Close","woocommerce"):(0,w.__)("Add","woocommerce"),showTooltip:!0}),i&&(0,a.createElement)(c.ToolbarItem,{as:lt.ToolSelector,disabled:m}),(0,a.createElement)(c.ToolbarItem,{as:oo}),(0,a.createElement)(c.ToolbarItem,{as:to}),(0,a.createElement)(c.ToolbarItem,{as:no})),(0,a.createElement)("div",{className:"woocommerce-iframe-editor__header-toolbar-right"},(0,a.createElement)(c.ToolbarItem,{as:c.Button,variant:"tertiary",className:"woocommerce-modal-actions__cancel-button",onClick:o,text:(0,w.__)("Cancel","woocommerce")}),(0,a.createElement)(c.ToolbarItem,{as:c.Button,variant:"primary",className:"woocommerce-modal-actions__done-button",onClick:t,text:(0,w.__)("Done","woocommerce")}),(0,a.createElement)(c.ToolbarItem,{as:io,className:"woocommerce-show-block-inspector-panel"}),(0,a.createElement)(c.ToolbarItem,{as:uo})))}const _o=window.wp.keycodes;function fo(e){let{direction:t,resizeWidthBy:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("button",{className:`resizable-editor__drag-handle is-${t}`,"aria-label":(0,w.__)("Drag to resize","woocommerce"),"aria-describedby":`resizable-editor__resize-help-${t}`,onKeyDown:function(e){const{keyCode:r}=e;"left"===t&&r===_o.LEFT||"right"===t&&r===_o.RIGHT?o(20):("left"===t&&r===_o.RIGHT||"right"===t&&r===_o.LEFT)&&o(-20)}}),(0,a.createElement)(c.VisuallyHidden,{id:`resizable-editor__resize-help-${t}`},(0,w.__)("Use left and right arrow keys to resize the canvas.","woocommerce")))}const ho={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};function go(e){let{enableResizing:t,height:o,children:r}=e;const[n,i]=(0,a.useState)("100%"),l=(0,a.useRef)(),s=(0,a.useCallback)((e=>{l.current&&i(l.current.offsetWidth+e)}),[]);return(0,a.createElement)(c.ResizableBox,{ref:e=>{l.current=null==e?void 0:e.resizable},size:{width:t?n:"100%",height:t&&o?o:"100%"},onResizeStop:(e,t,o)=>{i(o.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",minHeight:o,enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,a.createElement)(fo,{direction:"left",resizeWidthBy:s}),right:(0,a.createElement)(fo,{direction:"right",resizeWidthBy:s})},handleClasses:void 0,handleStyles:{left:ho,right:ho}},r)}const bo=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function wo(){const{setIsInserterOpened:e}=(0,a.useContext)(Xt),t=(0,Z.useViewportMatch)("medium","<"),{rootClientId:o}=(0,b.useSelect)((e=>{const{getBlockRootClientId:t}=e(lt.store);return{rootClientId:t()}})),r=(0,a.useCallback)((()=>e(!1)),[e]),n=t?"div":c.VisuallyHidden,[i,l]=(0,Z.__experimentalUseDialog)({onClose:r,focusOnMount:!1}),s=(0,a.useRef)(null);return(0,a.useEffect)((()=>{var e;null===(e=s.current)||void 0===e||e.focusSearch()}),[]),(0,a.createElement)("div",{ref:i,...l,className:"woocommerce-iframe-editor__inserter-panel"},(0,a.createElement)(n,{className:"woocommerce-iframe-editor__inserter-panel-header"},(0,a.createElement)(c.Button,{icon:bo,onClick:r,label:(0,w.__)("Close block inserter","woocommerce")})),(0,a.createElement)("div",{className:"woocommerce-iframe-editor__inserter-panel-content"},(0,a.createElement)(lt.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:t,rootClientId:o,ref:s})))}function Eo(){const{setIsDocumentOverviewOpened:e}=(0,a.useContext)(Xt),t=(0,Z.useFocusOnMount)("firstElement"),o=(0,Z.useFocusReturn)(),r=(0,Z.useFocusReturn)(),[n,i]=(0,a.useState)(null),[l,s]=(0,a.useState)("list-view"),m=(0,a.useRef)(null),u=(0,Z.useMergeRefs)([r,t,m,i]);return(0,a.createElement)("div",{className:"woocommerce-iframe-editor__document-overview-sidebar",onKeyDown:function(t){"Escape"!==t.code||t.defaultPrevented||(t.preventDefault(),e(!1))}},(0,a.createElement)(c.Button,{className:"woocommerce-iframe-editor__document-overview-sidebar-close-button",ref:o,icon:Oe,label:(0,w.__)("Close","woocommerce"),onClick:()=>e(!1)}),(0,a.createElement)(c.TabPanel,{className:"woocommerce-iframe-editor__document-overview-sidebar-tab-panel",initialTabName:l,onSelect:s,tabs:[{name:"list-view",title:"List View",className:"woocommerce-iframe-editor__document-overview-sidebar-tab-item"}]},(e=>(0,a.createElement)("div",{className:"woocommerce-iframe-editor__document-overview-sidebar-tab-content",ref:u},"list-view"===e.name?(0,a.createElement)(lt.__experimentalListView,{dropZoneElement:n}):null))))}function vo(){const{isInserterOpened:e,isDocumentOverviewOpened:t}=(0,a.useContext)(Xt);return e?(0,a.createElement)(wo,null):t?(0,a.createElement)(Eo,null):null}const yo=50;function Co(e){let{maxHistory:t=yo,setBlocks:o}=e;const[r,n]=(0,a.useState)([]),[i,l]=(0,a.useState)(0);return{appendEdit:function(e){const o=[...r.slice(0,i+1),e].slice(-1*t);n(o),l(o.length-1)},hasRedo:!!r.length&&i<r.length-1,hasUndo:!!r.length&&i>0,redo:function(){const e=Math.min(r.length-1,i+1);r[e]&&(o(r[e]),l(e))},undo:function(){const e=Math.max(0,i-1);r[e]&&(o(r[e]),l(e))}}}function ko(e){let{closeModal:t=(()=>{}),initialBlocks:o=[],onChange:r=(()=>{}),onClose:n,onInput:i=(()=>{}),settings:l}=e;const[s]=(0,Z.useResizeObserver)(),[m,u]=(0,a.useState)(o),[d,p]=(0,a.useState)(o),{appendEdit:_}=Co({setBlocks:u}),{appendEdit:f,hasRedo:h,hasUndo:g,redo:w,undo:E}=Co({setBlocks:p}),[v,y]=(0,a.useState)(!1),[C,k]=(0,a.useState)(!1),[S,x]=(0,a.useState)(!0),{clearSelectedBlock:T,updateSettings:N}=(0,b.useDispatch)(lt.store),P=(0,b.useSelect)((e=>e(lt.store).getSettings()),[]);(0,a.useEffect)((()=>{N(productBlockEditorSettings)}),[]);const I=l||P;return(0,a.createElement)("div",{className:"woocommerce-iframe-editor"},(0,a.createElement)(Xt.Provider,{value:{hasRedo:h,hasUndo:g,isInserterOpened:v,isDocumentOverviewOpened:C,redo:w,setIsInserterOpened:y,setIsDocumentOverviewOpened:k,undo:E,isSidebarOpened:S,setIsSidebarOpened:x}},(0,a.createElement)(lt.BlockEditorProvider,{settings:{...I,hasFixedToolbar:!0,templateLock:!1},value:m,onChange:e=>{f(e),p(e),r(e)},onInput:e=>{f(e),p(e),i(e)},useSubRegistry:!0},(0,a.createElement)(po,{onSave:()=>{_(d),u(d),r(d),t()},onCancel:()=>{_(m),u(m),r(m),p(m),t()}}),(0,a.createElement)("div",{className:"woocommerce-iframe-editor__main"},(0,a.createElement)(vo,null),(0,a.createElement)(lt.BlockTools,{className:"woocommerce-iframe-editor__content",onClick:e=>{e.target===e.currentTarget&&T()}},(0,a.createElement)(lt.BlockEditorKeyboardShortcuts.Register,null),n&&(0,a.createElement)(Jt,{onClick:()=>{setTimeout(n,550)}}),(0,a.createElement)(go,{enableResizing:!0,height:"100%"},(0,a.createElement)(Kt,{enableResizing:!0,settings:I},s,(0,a.createElement)(lt.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks"})),(0,a.createElement)(c.Popover.Slot,null)),(0,a.createElement)("div",{className:"woocommerce-iframe-editor__content-inserter-clipper"})),S&&(0,a.createElement)("div",{className:"woocommerce-iframe-editor__sidebar"},(0,a.createElement)(lt.BlockInspector,null))))))}function So(e){let{initialBlocks:t,onChange:o,onClose:r,title:n}=e;const i=(0,Z.useDebounce)((e=>{o(e)}),250);function l(){const e=i.flush();e&&o(e),r()}return(0,a.createElement)(c.Modal,{className:"woocommerce-modal-editor",title:n,onRequestClose:l,shouldCloseOnClickOutside:!1},(0,a.createElement)(ko,{initialBlocks:t,onInput:i,onChange:i,closeModal:l}))}const{name:xo,...To}=Ht,No={example:{},edit:function(){const e=(0,lt.useBlockProps)(),[t,o]=(0,a.useState)(!1),[r,n]=(0,me.useEntityProp)("postType","product","description");return(0,a.createElement)("div",{...e},(0,a.createElement)(c.Button,{variant:"secondary",onClick:()=>{o(!0),(0,N.recordEvent)("product_add_description_click")}},r.length?(0,w.__)("Edit description","woocommerce"):(0,w.__)("Add description","woocommerce")),t&&(0,a.createElement)(So,{initialBlocks:(0,oe.parse)(r),onChange:e=>{const t=(0,oe.serialize)(function(e){if(1===e.length){const{content:t}=e[0].attributes;if(!t||!t.trim())return[]}return e}(e));n(t)},onClose:()=>o(!1),title:(0,w.__)("Edit description","woocommerce")}),!!r.length&&(0,a.createElement)(qt,{content:r}))}},Po=()=>ft({name:xo,metadata:To,settings:No}),Io=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-images-field","title":"Product images","category":"widgets","description":"The product images.","keywords":["products","image","images","gallery"],"textdomain":"default","attributes":{"mediaId":{"type":"number","__experimentalRole":"content"},"images":{"__experimentalRole":"content","type":"array","items":{"type":"number"},"default":[]}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),Ao=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"})),{name:Mo}=Io,Ro={example:{},edit:function(){const[e,t]=(0,me.useEntityProp)("postType","product","images"),[o,r]=(0,a.useState)(!1),[n,l]=(0,a.useState)(!1),[s,m]=(0,a.useState)(null),u=(0,lt.useBlockProps)({className:fe()({"has-images":e.length>0})}),d=()=>{r(!o)};return(0,a.createElement)("div",{...u},(0,a.createElement)("div",{className:"woocommerce-product-form__image-drop-zone"},o?(0,a.createElement)("div",{className:"woocommerce-product-form__remove-image-drop-zone"},(0,a.createElement)("span",null,(0,a.createElement)(xt,{icon:Ao,size:20,className:"icon-control"}),(0,w.__)("Drop here to remove","woocommerce")),(0,a.createElement)(c.DropZone,{onHTMLDrop:()=>l(!0),onDrop:()=>l(!0),label:(0,w.__)("Drop here to remove","woocommerce")})):(0,a.createElement)(i.MediaUploader,{multipleSelect:"add",onError:()=>null,onFileUploadChange:o=>{o[0].id&&((0,N.recordEvent)("product_images_add_via_file_upload_area"),t([...e,...o]))},onMediaGalleryOpen:()=>{(0,N.recordEvent)("product_images_media_gallery_open")},onSelect:o=>{const r=o.filter((t=>!e.find((e=>e.id===t.id))));r.length>0&&((0,N.recordEvent)("product_images_add_via_media_library"),t([...e,...r]))},onUpload:o=>{o[0].id&&((0,N.recordEvent)("product_images_add_via_drag_and_drop_upload"),t([...e,...o]))},label:""})),(0,a.createElement)(i.ImageGallery,{allowDragging:!1,onDragStart:t=>{var o;const{id:r,dataset:n}=t.target;if(r)m(parseInt(r,10));else{const t=null==n?void 0:n.index;t&&m(null===(o=e[parseInt(t,10)])||void 0===o?void 0:o.id)}d()},onDragEnd:()=>{n&&s&&((0,N.recordEvent)("product_images_remove_image_button_click"),t(e.filter((e=>e.id!==s))),l(!1),m(null)),d()},onOrderChange:o=>{const r=o.map((t=>e.find((e=>{var o;return e.id===parseInt(null===(o=null==t?void 0:t.props)||void 0===o?void 0:o.id,10)}))));(0,N.recordEvent)("product_images_change_image_order_via_image_gallery"),t(r)},onReplace:o=>{let{replaceIndex:r,media:n}=o;if(void 0===e.find((e=>n.id===e.id))){const o=[...e];o[r]=n,(0,N.recordEvent)("product_images_replace_image_button_click"),t(o)}},onSelectAsCover:()=>(0,N.recordEvent)("product_images_select_image_as_cover_button_click")},e.map((e=>(0,a.createElement)(i.ImageGalleryItem,{key:e.id||e.url,alt:e.alt,src:e.url||e.src,id:`${e.id}`})))))}},Oo=()=>ft({name:Mo,metadata:Io,settings:Ro}),Lo=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-inventory-email-field","title":"Stock level threshold","category":"widgets","description":"Stock management minimum quantity.","keywords":["products","inventory","email","minimum"],"textdomain":"default","attributes":{"name":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}');function Do(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=(0,a.useContext)(Ke),[n,i]=(0,a.useState)(!1),l=(0,a.useMemo)((()=>r.registerValidator(e,t)),[e,...o]);return{ref:l,error:r.errors[e],isValidating:n,validate:async()=>(i(!0),r.validateField(e).finally((()=>{i(!1)})))}}const{name:Bo,...Fo}=Lo,Vo={example:{},edit:function(e){let{clientId:t}=e;const o=(0,lt.useBlockProps)(),r=(0,Ve.getSetting)("notifyLowStockAmount",2),[n,l]=(0,me.useEntityProp)("postType","product","low_stock_amount"),s=(0,Z.useInstanceId)(c.BaseControl,"low_stock_amount"),{ref:m,error:u,validate:d}=Do(`low_stock_amount-${t}`,(async function(){if(n&&n<0)return(0,w.__)("This field must be a positive number.","woocommerce")}),[n]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{...o},(0,a.createElement)("div",{className:"wp-block-columns"},(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(c.BaseControl,{id:s,label:(0,w.__)("Email me when stock reaches","woocommerce"),help:u||(0,a.createInterpolateElement)((0,w.__)("Make sure to enable notifications in <link>store settings.</link>","woocommerce"),{link:(0,a.createElement)(i.Link,{href:`${(0,Ve.getSetting)("adminUrl")}admin.php?page=wc-settings&tab=products&section=inventory`,target:"_blank",type:"external"})}),className:u&&"has-error"},(0,a.createElement)(c.__experimentalInputControl,{id:s,ref:m,name:"low_stock_amount",placeholder:(0,w.sprintf)((0,w.__)("%d (store default)","woocommerce"),r),onChange:l,onBlur:d,value:n,type:"number",min:0}))),(0,a.createElement)("div",{className:"wp-block-column"}))))}};function Ho(){return ft({name:Bo,metadata:Fo,settings:Vo})}const zo=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-sku-field","title":"Product text control","category":"woocommerce","description":"The product sku.","keywords":["products","sku"],"textdomain":"default","attributes":{"name":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:Uo,...jo}=zo,$o={example:{},edit:function(){const e=(0,lt.useBlockProps)(),[t,o]=(0,me.useEntityProp)("postType","product","sku");return(0,a.createElement)("div",{...e},(0,a.createElement)(c.BaseControl,{id:"product_sku",className:"woocommerce-product-form_inventory-sku",label:(0,a.createInterpolateElement)((0,w.__)("Sku <description />","woocommerce"),{description:(0,a.createElement)("span",{className:"woocommerce-product-form__optional-input"},(0,w.__)("(STOCK KEEPING UNIT)","woocommerce"))})},(0,a.createElement)(c.__experimentalInputControl,{name:"woocommerce-product-sku",onChange:o,value:t||""})))}},Go=()=>ft({name:Uo,metadata:jo,settings:$o}),Wo=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-name-field","title":"Product name","category":"widgets","description":"The product name.","keywords":["products","name","title"],"textdomain":"default","attributes":{"name":{"type":"string","__experimentalRole":"content"},"autoFocus":{"type":"boolean","default":false}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:qo}=Wo,Zo={example:{},edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)(),{editEntityRecord:r,saveEntityRecord:n}=(0,b.useDispatch)("core"),{hasEdit:i}=mt(),[l,s]=(0,a.useState)(!1),m=(0,me.useEntityId)("postType","product"),u=(0,b.useSelect)((e=>e("core").getEditedEntityRecord("postType","product",m))),[d,p]=(0,me.useEntityProp)("postType","product","sku"),[_,f]=(0,me.useEntityProp)("postType","product","name"),{permalinkPrefix:h,permalinkSuffix:g}=(0,b.useSelect)((e=>{const{getPermalinkParts:t}=e(v.PRODUCTS_STORE_NAME);if(m){const e=t(m);return{permalinkPrefix:null==e?void 0:e.prefix,permalinkSuffix:null==e?void 0:e.suffix}}return{}})),{ref:y,error:C,validate:k}=Do("name",(async function(){return _&&_!==R?_.length>120?(0,w.__)("Please enter a product name shorter than 120 characters.","woocommerce"):void 0:(0,w.__)("This field is required.","woocommerce")}),[_]),S=null!=C?C:m&&["publish","draft"].includes(u.status)&&h&&(0,a.createElement)("span",{className:"woocommerce-product-form__secondary-text product-details-section__product-link"},(0,w.__)("Product link","woocommerce"),": ",(0,a.createElement)("a",{href:u.permalink,target:"_blank",rel:"noreferrer"},h,u.slug||(0,E.cleanForSlug)(_),g),(0,a.createElement)(c.Button,{variant:"link",onClick:()=>s(!0)},(0,w.__)("Edit","woocommerce"))),x=(0,Z.useInstanceId)(c.BaseControl,"product_name");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{...o},(0,a.createElement)(c.BaseControl,{id:x,label:(0,a.createInterpolateElement)((0,w.__)("Name <required />","woocommerce"),{required:(0,a.createElement)("span",{className:"woocommerce-product-form__required-input"},(0,w.__)("*","woocommerce"))}),className:fe()({"has-error":C}),help:S},(0,a.createElement)(c.__experimentalInputControl,{id:x,ref:y,name:"name",autoFocus:t.autoFocus,placeholder:(0,w.__)("e.g. 12 oz Coffee Mug","woocommerce"),onChange:f,value:_&&_!==R?_:"",autoComplete:"off","data-1p-ignore":!0,onBlur:()=>{i("name")&&(d||C||p((0,E.cleanForSlug)(_)),k())}})),l&&(0,a.createElement)(P,{permalinkPrefix:h||"",permalinkSuffix:g||"",product:u,onCancel:()=>s(!1),onSaved:()=>s(!1),saveHandler:async e=>{const{slug:t,permalink:o}=await n("postType","product",{id:u.id,slug:e});if(t&&o)return r("postType","product",u.id,{slug:t,permalink:o}),{slug:t,permalink:o}}})))}},Jo=()=>ft({name:qo,metadata:Wo,settings:Zo}),Ko=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-pricing-field","description":"A product price block with currency display.","title":"Product pricing","category":"widgets","keywords":["products","price"],"textdomain":"default","attributes":{"name":{"type":"string","__experimentalRole":"content"},"label":{"type":"string"},"help":{"type":"string"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),Xo=(e,t,o)=>{const{decimalSeparator:r,thousandSeparator:n}=t,a=new RegExp("[^-0-9%s1%s2]".replace("%s1",r).replace("%s2",n),"g");return void 0===e?e:o(e).replace(a,"")},Yo=e=>{let{value:t,onChange:o,onFocus:r,onKeyUp:n}=e;const{sanitizePrice:i}=D(),l=(0,a.useContext)(A.CurrencyContext),{getCurrencyConfig:c,formatAmount:s}=l,m=c();return{prefix:m.symbol,className:"components-currency-control",value:Xo(String(t),m,s),sanitize:e=>i(String(e)),onFocus(e){setTimeout((function(e){e.select()}),0,e.currentTarget),r&&r(e)},onKeyUp(e){const r=Number.parseFloat(i(t||"0")),a=Number(e.currentTarget.step||"1");"ArrowUp"===e.code&&o(String(r+a)),"ArrowDown"===e.code&&o(String(r-a)),n&&n(e)},onChange(e){const t=i(e);o&&o(t)}}},{name:Qo,...er}=Ko,tr={example:{},edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)(),{name:r,label:n,help:l}=t,[s,m]=(0,me.useEntityProp)("postType","product",r),u=Yo({value:s,onChange:m}),d=l?(0,a.createInterpolateElement)(l,{PricingTab:(0,a.createElement)(i.Link,{href:(0,Ze.getNewPath)({tab:"pricing"}),onClick:()=>{(0,N.recordEvent)("product_pricing_help_click")}})}):null,p=(0,Z.useInstanceId)(c.BaseControl,"wp-block-woocommerce-product-pricing-field");return(0,a.createElement)("div",{...o},(0,a.createElement)(c.BaseControl,{id:p,help:d},(0,a.createElement)(c.__experimentalInputControl,{...u,id:p,name:r,label:n||(0,w.__)("Price","woocommerce")})))}};function or(){return ft({name:Qo,metadata:er,settings:tr})}const rr=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-radio-field","title":"Product radio control","category":"woocommerce","description":"The product radio.","keywords":["products","radio","input"],"textdomain":"default","attributes":{"title":{"type":"string"},"description":{"type":"string"},"property":{"type":"string"},"options":{"type":"array","items":{"type":"object"},"default":[],"__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}');function nr(e){let{title:t,description:o,className:r,...n}=e;return(0,a.createElement)(c.RadioControl,{...n,className:fe()(r,"woocommerce-radio-field"),label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("span",{className:"woocommerce-radio-field__title"},t),o&&(0,a.createElement)("span",{className:"woocommerce-radio-field__description",dangerouslySetInnerHTML:$t(o)}))})}const{name:ar,...ir}=rr,lr={example:{},edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)(),{description:r,options:n,property:i,title:l}=t,[c,s]=(0,me.useEntityProp)("postType","product",i);return(0,a.createElement)("div",{...o},(0,a.createElement)(nr,{title:l,description:r,selected:c,options:n,onChange:e=>s(e||"")}))}};function cr(){return ft({name:ar,metadata:ir,settings:lr})}const sr=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-regular-price-field","description":"A product price block with currency display.","title":"Product regular price","category":"widgets","keywords":["products","price"],"textdomain":"default","attributes":{"label":{"type":"string","__experimentalRole":"content"},"help":{"type":"string"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:mr,...ur}=sr,dr={example:{},edit:function(e){let{attributes:t,clientId:o}=e;const r=(0,lt.useBlockProps)(),{label:n,help:l}=t,[s,m]=(0,me.useEntityProp)("postType","product","regular_price"),[u]=(0,me.useEntityProp)("postType","product","sale_price"),d=Yo({value:s,onChange:m}),p=l?(0,a.createInterpolateElement)(l,{PricingTab:(0,a.createElement)(i.Link,{href:(0,Ze.getNewPath)({tab:"pricing"}),onClick:()=>{(0,N.recordEvent)("product_pricing_help_click")}})}):null,_=(0,Z.useInstanceId)(c.BaseControl,"wp-block-woocommerce-product-regular-price-field"),{ref:f,error:h,validate:g}=Do(`regular_price-${o}`,(async function(){const e=Number.parseFloat(s);if(e){if(e<0)return(0,w.__)("List price must be greater than or equals to zero.","woocommerce");if(u&&e<=Number.parseFloat(u))return(0,w.__)("List price must be greater than the sale price.","woocommerce")}}),[s,u]);return(0,a.createElement)("div",{...r},(0,a.createElement)(c.BaseControl,{id:_,help:h||p,className:fe()({"has-error":h})},(0,a.createElement)(c.__experimentalInputControl,{...d,id:_,name:"regular_price",ref:f,label:n,onBlur:g})))}};function pr(){return ft({name:mr,metadata:ur,settings:dr})}const _r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-sale-price-field","description":"A product price block with currency display.","title":"Product sale price","category":"widgets","keywords":["products","price"],"textdomain":"default","attributes":{"label":{"type":"string","__experimentalRole":"content"},"help":{"type":"string"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:fr,...hr}=_r,gr={example:{},edit:function(e){let{attributes:t,clientId:o}=e;const r=(0,lt.useBlockProps)(),{label:n,help:i}=t,[l]=(0,me.useEntityProp)("postType","product","regular_price"),[s,m]=(0,me.useEntityProp)("postType","product","sale_price"),u=Yo({value:s,onChange:m}),d=(0,Z.useInstanceId)(c.BaseControl,"wp-block-woocommerce-product-sale-price-field"),{ref:p,error:_,validate:f}=Do(`sale-price-${o}`,(async function(){if(s){if(Number.parseFloat(s)<0)return(0,w.__)("Sale price must be greater than or equals to zero.","woocommerce");const e=Number.parseFloat(l);if(!e||e<=Number.parseFloat(s))return(0,w.__)("Sale price must be lower than the list price.","woocommerce")}}),[l,s]);return(0,a.createElement)("div",{...r},(0,a.createElement)(c.BaseControl,{id:d,help:_||i,className:fe()({"has-error":_})},(0,a.createElement)(c.__experimentalInputControl,{...u,id:d,name:"sale_price",ref:p,label:n,onBlur:f})))}};function br(){return ft({name:fr,metadata:hr,settings:gr})}const wr=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-schedule-sale-fields","title":"Product schedule sale fields","category":"woocommerce","description":"The product schedule sale fields.","keywords":["products","schedule","sale"],"textdomain":"default","attributes":{"name":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),Er=window.moment;var vr=o.n(Er);const yr=window.wp.date,{name:Cr,...kr}=wr,Sr={example:{},edit:function(e){let{clientId:t}=e;const o=(0,lt.useBlockProps)(),{hasEdit:r}=mt(),n=(0,yr.getSettings)().formats.datetime,[l,s]=(0,a.useState)(!1),[m]=(0,me.useEntityProp)("postType","product","sale_price"),u=Number.parseFloat(m||"0")>0,[d,p]=(0,me.useEntityProp)("postType","product","date_on_sale_from_gmt"),[_,f]=(0,me.useEntityProp)("postType","product","date_on_sale_to_gmt"),h=vr()().startOf("minute").toISOString();(0,a.useEffect)((()=>{r("sale_price")&&!u&&(s(!1),p(""),f(""))}),[u]),(0,a.useEffect)((()=>{(d||_)&&s(!0)}),[d,_]);const g=vr()(d,vr().ISO_8601,!0),b=vr()(_,vr().ISO_8601,!0),{ref:E,error:v,validate:y}=Do(`date_on_sale_from_gmt-${t}`,(async function(){if(l&&d){if(!g.isValid())return(0,w.__)("Please enter a valid date.","woocommerce");if(g.isAfter(b))return(0,w.__)("The start date of the sale must be before the end date.","woocommerce")}}),[l,d,g,b]),{ref:C,error:k,validate:S}=Do(`date_on_sale_to_gmt-${t}`,(async function(){if(l&&_){if(!b.isValid())return(0,w.__)("Please enter a valid date.","woocommerce");if(b.isBefore(g))return(0,w.__)("The end date of the sale must be after the start date.","woocommerce")}}),[l,d,g,b]);return(0,a.createElement)("div",{...o},(0,a.createElement)(c.ToggleControl,{label:(0,w.__)("Schedule sale","woocommerce"),checked:l,onChange:function(e){(0,N.recordEvent)("product_pricing_schedule_sale_toggle_click",{enabled:e}),s(e),e?(p(h),f("")):(p(""),f(""))},disabled:!u}),l&&(0,a.createElement)("div",{className:"wp-block-columns wp-block-woocommerce-product-schedule-sale-fields__content"},(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(i.DateTimePickerControl,{ref:E,label:(0,w.__)("From","woocommerce"),placeholder:(0,w.__)("Sale start date and time (optional)","woocommerce"),dateTimeFormat:n,currentDate:d,onChange:p,className:v&&"has-error",help:v,onBlur:y})),(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(i.DateTimePickerControl,{ref:C,label:(0,w.__)("To","woocommerce"),placeholder:(0,w.__)("Sale end date and time (optional)","woocommerce"),dateTimeFormat:n,currentDate:_,onChange:e=>f(vr()(e).startOf("minute").toISOString()),onBlur:S,className:k&&"has-error",help:k}))))}};function xr(){return ft({name:Cr,metadata:kr,settings:Sr})}const Tr=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-section","title":"Product section","category":"woocommerce","description":"The product section.","keywords":["products","section","group"],"textdomain":"default","attributes":{"title":{"type":"string"},"description":{"type":"string","__experimentalRole":"content"},"blockGap":{"type":"string","enum":["unit-30","unit-40"],"default":"unit-30"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:Nr,...Pr}=Tr,Ir={example:{},edit:function(e){let{attributes:t}=e;const{description:o,title:r,blockGap:n}=t,i=(0,lt.useBlockProps)(),l=(0,lt.useInnerBlocksProps)({className:fe()("wp-block-woocommerce-product-section__content",`wp-block-woocommerce-product-section__content--block-gap-${n}`)},{templateLock:"all"}),c=r?"fieldset":"div",s="fieldset"===c?"legend":"div";return(0,a.createElement)(c,{...i},r&&(0,a.createElement)(s,{className:"wp-block-woocommerce-product-section__heading"},(0,a.createElement)("h2",{className:"wp-block-woocommerce-product-section__heading-title"},r),o&&(0,a.createElement)("p",{className:"wp-block-woocommerce-product-section__heading-description",dangerouslySetInnerHTML:$t(o)})),(0,a.createElement)("div",{...l}))}};function Ar(){return ft({name:Nr,metadata:Pr,settings:Ir})}const Mr=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-shipping-class-field","title":"Product shipping class field","category":"woocommerce","description":"The product shipping class field.","keywords":["products","shipping","class"],"textdomain":"default","attributes":{"title":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}');function Rr(e){let{onAdd:t,onCancel:o}=e;var r;const{errors:n,getInputProps:l,isValidForm:s}=(0,i.useFormContext)(),[m,u]=(0,a.useState)(!1);return(0,a.createElement)("div",{className:"woocommerce-add-new-shipping-class-modal__wrapper"},(0,a.createElement)(c.TextControl,{...l("name"),placeholder:(0,w.__)("e.g. Fragile products","woocommerce"),label:(0,a.createInterpolateElement)((0,w.__)("Name <required />","woocommerce"),{required:(0,a.createElement)("span",{className:"woocommerce-add-new-shipping-class-modal__optional-input"},(0,w.__)("(required)","woocommerce"))})}),(0,a.createElement)(c.TextControl,{...l("slug"),label:(0,w.__)("Slug","woocommerce")}),(0,a.createElement)(c.TextControl,{...l("description"),label:(0,w.__)("Description","woocommerce"),help:null!==(r=null==n?void 0:n.description)&&void 0!==r?r:(0,w.__)("Describe how you and other store administrators can use this shipping class.","woocommerce")}),(0,a.createElement)("div",{className:"woocommerce-add-new-shipping-class-modal__buttons"},(0,a.createElement)(c.Button,{isSecondary:!0,onClick:o},(0,w.__)("Cancel","woocommerce")),(0,a.createElement)(c.Button,{isPrimary:!0,isBusy:m,disabled:!s||m,onClick:function(){u(!0),t().then((()=>{u(!1),o()})).catch((()=>{u(!1)}))}},(0,w.__)("Add","woocommerce"))))}function Or(e){var t;const o={};return(null===(t=e.name)||void 0===t?void 0:t.length)||(o.name=(0,w.__)("The shipping class name is required.","woocommerce")),o}const Lr={name:"",slug:"",description:""};function Dr(e){let{shippingClass:t,onAdd:o,onCancel:r}=e;return(0,a.createElement)(c.Modal,{title:(0,w.__)("New shipping class","woocommerce"),className:"woocommerce-add-new-shipping-class-modal",onRequestClose:r},(0,a.createElement)(i.Form,{initialValues:null!=t?t:Lr,validate:Or,errors:{},onSubmit:o},(e=>(0,a.createElement)(Rr,{onAdd:e.handleSubmit,onCancel:r}))))}const Br=[{value:"",label:(0,w.__)("No shipping class","woocommerce")},{value:k,label:(0,w.__)("Add new shipping class","woocommerce")}];function Fr(e){return e.map((e=>{let{slug:t,name:o}=e;return{value:t,label:o}}))}function Vr(e,t){const o=null==e?void 0:e.find((e=>{let{slug:t}=e;return"uncategorized"!==t}));if(o&&!(null==t?void 0:t.some((e=>{let{slug:t}=e;return t===o.slug}))))return{name:o.name,slug:o.slug}}const{name:Hr,...zr}=Mr,Ur={example:{},edit:function(e){let{}=e;const[t,o]=(0,a.useState)(!1),r=(0,lt.useBlockProps)(),{createProductShippingClass:n,invalidateResolution:l}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_SHIPPING_CLASSES_STORE_NAME),{createErrorNotice:s}=(0,b.useDispatch)("core/notices"),[m]=(0,me.useEntityProp)("postType","product","categories"),[u,d]=(0,me.useEntityProp)("postType","product","shipping_class");function p(e){let t=(0,w.__)("We couldn’t add this shipping class. Try again in a few seconds.","woocommerce");throw"term_exists"===e.code&&(t=(0,w.__)("A shipping class with that slug already exists.","woocommerce")),s(t,{explicitDismiss:!0}),e}const{shippingClasses:_}=(0,b.useSelect)((e=>{var t;const{getProductShippingClasses:o}=e(v.EXPERIMENTAL_PRODUCT_SHIPPING_CLASSES_STORE_NAME);return{shippingClasses:null!==(t=o())&&void 0!==t?t:[]}}),[]),f=(0,Z.useInstanceId)(c.BaseControl,"wp-block-woocommerce-product-shipping-class-field");return(0,a.createElement)("div",{...r},(0,a.createElement)("div",{className:"wp-block-columns"},(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(c.SelectControl,{id:f,name:"shipping_class",value:u,onChange:e=>{e!==k?d(e):o(!0)},label:(0,w.__)("Shipping class","woocommerce"),options:[...Br,...Fr(null!=_?_:[])],help:(0,a.createInterpolateElement)((0,w.__)("Manage shipping classes and rates in <Link>global settings</Link>.","woocommerce"),{Link:(0,a.createElement)(i.Link,{href:(0,Ze.getNewPath)({tab:"shipping",section:"classes"},"",{},"wc-settings"),target:"_blank",type:"external",onClick:()=>{(0,N.recordEvent)("product_shipping_global_settings_link_click")}},(0,a.createElement)(a.Fragment,null))})})),(0,a.createElement)("div",{className:"wp-block-column"})),t&&(0,a.createElement)(Dr,{shippingClass:Vr(m,_),onAdd:e=>n(e).then((e=>((0,N.recordEvent)("product_new_shipping_class_modal_add_button_click"),l("getProductShippingClasses"),d(e.slug),e))).catch(p),onCancel:()=>o(!1)}))}};function jr(){return ft({name:Hr,metadata:zr,settings:Ur})}const $r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-shipping-dimensions-fields","title":"Product shipping dimensions fields","category":"woocommerce","description":"The product shipping dimensions fields.","keywords":["products","shipping","dimensions"],"textdomain":"default","attributes":{"__contentEditable":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}');function Gr(e){let{highlight:t,labels:o={},...r}=e;return(0,a.createElement)("svg",{width:"295",height:"195",viewBox:"0 0 295 195",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},(0,a.createElement)("path",{d:"M11.5664 134.604V35.3599C11.5664 33.9482 12.9862 32.9782 14.3014 33.4915L99.6373 66.7959C100.4 67.0935 100.905 67.8243 100.914 68.6426L102.037 171.578C102.052 173.027 100.574 174.014 99.2419 173.444L12.7831 136.448C12.0451 136.132 11.5664 135.407 11.5664 134.604Z",fill:"A"===t?"#F0F6FC":"#FFFFFF"}),(0,a.createElement)("path",{d:"M11.5664 134.603V35.3599C11.5664 33.9482 12.9862 32.9782 14.3014 33.4915L99.624 66.7908C100.393 67.0909 100.9 67.8314 100.901 68.6569L101.024 174.131L12.7844 136.447C12.0457 136.132 11.5664 135.406 11.5664 134.603Z",stroke:"#E0E0E0",strokeWidth:"2.00574"}),(0,a.createElement)("path",{d:"M1.25977 150.388L86.0112 188.183",stroke:"A"===t?"#006FAD":"#CCCCCC",strokeWidth:"1.50431",strokeMiterlimit:"16"}),(0,a.createElement)("path",{d:"M250.775 32.9793L100.9 66.9577V172.981C100.9 174.297 102.146 175.257 103.418 174.921L251.73 135.764C252.611 135.531 253.224 134.735 253.224 133.824V34.9354C253.224 33.6488 252.03 32.6948 250.775 32.9793Z",fill:"B"===t?"#F0F6FC":"#FFFFFF",stroke:"#E0E0E0",strokeWidth:"2.00574"}),(0,a.createElement)("path",{d:"M270.402 28.9875V132.064",stroke:"C"===t?"#006FAD":"#CCCCCC",strokeWidth:"1.50431",strokeMiterlimit:"16"}),(0,a.createElement)("path",{d:"M257.804 152.679L107.771 192.765",stroke:"B"===t?"#006FAD":"#CCCCCC",strokeWidth:"1.50431",strokeMiterlimit:"16"}),(0,a.createElement)("path",{d:"M13.1406 33.41L161.446 1.61817C161.808 1.54066 162.184 1.56462 162.533 1.68742L251.16 32.8868",stroke:"#E0E0E0",strokeWidth:"2.00574"}),o.C?(0,a.createElement)("text",{x:"280",y:"85",fontSize:11,fill:"C"===t?"#007CBA":"#949494"},o.C):(0,a.createElement)("path",{d:"M282.123 80.7892C282.123 79.5323 282.435 78.5405 283.058 77.8136C283.685 77.0867 284.537 76.7233 285.615 76.7233C286.467 76.7233 287.192 76.9739 287.79 77.4752C288.391 77.9729 288.741 78.6175 288.837 79.4088H287.639C287.525 78.9326 287.285 78.553 286.92 78.2701C286.558 77.9873 286.123 77.8458 285.615 77.8458C284.92 77.8458 284.368 78.1108 283.96 78.6407C283.556 79.1671 283.353 79.8833 283.353 80.7892C283.353 81.6915 283.556 82.4077 283.96 82.9376C284.368 83.464 284.922 83.7272 285.62 83.7272C286.132 83.7272 286.569 83.5983 286.93 83.3405C287.296 83.0826 287.532 82.7353 287.639 82.2985H288.837C288.73 83.0647 288.382 83.6824 287.795 84.1515C287.208 84.617 286.483 84.8497 285.62 84.8497C284.542 84.8497 283.69 84.4863 283.063 83.7594C282.437 83.0325 282.123 82.0424 282.123 80.7892Z",fill:"C"===t?"#007CBA":"#949494"}),o.B?(0,a.createElement)("text",{x:"188",y:"190",fontSize:11,fill:"B"===t?"#007CBA":"#949494"},o.B):(0,a.createElement)("path",{d:"M192.281 189.611V181.861H195.396C196.123 181.861 196.692 182.034 197.104 182.382C197.519 182.725 197.727 183.196 197.727 183.794C197.727 184.199 197.596 184.562 197.335 184.885C197.073 185.203 196.751 185.395 196.368 185.459V185.551C196.891 185.604 197.312 185.803 197.63 186.147C197.953 186.487 198.114 186.91 198.114 187.414C198.114 188.098 197.879 188.635 197.41 189.026C196.941 189.416 196.293 189.611 195.466 189.611H192.281ZM193.484 188.591H195.224C195.765 188.591 196.177 188.483 196.459 188.268C196.742 188.054 196.884 187.74 196.884 187.328C196.884 186.924 196.737 186.618 196.443 186.41C196.15 186.199 195.72 186.093 195.154 186.093H193.484V188.591ZM193.484 185.142H194.913C195.442 185.142 195.844 185.048 196.116 184.858C196.391 184.664 196.529 184.383 196.529 184.015C196.529 183.656 196.404 183.379 196.153 183.182C195.906 182.981 195.561 182.881 195.117 182.881H193.484V185.142Z",fill:"B"===t?"#007CBA":"#949494"}),o.A?(0,a.createElement)("text",{x:"18",y:"185",fontSize:11,fill:"A"===t?"#007CBA":"#949494"},o.A):(0,a.createElement)("path",{d:"M22.7694 185.149L25.5678 177.399H26.8622L29.6605 185.149H28.3822L27.6732 183.092H24.7191L24.0048 185.149H22.7694ZM25.0253 182.082H27.3671L26.2445 178.806H26.1532L25.0253 182.082Z",fill:"A"===t?"#007CBA":"#949494"}))}const{name:Wr,...qr}=$r,Zr={example:{},edit:function(e){let{clientId:t}=e;var o,r,n;const i=(0,lt.useBlockProps)(),[l,s]=(0,me.useEntityProp)("postType","product","dimensions"),[m,u]=(0,me.useEntityProp)("postType","product","weight"),[d,p]=(0,a.useState)(),{formatNumber:_,parseNumber:f}=D(),{dimensionUnit:h,weightUnit:g}=(0,b.useSelect)((e=>{const{getOption:t}=e(v.OPTIONS_STORE_NAME);return{dimensionUnit:t("woocommerce_dimension_unit"),weightUnit:t("woocommerce_weight_unit")}}),[]);function E(e,t){return{name:`dimensions.${e}`,value:l?_(String(l[e])):void 0,onChange:t=>s({...null!=l?l:{},[e]:f(t)}),onFocus:()=>p(t),onBlur:()=>p(void 0),suffix:h}}const{ref:y,error:C,validate:k}=Do(`dimensions_width-${t}`,(async function(){if((null==l?void 0:l.width)&&+l.width<=0)return(0,w.__)("Width must be greater than zero.","woocommerce")}),[null==l?void 0:l.width]),{ref:S,error:x,validate:T}=Do(`dimensions_length-${t}`,(async function(){if((null==l?void 0:l.length)&&+l.length<=0)return(0,w.__)("Length must be greater than zero.","woocommerce")}),[null==l?void 0:l.length]),{ref:N,error:P,validate:I}=Do(`dimensions_height-${t}`,(async function(){if((null==l?void 0:l.height)&&+l.height<=0)return(0,w.__)("Height must be greater than zero.","woocommerce")}),[null==l?void 0:l.height]),{ref:A,error:M,validate:R}=Do(`weight-${t}`,(async function(){if(m&&+m<=0)return(0,w.__)("Weight must be greater than zero.","woocommerce")}),[m]),O={...E("width","A"),id:(0,Z.useInstanceId)(c.BaseControl,"product_shipping_dimensions_width"),ref:y,onBlur:k},L={...E("length","B"),id:(0,Z.useInstanceId)(c.BaseControl,"product_shipping_dimensions_length"),ref:S,onBlur:T},B={...E("height","C"),id:(0,Z.useInstanceId)(c.BaseControl,"product_shipping_dimensions_height"),ref:N,onBlur:I},F={id:(0,Z.useInstanceId)(c.BaseControl,"product_shipping_weight"),name:"weight",value:_(String(m)),onChange:e=>u(f(e)),suffix:g,ref:A,onBlur:R};return(0,a.createElement)("div",{...i},(0,a.createElement)("h4",null,(0,w.__)("Dimensions","woocommerce")),(0,a.createElement)("div",{className:"wp-block-columns"},(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(c.BaseControl,{id:O.id,label:(0,a.createInterpolateElement)((0,w.__)("Width <Side />","woocommerce"),{Side:(0,a.createElement)("span",null,"A")}),className:fe()({"has-error":C}),help:C},(0,a.createElement)(c.__experimentalInputControl,{...O})),(0,a.createElement)(c.BaseControl,{id:L.id,label:(0,a.createInterpolateElement)((0,w.__)("Length <Side />","woocommerce"),{Side:(0,a.createElement)("span",null,"B")}),className:fe()({"has-error":x}),help:x},(0,a.createElement)(c.__experimentalInputControl,{...L})),(0,a.createElement)(c.BaseControl,{id:B.id,label:(0,a.createInterpolateElement)((0,w.__)("Height <Side />","woocommerce"),{Side:(0,a.createElement)("span",null,"C")}),className:fe()({"has-error":P}),help:P},(0,a.createElement)(c.__experimentalInputControl,{...B})),(0,a.createElement)(c.BaseControl,{id:F.id,label:(0,w.__)("Weight","woocommerce"),className:fe()({"has-error":M}),help:M},(0,a.createElement)(c.__experimentalInputControl,{...F}))),(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(Gr,{highlight:d,className:"wp-block-woocommerce-product-shipping-dimensions-fields__dimensions-image",labels:{A:(null===(o=O.value)||void 0===o?void 0:o.length)?O.value:void 0,B:(null===(r=L.value)||void 0===r?void 0:r.length)?L.value:void 0,C:(null===(n=B.value)||void 0===n?void 0:n.length)?B.value:void 0}}))))}};function Jr(){return ft({name:Wr,metadata:qr,settings:Zr})}const Kr=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-summary-field","title":"Product summary","category":"widgets","description":"The product summary.","keywords":["products","summary","excerpt"],"textdomain":"default","attributes":{"align":{"type":"string"},"allowedFormats":{"type":"array","default":["core/bold","core/code","core/italic","core/link","core/strikethrough","core/underline","core/text-color","core/subscript","core/superscript","core/unknown"]},"direction":{"type":"string","enum":["ltr","rtl"]},"label":{"type":"string"},"content":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"editorStyle":"file:./editor.css"}'),Xr=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(ge.Path,{d:"M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"}));function Yr(e){let{direction:t,onChange:o}=e;return(0,a.createElement)(a.Fragment,null,(0,w.isRTL)()&&(0,a.createElement)(c.ToolbarButton,{icon:Xr,title:(0,w._x)("Left to right","editor button","woocommerce"),isActive:"ltr"===t,onClick:function(){"function"==typeof o&&o("ltr"===t?void 0:"ltr")}}))}const Qr=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),en=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),tn=(0,a.createElement)(ge.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),on=(0,a.createElement)(ge.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(ge.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})),rn=[{icon:Qr,title:(0,w.__)("Align text left","woocommerce"),align:"left"},{icon:en,title:(0,w.__)("Align text center","woocommerce"),align:"center"},{icon:tn,title:(0,w.__)("Align text right","woocommerce"),align:"right"},{icon:on,title:(0,w.__)("Align text justify","woocommerce"),align:"justify"}],{name:nn,...an}=Kr,ln={example:{},edit:function e(t){let{attributes:o,setAttributes:r}=t;const{align:n,allowedFormats:i,direction:l,label:s}=o,m=(0,lt.useBlockProps)({style:{direction:l}}),u=(0,Z.useInstanceId)(e,"wp-block-woocommerce-product-summary-field__content"),[d,p]=(0,me.useEntityProp)("postType","product","short_description"),{clearSelectedBlock:_}=(0,b.useDispatch)(lt.store);return(0,a.createElement)("div",{className:"wp-block wp-block-woocommerce-product-summary-field-wrapper"},(0,a.createElement)(lt.BlockControls,{group:"block"},(0,a.createElement)(lt.AlignmentControl,{alignmentControls:rn,value:n,onChange:function(e){r({align:e})}}),(0,a.createElement)(Yr,{direction:l,onChange:function(e){r({direction:e})}})),(0,a.createElement)(c.BaseControl,{id:u.toString(),label:s||(0,w.__)("Summary","woocommerce"),help:(0,w.__)("Summarize this product in 1-2 short sentences. We'll show it at the top of the page.","woocommerce")},(0,a.createElement)("div",{...m},(0,a.createElement)(lt.RichText,{id:u.toString(),identifier:"content",tagName:"p",value:d,onChange:p,"data-empty":Boolean(d),className:fe()("components-summary-control",{[`has-text-align-${n}`]:n}),dir:l,allowedFormats:i,onBlur:function(e){var t;(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest(".block-editor-block-contextual-toolbar"))||_()}}))))}};function cn(){return ft({name:nn,metadata:an,settings:ln})}const sn=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-tab","title":"Product tab","category":"woocommerce","description":"The product tab.","keywords":["products","tab","group"],"textdomain":"default","attributes":{"id":{"type":"string"},"title":{"type":"string"},"order":{"type":"number"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"providesContext":{"isInSelectedTab":"isSelected"},"usesContext":["selectedTab"],"editorStyle":"file:./editor.css","templateLock":"contentOnly"}'),mn=100,un=e=>{let{children:t}=e;return(0,a.createElement)(a.Fragment,null,t)};function dn(e){let{children:t,className:o,id:r,order:n=mn,selected:i=!1}=e;const l=fe()("wp-block-woocommerce-product-tab__button",o,{"is-selected":i});return(0,a.createElement)(c.Fill,{name:rt},(e=>{const{onClick:o}=e;return(0,a.createElement)(un,{order:n},(0,a.createElement)(c.Button,{key:r,className:l,onClick:()=>o(r),id:`woocommerce-product-tab__${r}`,"aria-controls":`woocommerce-product-tab__${r}-content`,"aria-selected":i},t))}))}const{name:pn,..._n}=sn,fn={example:{},edit:function(e){let{setAttributes:t,attributes:o,context:r}=e;const n=(0,lt.useBlockProps)(),{id:i,title:l,order:c,isSelected:s}=o,m=(null==r?void 0:r.selectedTab)===i;m!==s&&t({isSelected:m});const u=fe()("wp-block-woocommerce-product-tab__content",{"is-selected":m});return(0,a.createElement)("div",{...n},(0,a.createElement)(dn,{id:i,selected:m,order:c},l),(0,a.createElement)("div",{id:`woocommerce-product-tab__${i}-content`,"aria-labelledby":`woocommerce-product-tab__${i}`,role:"tabpanel",className:u},(0,a.createElement)(lt.InnerBlocks,{templateLock:"contentOnly"})))}};function hn(){ft({name:pn,metadata:_n,settings:fn})}const gn=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-inventory-quantity-field","title":"Product inventory quantity available","category":"woocommerce","description":"The product available quantity.","keywords":["products","quantity","inventory"],"textdomain":"default","attributes":{"name":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:bn,...wn}=gn,En={example:{},edit:function(e){let{clientId:t}=e;const o=(0,lt.useBlockProps)(),[r]=(0,me.useEntityProp)("postType","product","manage_stock"),[n,i]=(0,me.useEntityProp)("postType","product","stock_quantity"),l=(0,Z.useInstanceId)(c.BaseControl,"product_stock_quantity"),{ref:s,error:m,validate:u}=Do(`stock_quantity-${t}`,(async function(){if(r&&n&&n<0)return(0,w.__)("Stock quantity must be a positive number.","woocommerce")}),[r,n]);return(0,a.useEffect)((()=>{r&&null===n&&i(1)}),[r,n]),(0,a.createElement)("div",{...o},(0,a.createElement)("div",{className:"wp-block-columns"},(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(c.BaseControl,{id:l,className:m&&"has-error",help:null!=m?m:""},(0,a.createElement)(c.__experimentalInputControl,{id:l,name:"stock_quantity",ref:s,label:(0,w.__)("Available quantity","woocommerce"),value:n,onChange:i,onBlur:u,type:"number",min:0}))),(0,a.createElement)("div",{className:"wp-block-column"})))}};function vn(){return ft({name:bn,metadata:wn,settings:En})}const yn=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-toggle-field","title":"Product toggle control","category":"woocommerce","description":"The product toggle.","keywords":["products","radio","input"],"textdomain":"default","attributes":{"label":{"type":"string","__experimentalRole":"content"},"property":{"type":"string"},"disabled":{"type":"boolean","default":false}},"supports":{"align":false,"html":false,"multiple":true,"reusable":true,"inserter":false,"lock":false,"__experimentalToolbar":false}}'),{name:Cn,...kn}=yn,Sn={example:{},edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)(),{label:r,property:n,disabled:i}=t,[l,s]=(0,me.useEntityProp)("postType","product",n);return(0,a.createElement)("div",{...o},(0,a.createElement)(c.ToggleControl,{label:r,checked:l,disabled:i,onChange:s}))}};function xn(){return ft({name:Cn,metadata:kn,settings:Sn})}const Tn=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-attributes-field","title":"Product attributes","category":"widgets","description":"The product attributes.","keywords":["products","attributes"],"textdomain":"default","attributes":{"name":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),Nn=e=>{let{initialAttributeTermName:t,attributeId:o,onCancel:r=(()=>{}),onCreated:n=(()=>{})}=e;const{createNotice:l}=(0,b.useDispatch)("core/notices"),[s,m]=(0,a.useState)(!1),{createProductAttributeTerm:u,invalidateResolutionForStoreSelector:d}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME);return(0,a.createElement)(c.Modal,{title:(0,w.__)("Create attribute","woocommerce"),onRequestClose:e=>{e.stopPropagation(),r()},className:"woocommerce-create-attribute-term-modal"},(0,a.createElement)(i.Form,{initialValues:{name:t,slug:(0,E.cleanForSlug)(t)},validate:function(e){var t;const o={};return(null===(t=e.name)||void 0===t?void 0:t.length)||(o.name=(0,w.__)("The attribute term name is required.","woocommerce")),o},errors:{},onSubmit:async e=>{(0,N.recordEvent)("product_attribute_term_add",{source:T}),m(!0);try{const t=await u({...e,attribute_id:o});(0,N.recordEvent)("product_attribute_term_add_success",{source:T}),d("getProductAttributes"),m(!1),n(t)}catch(e){(0,N.recordEvent)("product_attribute_term_add_failed",{source:T}),l("error",(0,w.__)("Failed to create attribute term.","woocommerce")),m(!1),r()}}},(e=>{let{getInputProps:t,handleSubmit:o,isValidForm:n,setValue:i,values:l}=e;const m=t("name");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(c.TextControl,{label:(0,w.__)("Name","woocommerce"),...m,onBlur:()=>{m.onBlur(),i("slug",(0,E.cleanForSlug)(l.name))}}),(0,a.createElement)(c.TextControl,{label:(0,w.__)("Slug","woocommerce"),...t("slug"),help:(0,w.__)("The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.","woocommerce")}),(0,a.createElement)(c.TextareaControl,{label:(0,w.__)("Description","woocommerce"),...t("description")}),(0,a.createElement)("div",{className:"woocommerce-create-attribute-term-modal__buttons"},(0,a.createElement)(c.Button,{isSecondary:!0,label:(0,w.__)("Cancel","woocommerce"),onClick:()=>r()},(0,w.__)("Cancel","woocommerce")),(0,a.createElement)(c.Button,{isPrimary:!0,isBusy:s,label:(0,w.__)("Add attribute","woocommerce"),disabled:!n||s,onClick:o},(0,w.__)("Add","woocommerce"))))})))};let Pn=0;const In=e=>{let{value:t=[],onChange:o,placeholder:r,disabled:n,attributeId:l,label:s="",autoCreateOnSelect:m=!0}=e;const u=(0,a.useRef)("woocommerce-attribute-term-field-"+ ++Pn),[d,p]=(0,a.useState)([]),[_,f]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),[y,C]=(0,a.useState)(),{createNotice:k}=(0,b.useDispatch)("core/notices"),{createProductAttributeTerm:S,invalidateResolutionForStoreSelector:x}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME),P=(0,a.useCallback)((e=>(f(!0),(0,b.resolveSelect)(v.EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME).getProductAttributeTerms({search:e||"",attribute_id:l}).then((e=>(p(e),f(!1),e)),(e=>(f(!1),e))))),[l]),I=(0,Z.useDebounce)(P,250);(0,a.useEffect)((()=>{n||void 0===l||d.length||P()}),[n,l]);const A=e=>{o(t.filter((t=>t.slug!==e.slug)))},M=()=>{const e=document.querySelector("."+u.current+" .woocommerce-experimental-select-control__input");e&&setTimeout((()=>{e.focus()}),0)},R=e=>{-99!==e.id?t.find((t=>t.slug===e.slug))?A(e):o([...t,e]):m?((async e=>{(0,N.recordEvent)("product_attribute_term_add",{source:T}),g(!0);try{const r=await S({...e,attribute_id:l});(0,N.recordEvent)("product_attribute_term_add_success",{source:T}),o([...t,r]),x("getProductAttributes"),x("getProductAttributeTerms"),g(!1)}catch(e){let t={source:T,code:"Unknown error.",message:"An unknown error occurred."},o=(0,w.__)("Failed to create attribute term.","woocommerce");const r=e;(null==r?void 0:r.code)&&(null==r?void 0:r.message)&&(t={...t,code:r.code,message:r.message},"term_exists"===r.code&&(o=(0,w.__)("Attribute term already exists.","woocommerce"))),(0,N.recordEvent)("product_attribute_term_add_failed",t),k("error",o),g(!1)}})({name:e.name,slug:(0,E.cleanForSlug)(e.name)}),M()):C(e.name)},O=(t||[]).map((e=>e.slug));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.__experimentalSelectControl,{items:d,multiple:!0,disabled:n||!l,label:s,getFilteredItems:(e,t)=>t.length>0&&!e.find((e=>e.name.toLowerCase()===t.toLowerCase()))?[...e,{id:-99,name:t}]:e,onInputChange:I,placeholder:r||"",getItemLabel:e=>(null==e?void 0:e.name)||"",getItemValue:e=>(null==e?void 0:e.slug)||"",stateReducer:(e,t)=>{const{changes:o,type:r}=t;switch(r){case i.selectControlStateChangeTypes.ControlledPropUpdatedSelectedItem:const t=h?{isOpen:h}:{};return{...o,...t,inputValue:e.inputValue};case i.selectControlStateChangeTypes.ItemClick:return o.selectedItem&&-99===o.selectedItem.id?o:{...o,isOpen:!0,inputValue:e.inputValue,highlightedIndex:e.highlightedIndex};default:return o}},selected:t,onSelect:R,onRemove:A,className:"woocommerce-attribute-term-field "+u.current,__experimentalOpenMenuOnFocus:!0},(e=>{let{items:t,highlightedIndex:o,getItemProps:r,getMenuProps:n,isOpen:l}=e;return(0,a.createElement)(i.__experimentalSelectControlMenu,{isOpen:l,getMenuProps:n},[_||h?(0,a.createElement)("div",{key:"loading-spinner",className:"woocommerce-attribute-term-field__loading-spinner"},(0,a.createElement)(c.Spinner,null)):null,...t.map(((e,t)=>{const n=O.includes(e.slug);return(0,a.createElement)(i.__experimentalSelectControlMenuItem,{key:`${e.slug}`,index:t,isActive:o===t,item:e,getItemProps:r},-99!==e.id?(0,a.createElement)(c.CheckboxControl,{onChange:()=>null,checked:n,label:(0,a.createElement)("span",{style:{fontWeight:n?"bold":"normal"}},e.name)}):(0,a.createElement)("div",{className:"woocommerce-attribute-term-field__add-new"},(0,a.createElement)(c.Icon,{icon:Yt,size:20,className:"woocommerce-attribute-term-field__add-new-icon"}),(0,a.createElement)("span",null,(0,w.sprintf)((0,w.__)('Create "%s"',"woocommerce"),e.name))))}))].filter((e=>null!==e)))})),!m&&y&&void 0!==l&&(0,a.createElement)(Nn,{initialAttributeTermName:y,onCancel:()=>{C(void 0),M()},attributeId:l,onCreated:e=>{R(e),C(void 0),x("getProductAttributeTerms"),M()}}))};function An(e){return null!==e&&"object"==typeof e&&!!e.label}const Mn=e=>{let{value:t=[],onChange:o,placeholder:r,disabled:n,label:l}=e;const[s,m]=(0,a.useState)(t),u=e=>{o(t.filter((t=>t!==e)))};return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.__experimentalSelectControl,{items:s,multiple:!0,disabled:n,label:l||"",placeholder:r||"",getItemLabel:e=>An(e)?e.label:e||"",getItemValue:e=>An(e)?e.id:e||"",getFilteredItems:(e,t)=>{const o=e.filter((e=>!t.length||!An(e)&&e.toLowerCase().includes(t.toLowerCase())));return t.length>0&&!o.find((e=>!An(e)&&e.toLowerCase()===t.toLowerCase()))?[...o,{id:"is-new",label:t}]:o},selected:t,onSelect:e=>{if(An(e))return m([...s,e.label]),void o([...t,e.label]);t.includes(e)?u(e):o([...t,e])},onRemove:u,className:"woocommerce-attribute-term-field"},(e=>{let{items:o,highlightedIndex:r,getItemProps:n,getMenuProps:l,isOpen:s}=e;return(0,a.createElement)(i.__experimentalSelectControlMenu,{isOpen:s,getMenuProps:l},o.map(((e,o)=>(0,a.createElement)(i.__experimentalSelectControlMenuItem,{key:`${An(e)?e.id:e}`,index:o,isActive:r===o,item:e,getItemProps:n},An(e)?(0,a.createElement)("div",{className:"woocommerce-attribute-term-field__add-new"},(0,a.createElement)(c.Icon,{icon:Yt,size:20,className:"woocommerce-attribute-term-field__add-new-icon"}),(0,a.createElement)("span",null,(0,w.sprintf)((0,w.__)('Create "%s"',"woocommerce"),e.label))):(0,a.createElement)(c.CheckboxControl,{onChange:()=>null,checked:t.includes(e),label:(0,a.createElement)("span",{style:{fontWeight:t.includes(e)?"bold":"normal"}},e)})))))})))},Rn=e=>{let{title:t=(0,w.__)("Edit attribute","woocommerce"),nameLabel:o=(0,w.__)("Name","woocommerce"),globalAttributeHelperMessage:r,customAttributeHelperMessage:n=(0,w.__)("Your customers will see this on the product page","woocommerce"),termsLabel:l=(0,w.__)("Values","woocommerce"),termsPlaceholder:s=(0,w.__)("Search or create value","woocommerce"),isDefaultLabel:m=(0,w.__)("Set default value","woocommerce"),isDefaultTooltip:u=(0,w.__)("Check to preselect the first choice when customers enter the product page.","woocommerce"),useAsFilterLabel:d=(0,w.__)("Use as filter","woocommerce"),useAsFilterTooltip:p=(0,w.__)("Check to allow customers to search and filter by this option in your store.","woocommerce"),visibleLabel:_=(0,w.__)("Visible to customers","woocommerce"),visibleTooltip:f=(0,w.__)("Show or hide this attribute on the product page","woocommerce"),cancelAccessibleLabel:h=(0,w.__)("Cancel","woocommerce"),cancelLabel:g=(0,w.__)("Cancel","woocommerce"),updateAccessibleLabel:b=(0,w.__)("Edit attribute","woocommerce"),updateLabel:E=(0,w.__)("Update","woocommerce"),onCancel:v,onEdit:y,attribute:C}=e;const[k,S]=(0,a.useState)({...C}),x=0===(null==k?void 0:k.id);return(0,a.createElement)(c.Modal,{title:t,onRequestClose:()=>v(),className:"woocommerce-edit-attribute-modal"},(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__body"},(0,a.createElement)(c.TextControl,{label:o,disabled:!x,value:(null==k?void 0:k.name)?null==k?void 0:k.name:"",onChange:e=>S({...k,name:e})}),(0,a.createElement)("p",{className:"woocommerce-edit-attribute-modal__helper-text"},x?n:r),C.terms?(0,a.createElement)(In,{label:l,placeholder:s,value:null==k?void 0:k.terms,attributeId:null==k?void 0:k.id,onChange:e=>{S({...k,terms:e})}}):(0,a.createElement)(Mn,{label:l,placeholder:s,disabled:!(null==C?void 0:C.name),value:null==k?void 0:k.options,onChange:e=>{S({...k,options:e})}}),(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__options"},C.variation&&(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__option-container"},(0,a.createElement)(c.CheckboxControl,{onChange:e=>S({...k,isDefault:e}),checked:null==k?void 0:k.isDefault,label:m}),(0,a.createElement)(i.__experimentalTooltip,{text:u})),(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__option-container"},(0,a.createElement)(c.CheckboxControl,{onChange:e=>S({...k,visible:e}),checked:null==k?void 0:k.visible,label:_}),(0,a.createElement)(i.__experimentalTooltip,{text:f})),0!==C.id&&(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__option-container"},(0,a.createElement)(c.CheckboxControl,{disabled:!0,onChange:()=>{},checked:!0,label:d}),(0,a.createElement)(i.__experimentalTooltip,{text:p})))),(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__buttons"},(0,a.createElement)(c.Button,{isSecondary:!0,label:h,onClick:()=>v()},g),(0,a.createElement)(c.Button,{isPrimary:!0,label:b,onClick:()=>{y(k)}},E)))};function On(e){return 0!==e.id?e.id:e.name}const Ln=e=>`${e.id}-${e.name}`;function Dn(e){let{width:t=24,height:o=24,...r}=e;return(0,a.createElement)("svg",{...r,width:t,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.7226 6.2125C13.1641 6.0766 12.5883 6 11.9999 6C8.10055 6 4.75407 9.36447 3.31899 11.0546C2.8507 11.6061 2.8507 12.3939 3.31899 12.9454C4.17896 13.9582 5.72533 15.5723 7.66574 16.7033L8.41572 15.4043C8.13761 15.242 7.86389 15.0655 7.59553 14.8776C6.25019 13.9359 5.15775 12.7905 4.48406 12C5.15775 11.2095 6.25019 10.0641 7.59553 9.12235C8.96667 8.16257 10.4775 7.5 11.9999 7.5C12.3118 7.5 12.6231 7.5278 12.9329 7.58027L13.7226 6.2125ZM12.3504 8.58923C12.2352 8.57753 12.1182 8.57153 11.9999 8.57153C10.1063 8.57153 8.57132 10.1066 8.57132 12.0001C8.57132 12.7505 8.81237 13.4445 9.22126 14.0091L10.1233 12.4467C10.0893 12.3034 10.0713 12.1538 10.0713 12.0001C10.0713 11.1266 10.652 10.3888 11.4484 10.1515L12.3504 8.58923ZM12.8092 10.2491L13.5611 8.94679C14.6697 9.51479 15.4285 10.6688 15.4285 12.0001C15.4285 13.8937 13.8934 15.4287 11.9999 15.4287C11.3128 15.4287 10.6729 15.2266 10.1364 14.8785L10.8883 13.5763C11.2025 13.7983 11.5859 13.9287 11.9999 13.9287C13.065 13.9287 13.9285 13.0652 13.9285 12.0001C13.9285 11.224 13.4701 10.555 12.8092 10.2491ZM9.51376 15.957C10.3246 16.2986 11.1605 16.5 11.9999 16.5C13.5223 16.5 15.0331 15.8374 16.4043 14.8776C17.7496 13.9359 18.842 12.7905 19.5157 12C18.842 11.2095 17.7496 10.0641 16.4043 9.12235C15.6875 8.62066 14.9327 8.20018 14.1579 7.91308L14.917 6.59839C17.5164 7.64275 19.6204 9.80575 20.6808 11.0546C21.1491 11.6061 21.1491 12.3939 20.6808 12.9454C19.2457 14.6355 15.8992 18 11.9999 18C10.8611 18 9.76945 17.713 8.7588 17.2646L9.51376 15.957Z",fill:"currentColor"}),(0,a.createElement)("rect",{x:"16.0625",y:"4.61377",width:"1.22727",height:"16",transform:"rotate(30 16.0625 4.61377)",fill:"currentColor"}))}function Bn(e){let{width:t=10,height:o=15,...r}=e;return(0,a.createElement)("svg",{...r,width:t,height:o,viewBox:`0 0 ${t} ${o}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)("g",{id:"help"},(0,a.createElement)("g",{id:"bundle os x cursors"},(0,a.createElement)("g",{id:"Made with 💕by Azendoo design team   @azendoo"},(0,a.createElement)("g",{id:"help_2"},(0,a.createElement)("path",{id:"cursor",fillRule:"evenodd",clipRule:"evenodd",d:"M2.3165 1.9407C2.9225 1.4527 4.0465 1.0657 5.0025 1.0597C6.5165 1.0507 7.3135 1.5157 8.0285 2.2107C8.7165 2.8797 9.0325 3.5627 8.9815 4.6107C8.9405 5.4637 8.7145 5.9587 8.3775 6.4217C8.1795 6.7027 7.8005 7.0627 7.2395 7.4997L6.7065 7.9297C6.3765 8.2497 6.2325 8.3927 6.1065 8.7497C6.0125 9.0157 5.9905 9.2557 5.9855 9.6717H4.0085C4.0055 8.6557 3.9895 8.2967 4.0985 7.8587C4.2055 7.4327 4.6005 7.1247 5.1615 6.6877L5.7295 6.2417C5.9175 6.1017 6.2235 5.8277 6.3375 5.6607C6.5455 5.3747 6.6715 4.9787 6.6885 4.6357C6.7045 4.3127 6.6075 3.9367 6.3445 3.6087C6.0325 3.2187 5.6415 2.9707 4.8795 3.0047C4.2785 3.0317 3.8185 3.3377 3.5375 3.6267C3.2075 3.9667 3.0635 4.5307 3.0395 4.9767H1.0625C1.1245 3.4927 1.4165 2.6647 2.3165 1.9407Z",fill:"white"}),(0,a.createElement)("path",{id:"cursor_2",fillRule:"evenodd",clipRule:"evenodd",d:"M2.3165 1.9407C2.9225 1.4527 4.0465 1.0657 5.0025 1.0597C6.5165 1.0507 7.3135 1.5157 8.0285 2.2107C8.7165 2.8797 9.0325 3.5627 8.9815 4.6107C8.9405 5.4637 8.7145 5.9587 8.3775 6.4217C8.1795 6.7027 7.8005 7.0627 7.2395 7.4997L6.7065 7.9297C6.3765 8.2497 6.2325 8.3927 6.1065 8.7497C6.0125 9.0157 5.9905 9.2557 5.9855 9.6717H4.0085C4.0055 8.6557 3.9895 8.2967 4.0985 7.8587C4.2055 7.4327 4.6005 7.1247 5.1615 6.6877L5.7295 6.2417C5.9175 6.1017 6.2235 5.8277 6.3375 5.6607C6.5455 5.3747 6.6715 4.9787 6.6885 4.6357C6.7045 4.3127 6.6075 3.9367 6.3445 3.6087C6.0325 3.2187 5.6415 2.9707 4.8795 3.0047C4.2785 3.0317 3.8185 3.3377 3.5375 3.6267C3.2075 3.9667 3.0635 4.5307 3.0395 4.9767H1.0625C1.1245 3.4927 1.4165 2.6647 2.3165 1.9407Z",stroke:"white",strokeWidth:"2"}),(0,a.createElement)("mask",{id:"mask0_4951_449651",maskUnits:"userSpaceOnUse",x:"-4",y:"-1",width:"18",height:"18"},(0,a.createElement)("g",{id:"mask 2"},(0,a.createElement)("path",{id:"Vector",d:"M-4 -1H14V17H-4V-1Z",fill:"white"}))),(0,a.createElement)("g",{mask:"url(#mask0_4951_449651)"},(0,a.createElement)("path",{id:"cursor_3",fillRule:"evenodd",clipRule:"evenodd",d:"M3.75391 10.8628H6.22791V13.2578H3.75391V10.8628Z",fill:"white"}),(0,a.createElement)("path",{id:"cursor_4",fillRule:"evenodd",clipRule:"evenodd",d:"M3.75391 10.8628H6.22791V13.2578H3.75391V10.8628Z",stroke:"white",strokeWidth:"1.5"}),(0,a.createElement)("path",{id:"cursor_5",fillRule:"evenodd",clipRule:"evenodd",d:"M2.515 1.92095C3.212 1.47195 3.857 1.12695 4.941 1.12695C6.558 1.12695 6.924 1.36895 7.753 2.03095C8.503 2.62995 8.96 3.40695 8.96 4.51095C8.96 5.18795 8.596 5.91895 8.258 6.38195C8.061 6.66295 7.799 6.94195 7.238 7.37995L6.626 7.84995C6.326 8.08395 6.028 8.43795 5.929 8.74995C5.867 8.94795 5.871 9.37295 5.867 9.78895H4.007C4.038 8.90895 4.041 8.18395 4.176 7.84795C4.311 7.51195 4.659 7.12495 5.22 6.68795L5.767 6.24195C5.954 6.10195 6.242 5.88795 6.356 5.72095C6.564 5.43495 6.745 5.01995 6.745 4.67595C6.745 4.27995 6.767 3.99995 6.536 3.67395C6.266 3.29595 6.02 2.87995 4.858 2.85995C3.953 2.84395 3.567 3.30695 3.316 3.70695C3.064 4.10895 2.978 4.56495 2.978 4.99695H1C1.063 3.51295 1.541 2.54095 2.515 1.92095Z",fill:"black"}),(0,a.createElement)("path",{id:"cursor_6",fillRule:"evenodd",clipRule:"evenodd",d:"M4.01172 11.0161H5.99072V13.0001H4.01172V11.0161Z",fill:"black"})))))),(0,a.createElement)("defs",null,(0,a.createElement)("clipPath",{id:"clip0_4951_449651"},(0,a.createElement)("rect",{width:"10",height:"15",fill:"white"}))))}function Fn(e){let{width:t=24,height:o=24,...r}=e;return(0,a.createElement)("svg",{...r,width:t,height:o,viewBox:`0 0 ${t} ${o}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)("g",null,(0,a.createElement)("path",{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"#949494"}),(0,a.createElement)("rect",{x:"16.7734",y:"4",width:"1.22727",height:"16",transform:"rotate(30 16.7734 4)",fill:"#949494"}),(0,a.createElement)("rect",{x:"16",y:"3",width:"1.22727",height:"16",transform:"rotate(30 16 3)",fill:"white"})),(0,a.createElement)("defs",null,(0,a.createElement)("clipPath",{id:"clip0_4951_450432"},(0,a.createElement)("rect",{width:"24",height:"24",fill:"white"}))))}const Vn=(0,w.__)("Not visible","woocommerce"),Hn=(0,w.__)("Custom attribute. Customers can’t filter or search by it to find this product","woocommerce"),zn=e=>{let{attribute:t,editLabel:o=(0,w.__)("Edit","woocommerce"),removeLabel:r=(0,w.__)("Remove attribute","woocommerce"),onDragStart:n,onDragEnd:l,onEditClick:s,onRemoveClick:m}=e;return(0,a.createElement)(i.ListItem,{className:"woocommerce-attribute-list-item",onDragStart:n,onDragEnd:l},(0,a.createElement)("div",null,t.name),(0,a.createElement)("div",{className:"woocommerce-attribute-list-item__options"},t.options.slice(0,2).map(((e,t)=>(0,a.createElement)("div",{className:"woocommerce-attribute-list-item__option-chip",key:t},e))),t.options.length>2&&(0,a.createElement)("div",{className:"woocommerce-attribute-list-item__option-chip"},(0,w.sprintf)((0,w.__)("+ %i more","woocommerce"),t.options.length-2))),(0,a.createElement)("div",{className:"woocommerce-attribute-list-item__actions"},0===t.id&&(0,a.createElement)(c.Tooltip,{className:"woocommerce-attribute-list-item__actions-tooltip",position:"top center",text:Hn},(0,a.createElement)("div",{className:"woocommerce-attribute-list-item__actions-icon-wrapper"},(0,a.createElement)(Fn,{className:"woocommerce-attribute-list-item__actions-icon-wrapper-icon"}),(0,a.createElement)(Bn,{className:"woocommerce-attribute-list-item__actions-icon-wrapper-help-icon"}))),!t.visible&&(0,a.createElement)(c.Tooltip,{className:"woocommerce-attribute-list-item__actions-tooltip",position:"top center",text:Vn},(0,a.createElement)("div",{className:"woocommerce-attribute-list-item__actions-icon-wrapper"},(0,a.createElement)(Dn,{className:"woocommerce-attribute-list-item__actions-icon-wrapper-icon"}),(0,a.createElement)(Bn,{className:"woocommerce-attribute-list-item__actions-icon-wrapper-help-icon"}))),"function"==typeof s&&(0,a.createElement)(c.Button,{variant:"tertiary",onClick:()=>s(t)},o),"function"==typeof m&&(0,a.createElement)(c.Button,{icon:Oe,label:r,onClick:()=>m(t)})))};function Un(e){return-99===e.id}const jn=e=>{let{value:t=null,onChange:o,placeholder:r,label:n,disabled:l,disabledAttributeIds:s=[],disabledAttributeMessage:m,ignoredAttributeIds:u=[],createNewAttributesAsGlobal:d=!1}=e;const{createErrorNotice:p}=(0,b.useDispatch)("core/notices"),{createProductAttribute:_,invalidateResolution:f}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_ATTRIBUTES_STORE_NAME),{attributes:h,isLoading:g}=(0,b.useSelect)((e=>{const{getProductAttributes:t,hasFinishedResolution:o}=e(v.EXPERIMENTAL_PRODUCT_ATTRIBUTES_STORE_NAME);return{isLoading:!o("getProductAttributes"),attributes:t()}})),E=(0,a.useMemo)((function(){var e;return null!==(e=null==h?void 0:h.map((e=>({...e,isDisabled:s.includes(e.id)}))))&&void 0!==e?e:[]}),[h,s]);return(0,a.createElement)(i.__experimentalSelectControl,{className:"woocommerce-attribute-input-field",items:E||[],label:n||"",disabled:l,getFilteredItems:(e,t)=>{const o=e.filter((e=>(e=>!u.length||!u.includes(e.id))(e)&&(e.name||"").toLowerCase().startsWith(t.toLowerCase())));return t.length>0&&!e.find((e=>e.name.toLowerCase()===t.toLowerCase()))?[...o,{id:-99,name:t}]:o},placeholder:r,getItemLabel:e=>(null==e?void 0:e.name)||"",getItemValue:e=>(null==e?void 0:e.id)||"",selected:t,onSelect:e=>{Un(e)?(e=>{(0,N.recordEvent)("product_attribute_add_custom_attribute",{source:T}),d?_({name:e.name}).then((e=>{f("getProductAttributes"),o({...e,options:[]})}),(e=>{let t=(0,w.__)("Failed to create new attribute.","woocommerce");"woocommerce_rest_cannot_create"===e.code&&(t=e.message),p(t,{explicitDismiss:!0})})):o(e.name)})(e):o({id:e.id,name:e.name,options:[]})},onRemove:()=>o(),__experimentalOpenMenuOnFocus:!0},(e=>{let{items:t,highlightedIndex:o,getItemProps:r,getMenuProps:n,isOpen:l}=e;return(0,a.createElement)(i.__experimentalSelectControlMenu,{getMenuProps:n,isOpen:l},g?(0,a.createElement)(c.Spinner,null):t.map(((e,t)=>(0,a.createElement)(i.__experimentalSelectControlMenuItem,{key:e.id,index:t,isActive:o===t,item:e,getItemProps:t=>({...r(t),disabled:e.isDisabled||void 0}),tooltipText:e.isDisabled?m:void 0},Un(e)?(0,a.createElement)("div",{className:"woocommerce-attribute-input-field__add-new"},(0,a.createElement)(c.Icon,{icon:Yt,size:20,className:"woocommerce-attribute-input-field__add-new-icon"}),(0,a.createElement)("span",null,(0,w.sprintf)((0,w.__)('Create "%s"',"woocommerce"),e.name))):e.name))))}))},$n=e=>{let{title:t=(0,w.__)("Add attributes","woocommerce"),description:o="",notice:r=(0,w.__)("By default, attributes are filterable and visible on the product page. You can change these settings for each attribute separately later.","woocommerce"),attributeLabel:n=(0,w.__)("Attribute","woocommerce"),valueLabel:l=(0,w.__)("Values","woocommerce"),attributePlaceholder:s=(0,w.__)("Search or create attribute","woocommerce"),termPlaceholder:m=(0,w.__)("Search or create value","woocommerce"),removeLabel:u=(0,w.__)("Remove attribute","woocommerce"),addAnotherAccessibleLabel:d=(0,w.__)("Add another attribute","woocommerce"),addAnotherLabel:p=(0,w.__)("+ Add another","woocommerce"),cancelLabel:_=(0,w.__)("Cancel","woocommerce"),addAccessibleLabel:f=(0,w.__)("Add attributes","woocommerce"),addLabel:h=(0,w.__)("Add","woocommerce"),confirmMessage:g=(0,w.__)("You have some attributes added to the list, are you sure you want to cancel?","woocommerce"),confirmCancelLabel:b=(0,w.__)("No thanks","woocommerce"),confirmConfirmLabel:E=(0,w.__)("Yes please!","woocommerce"),onCancel:v,onAdd:y,selectedAttributeIds:C=[],createNewAttributesAsGlobal:k=!1,disabledAttributeIds:S=[],disabledAttributeMessage:x=(0,w.__)("Already used in Attributes","woocommerce")}=e;const[T,P]=(0,a.useState)(!1),I=e=>{return(e=>0!==e.id)(e)?(t=e.terms)?t.map((e=>e.name)):[]:e.options;var t},A=e=>void 0===e.visible||e.visible,M=e=>{e.attributes.some((e=>null!==e&&(null==e?void 0:e.terms)&&(null==e?void 0:e.terms.length)>0))?P(!0):v()};return(0,a.useEffect)((function(){const e=document.querySelector(".woocommerce-new-attribute-modal__table-row .woocommerce-attribute-input-field label");null==e||e.focus()}),[]),(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.Form,{initialValues:{attributes:[null]}},(e=>{let{values:i,setValue:g}=e;return(0,a.createElement)(c.Modal,{title:t,onRequestClose:e=>{e.isPropagationStopped()||M(i)},className:"woocommerce-new-attribute-modal"},r&&(0,a.createElement)(c.Notice,{isDismissible:!1},(0,a.createElement)("p",null,r)),o&&(0,a.createElement)("p",null,o),(0,a.createElement)("div",{className:"woocommerce-new-attribute-modal__body"},(0,a.createElement)("table",{className:"woocommerce-new-attribute-modal__table"},(0,a.createElement)("thead",null,(0,a.createElement)("tr",{className:"woocommerce-new-attribute-modal__table-header"},(0,a.createElement)("th",null,n),(0,a.createElement)("th",null,l))),(0,a.createElement)("tbody",null,i.attributes.map(((e,t)=>(0,a.createElement)("tr",{key:t,className:`woocommerce-new-attribute-modal__table-row woocommerce-new-attribute-modal__table-row-${t}`},(0,a.createElement)("td",{className:"woocommerce-new-attribute-modal__table-attribute-column"},(0,a.createElement)(jn,{placeholder:s,value:e,label:n,onChange:e=>{g("attributes["+t+"]",e&&function(e){return"string"==typeof e?{id:0,name:e,options:[]}:e}(e)),e&&(e=>{setTimeout((()=>{const t=document.querySelector(".woocommerce-new-attribute-modal__table-row-"+e+" .woocommerce-new-attribute-modal__table-attribute-value-column .woocommerce-experimental-select-control__input");t&&t.focus()}),0)})(t)},ignoredAttributeIds:[...C,...i.attributes.map((e=>null==e?void 0:e.id)).filter((e=>void 0!==e))],createNewAttributesAsGlobal:k,disabledAttributeIds:S,disabledAttributeMessage:x})),(0,a.createElement)("td",{className:"woocommerce-new-attribute-modal__table-attribute-value-column"},null===e||0!==e.id?(0,a.createElement)(In,{placeholder:m,disabled:!e||!e.id,attributeId:e?e.id:void 0,value:null===e?[]:e.terms,label:l,onChange:e=>g("attributes["+t+"].terms",e)}):(0,a.createElement)(Mn,{placeholder:m,disabled:!e.name,value:e.options,label:l,onChange:e=>g("attributes["+t+"].options",e)})),(0,a.createElement)("td",{className:"woocommerce-new-attribute-modal__table-attribute-trash-column"},(0,a.createElement)(c.Button,{icon:Ao,disabled:1===i.attributes.length&&null===i.attributes[0],label:u,onClick:()=>((e,t,o)=>{(0,N.recordEvent)("product_add_attributes_modal_remove_attribute_button_click"),t.attributes.length>1?o("attributes",t.attributes.filter(((t,o)=>o!==e))):o(`attributes[${e}]`,[null])})(t,i,g)})))))))),(0,a.createElement)("div",null,(0,a.createElement)(c.Button,{className:"woocommerce-new-attribute-modal__add-attribute",variant:"tertiary",label:d,onClick:()=>{(0,N.recordEvent)("product_add_attributes_modal_add_another_attribute_button_click"),((e,t)=>{var o;t("attributes",[...e.attributes,null]),o=e.attributes.length,setTimeout((()=>{const e=document.querySelector(`.woocommerce-new-attribute-modal__table-row-${o}`);null==e||e.scrollIntoView({behavior:"smooth"})}),0)})(i,g)}},p)),(0,a.createElement)("div",{className:"woocommerce-new-attribute-modal__buttons"},(0,a.createElement)(c.Button,{isSecondary:!0,label:_,onClick:()=>M(i)},_),(0,a.createElement)(c.Button,{isPrimary:!0,label:f,disabled:1===i.attributes.length&&null===i.attributes[0],onClick:()=>(e=>{const t=[];e.attributes.forEach((e=>{var o;null!==(o=e)&&o.name.length>0&&(e=>e.terms&&e.terms.length>0||e.options&&e.options.length>0)(o)&&t.push({...e,visible:A(e),options:I(e)})})),y(t)})(i)},h)))})),(0,a.createElement)(i.__experimentalSelectControlMenuSlot,null),T&&(0,a.createElement)(c.__experimentalConfirmDialog,{cancelButtonText:b,confirmButtonText:E,onCancel:()=>P(!1),onConfirm:v},g))},Gn=e=>{let{title:t=(0,w.__)("Add attributes","woocommerce"),description:o="",onCancel:r,onRemove:n}=e;return(0,a.createElement)(c.Modal,{title:t,onRequestClose:e=>{e.isPropagationStopped()||r()},className:"woocommerce-remove-attribute-modal"},o&&(0,a.createElement)("p",null,o),(0,a.createElement)("div",{className:"woocommerce-remove-attribute-modal__buttons"},(0,a.createElement)(c.Button,{isDestructive:!0,variant:"primary",label:(0,w.__)("Delete","woocommerce"),onClick:n},(0,w.__)("Delete","woocommerce")),(0,a.createElement)(c.Button,{variant:"tertiary",label:(0,w.__)("Cancel","woocommerce"),onClick:r},(0,w.__)("Cancel","woocommerce"))))},Wn=e=>{let{value:t,onAdd:o=(()=>{}),onChange:r,onEdit:n=(()=>{}),onNewModalCancel:l=(()=>{}),onNewModalClose:s=(()=>{}),onNewModalOpen:m=(()=>{}),onEditModalCancel:u=(()=>{}),onEditModalClose:d=(()=>{}),onEditModalOpen:p=(()=>{}),onRemove:_=(()=>{}),onRemoveCancel:f=(()=>{}),onNoticeDismiss:h=(()=>{}),uiStrings:g,createNewAttributesAsGlobal:b=!1,useRemoveConfirmationModal:E=!1,disabledAttributeIds:v=[]}=e;g={newAttributeListItemLabel:(0,w.__)("Add new","woocommerce"),globalAttributeHelperMessage:(0,w.__)("You can change the attribute's name in <link>Attributes</link>.","woocommerce"),newAttributeModalNotice:(0,w.__)("By default, attributes are filterable and visible on the product page. You can change these settings for each attribute separately later.","woocommerce"),attributeRemoveConfirmationMessage:(0,w.__)("Remove this attribute?","woocommerce"),...g};const[y,C]=(0,a.useState)(!1),[k,S]=(0,a.useState)(),[x,T]=(0,a.useState)(null),P=e=>{r(e.map((e=>({...e,options:e.terms?e.terms.map((e=>e.name)):e.options,terms:void 0,visible:e.visible||!1}))))},I=e=>{P(t.filter((t=>Ln(t)!==Ln(e)))),_(e),S(null)},A=()=>{C(!1),s()},M=e=>{T(null),d(e)},R=t.sort(((e,t)=>e.position-t.position)),O=t.reduce(((e,t)=>(e[On(t)]=t,e)),{}),L=t.find((e=>Ln(e)===x));return(0,a.createElement)("div",{className:"woocommerce-attribute-field"},(0,a.createElement)(c.Button,{variant:"secondary",className:"woocommerce-add-attribute-list-item__add-button",onClick:()=>{C(!0),m(),(0,N.recordEvent)("product_add_attributes_click")}},g.newAttributeListItemLabel),g.notice&&(0,a.createElement)(c.Notice,{isDismissible:!0,status:"warning",className:"woocommerce-attribute-field__notice",onRemove:h},(0,a.createElement)("p",null,g.notice)),Boolean(t.length)&&(0,a.createElement)(i.Sortable,{onOrderChange:e=>{const t=e.reduce(((e,t,o)=>{let{props:r}=t;return e[On(r.attribute)]=o,e}),{});r(function(e,t){return Object.keys(t).map((o=>isNaN(e[o])?{...t[o]}:{...t[o],position:e[o]}))}(t,O))}},R.map((e=>(0,a.createElement)(zn,{attribute:e,removeLabel:null==g?void 0:g.attributeRemoveLabel,key:Ln(e),onEditClick:()=>{return T(Ln(t=e)),void p(t);var t},onRemoveClick:()=>{return t=e,void(E?S(t):window.confirm(null==g?void 0:g.attributeRemoveConfirmationMessage)?I(t):f(t));var t}})))),y&&(0,a.createElement)($n,{title:g.newAttributeModalTitle,description:g.newAttributeModalDescription,notice:g.newAttributeModalNotice,onCancel:()=>{A(),l()},onAdd:e=>{P([...t,...e.filter((e=>!t.find((t=>Ln(e)===Ln(t)))))]),o(e),A()},selectedAttributeIds:t.map((e=>e.id)),createNewAttributesAsGlobal:b,disabledAttributeIds:v,disabledAttributeMessage:g.disabledAttributeMessage}),(0,a.createElement)(i.__experimentalSelectControlMenuSlot,null),L&&(0,a.createElement)(Rn,{title:(0,w.sprintf)((0,w.__)("Edit %s","woocommerce"),L.name),customAttributeHelperMessage:g.customAttributeHelperMessage,globalAttributeHelperMessage:g.globalAttributeHelperMessage?(0,a.createInterpolateElement)(g.globalAttributeHelperMessage,{link:(0,a.createElement)(i.Link,{href:(0,Ve.getAdminLink)("edit.php?post_type=product&page=product_attributes"),target:"_blank",type:"wp-admin"},(0,a.createElement)(a.Fragment,null))}):void 0,onCancel:()=>{M(L),u(L)},onEdit:e=>{(e=>{const o=t.map((t=>Ln(t)===Ln(e)?e:t));n(e),P(o),M(e)})(e)},attribute:L}),k&&(0,a.createElement)(Gn,{title:(0,w.sprintf)((0,w.__)("Delete %(attributeName)s","woocommerce"),{attributeName:k.name}),description:g.attributeRemoveConfirmationModalMessage,onRemove:()=>I(k),onCancel:()=>{f(k),S(null)}}))},qn=(e,t)=>e.reduce(((e,o)=>(e[t(o)?0:1].push(o),e)),[[],[]]),Zn=(e,t)=>t?e.filter((e=>!!e.variation)):e.filter((e=>!e.variation));function Jn(e){let{allAttributes:t=[],isVariationAttributes:o=!1,onChange:r,productId:n}=e;const[i,l]=(0,a.useState)(Zn(t,o)),c=(0,a.useCallback)((e=>(0,b.resolveSelect)(v.EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME).getProductAttributeTerms({attribute_id:e}).then((e=>e),(e=>e))),[n]),s=(e,t,o)=>e.map(((e,r)=>{let{isDefault:n,terms:a,...i}=e;return{...i,variation:t,position:o+r}}));return(0,a.useEffect)((()=>{const[e,r]=qn(Zn(t,o),(e=>0===e.id));Promise.all(r.map((e=>c(e.id)))).then((t=>{l([...r.map(((e,o)=>{return r=e,n=t[o],{...r,terms:(n||[]).filter((e=>r.options.includes(e.name)))};var r,n})),...e])}))}),[t,o,c]),{attributes:i,handleChange:e=>{let n=o?t.filter((e=>!e.variation)):t.filter((e=>!!e.variation));n=n.filter((t=>!(t.id>0&&e.some((e=>e.id===t.id))||0===t.id&&e.some((e=>e.name.toLowerCase()===t.name.toLowerCase())))));const a=s(e,o,o?n.length:0),i=s(n,!o,o?0:e.length);r(o?[...i,...a]:[...a,...i])},setAttributes:l}}const Kn=e=>{let{value:t,onChange:o,productId:r}=e;const{attributes:n,handleChange:i}=Jn({allAttributes:t,onChange:o,productId:r});return(0,a.createElement)(Wn,{value:n,disabledAttributeIds:t.filter((e=>!!e.variation)).map((e=>e.id)),uiStrings:{disabledAttributeMessage:(0,w.__)("Already used in Variations","woocommerce")},onAdd:()=>{(0,N.recordEvent)("product_add_attributes_modal_add_button_click")},onChange:i,onNewModalCancel:()=>{(0,N.recordEvent)("product_add_attributes_modal_cancel_button_click")},onNewModalOpen:()=>{n.length?(0,N.recordEvent)("product_add_attribute_button"):(0,N.recordEvent)("product_add_first_attribute_button_click")},onRemove:()=>(0,N.recordEvent)("product_remove_attribute_confirmation_confirm_click"),onRemoveCancel:()=>(0,N.recordEvent)("product_remove_attribute_confirmation_cancel_click")})},{name:Xn}=Tn,Yn={example:{},edit:function(){const[e,t]=(0,me.useEntityProp)("postType","product","attributes"),o=(0,me.useEntityId)("postType","product"),r=(0,lt.useBlockProps)();return(0,a.createElement)("div",{...r},(0,a.createElement)(Kn,{productId:o,value:e,onChange:t}))}},Qn=()=>ft({name:Xn,metadata:Tn,settings:Yn}),ea=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-variations-fields","title":"Product variations fields","category":"woocommerce","description":"The product variations.","keywords":["products","variations"],"textdomain":"default","attributes":{"description":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}');function ta(e){const t=(0,Z.useInstanceId)(c.G,"clip");return(0,a.createElement)(c.SVG,{width:"264",height:"167",...e,viewBox:"0 0 264 167",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(c.G,{clipPath:`url(#${t})`},(0,a.createElement)(c.Path,{d:"M38.5556 0.164185C11.3783 0.164185 -3.89877 21.4091 1.5234 37.3916C7.43365 54.8517 25.6968 71.9169 25.6968 85.7696H51.4188C51.4188 71.908 69.6821 54.8517 75.5923 37.3916C81.0145 21.4091 65.7463 0.164185 38.5556 0.164185Z",fill:"#F0F0F0"}),(0,a.createElement)(c.Path,{d:"M50.5063 48.3114C44.2189 48.3114 40.5228 52.5755 40.5228 59.1735V59.9899C40.079 59.9899 39.6176 59.9899 39.1827 59.9944H38.3486C37.7141 59.9944 37.3325 59.9944 36.5915 59.9944V59.1779C36.5915 52.5755 32.8953 48.3114 26.6124 48.3114C21.0127 48.3114 17.8047 50.4812 17.8047 54.2616C17.8047 57.0969 20.4936 59.0137 25.7915 59.9589C29.0306 60.5357 32.1721 60.6777 35.2781 60.7087V85.7652H36.6003V60.7176C37.3413 60.722 37.7185 60.722 38.3574 60.7176C38.9919 60.7176 39.7906 60.7176 40.5316 60.7176V85.7652H41.8539V60.7132C44.9554 60.6777 48.0969 60.5401 51.3405 59.9633C56.6384 59.0182 59.3273 57.1013 59.3273 54.266C59.3273 50.4856 56.1192 48.3158 50.5196 48.3158L50.5063 48.3114ZM35.2781 59.9855C32.2032 59.95 29.106 59.8124 25.9202 59.2445C21.0172 58.3704 19.6905 56.2938 19.6905 54.1329C19.6905 50.2682 23.5996 49.0347 26.6124 49.0347C32.2342 49.0347 35.2781 53.0148 35.2781 59.169V59.981V59.9855ZM51.1985 59.2445C48.0126 59.8124 44.9155 59.9544 41.845 59.9855V59.1735C41.845 53.0148 44.8889 49.0391 50.5107 49.0391C53.528 49.0391 57.4326 50.2726 57.4326 54.1373C57.4326 56.2982 56.1015 58.3704 51.2029 59.2489L51.1985 59.2445Z",fill:"white"}),(0,a.createElement)(c.Path,{d:"M38.5585 101.872C45.5248 101.872 51.4173 96.1613 51.4173 89.834H25.6953C25.6953 96.1613 31.5923 101.872 38.5585 101.872Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M57.2858 89.9271H19.832V85.7695H57.2858V89.9271Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M69.5768 106.602H7.63895L0.4375 167L15.2974 151.328H64.2566L69.5768 106.602Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M119.436 122.749C113.97 115.072 110.828 111.394 104.652 111.394C97.8809 111.394 94.908 119.061 98.9724 123.853C103.445 129.125 118.993 134.627 118.993 134.627C118.993 134.627 94.0694 129.923 84.9112 129.923C79.8573 129.923 74.6836 131.96 74.6836 139.135C74.6836 146.31 79.8617 148.346 84.9112 148.346C94.0694 148.346 118.993 143.643 118.993 143.643C118.993 143.643 103.445 149.145 98.9724 154.416C94.908 159.208 97.8764 166.876 104.652 166.876C110.828 166.876 113.97 163.197 119.436 155.521C121.287 152.921 130.707 139.135 130.707 139.135C130.707 139.135 121.287 125.349 119.436 122.749Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M94.2838 102.671L169.715 102.671V80.4849L94.2838 80.4849V102.671Z",fill:"#F0F0F0"}),(0,a.createElement)(c.Path,{d:"M169.712 0H94.2812V75.4311H169.712V0Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M147.619 49.6336C147.619 44.4156 144.429 39.4194 138.168 36.0116H157.66L139.472 6.00781H124.524L106.336 36.0116H125.828C119.567 39.4194 116.377 44.4156 116.377 49.6336C116.377 55.5394 121.005 61.4985 127.106 64.6888C118.667 62.9849 117.344 69.4232 117.344 69.4232H146.661C146.661 69.4232 145.338 62.9849 136.899 64.6888C143 61.4985 147.628 55.5394 147.628 49.6336H147.619Z",fill:"white"}),(0,a.createElement)(c.Path,{d:"M147.86 80.7911H94.2812V85.2283H147.86V80.7911Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M169.712 89.8473H94.2812V94.2844H169.712V89.8473Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M136.82 98.9034H94.2812V103.341H136.82V98.9034Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M219.52 167C229.042 167 235.063 158.538 235.063 151.457H203.977C203.977 158.538 209.998 167 219.52 167Z",fill:"#DDDDDD"}),(0,a.createElement)(c.Path,{d:"M219.516 58.2018C185.027 58.2018 168.143 86.1557 178.522 110.613C185.541 127.141 202.225 125.264 202.225 138.505H236.826C236.826 125.264 253.514 127.141 260.529 110.613C270.903 86.1557 254.006 58.2018 219.516 58.2018Z",fill:"#F0F0F0"}),(0,a.createElement)(c.Path,{d:"M219.52 167C228.9 167 234.882 158.787 235.059 151.776C235.059 151.67 235.059 142.707 235.059 142.6H203.973C203.973 142.685 203.973 151.63 203.973 151.719C204.115 158.742 210.105 167.004 219.511 167.004L219.52 167Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M240.248 142.596H198.801V138.505H240.248V142.596Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M240.248 149.074H198.801V144.983H240.248V149.074Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M169.656 125.371H142.133V152.894H169.656V125.371Z",fill:"#F0F0F0"}),(0,a.createElement)(c.Path,{d:"M155.015 146.194L162.181 139.587L147.445 139.663V138.571L162.154 138.647L155.015 132.067L155.676 131.228L163.982 139.055V139.184L155.676 147.033L155.015 146.194Z",fill:"#DDDDDD"}),(0,a.createElement)(c.Path,{d:"M22.0977 126.533L27.44 141.921L53.5835 112.729",stroke:"white",strokeMiterlimit:"10"}),(0,a.createElement)(c.Path,{d:"M232.227 110.138C232.227 102.307 227.559 97.4392 220.042 97.4126C220.042 97.4126 220.025 97.4126 220.016 97.4126C220.007 97.4126 219.998 97.4126 219.989 97.4126C212.473 97.4392 207.805 102.928 207.805 110.138C207.805 117.349 212.22 120.774 218.516 125.287C214.704 128.858 212.663 134.516 212.663 138.505H215.867C215.867 134.809 216.572 129.56 220.016 126.462C223.463 129.56 224.164 134.809 224.164 138.505H227.368C227.368 134.516 225.322 128.858 221.515 125.287C227.812 120.778 232.227 116.958 232.227 110.138ZM220.016 124.435C213.773 119.989 209.242 117.158 209.242 110.138C209.242 103.119 213.546 98.7216 220.016 98.7082C226.485 98.7216 230.789 103.354 230.789 110.138C230.789 116.222 226.259 119.989 220.016 124.435Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M250.84 40.1516C250.84 45.9864 246.155 50.7297 240.342 50.8184H199.862C193.97 50.8184 189.195 46.0441 189.195 40.1516C189.195 34.2591 193.97 29.4847 199.862 29.4847H240.36C246.164 29.4847 250.84 34.3256 250.84 40.1516Z",fill:"#F0F0F0"}),(0,a.createElement)(c.Path,{d:"M240.122 47.7347C244.31 47.7347 247.705 44.3396 247.705 40.1516C247.705 35.9636 244.31 32.5686 240.122 32.5686C235.934 32.5686 232.539 35.9636 232.539 40.1516C232.539 44.3396 235.934 47.7347 240.122 47.7347Z",fill:"#E0E0E0"}),(0,a.createElement)(c.Path,{d:"M131.996 6.00781H124.524L106.332 36.0116H125.824H138.168H157.661L139.468 6.00781H131.996Z",fill:"#F0F0F0"}),(0,a.createElement)(c.Path,{d:"M151.608 26.0281H112.384L106.332 36.0116L151.608 26.0281Z",fill:"white"}),(0,a.createElement)(c.Path,{d:"M145.555 16.0446H118.435L112.383 26.0281L145.555 16.0446Z",fill:"white"}),(0,a.createElement)(c.Path,{d:"M139.469 6.00781H124.525L118.438 16.0446L139.469 6.00781Z",fill:"white"}),(0,a.createElement)(c.Path,{d:"M57.4297 42.9647H87.8994",stroke:"#DDDDDD",strokeWidth:"0.71",strokeMiterlimit:"10"}),(0,a.createElement)(c.Path,{d:"M61.8945 32.1914L83.4412 53.7381",stroke:"#DDDDDD",strokeWidth:"0.71",strokeMiterlimit:"10"}),(0,a.createElement)(c.Path,{d:"M72.668 27.7321V58.2018",stroke:"#DDDDDD",strokeWidth:"0.71",strokeMiterlimit:"10"})),(0,a.createElement)("defs",null,(0,a.createElement)("clipPath",{id:t},(0,a.createElement)(c.Rect,{width:"263.121",height:"167",fill:"white",transform:"translate(0.4375)"}))))}function oa(){const[e]=(0,me.useEntityProp)("postType","product","id"),{generateProductVariations:t,invalidateResolutionForStoreSelector:o}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME),[r,n]=(0,a.useState)(!1);return{generateProductVariations:(0,a.useCallback)((async r=>{n(!0);const a=r.some((e=>e.variation));return t({product_id:e},{type:a?"variable":"simple",attributes:r},{delete:!0}).then((()=>(o("getProductVariations"),o("getProductVariationsTotalCount")))).finally((()=>{n(!1)}))}),[]),isGenerating:r}}const ra=e=>!(!Array.isArray(e)||!e.length)&&e.some((e=>{let{variation:t}=e;return t})),{name:na,...aa}=ea,ia={example:{},edit:function(e){let{attributes:t}=e;const{description:o}=t,{generateProductVariations:r}=oa(),[n,l]=(0,a.useState)(!1),[s,m]=(0,me.useEntityProp)("postType","product","attributes"),[,u]=(0,me.useEntityProp)("postType","product","default_attributes"),{attributes:d,handleChange:p}=Jn({allAttributes:s,isVariationAttributes:!0,productId:(0,me.useEntityId)("postType","product"),onChange(e){m(e),u(function(e){return e.map((e=>({id:e.id,name:e.name,option:e.options[0]})))}(e)),r(e)}}),_=ra(s),f=(0,lt.useBlockProps)({className:fe()({"wp-block-woocommerce-product-variations-fields--has-attributes":_})}),h=(0,lt.useInnerBlocksProps)({className:"wp-block-woocommerce-product-variations-fields__content"},{templateLock:"all"}),g=()=>{l(!1)};return(0,a.createElement)("div",{...f},(0,a.createElement)("div",{className:"wp-block-woocommerce-product-variations-fields__heading"},(0,a.createElement)("div",{className:"wp-block-woocommerce-product-variations-fields__heading-image-container"},(0,a.createElement)(ta,null)),(0,a.createElement)("p",{className:"wp-block-woocommerce-product-variations-fields__heading-description",dangerouslySetInnerHTML:$t(o)}),(0,a.createElement)("div",{className:"wp-block-woocommerce-product-variations-fields__heading-actions"},(0,a.createElement)(c.Button,{variant:"primary",onClick:()=>{l(!0)}},(0,w.__)("Add variation options","woocommerce")))),(0,a.createElement)("div",{...h}),n&&(0,a.createElement)($n,{title:(0,w.__)("Add variation options","woocommerce"),description:(0,a.createInterpolateElement)((0,w.__)("Select from existing <globalAttributeLink>global attributes</globalAttributeLink> or create options for buyers to choose on the product page. You can change the order later.","woocommerce"),{globalAttributeLink:(0,a.createElement)(i.Link,{href:"https://woocommerce.com/document/variable-product/#add-attributes-to-use-for-variations",type:"external",target:"_blank"})}),createNewAttributesAsGlobal:!0,notice:"",onCancel:()=>{g()},onAdd:e=>{p([...e.filter((e=>!d.find((t=>Ln(e)===Ln(t)))))]),g()},selectedAttributeIds:d.map((e=>e.id)),disabledAttributeIds:s.filter((e=>!e.variation)).map((e=>e.id))}))}};function la(){return ft({name:na,metadata:aa,settings:ia})}const ca=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-password-field","description":"A checkbox and an input to type a password to view a product.","title":"Product password","category":"widgets","keywords":["products","password"],"textdomain":"default","attributes":{"label":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:sa,...ma}=ca,ua={edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)(),{label:r}=t,[n,i]=(0,me.useEntityProp)("postType","product","post_password"),[l,s]=(0,a.useState)(Boolean(n)),m=(0,Z.useInstanceId)(c.BaseControl,"post_password");return(0,a.createElement)("div",{...o},(0,a.createElement)(c.CheckboxControl,{label:r,checked:l,className:"wp-block-woocommerce-product-password-fields__field",onChange:e=>{s(e),e||i("")}}),l&&(0,a.createElement)(c.BaseControl,{id:m,label:(0,w.__)("Password","woocommerce")},(0,a.createElement)(c.__experimentalInputControl,{id:m,value:n,onChange:i})))}};function da(){return ft({name:sa,metadata:ma,settings:ua})}const pa=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-variation-items-field","title":"Product variations items","category":"woocommerce","description":"The product variations items.","keywords":["products","variations"],"textdomain":"default","attributes":{"description":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"usesContext":["isInSelectedTab"],"editorStyle":"file:./editor.css"}');var _a,fa,ha=o(56519),ga=o.n(ha);function ba(e){let{width:t=24,height:o=24,...r}=e;return(0,a.createElement)("svg",{...r,width:t,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},(0,a.createElement)("path",{d:"M20.1091 11.54C20.3396 11.8116 20.3396 12.1884 20.1091 12.46C19.4144 13.2781 18.266 14.4899 16.8343 15.4921C15.397 16.4982 13.7359 17.25 11.9999 17.25C10.2638 17.25 8.60268 16.4982 7.1654 15.4921C5.73376 14.4899 4.58533 13.2781 3.89066 12.46C3.6601 12.1884 3.6601 11.8116 3.89066 11.54C4.58533 10.7219 5.73376 9.51006 7.1654 8.50792C8.60268 7.50184 10.2638 6.75 11.9999 6.75C13.7359 6.75 15.397 7.50184 16.8343 8.50792C18.266 9.51006 19.4144 10.7219 20.1091 11.54Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,a.createElement)("circle",{cx:"11.9999",cy:"11.9999",r:"2.67857",stroke:"currentColor",strokeWidth:"1.5"}))}!function(e){e.instock="instock",e.onbackorder="onbackorder",e.outofstock="outofstock"}(_a||(_a={})),function(e){e.instock="green",e.onbackorder="yellow",e.outofstock="red"}(fa||(fa={}));const wa={[_a.instock]:(0,w.__)("In stock","woocommerce"),[_a.onbackorder]:(0,w.__)("On backorder","woocommerce"),[_a.outofstock]:(0,w.__)("Out of stock","woocommerce")},Ea=e=>e.manage_stock?e.stock_quantity||0:e.stock_status?wa[e.stock_status]:wa.instock,va=e=>{if(e.manage_stock){const t=e.stock_quantity||0;return t>=10?fa.instock:t<10&&t>2?fa.onbackorder:fa.outofstock}return e.stock_status?fa[e.stock_status]:""},ya=(0,w.__)("Not visible to customers","woocommerce"),Ca=(0,w.__)("Visible to customers","woocommerce"),ka=(0,w.__)("Updating product variation","woocommerce");function Sa(){const[e,t]=(0,a.useState)(1),[o,r]=(0,a.useState)(25),[n,l]=(0,a.useState)({}),s=(0,me.useEntityId)("postType","product"),m=(0,a.useContext)(A.CurrencyContext),{formatAmount:u}=m,{isLoading:d,variations:p,totalCount:_,isGeneratingVariations:f}=(0,b.useSelect)((t=>{const{getProductVariations:r,hasFinishedResolution:n,getProductVariationsTotalCount:a,isGeneratingVariations:i}=t(v.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME),l={product_id:s,page:e,per_page:o,order:"asc",orderby:"menu_order"};return{isLoading:!n("getProductVariations",[l]),isGeneratingVariations:i({product_id:s}),variations:r(l),totalCount:a(l)}}),[e,o,s]),{updateProductVariation:h}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME);if(!p&&d)return(0,a.createElement)("div",{className:"woocommerce-product-variations__loading"},(0,a.createElement)(c.Spinner,null),f&&(0,a.createElement)("span",null,(0,w.__)("Generating variations…","woocommerce")));function g(e,t){n[e]||(l((t=>({...t,[e]:!0}))),h({product_id:s,id:e},{status:t}).finally((()=>l((t=>({...t,[e]:!1}))))))}return(0,a.createElement)("div",{className:"woocommerce-product-variations"},d||f&&(0,a.createElement)("div",{className:"woocommerce-product-variations__loading"},(0,a.createElement)(c.Spinner,null),f&&(0,a.createElement)("span",null,(0,w.__)("Generating variations…","woocommerce"))),(0,a.createElement)(i.Sortable,null,p.map((e=>(0,a.createElement)(i.ListItem,{key:`${e.id}`},(0,a.createElement)("div",{className:"woocommerce-product-variations__attributes"},e.attributes.map((e=>{const t=(0,a.createElement)(i.Tag,{id:e.id,className:"woocommerce-product-variations__attribute",key:e.id,label:ga()(e.option,{length:32}),screenReaderLabel:e.option});return e.option.length<=32?t:(0,a.createElement)(c.Tooltip,{key:e.id,text:e.option,position:"top center"},(0,a.createElement)("span",null,t))}))),(0,a.createElement)("div",{className:fe()("woocommerce-product-variations__price",{"woocommerce-product-variations__price--fade":"private"===e.status})},u(e.price)),(0,a.createElement)("div",{className:fe()("woocommerce-product-variations__quantity",{"woocommerce-product-variations__quantity--fade":"private"===e.status})},(0,a.createElement)("span",{className:fe()("woocommerce-product-variations__status-dot",va(e))},"●"),Ea(e)),(0,a.createElement)("div",{className:"woocommerce-product-variations__actions"},"private"===e.status&&(0,a.createElement)(c.Tooltip,{position:"top center",text:ya},(0,a.createElement)(c.Button,{className:"components-button--hidden","aria-label":n[e.id]?ka:ya,"aria-disabled":n[e.id],onClick:()=>g(e.id,"publish")},n[e.id]?(0,a.createElement)(c.Spinner,null):(0,a.createElement)(Dn,null))),"publish"===e.status&&(0,a.createElement)(c.Tooltip,{position:"top center",text:Ca},(0,a.createElement)(c.Button,{className:"components-button--visible","aria-label":n[e.id]?ka:Ca,"aria-disabled":n[e.id],onClick:()=>g(e.id,"private")},n[e.id]?(0,a.createElement)(c.Spinner,null):(0,a.createElement)(ba,null))),(0,a.createElement)(i.Link,{href:(0,Ze.getNewPath)({},`/product/${s}/variation/${e.id}`,{}),type:"wc-admin",className:"components-button"},(0,w.__)("Edit","woocommerce"))))))),(0,a.createElement)(i.Pagination,{className:"woocommerce-product-variations__footer",page:e,perPage:o,total:_,showPagePicker:!1,onPageChange:t,onPerPageChange:r}))}const xa=()=>{const[e,t]=(0,a.useState)(!1),o=(0,me.useEntityId)("postType","product"),r=(0,a.useRef)(),{totalCount:n}=(0,b.useSelect)((e=>{const{getProductVariationsTotalCount:t}=e(v.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME);return{totalCount:t({product_id:o,page:1,per_page:25,order:"asc",orderby:"menu_order"})}}),[o]),{updateUserPreferences:l,variable_product_block_tour_shown:c}=(0,v.useUserPreferences)(),s={placement:"top",steps:[{referenceElements:{desktop:".wp-block-woocommerce-product-variation-items-field"},focusElement:{desktop:".wp-block-woocommerce-product-variation-items-field"},meta:{name:"product-variations-2",heading:(0,w.__)("⚡️ This product now has variations","woocommerce"),descriptions:{desktop:(0,w.__)("From now on, you’ll manage pricing, shipping, and inventory for each variation individually—just like any other product in your store.","woocommerce")},primaryButton:{text:(0,w.__)("Got it","woocommerce")}}}],options:{classNames:["variation-items-product-tour"],effects:{arrowIndicator:!0,spotlight:{interactivity:{enabled:!0}}},callbacks:{onStepViewOnce:()=>{(0,N.recordEvent)("variable_product_block_tour_shown",{variable_count:n})}},popperModifiers:[{name:"offset",options:{offset:[0,32]}}]},closeHandler:()=>{l({variable_product_block_tour_shown:"yes"}),t(!1),(0,N.recordEvent)("variable_product_block_tour_dismissed")}};return(0,a.useEffect)((()=>{const o=r.current!==n&&n>0&&0===r.current;r.current=n,o&&!e&&t(!0)}),[n]),"yes"!==c&&e?(0,a.createElement)(i.TourKit,{config:s}):null},{name:Ta,...Na}=pa,Pa={example:{},edit:function(e){let{context:t}=e;const o=(0,lt.useBlockProps)();return(0,a.createElement)("div",{...o},(0,a.createElement)(Sa,null),(null==t?void 0:t.isInSelectedTab)&&(0,a.createElement)(xa,null))}};function Ia(){return ft({name:Ta,metadata:Na,settings:Pa})}const Aa=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-variations-options-field","title":"Product variations options","category":"woocommerce","description":"The product variations options.","keywords":["products","variations"],"textdomain":"default","attributes":{"description":{"type":"string","__experimentalRole":"content"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:Ma,...Ra}=Aa,Oa={example:{},edit:function(){const e=(0,lt.useBlockProps)(),{generateProductVariations:t}=oa(),{updateUserPreferences:o,product_block_variable_options_notice_dismissed:r}=(0,v.useUserPreferences)(),[n,l]=(0,me.useEntityProp)("postType","product","attributes"),[c,s]=(0,me.useEntityProp)("postType","product","default_attributes"),{attributes:m,handleChange:u}=Jn({allAttributes:n,isVariationAttributes:!0,productId:(0,me.useEntityId)("postType","product"),onChange(e){l(e),s(function(e){return e.reduce(((e,t)=>t.isDefault?[...e,{id:t.id,name:t.name,option:t.options[0]}]:e),[])}(e)),t(e)}}),d=m.filter((e=>0===e.id)).map((e=>e.name));let p="";return d.length>0&&"yes"!==r&&(p=(0,a.createInterpolateElement)((0,w.__)("Buyers can’t search or filter by <attributeNames /> to find the variations. Consider adding them again as <globalAttributeLink>global attributes</globalAttributeLink> to make them easier to discover.","woocommerce"),{attributeNames:(0,a.createElement)("span",null,2===d.length?d.join((0,w.__)(" and ","woocommerce")):d.join(", ")),globalAttributeLink:(0,a.createElement)(i.Link,{href:"https://woocommerce.com/document/variable-product/#add-attributes-to-use-for-variations",type:"external",target:"_blank"})})),(0,a.createElement)("div",{...e},(0,a.createElement)(Wn,{value:(0,a.useMemo)((function(){return m.map((e=>({...e,isDefault:c.some((t=>t.id===e.id||t.name===e.name))})))}),[m,c]),onChange:u,createNewAttributesAsGlobal:!0,useRemoveConfirmationModal:!0,onNoticeDismiss:()=>o({product_block_variable_options_notice_dismissed:"yes"}),disabledAttributeIds:n.filter((e=>!e.variation)).map((e=>e.id)),uiStrings:{notice:p,globalAttributeHelperMessage:"",customAttributeHelperMessage:"",newAttributeModalNotice:"",newAttributeModalTitle:(0,w.__)("Add variation options","woocommerce"),newAttributeModalDescription:(0,a.createInterpolateElement)((0,w.__)("Select from existing <globalAttributeLink>global attributes</globalAttributeLink> or create options for buyers to choose on the product page. You can change the order later.","woocommerce"),{globalAttributeLink:(0,a.createElement)(i.Link,{href:"https://woocommerce.com/document/variable-product/#add-attributes-to-use-for-variations",type:"external",target:"_blank"})}),attributeRemoveLabel:(0,w.__)("Remove variation option","woocommerce"),attributeRemoveConfirmationModalMessage:(0,w.__)("If you continue, some variations of this product will be deleted and customers will no longer be able to purchase them.","woocommerce")}}))}};function La(){return ft({name:Ma,metadata:Ra,settings:Oa})}const Da=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-has-variations-notice","title":"Notice","category":"woocommerce","description":"Notice description","keywords":["products","notice"],"textdomain":"default","attributes":{"id":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"buttonText":{"type":"string"},"type":{"type":"string"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css","templateLock":"contentOnly"}');function Ba(e){let{title:t="",content:o="",className:r,type:n="info",children:i}=e;return(0,a.createElement)("div",{className:fe()(r,n,"woocommerce-product-notice")},t&&(0,a.createElement)("h3",{className:"woocommerce-product-notice__title"},t),o&&(0,a.createElement)("p",{className:"woocommerce-product-notice__content"},o),(0,a.createElement)("div",{className:"woocommerce-product-notice__content"},i))}const{name:Fa,...Va}=Da,Ha={example:{},edit:function(e){let{attributes:t}=e;const o=(0,lt.useBlockProps)(),{buttonText:r,content:n,title:i,type:l="info"}=t,[s]=(0,me.useEntityProp)("postType","product","attributes"),m=ra(s);return(0,a.createElement)("div",{...o},m&&(0,a.createElement)(Ba,{content:n,title:i,type:l},(0,a.createElement)(c.Button,{isSecondary:!0,onClick:()=>(0,Ze.navigateTo)({url:(0,Ze.getNewPath)({tab:"variations"})})},r)))}};function za(){ft({name:Fa,metadata:Va,settings:Ha})}function Ua(){const e=(0,_t.__experimentalGetCoreBlocks)().filter((e=>!(0,oe.getBlockType)(e.name)));(0,_t.registerCoreBlocks)(e);const t=Object.values(n).map((e=>e())),o=[...e,...t];return function(){o.forEach((e=>e&&(0,oe.unregisterBlockType)(e.name)))}}function ja(e){let{clientId:t}=e;const o=(0,b.useSelect)((e=>{const{getBlockAttributes:o,getBlockName:r}=e("core/block-editor"),n=o(t);if(null==n?void 0:n.icon)return n.icon;const{getBlockType:a}=e("core/blocks"),i=a(r(t));return null==i?void 0:i.icon}),[t]);if(!o)return null;if("object"==typeof o){const{src:e,...t}=o;if(/^<(.)+>$/.test(e)){const o=(0,a.createElement)(a.RawHTML,{"aria-hidden":"true",...t},e);return(0,a.createElement)(lt.BlockIcon,{icon:o,showColors:!0})}if(/^https?:\/\/(.)+/.test(e)){const o=(0,a.createElement)("img",{src:e,alt:"","aria-hidden":"true",...t,height:24,width:24});return(0,a.createElement)(lt.BlockIcon,{icon:o,showColors:!0})}}return(0,a.createElement)(lt.BlockIcon,{icon:o,showColors:!0})}const $a=e=>{const{symbol:t,symbolPosition:o}=e;return{[o.includes("left")?"prefix":"suffix"]:t}};var Ga;!function(e){e.unsaved="unsaved",e.draft="draft",e.instock="instock",e.outofstock="outofstock"}(Ga||(Ga={}));const Wa={[Ga.unsaved]:(0,w.__)("Unsaved","woocommerce"),[Ga.draft]:(0,w.__)("Draft","woocommerce"),[Ga.instock]:(0,w.__)("In stock","woocommerce"),[Ga.outofstock]:(0,w.__)("Out of stock","woocommerce")},qa=e=>e?"draft"===e.status?Ga.draft:"instock"===e.stock_status?Ga.instock:Ga.outofstock:Ga.unsaved,Za=(e,t,o)=>(null==e?void 0:e.length)?e:o&&o!==R?o:"simple"===t?(0,w.__)("New standard product","woocommerce"):(0,w.__)("New product","woocommerce"),Ja=e=>{var t;return(null===(t=null==e?void 0:e.attributes)||void 0===t?void 0:t.length)?e.attributes.map((e=>e.option)).join(", "):"#"+e.id},Ka=e=>{const t=Ja(e);return t.length>32?t.substring(0,32)+"…":t},Xa=window.wp.apiFetch;var Ya=o.n(Xa);const Qa=()=>{Ya().use(((e,t)=>{const o=new RegExp("^/wp/v2/product");return e.path&&o.test(null==e?void 0:e.path)&&(()=>{const e=(0,Ze.getQuery)();return"wc-admin"===(null==e?void 0:e.page)&&["/add-product","/product/"].some((t=>{var o;return null===(o=null==e?void 0:e.path)||void 0===o?void 0:o.startsWith(t)}))})()&&(e.path=e.path.replace(o,"/wc/v3/products")),t(e)}))};function ei(e){return`${e.id}:${e.menu_order}`}function ti(e){let{key:t}=e;return"string"==typeof t?Number.parseInt(t.split(":")[1],10):Number.MAX_SAFE_INTEGER}function oi(e,t,o){let{variationsOrder:r}=o;if(!r||!r[t])return e;const n=r[t];return[...e].sort(((e,t)=>n[e.id]&&n[t.id]?n[e.id]-n[t.id]:0))}const ri=e=>{let{variations:t,currentPage:o}=e;const{setValue:r,values:n}=(0,i.useFormContext)();return{sortedVariations:oi(t,o,n),getVariationKey:ei,onOrderChange:function(e){const t=Math.min(...e.map(ti));r("variationsOrder",{...n.variationsOrder,[o]:e.reduce(((e,o,r)=>({...e,[function(e){let{key:t}=e;return"string"==typeof t?Number.parseInt(t.split(":")[0],10):0}(o)]:t+r})),{})})}}}})(),(window.wc=window.wc||{}).productEditor=r})();

https://t.me/AnonymousX5 - 2025