@dropins/storefront-checkout 3.3.0-beta.0 → 3.3.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/api.js +266 -0
  3. package/api.js.map +1 -0
  4. package/chunks/PaymentOnAccount.js +1 -1
  5. package/chunks/PaymentOnAccount.js.map +1 -1
  6. package/chunks/PurchaseOrder.js +1 -1
  7. package/chunks/PurchaseOrder.js.map +1 -1
  8. package/chunks/components.js +2 -2
  9. package/chunks/components.js.map +1 -1
  10. package/chunks/events.js +4 -0
  11. package/chunks/events.js.map +1 -0
  12. package/chunks/render.js +1 -1
  13. package/chunks/render.js.map +1 -1
  14. package/chunks/ui.js +4 -0
  15. package/chunks/ui.js.map +1 -0
  16. package/containers/AddressValidation.js +1 -1
  17. package/containers/AddressValidation.js.map +1 -1
  18. package/containers/BillToShippingAddress.js +1 -1
  19. package/containers/BillToShippingAddress.js.map +1 -1
  20. package/containers/EstimateShipping.js +1 -1
  21. package/containers/EstimateShipping.js.map +1 -1
  22. package/containers/LoginForm.js +1 -1
  23. package/containers/LoginForm.js.map +1 -1
  24. package/containers/MergedCartBanner.js +1 -1
  25. package/containers/MergedCartBanner.js.map +1 -1
  26. package/containers/OutOfStock.js +1 -1
  27. package/containers/OutOfStock.js.map +1 -1
  28. package/containers/PaymentMethods.js +1 -1
  29. package/containers/PaymentMethods.js.map +1 -1
  30. package/containers/PaymentOnAccount.js +1 -1
  31. package/containers/PlaceOrder.js +1 -1
  32. package/containers/PlaceOrder.js.map +1 -1
  33. package/containers/PurchaseOrder.js +1 -1
  34. package/containers/ServerError.js +1 -1
  35. package/containers/ServerError.js.map +1 -1
  36. package/containers/ShippingMethods.js +1 -1
  37. package/containers/ShippingMethods.js.map +1 -1
  38. package/containers/TermsAndConditions.js +1 -1
  39. package/containers/TermsAndConditions.js.map +1 -1
  40. package/fragments.js +275 -1
  41. package/fragments.js.map +1 -1
  42. package/lib/index.d.ts +0 -1
  43. package/lib/utils/index.d.ts +1 -1
  44. package/lib/utils.js +1 -537
  45. package/lib/utils.js.map +1 -1
  46. package/package.json +1 -1
  47. package/render.js +1 -1
@@ -1,5 +1,5 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{classes as T,VComponent as $,getPriceFormatter as mn,Slot as hn}from"@dropins/tools/lib.js";import{useText as F,Text as pn}from"@dropins/tools/i18n.js";import{jsxs as p,jsx as o,Fragment as Nt}from"@dropins/tools/preact-jsx-runtime.js";import{Header as fn,ToggleButton as qe,Skeleton as X,SkeletonRow as b,Checkbox as gn,InLineAlert as ye,Field as Ke,Input as Je,Card as _n,Icon as fe,Image as kn,IllustratedMessage as Qe,RadioButton as Pt,Price as pe,Button as Ft}from"@dropins/tools/components.js";import{scrollToElement as Ht,h as En}from"../lib/utils.js";import"@dropins/tools/event-bus.js";import*as f from"@dropins/tools/preact-compat.js";import{useRef as Tn,useEffect as An}from"@dropins/tools/preact-compat.js";import{useRef as Ln,useEffect as vn,useMemo as Sn}from"@dropins/tools/preact-hooks.js";function Nn(t){var k;if(!t)return[];const n=`${t.firstName} ${t.lastName}`.trim(),r=((k=t.street)==null?void 0:k[0])??"",a=t.city??"",s=t.region||"",c=t.postcode??"",d=t.countryCode??"";let m="";a&&s?m=`${a}, ${s}`:a?m=a:s&&(m=s);let _=m;c&&(_=m?`${m} ${c}`:c);let A=_;return d&&(A=_?`${_}, ${d}`:d),[n,r,A]}const bt=({title:t,address:n,selected:r,busy:a,onChange:s})=>{const[c,d,m]=Nn(n);return o("div",{className:"checkout-address-validation__option",children:o(qe,{busy:a,className:"checkout-address-validation__radio",label:p("div",{children:[o("div",{className:"checkout-address-validation__option-title",children:o("strong",{children:t})}),c&&o("div",{children:c}),d&&o("div",{children:d}),m&&o("div",{children:m})]}),name:"address-validation-choice",selected:r,value:t,onChange:s})})},bo=({busy:t=!1,className:n,currentAddress:r,onSelectionChange:a,selection:s,suggestedAddress:c})=>{const d=!!c,m=F({title:"Checkout.AddressValidation.title",subtitle:"Checkout.AddressValidation.subtitle",suggestedAddress:"Checkout.AddressValidation.suggestedAddress",originalAddress:"Checkout.AddressValidation.originalAddress"});return p("div",{className:T(["checkout-address-validation",n]),children:[o(fn,{className:"checkout-address-validation__title",divider:!1,title:m.title}),o("div",{className:"checkout-address-validation__subtitle",children:m.subtitle}),p("div",{className:T(["checkout-address-validation__options",t&&"checkout-address-validation__options--busy"]),children:[d&&o(bt,{address:c,busy:t,selected:s==="suggested",title:m.suggestedAddress,onChange:()=>a("suggested")}),o(bt,{address:r,busy:t,selected:s==="original",title:m.originalAddress,onChange:()=>a("original")})]})]})},bn=()=>o(X,{className:"bill-to-shipping-address__skeleton","data-testid":"bill-to-shipping-skeleton",children:o(b,{size:"small",variant:"row"})});function Z(t,n){return function(a){const{initialized:s=!0,visible:c=!0,...d}=a;return p("div",{className:"conditional-wrapper",children:[c&&!s&&o(n,{}),c&&s&&o(t,{...d})]})}}const yn=t=>t.reduce((r,a)=>{if(!a)return r;if(typeof a=="string"&&(r+=` ${a}`),Array.isArray(a)){const[s,c]=a;s&&c&&(r+=` ${s}`)}return r},"").trim(),Cn=({className:t,checked:n,disabled:r,error:a=null,onChange:s=()=>{},onDismissError:c=()=>{}})=>{const d=F({title:"Checkout.BillToShippingAddress.title"}),m=a!==null,_=A=>{const k=A.target;s==null||s(k.checked)};return p("div",{className:"checkout-bill-to-shipping-address",children:[o(gn,{checked:n,className:yn(["checkout-bill-to-shipping-address__checkbox",t]),"data-testid":"bill-to-shipping-checkbox",disabled:r,label:d.title,name:"checkout-bill-to-shipping-address__checkbox",onChange:_}),m&&o("div",{className:"checkout-bill-to-shipping-address__error","data-testid":"checkout-bill-to-shipping-address-alert",children:o(ye,{heading:a,type:"error",variant:"primary",onDismiss:c})})]})},yo=Z(Cn,bn),On=()=>o(X,{"data-testid":"estimate-shipping-skeleton",children:o(b,{size:"xsmall"})}),Rn=({label:t,price:n,priceExclTax:r,taxExcluded:a=!1,taxIncluded:s=!1})=>{const c=F({withTaxes:"Checkout.EstimateShipping.withTaxes",withoutTaxes:"Checkout.EstimateShipping.withoutTaxes"});return p("div",{className:"checkout-estimate-shipping","data-testid":"estimate-shipping",children:[o($,{className:"checkout-estimate-shipping__label",node:t}),o($,{className:"checkout-estimate-shipping__price",node:n}),s&&o("span",{className:T(["checkout-estimate-shipping__caption"]),"data-testid":"shipping-tax-included",children:c.withTaxes}),a&&p("span",{className:T(["checkout-estimate-shipping__caption"]),"data-testid":"shipping-tax-included-excluded",children:[r," ",c.withoutTaxes]})]})},Co=Z(Rn,On),Mn=({value:t,error:n,hint:r,onChange:a,onBlur:s,onInvalid:c})=>{const d=F({LoginFormLabel:"Checkout.LoginForm.ariaLabel",LoginFormFloatingLabel:"Checkout.LoginForm.floatingLabel",LoginFormPlaceholder:"Checkout.LoginForm.placeholder"});return o(Ke,{error:n,hint:r,children:o(Je,{"aria-label":d.LoginFormLabel,"aria-required":!0,autocomplete:"email",floatingLabel:d.LoginFormFloatingLabel,id:"customer-email",name:"customer-email",placeholder:d.LoginFormPlaceholder,required:!0,type:"email",value:t,onBlur:s,onChange:a,onInvalid:c})})},Oo=({onClick:t})=>{const n=F({account:"Checkout.LoginForm.account",signIn:"Checkout.LoginForm.signIn"});return p("div",{className:"checkout-login-form__sign-in",children:[n.account,o("a",{className:"checkout-login-form__link","data-testid":"sign-in-link",href:"#",rel:"noreferrer",target:"_blank",onClick:r=>{r.preventDefault(),t(r)},children:n.signIn})]})},wn=()=>p(X,{"data-testid":"login-form-skeleton",children:[o(b,{fullWidth:!0,variant:"heading"}),o(b,{fullWidth:!0,size:"medium"})]}),In=({className:t,customer:n,email:r,error:a,headingContent:s,hint:c,name:d,onEmailBlur:m,onEmailChange:_,onEmailInvalid:A,preferences:k,title:W,...H})=>p("div",{className:"checkout-login-form","data-testid":"checkout-login-form",children:[p("div",{className:"checkout-login-form__heading",children:[W&&o($,{className:"checkout-login-form__title",node:W}),s&&o($,{className:"checkout-login-form__heading-label",node:s})]}),n?p("div",{className:"checkout-login-form__customer-details",children:[o("div",{className:"checkout-login-form__customer-name",children:`${n.firstName} ${n.lastName}`}),o("div",{className:"checkout-login-form__customer-email",children:n.email})]}):o("div",{className:"checkout-login-form__content",children:p("form",{...H,noValidate:!0,className:T(["dropin-login-form__form",t]),name:d,children:[o("button",{disabled:!0,"aria-hidden":"true",style:"display: none",type:"submit"}),o(Mn,{error:a,hint:c,value:r,onBlur:m,onChange:_,onInvalid:A}),k&&o($,{className:"checkout-login-form__preferences",node:k})]})})]}),Ro=Z(In,wn),Mo=({onClick:t})=>{const n=F({switch:"Checkout.LoginForm.switch",signOut:"Checkout.LoginForm.signOut"});return p("p",{className:"checkout-login-form__sign-out",children:[n.switch,o("a",{className:"checkout-login-form__link",href:"#",rel:"noreferrer",target:"_blank",onClick:r=>{r.preventDefault(),t==null||t(r)},children:n.signOut})]})};/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Ut,setPrototypeOf:yt,isFrozen:Dn,getPrototypeOf:xn,getOwnPropertyDescriptor:Pn}=Object;let{freeze:I,seal:P,create:Wt}=Object,{apply:Xe,construct:Ze}=typeof Reflect<"u"&&Reflect;I||(I=function(n){return n});P||(P=function(n){return n});Xe||(Xe=function(n,r,a){return n.apply(r,a)});Ze||(Ze=function(n,r){return new n(...r)});const Se=D(Array.prototype.forEach),Fn=D(Array.prototype.lastIndexOf),Ct=D(Array.prototype.pop),le=D(Array.prototype.push),Hn=D(Array.prototype.splice),be=D(String.prototype.toLowerCase),Ve=D(String.prototype.toString),Ot=D(String.prototype.match),ue=D(String.prototype.replace),Un=D(String.prototype.indexOf),Wn=D(String.prototype.trim),U=D(Object.prototype.hasOwnProperty),w=D(RegExp.prototype.test),de=zn(TypeError);function D(t){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return Xe(t,n,a)}}function zn(t){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ze(t,r)}}function h(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:be;yt&&yt(t,null);let a=n.length;for(;a--;){let s=n[a];if(typeof s=="string"){const c=r(s);c!==s&&(Dn(n)||(n[a]=c),s=c)}t[s]=!0}return t}function Bn(t){for(let n=0;n<t.length;n++)U(t,n)||(t[n]=null);return t}function Y(t){const n=Wt(null);for(const[r,a]of Ut(t))U(t,r)&&(Array.isArray(a)?n[r]=Bn(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=Y(a):n[r]=a);return n}function me(t,n){for(;t!==null;){const a=Pn(t,n);if(a){if(a.get)return D(a.get);if(typeof a.value=="function")return D(a.value)}t=xn(t)}function r(){return null}return r}const Rt=I(["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"]),Ge=I(["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"]),je=I(["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"]),Vn=I(["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"]),Ye=I(["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"]),Gn=I(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mt=I(["#text"]),wt=I(["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"]),$e=I(["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"]),It=I(["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"]),Ne=I(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jn=P(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yn=P(/<%[\w\W]*|[\w\W]*%>/gm),$n=P(/\$\{[\w\W]*/gm),Xn=P(/^data-[\-\w.\u00B7-\uFFFF]+$/),Zn=P(/^aria-[\-\w]+$/),zt=P(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qn=P(/^(?:\w+script|data):/i),Kn=P(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bt=P(/^html$/i),Jn=P(/^[a-z][.\w]*(-[.\w]+)+$/i);var Dt=Object.freeze({__proto__:null,ARIA_ATTR:Zn,ATTR_WHITESPACE:Kn,CUSTOM_ELEMENT:Jn,DATA_ATTR:Xn,DOCTYPE_NAME:Bt,ERB_EXPR:Yn,IS_ALLOWED_URI:zt,IS_SCRIPT_OR_DATA:qn,MUSTACHE_EXPR:jn,TMPLIT_EXPR:$n});const he={element:1,text:3,progressingInstruction:7,comment:8,document:9},Qn=function(){return typeof window>"u"?null:window},eo=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(a=r.getAttribute(s));const c="dompurify"+(a?"#"+a:"");try{return n.createPolicy(c,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},xt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qn();const n=u=>Vt(u);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==he.document||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const a=r,s=a.currentScript,{DocumentFragment:c,HTMLTemplateElement:d,Node:m,Element:_,NodeFilter:A,NamedNodeMap:k=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:W,DOMParser:H,trustedTypes:O}=t,B=_.prototype,jt=me(B,"cloneNode"),Yt=me(B,"remove"),$t=me(B,"nextSibling"),Xt=me(B,"childNodes"),ge=me(B,"parentNode");if(typeof d=="function"){const u=r.createElement("template");u.content&&u.content.ownerDocument&&(r=u.content.ownerDocument)}let R,re="";const{implementation:Ce,createNodeIterator:Zt,createDocumentFragment:qt,getElementsByTagName:Kt}=r,{importNode:Jt}=a;let M=xt();n.isSupported=typeof Ut=="function"&&typeof ge=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Oe,ERB_EXPR:Re,TMPLIT_EXPR:Me,DATA_ATTR:Qt,ARIA_ATTR:en,IS_SCRIPT_OR_DATA:tn,ATTR_WHITESPACE:et,CUSTOM_ELEMENT:nn}=Dt;let{IS_ALLOWED_URI:tt}=Dt,v=null;const nt=h({},[...Rt,...Ge,...je,...Ye,...Mt]);let N=null;const ot=h({},[...wt,...$e,...It,...Ne]);let E=Object.seal(Wt(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}})),ie=null,we=null,rt=!0,Ie=!0,it=!1,at=!0,K=!1,_e=!0,q=!1,De=!1,xe=!1,J=!1,ke=!1,Ee=!1,st=!0,ct=!1;const on="user-content-";let Pe=!0,ae=!1,Q={},ee=null;const lt=h({},["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 ut=null;const dt=h({},["audio","video","img","source","image","track"]);let Fe=null;const mt=h({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Te="http://www.w3.org/1998/Math/MathML",Ae="http://www.w3.org/2000/svg",V="http://www.w3.org/1999/xhtml";let te=V,He=!1,Ue=null;const rn=h({},[Te,Ae,V],Ve);let Le=h({},["mi","mo","mn","ms","mtext"]),ve=h({},["annotation-xml"]);const an=h({},["title","style","font","a","script"]);let se=null;const sn=["application/xhtml+xml","text/html"],cn="text/html";let S=null,ne=null;const ln=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},We=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ne&&ne===e)){if((!e||typeof e!="object")&&(e={}),e=Y(e),se=sn.indexOf(e.PARSER_MEDIA_TYPE)===-1?cn:e.PARSER_MEDIA_TYPE,S=se==="application/xhtml+xml"?Ve:be,v=U(e,"ALLOWED_TAGS")?h({},e.ALLOWED_TAGS,S):nt,N=U(e,"ALLOWED_ATTR")?h({},e.ALLOWED_ATTR,S):ot,Ue=U(e,"ALLOWED_NAMESPACES")?h({},e.ALLOWED_NAMESPACES,Ve):rn,Fe=U(e,"ADD_URI_SAFE_ATTR")?h(Y(mt),e.ADD_URI_SAFE_ATTR,S):mt,ut=U(e,"ADD_DATA_URI_TAGS")?h(Y(dt),e.ADD_DATA_URI_TAGS,S):dt,ee=U(e,"FORBID_CONTENTS")?h({},e.FORBID_CONTENTS,S):lt,ie=U(e,"FORBID_TAGS")?h({},e.FORBID_TAGS,S):Y({}),we=U(e,"FORBID_ATTR")?h({},e.FORBID_ATTR,S):Y({}),Q=U(e,"USE_PROFILES")?e.USE_PROFILES:!1,rt=e.ALLOW_ARIA_ATTR!==!1,Ie=e.ALLOW_DATA_ATTR!==!1,it=e.ALLOW_UNKNOWN_PROTOCOLS||!1,at=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=e.SAFE_FOR_TEMPLATES||!1,_e=e.SAFE_FOR_XML!==!1,q=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Ee=e.RETURN_TRUSTED_TYPE||!1,xe=e.FORCE_BODY||!1,st=e.SANITIZE_DOM!==!1,ct=e.SANITIZE_NAMED_PROPS||!1,Pe=e.KEEP_CONTENT!==!1,ae=e.IN_PLACE||!1,tt=e.ALLOWED_URI_REGEXP||zt,te=e.NAMESPACE||V,Le=e.MATHML_TEXT_INTEGRATION_POINTS||Le,ve=e.HTML_INTEGRATION_POINTS||ve,E=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(E.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(E.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(E.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(Ie=!1),ke&&(J=!0),Q&&(v=h({},Mt),N=[],Q.html===!0&&(h(v,Rt),h(N,wt)),Q.svg===!0&&(h(v,Ge),h(N,$e),h(N,Ne)),Q.svgFilters===!0&&(h(v,je),h(N,$e),h(N,Ne)),Q.mathMl===!0&&(h(v,Ye),h(N,It),h(N,Ne))),e.ADD_TAGS&&(v===nt&&(v=Y(v)),h(v,e.ADD_TAGS,S)),e.ADD_ATTR&&(N===ot&&(N=Y(N)),h(N,e.ADD_ATTR,S)),e.ADD_URI_SAFE_ATTR&&h(Fe,e.ADD_URI_SAFE_ATTR,S),e.FORBID_CONTENTS&&(ee===lt&&(ee=Y(ee)),h(ee,e.FORBID_CONTENTS,S)),Pe&&(v["#text"]=!0),q&&h(v,["html","head","body"]),v.table&&(h(v,["tbody"]),delete ie.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=e.TRUSTED_TYPES_POLICY,re=R.createHTML("")}else R===void 0&&(R=eo(O,s)),R!==null&&typeof re=="string"&&(re=R.createHTML(""));I&&I(e),ne=e}},pt=h({},[...Ge,...je,...Vn]),ft=h({},[...Ye,...Gn]),un=function(e){let i=ge(e);(!i||!i.tagName)&&(i={namespaceURI:te,tagName:"template"});const l=be(e.tagName),g=be(i.tagName);return Ue[e.namespaceURI]?e.namespaceURI===Ae?i.namespaceURI===V?l==="svg":i.namespaceURI===Te?l==="svg"&&(g==="annotation-xml"||Le[g]):!!pt[l]:e.namespaceURI===Te?i.namespaceURI===V?l==="math":i.namespaceURI===Ae?l==="math"&&ve[g]:!!ft[l]:e.namespaceURI===V?i.namespaceURI===Ae&&!ve[g]||i.namespaceURI===Te&&!Le[g]?!1:!ft[l]&&(an[l]||!pt[l]):!!(se==="application/xhtml+xml"&&Ue[e.namespaceURI]):!1},z=function(e){le(n.removed,{element:e});try{ge(e).removeChild(e)}catch{Yt(e)}},oe=function(e,i){try{le(n.removed,{attribute:i.getAttributeNode(e),from:i})}catch{le(n.removed,{attribute:null,from:i})}if(i.removeAttribute(e),e==="is")if(J||ke)try{z(i)}catch{}else try{i.setAttribute(e,"")}catch{}},gt=function(e){let i=null,l=null;if(xe)e="<remove></remove>"+e;else{const L=Ot(e,/^[\r\n\t ]+/);l=L&&L[0]}se==="application/xhtml+xml"&&te===V&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const g=R?R.createHTML(e):e;if(te===V)try{i=new H().parseFromString(g,se)}catch{}if(!i||!i.documentElement){i=Ce.createDocument(te,"template",null);try{i.documentElement.innerHTML=He?re:g}catch{}}const y=i.body||i.documentElement;return e&&l&&y.insertBefore(r.createTextNode(l),y.childNodes[0]||null),te===V?Kt.call(i,q?"html":"body")[0]:q?i.documentElement:y},_t=function(e){return Zt.call(e.ownerDocument||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT|A.SHOW_PROCESSING_INSTRUCTION|A.SHOW_CDATA_SECTION,null)},ze=function(e){return e instanceof W&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof k)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},kt=function(e){return typeof m=="function"&&e instanceof m};function G(u,e,i){Se(u,l=>{l.call(n,e,i,ne)})}const Et=function(e){let i=null;if(G(M.beforeSanitizeElements,e,null),ze(e))return z(e),!0;const l=S(e.nodeName);if(G(M.uponSanitizeElement,e,{tagName:l,allowedTags:v}),_e&&e.hasChildNodes()&&!kt(e.firstElementChild)&&w(/<[/\w!]/g,e.innerHTML)&&w(/<[/\w!]/g,e.textContent)||e.nodeType===he.progressingInstruction||_e&&e.nodeType===he.comment&&w(/<[/\w]/g,e.data))return z(e),!0;if(!v[l]||ie[l]){if(!ie[l]&&At(l)&&(E.tagNameCheck instanceof RegExp&&w(E.tagNameCheck,l)||E.tagNameCheck instanceof Function&&E.tagNameCheck(l)))return!1;if(Pe&&!ee[l]){const g=ge(e)||e.parentNode,y=Xt(e)||e.childNodes;if(y&&g){const L=y.length;for(let x=L-1;x>=0;--x){const j=jt(y[x],!0);j.__removalCount=(e.__removalCount||0)+1,g.insertBefore(j,$t(e))}}}return z(e),!0}return e instanceof _&&!un(e)||(l==="noscript"||l==="noembed"||l==="noframes")&&w(/<\/no(script|embed|frames)/i,e.innerHTML)?(z(e),!0):(K&&e.nodeType===he.text&&(i=e.textContent,Se([Oe,Re,Me],g=>{i=ue(i,g," ")}),e.textContent!==i&&(le(n.removed,{element:e.cloneNode()}),e.textContent=i)),G(M.afterSanitizeElements,e,null),!1)},Tt=function(e,i,l){if(st&&(i==="id"||i==="name")&&(l in r||l in ln))return!1;if(!(Ie&&!we[i]&&w(Qt,i))){if(!(rt&&w(en,i))){if(!N[i]||we[i]){if(!(At(e)&&(E.tagNameCheck instanceof RegExp&&w(E.tagNameCheck,e)||E.tagNameCheck instanceof Function&&E.tagNameCheck(e))&&(E.attributeNameCheck instanceof RegExp&&w(E.attributeNameCheck,i)||E.attributeNameCheck instanceof Function&&E.attributeNameCheck(i))||i==="is"&&E.allowCustomizedBuiltInElements&&(E.tagNameCheck instanceof RegExp&&w(E.tagNameCheck,l)||E.tagNameCheck instanceof Function&&E.tagNameCheck(l))))return!1}else if(!Fe[i]){if(!w(tt,ue(l,et,""))){if(!((i==="src"||i==="xlink:href"||i==="href")&&e!=="script"&&Un(l,"data:")===0&&ut[e])){if(!(it&&!w(tn,ue(l,et,"")))){if(l)return!1}}}}}}return!0},At=function(e){return e!=="annotation-xml"&&Ot(e,nn)},Lt=function(e){G(M.beforeSanitizeAttributes,e,null);const{attributes:i}=e;if(!i||ze(e))return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0};let g=i.length;for(;g--;){const y=i[g],{name:L,namespaceURI:x,value:j}=y,ce=S(L),Be=j;let C=L==="value"?Be:Wn(Be);if(l.attrName=ce,l.attrValue=C,l.keepAttr=!0,l.forceKeepAttr=void 0,G(M.uponSanitizeAttribute,e,l),C=l.attrValue,ct&&(ce==="id"||ce==="name")&&(oe(L,e),C=on+C),_e&&w(/((--!?|])>)|<\/(style|title)/i,C)){oe(L,e);continue}if(l.forceKeepAttr)continue;if(!l.keepAttr){oe(L,e);continue}if(!at&&w(/\/>/i,C)){oe(L,e);continue}K&&Se([Oe,Re,Me],St=>{C=ue(C,St," ")});const vt=S(e.nodeName);if(!Tt(vt,ce,C)){oe(L,e);continue}if(R&&typeof O=="object"&&typeof O.getAttributeType=="function"&&!x)switch(O.getAttributeType(vt,ce)){case"TrustedHTML":{C=R.createHTML(C);break}case"TrustedScriptURL":{C=R.createScriptURL(C);break}}if(C!==Be)try{x?e.setAttributeNS(x,L,C):e.setAttribute(L,C),ze(e)?z(e):Ct(n.removed)}catch{oe(L,e)}}G(M.afterSanitizeAttributes,e,null)},dn=function u(e){let i=null;const l=_t(e);for(G(M.beforeSanitizeShadowDOM,e,null);i=l.nextNode();)G(M.uponSanitizeShadowNode,i,null),Et(i),Lt(i),i.content instanceof c&&u(i.content);G(M.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(u){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,l=null,g=null,y=null;if(He=!u,He&&(u="<!-->"),typeof u!="string"&&!kt(u))if(typeof u.toString=="function"){if(u=u.toString(),typeof u!="string")throw de("dirty is not a string, aborting")}else throw de("toString is not a function");if(!n.isSupported)return u;if(De||We(e),n.removed=[],typeof u=="string"&&(ae=!1),ae){if(u.nodeName){const j=S(u.nodeName);if(!v[j]||ie[j])throw de("root node is forbidden and cannot be sanitized in-place")}}else if(u instanceof m)i=gt("<!---->"),l=i.ownerDocument.importNode(u,!0),l.nodeType===he.element&&l.nodeName==="BODY"||l.nodeName==="HTML"?i=l:i.appendChild(l);else{if(!J&&!K&&!q&&u.indexOf("<")===-1)return R&&Ee?R.createHTML(u):u;if(i=gt(u),!i)return J?null:Ee?re:""}i&&xe&&z(i.firstChild);const L=_t(ae?u:i);for(;g=L.nextNode();)Et(g),Lt(g),g.content instanceof c&&dn(g.content);if(ae)return u;if(J){if(ke)for(y=qt.call(i.ownerDocument);i.firstChild;)y.appendChild(i.firstChild);else y=i;return(N.shadowroot||N.shadowrootmode)&&(y=Jt.call(a,y,!0)),y}let x=q?i.outerHTML:i.innerHTML;return q&&v["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(Bt,i.ownerDocument.doctype.name)&&(x="<!DOCTYPE "+i.ownerDocument.doctype.name+`>
4
- `+x),K&&Se([Oe,Re,Me],j=>{x=ue(x,j," ")}),R&&Ee?R.createHTML(x):x},n.setConfig=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};We(u),De=!0},n.clearConfig=function(){ne=null,De=!1},n.isValidAttribute=function(u,e,i){ne||We({});const l=S(u),g=S(e);return Tt(l,g,i)},n.addHook=function(u,e){typeof e=="function"&&le(M[u],e)},n.removeHook=function(u,e){if(e!==void 0){const i=Fn(M[u],e);return i===-1?void 0:Hn(M[u],i,1)[0]}return Ct(M[u])},n.removeHooks=function(u){M[u]=[]},n.removeAllHooks=function(){M=xt()},n}var to=Vt();const wo=({html:t})=>{const n=to.sanitize(t,{ADD_ATTR:["target"]});return n===""?null:o("span",{dangerouslySetInnerHTML:{__html:n}})},no=t=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.47266 4.90002H15.1851V10.9645H21.2495L23 12.715V17.6124H20.073",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76151 16.7898C9.76151 18.0525 8.72845 19.076 7.46582 19.076C6.20318 19.076 5.17969 18.0429 5.17969 16.7803C5.17969 15.5176 6.20318 14.4941 7.46582 14.4941C8.72845 14.4941 9.75195 15.5176 9.76151 16.7803C9.76151 16.7803 9.76151 16.7803 9.76151 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8726 16.7898C19.8726 18.062 18.8491 19.0855 17.5769 19.0855C16.3047 19.0855 15.2812 18.062 15.2812 16.7898C15.2812 15.5176 16.3047 14.4941 17.5769 14.4941C18.8491 14.4941 19.8726 15.5176 19.8726 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Io=t=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),Gt=t=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},f.createElement("g",{clipPath:"url(#clip0_4797_15331)"},f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.25 20.91L1.5 17.55V6.51996L10.25 9.92996V20.91Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.24023 4.64001L14.9902 8.06001V11.42",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),f.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19 13.31L15.5 19.37H22.5L19 13.31Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),f.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19.0202 17.11H18.9802L18.9502 15.56H19.0502L19.0202 17.11ZM18.9602 18.29V18.06H19.0502V18.29H18.9602Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19 12.16V6.51996L10.25 9.92996V20.91L14.27 19.37L14.4 19.32",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:1}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.51999L10.25 3.04999L19 6.51999L10.25 9.92999L1.5 6.51999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})),f.createElement("defs",null,f.createElement("clipPath",{id:"clip0_4797_15331"},f.createElement("rect",{width:22,height:18.86,fill:"white",transform:"translate(1 2.54999)"})))),oo=t=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Do=({className:t,items:n,onRemoveOutOfStock:r,routeCart:a,...s})=>{const c=F({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return p(_n,{className:T(["checkout-out-of-stock",t]),"data-testid":"checkout-out-of-stock",variant:"secondary",...s,children:[p("h4",{className:"checkout-out-of-stock__title",children:[o(fe,{size:"16",source:Gt,stroke:"1"}),c.title]}),o("p",{className:"checkout-out-of-stock__message",children:c.message}),o("ol",{className:"checkout-out-of-stock__items",children:n.map(d=>o("li",{className:"checkout-out-of-stock__item","data-testid":"out-of-stock-item",children:o(kn,{alt:d.image.alt,height:"100",loading:"eager",params:{width:100},src:d.image.src,width:"100"})},d.sku))}),p("div",{className:"checkout-out-of-stock__actions",children:[a&&o("a",{className:"checkout-out-of-stock__action","data-testid":"review-cart",href:a,children:c.reviewCart}),r&&o("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:r,children:c.removeOutOfStock})]})]})},ro=()=>p(X,{"data-testid":"payment-methods-skeleton",children:[o(b,{size:"medium",variant:"heading"}),o(b,{size:"medium",variant:"empty"}),o(b,{fullWidth:!0,size:"xlarge"}),o(b,{fullWidth:!0,size:"xlarge"})]}),io=({UIComponentType:t="ToggleButton",busy:n,code:r,icon:a,onSelectionChange:s,selected:c,title:d})=>{const m={busy:n,className:"checkout-payment-methods__method",label:d,name:"payment-method",onChange:()=>s({code:r,title:d}),value:r};return t==="ToggleButton"?o(qe,{...m,icon:a?o(fe,{source:a}):void 0,selected:c}):o(Pt,{...m,checked:c,icon:a??void 0})},ao=({className:t,error:n=null,busy:r=!1,onDismissError:a,onSelectionChange:s=()=>{},options:c,paymentMethodContent:d,selection:m,title:_,UIComponentType:A})=>{const k=F({EmptyState:"Checkout.PaymentMethods.emptyState"}),W=n!==null,H=Tn(null);return An(()=>{W&&H.current&&Ht(H.current)},[W]),p("div",{className:T(["checkout-payment-methods",t]),"data-testid":"checkout-payment-methods",children:[_&&o($,{className:"checkout-payment-methods__title",node:_}),!r&&c.length===0&&o(Qe,{"data-testid":"checkout-payment-methods-empty",icon:o(fe,{source:oo}),message:o("p",{children:k.EmptyState})}),p("div",{className:T(["checkout-payment-methods__wrapper",["checkout-payment-methods__wrapper--busy",r]]),"data-testid":"checkout-payment-methods-wrapper",children:[o("div",{className:T(["checkout-payment-methods__methods",["checkout-payment-methods--full-width",c.length%2!==0]]),children:c==null?void 0:c.map(O=>o(io,{UIComponentType:A,busy:r,code:O.code,icon:O.icon,selected:(m==null?void 0:m.code)===O.code,title:O.displayLabel??!0?O.title:"",onSelectionChange:s},O.code))}),d&&o("div",{className:"checkout-payment-methods__content",children:d})]}),W&&o("div",{ref:H,className:"checkout-payment-methods__error","data-testid":"checkout-payment-methods-alert",children:o(ye,{heading:n,type:"error",variant:"primary",onDismiss:a})})]})},xo=Z(ao,ro),so=()=>p(X,{"data-testid":"payment-on-account-skeleton",children:[o(b,{fullWidth:!0,size:"medium"}),o(b,{fullWidth:!0,size:"medium"})]}),co=(t,n)=>{if(!(t!=null&&t.availableCredit)||!n)return null;const r=t.availableCredit.value,s=n.value-r;return s<=0?null:{value:s,currency:t.availableCredit.currency}},lo=({className:t,referenceNumber:n="",onReferenceNumberChange:r,onReferenceNumberBlur:a,companyCredit:s=null,totalAmount:c=null,...d})=>{const m=co(s,c),_=s==null?void 0:s.availableCredit,A=mn({currency:(c==null?void 0:c.currency)??""}),k=F({referenceNumberLabel:"Checkout.PaymentOnAccount.referenceNumberLabel",referenceNumberPlaceholder:"Checkout.PaymentOnAccount.referenceNumberPlaceholder",referenceNumberHint:"Checkout.PaymentOnAccount.referenceNumberHint",availableCreditLabel:"Checkout.PaymentOnAccount.availableCreditLabel",exceedLimitError:"Checkout.PaymentOnAccount.exceedLimitError",exceedLimitWarning:m?o(pn,{fields:{creditLimit:A.format((_==null?void 0:_.value)??0),exceededAmount:A.format((m==null?void 0:m.value)??0)},id:"Checkout.PaymentOnAccount.exceedLimitWarning"}):""});return o("div",{className:"checkout-payment-on-account","data-testid":"checkout-payment-on-account",children:p("form",{...d,noValidate:!0,className:T(["checkout-payment-on-account__form",t]),"data-testid":"checkout-payment-on-account-form",name:"checkout-payment-on-account__form",children:[s&&s.availableCredit&&p("div",{className:"checkout-payment-on-account__credit","data-testid":"checkout-payment-on-account-credit",children:[o("span",{className:"checkout-payment-on-account__credit-label",children:k.availableCreditLabel}),o("span",{className:"checkout-payment-on-account__credit-amount",children:o(pe,{amount:s==null?void 0:s.availableCredit.value,currency:s==null?void 0:s.availableCredit.currency})})]}),o(Ke,{hint:k.referenceNumberHint,children:o(Je,{"aria-label":k.referenceNumberLabel,floatingLabel:k.referenceNumberLabel,id:"reference-number",name:"reference-number",placeholder:k.referenceNumberPlaceholder,type:"text",value:n,onBlur:a,onChange:r})}),m&&o("div",{className:"checkout-payment-on-account__exceed-message","data-testid":"checkout-payment-on-account-exceed-message",children:o(ye,{heading:s!=null&&s.exceedLimit?k.exceedLimitWarning:k.exceedLimitError,type:s!=null&&s.exceedLimit?"warning":"error",variant:"primary"})})]})})},Po=Z(lo,so),uo=()=>p(X,{"data-testid":"place-order-skeleton",children:[o(b,{size:"small",variant:"empty"}),o(b,{size:"small"})]}),mo=({children:t,className:n,disabled:r=!1,onClick:a})=>o("div",{className:T(["checkout-place-order",n]),children:o(Ft,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:r,size:"medium",type:"button",variant:"primary",onClick:a,children:t},"placeOrder")}),Fo=Z(mo,uo),Ho=({className:t,error:n="",referenceNumber:r="",onReferenceNumberBlur:a,onReferenceNumberChange:s,onInvalidReferenceNumber:c,...d})=>{const m=F({refNumberHint:"Checkout.PurchaseOrder.referenceNumberHint",refNumberLabel:"Checkout.PurchaseOrder.referenceNumberLabel",refNumberPlaceholder:"Checkout.PurchaseOrder.referenceNumberPlaceholder"});return o("div",{className:"checkout-purchase-order","data-testid":"checkout-purchase-order",children:o("form",{...d,noValidate:!0,className:T(["checkout-purchase-order__form",t]),"data-testid":"checkout-purchase-order-form",children:o(Ke,{error:n,hint:m.refNumberHint||void 0,children:o(Je,{"aria-required":"true",floatingLabel:`${m.refNumberLabel} *`,id:"reference-number",name:"reference-number",pattern:En.NOT_EMPTY,placeholder:m.refNumberPlaceholder,required:!0,type:"text",value:r,onBlur:a,onChange:s,onInvalid:c})})})})},Uo=({className:t,contactSupport:n,errorMessage:r,onClick:a,errorMessageRef:s})=>{const c=F({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"}),d=r!==""?r:c.Title;return o(Qe,{action:o(Ft,{className:T(["checkout-server-error__button"]),name:"server-error-button",onClick:a,children:c.Button}),"aria-describedby":"checkout-server-error__message","aria-invalid":"true","aria-live":"polite",className:T(["checkout-server-error",t]),"data-testid":"checkout-server-error",heading:d,icon:o(fe,{className:T(["checkout-server-error__icon"]),source:Gt}),message:p("p",{ref:s,"data-testid":"checkout-server-error-message",id:T(["checkout-server-error__message"]),children:[c.Message,o("br",{}),o("span",{children:n??c.ContactSupport})]})})},ho=()=>p(X,{"data-testid":"shipping-methods-skeleton",children:[o(b,{size:"small",variant:"heading"}),o(b,{size:"small",variant:"empty"}),o(b,{fullWidth:!0,size:"medium"}),o(b,{fullWidth:!0,size:"medium"})]}),po=({method:t,isSelected:n,busy:r,UIComponentType:a,onSelectionChange:s,slot:c})=>{const d=Sn(()=>({method:t,isSelected:n,busy:r,onSelect:()=>s(t)}),[t,n,r,s]),m={busy:r,className:"checkout-shipping-methods__method",name:"shipping-method",value:t.value,onChange:()=>s(t)},k=a==="RadioButton"?o(Pt,{...m,checked:n,"data-testid":"shipping-method-radioButton",description:t.title,disabled:r,id:t.value,label:p(Nt,{children:[t.originalAmount&&o(pe,{amount:t.originalAmount.value,className:"checkout-shipping-methods__price--original",currency:t.originalAmount.currency,"data-testid":"shipping-method-original-price",variant:"strikethrough"}),o(pe,{amount:t.amount.value,className:"checkout-shipping-methods__price",currency:t.amount.currency})," ",o("span",{children:t.carrier.title})]})}):o(qe,{...m,"data-testid":"shipping-method-toggleButton",label:p(Nt,{children:[o("span",{children:t.carrier.title}),p("div",{className:"checkout-shipping-methods__price-wrapper",children:[t.originalAmount&&o(pe,{amount:t.originalAmount.value,className:"checkout-shipping-methods__price--original",currency:t.originalAmount.currency,"data-testid":"shipping-method-original-price",variant:"strikethrough"}),o(pe,{amount:t.amount.value,className:"checkout-shipping-methods__price",currency:t.amount.currency})]})]}),selected:n});return o(hn,{context:d,name:`checkout-shipping-method-item-${t.value}`,slot:c,children:k})},fo=({className:t,busy:n=!1,onSelectionChange:r=()=>{},options:a,selection:s,shippingMethodItemSlot:c,title:d,UIComponentType:m="RadioButton",error:_=null,onDismissError:A=()=>{},...k})=>{const W=F({EmptyState:"Checkout.ShippingMethods.emptyState"}),H=_!==null,O=Ln(null);return vn(()=>{H&&O.current&&Ht(O.current)},[H]),p("div",{...k,className:T(["checkout-shipping-methods",t]),"data-testid":"checkout-shipping-methods",children:[d&&o($,{className:"checkout-shipping-methods__title",node:d}),o("div",{className:T(["checkout-shipping-methods__content"]),children:o("div",{className:T(["checkout-shipping-methods__options",["checkout-shipping-methods__options--busy",n],["checkout-shipping-methods__options--toggleButton",m==="ToggleButton"]]),"data-testid":"checkout-shipping-methods-options",children:a.length===0?o(Qe,{"data-testid":"checkout-shipping-methods-empty",icon:o(fe,{source:no}),message:o("p",{children:W.EmptyState})}):a.map(B=>o(po,{UIComponentType:m,busy:n,isSelected:(s==null?void 0:s.value)===B.value,method:B,slot:c,onSelectionChange:r},B.value))})}),H&&o("div",{ref:O,className:"checkout-shipping-methods__error","data-testid":"checkout-shipping-methods-alert",children:o(ye,{heading:_,type:"error",variant:"primary",onDismiss:A})})]})},Wo=Z(fo,ho),go=()=>o(X,{className:"checkout-terms-and-conditions-skeleton","data-testid":"checkout-terms-and-conditions-skeleton",children:o(b,{fullWidth:!0,size:"small",variant:"row"})}),_o=({className:t,agreements:n,error:r,...a})=>o("div",{className:"checkout-terms-and-conditions","data-testid":"checkout-terms-and-conditions",children:p("form",{...a,noValidate:!0,className:T(["checkout-terms-and-conditions__form",t]),"data-testid":"checkout-terms-and-conditions-form",name:"checkout-terms-and-conditions__form",children:[n&&o($,{className:T(["checkout-terms-and-conditions__agreements"]),"data-testid":"checkout-terms-and-conditions-agreements",node:n}),r&&o("div",{className:"checkout-terms-and-conditions__error","data-testid":"checkout-terms-and-conditions-error",children:r})]})}),zo=Z(_o,go);export{bo as A,yo as B,Co as E,Ro as L,wo as M,Do as O,Fo as P,Wo as S,zo as T,Uo as a,Ho as b,Po as c,yn as d,Io as e,Mo as f,Oo as g,xo as h};
3
+ import{classes as T,VComponent as $,getPriceFormatter as mn,Slot as hn}from"@dropins/tools/lib.js";import{useText as F,Text as fn}from"@dropins/tools/i18n.js";import{jsxs as f,jsx as o,Fragment as bt}from"@dropins/tools/preact-jsx-runtime.js";import{Header as pn,ToggleButton as qe,Skeleton as X,SkeletonRow as b,Checkbox as gn,InLineAlert as ye,Field as Ke,Input as Je,Card as _n,Icon as pe,Image as kn,IllustratedMessage as Qe,RadioButton as Ft,Price as fe,Button as Ht}from"@dropins/tools/components.js";import*as p from"@dropins/tools/preact-compat.js";import{useRef as En,useEffect as Tn}from"@dropins/tools/preact-compat.js";import{useRef as An,useEffect as vn,useMemo as Ln}from"@dropins/tools/preact-hooks.js";import{h as Sn}from"../api.js";function Nn(t){var k;if(!t)return[];const n=`${t.firstName} ${t.lastName}`.trim(),r=((k=t.street)==null?void 0:k[0])??"",a=t.city??"",s=t.region||"",c=t.postcode??"",d=t.countryCode??"";let m="";a&&s?m=`${a}, ${s}`:a?m=a:s&&(m=s);let _=m;c&&(_=m?`${m} ${c}`:c);let A=_;return d&&(A=_?`${_}, ${d}`:d),[n,r,A]}const yt=({title:t,address:n,selected:r,busy:a,onChange:s})=>{const[c,d,m]=Nn(n);return o("div",{className:"checkout-address-validation__option",children:o(qe,{busy:a,className:"checkout-address-validation__radio",label:f("div",{children:[o("div",{className:"checkout-address-validation__option-title",children:o("strong",{children:t})}),c&&o("div",{children:c}),d&&o("div",{children:d}),m&&o("div",{children:m})]}),name:"address-validation-choice",selected:r,value:t,onChange:s})})},bo=({busy:t=!1,className:n,currentAddress:r,onSelectionChange:a,selection:s,suggestedAddress:c})=>{const d=!!c,m=F({title:"Checkout.AddressValidation.title",subtitle:"Checkout.AddressValidation.subtitle",suggestedAddress:"Checkout.AddressValidation.suggestedAddress",originalAddress:"Checkout.AddressValidation.originalAddress"});return f("div",{className:T(["checkout-address-validation",n]),children:[o(pn,{className:"checkout-address-validation__title",divider:!1,title:m.title}),o("div",{className:"checkout-address-validation__subtitle",children:m.subtitle}),f("div",{className:T(["checkout-address-validation__options",t&&"checkout-address-validation__options--busy"]),children:[d&&o(yt,{address:c,busy:t,selected:s==="suggested",title:m.suggestedAddress,onChange:()=>a("suggested")}),o(yt,{address:r,busy:t,selected:s==="original",title:m.originalAddress,onChange:()=>a("original")})]})]})},bn=()=>o(X,{className:"bill-to-shipping-address__skeleton","data-testid":"bill-to-shipping-skeleton",children:o(b,{size:"small",variant:"row"})});function Z(t,n){return function(a){const{initialized:s=!0,visible:c=!0,...d}=a;return f("div",{className:"conditional-wrapper",children:[c&&!s&&o(n,{}),c&&s&&o(t,{...d})]})}}const yn=t=>t.reduce((r,a)=>{if(!a)return r;if(typeof a=="string"&&(r+=` ${a}`),Array.isArray(a)){const[s,c]=a;s&&c&&(r+=` ${s}`)}return r},"").trim(),Cn=({className:t,checked:n,disabled:r,error:a=null,onChange:s=()=>{},onDismissError:c=()=>{}})=>{const d=F({title:"Checkout.BillToShippingAddress.title"}),m=a!==null,_=A=>{const k=A.target;s==null||s(k.checked)};return f("div",{className:"checkout-bill-to-shipping-address",children:[o(gn,{checked:n,className:yn(["checkout-bill-to-shipping-address__checkbox",t]),"data-testid":"bill-to-shipping-checkbox",disabled:r,label:d.title,name:"checkout-bill-to-shipping-address__checkbox",onChange:_}),m&&o("div",{className:"checkout-bill-to-shipping-address__error","data-testid":"checkout-bill-to-shipping-address-alert",children:o(ye,{heading:a,type:"error",variant:"primary",onDismiss:c})})]})},yo=Z(Cn,bn),On=()=>o(X,{"data-testid":"estimate-shipping-skeleton",children:o(b,{size:"xsmall"})}),Rn=({label:t,price:n,priceExclTax:r,taxExcluded:a=!1,taxIncluded:s=!1})=>{const c=F({withTaxes:"Checkout.EstimateShipping.withTaxes",withoutTaxes:"Checkout.EstimateShipping.withoutTaxes"});return f("div",{className:"checkout-estimate-shipping","data-testid":"estimate-shipping",children:[o($,{className:"checkout-estimate-shipping__label",node:t}),o($,{className:"checkout-estimate-shipping__price",node:n}),s&&o("span",{className:T(["checkout-estimate-shipping__caption"]),"data-testid":"shipping-tax-included",children:c.withTaxes}),a&&f("span",{className:T(["checkout-estimate-shipping__caption"]),"data-testid":"shipping-tax-included-excluded",children:[r," ",c.withoutTaxes]})]})},Co=Z(Rn,On),Mn=({value:t,error:n,hint:r,onChange:a,onBlur:s,onInvalid:c})=>{const d=F({LoginFormLabel:"Checkout.LoginForm.ariaLabel",LoginFormFloatingLabel:"Checkout.LoginForm.floatingLabel",LoginFormPlaceholder:"Checkout.LoginForm.placeholder"});return o(Ke,{error:n,hint:r,children:o(Je,{"aria-label":d.LoginFormLabel,"aria-required":!0,autocomplete:"email",floatingLabel:d.LoginFormFloatingLabel,id:"customer-email",name:"customer-email",placeholder:d.LoginFormPlaceholder,required:!0,type:"email",value:t,onBlur:s,onChange:a,onInvalid:c})})},Oo=({onClick:t})=>{const n=F({account:"Checkout.LoginForm.account",signIn:"Checkout.LoginForm.signIn"});return f("div",{className:"checkout-login-form__sign-in",children:[n.account,o("a",{className:"checkout-login-form__link","data-testid":"sign-in-link",href:"#",rel:"noreferrer",target:"_blank",onClick:r=>{r.preventDefault(),t(r)},children:n.signIn})]})},wn=()=>f(X,{"data-testid":"login-form-skeleton",children:[o(b,{fullWidth:!0,variant:"heading"}),o(b,{fullWidth:!0,size:"medium"})]}),In=({className:t,customer:n,email:r,error:a,headingContent:s,hint:c,name:d,onEmailBlur:m,onEmailChange:_,onEmailInvalid:A,preferences:k,title:W,...H})=>f("div",{className:"checkout-login-form","data-testid":"checkout-login-form",children:[f("div",{className:"checkout-login-form__heading",children:[W&&o($,{className:"checkout-login-form__title",node:W}),s&&o($,{className:"checkout-login-form__heading-label",node:s})]}),n?f("div",{className:"checkout-login-form__customer-details",children:[o("div",{className:"checkout-login-form__customer-name",children:`${n.firstName} ${n.lastName}`}),o("div",{className:"checkout-login-form__customer-email",children:n.email})]}):o("div",{className:"checkout-login-form__content",children:f("form",{...H,noValidate:!0,className:T(["dropin-login-form__form",t]),name:d,children:[o("button",{disabled:!0,"aria-hidden":"true",style:"display: none",type:"submit"}),o(Mn,{error:a,hint:c,value:r,onBlur:m,onChange:_,onInvalid:A}),k&&o($,{className:"checkout-login-form__preferences",node:k})]})})]}),Ro=Z(In,wn),Mo=({onClick:t})=>{const n=F({switch:"Checkout.LoginForm.switch",signOut:"Checkout.LoginForm.signOut"});return f("p",{className:"checkout-login-form__sign-out",children:[n.switch,o("a",{className:"checkout-login-form__link",href:"#",rel:"noreferrer",target:"_blank",onClick:r=>{r.preventDefault(),t==null||t(r)},children:n.signOut})]})};/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Ut,setPrototypeOf:Ct,isFrozen:Dn,getPrototypeOf:xn,getOwnPropertyDescriptor:Pn}=Object;let{freeze:I,seal:P,create:Wt}=Object,{apply:Xe,construct:Ze}=typeof Reflect<"u"&&Reflect;I||(I=function(n){return n});P||(P=function(n){return n});Xe||(Xe=function(n,r,a){return n.apply(r,a)});Ze||(Ze=function(n,r){return new n(...r)});const Se=D(Array.prototype.forEach),Fn=D(Array.prototype.lastIndexOf),Ot=D(Array.prototype.pop),le=D(Array.prototype.push),Hn=D(Array.prototype.splice),be=D(String.prototype.toLowerCase),Ve=D(String.prototype.toString),Rt=D(String.prototype.match),ue=D(String.prototype.replace),Un=D(String.prototype.indexOf),Wn=D(String.prototype.trim),U=D(Object.prototype.hasOwnProperty),w=D(RegExp.prototype.test),de=zn(TypeError);function D(t){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return Xe(t,n,a)}}function zn(t){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ze(t,r)}}function h(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:be;Ct&&Ct(t,null);let a=n.length;for(;a--;){let s=n[a];if(typeof s=="string"){const c=r(s);c!==s&&(Dn(n)||(n[a]=c),s=c)}t[s]=!0}return t}function Bn(t){for(let n=0;n<t.length;n++)U(t,n)||(t[n]=null);return t}function Y(t){const n=Wt(null);for(const[r,a]of Ut(t))U(t,r)&&(Array.isArray(a)?n[r]=Bn(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=Y(a):n[r]=a);return n}function me(t,n){for(;t!==null;){const a=Pn(t,n);if(a){if(a.get)return D(a.get);if(typeof a.value=="function")return D(a.value)}t=xn(t)}function r(){return null}return r}const Mt=I(["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"]),Ge=I(["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"]),je=I(["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"]),Vn=I(["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"]),Ye=I(["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"]),Gn=I(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),wt=I(["#text"]),It=I(["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"]),$e=I(["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"]),Dt=I(["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"]),Ne=I(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jn=P(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yn=P(/<%[\w\W]*|[\w\W]*%>/gm),$n=P(/\$\{[\w\W]*/gm),Xn=P(/^data-[\-\w.\u00B7-\uFFFF]+$/),Zn=P(/^aria-[\-\w]+$/),zt=P(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qn=P(/^(?:\w+script|data):/i),Kn=P(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bt=P(/^html$/i),Jn=P(/^[a-z][.\w]*(-[.\w]+)+$/i);var xt=Object.freeze({__proto__:null,ARIA_ATTR:Zn,ATTR_WHITESPACE:Kn,CUSTOM_ELEMENT:Jn,DATA_ATTR:Xn,DOCTYPE_NAME:Bt,ERB_EXPR:Yn,IS_ALLOWED_URI:zt,IS_SCRIPT_OR_DATA:qn,MUSTACHE_EXPR:jn,TMPLIT_EXPR:$n});const he={element:1,text:3,progressingInstruction:7,comment:8,document:9},Qn=function(){return typeof window>"u"?null:window},eo=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(a=r.getAttribute(s));const c="dompurify"+(a?"#"+a:"");try{return n.createPolicy(c,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Pt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qn();const n=u=>Vt(u);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==he.document||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const a=r,s=a.currentScript,{DocumentFragment:c,HTMLTemplateElement:d,Node:m,Element:_,NodeFilter:A,NamedNodeMap:k=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:W,DOMParser:H,trustedTypes:O}=t,B=_.prototype,jt=me(B,"cloneNode"),Yt=me(B,"remove"),$t=me(B,"nextSibling"),Xt=me(B,"childNodes"),ge=me(B,"parentNode");if(typeof d=="function"){const u=r.createElement("template");u.content&&u.content.ownerDocument&&(r=u.content.ownerDocument)}let R,re="";const{implementation:Ce,createNodeIterator:Zt,createDocumentFragment:qt,getElementsByTagName:Kt}=r,{importNode:Jt}=a;let M=Pt();n.isSupported=typeof Ut=="function"&&typeof ge=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Oe,ERB_EXPR:Re,TMPLIT_EXPR:Me,DATA_ATTR:Qt,ARIA_ATTR:en,IS_SCRIPT_OR_DATA:tn,ATTR_WHITESPACE:tt,CUSTOM_ELEMENT:nn}=xt;let{IS_ALLOWED_URI:nt}=xt,L=null;const ot=h({},[...Mt,...Ge,...je,...Ye,...wt]);let N=null;const rt=h({},[...It,...$e,...Dt,...Ne]);let E=Object.seal(Wt(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}})),ie=null,we=null,it=!0,Ie=!0,at=!1,st=!0,K=!1,_e=!0,q=!1,De=!1,xe=!1,J=!1,ke=!1,Ee=!1,ct=!0,lt=!1;const on="user-content-";let Pe=!0,ae=!1,Q={},ee=null;const ut=h({},["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 dt=null;const mt=h({},["audio","video","img","source","image","track"]);let Fe=null;const ht=h({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Te="http://www.w3.org/1998/Math/MathML",Ae="http://www.w3.org/2000/svg",V="http://www.w3.org/1999/xhtml";let te=V,He=!1,Ue=null;const rn=h({},[Te,Ae,V],Ve);let ve=h({},["mi","mo","mn","ms","mtext"]),Le=h({},["annotation-xml"]);const an=h({},["title","style","font","a","script"]);let se=null;const sn=["application/xhtml+xml","text/html"],cn="text/html";let S=null,ne=null;const ln=r.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},We=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ne&&ne===e)){if((!e||typeof e!="object")&&(e={}),e=Y(e),se=sn.indexOf(e.PARSER_MEDIA_TYPE)===-1?cn:e.PARSER_MEDIA_TYPE,S=se==="application/xhtml+xml"?Ve:be,L=U(e,"ALLOWED_TAGS")?h({},e.ALLOWED_TAGS,S):ot,N=U(e,"ALLOWED_ATTR")?h({},e.ALLOWED_ATTR,S):rt,Ue=U(e,"ALLOWED_NAMESPACES")?h({},e.ALLOWED_NAMESPACES,Ve):rn,Fe=U(e,"ADD_URI_SAFE_ATTR")?h(Y(ht),e.ADD_URI_SAFE_ATTR,S):ht,dt=U(e,"ADD_DATA_URI_TAGS")?h(Y(mt),e.ADD_DATA_URI_TAGS,S):mt,ee=U(e,"FORBID_CONTENTS")?h({},e.FORBID_CONTENTS,S):ut,ie=U(e,"FORBID_TAGS")?h({},e.FORBID_TAGS,S):Y({}),we=U(e,"FORBID_ATTR")?h({},e.FORBID_ATTR,S):Y({}),Q=U(e,"USE_PROFILES")?e.USE_PROFILES:!1,it=e.ALLOW_ARIA_ATTR!==!1,Ie=e.ALLOW_DATA_ATTR!==!1,at=e.ALLOW_UNKNOWN_PROTOCOLS||!1,st=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=e.SAFE_FOR_TEMPLATES||!1,_e=e.SAFE_FOR_XML!==!1,q=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Ee=e.RETURN_TRUSTED_TYPE||!1,xe=e.FORCE_BODY||!1,ct=e.SANITIZE_DOM!==!1,lt=e.SANITIZE_NAMED_PROPS||!1,Pe=e.KEEP_CONTENT!==!1,ae=e.IN_PLACE||!1,nt=e.ALLOWED_URI_REGEXP||zt,te=e.NAMESPACE||V,ve=e.MATHML_TEXT_INTEGRATION_POINTS||ve,Le=e.HTML_INTEGRATION_POINTS||Le,E=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(E.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(E.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(E.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(Ie=!1),ke&&(J=!0),Q&&(L=h({},wt),N=[],Q.html===!0&&(h(L,Mt),h(N,It)),Q.svg===!0&&(h(L,Ge),h(N,$e),h(N,Ne)),Q.svgFilters===!0&&(h(L,je),h(N,$e),h(N,Ne)),Q.mathMl===!0&&(h(L,Ye),h(N,Dt),h(N,Ne))),e.ADD_TAGS&&(L===ot&&(L=Y(L)),h(L,e.ADD_TAGS,S)),e.ADD_ATTR&&(N===rt&&(N=Y(N)),h(N,e.ADD_ATTR,S)),e.ADD_URI_SAFE_ATTR&&h(Fe,e.ADD_URI_SAFE_ATTR,S),e.FORBID_CONTENTS&&(ee===ut&&(ee=Y(ee)),h(ee,e.FORBID_CONTENTS,S)),Pe&&(L["#text"]=!0),q&&h(L,["html","head","body"]),L.table&&(h(L,["tbody"]),delete ie.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=e.TRUSTED_TYPES_POLICY,re=R.createHTML("")}else R===void 0&&(R=eo(O,s)),R!==null&&typeof re=="string"&&(re=R.createHTML(""));I&&I(e),ne=e}},pt=h({},[...Ge,...je,...Vn]),gt=h({},[...Ye,...Gn]),un=function(e){let i=ge(e);(!i||!i.tagName)&&(i={namespaceURI:te,tagName:"template"});const l=be(e.tagName),g=be(i.tagName);return Ue[e.namespaceURI]?e.namespaceURI===Ae?i.namespaceURI===V?l==="svg":i.namespaceURI===Te?l==="svg"&&(g==="annotation-xml"||ve[g]):!!pt[l]:e.namespaceURI===Te?i.namespaceURI===V?l==="math":i.namespaceURI===Ae?l==="math"&&Le[g]:!!gt[l]:e.namespaceURI===V?i.namespaceURI===Ae&&!Le[g]||i.namespaceURI===Te&&!ve[g]?!1:!gt[l]&&(an[l]||!pt[l]):!!(se==="application/xhtml+xml"&&Ue[e.namespaceURI]):!1},z=function(e){le(n.removed,{element:e});try{ge(e).removeChild(e)}catch{Yt(e)}},oe=function(e,i){try{le(n.removed,{attribute:i.getAttributeNode(e),from:i})}catch{le(n.removed,{attribute:null,from:i})}if(i.removeAttribute(e),e==="is")if(J||ke)try{z(i)}catch{}else try{i.setAttribute(e,"")}catch{}},_t=function(e){let i=null,l=null;if(xe)e="<remove></remove>"+e;else{const v=Rt(e,/^[\r\n\t ]+/);l=v&&v[0]}se==="application/xhtml+xml"&&te===V&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const g=R?R.createHTML(e):e;if(te===V)try{i=new H().parseFromString(g,se)}catch{}if(!i||!i.documentElement){i=Ce.createDocument(te,"template",null);try{i.documentElement.innerHTML=He?re:g}catch{}}const y=i.body||i.documentElement;return e&&l&&y.insertBefore(r.createTextNode(l),y.childNodes[0]||null),te===V?Kt.call(i,q?"html":"body")[0]:q?i.documentElement:y},kt=function(e){return Zt.call(e.ownerDocument||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT|A.SHOW_PROCESSING_INSTRUCTION|A.SHOW_CDATA_SECTION,null)},ze=function(e){return e instanceof W&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof k)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Et=function(e){return typeof m=="function"&&e instanceof m};function G(u,e,i){Se(u,l=>{l.call(n,e,i,ne)})}const Tt=function(e){let i=null;if(G(M.beforeSanitizeElements,e,null),ze(e))return z(e),!0;const l=S(e.nodeName);if(G(M.uponSanitizeElement,e,{tagName:l,allowedTags:L}),_e&&e.hasChildNodes()&&!Et(e.firstElementChild)&&w(/<[/\w!]/g,e.innerHTML)&&w(/<[/\w!]/g,e.textContent)||e.nodeType===he.progressingInstruction||_e&&e.nodeType===he.comment&&w(/<[/\w]/g,e.data))return z(e),!0;if(!L[l]||ie[l]){if(!ie[l]&&vt(l)&&(E.tagNameCheck instanceof RegExp&&w(E.tagNameCheck,l)||E.tagNameCheck instanceof Function&&E.tagNameCheck(l)))return!1;if(Pe&&!ee[l]){const g=ge(e)||e.parentNode,y=Xt(e)||e.childNodes;if(y&&g){const v=y.length;for(let x=v-1;x>=0;--x){const j=jt(y[x],!0);j.__removalCount=(e.__removalCount||0)+1,g.insertBefore(j,$t(e))}}}return z(e),!0}return e instanceof _&&!un(e)||(l==="noscript"||l==="noembed"||l==="noframes")&&w(/<\/no(script|embed|frames)/i,e.innerHTML)?(z(e),!0):(K&&e.nodeType===he.text&&(i=e.textContent,Se([Oe,Re,Me],g=>{i=ue(i,g," ")}),e.textContent!==i&&(le(n.removed,{element:e.cloneNode()}),e.textContent=i)),G(M.afterSanitizeElements,e,null),!1)},At=function(e,i,l){if(ct&&(i==="id"||i==="name")&&(l in r||l in ln))return!1;if(!(Ie&&!we[i]&&w(Qt,i))){if(!(it&&w(en,i))){if(!N[i]||we[i]){if(!(vt(e)&&(E.tagNameCheck instanceof RegExp&&w(E.tagNameCheck,e)||E.tagNameCheck instanceof Function&&E.tagNameCheck(e))&&(E.attributeNameCheck instanceof RegExp&&w(E.attributeNameCheck,i)||E.attributeNameCheck instanceof Function&&E.attributeNameCheck(i))||i==="is"&&E.allowCustomizedBuiltInElements&&(E.tagNameCheck instanceof RegExp&&w(E.tagNameCheck,l)||E.tagNameCheck instanceof Function&&E.tagNameCheck(l))))return!1}else if(!Fe[i]){if(!w(nt,ue(l,tt,""))){if(!((i==="src"||i==="xlink:href"||i==="href")&&e!=="script"&&Un(l,"data:")===0&&dt[e])){if(!(at&&!w(tn,ue(l,tt,"")))){if(l)return!1}}}}}}return!0},vt=function(e){return e!=="annotation-xml"&&Rt(e,nn)},Lt=function(e){G(M.beforeSanitizeAttributes,e,null);const{attributes:i}=e;if(!i||ze(e))return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0};let g=i.length;for(;g--;){const y=i[g],{name:v,namespaceURI:x,value:j}=y,ce=S(v),Be=j;let C=v==="value"?Be:Wn(Be);if(l.attrName=ce,l.attrValue=C,l.keepAttr=!0,l.forceKeepAttr=void 0,G(M.uponSanitizeAttribute,e,l),C=l.attrValue,lt&&(ce==="id"||ce==="name")&&(oe(v,e),C=on+C),_e&&w(/((--!?|])>)|<\/(style|title)/i,C)){oe(v,e);continue}if(l.forceKeepAttr)continue;if(!l.keepAttr){oe(v,e);continue}if(!st&&w(/\/>/i,C)){oe(v,e);continue}K&&Se([Oe,Re,Me],Nt=>{C=ue(C,Nt," ")});const St=S(e.nodeName);if(!At(St,ce,C)){oe(v,e);continue}if(R&&typeof O=="object"&&typeof O.getAttributeType=="function"&&!x)switch(O.getAttributeType(St,ce)){case"TrustedHTML":{C=R.createHTML(C);break}case"TrustedScriptURL":{C=R.createScriptURL(C);break}}if(C!==Be)try{x?e.setAttributeNS(x,v,C):e.setAttribute(v,C),ze(e)?z(e):Ot(n.removed)}catch{oe(v,e)}}G(M.afterSanitizeAttributes,e,null)},dn=function u(e){let i=null;const l=kt(e);for(G(M.beforeSanitizeShadowDOM,e,null);i=l.nextNode();)G(M.uponSanitizeShadowNode,i,null),Tt(i),Lt(i),i.content instanceof c&&u(i.content);G(M.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(u){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,l=null,g=null,y=null;if(He=!u,He&&(u="<!-->"),typeof u!="string"&&!Et(u))if(typeof u.toString=="function"){if(u=u.toString(),typeof u!="string")throw de("dirty is not a string, aborting")}else throw de("toString is not a function");if(!n.isSupported)return u;if(De||We(e),n.removed=[],typeof u=="string"&&(ae=!1),ae){if(u.nodeName){const j=S(u.nodeName);if(!L[j]||ie[j])throw de("root node is forbidden and cannot be sanitized in-place")}}else if(u instanceof m)i=_t("<!---->"),l=i.ownerDocument.importNode(u,!0),l.nodeType===he.element&&l.nodeName==="BODY"||l.nodeName==="HTML"?i=l:i.appendChild(l);else{if(!J&&!K&&!q&&u.indexOf("<")===-1)return R&&Ee?R.createHTML(u):u;if(i=_t(u),!i)return J?null:Ee?re:""}i&&xe&&z(i.firstChild);const v=kt(ae?u:i);for(;g=v.nextNode();)Tt(g),Lt(g),g.content instanceof c&&dn(g.content);if(ae)return u;if(J){if(ke)for(y=qt.call(i.ownerDocument);i.firstChild;)y.appendChild(i.firstChild);else y=i;return(N.shadowroot||N.shadowrootmode)&&(y=Jt.call(a,y,!0)),y}let x=q?i.outerHTML:i.innerHTML;return q&&L["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(Bt,i.ownerDocument.doctype.name)&&(x="<!DOCTYPE "+i.ownerDocument.doctype.name+`>
4
+ `+x),K&&Se([Oe,Re,Me],j=>{x=ue(x,j," ")}),R&&Ee?R.createHTML(x):x},n.setConfig=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};We(u),De=!0},n.clearConfig=function(){ne=null,De=!1},n.isValidAttribute=function(u,e,i){ne||We({});const l=S(u),g=S(e);return At(l,g,i)},n.addHook=function(u,e){typeof e=="function"&&le(M[u],e)},n.removeHook=function(u,e){if(e!==void 0){const i=Fn(M[u],e);return i===-1?void 0:Hn(M[u],i,1)[0]}return Ot(M[u])},n.removeHooks=function(u){M[u]=[]},n.removeAllHooks=function(){M=Pt()},n}var to=Vt();const wo=({html:t})=>{const n=to.sanitize(t,{ADD_ATTR:["target"]});return n===""?null:o("span",{dangerouslySetInnerHTML:{__html:n}})},no=t=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.47266 4.90002H15.1851V10.9645H21.2495L23 12.715V17.6124H20.073",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76151 16.7898C9.76151 18.0525 8.72845 19.076 7.46582 19.076C6.20318 19.076 5.17969 18.0429 5.17969 16.7803C5.17969 15.5176 6.20318 14.4941 7.46582 14.4941C8.72845 14.4941 9.75195 15.5176 9.76151 16.7803C9.76151 16.7803 9.76151 16.7803 9.76151 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8726 16.7898C19.8726 18.062 18.8491 19.0855 17.5769 19.0855C16.3047 19.0855 15.2812 18.062 15.2812 16.7898C15.2812 15.5176 16.3047 14.4941 17.5769 14.4941C18.8491 14.4941 19.8726 15.5176 19.8726 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Io=t=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},p.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),Gt=t=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},p.createElement("g",{clipPath:"url(#clip0_4797_15331)"},p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.25 20.91L1.5 17.55V6.51996L10.25 9.92996V20.91Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.24023 4.64001L14.9902 8.06001V11.42",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),p.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19 13.31L15.5 19.37H22.5L19 13.31Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),p.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19.0202 17.11H18.9802L18.9502 15.56H19.0502L19.0202 17.11ZM18.9602 18.29V18.06H19.0502V18.29H18.9602Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19 12.16V6.51996L10.25 9.92996V20.91L14.27 19.37L14.4 19.32",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:1}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.51999L10.25 3.04999L19 6.51999L10.25 9.92999L1.5 6.51999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_4797_15331"},p.createElement("rect",{width:22,height:18.86,fill:"white",transform:"translate(1 2.54999)"})))),oo=t=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Do=({className:t,items:n,onRemoveOutOfStock:r,routeCart:a,...s})=>{const c=F({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return f(_n,{className:T(["checkout-out-of-stock",t]),"data-testid":"checkout-out-of-stock",variant:"secondary",...s,children:[f("h4",{className:"checkout-out-of-stock__title",children:[o(pe,{size:"16",source:Gt,stroke:"1"}),c.title]}),o("p",{className:"checkout-out-of-stock__message",children:c.message}),o("ol",{className:"checkout-out-of-stock__items",children:n.map(d=>o("li",{className:"checkout-out-of-stock__item","data-testid":"out-of-stock-item",children:o(kn,{alt:d.image.alt,height:"100",loading:"eager",params:{width:100},src:d.image.src,width:"100"})},d.sku))}),f("div",{className:"checkout-out-of-stock__actions",children:[a&&o("a",{className:"checkout-out-of-stock__action","data-testid":"review-cart",href:a,children:c.reviewCart}),r&&o("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:r,children:c.removeOutOfStock})]})]})},ro=()=>f(X,{"data-testid":"payment-methods-skeleton",children:[o(b,{size:"medium",variant:"heading"}),o(b,{size:"medium",variant:"empty"}),o(b,{fullWidth:!0,size:"xlarge"}),o(b,{fullWidth:!0,size:"xlarge"})]});function io(t){return t.closest("[data-dropin-container]")}function et(t){t.focus(),document.activeElement!==t&&t.scrollIntoView({behavior:"smooth"})}function xo(t){const n=io(t);n&&et(n)}const ao=({UIComponentType:t="ToggleButton",busy:n,code:r,icon:a,onSelectionChange:s,selected:c,title:d})=>{const m={busy:n,className:"checkout-payment-methods__method",label:d,name:"payment-method",onChange:()=>s({code:r,title:d}),value:r};return t==="ToggleButton"?o(qe,{...m,icon:a?o(pe,{source:a}):void 0,selected:c}):o(Ft,{...m,checked:c,icon:a??void 0})},so=({className:t,error:n=null,busy:r=!1,onDismissError:a,onSelectionChange:s=()=>{},options:c,paymentMethodContent:d,selection:m,title:_,UIComponentType:A})=>{const k=F({EmptyState:"Checkout.PaymentMethods.emptyState"}),W=n!==null,H=En(null);return Tn(()=>{W&&H.current&&et(H.current)},[W]),f("div",{className:T(["checkout-payment-methods",t]),"data-testid":"checkout-payment-methods",children:[_&&o($,{className:"checkout-payment-methods__title",node:_}),!r&&c.length===0&&o(Qe,{"data-testid":"checkout-payment-methods-empty",icon:o(pe,{source:oo}),message:o("p",{children:k.EmptyState})}),f("div",{className:T(["checkout-payment-methods__wrapper",["checkout-payment-methods__wrapper--busy",r]]),"data-testid":"checkout-payment-methods-wrapper",children:[o("div",{className:T(["checkout-payment-methods__methods",["checkout-payment-methods--full-width",c.length%2!==0]]),children:c==null?void 0:c.map(O=>o(ao,{UIComponentType:A,busy:r,code:O.code,icon:O.icon,selected:(m==null?void 0:m.code)===O.code,title:O.displayLabel??!0?O.title:"",onSelectionChange:s},O.code))}),d&&o("div",{className:"checkout-payment-methods__content",children:d})]}),W&&o("div",{ref:H,className:"checkout-payment-methods__error","data-testid":"checkout-payment-methods-alert",children:o(ye,{heading:n,type:"error",variant:"primary",onDismiss:a})})]})},Po=Z(so,ro),co=()=>f(X,{"data-testid":"payment-on-account-skeleton",children:[o(b,{fullWidth:!0,size:"medium"}),o(b,{fullWidth:!0,size:"medium"})]}),lo=(t,n)=>{if(!(t!=null&&t.availableCredit)||!n)return null;const r=t.availableCredit.value,s=n.value-r;return s<=0?null:{value:s,currency:t.availableCredit.currency}},uo=({className:t,referenceNumber:n="",onReferenceNumberChange:r,onReferenceNumberBlur:a,companyCredit:s=null,totalAmount:c=null,...d})=>{const m=lo(s,c),_=s==null?void 0:s.availableCredit,A=mn({currency:(c==null?void 0:c.currency)??""}),k=F({referenceNumberLabel:"Checkout.PaymentOnAccount.referenceNumberLabel",referenceNumberPlaceholder:"Checkout.PaymentOnAccount.referenceNumberPlaceholder",referenceNumberHint:"Checkout.PaymentOnAccount.referenceNumberHint",availableCreditLabel:"Checkout.PaymentOnAccount.availableCreditLabel",exceedLimitError:"Checkout.PaymentOnAccount.exceedLimitError",exceedLimitWarning:m?o(fn,{fields:{creditLimit:A.format((_==null?void 0:_.value)??0),exceededAmount:A.format((m==null?void 0:m.value)??0)},id:"Checkout.PaymentOnAccount.exceedLimitWarning"}):""});return o("div",{className:"checkout-payment-on-account","data-testid":"checkout-payment-on-account",children:f("form",{...d,noValidate:!0,className:T(["checkout-payment-on-account__form",t]),"data-testid":"checkout-payment-on-account-form",name:"checkout-payment-on-account__form",children:[s&&s.availableCredit&&f("div",{className:"checkout-payment-on-account__credit","data-testid":"checkout-payment-on-account-credit",children:[o("span",{className:"checkout-payment-on-account__credit-label",children:k.availableCreditLabel}),o("span",{className:"checkout-payment-on-account__credit-amount",children:o(fe,{amount:s==null?void 0:s.availableCredit.value,currency:s==null?void 0:s.availableCredit.currency})})]}),o(Ke,{hint:k.referenceNumberHint,children:o(Je,{"aria-label":k.referenceNumberLabel,floatingLabel:k.referenceNumberLabel,id:"reference-number",name:"reference-number",placeholder:k.referenceNumberPlaceholder,type:"text",value:n,onBlur:a,onChange:r})}),m&&o("div",{className:"checkout-payment-on-account__exceed-message","data-testid":"checkout-payment-on-account-exceed-message",children:o(ye,{heading:s!=null&&s.exceedLimit?k.exceedLimitWarning:k.exceedLimitError,type:s!=null&&s.exceedLimit?"warning":"error",variant:"primary"})})]})})},Fo=Z(uo,co),mo=()=>f(X,{"data-testid":"place-order-skeleton",children:[o(b,{size:"small",variant:"empty"}),o(b,{size:"small"})]}),ho=({children:t,className:n,disabled:r=!1,onClick:a})=>o("div",{className:T(["checkout-place-order",n]),children:o(Ht,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:r,size:"medium",type:"button",variant:"primary",onClick:a,children:t},"placeOrder")}),Ho=Z(ho,mo),Uo=({className:t,error:n="",referenceNumber:r="",onReferenceNumberBlur:a,onReferenceNumberChange:s,onInvalidReferenceNumber:c,...d})=>{const m=F({refNumberHint:"Checkout.PurchaseOrder.referenceNumberHint",refNumberLabel:"Checkout.PurchaseOrder.referenceNumberLabel",refNumberPlaceholder:"Checkout.PurchaseOrder.referenceNumberPlaceholder"});return o("div",{className:"checkout-purchase-order","data-testid":"checkout-purchase-order",children:o("form",{...d,noValidate:!0,className:T(["checkout-purchase-order__form",t]),"data-testid":"checkout-purchase-order-form",children:o(Ke,{error:n,hint:m.refNumberHint||void 0,children:o(Je,{"aria-required":"true",floatingLabel:`${m.refNumberLabel} *`,id:"reference-number",name:"reference-number",pattern:Sn.NOT_EMPTY,placeholder:m.refNumberPlaceholder,required:!0,type:"text",value:r,onBlur:a,onChange:s,onInvalid:c})})})})},Wo=({className:t,contactSupport:n,errorMessage:r,onClick:a,errorMessageRef:s})=>{const c=F({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"}),d=r!==""?r:c.Title;return o(Qe,{action:o(Ht,{className:T(["checkout-server-error__button"]),name:"server-error-button",onClick:a,children:c.Button}),"aria-describedby":"checkout-server-error__message","aria-invalid":"true","aria-live":"polite",className:T(["checkout-server-error",t]),"data-testid":"checkout-server-error",heading:d,icon:o(pe,{className:T(["checkout-server-error__icon"]),source:Gt}),message:f("p",{ref:s,"data-testid":"checkout-server-error-message",id:T(["checkout-server-error__message"]),children:[c.Message,o("br",{}),o("span",{children:n??c.ContactSupport})]})})},fo=()=>f(X,{"data-testid":"shipping-methods-skeleton",children:[o(b,{size:"small",variant:"heading"}),o(b,{size:"small",variant:"empty"}),o(b,{fullWidth:!0,size:"medium"}),o(b,{fullWidth:!0,size:"medium"})]}),po=({method:t,isSelected:n,busy:r,UIComponentType:a,onSelectionChange:s,slot:c})=>{const d=Ln(()=>({method:t,isSelected:n,busy:r,onSelect:()=>s(t)}),[t,n,r,s]),m={busy:r,className:"checkout-shipping-methods__method",name:"shipping-method",value:t.value,onChange:()=>s(t)},k=a==="RadioButton"?o(Ft,{...m,checked:n,"data-testid":"shipping-method-radioButton",description:t.title,disabled:r,id:t.value,label:f(bt,{children:[t.originalAmount&&o(fe,{amount:t.originalAmount.value,className:"checkout-shipping-methods__price--original",currency:t.originalAmount.currency,"data-testid":"shipping-method-original-price",variant:"strikethrough"}),o(fe,{amount:t.amount.value,className:"checkout-shipping-methods__price",currency:t.amount.currency})," ",o("span",{children:t.carrier.title})]})}):o(qe,{...m,"data-testid":"shipping-method-toggleButton",label:f(bt,{children:[o("span",{children:t.carrier.title}),f("div",{className:"checkout-shipping-methods__price-wrapper",children:[t.originalAmount&&o(fe,{amount:t.originalAmount.value,className:"checkout-shipping-methods__price--original",currency:t.originalAmount.currency,"data-testid":"shipping-method-original-price",variant:"strikethrough"}),o(fe,{amount:t.amount.value,className:"checkout-shipping-methods__price",currency:t.amount.currency})]})]}),selected:n});return o(hn,{context:d,name:`checkout-shipping-method-item-${t.value}`,slot:c,children:k})},go=({className:t,busy:n=!1,onSelectionChange:r=()=>{},options:a,selection:s,shippingMethodItemSlot:c,title:d,UIComponentType:m="RadioButton",error:_=null,onDismissError:A=()=>{},...k})=>{const W=F({EmptyState:"Checkout.ShippingMethods.emptyState"}),H=_!==null,O=An(null);return vn(()=>{H&&O.current&&et(O.current)},[H]),f("div",{...k,className:T(["checkout-shipping-methods",t]),"data-testid":"checkout-shipping-methods",children:[d&&o($,{className:"checkout-shipping-methods__title",node:d}),o("div",{className:T(["checkout-shipping-methods__content"]),children:o("div",{className:T(["checkout-shipping-methods__options",["checkout-shipping-methods__options--busy",n],["checkout-shipping-methods__options--toggleButton",m==="ToggleButton"]]),"data-testid":"checkout-shipping-methods-options",children:a.length===0?o(Qe,{"data-testid":"checkout-shipping-methods-empty",icon:o(pe,{source:no}),message:o("p",{children:W.EmptyState})}):a.map(B=>o(po,{UIComponentType:m,busy:n,isSelected:(s==null?void 0:s.value)===B.value,method:B,slot:c,onSelectionChange:r},B.value))})}),H&&o("div",{ref:O,className:"checkout-shipping-methods__error","data-testid":"checkout-shipping-methods-alert",children:o(ye,{heading:_,type:"error",variant:"primary",onDismiss:A})})]})},zo=Z(go,fo),_o=()=>o(X,{className:"checkout-terms-and-conditions-skeleton","data-testid":"checkout-terms-and-conditions-skeleton",children:o(b,{fullWidth:!0,size:"small",variant:"row"})}),ko=({className:t,agreements:n,error:r,...a})=>o("div",{className:"checkout-terms-and-conditions","data-testid":"checkout-terms-and-conditions",children:f("form",{...a,noValidate:!0,className:T(["checkout-terms-and-conditions__form",t]),"data-testid":"checkout-terms-and-conditions-form",name:"checkout-terms-and-conditions__form",children:[n&&o($,{className:T(["checkout-terms-and-conditions__agreements"]),"data-testid":"checkout-terms-and-conditions-agreements",node:n}),r&&o("div",{className:"checkout-terms-and-conditions__error","data-testid":"checkout-terms-and-conditions-error",children:r})]})}),Bo=Z(ko,_o);export{bo as A,yo as B,Co as E,Ro as L,wo as M,Do as O,Ho as P,zo as S,Bo as T,Wo as a,Uo as b,Fo as c,yn as d,Io as e,Mo as f,Oo as g,Po as h,xo as i,io as j,et as s};
5
5
  //# sourceMappingURL=components.js.map