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