sonner 1.4.32 → 1.4.41
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.
- package/dist/index.d.ts +7 -8
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";import s from"react";import An from"react-dom";var{entries:ke,setPrototypeOf:Re,isFrozen:Ze,getPrototypeOf:Je,getOwnPropertyDescriptor:Qe}=Object,{freeze:k,seal:X,create:Pe}=Object,{apply:le,construct:ce}=typeof Reflect!="undefined"&&Reflect;k||(k=function(n){return n});X||(X=function(n){return n});le||(le=function(n,t,r){return n.apply(t,r)});ce||(ce=function(n,t){return new n(...t)});var qt=F(Array.prototype.forEach),Ne=F(Array.prototype.pop),jt=F(Array.prototype.push),Qt=F(String.prototype.toLowerCase),oe=F(String.prototype.toString),De=F(String.prototype.match),$t=F(String.prototype.replace),tn=F(String.prototype.indexOf),en=F(String.prototype.trim),Q=F(Object.prototype.hasOwnProperty),B=F(RegExp.prototype.test),Vt=nn(TypeError);function F(i){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),h=1;h<t;h++)r[h-1]=arguments[h];return le(i,n,r)}}function nn(i){return function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return ce(i,t)}}function d(i,n){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qt;Re&&Re(i,null);let r=n.length;for(;r--;){let h=n[r];if(typeof h=="string"){let E=t(h);E!==h&&(Ze(n)||(n[r]=E),h=E)}i[h]=!0}return i}function on(i){for(let n=0;n<i.length;n++)Q(i,n)||(i[n]=null);return i}function Nt(i){let n=Pe(null);for(let[t,r]of ke(i))Q(i,t)&&(Array.isArray(r)?n[t]=on(r):r&&typeof r=="object"&&r.constructor===Object?n[t]=Nt(r):n[t]=r);return n}function Zt(i,n){for(;i!==null;){let r=Qe(i,n);if(r){if(r.get)return F(r.get);if(typeof r.value=="function")return F(r.value)}i=Je(i)}function t(){return null}return t}var Le=k(["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"]),re=k(["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"]),ae=k(["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"]),rn=k(["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"]),se=k(["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"]),an=k(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ie=k(["#text"]),Me=k(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),ie=k(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ce=k(["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"]),Jt=k(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sn=X(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ln=X(/<%[\w\W]*|[\w\W]*%>/gm),cn=X(/\${[\w\W]*}/gm),dn=X(/^data-[\-\w.\u00B7-\uFFFF]/),un=X(/^aria-[\-\w]+$/),He=X(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fn=X(/^(?:\w+script|data):/i),mn=X(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ue=X(/^html$/i),pn=X(/^[a-z][a-z\d]*(-[a-z\d]+)+$/i),Oe=Object.freeze({__proto__:null,MUSTACHE_EXPR:sn,ERB_EXPR:ln,TMPLIT_EXPR:cn,DATA_ATTR:dn,ARIA_ATTR:un,IS_ALLOWED_URI:He,IS_SCRIPT_OR_DATA:fn,ATTR_WHITESPACE:mn,DOCTYPE_NAME:Ue,CUSTOM_ELEMENT:pn}),hn=function(){return typeof window=="undefined"?null:window},gn=function(n,t){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let r=null,h="data-tt-policy-suffix";t&&t.hasAttribute(h)&&(r=t.getAttribute(h));let E="dompurify"+(r?"#"+r:"");try{return n.createPolicy(E,{createHTML(y){return y},createScriptURL(y){return y}})}catch(y){return console.warn("TrustedTypes policy "+E+" could not be created."),null}};function Be(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn(),n=l=>Be(l);if(n.version="3.0.10",n.removed=[],!i||!i.document||i.document.nodeType!==9)return n.isSupported=!1,n;let{document:t}=i,r=t,h=r.currentScript,{DocumentFragment:E,HTMLTemplateElement:y,Node:A,Element:T,NodeFilter:mt,NamedNodeMap:wt=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:Dt,DOMParser:Lt,trustedTypes:f}=i,st=T.prototype,Pt=Zt(st,"cloneNode"),Ht=Zt(st,"nextSibling"),Ut=Zt(st,"childNodes"),pt=Zt(st,"parentNode");if(typeof y=="function"){let l=t.createElement("template");l.content&&l.content.ownerDocument&&(t=l.content.ownerDocument)}let R,it="",{implementation:P,createNodeIterator:lt,createDocumentFragment:m,getElementsByTagName:z}=t,{importNode:Bt}=r,O={};n.isSupported=typeof ke=="function"&&typeof pt=="function"&&P&&P.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:N,ERB_EXPR:q,TMPLIT_EXPR:ht,DATA_ATTR:It,ARIA_ATTR:ct,IS_SCRIPT_OR_DATA:et,ATTR_WHITESPACE:xt,CUSTOM_ELEMENT:W}=Oe,{IS_ALLOWED_URI:nt}=Oe,_=null,b=d({},[...Le,...re,...ae,...se,...Ie]),u=null,D=d({},[...Me,...ie,...Ce,...Jt]),p=Object.seal(Pe(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}})),I=null,w=null,gt=!0,L=!0,Y=!1,Tt=!0,bt=!1,G=!1,Ft=!1,Mt=!1,ot=!1,Z=!1,vt=!1,dt=!0,zt=!1,te="user-content-",Ct=!0,yt=!1,Et={},rt=null,J=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Xt=null,Wt=d({},["audio","video","img","source","image","track"]),Ot=null,Yt=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_t="http://www.w3.org/1998/Math/MathML",At="http://www.w3.org/2000/svg",j="http://www.w3.org/1999/xhtml",ut=j,kt=!1,c=null,v=d({},[_t,At,j],oe),S=null,$=["application/xhtml+xml","text/html"],V="text/html",g=null,at=null,Kt=t.createElement("form"),me=function(e){return e instanceof RegExp||e instanceof Function},ee=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(at&&at===e)){if((!e||typeof e!="object")&&(e={}),e=Nt(e),S=$.indexOf(e.PARSER_MEDIA_TYPE)===-1?V:e.PARSER_MEDIA_TYPE,g=S==="application/xhtml+xml"?oe:Qt,_=Q(e,"ALLOWED_TAGS")?d({},e.ALLOWED_TAGS,g):b,u=Q(e,"ALLOWED_ATTR")?d({},e.ALLOWED_ATTR,g):D,c=Q(e,"ALLOWED_NAMESPACES")?d({},e.ALLOWED_NAMESPACES,oe):v,Ot=Q(e,"ADD_URI_SAFE_ATTR")?d(Nt(Yt),e.ADD_URI_SAFE_ATTR,g):Yt,Xt=Q(e,"ADD_DATA_URI_TAGS")?d(Nt(Wt),e.ADD_DATA_URI_TAGS,g):Wt,rt=Q(e,"FORBID_CONTENTS")?d({},e.FORBID_CONTENTS,g):J,I=Q(e,"FORBID_TAGS")?d({},e.FORBID_TAGS,g):{},w=Q(e,"FORBID_ATTR")?d({},e.FORBID_ATTR,g):{},Et=Q(e,"USE_PROFILES")?e.USE_PROFILES:!1,gt=e.ALLOW_ARIA_ATTR!==!1,L=e.ALLOW_DATA_ATTR!==!1,Y=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Tt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,bt=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,ot=e.RETURN_DOM||!1,Z=e.RETURN_DOM_FRAGMENT||!1,vt=e.RETURN_TRUSTED_TYPE||!1,Mt=e.FORCE_BODY||!1,dt=e.SANITIZE_DOM!==!1,zt=e.SANITIZE_NAMED_PROPS||!1,Ct=e.KEEP_CONTENT!==!1,yt=e.IN_PLACE||!1,nt=e.ALLOWED_URI_REGEXP||He,ut=e.NAMESPACE||j,p=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&me(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(p.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&me(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(p.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(p.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),bt&&(L=!1),Z&&(ot=!0),Et&&(_=d({},Ie),u=[],Et.html===!0&&(d(_,Le),d(u,Me)),Et.svg===!0&&(d(_,re),d(u,ie),d(u,Jt)),Et.svgFilters===!0&&(d(_,ae),d(u,ie),d(u,Jt)),Et.mathMl===!0&&(d(_,se),d(u,Ce),d(u,Jt))),e.ADD_TAGS&&(_===b&&(_=Nt(_)),d(_,e.ADD_TAGS,g)),e.ADD_ATTR&&(u===D&&(u=Nt(u)),d(u,e.ADD_ATTR,g)),e.ADD_URI_SAFE_ATTR&&d(Ot,e.ADD_URI_SAFE_ATTR,g),e.FORBID_CONTENTS&&(rt===J&&(rt=Nt(rt)),d(rt,e.FORBID_CONTENTS,g)),Ct&&(_["#text"]=!0),G&&d(_,["html","head","body"]),_.table&&(d(_,["tbody"]),delete I.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=e.TRUSTED_TYPES_POLICY,it=R.createHTML("")}else R===void 0&&(R=gn(f,h)),R!==null&&typeof it=="string"&&(it=R.createHTML(""));k&&k(e),at=e}},pe=d({},["mi","mo","mn","ms","mtext"]),he=d({},["foreignobject","desc","title","annotation-xml"]),Ve=d({},["title","style","font","a","script"]),ge=d({},[...re,...ae,...rn]),Te=d({},[...se,...an]),Xe=function(e){let o=pt(e);(!o||!o.tagName)&&(o={namespaceURI:ut,tagName:"template"});let a=Qt(e.tagName),x=Qt(o.tagName);return c[e.namespaceURI]?e.namespaceURI===At?o.namespaceURI===j?a==="svg":o.namespaceURI===_t?a==="svg"&&(x==="annotation-xml"||pe[x]):!!ge[a]:e.namespaceURI===_t?o.namespaceURI===j?a==="math":o.namespaceURI===At?a==="math"&&he[x]:!!Te[a]:e.namespaceURI===j?o.namespaceURI===At&&!he[x]||o.namespaceURI===_t&&!pe[x]?!1:!Te[a]&&(Ve[a]||!ge[a]):!!(S==="application/xhtml+xml"&&c[e.namespaceURI]):!1},St=function(e){jt(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(o){e.remove()}},ne=function(e,o){try{jt(n.removed,{attribute:o.getAttributeNode(e),from:o})}catch(a){jt(n.removed,{attribute:null,from:o})}if(o.removeAttribute(e),e==="is"&&!u[e])if(ot||Z)try{St(o)}catch(a){}else try{o.setAttribute(e,"")}catch(a){}},be=function(e){let o=null,a=null;if(Mt)e="<remove></remove>"+e;else{let C=De(e,/^[\r\n\t ]+/);a=C&&C[0]}S==="application/xhtml+xml"&&ut===j&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let x=R?R.createHTML(e):e;if(ut===j)try{o=new Lt().parseFromString(x,S)}catch(C){}if(!o||!o.documentElement){o=P.createDocument(ut,"template",null);try{o.documentElement.innerHTML=kt?it:x}catch(C){}}let M=o.body||o.documentElement;return e&&a&&M.insertBefore(t.createTextNode(a),M.childNodes[0]||null),ut===j?z.call(o,G?"html":"body")[0]:G?o.documentElement:M},ye=function(e){return lt.call(e.ownerDocument||e,e,mt.SHOW_ELEMENT|mt.SHOW_COMMENT|mt.SHOW_TEXT|mt.SHOW_PROCESSING_INSTRUCTION,null)},Ke=function(e){return e instanceof Dt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof wt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Ee=function(e){return typeof A=="function"&&e instanceof A},ft=function(e,o,a){O[e]&&qt(O[e],x=>{x.call(n,o,a,at)})},we=function(e){let o=null;if(ft("beforeSanitizeElements",e,null),Ke(e))return St(e),!0;let a=g(e.nodeName);if(ft("uponSanitizeElement",e,{tagName:a,allowedTags:_}),e.hasChildNodes()&&!Ee(e.firstElementChild)&&B(/<[/\w]/g,e.innerHTML)&&B(/<[/\w]/g,e.textContent))return St(e),!0;if(!_[a]||I[a]){if(!I[a]&&ve(a)&&(p.tagNameCheck instanceof RegExp&&B(p.tagNameCheck,a)||p.tagNameCheck instanceof Function&&p.tagNameCheck(a)))return!1;if(Ct&&!rt[a]){let x=pt(e)||e.parentNode,M=Ut(e)||e.childNodes;if(M&&x){let C=M.length;for(let H=C-1;H>=0;--H)x.insertBefore(Pt(M[H],!0),Ht(e))}}return St(e),!0}return e instanceof T&&!Xe(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&B(/<\/no(script|embed|frames)/i,e.innerHTML)?(St(e),!0):(bt&&e.nodeType===3&&(o=e.textContent,qt([N,q,ht],x=>{o=$t(o,x," ")}),e.textContent!==o&&(jt(n.removed,{element:e.cloneNode()}),e.textContent=o)),ft("afterSanitizeElements",e,null),!1)},xe=function(e,o,a){if(dt&&(o==="id"||o==="name")&&(a in t||a in Kt))return!1;if(!(L&&!w[o]&&B(It,o))){if(!(gt&&B(ct,o))){if(!u[o]||w[o]){if(!(ve(e)&&(p.tagNameCheck instanceof RegExp&&B(p.tagNameCheck,e)||p.tagNameCheck instanceof Function&&p.tagNameCheck(e))&&(p.attributeNameCheck instanceof RegExp&&B(p.attributeNameCheck,o)||p.attributeNameCheck instanceof Function&&p.attributeNameCheck(o))||o==="is"&&p.allowCustomizedBuiltInElements&&(p.tagNameCheck instanceof RegExp&&B(p.tagNameCheck,a)||p.tagNameCheck instanceof Function&&p.tagNameCheck(a))))return!1}else if(!Ot[o]){if(!B(nt,$t(a,xt,""))){if(!((o==="src"||o==="xlink:href"||o==="href")&&e!=="script"&&tn(a,"data:")===0&&Xt[e])){if(!(Y&&!B(et,$t(a,xt,"")))){if(a)return!1}}}}}}return!0},ve=function(e){return e!=="annotation-xml"&&De(e,W)},_e=function(e){ft("beforeSanitizeAttributes",e,null);let{attributes:o}=e;if(!o)return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:u},x=o.length;for(;x--;){let M=o[x],{name:C,namespaceURI:H,value:Rt}=M,Gt=g(C),U=C==="value"?Rt:en(Rt);if(a.attrName=Gt,a.attrValue=U,a.keepAttr=!0,a.forceKeepAttr=void 0,ft("uponSanitizeAttribute",e,a),U=a.attrValue,a.forceKeepAttr||(ne(C,e),!a.keepAttr))continue;if(!Tt&&B(/\/>/i,U)){ne(C,e);continue}bt&&qt([N,q,ht],Se=>{U=$t(U,Se," ")});let Ae=g(e.nodeName);if(xe(Ae,Gt,U)){if(zt&&(Gt==="id"||Gt==="name")&&(ne(C,e),U=te+U),R&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!H)switch(f.getAttributeType(Ae,Gt)){case"TrustedHTML":{U=R.createHTML(U);break}case"TrustedScriptURL":{U=R.createScriptURL(U);break}}try{H?e.setAttributeNS(H,C,U):e.setAttribute(C,U),Ne(n.removed)}catch(Se){}}}ft("afterSanitizeAttributes",e,null)},qe=function l(e){let o=null,a=ye(e);for(ft("beforeSanitizeShadowDOM",e,null);o=a.nextNode();)ft("uponSanitizeShadowNode",o,null),!we(o)&&(o.content instanceof E&&l(o.content),_e(o));ft("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(l){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=null,a=null,x=null,M=null;if(kt=!l,kt&&(l="<!-->"),typeof l!="string"&&!Ee(l))if(typeof l.toString=="function"){if(l=l.toString(),typeof l!="string")throw Vt("dirty is not a string, aborting")}else throw Vt("toString is not a function");if(!n.isSupported)return l;if(Ft||ee(e),n.removed=[],typeof l=="string"&&(yt=!1),yt){if(l.nodeName){let Rt=g(l.nodeName);if(!_[Rt]||I[Rt])throw Vt("root node is forbidden and cannot be sanitized in-place")}}else if(l instanceof A)o=be("<!---->"),a=o.ownerDocument.importNode(l,!0),a.nodeType===1&&a.nodeName==="BODY"||a.nodeName==="HTML"?o=a:o.appendChild(a);else{if(!ot&&!bt&&!G&&l.indexOf("<")===-1)return R&&vt?R.createHTML(l):l;if(o=be(l),!o)return ot?null:vt?it:""}o&&Mt&&St(o.firstChild);let C=ye(yt?l:o);for(;x=C.nextNode();)we(x)||(x.content instanceof E&&qe(x.content),_e(x));if(yt)return l;if(ot){if(Z)for(M=m.call(o.ownerDocument);o.firstChild;)M.appendChild(o.firstChild);else M=o;return(u.shadowroot||u.shadowrootmode)&&(M=Bt.call(r,M,!0)),M}let H=G?o.outerHTML:o.innerHTML;return G&&_["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&B(Ue,o.ownerDocument.doctype.name)&&(H="<!DOCTYPE "+o.ownerDocument.doctype.name+`>
|
|
2
|
-
`+H),bt&&qt([N,q,ht],Rt=>{H=$t(H,Rt," ")}),R&&vt?R.createHTML(H):H},n.setConfig=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ee(l),Ft=!0},n.clearConfig=function(){at=null,Ft=!1},n.isValidAttribute=function(l,e,o){at||ee({});let a=g(l),x=g(e);return xe(a,x,o)},n.addHook=function(l,e){typeof e=="function"&&(O[l]=O[l]||[],jt(O[l],e))},n.removeHook=function(l){if(O[l])return Ne(O[l])},n.removeHooks=function(l){O[l]&&(O[l]=[])},n.removeAllHooks=function(){O={}},n}var Fe=Be();import tt from"react";var ze=i=>{switch(i){case"success":return bn;case"info":return En;case"warning":return yn;case"error":return wn;default:return null}},Tn=Array(12).fill(0),We=({visible:i})=>tt.createElement("div",{className:"sonner-loading-wrapper","data-visible":i},tt.createElement("div",{className:"sonner-spinner"},Tn.map((n,t)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),bn=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),yn=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),En=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),wn=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}));import Ye from"react";var Ge=()=>{let[i,n]=Ye.useState(!1);return Ye.useEffect(()=>{let t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),i};var de=1,ue=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)});this.publish=n=>{this.subscribers.forEach(t=>t(n))};this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]};this.create=n=>{var A;let{message:t,...r}=n,h=typeof(n==null?void 0:n.id)=="number"||((A=n.id)==null?void 0:A.length)>0?n.id:de++,E=this.toasts.find(T=>T.id===h),y=n.dismissible===void 0?!0:n.dismissible;return E?this.toasts=this.toasts.map(T=>T.id===h?(this.publish({...T,...n,id:h,title:t}),{...T,...n,id:h,dismissible:y,title:t}):T):this.addToast({title:t,...r,dismissible:y,id:h}),h};this.dismiss=n=>(n||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:n,dismiss:!0})),n);this.message=(n,t)=>this.create({...t,message:n});this.error=(n,t)=>this.create({...t,message:n,type:"error"});this.success=(n,t)=>this.create({...t,type:"success",message:n});this.info=(n,t)=>this.create({...t,type:"info",message:n});this.warning=(n,t)=>this.create({...t,type:"warning",message:n});this.loading=(n,t)=>this.create({...t,type:"loading",message:n});this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let h=n instanceof Promise?n:n(),E=r!==void 0;return h.then(y=>{if(y&&typeof y.ok=="boolean"&&!y.ok){E=!1;let A=typeof t.error=="function"?t.error(`HTTP error! status: ${y.status}`):t.error,T=typeof t.description=="function"?t.description(`HTTP error! status: ${y.status}`):t.description;this.create({id:r,type:"error",message:A,description:T})}else if(t.success!==void 0){E=!1;let A=typeof t.success=="function"?t.success(y):t.success,T=typeof t.description=="function"?t.description(y):t.description;this.create({id:r,type:"success",message:A,description:T})}}).catch(y=>{if(t.error!==void 0){E=!1;let A=typeof t.error=="function"?t.error(y):t.error,T=typeof t.description=="function"?t.description(y):t.description;this.create({id:r,type:"error",message:A,description:T})}}).finally(()=>{var y;E&&(this.dismiss(r),r=void 0),(y=t.finally)==null||y.call(t)}),r};this.custom=(n,t)=>{let r=(t==null?void 0:t.id)||de++;return this.create({jsx:n(r),id:r,...t}),r};this.subscribers=[],this.toasts=[]}},K=new ue,xn=(i,n)=>{let t=(n==null?void 0:n.id)||de++;return K.addToast({title:i,...n,id:t}),t},vn=xn,_n=Object.assign(vn,{success:K.success,info:K.info,warning:K.warning,error:K.error,custom:K.custom,message:K.message,promise:K.promise,dismiss:K.dismiss,loading:K.loading});function fe(i,{insertAt:n}={}){if(!i||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i))}fe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
3
|
-
`);var Sn=3,Rn="32px",Nn=4e3,Dn=356,$e=14,Ln=20,In=200;function Mn(...i){return i.filter(Boolean).join(" ")}var Cn=i=>{var Ot,Yt,_t,At,j,ut,kt;let{invert:n,toast:t,unstyled:r,interacting:h,setHeights:E,visibleToasts:y,heights:A,index:T,toasts:mt,expanded:wt,removeToast:Dt,closeButton:Lt,style:f,cancelButtonStyle:st,actionButtonStyle:Pt,className:Ht="",descriptionClassName:Ut="",duration:pt,position:R,gap:it=$e,loadingIcon:P,expandByDefault:lt,classNames:m,icons:z,closeButtonAriaLabel:Bt="Close toast",pauseWhenPageIsHidden:O,cn:N}=i,[q,ht]=s.useState(!1),[It,ct]=s.useState(!1),[et,xt]=s.useState(!1),[W,nt]=s.useState(!1),[_,b]=s.useState(0),[u,D]=s.useState(0),p=s.useRef(null),I=s.useRef(null),w=T===0,gt=T+1<=y,L=t.type,Y=t.dismissible!==!1,Tt=t.className||"",bt=t.descriptionClassName||"",G=s.useMemo(()=>A.findIndex(c=>c.toastId===t.id)||0,[A,t.id]),Ft=s.useMemo(()=>{var c;return(c=t.closeButton)!=null?c:Lt},[t.closeButton,Lt]),Mt=s.useMemo(()=>t.duration||pt||Nn,[t.duration,pt]),ot=s.useRef(0),Z=s.useRef(0),vt=s.useRef(0),dt=s.useRef(null),[zt,te]=R.split("-"),Ct=s.useMemo(()=>A.reduce((c,v,S)=>S>=G?c:c+v.height,0),[A,G]),yt=Ge(),Et=t.invert||n,rt=L==="loading";Z.current=s.useMemo(()=>G*it+Ct,[G,Ct]),s.useEffect(()=>{ht(!0)},[]),s.useLayoutEffect(()=>{if(!q)return;let c=I.current,v=c.style.height;c.style.height="auto";let S=c.getBoundingClientRect().height;c.style.height=v,D(S),E($=>$.find(g=>g.toastId===t.id)?$.map(g=>g.toastId===t.id?{...g,height:S}:g):[{toastId:t.id,height:S,position:t.position},...$])},[q,t.title,t.description,E,t.id]);let J=s.useCallback(()=>{ct(!0),b(Z.current),E(c=>c.filter(v=>v.toastId!==t.id)),setTimeout(()=>{Dt(t)},In)},[t,Dt,E,Z]);s.useEffect(()=>{if(t.promise&&L==="loading"||t.duration===1/0||t.type==="loading")return;let c,v=Mt;return wt||h||O&&yt?(()=>{if(vt.current<ot.current){let V=new Date().getTime()-ot.current;v=v-V}vt.current=new Date().getTime()})():(()=>{ot.current=new Date().getTime(),c=setTimeout(()=>{var V;(V=t.onAutoClose)==null||V.call(t,t),J()},v)})(),()=>clearTimeout(c)},[wt,h,lt,t,Mt,J,t.promise,L,O,yt]),s.useEffect(()=>{let c=I.current;if(c){let v=c.getBoundingClientRect().height;return D(v),E(S=>[{toastId:t.id,height:v,position:t.position},...S]),()=>E(S=>S.filter($=>$.toastId!==t.id))}},[E,t.id]),s.useEffect(()=>{t.delete&&J()},[J,t.delete]);function Xt(){return z!=null&&z.loading?s.createElement("div",{className:"sonner-loader","data-visible":L==="loading"},z.loading):P?s.createElement("div",{className:"sonner-loader","data-visible":L==="loading"},P):s.createElement(We,{visible:L==="loading"})}function Wt(c){return{__html:Fe.sanitize(c)}}return s.createElement("li",{"aria-live":t.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:I,className:N(Ht,Tt,m==null?void 0:m.toast,(Ot=t==null?void 0:t.classNames)==null?void 0:Ot.toast,m==null?void 0:m.default,m==null?void 0:m[L],(Yt=t==null?void 0:t.classNames)==null?void 0:Yt[L]),"data-sonner-toast":"","data-styled":!(t.jsx||t.unstyled||r),"data-mounted":q,"data-promise":!!t.promise,"data-removed":It,"data-visible":gt,"data-y-position":zt,"data-x-position":te,"data-index":T,"data-front":w,"data-swiping":et,"data-dismissible":Y,"data-type":L,"data-invert":Et,"data-swipe-out":W,"data-expanded":!!(wt||lt&&q),style:{"--index":T,"--toasts-before":T,"--z-index":mt.length-T,"--offset":`${It?_:Z.current}px`,"--initial-height":lt?"auto":`${u}px`,...f,...t.style},onPointerDown:c=>{rt||!Y||(p.current=new Date,b(Z.current),c.target.setPointerCapture(c.pointerId),c.target.tagName!=="BUTTON"&&(xt(!0),dt.current={x:c.clientX,y:c.clientY}))},onPointerUp:()=>{var $,V,g,at;if(W||!Y)return;dt.current=null;let c=Number((($=I.current)==null?void 0:$.style.getPropertyValue("--swipe-amount").replace("px",""))||0),v=new Date().getTime()-((V=p.current)==null?void 0:V.getTime()),S=Math.abs(c)/v;if(Math.abs(c)>=Ln||S>.11){b(Z.current),(g=t.onDismiss)==null||g.call(t,t),J(),nt(!0);return}(at=I.current)==null||at.style.setProperty("--swipe-amount","0px"),xt(!1)},onPointerMove:c=>{var Kt;if(!dt.current||!Y)return;let v=c.clientY-dt.current.y,S=c.clientX-dt.current.x,V=(zt==="top"?Math.min:Math.max)(0,v),g=c.pointerType==="touch"?10:2;Math.abs(V)>g?(Kt=I.current)==null||Kt.style.setProperty("--swipe-amount",`${v}px`):Math.abs(S)>g&&(dt.current=null)}},Ft&&!t.jsx?s.createElement("button",{"aria-label":Bt,"data-disabled":rt,"data-close-button":!0,onClick:rt||!Y?()=>{}:()=>{var c;J(),(c=t.onDismiss)==null||c.call(t,t)},className:N(m==null?void 0:m.closeButton,(_t=t==null?void 0:t.classNames)==null?void 0:_t.closeButton)},s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},s.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,t.jsx||s.isValidElement(t.title)?t.jsx||t.title:s.createElement(s.Fragment,null,L||t.icon||t.promise?s.createElement("div",{"data-icon":"",className:N(m==null?void 0:m.icon)},t.promise||t.type==="loading"&&!t.icon?t.icon||Xt():null,t.type!=="loading"?t.icon||(z==null?void 0:z[L])||ze(L):null):null,s.createElement("div",{"data-content":"",className:N(m==null?void 0:m.content)},s.createElement("div",{"data-title":"",className:N(m==null?void 0:m.title,(At=t==null?void 0:t.classNames)==null?void 0:At.title),dangerouslySetInnerHTML:Wt(t.title)}),t.description?s.createElement("div",{"data-description":"",className:N(Ut,bt,m==null?void 0:m.description,(j=t==null?void 0:t.classNames)==null?void 0:j.description),dangerouslySetInnerHTML:Wt(t.description)}):null),t.cancel?s.createElement("button",{"data-button":!0,"data-cancel":!0,style:t.cancelButtonStyle||st,onClick:c=>{var v;Y&&(J(),(v=t.cancel)!=null&&v.onClick&&t.cancel.onClick(c))},className:N(m==null?void 0:m.cancelButton,(ut=t==null?void 0:t.classNames)==null?void 0:ut.cancelButton)},t.cancel.label):null,t.action?s.createElement("button",{"data-button":"",style:t.actionButtonStyle||Pt,onClick:c=>{var v;(v=t.action)==null||v.onClick(c),!c.defaultPrevented&&J()},className:N(m==null?void 0:m.actionButton,(kt=t==null?void 0:t.classNames)==null?void 0:kt.actionButton)},t.action.label):null))};function je(){if(typeof window=="undefined"||typeof document=="undefined")return"ltr";let i=document.documentElement.getAttribute("dir");return i==="auto"||!i?window.getComputedStyle(document.documentElement).direction:i}var Kn=i=>{let{invert:n,position:t="bottom-right",hotkey:r=["altKey","KeyT"],expand:h,closeButton:E,className:y,offset:A,theme:T="light",richColors:mt,duration:wt,style:Dt,visibleToasts:Lt=Sn,toastOptions:f,dir:st=je(),gap:Pt,loadingIcon:Ht,icons:Ut,containerAriaLabel:pt="Notifications",pauseWhenPageIsHidden:R,cn:it=Mn}=i,[P,lt]=s.useState([]),m=s.useMemo(()=>Array.from(new Set([t].concat(P.filter(b=>b.position).map(b=>b.position)))),[P,t]),[z,Bt]=s.useState([]),[O,N]=s.useState(!1),[q,ht]=s.useState(!1),[It,ct]=s.useState(T!=="system"?T:typeof window!="undefined"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),et=s.useRef(null),xt=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=s.useRef(null),nt=s.useRef(!1),_=s.useCallback(b=>lt(u=>u.filter(({id:D})=>D!==b.id)),[]);return s.useEffect(()=>K.subscribe(b=>{if(b.dismiss){lt(u=>u.map(D=>D.id===b.id?{...D,delete:!0}:D));return}setTimeout(()=>{An.flushSync(()=>{lt(u=>{let D=u.findIndex(p=>p.id===b.id);return D!==-1?[...u.slice(0,D),{...u[D],...b},...u.slice(D+1)]:[b,...u]})})})}),[]),s.useEffect(()=>{if(T!=="system"){ct(T);return}T==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ct("dark"):ct("light")),typeof window!="undefined"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:b})=>{ct(b?"dark":"light")})},[T]),s.useEffect(()=>{P.length<=1&&N(!1)},[P]),s.useEffect(()=>{let b=u=>{var p,I;r.every(w=>u[w]||u.code===w)&&(N(!0),(p=et.current)==null||p.focus()),u.code==="Escape"&&(document.activeElement===et.current||(I=et.current)!=null&&I.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),s.useEffect(()=>{if(et.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,nt.current=!1)}},[et.current]),P.length?s.createElement("section",{"aria-label":`${pt} ${xt}`,tabIndex:-1},m.map((b,u)=>{var I;let[D,p]=b.split("-");return s.createElement("ol",{key:b,dir:st==="auto"?je():st,tabIndex:-1,ref:et,className:y,"data-sonner-toaster":!0,"data-theme":It,"data-rich-colors":mt,"data-y-position":D,"data-x-position":p,style:{"--front-toast-height":`${((I=z[0])==null?void 0:I.height)||0}px`,"--offset":typeof A=="number"?`${A}px`:A||Rn,"--width":`${Dn}px`,"--gap":`${$e}px`,...Dt},onBlur:w=>{nt.current&&!w.currentTarget.contains(w.relatedTarget)&&(nt.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:w=>{w.target instanceof HTMLElement&&w.target.dataset.dismissible==="false"||nt.current||(nt.current=!0,W.current=w.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{q||N(!1)},onPointerDown:w=>{w.target instanceof HTMLElement&&w.target.dataset.dismissible==="false"||ht(!0)},onPointerUp:()=>ht(!1)},P.filter(w=>!w.position&&u===0||w.position===b).map((w,gt)=>{var L,Y;return s.createElement(Cn,{key:w.id,icons:Ut,index:gt,toast:w,duration:(L=f==null?void 0:f.duration)!=null?L:wt,className:f==null?void 0:f.className,descriptionClassName:f==null?void 0:f.descriptionClassName,invert:n,visibleToasts:Lt,closeButton:(Y=f==null?void 0:f.closeButton)!=null?Y:E,interacting:q,position:b,style:f==null?void 0:f.style,unstyled:f==null?void 0:f.unstyled,classNames:f==null?void 0:f.classNames,cancelButtonStyle:f==null?void 0:f.cancelButtonStyle,actionButtonStyle:f==null?void 0:f.actionButtonStyle,removeToast:_,toasts:P.filter(Tt=>Tt.position==w.position),heights:z.filter(Tt=>Tt.position==w.position),setHeights:Bt,expandByDefault:h,gap:Pt,loadingIcon:Ht,expanded:O,pauseWhenPageIsHidden:R,cn:it})}))})):null};export{Kn as Toaster,_n as toast};
|
|
1
|
+
"use client";import i from"react";import _n from"react-dom";var{entries:ke,setPrototypeOf:Ne,isFrozen:Ze,getPrototypeOf:Je,getOwnPropertyDescriptor:Qe}=Object,{freeze:O,seal:X,create:Be}=Object,{apply:ce,construct:de}=typeof Reflect!="undefined"&&Reflect;O||(O=function(n){return n});X||(X=function(n){return n});ce||(ce=function(n,t,a){return n.apply(t,a)});de||(de=function(n,t){return new n(...t)});var Zt=F(Array.prototype.forEach),De=F(Array.prototype.pop),jt=F(Array.prototype.push),te=F(String.prototype.toLowerCase),ae=F(String.prototype.toString),Ie=F(String.prototype.match),$t=F(String.prototype.replace),tn=F(String.prototype.indexOf),en=F(String.prototype.trim),Q=F(Object.prototype.hasOwnProperty),U=F(RegExp.prototype.test),Vt=nn(TypeError);function F(r){return function(n){for(var t=arguments.length,a=new Array(t>1?t-1:0),g=1;g<t;g++)a[g-1]=arguments[g];return ce(r,n,a)}}function nn(r){return function(){for(var n=arguments.length,t=new Array(n),a=0;a<n;a++)t[a]=arguments[a];return de(r,t)}}function d(r,n){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te;Ne&&Ne(r,null);let a=n.length;for(;a--;){let g=n[a];if(typeof g=="string"){let E=t(g);E!==g&&(Ze(n)||(n[a]=E),g=E)}r[g]=!0}return r}function on(r){for(let n=0;n<r.length;n++)Q(r,n)||(r[n]=null);return r}function Nt(r){let n=Be(null);for(let[t,a]of ke(r))Q(r,t)&&(Array.isArray(a)?n[t]=on(a):a&&typeof a=="object"&&a.constructor===Object?n[t]=Nt(a):n[t]=a);return n}function Jt(r,n){for(;r!==null;){let a=Qe(r,n);if(a){if(a.get)return F(a.get);if(typeof a.value=="function")return F(a.value)}r=Je(r)}function t(){return null}return t}var Ce=O(["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"]),re=O(["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"]),se=O(["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"]),an=O(["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"]),ie=O(["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"]),rn=O(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Le=O(["#text"]),Me=O(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),le=O(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pe=O(["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"]),Qt=O(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sn=X(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ln=X(/<%[\w\W]*|[\w\W]*%>/gm),cn=X(/\${[\w\W]*}/gm),dn=X(/^data-[\-\w.\u00B7-\uFFFF]/),un=X(/^aria-[\-\w]+$/),He=X(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fn=X(/^(?:\w+script|data):/i),mn=X(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ue=X(/^html$/i),pn=X(/^[a-z][a-z\d]*(-[a-z\d]+)+$/i),Oe=Object.freeze({__proto__:null,MUSTACHE_EXPR:sn,ERB_EXPR:ln,TMPLIT_EXPR:cn,DATA_ATTR:dn,ARIA_ATTR:un,IS_ALLOWED_URI:He,IS_SCRIPT_OR_DATA:fn,ATTR_WHITESPACE:mn,DOCTYPE_NAME:Ue,CUSTOM_ELEMENT:pn}),gn=function(){return typeof window=="undefined"?null:window},hn=function(n,t){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null,g="data-tt-policy-suffix";t&&t.hasAttribute(g)&&(a=t.getAttribute(g));let E="dompurify"+(a?"#"+a:"");try{return n.createPolicy(E,{createHTML(y){return y},createScriptURL(y){return y}})}catch(y){return console.warn("TrustedTypes policy "+E+" could not be created."),null}};function Fe(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gn(),n=l=>Fe(l);if(n.version="3.0.10",n.removed=[],!r||!r.document||r.document.nodeType!==9)return n.isSupported=!1,n;let{document:t}=r,a=t,g=a.currentScript,{DocumentFragment:E,HTMLTemplateElement:y,Node:A,Element:T,NodeFilter:mt,NamedNodeMap:wt=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:Dt,DOMParser:It,trustedTypes:f}=r,st=T.prototype,Ct=Jt(st,"cloneNode"),Bt=Jt(st,"nextSibling"),Ht=Jt(st,"childNodes"),pt=Jt(st,"parentNode");if(typeof y=="function"){let l=t.createElement("template");l.content&&l.content.ownerDocument&&(t=l.content.ownerDocument)}let R,it="",{implementation:k,createNodeIterator:lt,createDocumentFragment:m,getElementsByTagName:z}=t,{importNode:Ut}=a,P={};n.isSupported=typeof ke=="function"&&typeof pt=="function"&&k&&k.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:N,ERB_EXPR:q,TMPLIT_EXPR:gt,DATA_ATTR:Lt,ARIA_ATTR:ct,IS_SCRIPT_OR_DATA:et,ATTR_WHITESPACE:xt,CUSTOM_ELEMENT:W}=Oe,{IS_ALLOWED_URI:nt}=Oe,v=null,b=d({},[...Ce,...re,...se,...ie,...Le]),u=null,D=d({},[...Me,...le,...Pe,...Qt]),p=Object.seal(Be(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}})),C=null,w=null,ht=!0,I=!0,Y=!1,Tt=!0,bt=!1,G=!1,Ft=!1,Mt=!1,ot=!1,Z=!1,vt=!1,dt=!0,zt=!1,ee="user-content-",Pt=!0,yt=!1,Et={},at=null,J=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Kt=null,Wt=d({},["audio","video","img","source","image","track"]),Ot=null,Yt=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),At="http://www.w3.org/1998/Math/MathML",_t="http://www.w3.org/2000/svg",j="http://www.w3.org/1999/xhtml",ut=j,kt=!1,c=null,_=d({},[At,_t,j],ae),S=null,$=["application/xhtml+xml","text/html"],V="text/html",h=null,rt=null,qt=t.createElement("form"),pe=function(e){return e instanceof RegExp||e instanceof Function},ne=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rt&&rt===e)){if((!e||typeof e!="object")&&(e={}),e=Nt(e),S=$.indexOf(e.PARSER_MEDIA_TYPE)===-1?V:e.PARSER_MEDIA_TYPE,h=S==="application/xhtml+xml"?ae:te,v=Q(e,"ALLOWED_TAGS")?d({},e.ALLOWED_TAGS,h):b,u=Q(e,"ALLOWED_ATTR")?d({},e.ALLOWED_ATTR,h):D,c=Q(e,"ALLOWED_NAMESPACES")?d({},e.ALLOWED_NAMESPACES,ae):_,Ot=Q(e,"ADD_URI_SAFE_ATTR")?d(Nt(Yt),e.ADD_URI_SAFE_ATTR,h):Yt,Kt=Q(e,"ADD_DATA_URI_TAGS")?d(Nt(Wt),e.ADD_DATA_URI_TAGS,h):Wt,at=Q(e,"FORBID_CONTENTS")?d({},e.FORBID_CONTENTS,h):J,C=Q(e,"FORBID_TAGS")?d({},e.FORBID_TAGS,h):{},w=Q(e,"FORBID_ATTR")?d({},e.FORBID_ATTR,h):{},Et=Q(e,"USE_PROFILES")?e.USE_PROFILES:!1,ht=e.ALLOW_ARIA_ATTR!==!1,I=e.ALLOW_DATA_ATTR!==!1,Y=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Tt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,bt=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,ot=e.RETURN_DOM||!1,Z=e.RETURN_DOM_FRAGMENT||!1,vt=e.RETURN_TRUSTED_TYPE||!1,Mt=e.FORCE_BODY||!1,dt=e.SANITIZE_DOM!==!1,zt=e.SANITIZE_NAMED_PROPS||!1,Pt=e.KEEP_CONTENT!==!1,yt=e.IN_PLACE||!1,nt=e.ALLOWED_URI_REGEXP||He,ut=e.NAMESPACE||j,p=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&pe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(p.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&pe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(p.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(p.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),bt&&(I=!1),Z&&(ot=!0),Et&&(v=d({},Le),u=[],Et.html===!0&&(d(v,Ce),d(u,Me)),Et.svg===!0&&(d(v,re),d(u,le),d(u,Qt)),Et.svgFilters===!0&&(d(v,se),d(u,le),d(u,Qt)),Et.mathMl===!0&&(d(v,ie),d(u,Pe),d(u,Qt))),e.ADD_TAGS&&(v===b&&(v=Nt(v)),d(v,e.ADD_TAGS,h)),e.ADD_ATTR&&(u===D&&(u=Nt(u)),d(u,e.ADD_ATTR,h)),e.ADD_URI_SAFE_ATTR&&d(Ot,e.ADD_URI_SAFE_ATTR,h),e.FORBID_CONTENTS&&(at===J&&(at=Nt(at)),d(at,e.FORBID_CONTENTS,h)),Pt&&(v["#text"]=!0),G&&d(v,["html","head","body"]),v.table&&(d(v,["tbody"]),delete C.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=e.TRUSTED_TYPES_POLICY,it=R.createHTML("")}else R===void 0&&(R=hn(f,g)),R!==null&&typeof it=="string"&&(it=R.createHTML(""));O&&O(e),rt=e}},ge=d({},["mi","mo","mn","ms","mtext"]),he=d({},["foreignobject","desc","title","annotation-xml"]),Ve=d({},["title","style","font","a","script"]),Te=d({},[...re,...se,...an]),be=d({},[...ie,...rn]),Xe=function(e){let o=pt(e);(!o||!o.tagName)&&(o={namespaceURI:ut,tagName:"template"});let s=te(e.tagName),x=te(o.tagName);return c[e.namespaceURI]?e.namespaceURI===_t?o.namespaceURI===j?s==="svg":o.namespaceURI===At?s==="svg"&&(x==="annotation-xml"||ge[x]):!!Te[s]:e.namespaceURI===At?o.namespaceURI===j?s==="math":o.namespaceURI===_t?s==="math"&&he[x]:!!be[s]:e.namespaceURI===j?o.namespaceURI===_t&&!he[x]||o.namespaceURI===At&&!ge[x]?!1:!be[s]&&(Ve[s]||!Te[s]):!!(S==="application/xhtml+xml"&&c[e.namespaceURI]):!1},St=function(e){jt(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(o){e.remove()}},oe=function(e,o){try{jt(n.removed,{attribute:o.getAttributeNode(e),from:o})}catch(s){jt(n.removed,{attribute:null,from:o})}if(o.removeAttribute(e),e==="is"&&!u[e])if(ot||Z)try{St(o)}catch(s){}else try{o.setAttribute(e,"")}catch(s){}},ye=function(e){let o=null,s=null;if(Mt)e="<remove></remove>"+e;else{let M=Ie(e,/^[\r\n\t ]+/);s=M&&M[0]}S==="application/xhtml+xml"&&ut===j&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let x=R?R.createHTML(e):e;if(ut===j)try{o=new It().parseFromString(x,S)}catch(M){}if(!o||!o.documentElement){o=k.createDocument(ut,"template",null);try{o.documentElement.innerHTML=kt?it:x}catch(M){}}let L=o.body||o.documentElement;return e&&s&&L.insertBefore(t.createTextNode(s),L.childNodes[0]||null),ut===j?z.call(o,G?"html":"body")[0]:G?o.documentElement:L},Ee=function(e){return lt.call(e.ownerDocument||e,e,mt.SHOW_ELEMENT|mt.SHOW_COMMENT|mt.SHOW_TEXT|mt.SHOW_PROCESSING_INSTRUCTION,null)},Ke=function(e){return e instanceof Dt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof wt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},we=function(e){return typeof A=="function"&&e instanceof A},ft=function(e,o,s){P[e]&&Zt(P[e],x=>{x.call(n,o,s,rt)})},xe=function(e){let o=null;if(ft("beforeSanitizeElements",e,null),Ke(e))return St(e),!0;let s=h(e.nodeName);if(ft("uponSanitizeElement",e,{tagName:s,allowedTags:v}),e.hasChildNodes()&&!we(e.firstElementChild)&&U(/<[/\w]/g,e.innerHTML)&&U(/<[/\w]/g,e.textContent))return St(e),!0;if(!v[s]||C[s]){if(!C[s]&&Ae(s)&&(p.tagNameCheck instanceof RegExp&&U(p.tagNameCheck,s)||p.tagNameCheck instanceof Function&&p.tagNameCheck(s)))return!1;if(Pt&&!at[s]){let x=pt(e)||e.parentNode,L=Ht(e)||e.childNodes;if(L&&x){let M=L.length;for(let B=M-1;B>=0;--B)x.insertBefore(Ct(L[B],!0),Bt(e))}}return St(e),!0}return e instanceof T&&!Xe(e)||(s==="noscript"||s==="noembed"||s==="noframes")&&U(/<\/no(script|embed|frames)/i,e.innerHTML)?(St(e),!0):(bt&&e.nodeType===3&&(o=e.textContent,Zt([N,q,gt],x=>{o=$t(o,x," ")}),e.textContent!==o&&(jt(n.removed,{element:e.cloneNode()}),e.textContent=o)),ft("afterSanitizeElements",e,null),!1)},ve=function(e,o,s){if(dt&&(o==="id"||o==="name")&&(s in t||s in qt))return!1;if(!(I&&!w[o]&&U(Lt,o))){if(!(ht&&U(ct,o))){if(!u[o]||w[o]){if(!(Ae(e)&&(p.tagNameCheck instanceof RegExp&&U(p.tagNameCheck,e)||p.tagNameCheck instanceof Function&&p.tagNameCheck(e))&&(p.attributeNameCheck instanceof RegExp&&U(p.attributeNameCheck,o)||p.attributeNameCheck instanceof Function&&p.attributeNameCheck(o))||o==="is"&&p.allowCustomizedBuiltInElements&&(p.tagNameCheck instanceof RegExp&&U(p.tagNameCheck,s)||p.tagNameCheck instanceof Function&&p.tagNameCheck(s))))return!1}else if(!Ot[o]){if(!U(nt,$t(s,xt,""))){if(!((o==="src"||o==="xlink:href"||o==="href")&&e!=="script"&&tn(s,"data:")===0&&Kt[e])){if(!(Y&&!U(et,$t(s,xt,"")))){if(s)return!1}}}}}}return!0},Ae=function(e){return e!=="annotation-xml"&&Ie(e,W)},_e=function(e){ft("beforeSanitizeAttributes",e,null);let{attributes:o}=e;if(!o)return;let s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:u},x=o.length;for(;x--;){let L=o[x],{name:M,namespaceURI:B,value:Rt}=L,Gt=h(M),H=M==="value"?Rt:en(Rt);if(s.attrName=Gt,s.attrValue=H,s.keepAttr=!0,s.forceKeepAttr=void 0,ft("uponSanitizeAttribute",e,s),H=s.attrValue,s.forceKeepAttr||(oe(M,e),!s.keepAttr))continue;if(!Tt&&U(/\/>/i,H)){oe(M,e);continue}bt&&Zt([N,q,gt],Re=>{H=$t(H,Re," ")});let Se=h(e.nodeName);if(ve(Se,Gt,H)){if(zt&&(Gt==="id"||Gt==="name")&&(oe(M,e),H=ee+H),R&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!B)switch(f.getAttributeType(Se,Gt)){case"TrustedHTML":{H=R.createHTML(H);break}case"TrustedScriptURL":{H=R.createScriptURL(H);break}}try{B?e.setAttributeNS(B,M,H):e.setAttribute(M,H),De(n.removed)}catch(Re){}}}ft("afterSanitizeAttributes",e,null)},qe=function l(e){let o=null,s=Ee(e);for(ft("beforeSanitizeShadowDOM",e,null);o=s.nextNode();)ft("uponSanitizeShadowNode",o,null),!xe(o)&&(o.content instanceof E&&l(o.content),_e(o));ft("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(l){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=null,s=null,x=null,L=null;if(kt=!l,kt&&(l="<!-->"),typeof l!="string"&&!we(l))if(typeof l.toString=="function"){if(l=l.toString(),typeof l!="string")throw Vt("dirty is not a string, aborting")}else throw Vt("toString is not a function");if(!n.isSupported)return l;if(Ft||ne(e),n.removed=[],typeof l=="string"&&(yt=!1),yt){if(l.nodeName){let Rt=h(l.nodeName);if(!v[Rt]||C[Rt])throw Vt("root node is forbidden and cannot be sanitized in-place")}}else if(l instanceof A)o=ye("<!---->"),s=o.ownerDocument.importNode(l,!0),s.nodeType===1&&s.nodeName==="BODY"||s.nodeName==="HTML"?o=s:o.appendChild(s);else{if(!ot&&!bt&&!G&&l.indexOf("<")===-1)return R&&vt?R.createHTML(l):l;if(o=ye(l),!o)return ot?null:vt?it:""}o&&Mt&&St(o.firstChild);let M=Ee(yt?l:o);for(;x=M.nextNode();)xe(x)||(x.content instanceof E&&qe(x.content),_e(x));if(yt)return l;if(ot){if(Z)for(L=m.call(o.ownerDocument);o.firstChild;)L.appendChild(o.firstChild);else L=o;return(u.shadowroot||u.shadowrootmode)&&(L=Ut.call(a,L,!0)),L}let B=G?o.outerHTML:o.innerHTML;return G&&v["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&U(Ue,o.ownerDocument.doctype.name)&&(B="<!DOCTYPE "+o.ownerDocument.doctype.name+`>
|
|
2
|
+
`+B),bt&&Zt([N,q,gt],Rt=>{B=$t(B,Rt," ")}),R&&vt?R.createHTML(B):B},n.setConfig=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ne(l),Ft=!0},n.clearConfig=function(){rt=null,Ft=!1},n.isValidAttribute=function(l,e,o){rt||ne({});let s=h(l),x=h(e);return ve(s,x,o)},n.addHook=function(l,e){typeof e=="function"&&(P[l]=P[l]||[],jt(P[l],e))},n.removeHook=function(l){if(P[l])return De(P[l])},n.removeHooks=function(l){P[l]&&(P[l]=[])},n.removeAllHooks=function(){P={}},n}var ze=Fe();import tt from"react";var We=r=>{switch(r){case"success":return bn;case"info":return En;case"warning":return yn;case"error":return wn;default:return null}},Tn=Array(12).fill(0),Ye=({visible:r})=>tt.createElement("div",{className:"sonner-loading-wrapper","data-visible":r},tt.createElement("div",{className:"sonner-spinner"},Tn.map((n,t)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),bn=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),yn=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),En=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),wn=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}));import Ge from"react";var je=()=>{let[r,n]=Ge.useState(!1);return Ge.useEffect(()=>{let t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),r};var ue=1,fe=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)});this.publish=n=>{this.subscribers.forEach(t=>t(n))};this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]};this.create=n=>{var A;let{message:t,...a}=n,g=typeof(n==null?void 0:n.id)=="number"||((A=n.id)==null?void 0:A.length)>0?n.id:ue++,E=this.toasts.find(T=>T.id===g),y=n.dismissible===void 0?!0:n.dismissible;return E?this.toasts=this.toasts.map(T=>T.id===g?(this.publish({...T,...n,id:g,title:t}),{...T,...n,id:g,dismissible:y,title:t}):T):this.addToast({title:t,...a,dismissible:y,id:g}),g};this.dismiss=n=>(n||this.toasts.forEach(t=>{this.subscribers.forEach(a=>a({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:n,dismiss:!0})),n);this.message=(n,t)=>this.create({...t,message:n});this.error=(n,t)=>this.create({...t,message:n,type:"error"});this.success=(n,t)=>this.create({...t,type:"success",message:n});this.info=(n,t)=>this.create({...t,type:"info",message:n});this.warning=(n,t)=>this.create({...t,type:"warning",message:n});this.loading=(n,t)=>this.create({...t,type:"loading",message:n});this.promise=(n,t)=>{if(!t)return;let a;t.loading!==void 0&&(a=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let g=n instanceof Promise?n:n(),E=a!==void 0;return g.then(y=>{if(y&&typeof y.ok=="boolean"&&!y.ok){E=!1;let A=typeof t.error=="function"?t.error(`HTTP error! status: ${y.status}`):t.error,T=typeof t.description=="function"?t.description(`HTTP error! status: ${y.status}`):t.description;this.create({id:a,type:"error",message:A,description:T})}else if(t.success!==void 0){E=!1;let A=typeof t.success=="function"?t.success(y):t.success,T=typeof t.description=="function"?t.description(y):t.description;this.create({id:a,type:"success",message:A,description:T})}}).catch(y=>{if(t.error!==void 0){E=!1;let A=typeof t.error=="function"?t.error(y):t.error,T=typeof t.description=="function"?t.description(y):t.description;this.create({id:a,type:"error",message:A,description:T})}}).finally(()=>{var y;E&&(this.dismiss(a),a=void 0),(y=t.finally)==null||y.call(t)}),a};this.custom=(n,t)=>{let a=(t==null?void 0:t.id)||ue++;return this.create({jsx:n(a),id:a,...t}),a};this.subscribers=[],this.toasts=[]}},K=new fe,xn=(r,n)=>{let t=(n==null?void 0:n.id)||ue++;return K.addToast({title:r,...n,id:t}),t},vn=xn,An=Object.assign(vn,{success:K.success,info:K.info,warning:K.warning,error:K.error,custom:K.custom,message:K.message,promise:K.promise,dismiss:K.dismiss,loading:K.loading});function me(r,{insertAt:n}={}){if(!r||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n==="top"&&t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(document.createTextNode(r))}me(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
3
|
+
`);function Xt(r){return r.label!==void 0&&typeof r.onClick=="function"}var Sn=3,Rn="32px",Nn=4e3,Dn=356,In=14,Cn=20,Ln=200;function Mn(...r){return r.filter(Boolean).join(" ")}var Pn=r=>{var Ot,Yt,At,_t,j,ut,kt;let{invert:n,toast:t,unstyled:a,interacting:g,setHeights:E,visibleToasts:y,heights:A,index:T,toasts:mt,expanded:wt,removeToast:Dt,closeButton:It,style:f,cancelButtonStyle:st,actionButtonStyle:Ct,className:Bt="",descriptionClassName:Ht="",duration:pt,position:R,gap:it,loadingIcon:k,expandByDefault:lt,classNames:m,icons:z,closeButtonAriaLabel:Ut="Close toast",pauseWhenPageIsHidden:P,cn:N}=r,[q,gt]=i.useState(!1),[Lt,ct]=i.useState(!1),[et,xt]=i.useState(!1),[W,nt]=i.useState(!1),[v,b]=i.useState(0),[u,D]=i.useState(0),p=i.useRef(null),C=i.useRef(null),w=T===0,ht=T+1<=y,I=t.type,Y=t.dismissible!==!1,Tt=t.className||"",bt=t.descriptionClassName||"",G=i.useMemo(()=>A.findIndex(c=>c.toastId===t.id)||0,[A,t.id]),Ft=i.useMemo(()=>{var c;return(c=t.closeButton)!=null?c:It},[t.closeButton,It]),Mt=i.useMemo(()=>t.duration||pt||Nn,[t.duration,pt]),ot=i.useRef(0),Z=i.useRef(0),vt=i.useRef(0),dt=i.useRef(null),[zt,ee]=R.split("-"),Pt=i.useMemo(()=>A.reduce((c,_,S)=>S>=G?c:c+_.height,0),[A,G]),yt=je(),Et=t.invert||n,at=I==="loading";Z.current=i.useMemo(()=>G*it+Pt,[G,Pt]),i.useEffect(()=>{gt(!0)},[]),i.useLayoutEffect(()=>{if(!q)return;let c=C.current,_=c.style.height;c.style.height="auto";let S=c.getBoundingClientRect().height;c.style.height=_,D(S),E($=>$.find(h=>h.toastId===t.id)?$.map(h=>h.toastId===t.id?{...h,height:S}:h):[{toastId:t.id,height:S,position:t.position},...$])},[q,t.title,t.description,E,t.id]);let J=i.useCallback(()=>{ct(!0),b(Z.current),E(c=>c.filter(_=>_.toastId!==t.id)),setTimeout(()=>{Dt(t)},Ln)},[t,Dt,E,Z]);i.useEffect(()=>{if(t.promise&&I==="loading"||t.duration===1/0||t.type==="loading")return;let c,_=Mt;return wt||g||P&&yt?(()=>{if(vt.current<ot.current){let V=new Date().getTime()-ot.current;_=_-V}vt.current=new Date().getTime()})():(()=>{_!==1/0&&(ot.current=new Date().getTime(),c=setTimeout(()=>{var V;(V=t.onAutoClose)==null||V.call(t,t),J()},_))})(),()=>clearTimeout(c)},[wt,g,lt,t,Mt,J,t.promise,I,P,yt]),i.useEffect(()=>{let c=C.current;if(c){let _=c.getBoundingClientRect().height;return D(_),E(S=>[{toastId:t.id,height:_,position:t.position},...S]),()=>E(S=>S.filter($=>$.toastId!==t.id))}},[E,t.id]),i.useEffect(()=>{t.delete&&J()},[J,t.delete]);function Kt(){return z!=null&&z.loading?i.createElement("div",{className:"sonner-loader","data-visible":I==="loading"},z.loading):k?i.createElement("div",{className:"sonner-loader","data-visible":I==="loading"},k):i.createElement(Ye,{visible:I==="loading"})}function Wt(c){return{__html:ze.sanitize(c)}}return i.createElement("li",{"aria-live":t.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:C,className:N(Bt,Tt,m==null?void 0:m.toast,(Ot=t==null?void 0:t.classNames)==null?void 0:Ot.toast,m==null?void 0:m.default,m==null?void 0:m[I],(Yt=t==null?void 0:t.classNames)==null?void 0:Yt[I]),"data-sonner-toast":"","data-styled":!(t.jsx||t.unstyled||a),"data-mounted":q,"data-promise":!!t.promise,"data-removed":Lt,"data-visible":ht,"data-y-position":zt,"data-x-position":ee,"data-index":T,"data-front":w,"data-swiping":et,"data-dismissible":Y,"data-type":I,"data-invert":Et,"data-swipe-out":W,"data-expanded":!!(wt||lt&&q),style:{"--index":T,"--toasts-before":T,"--z-index":mt.length-T,"--offset":`${Lt?v:Z.current}px`,"--initial-height":lt?"auto":`${u}px`,...f,...t.style},onPointerDown:c=>{at||!Y||(p.current=new Date,b(Z.current),c.target.setPointerCapture(c.pointerId),c.target.tagName!=="BUTTON"&&(xt(!0),dt.current={x:c.clientX,y:c.clientY}))},onPointerUp:()=>{var $,V,h,rt;if(W||!Y)return;dt.current=null;let c=Number((($=C.current)==null?void 0:$.style.getPropertyValue("--swipe-amount").replace("px",""))||0),_=new Date().getTime()-((V=p.current)==null?void 0:V.getTime()),S=Math.abs(c)/_;if(Math.abs(c)>=Cn||S>.11){b(Z.current),(h=t.onDismiss)==null||h.call(t,t),J(),nt(!0);return}(rt=C.current)==null||rt.style.setProperty("--swipe-amount","0px"),xt(!1)},onPointerMove:c=>{var qt;if(!dt.current||!Y)return;let _=c.clientY-dt.current.y,S=c.clientX-dt.current.x,V=(zt==="top"?Math.min:Math.max)(0,_),h=c.pointerType==="touch"?10:2;Math.abs(V)>h?(qt=C.current)==null||qt.style.setProperty("--swipe-amount",`${_}px`):Math.abs(S)>h&&(dt.current=null)}},Ft&&!t.jsx?i.createElement("button",{"aria-label":Ut,"data-disabled":at,"data-close-button":!0,onClick:at||!Y?()=>{}:()=>{var c;J(),(c=t.onDismiss)==null||c.call(t,t)},className:N(m==null?void 0:m.closeButton,(At=t==null?void 0:t.classNames)==null?void 0:At.closeButton)},i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,t.jsx||i.isValidElement(t.title)?t.jsx||t.title:i.createElement(i.Fragment,null,I||t.icon||t.promise?i.createElement("div",{"data-icon":"",className:N(m==null?void 0:m.icon)},t.promise||t.type==="loading"&&!t.icon?t.icon||Kt():null,t.type!=="loading"?t.icon||(z==null?void 0:z[I])||We(I):null):null,i.createElement("div",{"data-content":"",className:N(m==null?void 0:m.content)},i.createElement("div",{"data-title":"",className:N(m==null?void 0:m.title,(_t=t==null?void 0:t.classNames)==null?void 0:_t.title),dangerouslySetInnerHTML:Wt(t.title)}),t.description?i.createElement("div",{"data-description":"",className:N(Ht,bt,m==null?void 0:m.description,(j=t==null?void 0:t.classNames)==null?void 0:j.description),dangerouslySetInnerHTML:Wt(t.description)}):null),i.isValidElement(t.cancel)?t.cancel:t.cancel&&Xt(t.cancel)?i.createElement("button",{"data-button":!0,"data-cancel":!0,style:t.cancelButtonStyle||st,onClick:c=>{Xt(t.cancel)&&Y&&(J(),t.cancel.onClick(c))},className:N(m==null?void 0:m.cancelButton,(ut=t==null?void 0:t.classNames)==null?void 0:ut.cancelButton)},t.cancel.label):null,i.isValidElement(t.action)?t.action:t.action&&Xt(t.action)?i.createElement("button",{"data-button":"",style:t.actionButtonStyle||Ct,onClick:c=>{Xt(t.action)&&(t.action.onClick(c),!c.defaultPrevented&&J())},className:N(m==null?void 0:m.actionButton,(kt=t==null?void 0:t.classNames)==null?void 0:kt.actionButton)},t.action.label):null))};function $e(){if(typeof window=="undefined"||typeof document=="undefined")return"ltr";let r=document.documentElement.getAttribute("dir");return r==="auto"||!r?window.getComputedStyle(document.documentElement).direction:r}var Jn=r=>{let{invert:n,position:t="bottom-right",hotkey:a=["altKey","KeyT"],expand:g,closeButton:E,className:y,offset:A,theme:T="light",richColors:mt,duration:wt,style:Dt,visibleToasts:It=Sn,toastOptions:f,dir:st=$e(),gap:Ct=In,loadingIcon:Bt,icons:Ht,containerAriaLabel:pt="Notifications",pauseWhenPageIsHidden:R,cn:it=Mn}=r,[k,lt]=i.useState([]),m=i.useMemo(()=>Array.from(new Set([t].concat(k.filter(b=>b.position).map(b=>b.position)))),[k,t]),[z,Ut]=i.useState([]),[P,N]=i.useState(!1),[q,gt]=i.useState(!1),[Lt,ct]=i.useState(T!=="system"?T:typeof window!="undefined"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),et=i.useRef(null),xt=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=i.useRef(null),nt=i.useRef(!1),v=i.useCallback(b=>lt(u=>u.filter(({id:D})=>D!==b.id)),[]);return i.useEffect(()=>K.subscribe(b=>{if(b.dismiss){lt(u=>u.map(D=>D.id===b.id?{...D,delete:!0}:D));return}setTimeout(()=>{_n.flushSync(()=>{lt(u=>{let D=u.findIndex(p=>p.id===b.id);return D!==-1?[...u.slice(0,D),{...u[D],...b},...u.slice(D+1)]:[b,...u]})})})}),[]),i.useEffect(()=>{if(T!=="system"){ct(T);return}T==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ct("dark"):ct("light")),typeof window!="undefined"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:b})=>{ct(b?"dark":"light")})},[T]),i.useEffect(()=>{k.length<=1&&N(!1)},[k]),i.useEffect(()=>{let b=u=>{var p,C;a.every(w=>u[w]||u.code===w)&&(N(!0),(p=et.current)==null||p.focus()),u.code==="Escape"&&(document.activeElement===et.current||(C=et.current)!=null&&C.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[a]),i.useEffect(()=>{if(et.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,nt.current=!1)}},[et.current]),k.length?i.createElement("section",{"aria-label":`${pt} ${xt}`,tabIndex:-1},m.map((b,u)=>{var C;let[D,p]=b.split("-");return i.createElement("ol",{key:b,dir:st==="auto"?$e():st,tabIndex:-1,ref:et,className:y,"data-sonner-toaster":!0,"data-theme":Lt,"data-rich-colors":mt,"data-y-position":D,"data-x-position":p,style:{"--front-toast-height":`${((C=z[0])==null?void 0:C.height)||0}px`,"--offset":typeof A=="number"?`${A}px`:A||Rn,"--width":`${Dn}px`,"--gap":`${Ct}px`,...Dt},onBlur:w=>{nt.current&&!w.currentTarget.contains(w.relatedTarget)&&(nt.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:w=>{w.target instanceof HTMLElement&&w.target.dataset.dismissible==="false"||nt.current||(nt.current=!0,W.current=w.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{q||N(!1)},onPointerDown:w=>{w.target instanceof HTMLElement&&w.target.dataset.dismissible==="false"||gt(!0)},onPointerUp:()=>gt(!1)},k.filter(w=>!w.position&&u===0||w.position===b).map((w,ht)=>{var I,Y;return i.createElement(Pn,{key:w.id,icons:Ht,index:ht,toast:w,duration:(I=f==null?void 0:f.duration)!=null?I:wt,className:f==null?void 0:f.className,descriptionClassName:f==null?void 0:f.descriptionClassName,invert:n,visibleToasts:It,closeButton:(Y=f==null?void 0:f.closeButton)!=null?Y:E,interacting:q,position:b,style:f==null?void 0:f.style,unstyled:f==null?void 0:f.unstyled,classNames:f==null?void 0:f.classNames,cancelButtonStyle:f==null?void 0:f.cancelButtonStyle,actionButtonStyle:f==null?void 0:f.actionButtonStyle,removeToast:v,toasts:k.filter(Tt=>Tt.position==w.position),heights:z.filter(Tt=>Tt.position==w.position),setHeights:Ut,expandByDefault:g,gap:Ct,loadingIcon:Bt,expanded:P,pauseWhenPageIsHidden:R,cn:it})}))})):null};export{Jn as Toaster,An as toast};
|
|
4
4
|
/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
dompurify/dist/purify.es.mjs:
|