streamlit-nightly 1.38.1.dev20240914__py2.py3-none-any.whl → 1.38.1.dev20240916__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/commands/navigation.py +1 -1
- streamlit/config.py +87 -61
- streamlit/elements/arrow.py +1 -1
- streamlit/elements/vega_charts.py +1 -1
- streamlit/navigation/page.py +1 -1
- streamlit/runtime/fragment.py +1 -3
- streamlit/runtime/pages_manager.py +19 -50
- streamlit/runtime/scriptrunner/script_runner.py +0 -1
- streamlit/runtime/scriptrunner_utils/script_run_context.py +27 -3
- streamlit/static/asset-manifest.json +3 -3
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/7591.b3928443.chunk.js +2 -0
- streamlit/static/static/js/7591.b3928443.chunk.js.LICENSE.txt +1 -0
- streamlit/static/static/js/{main.8721af5a.js → main.50e02474.js} +2 -2
- {streamlit_nightly-1.38.1.dev20240914.dist-info → streamlit_nightly-1.38.1.dev20240916.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.38.1.dev20240914.dist-info → streamlit_nightly-1.38.1.dev20240916.dist-info}/RECORD +21 -21
- {streamlit_nightly-1.38.1.dev20240914.dist-info → streamlit_nightly-1.38.1.dev20240916.dist-info}/WHEEL +1 -1
- streamlit/static/static/js/7591.116b650a.chunk.js +0 -2
- streamlit/static/static/js/7591.116b650a.chunk.js.LICENSE.txt +0 -1
- /streamlit/static/static/js/{main.8721af5a.js.LICENSE.txt → main.50e02474.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.38.1.dev20240914.data → streamlit_nightly-1.38.1.dev20240916.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.38.1.dev20240914.dist-info → streamlit_nightly-1.38.1.dev20240916.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.38.1.dev20240914.dist-info → streamlit_nightly-1.38.1.dev20240916.dist-info}/top_level.txt +0 -0
streamlit/static/index.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.50e02474.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! For license information please see 7591.b3928443.chunk.js.LICENSE.txt */
|
2
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7591],{17591:(e,t,n)=>{n.d(t,{A:()=>ie});const{entries:o,setPrototypeOf:r,isFrozen:i,getPrototypeOf:a,getOwnPropertyDescriptor:l}=Object;let{freeze:c,seal:s,create:u}=Object,{apply:m,construct:p}="undefined"!==typeof Reflect&&Reflect;c||(c=function(e){return e}),s||(s=function(e){return e}),m||(m=function(e,t,n){return e.apply(t,n)}),p||(p=function(e,t){return new e(...t)});const f=w(Array.prototype.forEach),d=w(Array.prototype.pop),h=w(Array.prototype.push),g=w(String.prototype.toLowerCase),T=w(String.prototype.toString),y=w(String.prototype.match),E=w(String.prototype.replace),_=w(String.prototype.indexOf),A=w(String.prototype.trim),N=w(Object.prototype.hasOwnProperty),b=w(RegExp.prototype.test),S=(R=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p(R,t)});var R;function w(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return m(e,t,o)}}function C(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g;r&&r(e,null);let o=t.length;for(;o--;){let r=t[o];if("string"===typeof r){const e=n(r);e!==r&&(i(t)||(t[o]=e),r=e)}e[r]=!0}return e}function L(e){for(let t=0;t<e.length;t++){N(e,t)||(e[t]=null)}return e}function v(e){const t=u(null);for(const[n,r]of o(e)){N(e,n)&&(Array.isArray(r)?t[n]=L(r):r&&"object"===typeof r&&r.constructor===Object?t[n]=v(r):t[n]=r)}return t}function D(e,t){for(;null!==e;){const n=l(e,t);if(n){if(n.get)return w(n.get);if("function"===typeof n.value)return w(n.value)}e=a(e)}return function(){return null}}const k=c(["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"]),O=c(["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"]),x=c(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=c(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=c(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),U=c(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=c(["#text"]),F=c(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),H=c(["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"]),z=c(["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"]),B=c(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),W=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=s(/<%[\w\W]*|[\w\W]*%>/gm),Y=s(/\${[\w\W]*}/gm),j=s(/^data-[\-\w.\u00B7-\uFFFF]/),X=s(/^aria-[\-\w]+$/),q=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=s(/^(?:\w+script|data):/i),K=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),V=s(/^html$/i),Z=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var J=Object.freeze({__proto__:null,MUSTACHE_EXPR:W,ERB_EXPR:G,TMPLIT_EXPR:Y,DATA_ATTR:j,ARIA_ATTR:X,IS_ALLOWED_URI:q,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:K,DOCTYPE_NAME:V,CUSTOM_ELEMENT:Z});const Q=1,ee=3,te=7,ne=8,oe=9,re=function(){return"undefined"===typeof window?null:window};var ie=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re();const n=t=>e(t);if(n.version="3.1.6",n.removed=[],!t||!t.document||t.document.nodeType!==oe)return n.isSupported=!1,n;let{document:r}=t;const i=r,a=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:s,Node:m,Element:p,NodeFilter:R,NamedNodeMap:w=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:L,DOMParser:W,trustedTypes:G}=t,Y=p.prototype,j=D(Y,"cloneNode"),X=D(Y,"remove"),$=D(Y,"nextSibling"),K=D(Y,"childNodes"),Z=D(Y,"parentNode");if("function"===typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let ie,ae="";const{implementation:le,createNodeIterator:ce,createDocumentFragment:se,getElementsByTagName:ue}=r,{importNode:me}=i;let pe={};n.isSupported="function"===typeof o&&"function"===typeof Z&&le&&void 0!==le.createHTMLDocument;const{MUSTACHE_EXPR:fe,ERB_EXPR:de,TMPLIT_EXPR:he,DATA_ATTR:ge,ARIA_ATTR:Te,IS_SCRIPT_OR_DATA:ye,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:_e}=J;let{IS_ALLOWED_URI:Ae}=J,Ne=null;const be=C({},[...k,...O,...x,...M,...P]);let Se=null;const Re=C({},[...F,...H,...z,...B]);let we=Object.seal(u(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}})),Ce=null,Le=null,ve=!0,De=!0,ke=!1,Oe=!0,xe=!1,Ie=!0,Me=!1,Ue=!1,Pe=!1,Fe=!1,He=!1,ze=!1,Be=!0,We=!1,Ge=!0,Ye=!1,je={},Xe=null;const qe=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const Ke=C({},["audio","video","img","source","image","track"]);let Ve=null;const Ze=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let tt=et,nt=!1,ot=null;const rt=C({},[Je,Qe,et],T);let it=null;const at=["application/xhtml+xml","text/html"];let lt=null,ct=null;const st=r.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"===typeof e||(e={}),e=v(e),it=-1===at.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===it?T:g,Ne=N(e,"ALLOWED_TAGS")?C({},e.ALLOWED_TAGS,lt):be,Se=N(e,"ALLOWED_ATTR")?C({},e.ALLOWED_ATTR,lt):Re,ot=N(e,"ALLOWED_NAMESPACES")?C({},e.ALLOWED_NAMESPACES,T):rt,Ve=N(e,"ADD_URI_SAFE_ATTR")?C(v(Ze),e.ADD_URI_SAFE_ATTR,lt):Ze,$e=N(e,"ADD_DATA_URI_TAGS")?C(v(Ke),e.ADD_DATA_URI_TAGS,lt):Ke,Xe=N(e,"FORBID_CONTENTS")?C({},e.FORBID_CONTENTS,lt):qe,Ce=N(e,"FORBID_TAGS")?C({},e.FORBID_TAGS,lt):{},Le=N(e,"FORBID_ATTR")?C({},e.FORBID_ATTR,lt):{},je=!!N(e,"USE_PROFILES")&&e.USE_PROFILES,ve=!1!==e.ALLOW_ARIA_ATTR,De=!1!==e.ALLOW_DATA_ATTR,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,xe=e.SAFE_FOR_TEMPLATES||!1,Ie=!1!==e.SAFE_FOR_XML,Me=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Be=!1!==e.SANITIZE_DOM,We=e.SANITIZE_NAMED_PROPS||!1,Ge=!1!==e.KEEP_CONTENT,Ye=e.IN_PLACE||!1,Ae=e.ALLOWED_URI_REGEXP||q,tt=e.NAMESPACE||et,we=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(we.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(De=!1),He&&(Fe=!0),je&&(Ne=C({},P),Se=[],!0===je.html&&(C(Ne,k),C(Se,F)),!0===je.svg&&(C(Ne,O),C(Se,H),C(Se,B)),!0===je.svgFilters&&(C(Ne,x),C(Se,H),C(Se,B)),!0===je.mathMl&&(C(Ne,M),C(Se,z),C(Se,B))),e.ADD_TAGS&&(Ne===be&&(Ne=v(Ne)),C(Ne,e.ADD_TAGS,lt)),e.ADD_ATTR&&(Se===Re&&(Se=v(Se)),C(Se,e.ADD_ATTR,lt)),e.ADD_URI_SAFE_ATTR&&C(Ve,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(Xe===qe&&(Xe=v(Xe)),C(Xe,e.FORBID_CONTENTS,lt)),Ge&&(Ne["#text"]=!0),Me&&C(Ne,["html","head","body"]),Ne.table&&(C(Ne,["tbody"]),delete Ce.tbody),e.TRUSTED_TYPES_POLICY){if("function"!==typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!==typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ie=e.TRUSTED_TYPES_POLICY,ae=ie.createHTML("")}else void 0===ie&&(ie=function(e,t){if("object"!==typeof e||"function"!==typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(i){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(G,a)),null!==ie&&"string"===typeof ae&&(ae=ie.createHTML(""));c&&c(e),ct=e}},pt=C({},["mi","mo","mn","ms","mtext"]),ft=C({},["foreignobject","annotation-xml"]),dt=C({},["title","style","font","a","script"]),ht=C({},[...O,...x,...I]),gt=C({},[...M,...U]),Tt=function(e){h(n.removed,{element:e});try{Z(e).removeChild(e)}catch(t){X(e)}},yt=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(o){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Se[e])if(Fe||He)try{Tt(t)}catch(o){}else try{t.setAttribute(e,"")}catch(o){}},Et=function(e){let t=null,n=null;if(Pe)e="<remove></remove>"+e;else{const t=y(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===it&&tt===et&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=ie?ie.createHTML(e):e;if(tt===et)try{t=(new W).parseFromString(o,it)}catch(a){}if(!t||!t.documentElement){t=le.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?ae:o}catch(a){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),tt===et?ue.call(t,Me?"html":"body")[0]:Me?t.documentElement:i},_t=function(e){return ce.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT|R.SHOW_PROCESSING_INSTRUCTION|R.SHOW_CDATA_SECTION,null)},At=function(e){return e instanceof L&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof w)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore||"function"!==typeof e.hasChildNodes)},Nt=function(e){return"function"===typeof m&&e instanceof m},bt=function(e,t,o){pe[e]&&f(pe[e],(e=>{e.call(n,t,o,ct)}))},St=function(e){let t=null;if(bt("beforeSanitizeElements",e,null),At(e))return Tt(e),!0;const o=lt(e.nodeName);if(bt("uponSanitizeElement",e,{tagName:o,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return Tt(e),!0;if(e.nodeType===te)return Tt(e),!0;if(Ie&&e.nodeType===ne&&b(/<[/\w]/g,e.data))return Tt(e),!0;if(!Ne[o]||Ce[o]){if(!Ce[o]&&wt(o)){if(we.tagNameCheck instanceof RegExp&&b(we.tagNameCheck,o))return!1;if(we.tagNameCheck instanceof Function&&we.tagNameCheck(o))return!1}if(Ge&&!Xe[o]){const t=Z(e)||e.parentNode,n=K(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=j(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,$(e))}}}return Tt(e),!0}return e instanceof p&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});const n=g(e.tagName),o=g(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===Qe?t.namespaceURI===et?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===o||pt[o]):Boolean(ht[n]):e.namespaceURI===Je?t.namespaceURI===et?"math"===n:t.namespaceURI===Qe?"math"===n&&ft[o]:Boolean(gt[n]):e.namespaceURI===et?!(t.namespaceURI===Qe&&!ft[o])&&!(t.namespaceURI===Je&&!pt[o])&&!gt[n]&&(dt[n]||!ht[n]):!("application/xhtml+xml"!==it||!ot[e.namespaceURI]))}(e)?(Tt(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(xe&&e.nodeType===ee&&(t=e.textContent,f([fe,de,he],(e=>{t=E(t,e," ")})),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),bt("afterSanitizeElements",e,null),!1):(Tt(e),!0)},Rt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in r||n in st))return!1;if(De&&!Le[t]&&b(ge,t));else if(ve&&b(Te,t));else if(!Se[t]||Le[t]){if(!(wt(e)&&(we.tagNameCheck instanceof RegExp&&b(we.tagNameCheck,e)||we.tagNameCheck instanceof Function&&we.tagNameCheck(e))&&(we.attributeNameCheck instanceof RegExp&&b(we.attributeNameCheck,t)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(t))||"is"===t&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&b(we.tagNameCheck,n)||we.tagNameCheck instanceof Function&&we.tagNameCheck(n))))return!1}else if(Ve[t]);else if(b(Ae,E(n,Ee,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!$e[e]){if(ke&&!b(ye,E(n,Ee,"")));else if(n)return!1}else;return!0},wt=function(e){return"annotation-xml"!==e&&y(e,_e)},Ct=function(e){bt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se};let r=t.length;for(;r--;){const a=t[r],{name:l,namespaceURI:c,value:s}=a,u=lt(l);let m="value"===l?s:A(s);if(o.attrName=u,o.attrValue=m,o.keepAttr=!0,o.forceKeepAttr=void 0,bt("uponSanitizeAttribute",e,o),m=o.attrValue,Ie&&b(/((--!?|])>)|<\/(style|title)/i,m)){yt(l,e);continue}if(o.forceKeepAttr)continue;if(yt(l,e),!o.keepAttr)continue;if(!Oe&&b(/\/>/i,m)){yt(l,e);continue}xe&&f([fe,de,he],(e=>{m=E(m,e," ")}));const p=lt(e.nodeName);if(Rt(p,u,m)){if(!We||"id"!==u&&"name"!==u||(yt(l,e),m="user-content-"+m),ie&&"object"===typeof G&&"function"===typeof G.getAttributeType)if(c);else switch(G.getAttributeType(p,u)){case"TrustedHTML":m=ie.createHTML(m);break;case"TrustedScriptURL":m=ie.createScriptURL(m)}try{c?e.setAttributeNS(c,l,m):e.setAttribute(l,m),At(e)?Tt(e):d(n.removed)}catch(i){}}}bt("afterSanitizeAttributes",e,null)},Lt=function e(t){let n=null;const o=_t(t);for(bt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)bt("uponSanitizeShadowNode",n,null),St(n)||(n.content instanceof l&&e(n.content),Ct(n));bt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,r=null,a=null,c=null;if(nt=!e,nt&&(e="\x3c!--\x3e"),"string"!==typeof e&&!Nt(e)){if("function"!==typeof e.toString)throw S("toString is not a function");if("string"!==typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Ue||mt(t),n.removed=[],"string"===typeof e&&(Ye=!1),Ye){if(e.nodeName){const t=lt(e.nodeName);if(!Ne[t]||Ce[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof m)o=Et("\x3c!----\x3e"),r=o.ownerDocument.importNode(e,!0),r.nodeType===Q&&"BODY"===r.nodeName||"HTML"===r.nodeName?o=r:o.appendChild(r);else{if(!Fe&&!xe&&!Me&&-1===e.indexOf("<"))return ie&&ze?ie.createHTML(e):e;if(o=Et(e),!o)return Fe?null:ze?ae:""}o&&Pe&&Tt(o.firstChild);const s=_t(Ye?e:o);for(;a=s.nextNode();)St(a)||(a.content instanceof l&&Lt(a.content),Ct(a));if(Ye)return e;if(Fe){if(He)for(c=se.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(Se.shadowroot||Se.shadowrootmode)&&(c=me.call(i,c,!0)),c}let u=Me?o.outerHTML:o.innerHTML;return Me&&Ne["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&b(V,o.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+u),xe&&f([fe,de,he],(e=>{u=E(u,e," ")})),ie&&ze?ie.createHTML(u):u},n.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ue=!0},n.clearConfig=function(){ct=null,Ue=!1},n.isValidAttribute=function(e,t,n){ct||mt({});const o=lt(e),r=lt(t);return Rt(o,r,n)},n.addHook=function(e,t){"function"===typeof t&&(pe[e]=pe[e]||[],h(pe[e],t))},n.removeHook=function(e){if(pe[e])return d(pe[e])},n.removeHooks=function(e){pe[e]&&(pe[e]=[])},n.removeAllHooks=function(){pe={}},n}()}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
|