📁 File Manager Pro
v10.0.2 | PHP: 8.1.34
Server: LiteSpeed
2026-06-26 13:48:16
📂
/
/
home
/
pallabnv
/
public_html
/
wp-content__3bb9dea
/
plugins
/
woocommerce
/
assets
/
client
/
blocks
/
woocommerce
✏️
Editing: product-elements.js
import*as e from"@wordpress/interactivity";import*as t from"@woocommerce/stores/woocommerce/products";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={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:h}="undefined"!=typeof Reflect&&Reflect;m||(m=function(e){return e}),p||(p=function(e){return e}),d||(d=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return e.apply(t,o)}),h||(h=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return new e(...n)});const g=L(Array.prototype.forEach),T=L(Array.prototype.lastIndexOf),y=L(Array.prototype.pop),E=L(Array.prototype.push),A=L(Array.prototype.splice),b=L(String.prototype.toLowerCase),_=L(String.prototype.toString),S=L(String.prototype.match),N=L(String.prototype.replace),w=L(String.prototype.indexOf),R=L(String.prototype.trim),D=L(Object.prototype.hasOwnProperty),C=L(RegExp.prototype.test),O=(v=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h(v,t)});var v;function L(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 k(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b;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 x(e){for(let t=0;t<e.length;t++)D(e,t)||(e[t]=null);return e}function M(e){const t=f(null);for(const[n,o]of a(e))D(e,n)&&(Array.isArray(o)?t[n]=x(o):o&&"object"==typeof o&&o.constructor===Object?t[n]=M(o):t[n]=o);return t}function I(e,t){for(;null!==e;){const n=u(e,t);if(n){if(n.get)return L(n.get);if("function"==typeof n.value)return L(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","search","section","select","shadow","slot","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"]),z=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=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"]),F=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"]),H=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"]),B=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),G=m(["#text"]),W=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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","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","mask-type","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","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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.4.0",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:h,DOMParser:v,trustedTypes:L}=t,x=u.prototype,q=I(x,"cloneNode"),K=I(x,"remove"),$=I(x,"nextSibling"),V=I(x,"childNodes"),Z=I(x,"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:he,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:Te}=oe;let{IS_ALLOWED_URI:ye}=oe,Ee=null;const Ae=k({},[...U,...z,...P,...H,...G]);let be=null;const _e=k({},[...W,...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;const Re=Object.seal(f(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let De=!0,Ce=!0,Oe=!1,ve=!0,Le=!1,ke=!0,xe=!1,Me=!1,Ie=!1,Ue=!1,ze=!1,Pe=!1,Fe=!0,He=!1,Be=!0,Ge=!1,We={},Ye=null;const je=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"]);let Xe=null;const qe=k({},["audio","video","img","source","image","track"]);let Ke=null;const $e=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ve="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Je="http://www.w3.org/1999/xhtml";let Qe=Je,et=!1,tt=null;const nt=k({},[Ve,Ze,Je],_);let ot=k({},["mi","mo","mn","ms","mtext"]),rt=k({},["annotation-xml"]);const it=k({},["title","style","font","a","script"]);let at=null;const lt=["application/xhtml+xml","text/html"];let ct=null,st=null;const ut=o.createElement("form"),mt=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!st||st!==e){if(e&&"object"==typeof e||(e={}),e=M(e),at=-1===lt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ct="application/xhtml+xml"===at?_:b,Ee=D(e,"ALLOWED_TAGS")?k({},e.ALLOWED_TAGS,ct):Ae,be=D(e,"ALLOWED_ATTR")?k({},e.ALLOWED_ATTR,ct):_e,tt=D(e,"ALLOWED_NAMESPACES")?k({},e.ALLOWED_NAMESPACES,_):nt,Ke=D(e,"ADD_URI_SAFE_ATTR")?k(M($e),e.ADD_URI_SAFE_ATTR,ct):$e,Xe=D(e,"ADD_DATA_URI_TAGS")?k(M(qe),e.ADD_DATA_URI_TAGS,ct):qe,Ye=D(e,"FORBID_CONTENTS")?k({},e.FORBID_CONTENTS,ct):je,Ne=D(e,"FORBID_TAGS")?k({},e.FORBID_TAGS,ct):M({}),we=D(e,"FORBID_ATTR")?k({},e.FORBID_ATTR,ct):M({}),We=!!D(e,"USE_PROFILES")&&e.USE_PROFILES,De=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,ke=!1!==e.SAFE_FOR_XML,xe=e.WHOLE_DOCUMENT||!1,Ue=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,He=e.SANITIZE_NAMED_PROPS||!1,Be=!1!==e.KEEP_CONTENT,Ge=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||J,Qe=e.NAMESPACE||Je,ot=e.MATHML_TEXT_INTEGRATION_POINTS||ot,rt=e.HTML_INTEGRATION_POINTS||rt,Se=e.CUSTOM_ELEMENT_HANDLING||f(null),e.CUSTOM_ELEMENT_HANDLING&&mt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&mt(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&&(Ce=!1),ze&&(Ue=!0),We&&(Ee=k({},G),be=f(null),!0===We.html&&(k(Ee,U),k(be,W)),!0===We.svg&&(k(Ee,z),k(be,Y),k(be,X)),!0===We.svgFilters&&(k(Ee,P),k(be,Y),k(be,X)),!0===We.mathMl&&(k(Ee,H),k(be,j),k(be,X))),Re.tagCheck=null,Re.attributeCheck=null,e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Re.tagCheck=e.ADD_TAGS:(Ee===Ae&&(Ee=M(Ee)),k(Ee,e.ADD_TAGS,ct))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Re.attributeCheck=e.ADD_ATTR:(be===_e&&(be=M(be)),k(be,e.ADD_ATTR,ct))),e.ADD_URI_SAFE_ATTR&&k(Ke,e.ADD_URI_SAFE_ATTR,ct),e.FORBID_CONTENTS&&(Ye===je&&(Ye=M(Ye)),k(Ye,e.FORBID_CONTENTS,ct)),e.ADD_FORBID_CONTENTS&&(Ye===je&&(Ye=M(Ye)),k(Ye,e.ADD_FORBID_CONTENTS,ct)),Be&&(Ee["#text"]=!0),xe&&k(Ee,["html","head","body"]),Ee.table&&(k(Ee,["tbody"]),delete Ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw O('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw O('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}}(L,i)),null!==Q&&"string"==typeof ee&&(ee=Q.createHTML(""));m&&m(e),st=e}},ft=k({},[...z,...P,...F]),dt=k({},[...H,...B]),ht=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(Ue||ze)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Tt=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=S(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===at&&Qe===Je&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=Q?Q.createHTML(e):e;if(Qe===Je)try{t=(new v).parseFromString(r,at)}catch(e){}if(!t||!t.documentElement){t=ne.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?ee:r}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),Qe===Je?le.call(t,xe?"html":"body")[0]:xe?t.documentElement:i},yt=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)},Et=function(e){return e instanceof h&&("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)},At=function(e){return"function"==typeof s&&e instanceof s};function bt(e,t,o){g(e,e=>{e.call(n,t,o,st)})}const _t=function(e){let t=null;if(bt(se.beforeSanitizeElements,e,null),Et(e))return ht(e),!0;const o=ct(e.nodeName);if(bt(se.uponSanitizeElement,e,{tagName:o,allowedTags:Ee}),ke&&e.hasChildNodes()&&!At(e.firstElementChild)&&C(/<[/\w!]/g,e.innerHTML)&&C(/<[/\w!]/g,e.textContent))return ht(e),!0;if(ke&&e.namespaceURI===Je&&"style"===o&&At(e.firstElementChild))return ht(e),!0;if(7===e.nodeType)return ht(e),!0;if(ke&&8===e.nodeType&&C(/<[/\w]/g,e.data))return ht(e),!0;if(Ne[o]||!(Re.tagCheck instanceof Function&&Re.tagCheck(o))&&!Ee[o]){if(!Ne[o]&&Nt(o)){if(Se.tagNameCheck instanceof RegExp&&C(Se.tagNameCheck,o))return!1;if(Se.tagNameCheck instanceof Function&&Se.tagNameCheck(o))return!1}if(Be&&!Ye[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 ht(e),!0}return e instanceof u&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:Qe,tagName:"template"});const n=b(e.tagName),o=b(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Ze?t.namespaceURI===Je?"svg"===n:t.namespaceURI===Ve?"svg"===n&&("annotation-xml"===o||ot[o]):Boolean(ft[n]):e.namespaceURI===Ve?t.namespaceURI===Je?"math"===n:t.namespaceURI===Ze?"math"===n&&rt[o]:Boolean(dt[n]):e.namespaceURI===Je?!(t.namespaceURI===Ze&&!rt[o])&&!(t.namespaceURI===Ve&&!ot[o])&&!dt[n]&&(it[n]||!ft[n]):!("application/xhtml+xml"!==at||!tt[e.namespaceURI]))}(e)?(ht(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!C(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,g([ue,me,pe],e=>{t=N(t,e," ")}),e.textContent!==t&&(E(n.removed,{element:e.cloneNode()}),e.textContent=t)),bt(se.afterSanitizeElements,e,null),!1):(ht(e),!0)},St=function(e,t,n){if(we[t])return!1;if(Fe&&("id"===t||"name"===t)&&(n in o||n in ut))return!1;if(Ce&&!we[t]&&C(fe,t));else if(De&&C(de,t));else if(Re.attributeCheck instanceof Function&&Re.attributeCheck(t,e));else if(!be[t]||we[t]){if(!(Nt(e)&&(Se.tagNameCheck instanceof RegExp&&C(Se.tagNameCheck,e)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(e))&&(Se.attributeNameCheck instanceof RegExp&&C(Se.attributeNameCheck,t)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(t,e))||"is"===t&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&C(Se.tagNameCheck,n)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))))return!1}else if(Ke[t]);else if(C(ye,N(n,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==w(n,"data:")||!Xe[e])if(Oe&&!C(he,N(n,ge,"")));else if(n)return!1;return!0},Nt=function(e){return"annotation-xml"!==e&&S(e,Te)},wt=function(e){bt(se.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Et(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=ct(a),u=c;let m="value"===a?u:R(u);if(o.attrName=s,o.attrValue=m,o.keepAttr=!0,o.forceKeepAttr=void 0,bt(se.uponSanitizeAttribute,e,o),m=o.attrValue,!He||"id"!==s&&"name"!==s||(gt(a,e),m="user-content-"+m),ke&&C(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,m)){gt(a,e);continue}if("attributename"===s&&S(m,"href")){gt(a,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){gt(a,e);continue}if(!ve&&C(/\/>/i,m)){gt(a,e);continue}Le&&g([ue,me,pe],e=>{m=N(m,e," ")});const p=ct(e.nodeName);if(St(p,s,m)){if(Q&&"object"==typeof L&&"function"==typeof L.getAttributeType)if(l);else switch(L.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),Et(e)?ht(e):y(n.removed)}catch(t){gt(a,e)}}else gt(a,e)}bt(se.afterSanitizeAttributes,e,null)},Rt=function(e){let t=null;const n=yt(e);for(bt(se.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)bt(se.uponSanitizeShadowNode,t,null),_t(t),wt(t),t.content instanceof l&&Rt(t.content);bt(se.afterSanitizeShadowDOM,e,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(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!At(e)){if("function"!=typeof e.toString)throw O("toString is not a function");if("string"!=typeof(e=e.toString()))throw O("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Me||pt(t),n.removed=[],"string"==typeof e&&(Ge=!1),Ge){if(e.nodeName){const t=ct(e.nodeName);if(!Ee[t]||Ne[t])throw O("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof s)o=Tt("\x3c!----\x3e"),i=o.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!Ue&&!Le&&!xe&&-1===e.indexOf("<"))return Q&&Pe?Q.createHTML(e):e;if(o=Tt(e),!o)return Ue?null:Pe?ee:""}o&&Ie&&ht(o.firstChild);const u=yt(Ge?e:o);for(;a=u.nextNode();)_t(a),wt(a),a.content instanceof l&&Rt(a.content);if(Ge)return e;if(Ue){if(Le){o.normalize();let e=o.innerHTML;g([ue,me,pe],t=>{e=N(e,t," ")}),o.innerHTML=e}if(ze)for(c=ae.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(be.shadowroot||be.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&&C(te,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),Le&&g([ue,me,pe],e=>{m=N(m,e," ")}),Q&&Pe?Q.createHTML(m):m},n.setConfig=function(){pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Me=!0},n.clearConfig=function(){st=null,Me=!1},n.isValidAttribute=function(e,t,n){st||pt({});const o=ct(e),r=ct(t);return St(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/products",{},{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"];(0,o.store)("woocommerce/product-elements",{callbacks:{updateValue:()=>{const e=(0,o.getElement)(),t=se.productInContext;if(!e.ref||!t)return;const{productElementKey:n}=(0,o.getContext)(),r=t[n];"string"==typeof r&&(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(e??"",n)}(r,{tags:ue,attr:me}))}}},{lock:!0});
💾 Save Changes
❌ Cancel