File: //proc/self/cwd/wp-content/plugins/woocommerce/assets/client/blocks/woocommerce/product-elements.js
import*as e from"@wordpress/interactivity";import*as t from"@woocommerce/stores/woocommerce/product-data";var n={d:(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(r={getConfig:()=>e.getConfig,getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store},i={},n.d(i,r),i);var r,i;n.d({},{});const{entries:a,setPrototypeOf:l,isFrozen:c,getPrototypeOf:s,getOwnPropertyDescriptor:u}=Object;let{freeze:m,seal:p,create:f}=Object,{apply:d,construct:g}="undefined"!=typeof Reflect&&Reflect;m||(m=function(e){return e}),p||(p=function(e){return e}),d||(d=function(e,t,n){return e.apply(t,n)}),g||(g=function(e,t){return new e(...t)});const h=C(Array.prototype.forEach),T=C(Array.prototype.lastIndexOf),y=C(Array.prototype.pop),E=C(Array.prototype.push),A=C(Array.prototype.splice),_=C(String.prototype.toLowerCase),b=C(String.prototype.toString),S=C(String.prototype.match),N=C(String.prototype.replace),w=C(String.prototype.indexOf),R=C(String.prototype.trim),v=C(Object.prototype.hasOwnProperty),O=C(RegExp.prototype.test),D=(L=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(L,t)});var L;function C(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return d(e,t,o)}}function x(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_;l&&l(e,null);let o=t.length;for(;o--;){let r=t[o];if("string"==typeof r){const e=n(r);e!==r&&(c(t)||(t[o]=e),r=e)}e[r]=!0}return e}function I(e){for(let t=0;t<e.length;t++)v(e,t)||(e[t]=null);return e}function M(e){const t=f(null);for(const[n,o]of a(e))v(e,n)&&(Array.isArray(o)?t[n]=I(o):o&&"object"==typeof o&&o.constructor===Object?t[n]=M(o):t[n]=o);return t}function k(e,t){for(;null!==e;){const n=u(e,t);if(n){if(n.get)return C(n.get);if("function"==typeof n.value)return C(n.value)}e=s(e)}return function(){return null}}const U=m(["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"]),P=m(["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"]),z=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),H=m(["animate","color-profile","cursor","discard","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"]),F=m(["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","mprescripts"]),W=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=m(["#text"]),G=m(["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","popover","popovertarget","popovertargetaction","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","wrap","xmlns","slot"]),Y=m(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","slope","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","tablevalues","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"]),j=m(["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"]),X=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),q=p(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=p(/<%[\w\W]*|[\w\W]*%>/gm),$=p(/\$\{[\w\W]*/gm),V=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),Z=p(/^aria-[\-\w]+$/),J=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=p(/^(?:\w+script|data):/i),ee=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),te=p(/^html$/i),ne=p(/^[a-z][.\w]*(-[.\w]+)+$/i);var oe=Object.freeze({__proto__:null,ARIA_ATTR:Z,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:ne,DATA_ATTR:V,DOCTYPE_NAME:te,ERB_EXPR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:Q,MUSTACHE_EXPR:q,TMPLIT_EXPR:$});const re=function(){return"undefined"==typeof window?null:window};var ie=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:o}=t;const r=o,i=r.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:s,Element:u,NodeFilter:p,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:g,DOMParser:L,trustedTypes:C}=t,I=u.prototype,q=k(I,"cloneNode"),K=k(I,"remove"),$=k(I,"nextSibling"),V=k(I,"childNodes"),Z=k(I,"parentNode");if("function"==typeof c){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let Q,ee="";const{implementation:ne,createNodeIterator:ie,createDocumentFragment:ae,getElementsByTagName:le}=o,{importNode:ce}=r;let se={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof a&&"function"==typeof Z&&ne&&void 0!==ne.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:me,TMPLIT_EXPR:pe,DATA_ATTR:fe,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:ge,ATTR_WHITESPACE:he,CUSTOM_ELEMENT:Te}=oe;let{IS_ALLOWED_URI:ye}=oe,Ee=null;const Ae=x({},[...U,...P,...z,...F,...B]);let _e=null;const be=x({},[...G,...Y,...j,...X]);let Se=Object.seal(f(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}})),Ne=null,we=null,Re=!0,ve=!0,Oe=!1,De=!0,Le=!1,Ce=!0,xe=!1,Ie=!1,Me=!1,ke=!1,Ue=!1,Pe=!1,ze=!0,He=!1,Fe=!0,We=!1,Be={},Ge=null;const Ye=x({},["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"]);let je=null;const Xe=x({},["audio","video","img","source","image","track"]);let qe=null;const Ke=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",Ve="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let Je=Ze,Qe=!1,et=null;const tt=x({},[$e,Ve,Ze],b);let nt=x({},["mi","mo","mn","ms","mtext"]),ot=x({},["annotation-xml"]);const rt=x({},["title","style","font","a","script"]);let it=null;const at=["application/xhtml+xml","text/html"];let lt=null,ct=null;const st=o.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=M(e),it=-1===at.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===it?b:_,Ee=v(e,"ALLOWED_TAGS")?x({},e.ALLOWED_TAGS,lt):Ae,_e=v(e,"ALLOWED_ATTR")?x({},e.ALLOWED_ATTR,lt):be,et=v(e,"ALLOWED_NAMESPACES")?x({},e.ALLOWED_NAMESPACES,b):tt,qe=v(e,"ADD_URI_SAFE_ATTR")?x(M(Ke),e.ADD_URI_SAFE_ATTR,lt):Ke,je=v(e,"ADD_DATA_URI_TAGS")?x(M(Xe),e.ADD_DATA_URI_TAGS,lt):Xe,Ge=v(e,"FORBID_CONTENTS")?x({},e.FORBID_CONTENTS,lt):Ye,Ne=v(e,"FORBID_TAGS")?x({},e.FORBID_TAGS,lt):M({}),we=v(e,"FORBID_ATTR")?x({},e.FORBID_ATTR,lt):M({}),Be=!!v(e,"USE_PROFILES")&&e.USE_PROFILES,Re=!1!==e.ALLOW_ARIA_ATTR,ve=!1!==e.ALLOW_DATA_ATTR,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,Ce=!1!==e.SAFE_FOR_XML,xe=e.WHOLE_DOCUMENT||!1,ke=e.RETURN_DOM||!1,Ue=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,ze=!1!==e.SANITIZE_DOM,He=e.SANITIZE_NAMED_PROPS||!1,Fe=!1!==e.KEEP_CONTENT,We=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||J,Je=e.NAMESPACE||Ze,nt=e.MATHML_TEXT_INTEGRATION_POINTS||nt,ot=e.HTML_INTEGRATION_POINTS||ot,Se=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(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),Le&&(ve=!1),Ue&&(ke=!0),Be&&(Ee=x({},B),_e=[],!0===Be.html&&(x(Ee,U),x(_e,G)),!0===Be.svg&&(x(Ee,P),x(_e,Y),x(_e,X)),!0===Be.svgFilters&&(x(Ee,z),x(_e,Y),x(_e,X)),!0===Be.mathMl&&(x(Ee,F),x(_e,j),x(_e,X))),e.ADD_TAGS&&(Ee===Ae&&(Ee=M(Ee)),x(Ee,e.ADD_TAGS,lt)),e.ADD_ATTR&&(_e===be&&(_e=M(_e)),x(_e,e.ADD_ATTR,lt)),e.ADD_URI_SAFE_ATTR&&x(qe,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(Ge===Ye&&(Ge=M(Ge)),x(Ge,e.FORBID_CONTENTS,lt)),Fe&&(Ee["#text"]=!0),xe&&x(Ee,["html","head","body"]),Ee.table&&(x(Ee,["tbody"]),delete Ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw D('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw D('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Q=e.TRUSTED_TYPES_POLICY,ee=Q.createHTML("")}else void 0===Q&&(Q=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(C,i)),null!==Q&&"string"==typeof ee&&(ee=Q.createHTML(""));m&&m(e),ct=e}},pt=x({},[...P,...z,...H]),ft=x({},[...F,...W]),dt=function(e){E(n.removed,{element:e});try{Z(e).removeChild(e)}catch(t){K(e)}},gt=function(e,t){try{E(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){E(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ke||Ue)try{dt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ht=function(e){let t=null,n=null;if(Me)e="<remove></remove>"+e;else{const t=S(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===it&&Je===Ze&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=Q?Q.createHTML(e):e;if(Je===Ze)try{t=(new L).parseFromString(r,it)}catch(e){}if(!t||!t.documentElement){t=ne.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:r}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),Je===Ze?le.call(t,xe?"html":"body")[0]:xe?t.documentElement:i},Tt=function(e){return ie.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},yt=function(e){return e instanceof g&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Et=function(e){return"function"==typeof s&&e instanceof s};function At(e,t,o){h(e,(e=>{e.call(n,t,o,ct)}))}const _t=function(e){let t=null;if(At(se.beforeSanitizeElements,e,null),yt(e))return dt(e),!0;const o=lt(e.nodeName);if(At(se.uponSanitizeElement,e,{tagName:o,allowedTags:Ee}),Ce&&e.hasChildNodes()&&!Et(e.firstElementChild)&&O(/<[/\w!]/g,e.innerHTML)&&O(/<[/\w!]/g,e.textContent))return dt(e),!0;if(7===e.nodeType)return dt(e),!0;if(Ce&&8===e.nodeType&&O(/<[/\w]/g,e.data))return dt(e),!0;if(!Ee[o]||Ne[o]){if(!Ne[o]&&St(o)){if(Se.tagNameCheck instanceof RegExp&&O(Se.tagNameCheck,o))return!1;if(Se.tagNameCheck instanceof Function&&Se.tagNameCheck(o))return!1}if(Fe&&!Ge[o]){const t=Z(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let o=n.length-1;o>=0;--o){const r=q(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,$(e))}}return dt(e),!0}return e instanceof u&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=_(e.tagName),o=_(t.tagName);return!!et[e.namespaceURI]&&(e.namespaceURI===Ve?t.namespaceURI===Ze?"svg"===n:t.namespaceURI===$e?"svg"===n&&("annotation-xml"===o||nt[o]):Boolean(pt[n]):e.namespaceURI===$e?t.namespaceURI===Ze?"math"===n:t.namespaceURI===Ve?"math"===n&&ot[o]:Boolean(ft[n]):e.namespaceURI===Ze?!(t.namespaceURI===Ve&&!ot[o])&&!(t.namespaceURI===$e&&!nt[o])&&!ft[n]&&(rt[n]||!pt[n]):!("application/xhtml+xml"!==it||!et[e.namespaceURI]))}(e)?(dt(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!O(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,h([ue,me,pe],(e=>{t=N(t,e," ")})),e.textContent!==t&&(E(n.removed,{element:e.cloneNode()}),e.textContent=t)),At(se.afterSanitizeElements,e,null),!1):(dt(e),!0)},bt=function(e,t,n){if(ze&&("id"===t||"name"===t)&&(n in o||n in st))return!1;if(ve&&!we[t]&&O(fe,t));else if(Re&&O(de,t));else if(!_e[t]||we[t]){if(!(St(e)&&(Se.tagNameCheck instanceof RegExp&&O(Se.tagNameCheck,e)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(e))&&(Se.attributeNameCheck instanceof RegExp&&O(Se.attributeNameCheck,t)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(t))||"is"===t&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&O(Se.tagNameCheck,n)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))))return!1}else if(qe[t]);else if(O(ye,N(n,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==w(n,"data:")||!je[e])if(Oe&&!O(ge,N(n,he,"")));else if(n)return!1;return!0},St=function(e){return"annotation-xml"!==e&&S(e,Te)},Nt=function(e){At(se.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||yt(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_e,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=lt(a),u=c;let m="value"===a?u:R(u);if(o.attrName=s,o.attrValue=m,o.keepAttr=!0,o.forceKeepAttr=void 0,At(se.uponSanitizeAttribute,e,o),m=o.attrValue,!He||"id"!==s&&"name"!==s||(gt(a,e),m="user-content-"+m),Ce&&O(/((--!?|])>)|<\/(style|title)/i,m)){gt(a,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){gt(a,e);continue}if(!De&&O(/\/>/i,m)){gt(a,e);continue}Le&&h([ue,me,pe],(e=>{m=N(m,e," ")}));const p=lt(e.nodeName);if(bt(p,s,m)){if(Q&&"object"==typeof C&&"function"==typeof C.getAttributeType)if(l);else switch(C.getAttributeType(p,s)){case"TrustedHTML":m=Q.createHTML(m);break;case"TrustedScriptURL":m=Q.createScriptURL(m)}if(m!==u)try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),yt(e)?dt(e):y(n.removed)}catch(t){gt(a,e)}}else gt(a,e)}At(se.afterSanitizeAttributes,e,null)},wt=function e(t){let n=null;const o=Tt(t);for(At(se.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)At(se.uponSanitizeShadowNode,n,null),_t(n),Nt(n),n.content instanceof l&&e(n.content);At(se.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,i=null,a=null,c=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Et(e)){if("function"!=typeof e.toString)throw D("toString is not a function");if("string"!=typeof(e=e.toString()))throw D("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Ie||mt(t),n.removed=[],"string"==typeof e&&(We=!1),We){if(e.nodeName){const t=lt(e.nodeName);if(!Ee[t]||Ne[t])throw D("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof s)o=ht("\x3c!----\x3e"),i=o.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!ke&&!Le&&!xe&&-1===e.indexOf("<"))return Q&&Pe?Q.createHTML(e):e;if(o=ht(e),!o)return ke?null:Pe?ee:""}o&&Me&&dt(o.firstChild);const u=Tt(We?e:o);for(;a=u.nextNode();)_t(a),Nt(a),a.content instanceof l&&wt(a.content);if(We)return e;if(ke){if(Ue)for(c=ae.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(_e.shadowroot||_e.shadowrootmode)&&(c=ce.call(r,c,!0)),c}let m=xe?o.outerHTML:o.innerHTML;return xe&&Ee["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&O(te,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),Le&&h([ue,me,pe],(e=>{m=N(m,e," ")})),Q&&Pe?Q.createHTML(m):m},n.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ie=!0},n.clearConfig=function(){ct=null,Ie=!1},n.isValidAttribute=function(e,t,n){ct||mt({});const o=lt(e),r=lt(t);return bt(o,r,n)},n.addHook=function(e,t){"function"==typeof t&&E(se[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=T(se[e],t);return-1===n?void 0:A(se[e],n,1)[0]}return y(se[e])},n.removeHooks=function(e){se[e]=[]},n.removeAllHooks=function(){se={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();let ae;const le=["a","b","em","i","strong","p","br","abbr"],ce=["target","href","rel","name","download","title"];const{state:se}=(0,o.store)("woocommerce/product-data",{},{lock:"I acknowledge that using a private store means my plugin will inevitably break on the next store release."}),ue=["a","b","em","i","strong","p","br","span","bdi","del","ins"],me=["class","target","href","rel","name","download","aria-hidden"],pe=(0,o.store)("woocommerce/product-elements",{state:{get productData(){if(!se?.productId)return;const{products:e}=(0,o.getConfig)("woocommerce");return e?e?.[se.productId]?.variations?.[se?.variationId||0]||e?.[se.productId]:void 0}},callbacks:{updateValue:()=>{const e=(0,o.getElement)();if(!e.ref||!se?.productId)return;const{productElementKey:t}=(0,o.getContext)(),n=pe?.state?.productData?.[t];"string"==typeof n&&(e.ref.innerHTML=function(e,t){const n={ALLOWED_TAGS:[...t?.tags||le],ALLOWED_ATTR:[...t?.attr||ce]},o=function(){if(void 0!==ae)return ae;if("undefined"==typeof window||!window.trustedTypes)return ae=null,null;try{ae=window.trustedTypes.createPolicy("woocommerce-sanitize-noop",{createHTML:e=>e})}catch(e){ae=null,console.warn('Failed to create "woocommerce-sanitize-noop" trusted type policy:',e)}return ae}();return o&&(n.TRUSTED_TYPES_POLICY=o),"HTMLBodyElement"===t?.returnType?n.RETURN_DOM=!0:"DocumentFragment"===t?.returnType&&(n.RETURN_DOM_FRAGMENT=!0),ie.sanitize(null!=e?e:"",n)}(n,{tags:ue,attr:me}))}}},{lock:!0});