diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..9ac7e57 Binary files /dev/null and b/icon.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..9199c69 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +Assistant
\ No newline at end of file diff --git a/main-91dd706c02280dbca272.js b/main-91dd706c02280dbca272.js new file mode 100644 index 0000000..c94c0f6 --- /dev/null +++ b/main-91dd706c02280dbca272.js @@ -0,0 +1,2 @@ +/*! For license information please see main-91dd706c02280dbca272.js.LICENSE.txt */ +(()=>{var A={856:function(A){A.exports=function(){"use strict";function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A(e)}function e(A,t){return e=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A},e(A,t)}function t(A,r,n){return t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}()?Reflect.construct:function(A,t,r){var n=[null];n.push.apply(n,t);var s=new(Function.bind.apply(A,n));return r&&e(s,r.prototype),s},t.apply(null,arguments)}function r(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var r,n,s=[],o=!0,i=!1;try{for(t=t.call(A);!(o=(r=t.next()).done)&&(s.push(r.value),!e||s.length!==e);o=!0);}catch(A){i=!0,n=A}finally{try{o||null==t.return||t.return()}finally{if(i)throw n}}return s}}(A,e)||s(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(A){return function(A){if(Array.isArray(A))return o(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||s(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(A,e){if(A){if("string"==typeof A)return o(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(A,e):void 0}}function o(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,r=new Array(e);t1?t-1:0),n=1;n=A.length?{done:!0}:{done:!1,value:A[r++]}},e:function(A){throw A},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,B=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){B=!0,o=A},f:function(){try{i||null==t.return||t.return()}finally{if(B)throw o}}}}(i(A));try{for(n.s();!(e=n.n()).done;){var o=r(e.value,2),B=o[0],a=o[1];t[B]=a}}catch(A){n.e(A)}finally{n.f()}return t}function k(A,e){for(;null!==A;){var t=l(A,e);if(t){if(t.get)return v(t.get);if("function"==typeof t.value)return v(t.value)}A=c(A)}return function(A){return console.warn("fallback value for",A),null}}var D=g(["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"]),S=g(["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"]),T=g(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=g(["animate","color-profile","cursor","discard","fedropshadow","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"]),O=g(["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"]),G=g(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R=g(["#text"]),V=g(["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"]),N=g(["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"]),P=g(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),X=g(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),J=u(/\{\{[\w\W]*|[\w\W]*\}\}/gm),_=u(/<%[\w\W]*|[\w\W]*%>/gm),Y=u(/\${[\w\W]*}/gm),W=u(/^data-[\-\w.\u00B7-\uFFFF]/),Z=u(/^aria-[\-\w]+$/),z=u(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=u(/^(?:\w+script|data):/i),j=u(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$=u(/^html$/i),AA=function(){return"undefined"==typeof window?null:window},eA=function(e,t){if("object"!==A(e)||"function"!=typeof e.createPolicy)return null;var r=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(r=t.currentScript.getAttribute(n));var s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML:function(A){return A},createScriptURL:function(A){return A}})}catch(A){return console.warn("TrustedTypes policy "+s+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:AA(),r=function(A){return e(A)};if(r.version="3.0.1",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;var s=t.document,o=t.document,B=t.DocumentFragment,a=t.HTMLTemplateElement,c=t.Node,l=t.Element,u=t.NodeFilter,w=t.NamedNodeMap,Q=void 0===w?t.NamedNodeMap||t.MozNamedAttrMap:w,h=t.HTMLFormElement,d=t.DOMParser,C=t.trustedTypes,v=l.prototype,tA=k(v,"cloneNode"),rA=k(v,"nextSibling"),nA=k(v,"childNodes"),sA=k(v,"parentNode");if("function"==typeof a){var oA=o.createElement("template");oA.content&&oA.content.ownerDocument&&(o=oA.content.ownerDocument)}var iA=eA(C,s),BA=iA?iA.createHTML(""):"",aA=o,cA=aA.implementation,lA=aA.createNodeIterator,gA=aA.createDocumentFragment,uA=aA.getElementsByTagName,wA=s.importNode,QA={};r.isSupported="function"==typeof i&&"function"==typeof sA&&cA&&void 0!==cA.createHTMLDocument;var hA,dA,CA=J,UA=_,pA=Y,FA=W,fA=Z,mA=q,HA=j,EA=z,yA=null,IA=x({},[].concat(n(D),n(S),n(T),n(O),n(R))),bA=null,KA=x({},[].concat(n(V),n(N),n(P),n(X))),vA=Object.seal(Object.create(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}})),xA=null,LA=null,kA=!0,DA=!0,SA=!1,TA=!0,MA=!1,OA=!1,GA=!1,RA=!1,VA=!1,NA=!1,PA=!1,XA=!0,JA=!1,_A=!0,YA=!1,WA={},ZA=null,zA=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qA=null,jA=x({},["audio","video","img","source","image","track"]),$A=null,Ae=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ee="http://www.w3.org/1998/Math/MathML",te="http://www.w3.org/2000/svg",re="http://www.w3.org/1999/xhtml",ne=re,se=!1,oe=null,ie=x({},[ee,te,re],m),Be=["application/xhtml+xml","text/html"],ae=null,ce=o.createElement("form"),le=function(A){return A instanceof RegExp||A instanceof Function},ge=function(e){ae&&ae===e||(e&&"object"===A(e)||(e={}),e=L(e),hA=hA=-1===Be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,dA="application/xhtml+xml"===hA?m:f,yA="ALLOWED_TAGS"in e?x({},e.ALLOWED_TAGS,dA):IA,bA="ALLOWED_ATTR"in e?x({},e.ALLOWED_ATTR,dA):KA,oe="ALLOWED_NAMESPACES"in e?x({},e.ALLOWED_NAMESPACES,m):ie,$A="ADD_URI_SAFE_ATTR"in e?x(L(Ae),e.ADD_URI_SAFE_ATTR,dA):Ae,qA="ADD_DATA_URI_TAGS"in e?x(L(jA),e.ADD_DATA_URI_TAGS,dA):jA,ZA="FORBID_CONTENTS"in e?x({},e.FORBID_CONTENTS,dA):zA,xA="FORBID_TAGS"in e?x({},e.FORBID_TAGS,dA):{},LA="FORBID_ATTR"in e?x({},e.FORBID_ATTR,dA):{},WA="USE_PROFILES"in e&&e.USE_PROFILES,kA=!1!==e.ALLOW_ARIA_ATTR,DA=!1!==e.ALLOW_DATA_ATTR,SA=e.ALLOW_UNKNOWN_PROTOCOLS||!1,TA=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,MA=e.SAFE_FOR_TEMPLATES||!1,OA=e.WHOLE_DOCUMENT||!1,VA=e.RETURN_DOM||!1,NA=e.RETURN_DOM_FRAGMENT||!1,PA=e.RETURN_TRUSTED_TYPE||!1,RA=e.FORCE_BODY||!1,XA=!1!==e.SANITIZE_DOM,JA=e.SANITIZE_NAMED_PROPS||!1,_A=!1!==e.KEEP_CONTENT,YA=e.IN_PLACE||!1,EA=e.ALLOWED_URI_REGEXP||EA,ne=e.NAMESPACE||re,vA=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&le(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(vA.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&le(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(vA.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(vA.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),MA&&(DA=!1),NA&&(VA=!0),WA&&(yA=x({},n(R)),bA=[],!0===WA.html&&(x(yA,D),x(bA,V)),!0===WA.svg&&(x(yA,S),x(bA,N),x(bA,X)),!0===WA.svgFilters&&(x(yA,T),x(bA,N),x(bA,X)),!0===WA.mathMl&&(x(yA,O),x(bA,P),x(bA,X))),e.ADD_TAGS&&(yA===IA&&(yA=L(yA)),x(yA,e.ADD_TAGS,dA)),e.ADD_ATTR&&(bA===KA&&(bA=L(bA)),x(bA,e.ADD_ATTR,dA)),e.ADD_URI_SAFE_ATTR&&x($A,e.ADD_URI_SAFE_ATTR,dA),e.FORBID_CONTENTS&&(ZA===zA&&(ZA=L(ZA)),x(ZA,e.FORBID_CONTENTS,dA)),_A&&(yA["#text"]=!0),OA&&x(yA,["html","head","body"]),yA.table&&(x(yA,["tbody"]),delete xA.tbody),g&&g(e),ae=e)},ue=x({},["mi","mo","mn","ms","mtext"]),we=x({},["foreignobject","desc","title","annotation-xml"]),Qe=x({},["title","style","font","a","script"]),he=x({},S);x(he,T),x(he,M);var de=x({},O);x(de,G);var Ce=function(A){F(r.removed,{element:A});try{A.parentNode.removeChild(A)}catch(e){A.remove()}},Ue=function(A,e){try{F(r.removed,{attribute:e.getAttributeNode(A),from:e})}catch(A){F(r.removed,{attribute:null,from:e})}if(e.removeAttribute(A),"is"===A&&!bA[A])if(VA||NA)try{Ce(e)}catch(A){}else try{e.setAttribute(A,"")}catch(A){}},pe=function(A){var e,t;if(RA)A=""+A;else{var r=H(A,/^[\r\n\t ]+/);t=r&&r[0]}"application/xhtml+xml"===hA&&ne===re&&(A=''+A+"");var n=iA?iA.createHTML(A):A;if(ne===re)try{e=(new d).parseFromString(n,hA)}catch(A){}if(!e||!e.documentElement){e=cA.createDocument(ne,"template",null);try{e.documentElement.innerHTML=se?BA:n}catch(A){}}var s=e.body||e.documentElement;return A&&t&&s.insertBefore(o.createTextNode(t),s.childNodes[0]||null),ne===re?uA.call(e,OA?"html":"body")[0]:OA?e.documentElement:s},Fe=function(A){return lA.call(A.ownerDocument||A,A,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},fe=function(e){return"object"===A(c)?e instanceof c:e&&"object"===A(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},me=function(A,e,t){QA[A]&&U(QA[A],(function(A){A.call(r,e,t,ae)}))},He=function(A){var e,t;if(me("beforeSanitizeElements",A,null),(t=A)instanceof h&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof Q)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes))return Ce(A),!0;var n=dA(A.nodeName);if(me("uponSanitizeElement",A,{tagName:n,allowedTags:yA}),A.hasChildNodes()&&!fe(A.firstElementChild)&&(!fe(A.content)||!fe(A.content.firstElementChild))&&b(/<[/\w]/g,A.innerHTML)&&b(/<[/\w]/g,A.textContent))return Ce(A),!0;if(!yA[n]||xA[n]){if(!xA[n]&&ye(n)){if(vA.tagNameCheck instanceof RegExp&&b(vA.tagNameCheck,n))return!1;if(vA.tagNameCheck instanceof Function&&vA.tagNameCheck(n))return!1}if(_A&&!ZA[n]){var s=sA(A)||A.parentNode,o=nA(A)||A.childNodes;if(o&&s)for(var i=o.length-1;i>=0;--i)s.insertBefore(tA(o[i],!0),rA(A))}return Ce(A),!0}return A instanceof l&&!function(A){var e=sA(A);e&&e.tagName||(e={namespaceURI:ne,tagName:"template"});var t=f(A.tagName),r=f(e.tagName);return!!oe[A.namespaceURI]&&(A.namespaceURI===te?e.namespaceURI===re?"svg"===t:e.namespaceURI===ee?"svg"===t&&("annotation-xml"===r||ue[r]):Boolean(he[t]):A.namespaceURI===ee?e.namespaceURI===re?"math"===t:e.namespaceURI===te?"math"===t&&we[r]:Boolean(de[t]):A.namespaceURI===re?!(e.namespaceURI===te&&!we[r])&&!(e.namespaceURI===ee&&!ue[r])&&!de[t]&&(Qe[t]||!he[t]):!("application/xhtml+xml"!==hA||!oe[A.namespaceURI]))}(A)?(Ce(A),!0):"noscript"!==n&&"noembed"!==n||!b(/<\/no(script|embed)/i,A.innerHTML)?(MA&&3===A.nodeType&&(e=A.textContent,e=E(e,CA," "),e=E(e,UA," "),e=E(e,pA," "),A.textContent!==e&&(F(r.removed,{element:A.cloneNode()}),A.textContent=e)),me("afterSanitizeElements",A,null),!1):(Ce(A),!0)},Ee=function(A,e,t){if(XA&&("id"===e||"name"===e)&&(t in o||t in ce))return!1;if(DA&&!LA[e]&&b(FA,e));else if(kA&&b(fA,e));else if(!bA[e]||LA[e]){if(!(ye(A)&&(vA.tagNameCheck instanceof RegExp&&b(vA.tagNameCheck,A)||vA.tagNameCheck instanceof Function&&vA.tagNameCheck(A))&&(vA.attributeNameCheck instanceof RegExp&&b(vA.attributeNameCheck,e)||vA.attributeNameCheck instanceof Function&&vA.attributeNameCheck(e))||"is"===e&&vA.allowCustomizedBuiltInElements&&(vA.tagNameCheck instanceof RegExp&&b(vA.tagNameCheck,t)||vA.tagNameCheck instanceof Function&&vA.tagNameCheck(t))))return!1}else if($A[e]);else if(b(EA,E(t,HA,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===A||0!==y(t,"data:")||!qA[A])if(SA&&!b(mA,E(t,HA,"")));else if(t)return!1;return!0},ye=function(A){return A.indexOf("-")>0},Ie=function(e){var t,n,s,o;me("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var B={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:bA};for(o=i.length;o--;){var a=t=i[o],c=a.name,l=a.namespaceURI;if(n="value"===c?t.value:I(t.value),s=dA(c),B.attrName=s,B.attrValue=n,B.keepAttr=!0,B.forceKeepAttr=void 0,me("uponSanitizeAttribute",e,B),n=B.attrValue,!B.forceKeepAttr&&(Ue(c,e),B.keepAttr))if(TA||!b(/\/>/i,n)){MA&&(n=E(n,CA," "),n=E(n,UA," "),n=E(n,pA," "));var g=dA(e.nodeName);if(Ee(g,s,n)){if(!JA||"id"!==s&&"name"!==s||(Ue(c,e),n="user-content-"+n),iA&&"object"===A(C)&&"function"==typeof C.getAttributeType)if(l);else switch(C.getAttributeType(g,s)){case"TrustedHTML":n=iA.createHTML(n);break;case"TrustedScriptURL":n=iA.createScriptURL(n)}try{l?e.setAttributeNS(l,c,n):e.setAttribute(c,n),p(r.removed)}catch(A){}}}else Ue(c,e)}me("afterSanitizeAttributes",e,null)}},be=function A(e){var t,r=Fe(e);for(me("beforeSanitizeShadowDOM",e,null);t=r.nextNode();)me("uponSanitizeShadowNode",t,null),He(t)||(t.content instanceof B&&A(t.content),Ie(t));me("afterSanitizeShadowDOM",e,null)};return r.sanitize=function(A){var e,t,n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((se=!A)&&(A="\x3c!--\x3e"),"string"!=typeof A&&!fe(A)){if("function"!=typeof A.toString)throw K("toString is not a function");if("string"!=typeof(A=A.toString()))throw K("dirty is not a string, aborting")}if(!r.isSupported)return A;if(GA||ge(i),r.removed=[],"string"==typeof A&&(YA=!1),YA){if(A.nodeName){var a=dA(A.nodeName);if(!yA[a]||xA[a])throw K("root node is forbidden and cannot be sanitized in-place")}}else if(A instanceof c)1===(t=(e=pe("\x3c!----\x3e")).ownerDocument.importNode(A,!0)).nodeType&&"BODY"===t.nodeName||"HTML"===t.nodeName?e=t:e.appendChild(t);else{if(!VA&&!MA&&!OA&&-1===A.indexOf("<"))return iA&&PA?iA.createHTML(A):A;if(!(e=pe(A)))return VA?null:PA?BA:""}e&&RA&&Ce(e.firstChild);for(var l=Fe(YA?A:e);n=l.nextNode();)He(n)||(n.content instanceof B&&be(n.content),Ie(n));if(YA)return A;if(VA){if(NA)for(o=gA.call(e.ownerDocument);e.firstChild;)o.appendChild(e.firstChild);else o=e;return(bA.shadowroot||bA.shadowrootmod)&&(o=wA.call(s,o,!0)),o}var g=OA?e.outerHTML:e.innerHTML;return OA&&yA["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&b($,e.ownerDocument.doctype.name)&&(g="\n"+g),MA&&(g=E(g,CA," "),g=E(g,UA," "),g=E(g,pA," ")),iA&&PA?iA.createHTML(g):g},r.setConfig=function(A){ge(A),GA=!0},r.clearConfig=function(){ae=null,GA=!1},r.isValidAttribute=function(A,e,t){ae||ge({});var r=dA(A),n=dA(e);return Ee(r,n,t)},r.addHook=function(A,e){"function"==typeof e&&(QA[A]=QA[A]||[],F(QA[A],e))},r.removeHook=function(A){if(QA[A])return p(QA[A])},r.removeHooks=function(A){QA[A]&&(QA[A]=[])},r.removeAllHooks=function(){QA={}},r}()}()},120:function(A){A.exports=function(){"use strict";var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},A(e,t)};function e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var t=function(){return t=Object.assign||function(A){for(var e,t=1,r=arguments.length;t0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]=55296&&n<=56319&&t>10),o%1024+56320)),(n+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="undefined"==typeof Uint8Array?[]:new Uint8Array(256),g=0;g=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U="undefined"==typeof Uint8Array?[]:new Uint8Array(256),p=0;p>4,c[B++]=(15&r)<<4|n>>2,c[B++]=(3&n)<<6|63&s;return a}(A),o=Array.isArray(s)?function(A){for(var e=A.length,t=[],r=0;r0;){var o=r[--s];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var i=t;i<=r.length;){var B;if((B=r[++i])===e)return!0;if(B!==F)break}if(o!==F)break}return!1},nA=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==F)return r;t--}return 0},sA=function(A,e,t,r,n){if(0===t[r])return Y;var s=r-1;if(Array.isArray(n)&&!0===n[s])return Y;var o=s-1,i=s+1,B=e[s],a=o>=0?e[o]:0,c=e[i];if(2===B&&3===c)return Y;if(-1!==q.indexOf(B))return _;if(-1!==q.indexOf(c))return Y;if(-1!==j.indexOf(c))return Y;if(8===nA(s,e))return W;if(11===Z.get(A[s]))return Y;if((B===T||B===M)&&11===Z.get(A[i]))return Y;if(7===B||7===c)return Y;if(9===B)return Y;if(-1===[F,f,m].indexOf(B)&&9===c)return Y;if(-1!==[H,E,y,v,D].indexOf(c))return Y;if(nA(s,e)===K)return Y;if(rA(23,K,s,e))return Y;if(rA([H,E],b,s,e))return Y;if(rA(12,12,s,e))return Y;if(B===F)return W;if(23===B||23===c)return Y;if(16===c||16===B)return W;if(-1!==[f,m,b].indexOf(c)||14===B)return Y;if(36===a&&-1!==tA.indexOf(B))return Y;if(B===D&&36===c)return Y;if(c===I)return Y;if(-1!==z.indexOf(c)&&B===x||-1!==z.indexOf(B)&&c===x)return Y;if(B===k&&-1!==[R,T,M].indexOf(c)||-1!==[R,T,M].indexOf(B)&&c===L)return Y;if(-1!==z.indexOf(B)&&-1!==$.indexOf(c)||-1!==$.indexOf(B)&&-1!==z.indexOf(c))return Y;if(-1!==[k,L].indexOf(B)&&(c===x||-1!==[K,m].indexOf(c)&&e[i+1]===x)||-1!==[K,m].indexOf(B)&&c===x||B===x&&-1!==[x,D,v].indexOf(c))return Y;if(-1!==[x,D,v,H,E].indexOf(c))for(var l=s;l>=0;){if((g=e[l])===x)return Y;if(-1===[D,v].indexOf(g))break;l--}if(-1!==[k,L].indexOf(c))for(l=-1!==[H,E].indexOf(B)?o:s;l>=0;){var g;if((g=e[l])===x)return Y;if(-1===[D,v].indexOf(g))break;l--}if(V===B&&-1!==[V,N,O,G].indexOf(c)||-1!==[N,O].indexOf(B)&&-1!==[N,P].indexOf(c)||-1!==[P,G].indexOf(B)&&c===P)return Y;if(-1!==eA.indexOf(B)&&-1!==[I,L].indexOf(c)||-1!==eA.indexOf(c)&&B===k)return Y;if(-1!==z.indexOf(B)&&-1!==z.indexOf(c))return Y;if(B===v&&-1!==z.indexOf(c))return Y;if(-1!==z.concat(x).indexOf(B)&&c===K&&-1===J.indexOf(A[i])||-1!==z.concat(x).indexOf(c)&&B===E)return Y;if(41===B&&41===c){for(var u=t[s],w=1;u>0&&41===e[--u];)w++;if(w%2!=0)return Y}return B===T&&c===M?Y:W},oA=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],r=[],n=[];return A.forEach((function(A,s){var o=Z.get(A);if(o>50?(n.push(!0),o-=50):n.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return r.push(s),t.push(16);if(4===o||11===o){if(0===s)return r.push(s),t.push(S);var i=t[s-1];return-1===AA.indexOf(i)?(r.push(r[s-1]),t.push(i)):(r.push(s),t.push(S))}return r.push(s),31===o?t.push("strict"===e?b:R):o===X||29===o?t.push(S):43===o?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(R):t.push(S):void t.push(o)})),[r,t,n]}(A,e.lineBreak),r=t[0],n=t[1],s=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(n=n.map((function(A){return-1!==[x,S,X].indexOf(A)?R:A})));var o="keep-all"===e.wordBreak?s.map((function(e,t){return e&&A[t]>=19968&&A[t]<=40959})):void 0;return[r,n,o]},iA=function(){function A(A,e,t,r){this.codePoints=A,this.required=e===_,this.start=t,this.end=r}return A.prototype.slice=function(){return a.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),BA=45,aA=43,cA=-1,lA=function(A){return A>=48&&A<=57},gA=function(A){return lA(A)||A>=65&&A<=70||A>=97&&A<=102},uA=function(A){return 10===A||9===A||32===A},wA=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},QA=function(A){return wA(A)||lA(A)||A===BA},hA=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},dA=function(A,e){return 92===A&&10!==e},CA=function(A,e,t){return A===BA?wA(e)||dA(e,t):!!wA(A)||!(92!==A||!dA(A,e))},UA=function(A,e,t){return A===aA||A===BA?!!lA(e)||46===e&&lA(t):lA(46===A?e:A)},pA=function(A){var e=0,t=1;A[e]!==aA&&A[e]!==BA||(A[e]===BA&&(t=-1),e++);for(var r=[];lA(A[e]);)r.push(A[e++]);var n=r.length?parseInt(a.apply(void 0,r),10):0;46===A[e]&&e++;for(var s=[];lA(A[e]);)s.push(A[e++]);var o=s.length,i=o?parseInt(a.apply(void 0,s),10):0;69!==A[e]&&101!==A[e]||e++;var B=1;A[e]!==aA&&A[e]!==BA||(A[e]===BA&&(B=-1),e++);for(var c=[];lA(A[e]);)c.push(A[e++]);var l=c.length?parseInt(a.apply(void 0,c),10):0;return t*(n+i*Math.pow(10,-o))*Math.pow(10,B*l)},FA={type:2},fA={type:3},mA={type:4},HA={type:13},EA={type:8},yA={type:21},IA={type:9},bA={type:10},KA={type:11},vA={type:12},xA={type:14},LA={type:23},kA={type:1},DA={type:25},SA={type:24},TA={type:26},MA={type:27},OA={type:28},GA={type:29},RA={type:31},VA={type:32},NA=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(B(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==VA;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(QA(e)||dA(t,r)){var n=CA(e,t,r)?2:1;return{type:5,value:this.consumeName(),flags:n}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),HA;break;case 39:return this.consumeStringToken(39);case 40:return FA;case 41:return fA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),xA;break;case aA:if(UA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return mA;case BA:var s=A,o=this.peekCodePoint(0),i=this.peekCodePoint(1);if(UA(s,o,i))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(CA(s,o,i))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(o===BA&&62===i)return this.consumeCodePoint(),this.consumeCodePoint(),SA;break;case 46:if(UA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var B=this.consumeCodePoint();if(42===B&&47===(B=this.consumeCodePoint()))return this.consumeToken();if(B===cA)return this.consumeToken()}break;case 58:return TA;case 59:return MA;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===BA&&this.peekCodePoint(2)===BA)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 64:var c=this.peekCodePoint(0),l=this.peekCodePoint(1),g=this.peekCodePoint(2);if(CA(c,l,g))return{type:7,value:this.consumeName()};break;case 91:return OA;case 92:if(dA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return GA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case 123:return KA;case 125:return vA;case 117:case 85:var u=this.peekCodePoint(0),w=this.peekCodePoint(1);return u!==aA||!gA(w)&&63!==w||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),IA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),yA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),bA;break;case cA:return VA}return uA(A)?(this.consumeWhiteSpace(),RA):lA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):wA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:a(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();gA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(a.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),end:parseInt(a.apply(void 0,A.map((function(A){return 63===A?70:A}))),16)};var r=parseInt(a.apply(void 0,A),16);if(this.peekCodePoint(0)===BA&&gA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var n=[];gA(e)&&n.length<6;)n.push(e),e=this.consumeCodePoint();return{type:30,start:r,end:parseInt(a.apply(void 0,n),16)}}return{type:30,start:r,end:r}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA)return{type:22,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),LA)}for(;;){var r=this.consumeCodePoint();if(r===cA||41===r)return{type:22,value:a.apply(void 0,A)};if(uA(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:a.apply(void 0,A)}):(this.consumeBadUrlRemnants(),LA);if(34===r||39===r||40===r||hA(r))return this.consumeBadUrlRemnants(),LA;if(92===r){if(!dA(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),LA;A.push(this.consumeEscapedCodePoint())}else A.push(r)}},A.prototype.consumeWhiteSpace=function(){for(;uA(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===cA)return;dA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(5e4,A);e+=a.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var r=this._value[t];if(r===cA||void 0===r||r===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===r)return this._value.splice(0,t),kA;if(92===r){var n=this._value[t+1];n!==cA&&void 0!==n&&(10===n?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):dA(r,n)&&(e+=this.consumeStringSlice(t),e+=a(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==aA&&t!==BA||A.push(this.consumeCodePoint());lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===t&&lA(r))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===t||101===t)&&((r===aA||r===BA)&&lA(n)||lA(r)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[pA(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],r=this.peekCodePoint(0),n=this.peekCodePoint(1),s=this.peekCodePoint(2);return CA(r,n,s)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===r?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(gA(A)){for(var e=a(A);gA(this.peekCodePoint(0))&&e.length<6;)e+=a(this.consumeCodePoint());uA(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===cA?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(QA(e))A+=a(e);else{if(!dA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=a(this.consumeEscapedCodePoint())}}},A}(),PA=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new NA;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||jA(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?VA:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),XA=function(A){return 15===A.type},JA=function(A){return 17===A.type},_A=function(A){return 20===A.type},YA=function(A){return 0===A.type},WA=function(A,e){return _A(A)&&A.value===e},ZA=function(A){return 31!==A.type},zA=function(A){return 31!==A.type&&4!==A.type},qA=function(A){var e=[],t=[];return A.forEach((function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)})),t.length&&e.push(t),e},jA=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},$A=function(A){return 17===A.type||15===A.type},Ae=function(A){return 16===A.type||$A(A)},ee=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},te={type:17,number:0,flags:4},re={type:16,number:50,flags:4},ne={type:16,number:100,flags:4},se=function(A,e,t){var r=A[0],n=A[1];return[oe(r,e),oe(void 0!==n?n:r,t)]},oe=function(A,e){if(16===A.type)return A.number/100*e;if(XA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},ie="grad",Be="turn",ae=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case ie:return Math.PI/200*e.number;case"rad":return e.number;case Be:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},ce=function(A){return 15===A.type&&("deg"===A.unit||A.unit===ie||"rad"===A.unit||A.unit===Be)},le=function(A){switch(A.filter(_A).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[te,te];case"to top":case"bottom":return ge(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[te,ne];case"to right":case"left":return ge(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ne,ne];case"to bottom":case"top":return ge(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ne,te];case"to left":case"right":return ge(270)}return 0},ge=function(A){return Math.PI*A/180},ue=function(A,e){if(18===e.type){var t=Fe[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var r=e.value.substring(0,1),n=e.value.substring(1,2),s=e.value.substring(2,3);return he(parseInt(r+r,16),parseInt(n+n,16),parseInt(s+s,16),1)}if(4===e.value.length){r=e.value.substring(0,1),n=e.value.substring(1,2),s=e.value.substring(2,3);var o=e.value.substring(3,4);return he(parseInt(r+r,16),parseInt(n+n,16),parseInt(s+s,16),parseInt(o+o,16)/255)}if(6===e.value.length)return r=e.value.substring(0,2),n=e.value.substring(2,4),s=e.value.substring(4,6),he(parseInt(r,16),parseInt(n,16),parseInt(s,16),1);if(8===e.value.length)return r=e.value.substring(0,2),n=e.value.substring(2,4),s=e.value.substring(4,6),o=e.value.substring(6,8),he(parseInt(r,16),parseInt(n,16),parseInt(s,16),parseInt(o,16)/255)}if(20===e.type){var i=me[e.value.toUpperCase()];if(void 0!==i)return i}return me.TRANSPARENT},we=function(A){return 0==(255&A)},Qe=function(A){var e=255&A,t=255&A>>8,r=255&A>>16,n=255&A>>24;return e<255?"rgba("+n+","+r+","+t+","+e/255+")":"rgb("+n+","+r+","+t+")"},he=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r)<<0)>>>0},de=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},Ce=function(A,e){var t=e.filter(zA);if(3===t.length){var r=t.map(de),n=r[0],s=r[1],o=r[2];return he(n,s,o,1)}if(4===t.length){var i=t.map(de),B=(n=i[0],s=i[1],o=i[2],i[3]);return he(n,s,o,B)}return 0};function Ue(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var pe=function(A,e){var t=e.filter(zA),r=t[0],n=t[1],s=t[2],o=t[3],i=(17===r.type?ge(r.number):ae(A,r))/(2*Math.PI),B=Ae(n)?n.number/100:0,a=Ae(s)?s.number/100:0,c=void 0!==o&&Ae(o)?oe(o,1):1;if(0===B)return he(255*a,255*a,255*a,1);var l=a<=.5?a*(B+1):a+B-a*B,g=2*a-l,u=Ue(g,l,i+1/3),w=Ue(g,l,i),Q=Ue(g,l,i-1/3);return he(255*u,255*w,255*Q,c)},Fe={hsl:pe,hsla:pe,rgb:Ce,rgba:Ce},fe=function(A,e){return ue(A,PA.create(e).parseComponentValue())},me={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},He={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(_A(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Ee={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ye=function(A,e){var t=ue(A,e[0]),r=e[1];return r&&Ae(r)?{color:t,stop:r}:{color:t,stop:null}},Ie=function(A,e){var t=A[0],r=A[A.length-1];null===t.stop&&(t.stop=te),null===r.stop&&(r.stop=ne);for(var n=[],s=0,o=0;os?n.push(B):n.push(s),s=B}else n.push(null)}var a=null;for(o=0;oA.optimumDistance)?{optimumCorner:e,optimumDistance:i}:A}),{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},xe=function(A,e){var t=ge(180),r=[];return qA(e).forEach((function(e,n){if(0===n){var s=e[0];if(20===s.type&&-1!==["top","left","right","bottom"].indexOf(s.value))return void(t=le(e));if(ce(s))return void(t=(ae(A,s)+ge(270))%ge(360))}var o=ye(A,e);r.push(o)})),{angle:t,stops:r,type:1}},Le="closest-side",ke="farthest-side",De="closest-corner",Se="farthest-corner",Te="circle",Me="ellipse",Oe="cover",Ge="contain",Re=function(A,e){var t=0,r=3,n=[],s=[];return qA(e).forEach((function(e,o){var i=!0;if(0===o?i=e.reduce((function(A,e){if(_A(e))switch(e.value){case"center":return s.push(re),!1;case"top":case"left":return s.push(te),!1;case"right":case"bottom":return s.push(ne),!1}else if(Ae(e)||$A(e))return s.push(e),!1;return A}),i):1===o&&(i=e.reduce((function(A,e){if(_A(e))switch(e.value){case Te:return t=0,!1;case Me:return t=1,!1;case Ge:case Le:return r=0,!1;case ke:return r=1,!1;case De:return r=2,!1;case Oe:case Se:return r=3,!1}else if($A(e)||Ae(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return A}),i)),i){var B=ye(A,e);n.push(B)}})),{size:r,shape:t,stops:n,position:s,type:2}},Ve=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var r=Pe[e.name];if(void 0===r)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return r(A,e.values)}throw new Error("Unsupported image type "+e.type)};var Ne,Pe={"linear-gradient":function(A,e){var t=ge(180),r=[];return qA(e).forEach((function(e,n){if(0===n){var s=e[0];if(20===s.type&&"to"===s.value)return void(t=le(e));if(ce(s))return void(t=ae(A,s))}var o=ye(A,e);r.push(o)})),{angle:t,stops:r,type:1}},"-moz-linear-gradient":xe,"-ms-linear-gradient":xe,"-o-linear-gradient":xe,"-webkit-linear-gradient":xe,"radial-gradient":function(A,e){var t=0,r=3,n=[],s=[];return qA(e).forEach((function(e,o){var i=!0;if(0===o){var B=!1;i=e.reduce((function(A,e){if(B)if(_A(e))switch(e.value){case"center":return s.push(re),A;case"top":case"left":return s.push(te),A;case"right":case"bottom":return s.push(ne),A}else(Ae(e)||$A(e))&&s.push(e);else if(_A(e))switch(e.value){case Te:return t=0,!1;case Me:return t=1,!1;case"at":return B=!0,!1;case Le:return r=0,!1;case Oe:case ke:return r=1,!1;case Ge:case De:return r=2,!1;case Se:return r=3,!1}else if($A(e)||Ae(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return A}),i)}if(i){var a=ye(A,e);n.push(a)}})),{size:r,shape:t,stops:n,position:s,type:2}},"-moz-radial-gradient":Re,"-ms-radial-gradient":Re,"-o-radial-gradient":Re,"-webkit-radial-gradient":Re,"-webkit-gradient":function(A,e){var t=ge(180),r=[],n=1;return qA(e).forEach((function(e,t){var s=e[0];if(0===t){if(_A(s)&&"linear"===s.value)return void(n=1);if(_A(s)&&"radial"===s.value)return void(n=2)}if(18===s.type)if("from"===s.name){var o=ue(A,s.values[0]);r.push({stop:te,color:o})}else if("to"===s.name)o=ue(A,s.values[0]),r.push({stop:ne,color:o});else if("color-stop"===s.name){var i=s.values.filter(zA);if(2===i.length){o=ue(A,i[1]);var B=i[0];JA(B)&&r.push({stop:{type:16,number:100*B.number,flags:B.flags},color:o})}}})),1===n?{angle:(t+ge(180))%ge(360),stops:r,type:n}:{size:3,shape:0,stops:r,position:[],type:n}}},Xe={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter((function(A){return zA(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!Pe[A.name])}(A)})).map((function(e){return Ve(A,e)}))}},Je={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(_A(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},_e={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return qA(e).map((function(A){return A.filter(Ae)})).map(ee)}},Ye={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return qA(e).map((function(A){return A.filter(_A).map((function(A){return A.value})).join(" ")})).map(We)}},We=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(Ne||(Ne={}));var Ze,ze={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return qA(e).map((function(A){return A.filter(qe)}))}},qe=function(A){return _A(A)||Ae(A)},je=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},$e=je("top"),At=je("right"),et=je("bottom"),tt=je("left"),rt=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return ee(e.filter(Ae))}}},nt=rt("top-left"),st=rt("top-right"),ot=rt("bottom-right"),it=rt("bottom-left"),Bt=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},at=Bt("top"),ct=Bt("right"),lt=Bt("bottom"),gt=Bt("left"),ut=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return XA(e)?e.number:0}}},wt=ut("top"),Qt=ut("right"),ht=ut("bottom"),dt=ut("left"),Ct={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ut={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},pt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).reduce((function(A,e){return A|Ft(e.value)}),0)}},Ft=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},ft={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},mt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(Ze||(Ze={}));var Ht,Et={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Ze.STRICT:Ze.NORMAL}},yt={name:"line-height",initialValue:"normal",prefix:!1,type:4},It=function(A,e){return _A(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:Ae(A)?oe(A,e):e},bt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Ve(A,e)}},Kt={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},vt={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},xt=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},Lt=xt("top"),kt=xt("right"),Dt=xt("bottom"),St=xt("left"),Tt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).map((function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},Mt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},Ot=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Gt=Ot("top"),Rt=Ot("right"),Vt=Ot("bottom"),Nt=Ot("left"),Pt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Xt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Jt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&WA(e[0],"none")?[]:qA(e).map((function(e){for(var t={color:me.TRANSPARENT,offsetX:te,offsetY:te,blur:te},r=0,n=0;n1?1:0],this.overflowWrap=Hr(A,Mt,e.overflowWrap),this.paddingTop=Hr(A,Gt,e.paddingTop),this.paddingRight=Hr(A,Rt,e.paddingRight),this.paddingBottom=Hr(A,Vt,e.paddingBottom),this.paddingLeft=Hr(A,Nt,e.paddingLeft),this.paintOrder=Hr(A,Cr,e.paintOrder),this.position=Hr(A,Xt,e.position),this.textAlign=Hr(A,Pt,e.textAlign),this.textDecorationColor=Hr(A,rr,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=Hr(A,nr,null!==(r=e.textDecorationLine)&&void 0!==r?r:e.textDecoration),this.textShadow=Hr(A,Jt,e.textShadow),this.textTransform=Hr(A,_t,e.textTransform),this.transform=Hr(A,Yt,e.transform),this.transformOrigin=Hr(A,qt,e.transformOrigin),this.visibility=Hr(A,jt,e.visibility),this.webkitTextStrokeColor=Hr(A,Ur,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=Hr(A,pr,e.webkitTextStrokeWidth),this.wordBreak=Hr(A,$t,e.wordBreak),this.zIndex=Hr(A,Ar,e.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return we(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return 0!==this.position},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return 0!==this.float},A.prototype.isInlineLevel=function(){return cr(this.display,4)||cr(this.display,33554432)||cr(this.display,268435456)||cr(this.display,536870912)||cr(this.display,67108864)||cr(this.display,134217728)},A}(),fr=function(A,e){this.content=Hr(A,lr,e.content),this.quotes=Hr(A,Qr,e.quotes)},mr=function(A,e){this.counterIncrement=Hr(A,gr,e.counterIncrement),this.counterReset=Hr(A,ur,e.counterReset)},Hr=function(A,e,t){var r=new NA,n=null!=t?t.toString():e.initialValue;r.write(n);var s=new PA(r.read());switch(e.type){case 2:var o=s.parseComponentValue();return e.parse(A,_A(o)?o.value:e.initialValue);case 0:return e.parse(A,s.parseComponentValue());case 1:return e.parse(A,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(e.format){case"angle":return ae(A,s.parseComponentValue());case"color":return ue(A,s.parseComponentValue());case"image":return Ve(A,s.parseComponentValue());case"length":var i=s.parseComponentValue();return $A(i)?i:te;case"length-percentage":var B=s.parseComponentValue();return Ae(B)?B:te;case"time":return er.parse(A,s.parseComponentValue())}}},Er=function(A,e){var t=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A);return 1===t||e===t},yr=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Er(e,3),this.styles=new Fr(A,window.getComputedStyle(e,null)),Dn(e)&&(this.styles.animationDuration.some((function(A){return A>0}))&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=i(this.context,e),Er(e,4)&&(this.flags|=16)},Ir="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",br="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Kr=0;Kr=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Lr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dr=0;Dr>10),o%1024+56320)),(n+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},Vr=function(A,e){var t,r,n,s=function(A){var e,t,r,n,s,o=.75*A.length,i=A.length,B=0;"="===A[A.length-1]&&(o--,"="===A[A.length-2]&&o--);var a="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),c=Array.isArray(a)?a:new Uint8Array(a);for(e=0;e>4,c[B++]=(15&r)<<4|n>>2,c[B++]=(3&n)<<6|63&s;return a}(A),o=Array.isArray(s)?function(A){for(var e=A.length,t=[],r=0;r=55296&&n<=56319&&t=t)return{done:!0,value:null};for(var A=Nr;ro.x||n.y>o.y;return o=n,0===e||i}));return A.body.removeChild(e),i}(document);return Object.defineProperty(Zr,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(Zr,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var n=new Image,s=e.toDataURL();n.src=s;var o=Yr(t,t,0,0,n);return r.fillStyle="red",r.fillRect(0,0,t,t),Wr(o).then((function(e){r.drawImage(e,0,0);var n=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var o=A.createElement("div");return o.style.backgroundImage="url("+s+")",o.style.height=t+"px",_r(n)?Wr(Yr(t,t,0,0,o)):Promise.reject(!1)})).then((function(A){return r.drawImage(A,0,0),_r(r.getImageData(0,0,t,t).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(Zr,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Zr,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Zr,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Zr,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Zr,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},zr=function(A,e){this.text=A,this.bounds=e},qr=function(A,e,t,r){var n=en(e,t),s=[],i=0;return n.forEach((function(e){if(t.textDecorationLine.length||e.trim().length>0)if(Zr.SUPPORT_RANGE_BOUNDS){var n=$r(r,i,e.length).getClientRects();if(n.length>1){var B=An(e),a=0;B.forEach((function(e){s.push(new zr(e,o.fromDOMRectList(A,$r(r,a+i,e.length).getClientRects()))),a+=e.length}))}else s.push(new zr(e,o.fromDOMRectList(A,n)))}else{var c=r.splitText(e.length);s.push(new zr(e,jr(A,r))),r=c}else Zr.SUPPORT_RANGE_BOUNDS||(r=r.splitText(e.length));i+=e.length})),s},jr=function(A,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var n=e.parentNode;if(n){n.replaceChild(r,e);var s=i(A,r);return r.firstChild&&n.replaceChild(r.firstChild,r),s}}return o.EMPTY},$r=function(A,e,t){var r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");var n=r.createRange();return n.setStart(A,e),n.setEnd(A,e+t),n},An=function(A){if(Zr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map((function(A){return A.segment}))}return function(A){for(var e,t=Jr(A),r=[];!(e=t.next()).done;)e.value&&r.push(e.value.slice());return r}(A)},en=function(A,e){return 0!==e.letterSpacing?An(A):function(A,e){if(Zr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map((function(A){return A.segment}))}return rn(A,e)}(A,e)},tn=[32,160,4961,65792,65793,4153,4241],rn=function(A,e){for(var t,r=function(A,e){var t=B(A),r=oA(t,e),n=r[0],s=r[1],o=r[2],i=t.length,a=0,c=0;return{next:function(){if(c>=i)return{done:!0,value:null};for(var A=Y;c0?e+t.toUpperCase():A},an=function(A){function t(e,t){var r=A.call(this,e,t)||this;return r.src=t.currentSrc||t.src,r.intrinsicWidth=t.naturalWidth,r.intrinsicHeight=t.naturalHeight,r.context.cache.addImage(r.src),r}return e(t,A),t}(yr),cn=function(A){function t(e,t){var r=A.call(this,e,t)||this;return r.canvas=t,r.intrinsicWidth=t.width,r.intrinsicHeight=t.height,r}return e(t,A),t}(yr),ln=function(A){function t(e,t){var r=A.call(this,e,t)||this,n=new XMLSerializer,s=i(e,t);return t.setAttribute("width",s.width+"px"),t.setAttribute("height",s.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(t)),r.intrinsicWidth=t.width.baseVal.value,r.intrinsicHeight=t.height.baseVal.value,r.context.cache.addImage(r.svg),r}return e(t,A),t}(yr),gn=function(A){function t(e,t){var r=A.call(this,e,t)||this;return r.value=t.value,r}return e(t,A),t}(yr),un=function(A){function t(e,t){var r=A.call(this,e,t)||this;return r.start=t.start,r.reversed="boolean"==typeof t.reversed&&!0===t.reversed,r}return e(t,A),t}(yr),wn=[{type:15,flags:0,unit:"px",number:3}],Qn=[{type:16,flags:0,number:50}],hn=function(A){return A.width>A.height?new o(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width0)t.textNodes.push(new nn(A,n,t.styles));else if(kn(n))if(Wn(n)&&n.assignedNodes)n.assignedNodes().forEach((function(e){return In(A,e,t,r)}));else{var o=bn(A,n);o.styles.isVisible()&&(vn(n,o,r)?o.flags|=4:xn(o.styles)&&(o.flags|=2),-1!==yn.indexOf(n.tagName)&&(o.flags|=8),t.elements.push(o),n.slot,n.shadowRoot?In(A,n.shadowRoot,o,r):_n(n)||Gn(n)||Yn(n)||In(A,n,o,r))}},bn=function(A,e){return Pn(e)?new an(A,e):Vn(e)?new cn(A,e):Gn(e)?new ln(A,e):Tn(e)?new gn(A,e):Mn(e)?new un(A,e):On(e)?new fn(A,e):Yn(e)?new mn(A,e):_n(e)?new Hn(A,e):Xn(e)?new En(A,e):new yr(A,e)},Kn=function(A,e){var t=bn(A,e);return t.flags|=4,In(A,e,t,t),t},vn=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Rn(A)&&t.styles.isTransparent()},xn=function(A){return A.isPositioned()||A.isFloating()},Ln=function(A){return A.nodeType===Node.TEXT_NODE},kn=function(A){return A.nodeType===Node.ELEMENT_NODE},Dn=function(A){return kn(A)&&void 0!==A.style&&!Sn(A)},Sn=function(A){return"object"==typeof A.className},Tn=function(A){return"LI"===A.tagName},Mn=function(A){return"OL"===A.tagName},On=function(A){return"INPUT"===A.tagName},Gn=function(A){return"svg"===A.tagName},Rn=function(A){return"BODY"===A.tagName},Vn=function(A){return"CANVAS"===A.tagName},Nn=function(A){return"VIDEO"===A.tagName},Pn=function(A){return"IMG"===A.tagName},Xn=function(A){return"IFRAME"===A.tagName},Jn=function(A){return"STYLE"===A.tagName},_n=function(A){return"TEXTAREA"===A.tagName},Yn=function(A){return"SELECT"===A.tagName},Wn=function(A){return"SLOT"===A.tagName},Zn=function(A){return A.tagName.indexOf("-")>0},zn=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){return this.counters[A]||[]},A.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,r=A.counterReset,n=!0;null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(n=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)}));var s=[];return n&&r.forEach((function(A){var t=e.counters[A.counter];s.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)})),s},A}(),qn={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},jn={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},$n={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},As={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},es=function(A,e,t,r,n,s){return At?cs(A,n,s.length>0):r.integers.reduce((function(e,t,n){for(;A>=t;)A-=t,e+=r.values[n];return e}),"")+s},ts=function(A,e,t,r){var n="";do{t||A--,n=r(A)+n,A/=e}while(A*e>=e);return n},rs=function(A,e,t,r,n){var s=t-e+1;return(A<0?"-":"")+(ts(Math.abs(A),s,r,(function(A){return a(Math.floor(A%s)+e)}))+n)},ns=function(A,e,t){void 0===t&&(t=". ");var r=e.length;return ts(Math.abs(A),r,!1,(function(A){return e[Math.floor(A%r)]}))+t},ss=function(A,e,t,r,n,s){if(A<-9999||A>9999)return cs(A,4,n.length>0);var o=Math.abs(A),i=n;if(0===o)return e[0]+i;for(var B=0;o>0&&B<=4;B++){var a=o%10;0===a&&cr(s,1)&&""!==i?i=e[a]+i:a>1||1===a&&0===B||1===a&&1===B&&cr(s,2)||1===a&&1===B&&cr(s,4)&&A>100||1===a&&B>1&&cr(s,8)?i=e[a]+(B>0?t[B-1]:"")+i:1===a&&B>0&&(i=t[B-1]+i),o=Math.floor(o/10)}return(A<0?r:"")+i},os="十百千萬",is="拾佰仟萬",Bs="マイナス",as="마이너스",cs=function(A,e,t){var r=t?". ":"",n=t?"、":"",s=t?", ":"",o=t?" ":"";switch(e){case 0:return"•"+o;case 1:return"◦"+o;case 2:return"◾"+o;case 5:var i=rs(A,48,57,!0,r);return i.length<4?"0"+i:i;case 4:return ns(A,"〇一二三四五六七八九",n);case 6:return es(A,1,3999,qn,3,r).toLowerCase();case 7:return es(A,1,3999,qn,3,r);case 8:return rs(A,945,969,!1,r);case 9:return rs(A,97,122,!1,r);case 10:return rs(A,65,90,!1,r);case 11:return rs(A,1632,1641,!0,r);case 12:case 49:return es(A,1,9999,jn,3,r);case 35:return es(A,1,9999,jn,3,r).toLowerCase();case 13:return rs(A,2534,2543,!0,r);case 14:case 30:return rs(A,6112,6121,!0,r);case 15:return ns(A,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return ns(A,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return ss(A,"零一二三四五六七八九",os,"負",n,14);case 47:return ss(A,"零壹貳參肆伍陸柒捌玖",is,"負",n,15);case 42:return ss(A,"零一二三四五六七八九",os,"负",n,14);case 41:return ss(A,"零壹贰叁肆伍陆柒捌玖",is,"负",n,15);case 26:return ss(A,"〇一二三四五六七八九","十百千万",Bs,n,0);case 25:return ss(A,"零壱弐参四伍六七八九","拾百千万",Bs,n,7);case 31:return ss(A,"영일이삼사오육칠팔구","십백천만",as,s,7);case 33:return ss(A,"零一二三四五六七八九","十百千萬",as,s,0);case 32:return ss(A,"零壹貳參四五六七八九","拾百千",as,s,7);case 18:return rs(A,2406,2415,!0,r);case 20:return es(A,1,19999,As,3,r);case 21:return rs(A,2790,2799,!0,r);case 22:return rs(A,2662,2671,!0,r);case 22:return es(A,1,10999,$n,3,r);case 23:return ns(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return ns(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return rs(A,3302,3311,!0,r);case 28:return ns(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return ns(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return rs(A,3792,3801,!0,r);case 37:return rs(A,6160,6169,!0,r);case 38:return rs(A,4160,4169,!0,r);case 39:return rs(A,2918,2927,!0,r);case 40:return rs(A,1776,1785,!0,r);case 43:return rs(A,3046,3055,!0,r);case 44:return rs(A,3174,3183,!0,r);case 45:return rs(A,3664,3673,!0,r);case 46:return rs(A,3872,3881,!0,r);default:return rs(A,48,57,!0,r)}},ls="data-html2canvas-ignore",gs=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new zn,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,e){var t=this,s=ws(A,e);if(!s.contentWindow)return Promise.reject("Unable to find iframe window");var o=A.defaultView.pageXOffset,i=A.defaultView.pageYOffset,B=s.contentWindow,a=B.document,c=ds(s).then((function(){return r(t,void 0,void 0,(function(){var A,t;return n(this,(function(r){switch(r.label){case 0:return this.scrolledElements.forEach(fs),B&&(B.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||B.scrollY===e.top&&B.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(B.scrollX-e.left,B.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,hs(a)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(a,t)})).then((function(){return s}))]:[2,s]}}))}))}));return a.open(),a.write(ps(document.doctype)+""),Fs(this.referenceElement.ownerDocument,o,i),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),c},A.prototype.createElementClone=function(A){if(Er(A,2),Vn(A))return this.createCanvasClone(A);if(Nn(A))return this.createVideoClone(A);if(Jn(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Pn(e)&&(Pn(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),Zn(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return Us(A.style,e),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),r=A.cloneNode(!1);return r.textContent=t,r}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(e){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var r=A.cloneNode(!1);try{r.width=A.width,r.height=A.height;var n=A.getContext("2d"),s=r.getContext("2d");if(s)if(!this.options.allowTaint&&n)s.putImageData(n.getImageData(0,0,A.width,A.height),0,0);else{var o=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(o){var i=o.getContextAttributes();!1===(null==i?void 0:i.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}s.drawImage(A,0,0)}return r}catch(e){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return r},A.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(e){this.context.logger.info("Unable to clone video as it is tainted",A)}var r=A.ownerDocument.createElement("canvas");return r.width=A.offsetWidth,r.height=A.offsetHeight,r},A.prototype.appendChildNode=function(A,e,t){kn(e)&&("SCRIPT"===e.tagName||e.hasAttribute(ls)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&kn(e)&&Jn(e)||A.appendChild(this.cloneNode(e,t))},A.prototype.cloneChildNodes=function(A,e,t){for(var r=this,n=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;n;n=n.nextSibling)if(kn(n)&&Wn(n)&&"function"==typeof n.assignedNodes){var s=n.assignedNodes();s.length&&s.forEach((function(A){return r.appendChildNode(e,A,t)}))}else this.appendChildNode(e,n,t)},A.prototype.cloneNode=function(A,e){if(Ln(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&kn(A)&&(Dn(A)||Sn(A))){var r=this.createElementClone(A);r.style.transitionProperty="none";var n=t.getComputedStyle(A),s=t.getComputedStyle(A,":before"),o=t.getComputedStyle(A,":after");this.referenceElement===A&&Dn(r)&&(this.clonedReferenceElement=r),Rn(r)&&ys(r);var i=this.counters.parse(new mr(this.context,n)),B=this.resolvePseudoContent(A,r,s,Sr.BEFORE);Zn(A)&&(e=!0),Nn(A)||this.cloneChildNodes(A,r,e),B&&r.insertBefore(B,r.firstChild);var a=this.resolvePseudoContent(A,r,o,Sr.AFTER);return a&&r.appendChild(a),this.counters.pop(i),(n&&(this.options.copyStyles||Sn(A))&&!Xn(A)||e)&&Us(n,r),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([r,A.scrollLeft,A.scrollTop]),(_n(A)||Yn(A))&&(_n(r)||Yn(r))&&(r.value=A.value),r}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,r){var n=this;if(t){var s=t.content,o=e.ownerDocument;if(o&&s&&"none"!==s&&"-moz-alt-content"!==s&&"none"!==t.display){this.counters.parse(new mr(this.context,t));var i=new fr(this.context,t),B=o.createElement("html2canvaspseudoelement");Us(t,B),i.content.forEach((function(e){if(0===e.type)B.appendChild(o.createTextNode(e.value));else if(22===e.type){var t=o.createElement("img");t.src=e.value,t.style.opacity="1",B.appendChild(t)}else if(18===e.type){if("attr"===e.name){var r=e.values.filter(_A);r.length&&B.appendChild(o.createTextNode(A.getAttribute(r[0].value)||""))}else if("counter"===e.name){var s=e.values.filter(zA),a=s[0],c=s[1];if(a&&_A(a)){var l=n.counters.getCounterValue(a.value),g=c&&_A(c)?vt.parse(n.context,c.value):3;B.appendChild(o.createTextNode(cs(l,g,!1)))}}else if("counters"===e.name){var u=e.values.filter(zA),w=(a=u[0],u[1]);if(c=u[2],a&&_A(a)){var Q=n.counters.getCounterValues(a.value),h=c&&_A(c)?vt.parse(n.context,c.value):3,d=w&&0===w.type?w.value:"",C=Q.map((function(A){return cs(A,h,!1)})).join(d);B.appendChild(o.createTextNode(C))}}}else if(20===e.type)switch(e.value){case"open-quote":B.appendChild(o.createTextNode(hr(i.quotes,n.quoteDepth++,!0)));break;case"close-quote":B.appendChild(o.createTextNode(hr(i.quotes,--n.quoteDepth,!1)));break;default:B.appendChild(o.createTextNode(e.value))}})),B.className=ms+" "+Hs;var a=r===Sr.BEFORE?" "+ms:" "+Hs;return Sn(e)?e.className.baseValue+=a:e.className+=a,B}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(Sr||(Sr={}));var us,ws=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(ls,"true"),A.body.appendChild(t),t},Qs=function(A){return new Promise((function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()}))},hs=function(A){return Promise.all([].slice.call(A.images,0).map(Qs))},ds=function(A){return new Promise((function(e,t){var r=A.contentWindow;if(!r)return t("No window assigned for iframe");var n=r.document;r.onload=A.onload=function(){r.onload=A.onload=null;var t=setInterval((function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(t),e(A))}),50)}}))},Cs=["all","d","content"],Us=function(A,e){for(var t=A.length-1;t>=0;t--){var r=A.item(t);-1===Cs.indexOf(r)&&e.style.setProperty(r,A.getPropertyValue(r))}return e},ps=function(A){var e="";return A&&(e+=""),e},Fs=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},fs=function(A){var e=A[0],t=A[1],r=A[2];e.scrollLeft=t,e.scrollTop=r},ms="___html2canvas___pseudoelement_before",Hs="___html2canvas___pseudoelement_after",Es='{\n content: "" !important;\n display: none !important;\n}',ys=function(A){Is(A,"."+ms+":before"+Es+"\n ."+Hs+":after"+Es)},Is=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}},bs=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),Ks=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:Ts(A)||ks(A)?((this._cache[A]=this.loadImage(A)).catch((function(){})),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return r(this,void 0,void 0,(function(){var e,t,r,s,o=this;return n(this,(function(n){switch(n.label){case 0:return e=bs.isSameOrigin(A),t=!Ds(A)&&!0===this._options.useCORS&&Zr.SUPPORT_CORS_IMAGES&&!e,r=!Ds(A)&&!e&&!Ts(A)&&"string"==typeof this._options.proxy&&Zr.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||Ds(A)||Ts(A)||r||t?(s=A,r?[4,this.proxy(s)]:[3,2]):[2];case 1:s=n.sent(),n.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise((function(A,e){var r=new Image;r.onload=function(){return A(r)},r.onerror=e,(Ss(s)||t)&&(r.crossOrigin="anonymous"),r.src=s,!0===r.complete&&setTimeout((function(){return A(r)}),500),o._options.imageTimeout>0&&setTimeout((function(){return e("Timed out ("+o._options.imageTimeout+"ms) loading image")}),o._options.imageTimeout)}))];case 3:return[2,n.sent()]}}))}))},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var r=A.substring(0,256);return new Promise((function(n,s){var o=Zr.SUPPORT_RESPONSE_TYPE?"blob":"text",i=new XMLHttpRequest;i.onload=function(){if(200===i.status)if("text"===o)n(i.response);else{var A=new FileReader;A.addEventListener("load",(function(){return n(A.result)}),!1),A.addEventListener("error",(function(A){return s(A)}),!1),A.readAsDataURL(i.response)}else s("Failed to proxy resource "+r+" with status code "+i.status)},i.onerror=s;var B=t.indexOf("?")>-1?"&":"?";if(i.open("GET",""+t+B+"url="+encodeURIComponent(A)+"&responseType="+o),"text"!==o&&i instanceof XMLHttpRequest&&(i.responseType=o),e._options.imageTimeout){var a=e._options.imageTimeout;i.timeout=a,i.ontimeout=function(){return s("Timed out ("+a+"ms) proxying "+r)}}i.send()}))},A}(),vs=/^data:image\/svg\+xml/i,xs=/^data:image\/.*;base64,/i,Ls=/^data:image\/.*/i,ks=function(A){return Zr.SUPPORT_SVG_DRAWING||!Ms(A)},Ds=function(A){return Ls.test(A)},Ss=function(A){return xs.test(A)},Ts=function(A){return"blob"===A.substr(0,4)},Ms=function(A){return"svg"===A.substr(-3).toLowerCase()||vs.test(A)},Os=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Gs=function(A,e,t){return new Os(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Rs=function(){function A(A,e,t,r){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=r}return A.prototype.subdivide=function(e,t){var r=Gs(this.start,this.startControl,e),n=Gs(this.startControl,this.endControl,e),s=Gs(this.endControl,this.end,e),o=Gs(r,n,e),i=Gs(n,s,e),B=Gs(o,i,e);return t?new A(this.start,r,o,B):new A(B,i,s,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),Vs=function(A){return 1===A.type},Ns=function(A){var e=A.styles,t=A.bounds,r=se(e.borderTopLeftRadius,t.width,t.height),n=r[0],s=r[1],o=se(e.borderTopRightRadius,t.width,t.height),i=o[0],B=o[1],a=se(e.borderBottomRightRadius,t.width,t.height),c=a[0],l=a[1],g=se(e.borderBottomLeftRadius,t.width,t.height),u=g[0],w=g[1],Q=[];Q.push((n+i)/t.width),Q.push((u+c)/t.width),Q.push((s+w)/t.height),Q.push((B+l)/t.height);var h=Math.max.apply(Math,Q);h>1&&(n/=h,s/=h,i/=h,B/=h,c/=h,l/=h,u/=h,w/=h);var d=t.width-i,C=t.height-l,U=t.width-c,p=t.height-w,F=e.borderTopWidth,f=e.borderRightWidth,m=e.borderBottomWidth,H=e.borderLeftWidth,E=oe(e.paddingTop,A.bounds.width),y=oe(e.paddingRight,A.bounds.width),I=oe(e.paddingBottom,A.bounds.width),b=oe(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||s>0?Ps(t.left+H/3,t.top+F/3,n-H/3,s-F/3,us.TOP_LEFT):new Os(t.left+H/3,t.top+F/3),this.topRightBorderDoubleOuterBox=n>0||s>0?Ps(t.left+d,t.top+F/3,i-f/3,B-F/3,us.TOP_RIGHT):new Os(t.left+t.width-f/3,t.top+F/3),this.bottomRightBorderDoubleOuterBox=c>0||l>0?Ps(t.left+U,t.top+C,c-f/3,l-m/3,us.BOTTOM_RIGHT):new Os(t.left+t.width-f/3,t.top+t.height-m/3),this.bottomLeftBorderDoubleOuterBox=u>0||w>0?Ps(t.left+H/3,t.top+p,u-H/3,w-m/3,us.BOTTOM_LEFT):new Os(t.left+H/3,t.top+t.height-m/3),this.topLeftBorderDoubleInnerBox=n>0||s>0?Ps(t.left+2*H/3,t.top+2*F/3,n-2*H/3,s-2*F/3,us.TOP_LEFT):new Os(t.left+2*H/3,t.top+2*F/3),this.topRightBorderDoubleInnerBox=n>0||s>0?Ps(t.left+d,t.top+2*F/3,i-2*f/3,B-2*F/3,us.TOP_RIGHT):new Os(t.left+t.width-2*f/3,t.top+2*F/3),this.bottomRightBorderDoubleInnerBox=c>0||l>0?Ps(t.left+U,t.top+C,c-2*f/3,l-2*m/3,us.BOTTOM_RIGHT):new Os(t.left+t.width-2*f/3,t.top+t.height-2*m/3),this.bottomLeftBorderDoubleInnerBox=u>0||w>0?Ps(t.left+2*H/3,t.top+p,u-2*H/3,w-2*m/3,us.BOTTOM_LEFT):new Os(t.left+2*H/3,t.top+t.height-2*m/3),this.topLeftBorderStroke=n>0||s>0?Ps(t.left+H/2,t.top+F/2,n-H/2,s-F/2,us.TOP_LEFT):new Os(t.left+H/2,t.top+F/2),this.topRightBorderStroke=n>0||s>0?Ps(t.left+d,t.top+F/2,i-f/2,B-F/2,us.TOP_RIGHT):new Os(t.left+t.width-f/2,t.top+F/2),this.bottomRightBorderStroke=c>0||l>0?Ps(t.left+U,t.top+C,c-f/2,l-m/2,us.BOTTOM_RIGHT):new Os(t.left+t.width-f/2,t.top+t.height-m/2),this.bottomLeftBorderStroke=u>0||w>0?Ps(t.left+H/2,t.top+p,u-H/2,w-m/2,us.BOTTOM_LEFT):new Os(t.left+H/2,t.top+t.height-m/2),this.topLeftBorderBox=n>0||s>0?Ps(t.left,t.top,n,s,us.TOP_LEFT):new Os(t.left,t.top),this.topRightBorderBox=i>0||B>0?Ps(t.left+d,t.top,i,B,us.TOP_RIGHT):new Os(t.left+t.width,t.top),this.bottomRightBorderBox=c>0||l>0?Ps(t.left+U,t.top+C,c,l,us.BOTTOM_RIGHT):new Os(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=u>0||w>0?Ps(t.left,t.top+p,u,w,us.BOTTOM_LEFT):new Os(t.left,t.top+t.height),this.topLeftPaddingBox=n>0||s>0?Ps(t.left+H,t.top+F,Math.max(0,n-H),Math.max(0,s-F),us.TOP_LEFT):new Os(t.left+H,t.top+F),this.topRightPaddingBox=i>0||B>0?Ps(t.left+Math.min(d,t.width-f),t.top+F,d>t.width+f?0:Math.max(0,i-f),Math.max(0,B-F),us.TOP_RIGHT):new Os(t.left+t.width-f,t.top+F),this.bottomRightPaddingBox=c>0||l>0?Ps(t.left+Math.min(U,t.width-H),t.top+Math.min(C,t.height-m),Math.max(0,c-f),Math.max(0,l-m),us.BOTTOM_RIGHT):new Os(t.left+t.width-f,t.top+t.height-m),this.bottomLeftPaddingBox=u>0||w>0?Ps(t.left+H,t.top+Math.min(p,t.height-m),Math.max(0,u-H),Math.max(0,w-m),us.BOTTOM_LEFT):new Os(t.left+H,t.top+t.height-m),this.topLeftContentBox=n>0||s>0?Ps(t.left+H+b,t.top+F+E,Math.max(0,n-(H+b)),Math.max(0,s-(F+E)),us.TOP_LEFT):new Os(t.left+H+b,t.top+F+E),this.topRightContentBox=i>0||B>0?Ps(t.left+Math.min(d,t.width+H+b),t.top+F+E,d>t.width+H+b?0:i-H+b,B-(F+E),us.TOP_RIGHT):new Os(t.left+t.width-(f+y),t.top+F+E),this.bottomRightContentBox=c>0||l>0?Ps(t.left+Math.min(U,t.width-(H+b)),t.top+Math.min(C,t.height+F+E),Math.max(0,c-(f+y)),l-(m+I),us.BOTTOM_RIGHT):new Os(t.left+t.width-(f+y),t.top+t.height-(m+I)),this.bottomLeftContentBox=u>0||w>0?Ps(t.left+H+b,t.top+p,Math.max(0,u-(H+b)),w-(m+I),us.BOTTOM_LEFT):new Os(t.left+H+b,t.top+t.height-(m+I))};!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(us||(us={}));var Ps=function(A,e,t,r,n){var s=(Math.sqrt(2)-1)/3*4,o=t*s,i=r*s,B=A+t,a=e+r;switch(n){case us.TOP_LEFT:return new Rs(new Os(A,a),new Os(A,a-i),new Os(B-o,e),new Os(B,e));case us.TOP_RIGHT:return new Rs(new Os(A,e),new Os(A+o,e),new Os(B,a-i),new Os(B,a));case us.BOTTOM_RIGHT:return new Rs(new Os(B,e),new Os(B,e+i),new Os(A+o,a),new Os(A,a));case us.BOTTOM_LEFT:default:return new Rs(new Os(B,a),new Os(B-o,a),new Os(A,e+i),new Os(A,e))}},Xs=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Js=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},_s=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},Ys=function(A,e){this.path=A,this.target=e,this.type=1},Ws=function(A){this.opacity=A,this.type=2,this.target=6},Zs=function(A){return 1===A.type},zs=function(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))},qs=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},js=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new Ns(this.container),this.container.styles.opacity<1&&this.effects.push(new Ws(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new _s(t,r,n))}if(0!==this.container.styles.overflowX){var s=Xs(this.curves),o=Js(this.curves);zs(s,o)?this.effects.push(new Ys(s,6)):(this.effects.push(new Ys(s,2)),this.effects.push(new Ys(o,4)))}}return A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,r=this.effects.slice(0);t;){var n=t.effects.filter((function(A){return!Zs(A)}));if(e||0!==t.container.styles.position||!t.parent){if(r.unshift.apply(r,n),e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var s=Xs(t.curves),o=Js(t.curves);zs(s,o)||r.unshift(new Ys(o,6))}}else r.unshift.apply(r,n);t=t.parent}return r.filter((function(e){return cr(e.target,A)}))},A}(),$s=function(A,e,t,r){A.container.elements.forEach((function(n){var s=cr(n.flags,4),o=cr(n.flags,2),i=new js(n,A);cr(n.styles.display,2048)&&r.push(i);var B=cr(n.flags,8)?[]:r;if(s||o){var a=s||n.styles.isPositioned()?t:e,c=new qs(i);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var l=n.styles.zIndex.order;if(l<0){var g=0;a.negativeZIndex.some((function(A,e){return l>A.element.container.styles.zIndex.order?(g=e,!1):g>0})),a.negativeZIndex.splice(g,0,c)}else if(l>0){var u=0;a.positiveZIndex.some((function(A,e){return l>=A.element.container.styles.zIndex.order?(u=e+1,!1):u>0})),a.positiveZIndex.splice(u,0,c)}else a.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?a.nonPositionedFloats.push(c):a.nonPositionedInlineLevel.push(c);$s(i,c,s?c:t,B)}else n.styles.isInlineLevel()?e.inlineLevel.push(i):e.nonInlineLevel.push(i),$s(i,e,t,B);cr(n.flags,8)&&Ao(n,B)}))},Ao=function(A,e){for(var t=A instanceof un?A.start:1,r=A instanceof un&&A.reversed,n=0;n0&&A.intrinsicHeight>0){var r=so(A),n=Js(e);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(A){return r(this,void 0,void 0,(function(){var e,r,s,i,B,a,c,l,g,u,w,Q,h,d,C,U,p,F;return n(this,(function(n){switch(n.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,r=A.curves,s=e.styles,i=0,B=e.textNodes,n.label=1;case 1:return i0&&H>0&&(C=r.ctx.createPattern(Q,"repeat"),r.renderRepeat(p,C,y,I))):function(A){return 2===A.type}(t)&&(U=oo(A,e,[null,null,null]),p=U[0],F=U[1],f=U[2],m=U[3],H=U[4],E=0===t.position.length?[re]:t.position,y=oe(E[0],m),I=oe(E[E.length-1],H),b=function(A,e,t,r,n){var s=0,o=0;switch(A.size){case 0:0===A.shape?s=o=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):1===A.shape&&(s=Math.min(Math.abs(e),Math.abs(e-r)),o=Math.min(Math.abs(t),Math.abs(t-n)));break;case 2:if(0===A.shape)s=o=Math.min(Ke(e,t),Ke(e,t-n),Ke(e-r,t),Ke(e-r,t-n));else if(1===A.shape){var i=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(e),Math.abs(e-r)),B=ve(r,n,e,t,!0),a=B[0],c=B[1];o=i*(s=Ke(a-e,(c-t)/i))}break;case 1:0===A.shape?s=o=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):1===A.shape&&(s=Math.max(Math.abs(e),Math.abs(e-r)),o=Math.max(Math.abs(t),Math.abs(t-n)));break;case 3:if(0===A.shape)s=o=Math.max(Ke(e,t),Ke(e,t-n),Ke(e-r,t),Ke(e-r,t-n));else if(1===A.shape){i=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(e),Math.abs(e-r));var l=ve(r,n,e,t,!1);a=l[0],c=l[1],o=i*(s=Ke(a-e,(c-t)/i))}}return Array.isArray(A.size)&&(s=oe(A.size[0],r),o=2===A.size.length?oe(A.size[1],n):s),[s,o]}(t,y,I,m,H),K=b[0],v=b[1],K>0&&v>0&&(x=r.ctx.createRadialGradient(F+y,f+I,0,F+y,f+I,K),Ie(t.stops,2*K).forEach((function(A){return x.addColorStop(A.stop,Qe(A.color))})),r.path(p),r.ctx.fillStyle=x,K!==v?(L=A.bounds.left+.5*A.bounds.width,k=A.bounds.top+.5*A.bounds.height,S=1/(D=v/K),r.ctx.save(),r.ctx.translate(L,k),r.ctx.transform(1,0,0,D,0,0),r.ctx.translate(-L,-k),r.ctx.fillRect(F,S*(f-k)+k,m,H*S),r.ctx.restore()):r.ctx.fill())),n.label=6;case 6:return e--,[2]}}))},r=this,s=0,o=A.styles.backgroundImage.slice(0).reverse(),B.label=1;case 1:return s0?2!==a.style?[3,5]:[4,this.renderDashedDottedBorder(a.color,a.width,o,A.curves,2)]:[3,11]:[3,13];case 4:return n.sent(),[3,11];case 5:return 3!==a.style?[3,7]:[4,this.renderDashedDottedBorder(a.color,a.width,o,A.curves,3)];case 6:return n.sent(),[3,11];case 7:return 4!==a.style?[3,9]:[4,this.renderDoubleBorder(a.color,a.width,o,A.curves)];case 8:return n.sent(),[3,11];case 9:return[4,this.renderSolidBorder(a.color,o,A.curves)];case 10:n.sent(),n.label=11;case 11:o++,n.label=12;case 12:return i++,[3,3];case 13:return[2]}}))}))},t.prototype.renderDashedDottedBorder=function(A,e,t,s,o){return r(this,void 0,void 0,(function(){var r,i,B,a,c,l,g,u,w,Q,h,d,C,U,p,F;return n(this,(function(n){return this.ctx.save(),r=function(A,e){switch(e){case 0:return to(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return to(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return to(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return to(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(s,t),i=eo(s,t),2===o&&(this.path(i),this.ctx.clip()),Vs(i[0])?(B=i[0].start.x,a=i[0].start.y):(B=i[0].x,a=i[0].y),Vs(i[1])?(c=i[1].end.x,l=i[1].end.y):(c=i[1].x,l=i[1].y),g=0===t||2===t?Math.abs(B-c):Math.abs(a-l),this.ctx.beginPath(),3===o?this.formatPath(r):this.formatPath(i.slice(0,2)),u=e<3?3*e:2*e,w=e<3?2*e:e,3===o&&(u=e,w=e),Q=!0,g<=2*u?Q=!1:g<=2*u+w?(u*=h=g/(2*u+w),w*=h):(d=Math.floor((g+w)/(u+w)),C=(g-d*u)/(d-1),w=(U=(g-(d+1)*u)/d)<=0||Math.abs(w-C){var e=A&&A.__esModule?()=>A.default:()=>A;return t.d(e,{a:e}),e},t.d=(A,e)=>{for(var r in e)t.o(e,r)&&!t.o(A,r)&&Object.defineProperty(A,r,{enumerable:!0,get:e[r]})},t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),(()=>{"use strict";const A=A=>{A.style.height=0;const e=window.getComputedStyle(A),t=parseFloat(e.getPropertyValue("padding-top")),r=parseFloat(e.getPropertyValue("padding-bottom")),n=A.scrollHeight-t-r;A.style.height=`${n}px`};var e=t(856);let r={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const n=/[&<>"']/,s=new RegExp(n.source,"g"),o=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,i=new RegExp(o.source,"g"),B={"&":"&","<":"<",">":">",'"':""","'":"'"},a=A=>B[A];function c(A,e){if(e){if(n.test(A))return A.replace(s,a)}else if(o.test(A))return A.replace(i,a);return A}const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(A){return A.replace(l,((A,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const u=/(^|[^\[])\^/g;function w(A,e){A="string"==typeof A?A:A.source,e=e||"";const t={replace:(e,r)=>(r=(r=r.source||r).replace(u,"$1"),A=A.replace(e,r),t),getRegex:()=>new RegExp(A,e)};return t}const Q=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(A,e,t){if(A){let A;try{A=decodeURIComponent(g(t)).replace(Q,"").toLowerCase()}catch(A){return null}if(0===A.indexOf("javascript:")||0===A.indexOf("vbscript:")||0===A.indexOf("data:"))return null}e&&!h.test(t)&&(t=function(A,e){C[" "+A]||(U.test(A)?C[" "+A]=A+"/":C[" "+A]=E(A,"/",!0));const t=-1===(A=C[" "+A]).indexOf(":");return"//"===e.substring(0,2)?t?e:A.replace(p,"$1")+e:"/"===e.charAt(0)?t?e:A.replace(F,"$1")+e:A+e}(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch(A){return null}return t}const C={},U=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,F=/^([^:]+:\/*[^/]*)[\s\S]*$/,f={exec:function(){}};function m(A){let e,t,r=1;for(;r{let r=!1,n=e;for(;--n>=0&&"\\"===t[n];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(t[0].trim()||t.shift(),t.length>0&&!t[t.length-1].trim()&&t.pop(),t.length>e)t.splice(e);else for(;t.length1;)1&e&&(t+=A),e>>=1,A+=A;return t+A}function b(A,e,t,r){const n=e.href,s=e.title?c(e.title):null,o=A[1].replace(/\\([\[\]])/g,"$1");if("!"!==A[0].charAt(0)){r.state.inLink=!0;const A={type:"link",raw:t,href:n,title:s,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,A}return{type:"image",raw:t,href:n,title:s,text:c(o)}}class K{constructor(A){this.options=A||r}space(A){const e=this.rules.block.newline.exec(A);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(A){const e=this.rules.block.code.exec(A);if(e){const A=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?A:E(A,"\n")}}}fences(A){const e=this.rules.block.fences.exec(A);if(e){const A=e[0],t=function(A,e){const t=A.match(/^(\s+)(?:```)/);if(null===t)return e;const r=t[1];return e.split("\n").map((A=>{const e=A.match(/^\s+/);if(null===e)return A;const[t]=e;return t.length>=r.length?A.slice(r.length):A})).join("\n")}(A,e[3]||"");return{type:"code",raw:A,lang:e[2]?e[2].trim().replace(this.rules.inline._escapes,"$1"):e[2],text:t}}}heading(A){const e=this.rules.block.heading.exec(A);if(e){let A=e[2].trim();if(/#$/.test(A)){const e=E(A,"#");this.options.pedantic?A=e.trim():e&&!/ $/.test(e)||(A=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:A,tokens:this.lexer.inline(A)}}}hr(A){const e=this.rules.block.hr.exec(A);if(e)return{type:"hr",raw:e[0]}}blockquote(A){const e=this.rules.block.blockquote.exec(A);if(e){const A=e[0].replace(/^ *>[ \t]?/gm,""),t=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(A);return this.lexer.state.top=t,{type:"blockquote",raw:e[0],tokens:r,text:A}}}list(A){let e=this.rules.block.list.exec(A);if(e){let t,r,n,s,o,i,B,a,c,l,g,u,w=e[1].trim();const Q=w.length>1,h={type:"list",raw:"",ordered:Q,start:Q?+w.slice(0,-1):"",loose:!1,items:[]};w=Q?`\\d{1,9}\\${w.slice(-1)}`:`\\${w}`,this.options.pedantic&&(w=Q?w:"[*+-]");const d=new RegExp(`^( {0,3}${w})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;A&&(u=!1,e=d.exec(A))&&!this.rules.block.hr.test(A);){if(t=e[0],A=A.substring(t.length),a=e[2].split("\n",1)[0].replace(/^\t+/,(A=>" ".repeat(3*A.length))),c=A.split("\n",1)[0],this.options.pedantic?(s=2,g=a.trimLeft()):(s=e[2].search(/[^ ]/),s=s>4?1:s,g=a.slice(s),s+=e[1].length),i=!1,!a&&/^ *$/.test(c)&&(t+=c+"\n",A=A.substring(c.length+1),u=!0),!u){const e=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),n=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;A&&(l=A.split("\n",1)[0],c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!n.test(c))&&!o.test(c)&&!e.test(c)&&!r.test(A);){if(c.search(/[^ ]/)>=s||!c.trim())g+="\n"+c.slice(s);else{if(i)break;if(a.search(/[^ ]/)>=4)break;if(n.test(a))break;if(o.test(a))break;if(r.test(a))break;g+="\n"+c}i||c.trim()||(i=!0),t+=l+"\n",A=A.substring(l.length+1),a=c.slice(s)}}h.loose||(B?h.loose=!0:/\n *\n *$/.test(t)&&(B=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(g),r&&(n="[ ] "!==r[0],g=g.replace(/^\[[ xX]\] +/,""))),h.items.push({type:"list_item",raw:t,task:!!r,checked:n,loose:!1,text:g}),h.raw+=t}h.items[h.items.length-1].raw=t.trimRight(),h.items[h.items.length-1].text=g.trimRight(),h.raw=h.raw.trimRight();const C=h.items.length;for(o=0;o"space"===A.type)),e=A.length>0&&A.some((A=>/\n.*\n/.test(A.raw)));h.loose=e}if(h.loose)for(o=0;o$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"):e[3];return{type:"def",tag:A,raw:e[0],href:t,title:r}}}table(A){const e=this.rules.block.table.exec(A);if(e){const A={type:"table",header:H(e[1]).map((A=>({text:A}))),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(A.header.length===A.align.length){A.raw=e[0];let t,r,n,s,o=A.align.length;for(t=0;t({text:A})));for(o=A.header.length,r=0;r/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):c(e[0]):e[0]}}link(A){const e=this.rules.inline.link.exec(A);if(e){const A=e[2].trim();if(!this.options.pedantic&&/^$/.test(A))return;const e=E(A.slice(0,-1),"\\");if((A.length-e.length)%2==0)return}else{const A=function(A,e){if(-1===A.indexOf(e[1]))return-1;const t=A.length;let r=0,n=0;for(;n-1){const t=(0===e[0].indexOf("!")?5:4)+e[1].length+A;e[2]=e[2].substring(0,A),e[0]=e[0].substring(0,t).trim(),e[3]=""}}let t=e[2],r="";if(this.options.pedantic){const A=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(t);A&&(t=A[1],r=A[3])}else r=e[3]?e[3].slice(1,-1):"";return t=t.trim(),/^$/.test(A)?t.slice(1):t.slice(1,-1)),b(e,{href:t?t.replace(this.rules.inline._escapes,"$1"):t,title:r?r.replace(this.rules.inline._escapes,"$1"):r},e[0],this.lexer)}}reflink(A,e){let t;if((t=this.rules.inline.reflink.exec(A))||(t=this.rules.inline.nolink.exec(A))){let A=(t[2]||t[1]).replace(/\s+/g," ");if(A=e[A.toLowerCase()],!A){const A=t[0].charAt(0);return{type:"text",raw:A,text:A}}return b(t,A,t[0],this.lexer)}}emStrong(A,e,t=""){let r=this.rules.inline.emStrong.lDelim.exec(A);if(!r)return;if(r[3]&&t.match(/[\p{L}\p{N}]/u))return;const n=r[1]||r[2]||"";if(!n||n&&(""===t||this.rules.inline.punctuation.exec(t))){const t=r[0].length-1;let n,s,o=t,i=0;const B="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(B.lastIndex=0,e=e.slice(-1*A.length+t);null!=(r=B.exec(e));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(s=n.length,r[3]||r[4]){o+=s;continue}if((r[5]||r[6])&&t%3&&!((t+s)%3)){i+=s;continue}if(o-=s,o>0)continue;s=Math.min(s,s+o+i);const e=A.slice(0,t+r.index+(r[0].length-n.length)+s);if(Math.min(t,s)%2){const A=e.slice(1,-1);return{type:"em",raw:e,text:A,tokens:this.lexer.inlineTokens(A)}}const B=e.slice(2,-2);return{type:"strong",raw:e,text:B,tokens:this.lexer.inlineTokens(B)}}}}codespan(A){const e=this.rules.inline.code.exec(A);if(e){let A=e[2].replace(/\n/g," ");const t=/[^ ]/.test(A),r=/^ /.test(A)&&/ $/.test(A);return t&&r&&(A=A.substring(1,A.length-1)),A=c(A,!0),{type:"codespan",raw:e[0],text:A}}}br(A){const e=this.rules.inline.br.exec(A);if(e)return{type:"br",raw:e[0]}}del(A){const e=this.rules.inline.del.exec(A);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(A,e){const t=this.rules.inline.autolink.exec(A);if(t){let A,r;return"@"===t[2]?(A=c(this.options.mangle?e(t[1]):t[1]),r="mailto:"+A):(A=c(t[1]),r=A),{type:"link",raw:t[0],text:A,href:r,tokens:[{type:"text",raw:A,text:A}]}}}url(A,e){let t;if(t=this.rules.inline.url.exec(A)){let A,r;if("@"===t[2])A=c(this.options.mangle?e(t[0]):t[0]),r="mailto:"+A;else{let e;do{e=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(e!==t[0]);A=c(t[0]),r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:A,href:r,tokens:[{type:"text",raw:A,text:A}]}}}inlineText(A,e){const t=this.rules.inline.text.exec(A);if(t){let A;return A=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]):t[0]:c(this.options.smartypants?e(t[0]):t[0]),{type:"text",raw:t[0],text:A}}}}const v={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};v.def=w(v.def).replace("label",v._label).replace("title",v._title).getRegex(),v.bullet=/(?:[*+-]|\d{1,9}[.)])/,v.listItemStart=w(/^( *)(bull) */).replace("bull",v.bullet).getRegex(),v.list=w(v.list).replace(/bull/g,v.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+v.def.source+")").getRegex(),v._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",v._comment=/|$)/,v.html=w(v.html,"i").replace("comment",v._comment).replace("tag",v._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v.paragraph=w(v._paragraph).replace("hr",v.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v._tag).getRegex(),v.blockquote=w(v.blockquote).replace("paragraph",v.paragraph).getRegex(),v.normal=m({},v),v.gfm=m({},v.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),v.gfm.table=w(v.gfm.table).replace("hr",v.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v._tag).getRegex(),v.gfm.paragraph=w(v._paragraph).replace("hr",v.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",v.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v._tag).getRegex(),v.pedantic=m({},v.normal,{html:w("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",v._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:f,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(v.normal._paragraph).replace("hr",v.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",v.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const x={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:f,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(t="x"+t.toString(16)),r+="&#"+t+";";return r}x._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",x.punctuation=w(x.punctuation).replace(/punctuation/g,x._punctuation).getRegex(),x.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,x.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,x._comment=w(v._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),x.emStrong.lDelim=w(x.emStrong.lDelim).replace(/punct/g,x._punctuation).getRegex(),x.emStrong.rDelimAst=w(x.emStrong.rDelimAst,"g").replace(/punct/g,x._punctuation).getRegex(),x.emStrong.rDelimUnd=w(x.emStrong.rDelimUnd,"g").replace(/punct/g,x._punctuation).getRegex(),x._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,x._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,x._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,x.autolink=w(x.autolink).replace("scheme",x._scheme).replace("email",x._email).getRegex(),x._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,x.tag=w(x.tag).replace("comment",x._comment).replace("attribute",x._attribute).getRegex(),x._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,x._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,x._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,x.link=w(x.link).replace("label",x._label).replace("href",x._href).replace("title",x._title).getRegex(),x.reflink=w(x.reflink).replace("label",x._label).replace("ref",v._label).getRegex(),x.nolink=w(x.nolink).replace("ref",v._label).getRegex(),x.reflinkSearch=w(x.reflinkSearch,"g").replace("reflink",x.reflink).replace("nolink",x.nolink).getRegex(),x.normal=m({},x),x.pedantic=m({},x.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",x._label).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",x._label).getRegex()}),x.gfm=m({},x.normal,{escape:w(x.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\e+" ".repeat(t.length)));A;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(t=r.call({lexer:this},A,e))&&(A=A.substring(t.raw.length),e.push(t),!0)))))if(t=this.tokenizer.space(A))A=A.substring(t.raw.length),1===t.raw.length&&e.length>0?e[e.length-1].raw+="\n":e.push(t);else if(t=this.tokenizer.code(A))A=A.substring(t.raw.length),r=e[e.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?e.push(t):(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(t=this.tokenizer.fences(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.heading(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.hr(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.blockquote(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.list(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.html(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.def(A))A=A.substring(t.raw.length),r=e[e.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(r.raw+="\n"+t.raw,r.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(t=this.tokenizer.table(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.lheading(A))A=A.substring(t.raw.length),e.push(t);else{if(n=A,this.options.extensions&&this.options.extensions.startBlock){let e=1/0;const t=A.slice(1);let r;this.options.extensions.startBlock.forEach((function(A){r=A.call({lexer:this},t),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(n=A.substring(0,e+1))}if(this.state.top&&(t=this.tokenizer.paragraph(n)))r=e[e.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):e.push(t),s=n.length!==A.length,A=A.substring(t.raw.length);else if(t=this.tokenizer.text(A))A=A.substring(t.raw.length),r=e[e.length-1],r&&"text"===r.type?(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):e.push(t);else if(A){const e="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(A,e=[]){return this.inlineQueue.push({src:A,tokens:e}),e}inlineTokens(A,e=[]){let t,r,n,s,o,i,B=A;if(this.tokens.links){const A=Object.keys(this.tokens.links);if(A.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(B));)A.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(B=B.slice(0,s.index)+"["+I("a",s[0].length-2)+"]"+B.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(B));)B=B.slice(0,s.index)+"["+I("a",s[0].length-2)+"]"+B.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(B));)B=B.slice(0,s.index+s[0].length-2)+"++"+B.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;A;)if(o||(i=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(t=r.call({lexer:this},A,e))&&(A=A.substring(t.raw.length),e.push(t),!0)))))if(t=this.tokenizer.escape(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.tag(A))A=A.substring(t.raw.length),r=e[e.length-1],r&&"text"===t.type&&"text"===r.type?(r.raw+=t.raw,r.text+=t.text):e.push(t);else if(t=this.tokenizer.link(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.reflink(A,this.tokens.links))A=A.substring(t.raw.length),r=e[e.length-1],r&&"text"===t.type&&"text"===r.type?(r.raw+=t.raw,r.text+=t.text):e.push(t);else if(t=this.tokenizer.emStrong(A,B,i))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.codespan(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.br(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.del(A))A=A.substring(t.raw.length),e.push(t);else if(t=this.tokenizer.autolink(A,k))A=A.substring(t.raw.length),e.push(t);else if(this.state.inLink||!(t=this.tokenizer.url(A,k))){if(n=A,this.options.extensions&&this.options.extensions.startInline){let e=1/0;const t=A.slice(1);let r;this.options.extensions.startInline.forEach((function(A){r=A.call({lexer:this},t),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(n=A.substring(0,e+1))}if(t=this.tokenizer.inlineText(n,L))A=A.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(i=t.raw.slice(-1)),o=!0,r=e[e.length-1],r&&"text"===r.type?(r.raw+=t.raw,r.text+=t.text):e.push(t);else if(A){const e="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}else A=A.substring(t.raw.length),e.push(t);return e}}class S{constructor(A){this.options=A||r}code(A,e,t){const r=(e||"").match(/\S*/)[0];if(this.options.highlight){const e=this.options.highlight(A,r);null!=e&&e!==A&&(t=!0,A=e)}return A=A.replace(/\n$/,"")+"\n",r?'
'+(t?A:c(A,!0))+"
\n":"
"+(t?A:c(A,!0))+"
\n"}blockquote(A){return`
\n${A}
\n`}html(A){return A}heading(A,e,t,r){return this.options.headerIds?`${A}\n`:`${A}\n`}hr(){return this.options.xhtml?"
\n":"
\n"}list(A,e,t){const r=e?"ol":"ul";return"<"+r+(e&&1!==t?' start="'+t+'"':"")+">\n"+A+"\n"}listitem(A){return`
  • ${A}
  • \n`}checkbox(A){return" "}paragraph(A){return`

    ${A}

    \n`}table(A,e){return e&&(e=`${e}`),"\n\n"+A+"\n"+e+"
    \n"}tablerow(A){return`\n${A}\n`}tablecell(A,e){const t=e.header?"th":"td";return(e.align?`<${t} align="${e.align}">`:`<${t}>`)+A+`\n`}strong(A){return`${A}`}em(A){return`${A}`}codespan(A){return`${A}`}br(){return this.options.xhtml?"
    ":"
    "}del(A){return`${A}`}link(A,e,t){if(null===(A=d(this.options.sanitize,this.options.baseUrl,A)))return t;let r='",r}image(A,e,t){if(null===(A=d(this.options.sanitize,this.options.baseUrl,A)))return t;let r=`${t}":">",r}text(A){return A}}class T{strong(A){return A}em(A){return A}codespan(A){return A}del(A){return A}html(A){return A}text(A){return A}link(A,e,t){return""+t}image(A,e,t){return""+t}br(){return""}}class M{constructor(){this.seen={}}serialize(A){return A.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(A,e){let t=A,r=0;if(this.seen.hasOwnProperty(t)){r=this.seen[A];do{r++,t=A+"-"+r}while(this.seen.hasOwnProperty(t))}return e||(this.seen[A]=r,this.seen[t]=0),t}slug(A,e={}){const t=this.serialize(A);return this.getNextSafeSlug(t,e.dryrun)}}class O{constructor(A){this.options=A||r,this.options.renderer=this.options.renderer||new S,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new T,this.slugger=new M}static parse(A,e){return new O(e).parse(A)}static parseInline(A,e){return new O(e).parseInline(A)}parse(A,e=!0){let t,r,n,s,o,i,B,a,c,l,u,w,Q,h,d,C,U,p,F,f="";const m=A.length;for(t=0;t0&&"paragraph"===d.tokens[0].type?(d.tokens[0].text=p+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&"text"===d.tokens[0].tokens[0].type&&(d.tokens[0].tokens[0].text=p+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:p}):h+=p),h+=this.parse(d.tokens,Q),c+=this.renderer.listitem(h,U,C);f+=this.renderer.list(c,u,w);continue;case"html":f+=this.renderer.html(l.text);continue;case"paragraph":f+=this.renderer.paragraph(this.parseInline(l.tokens));continue;case"text":for(c=l.tokens?this.parseInline(l.tokens):l.text;t+1{r(A.text,A.lang,(function(e,t){if(e)return s(e);null!=t&&t!==A.text&&(A.text=t,A.escaped=!0),o--,0===o&&s()}))}),0))})),void(0===o&&s())}function r(A){if(A.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"

    An error occurred:

    "+c(A.message+"",!0)+"
    ";throw A}try{const t=D.lex(A,e);if(e.walkTokens){if(e.async)return Promise.all(G.walkTokens(t,e.walkTokens)).then((()=>O.parse(t,e))).catch(r);G.walkTokens(t,e.walkTokens)}return O.parse(t,e)}catch(A){r(A)}}G.options=G.setOptions=function(A){var e;return m(G.defaults,A),e=G.defaults,r=e,G},G.getDefaults=function(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}},G.defaults=r,G.use=function(...A){const e=G.defaults.extensions||{renderers:{},childTokens:{}};A.forEach((A=>{const t=m({},A);if(t.async=G.defaults.async||t.async,A.extensions&&(A.extensions.forEach((A=>{if(!A.name)throw new Error("extension name required");if(A.renderer){const t=e.renderers[A.name];e.renderers[A.name]=t?function(...e){let r=A.renderer.apply(this,e);return!1===r&&(r=t.apply(this,e)),r}:A.renderer}if(A.tokenizer){if(!A.level||"block"!==A.level&&"inline"!==A.level)throw new Error("extension level must be 'block' or 'inline'");e[A.level]?e[A.level].unshift(A.tokenizer):e[A.level]=[A.tokenizer],A.start&&("block"===A.level?e.startBlock?e.startBlock.push(A.start):e.startBlock=[A.start]:"inline"===A.level&&(e.startInline?e.startInline.push(A.start):e.startInline=[A.start]))}A.childTokens&&(e.childTokens[A.name]=A.childTokens)})),t.extensions=e),A.renderer){const e=G.defaults.renderer||new S;for(const t in A.renderer){const r=e[t];e[t]=(...n)=>{let s=A.renderer[t].apply(e,n);return!1===s&&(s=r.apply(e,n)),s}}t.renderer=e}if(A.tokenizer){const e=G.defaults.tokenizer||new K;for(const t in A.tokenizer){const r=e[t];e[t]=(...n)=>{let s=A.tokenizer[t].apply(e,n);return!1===s&&(s=r.apply(e,n)),s}}t.tokenizer=e}if(A.walkTokens){const e=G.defaults.walkTokens;t.walkTokens=function(t){let r=[];return r.push(A.walkTokens.call(this,t)),e&&(r=r.concat(e.call(this,t))),r}}G.setOptions(t)}))},G.walkTokens=function(A,e){let t=[];for(const r of A)switch(t=t.concat(e.call(G,r)),r.type){case"table":for(const A of r.header)t=t.concat(G.walkTokens(A.tokens,e));for(const A of r.rows)for(const r of A)t=t.concat(G.walkTokens(r.tokens,e));break;case"list":t=t.concat(G.walkTokens(r.items,e));break;default:G.defaults.extensions&&G.defaults.extensions.childTokens&&G.defaults.extensions.childTokens[r.type]?G.defaults.extensions.childTokens[r.type].forEach((function(A){t=t.concat(G.walkTokens(r[A],e))})):r.tokens&&(t=t.concat(G.walkTokens(r.tokens,e)))}return t},G.parseInline=function(A,e){if(null==A)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof A)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(A)+", string expected");y(e=m({},G.defaults,e||{}));try{const t=D.lexInline(A,e);return e.walkTokens&&G.walkTokens(t,e.walkTokens),O.parseInline(t,e)}catch(A){if(A.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"

    An error occurred:

    "+c(A.message+"",!0)+"
    ";throw A}},G.Parser=O,G.parser=O.parse,G.Renderer=S,G.TextRenderer=T,G.Lexer=D,G.lexer=D.lex,G.Tokenizer=K,G.Slugger=M,G.parse=G,G.options,G.setOptions,G.use,G.walkTokens,G.parseInline;const R=G,V=(O.parse,D.lex,A=>{A=(A=(A=A.replaceAll("&","&")).replaceAll("<","<")).replaceAll(">",">");const t=(0,e.sanitize)(R(A,{gfm:!0,breaks:!0})),r=N(t);for(const A of r.querySelectorAll("code"))A.innerHTML=A.innerHTML.replaceAll("&","&");return r}),N=A=>{var e=document.createElement("template");return e.innerHTML=A,e.content};var P=t(120),X=t.n(P);const J=()=>{const A=document.querySelectorAll(".api-key-status");A.forEach((A=>A.classList.remove("error"))),A.forEach((A=>A.classList.remove("success"))),A.forEach((A=>A.innerText=""))},_=()=>{const A=document.querySelectorAll(".api-key-status"),e=document.querySelector("#intro-continue");J(),e.classList.add("secondary");const t=localStorage.getItem("api-key");if(!t)return;A.forEach((A=>A.innerText="Checking..."));const r=(A=>fetch("https://api.openai.com/v1/models",{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A}`}}).then((A=>A.json())))(t);r.then((t=>{t.error?(A.forEach((A=>A.classList.add("error"))),"invalid_api_key"===t.error.code?A.forEach((A=>A.innerText="This API key doesn’t work.")):A.forEach((A=>A.innerText="There was an error when checking the API key."))):(A.forEach((A=>A.innerText="This API key is working!")),A.forEach((A=>A.classList.add("success"))),e.classList.remove("secondary"))}),(e=>{A.forEach((A=>A.innerText="There was an error when checking the API key.")),A.forEach((A=>A.classList.add("error")))}))};let Y=!1,W=!1;document.addEventListener("mousedown",(()=>{Y=!0,W=!1})),document.addEventListener("mousemove",(()=>{Y&&window.getSelection().toString().length>0&&(W=!0)})),document.addEventListener("mouseup",(()=>{Y=!1}));let Z=null;const z=A=>{let e=document.querySelector("#notification");e.className="notification show",e.innerText=A,Z&&clearInterval(Z),Z=setTimeout((()=>{e.className="notification"}),4e3)},q=A=>{for(const e of A.querySelectorAll("code, pre"))e.addEventListener("click",(A=>{W||(A.stopPropagation(),navigator.clipboard.writeText(e.innerText).then((()=>{z("Copied!")})).catch((A=>{z("Error copying text to clipboard:")})))}))},j=(A,e)=>{const t=document.querySelector("#output"),r=document.createElement("div");r.classList.add(`${e}-container`),t.appendChild(r);const n=document.createElement("div");n.classList.add(`${e}-bubble`),n.classList.add("message-bubble");const s=V(A);q(s),n.appendChild(s),r.appendChild(n);const o=document.createElement("span");return o.classList.add("copied-indicator"),r.appendChild(o),r};window.addEventListener("click",(()=>{const A=document.querySelectorAll(".copied-indicator");for(const e of A)e.innerText=""}));const $=A=>j(A,"response");window.addEventListener("load",(()=>{(()=>{const A=document.querySelectorAll("[data-persistent-name]"),e=A=>A.getAttribute("data-persistent-name");for(const t of A){const A=e(t);localStorage.getItem(A)||localStorage.setItem(A,t.value)}for(const t of A){const r=e(t);t.value=localStorage.getItem(r),t.addEventListener("input",(()=>{const n=t.value;localStorage.setItem(r,n),console.log("saving:",r,n);for(const t of A)e(t)===r&&(t.value=n)})),window.addEventListener("storage",(A=>{A.key===r&&(t.value=A.newValue)}))}})(),(()=>{window.addEventListener("storage",(A=>{"api-key"===A.key&&_()}));const A=document.querySelectorAll(".api-key-input");for(const e of A)e.addEventListener("input",(()=>{_()}));const e=localStorage.getItem("api-key"),t=document.querySelector("#intro-view");e||t.classList.remove("hidden"),document.querySelector("#intro-continue").addEventListener("click",(()=>{t.classList.add("hidden"),document.querySelector("#prompt").focus()}))})(),(()=>{const e=document.querySelector("#settings-view");document.querySelector("#settings-button").addEventListener("click",(()=>{e.classList.remove("hidden"),J();for(const e of document.querySelectorAll("textarea"))A(e)})),document.querySelector("#settings-exit-button").addEventListener("click",(()=>{e.classList.add("hidden")})),document.querySelector("#settings-show-intro").addEventListener("click",(()=>{e.classList.add("hidden"),document.querySelector("#intro-view").classList.remove("hidden"),_()}))})();let e=[{role:"system",content:localStorage.getItem("initial-system-message")}];document.querySelector("#screenshot-button").addEventListener("click",(()=>{(()=>{const A=document.querySelector("#output"),e=getComputedStyle(document.body).backgroundColor;X()(A,{backgroundColor:e}).then((A=>{const e=A.toDataURL("image/png"),t=document.createElement("a");t.href=e,t.download="assistant.png",document.body.appendChild(t),t.click(),document.body.removeChild(t)}))})()})),document.querySelector("#save-md-button").addEventListener("click",(()=>{(A=>{const e=A.map((A=>{return`## ${e=A.role,e[0].toUpperCase()+e.slice(1)}\n${A.content}`;var e})).join("\n\n"),t="data:text/markdown;charset=utf-8,"+encodeURIComponent(e),r=document.createElement("a");r.href=t,r.download="assistant.md",document.body.appendChild(r),r.click(),document.body.removeChild(r)})(e)}));const t=A=>{(()=>{for(const A of document.querySelectorAll(".error"))A.remove()})(),(A=>{j(A,"my-message")})(A);const t=$("● ● ●");document.body.scrollIntoView({block:"end",behavior:"smooth"}),e.push({role:"user",content:A});const r=localStorage.getItem("api-key"),n=(()=>{const A=document.querySelector("#model-select");return A.options[A.selectedIndex].value})();let s={},o=null;const i=parseInt(localStorage.getItem("maximum-messages"))+1;((A,e,t)=>{e.model||(e.model="gpt-3.5-turbo"),e.stream=!0,fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A}`},body:JSON.stringify(e)}).then((A=>{const e=A.body.getReader();let r="";const n=({done:A,value:s})=>{if(A)return;const o=new TextDecoder("utf-8");for(r+=o.decode(s);-1!==r.indexOf("\n");){const A=r.indexOf("\n"),e=r.substring(0,A);r=r.substring(A+1);const n=e.replace("data: ","");if(!n)continue;if("[DONE]"===n)return;let s;try{s=JSON.parse(n)}catch(A){r=e+r;continue}t(s)}e.read().then(n)};e.read().then(n).catch((A=>{console.error("Error reading stream:",A),e.cancel()}))})).catch((A=>{console.error("Error:",A)}))})(r,{messages:[e[0],...e.slice(1).slice(-i)],model:n},(A=>{t.remove();const r=(()=>{const{scrollTop:A,clientHeight:e,scrollHeight:t}=document.documentElement;return A+e>=t})();if("error"in A)((A,e)=>{const t=document.querySelector("#output"),r=document.createElement("div");r.classList.add("assistant-container"),r.classList.add("error"),t.appendChild(r),r.innerText=A})(A.error.message);else if("choices"in A){const t=A.choices[0].delta;if("role"in t&&(s={role:t.role,content:""},e.push(s),o=$(s.content)),"content"in t){s.content+=t.content,o.firstChild.innerHTML="";const A=V(s.content+"\n");q(A),o.firstChild.appendChild(A)}}r&&window.scrollTo(0,document.body.scrollHeight)}))},r=(()=>{const A={};return window.location.hash.substring(1).split("&").forEach((e=>{const[t,r]=e.split("=");A[decodeURIComponent(t)]=decodeURIComponent(r)})),A})();"q"in r&&r.q&&t(r.q);const n=()=>{const e=document.querySelector("#prompt").value;document.querySelector("#prompt").value="",A(s),t(e)},s=document.querySelector("#prompt");s.addEventListener("keydown",(A=>{13!==A.keyCode||A.ctrlKey||A.altKey||A.shiftKey||(A.preventDefault(),n())})),document.querySelector("form").addEventListener("submit",(A=>{A.preventDefault(),n()}));for(const e of document.querySelectorAll("textarea"))e.addEventListener("input",(()=>{A(e)})),A(e);document.addEventListener("keydown",(A=>{A.ctrlKey&&"m"===A.key.toLowerCase()&&o("model-select")}));const o=A=>{const e=document.querySelector(`#${A}`);e.selectedIndex{console.log("ServiceWorker registration successful with scope: ",A.scope)}),(A=>{console.log("ServiceWorker registration failed: ",A)}))})()})(); \ No newline at end of file diff --git a/main-91dd706c02280dbca272.js.LICENSE.txt b/main-91dd706c02280dbca272.js.LICENSE.txt new file mode 100644 index 0000000..b1e2749 --- /dev/null +++ b/main-91dd706c02280dbca272.js.LICENSE.txt @@ -0,0 +1,22 @@ +/*! + * html2canvas 1.4.1 + * Copyright (c) 2022 Niklas von Hertzen + * Released under MIT License + */ + +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + +/*! @license DOMPurify 3.0.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.1/LICENSE */ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..9fbbbc7 --- /dev/null +++ b/manifest.json @@ -0,0 +1,12 @@ +{ + "name": "Assistant", + "start_url": "/", + "display": "standalone", + "icons": [ + { + "src": "icon.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/service-worker.js b/service-worker.js new file mode 100644 index 0000000..535207e --- /dev/null +++ b/service-worker.js @@ -0,0 +1 @@ +if(!self.define){let e,i={};const n=(n,r)=>(n=new URL(n+".js",r).href,i[n]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()})).then((()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(r,s)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(i[c])return;let o={};const t=e=>n(e,c),d={module:{uri:c},exports:o,require:t};i[c]=Promise.all(r.map((e=>d[e]||t(e)))).then((e=>(s(...e),o)))}}define(["./workbox-f2a038d9"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"icon.png",revision:"6f4cc305bb1e9639229b0d2780d4e588"},{url:"index.html",revision:"9b403142ab08d58948218ffb2befaf58"},{url:"main-91dd706c02280dbca272.js",revision:null},{url:"main-91dd706c02280dbca272.js.LICENSE.txt",revision:"0cf4c93a7c799beaa8070f78e23572cf"},{url:"manifest.json",revision:"53cf856572289cd019b7db411ecae230"},{url:"style-e55085ecd9d56c5327ec.css",revision:null}],{}),e.registerRoute(/$/,new e.StaleWhileRevalidate,"GET")})); diff --git a/style-e55085ecd9d56c5327ec.css b/style-e55085ecd9d56c5327ec.css new file mode 100644 index 0000000..ac1163a --- /dev/null +++ b/style-e55085ecd9d56c5327ec.css @@ -0,0 +1,488 @@ +:root { + --bg: white; + --compose-box-bg: hsl(0, 0%, 100%, 0.7); + --fg: black; + --my-message-bg: hsl(215, 90%, 50%); + --my-message-fg: white; + --response-bg: hsl(0, 0%, 91%); + --link: hsl(215, 100%, 45%); + --input-border: hsla(0, 0%, 0%, 20%); + --settings-icon-border: hsla(0, 0%, 0%, 40%); + --info: hsl(120, 50%, 80%); + --info-link: hsl(210, 100%, 30%); + --error-fg: hsl(5, 70%, 50%); + --success-fg: hsl(140, 70%, 30%); + --code-bg: hsla(0, 0%, 100%, 0.7); + --code-border: hsla(0, 0%, 0%, 0.15); + --my-message-code-bg: hsla(0, 0%, 0%, 0.2); + --my-message-code-border: hsla(0, 0%, 0%, 0.15); + + --chat-max-width: 50em; + --block-border-radius: 0.5em; +} + +html { + -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape while allowing user zoom */ +} + +body { + margin: 0; + font-family: sans-serif; + line-height: 140%; + background-color: var(--bg); + color: var(--fg); + display: flex; + justify-content: center; +} + +.container { + width: var(--chat-max-width); + padding: 0.7em 1em; + margin-left: env(safe-area-inset-left); + margin-right: env(safe-area-inset-right); + margin-bottom: calc(4em + env(safe-area-inset-bottom)); + max-width: calc(100% - 2em); /* Don't overflow the window with over-sized texts. Subtract paddings */ +} + +#settings-button, #settings-exit-button { + float: right; + margin-right: -0.1em; + height: 25px; +} + +#settings-button:hover, #settings-exit-button:hover { + opacity: 80%; + cursor: pointer; +} + +/* From https://gist.github.com/MoOx/9137295 */ +.reset-button { + border: none; + margin: 0; + padding: 0; + width: auto; + overflow: visible; + + background: transparent; + + /* inherit font & color from ancestor */ + color: inherit; + font: inherit; + + /* Normalize `line-height`. Cannot be changed from `normal` in Firefox 4+. */ + line-height: normal; + + /* Corrects font smoothing for webkit */ + -webkit-font-smoothing: inherit; + -moz-osx-font-smoothing: inherit; + + /* Corrects inability to style clickable `input` types in iOS */ + -webkit-appearance: none; +} + + +.full-window-overlay { + position: absolute; + box-sizing: border-box; + min-height: 100vh; + width: 100%; + padding-left: calc(max((100vw - var(--chat-max-width))/2, 1em + env(safe-area-inset-left))); + padding-right: calc(max((100vw - var(--chat-max-width))/2, 1em + env(safe-area-inset-right))); + padding-bottom: calc(0.8em + env(safe-area-inset-bottom)); + padding-top: 0.7em; + z-index: 2; + background-color: var(--compose-box-bg); + backdrop-filter: blur(20px); + -webkit-backdrop-filter: blur(20px); /* Needed for Safari in 2023 */ +} + +#settings-view h1 { + margin-top: 0.3em; +} + +#settings-view h2 { + font-weight: 400; + font-size: 1.3em; + margin: 1em 0 0.6em 0; +} + +#settings-view input, #settings-view .textarea-border-radius { + margin: 0.2em 0; +} + +#system-message { + max-height: 20vh; +} + +.assistant-icon-container { + text-align: center; + margin-top: 2em; + margin-bottom: 2em; +} + +.assistant-icon { + width: 7em; + border-radius: 1.5em; +} + +.start-view { + background-color: var(--info); + padding: 1em; + border-radius: 1em; + display: inline-block; + margin: 1em 0; + font-size: 1.1em; +} + +.start-view a, .start-view a:visited { + color: var(--info-link); + text-decoration: underline; +} + +#compose-box { + background-color: var(--compose-box-bg); + backdrop-filter: blur(20px); + -webkit-backdrop-filter: blur(20px); /* Needed for Safari in 2023 */ + position: fixed; + bottom: 0; + + width: 100%; + box-sizing: border-box; + padding: 0.9em; + padding-left: calc(max(0.9em + env(safe-area-inset-left), (100% - var(--chat-max-width))/2)); + padding-right: calc(max(0.9em + env(safe-area-inset-right), (100% - var(--chat-max-width))/2)); + padding-bottom: calc(0.8em + env(safe-area-inset-bottom)); + + display: flex; + justify-content: space-between; +} + +#prompt { + font-size: 1.1em; + margin: 0; + max-height: 70vh; +} + +#submit { + margin: 0; +} + +#prompt-container { + flex: 1; + margin-right: 0.5em; +} + +input { + font-size: 16px; +} + +.response-container { + display: flex; + align-items: start; + flex-direction: column; +} + +.my-message-container { + display: flex; + align-items: end; + flex-direction: column; +} + +.message-bubble { + margin-top: 0.6em; + display: inline-block; + padding-top: 0.1em; + padding-bottom: 0.15em; + padding-left: 0.8em; + padding-right: 0.8em; + border-radius: 1.0em; + max-width: 100%; + box-sizing: border-box; + word-wrap: break-word; +} + +.response-bubble { + background-color: var(--response-bg); + color: var(--fg); +} + +.my-message-bubble { + background-color: var(--my-message-bg); + color: var(--my-message-fg); +} + +.my-message-bubble a { + color: var(--my-message-fg); + text-decoration: underline; +} + +.my-message-bubble a:hover { + text-decoration-thickness: 2px; +} + +.error { + color: var(--error-fg); +} + +.success { + color: var(--success-fg); +} + +.copied-indicator { + font-size: 0.8em; +} + +hr { + border: none; + border-top: 1px solid var(--input-border); + background: none; + margin: 1.4em 0; +} + +p { + margin: 0.5em 0; +} + +br { + line-height: inherit; +} + +code { + white-space: pre-wrap; + border: 1px solid var(--code-border); + border-radius: 0.4em; + padding: 0.1em 0.3em; + background-color: var(--code-bg); +} + +pre > code { + border: none; + padding: 0; + color: var(--fg); + background: none; +} + +pre { + border: 1px solid var(--code-border); + border-radius: var(--block-border-radius); + padding: 0.5em 0.9em; + background-color: var(--code-bg); +} + +pre, code { + cursor: pointer; +} + +.my-message-bubble code { + color: var(--my-message-fg); + border: 1px solid var(--my-message-code-border); + background-color: var(--my-message-code-bg); +} + +.my-message-bubble pre > code { + border: none; + background: none; +} + +.my-message-bubble pre { + border: 1px solid var(--my-message-code-border); + background-color: var(--my-message-code-bg); +} + + +table { + border-collapse: separate; + border-spacing: 0; + margin: 1em 0; +} + +th, td { + border: 1px solid var(--code-border); + padding: 0.4em 0.7em; + background-color: var(--code-bg); +} + +/* Border drawing logic */ +th { border-style: solid solid solid none; } +th:first-child { border-left-style: solid; } +td { border-style: none solid solid none; } +td:first-child { border-left-style: solid; } + +/* Rounded corners */ +tr:first-child th:first-child { border-top-left-radius: var(--block-border-radius); } +tr:first-child th:last-child { border-top-right-radius: var(--block-border-radius); } +tr:last-child td:first-child { border-bottom-left-radius: var(--block-border-radius); } +tr:last-child td:last-child { border-bottom-right-radius: var(--block-border-radius); } + +/* Colors in my messages */ +.my-message-bubble th, .my-message-bubble td { + border-color: var(--my-message-code-border); + background-color: var(--my-message-code-bg); +} + + +.message-bubble img { + width: 100%; +} + +a, a:visited { + text-decoration: none; + color: var(--link); +} + +a:hover { + text-decoration: underline; +} + +.disclaimer { + font-size: 0.75em; + line-height: 130%; + margin: 0.35em 0; +} + +footer { + margin-top: 10px; + font-size: 0.7em; + opacity: 70%; +} + +input[type=text], input[type=number], textarea { + font-family: -apple-system, sans-serif; + line-height: 120%; + background-color: var(--bg); + color: var(--fg); + border: 1px solid var(--input-border); + padding: 0.2em 0.5em; + border-radius: 1em; +} + +.textarea-border-radius { + border-radius: 1em; + overflow: hidden; + display: flex; + border: 1px solid var(--input-border); +} + +.textarea-border-radius > textarea { + margin: -1px !important; + border: none; + flex: 1; +} + +input[type=number] { + width: 5em; +} + +input[type=text]:focus, input[type=number]:focus, textarea:focus { + outline: none; +} + +textarea { + resize: none; + height: auto; + padding: 0.3em 0.7em; + font-size: 1em; +} + +button { + background-color: var(--my-message-bg); + color: var(--my-message-fg); + border: none; + padding: 0.4em 0.8em; + border-radius: 1em; + font-size: 1em; + margin: 0.2em 0; + font-weight: 500; +} + +button.secondary { + background-color: var(--response-bg); + color: var(--fg); +} + +select { + font-family: -apple-system, sans-serif; + line-height: 120%; + background-color: var(--bg); + color: var(--fg); + border: 1px solid var(--input-border); + padding: 0.2em 0.5em; + border-radius: 1em; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: right 0.5em center; + background-size: 14px; + padding-right: 2em; + font-size: 1em; +} + +select:focus { + outline: none; +} + +.hidden { + display: none !important; +} + + +.notification { + visibility: hidden; + min-width: 100px; + margin-left: -50px; + box-sizing: border-box; + background-color: var(--fg); + color: var(--bg); + text-align: center; + border-radius: 1em; + padding: 0.8em; + position: fixed; + z-index: 1; + left: 50%; + top: 1.5em; + font-size: 1em; +} + +.show { + visibility: visible !important; + animation: fadein 0.35s ease, fadeout 0.5s ease 3.65s; +} + +@keyframes fadein { + from {top: 0; opacity: 0;} + to {top: 1.5em; opacity: 1;} +} + +@keyframes fadeout { + from {top: 1.5em; opacity: 1;} + to {top: 0; opacity: 0;} +} + + +@media (prefers-color-scheme: dark) { + :root { + --bg: hsl(215, 20%, 9%); + --compose-box-bg: hsl(215, 20%, 9%, 0.7); + --fg: hsl(0, 0%, 95%); + --my-message-bg: hsl(215, 75%, 48%); + --my-message-fg: white; + --response-bg: hsl(215, 15%, 20%); + --link: hsl(215, 100%, 65%); + --input-border: hsla(0, 0%, 90%, 40%); + --settings-icon-border: hsla(0, 0%, 100%, 50%); + --info: hsl(130, 30%, 25%); + --info-link: hsl(220, 100%, 85%); + --error-fg: hsl(5, 70%, 60%); + --success-fg: hsl(140, 70%, 45%); + --code-bg: hsla(0, 0%, 0%, 0.25); + --code-border: hsla(0, 0%, 0%, 0.15); + --my-message-code-bg: hsla(0, 0%, 0%, 0.25); + --my-message-code-border: hsla(0, 0%, 0%, 0.15); + } + + * { + color-scheme: dark; + } +} diff --git a/workbox-f2a038d9.js b/workbox-f2a038d9.js new file mode 100644 index 0000000..e0eeb20 --- /dev/null +++ b/workbox-f2a038d9.js @@ -0,0 +1 @@ +define(["exports"],(function(t){"use strict";try{self["workbox:core:6.5.3"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:6.5.3"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class r{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class i extends r{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=i&&i.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:r})}catch(t){a=Promise.reject(t)}const h=i&&i.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:r})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const r=this.t.get(s.method)||[];for(const i of r){let r;const o=i.match({url:t,sameOrigin:e,request:s,event:n});if(o)return r=o,(Array.isArray(r)&&0===r.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(r=void 0),{route:i,params:r}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a=()=>(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c);function h(t,e,n){let o;if("string"==typeof t){const s=new URL(t,location.href);o=new r((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)o=new i(t,e,n);else if("function"==typeof t)o=new r(t,e,n);else{if(!(t instanceof r))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}return a().registerRoute(o),o}try{self["workbox:strategies:6.5.3"]&&_()}catch(t){}const u={cacheWillUpdate:async({response:t})=>200===t.status||0===t.status?t:null},l={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},f=t=>[l.prefix,t,l.suffix].filter((t=>t&&t.length>0)).join("-"),w=t=>t||f(l.precache),d=t=>t||f(l.runtime);function p(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class y{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const g=new Set;function R(t){return"string"==typeof t?new Request(t):t}class m{constructor(t,e){this.h={},Object.assign(this,e),this.event=e.event,this.u=t,this.l=new y,this.p=[],this.g=[...t.plugins],this.R=new Map;for(const t of this.g)this.R.set(t,{});this.event.waitUntil(this.l.promise)}async fetch(t){const{event:e}=this;let n=R(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.u.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:i,response:t});return t}catch(t){throw r&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:r.clone(),request:i.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=R(t);let s;const{cacheName:n,matchOptions:r}=this.u,i=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},r),{cacheName:n});s=await caches.match(i,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:r,cachedResponse:s,request:i,event:this.event})||void 0;return s}async cachePut(t,e){const n=R(t);var r;await(r=0,new Promise((t=>setTimeout(t,r))));const i=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=i.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const c=await this.m(e);if(!c)return!1;const{cacheName:a,matchOptions:h}=this.u,u=await self.caches.open(a),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const r=p(e.url,s);if(e.url===r)return t.match(e,n);const i=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,i);for(const e of o)if(r===p(e.url,s))return t.match(e,n)}(u,i.clone(),["__WB_REVISION__"],h):null;try{await u.put(i,l?c.clone():c)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of g)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:a,oldResponse:f,newResponse:c.clone(),request:i,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.h[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=R(await t({mode:e,request:n,event:this.event,params:this.params}));this.h[s]=n}return this.h[s]}hasCallback(t){for(const e of this.u.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.u.plugins)if("function"==typeof e[t]){const s=this.R.get(e),n=n=>{const r=Object.assign(Object.assign({},n),{state:s});return e[t](r)};yield n}}waitUntil(t){return this.p.push(t),t}async doneWaiting(){let t;for(;t=this.p.shift();)await t}destroy(){this.l.resolve(null)}async m(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class v{constructor(t={}){this.cacheName=d(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,r=new m(this,{event:e,request:s,params:n}),i=this.v(r,s,e);return[i,this.q(i,r,s,e)]}async v(t,e,n){let r;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(r=await this.U(e,t),!r||"error"===r.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(r=await i({error:s,event:n,request:e}),r)break;if(!r)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))r=await s({event:n,request:e,response:r});return r}async q(t,e,s,n){let r,i;try{r=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:r}),await e.doneWaiting()}catch(t){t instanceof Error&&(i=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:r,error:i}),e.destroy(),i)throw i}}function q(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:6.5.3"]&&_()}catch(t){}const U="__WB_REVISION__";function L(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const r=new URL(n,location.href),i=new URL(n,location.href);return r.searchParams.set(U,e),{cacheKey:r.href,url:i.href}}class b{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class E{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.L.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.L=t}}let C,O;async function x(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const r=t.clone(),i={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},o=e?e(i):i,c=function(){if(void 0===C){const t=new Response("");if("body"in t)try{new Response(t.body),C=!0}catch(t){C=!1}C=!1}return C}()?r.body:await r.blob();return new Response(c,o)}class N extends v{constructor(t={}){t.cacheName=w(t.cacheName),super(t),this._=!1!==t.fallbackToNetwork,this.plugins.push(N.copyRedirectedCacheableResponsesPlugin)}async U(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.C(t,e):await this.O(t,e))}async O(t,e){let n;const r=e.params||{};if(!this._)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=r.integrity,i=t.integrity,o=!i||i===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?i||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.N(),await e.cachePut(t,n.clone()))}return n}async C(t,e){this.N();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}N(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==N.copyRedirectedCacheableResponsesPlugin&&(n===N.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(N.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}N.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},N.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await x(t):t};class W{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.W=new Map,this.k=new Map,this.K=new Map,this.u=new N({cacheName:w(t),plugins:[...e,new E({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.u}precache(t){this.addToCacheList(t),this.T||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.T=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:r}=L(n),i="string"!=typeof n&&n.revision?"reload":"default";if(this.W.has(r)&&this.W.get(r)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.W.get(r),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.K.has(t)&&this.K.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:r});this.K.set(t,n.integrity)}if(this.W.set(r,t),this.k.set(r,i),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return q(t,(async()=>{const e=new b;this.strategy.plugins.push(e);for(const[e,s]of this.W){const n=this.K.get(s),r=this.k.get(e),i=new Request(e,{integrity:n,cache:r,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:i,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return q(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.W.values()),n=[];for(const r of e)s.has(r.url)||(await t.delete(r),n.push(r.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.W}getCachedURLs(){return[...this.W.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.W.get(e.href)}getIntegrityForCacheKey(t){return this.K.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}const k=()=>(O||(O=new W),O);class K extends r{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const r of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:r}={}){const i=new URL(t,location.href);i.hash="",yield i.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(i,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(r){const t=r({url:i});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(r);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}t.StaleWhileRevalidate=class extends v{constructor(t={}){super(t),this.plugins.some((t=>"cacheWillUpdate"in t))||this.plugins.unshift(u)}async U(t,e){const n=e.fetchAndCachePut(t).catch((()=>{}));e.waitUntil(n);let r,i=await e.cacheMatch(t);if(i);else try{i=await n}catch(t){t instanceof Error&&(r=t)}if(!i)throw new s("no-response",{url:t.url,error:r});return i}},t.clientsClaim=function(){self.addEventListener("activate",(()=>self.clients.claim()))},t.precacheAndRoute=function(t,e){!function(t){k().precache(t)}(t),function(t){const e=k();h(new K(e,t))}(e)},t.registerRoute=h}));