@d1g1tal/transportr 3.3.2 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/VSS64DLN.js +8 -0
- package/dist/VSS64DLN.js.map +7 -0
- package/dist/iife/content-type.js +8 -0
- package/dist/iife/content-type.js.map +7 -0
- package/dist/iife/request-header.js +8 -0
- package/dist/iife/request-header.js.map +7 -0
- package/dist/iife/request-method.js +8 -0
- package/dist/iife/request-method.js.map +7 -0
- package/dist/iife/response-header.js +8 -0
- package/dist/iife/response-header.js.map +7 -0
- package/dist/iife/transportr.js +1292 -0
- package/dist/iife/transportr.js.map +7 -0
- package/dist/transportr.js +1 -1
- package/dist/transportr.js.map +2 -2
- package/package.json +7 -7
- package/dist/OP3JQ447.js +0 -8
- package/dist/OP3JQ447.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [3.3.4](https://github.com/D1g1talEntr0py/transportr/compare/v3.3.3...v3.3.4) (2026-04-14)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **build:** update tsbuild to fix missing source map reference in iife output (b06dbefd2db54e1739d36a7db3e4babf59feaf41)
|
|
6
|
+
|
|
7
|
+
## [3.3.3](https://github.com/D1g1talEntr0py/transportr/compare/v3.3.2...v3.3.3) (2026-04-14)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **build:** restore IIFE format output (2698d3de6591c06bac77654e05dbad27d10ac2c9)
|
|
12
|
+
Replaces the accidentally disabled IIFE build configuration so the library can once again be consumed via standard script tags in a browser environment.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Miscellaneous Chores
|
|
16
|
+
|
|
17
|
+
* **deps-dev:** bump dev dependencies (f835b889d7f9af06823d4e8d6f96d9425916527a)
|
|
18
|
+
Updates several development dependencies to their latest versions, including `@typescript-eslint` packages, `@d1g1tal/tsbuild`, and `globals`. The lockfile is updated accordingly to reflect the new dependency tree and resolved versions.
|
|
19
|
+
|
|
1
20
|
## [3.3.2](https://github.com/D1g1talEntr0py/transportr/compare/v3.3.1...v3.3.2) (2026-04-11)
|
|
2
21
|
|
|
3
22
|
### Performance Improvements
|
package/dist/VSS64DLN.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var{entries:gt,setPrototypeOf:ft,isFrozen:Yt,getPrototypeOf:Xt,getOwnPropertyDescriptor:jt}=Object,{freeze:S,seal:b,create:ne}=Object,{apply:Ue,construct:Fe}=typeof Reflect<"u"&&Reflect;S||(S=function(o){return o});b||(b=function(o){return o});Ue||(Ue=function(o,l){for(var a=arguments.length,c=new Array(a>2?a-2:0),O=2;O<a;O++)c[O-2]=arguments[O];return o.apply(l,c)});Fe||(Fe=function(o){for(var l=arguments.length,a=new Array(l>1?l-1:0),c=1;c<l;c++)a[c-1]=arguments[c];return new o(...a)});var Z=R(Array.prototype.forEach),Vt=R(Array.prototype.lastIndexOf),ut=R(Array.prototype.pop),J=R(Array.prototype.push),$t=R(Array.prototype.splice),Ee=R(String.prototype.toLowerCase),Me=R(String.prototype.toString),we=R(String.prototype.match),B=R(String.prototype.replace),qt=R(String.prototype.indexOf),Kt=R(String.prototype.trim),C=R(Object.prototype.hasOwnProperty),A=R(RegExp.prototype.test),Q=Zt(TypeError);function R(s){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var l=arguments.length,a=new Array(l>1?l-1:0),c=1;c<l;c++)a[c-1]=arguments[c];return Ue(s,o,a)}}function Zt(s){return function(){for(var o=arguments.length,l=new Array(o),a=0;a<o;a++)l[a]=arguments[a];return Fe(s,l)}}function r(s,o){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ee;ft&&ft(s,null);let a=o.length;for(;a--;){let c=o[a];if(typeof c=="string"){let O=l(c);O!==c&&(Yt(o)||(o[a]=O),c=O)}s[c]=!0}return s}function Jt(s){for(let o=0;o<s.length;o++)C(s,o)||(s[o]=null);return s}function M(s){let o=ne(null);for(let[l,a]of gt(s))C(s,l)&&(Array.isArray(a)?o[l]=Jt(a):a&&typeof a=="object"&&a.constructor===Object?o[l]=M(a):o[l]=a);return o}function ee(s,o){for(;s!==null;){let a=jt(s,o);if(a){if(a.get)return R(a.get);if(typeof a.value=="function")return R(a.value)}s=Xt(s)}function l(){return null}return l}var mt=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),xe=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Pe=S(["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"]),Qt=S(["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"]),ke=S(["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"]),en=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pt=S(["#text"]),Tt=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ve=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),dt=S(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),de=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tn=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),nn=b(/<%[\w\W]*|[\w\W]*%>/gm),on=b(/\$\{[\w\W]*/gm),an=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),rn=b(/^aria-[\-\w]+$/),ht=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sn=b(/^(?:\w+script|data):/i),ln=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),At=b(/^html$/i),cn=b(/^[a-z][.\w]*(-[.\w]+)+$/i),Et=Object.freeze({__proto__:null,ARIA_ATTR:rn,ATTR_WHITESPACE:ln,CUSTOM_ELEMENT:cn,DATA_ATTR:an,DOCTYPE_NAME:At,ERB_EXPR:nn,IS_ALLOWED_URI:ht,IS_SCRIPT_OR_DATA:sn,MUSTACHE_EXPR:tn,TMPLIT_EXPR:on}),te={element:1,text:3,progressingInstruction:7,comment:8,document:9},fn=function(){return typeof window>"u"?null:window},un=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let a=null,c="data-tt-policy-suffix";l&&l.hasAttribute(c)&&(a=l.getAttribute(c));let O="dompurify"+(a?"#"+a:"");try{return o.createPolicy(O,{createHTML(F){return F},createScriptURL(F){return F}})}catch{return console.warn("TrustedTypes policy "+O+" could not be created."),null}},_t=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function St(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fn(),o=i=>St(i);if(o.version="3.4.0",o.removed=[],!s||!s.document||s.document.nodeType!==te.document||!s.Element)return o.isSupported=!1,o;let{document:l}=s,a=l,c=a.currentScript,{DocumentFragment:O,HTMLTemplateElement:F,Node:_e,Element:He,NodeFilter:Y,NamedNodeMap:Rt=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:Ot,DOMParser:Dt,trustedTypes:oe}=s,X=He.prototype,Lt=ee(X,"cloneNode"),bt=ee(X,"remove"),yt=ee(X,"nextSibling"),Ct=ee(X,"childNodes"),ie=ee(X,"parentNode");if(typeof F=="function"){let i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let g,j="",{implementation:ge,createNodeIterator:It,createDocumentFragment:Nt,getElementsByTagName:Mt}=l,{importNode:wt}=a,h=_t();o.isSupported=typeof gt=="function"&&typeof ie=="function"&&ge&&ge.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ae,ERB_EXPR:re,TMPLIT_EXPR:se,DATA_ATTR:xt,ARIA_ATTR:Pt,IS_SCRIPT_OR_DATA:kt,ATTR_WHITESPACE:ze,CUSTOM_ELEMENT:vt}=Et,{IS_ALLOWED_URI:Ge}=Et,T=null,We=r({},[...mt,...xe,...Pe,...ke,...pt]),d=null,Be=r({},[...Tt,...ve,...dt,...de]),u=Object.seal(ne(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}})),V=null,le=null,x=Object.seal(ne(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ye=!0,he=!0,Xe=!1,je=!0,k=!1,$=!0,v=!1,Ae=!1,Se=!1,H=!1,ce=!1,fe=!1,Ve=!0,$e=!1,Ut="user-content-",Re=!0,q=!1,z={},I=null,Oe=r({},["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"]),qe=null,Ke=r({},["audio","video","img","source","image","track"]),De=null,Ze=r({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",me="http://www.w3.org/2000/svg",N="http://www.w3.org/1999/xhtml",G=N,Le=!1,be=null,Ft=r({},[ue,me,N],Me),pe=r({},["mi","mo","mn","ms","mtext"]),Te=r({},["annotation-xml"]),Ht=r({},["title","style","font","a","script"]),K=null,zt=["application/xhtml+xml","text/html"],Gt="text/html",p=null,W=null,Wt=l.createElement("form"),Je=function(e){return e instanceof RegExp||e instanceof Function},ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(W&&W===e)){if((!e||typeof e!="object")&&(e={}),e=M(e),K=zt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Gt:e.PARSER_MEDIA_TYPE,p=K==="application/xhtml+xml"?Me:Ee,T=C(e,"ALLOWED_TAGS")?r({},e.ALLOWED_TAGS,p):We,d=C(e,"ALLOWED_ATTR")?r({},e.ALLOWED_ATTR,p):Be,be=C(e,"ALLOWED_NAMESPACES")?r({},e.ALLOWED_NAMESPACES,Me):Ft,De=C(e,"ADD_URI_SAFE_ATTR")?r(M(Ze),e.ADD_URI_SAFE_ATTR,p):Ze,qe=C(e,"ADD_DATA_URI_TAGS")?r(M(Ke),e.ADD_DATA_URI_TAGS,p):Ke,I=C(e,"FORBID_CONTENTS")?r({},e.FORBID_CONTENTS,p):Oe,V=C(e,"FORBID_TAGS")?r({},e.FORBID_TAGS,p):M({}),le=C(e,"FORBID_ATTR")?r({},e.FORBID_ATTR,p):M({}),z=C(e,"USE_PROFILES")?e.USE_PROFILES:!1,Ye=e.ALLOW_ARIA_ATTR!==!1,he=e.ALLOW_DATA_ATTR!==!1,Xe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,je=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=e.SAFE_FOR_TEMPLATES||!1,$=e.SAFE_FOR_XML!==!1,v=e.WHOLE_DOCUMENT||!1,H=e.RETURN_DOM||!1,ce=e.RETURN_DOM_FRAGMENT||!1,fe=e.RETURN_TRUSTED_TYPE||!1,Se=e.FORCE_BODY||!1,Ve=e.SANITIZE_DOM!==!1,$e=e.SANITIZE_NAMED_PROPS||!1,Re=e.KEEP_CONTENT!==!1,q=e.IN_PLACE||!1,Ge=e.ALLOWED_URI_REGEXP||ht,G=e.NAMESPACE||N,pe=e.MATHML_TEXT_INTEGRATION_POINTS||pe,Te=e.HTML_INTEGRATION_POINTS||Te,u=e.CUSTOM_ELEMENT_HANDLING||ne(null),e.CUSTOM_ELEMENT_HANDLING&&Je(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Je(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),k&&(he=!1),ce&&(H=!0),z&&(T=r({},pt),d=ne(null),z.html===!0&&(r(T,mt),r(d,Tt)),z.svg===!0&&(r(T,xe),r(d,ve),r(d,de)),z.svgFilters===!0&&(r(T,Pe),r(d,ve),r(d,de)),z.mathMl===!0&&(r(T,ke),r(d,dt),r(d,de))),x.tagCheck=null,x.attributeCheck=null,e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?x.tagCheck=e.ADD_TAGS:(T===We&&(T=M(T)),r(T,e.ADD_TAGS,p))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?x.attributeCheck=e.ADD_ATTR:(d===Be&&(d=M(d)),r(d,e.ADD_ATTR,p))),e.ADD_URI_SAFE_ATTR&&r(De,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(I===Oe&&(I=M(I)),r(I,e.FORBID_CONTENTS,p)),e.ADD_FORBID_CONTENTS&&(I===Oe&&(I=M(I)),r(I,e.ADD_FORBID_CONTENTS,p)),Re&&(T["#text"]=!0),v&&r(T,["html","head","body"]),T.table&&(r(T,["tbody"]),delete V.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,j=g.createHTML("")}else g===void 0&&(g=un(oe,c)),g!==null&&typeof j=="string"&&(j=g.createHTML(""));S&&S(e),W=e}},Qe=r({},[...xe,...Pe,...Qt]),et=r({},[...ke,...en]),Bt=function(e){let t=ie(e);(!t||!t.tagName)&&(t={namespaceURI:G,tagName:"template"});let n=Ee(e.tagName),f=Ee(t.tagName);return be[e.namespaceURI]?e.namespaceURI===me?t.namespaceURI===N?n==="svg":t.namespaceURI===ue?n==="svg"&&(f==="annotation-xml"||pe[f]):!!Qe[n]:e.namespaceURI===ue?t.namespaceURI===N?n==="math":t.namespaceURI===me?n==="math"&&Te[f]:!!et[n]:e.namespaceURI===N?t.namespaceURI===me&&!Te[f]||t.namespaceURI===ue&&!pe[f]?!1:!et[n]&&(Ht[n]||!Qe[n]):!!(K==="application/xhtml+xml"&&be[e.namespaceURI]):!1},y=function(e){J(o.removed,{element:e});try{ie(e).removeChild(e)}catch{bt(e)}},U=function(e,t){try{J(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{J(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(H||ce)try{y(t)}catch{}else try{t.setAttribute(e,"")}catch{}},tt=function(e){let t=null,n=null;if(Se)e="<remove></remove>"+e;else{let m=we(e,/^[\r\n\t ]+/);n=m&&m[0]}K==="application/xhtml+xml"&&G===N&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let f=g?g.createHTML(e):e;if(G===N)try{t=new Dt().parseFromString(f,K)}catch{}if(!t||!t.documentElement){t=ge.createDocument(G,"template",null);try{t.documentElement.innerHTML=Le?j:f}catch{}}let _=t.body||t.documentElement;return e&&n&&_.insertBefore(l.createTextNode(n),_.childNodes[0]||null),G===N?Mt.call(t,v?"html":"body")[0]:v?t.documentElement:_},nt=function(e){return It.call(e.ownerDocument||e,e,Y.SHOW_ELEMENT|Y.SHOW_COMMENT|Y.SHOW_TEXT|Y.SHOW_PROCESSING_INSTRUCTION|Y.SHOW_CDATA_SECTION,null)},Ce=function(e){return e instanceof Ot&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Rt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Ie=function(e){return typeof _e=="function"&&e instanceof _e};function w(i,e,t){Z(i,n=>{n.call(o,e,t,W)})}let ot=function(e){let t=null;if(w(h.beforeSanitizeElements,e,null),Ce(e))return y(e),!0;let n=p(e.nodeName);if(w(h.uponSanitizeElement,e,{tagName:n,allowedTags:T}),$&&e.hasChildNodes()&&!Ie(e.firstElementChild)&&A(/<[/\w!]/g,e.innerHTML)&&A(/<[/\w!]/g,e.textContent)||$&&e.namespaceURI===N&&n==="style"&&Ie(e.firstElementChild)||e.nodeType===te.progressingInstruction||$&&e.nodeType===te.comment&&A(/<[/\w]/g,e.data))return y(e),!0;if(V[n]||!(x.tagCheck instanceof Function&&x.tagCheck(n))&&!T[n]){if(!V[n]&&at(n)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,n)||u.tagNameCheck instanceof Function&&u.tagNameCheck(n)))return!1;if(Re&&!I[n]){let f=ie(e)||e.parentNode,_=Ct(e)||e.childNodes;if(_&&f){let m=_.length;for(let D=m-1;D>=0;--D){let L=Lt(_[D],!0);L.__removalCount=(e.__removalCount||0)+1,f.insertBefore(L,yt(e))}}}return y(e),!0}return e instanceof He&&!Bt(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&A(/<\/no(script|embed|frames)/i,e.innerHTML)?(y(e),!0):(k&&e.nodeType===te.text&&(t=e.textContent,Z([ae,re,se],f=>{t=B(t,f," ")}),e.textContent!==t&&(J(o.removed,{element:e.cloneNode()}),e.textContent=t)),w(h.afterSanitizeElements,e,null),!1)},it=function(e,t,n){if(le[t]||Ve&&(t==="id"||t==="name")&&(n in l||n in Wt))return!1;if(!(he&&!le[t]&&A(xt,t))){if(!(Ye&&A(Pt,t))){if(!(x.attributeCheck instanceof Function&&x.attributeCheck(t,e))){if(!d[t]||le[t]){if(!(at(e)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&A(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t,e))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,n)||u.tagNameCheck instanceof Function&&u.tagNameCheck(n))))return!1}else if(!De[t]){if(!A(Ge,B(n,ze,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&qt(n,"data:")===0&&qe[e])){if(!(Xe&&!A(kt,B(n,ze,"")))){if(n)return!1}}}}}}}return!0},at=function(e){return e!=="annotation-xml"&&we(e,vt)},rt=function(e){w(h.beforeSanitizeAttributes,e,null);let{attributes:t}=e;if(!t||Ce(e))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d,forceKeepAttr:void 0},f=t.length;for(;f--;){let _=t[f],{name:m,namespaceURI:D,value:L}=_,P=p(m),Ne=L,E=m==="value"?Ne:Kt(Ne);if(n.attrName=P,n.attrValue=E,n.keepAttr=!0,n.forceKeepAttr=void 0,w(h.uponSanitizeAttribute,e,n),E=n.attrValue,$e&&(P==="id"||P==="name")&&(U(m,e),E=Ut+E),$&&A(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,E)){U(m,e);continue}if(P==="attributename"&&we(E,"href")){U(m,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){U(m,e);continue}if(!je&&A(/\/>/i,E)){U(m,e);continue}k&&Z([ae,re,se],ct=>{E=B(E,ct," ")});let lt=p(e.nodeName);if(!it(lt,P,E)){U(m,e);continue}if(g&&typeof oe=="object"&&typeof oe.getAttributeType=="function"&&!D)switch(oe.getAttributeType(lt,P)){case"TrustedHTML":{E=g.createHTML(E);break}case"TrustedScriptURL":{E=g.createScriptURL(E);break}}if(E!==Ne)try{D?e.setAttributeNS(D,m,E):e.setAttribute(m,E),Ce(e)?y(e):ut(o.removed)}catch{U(m,e)}}w(h.afterSanitizeAttributes,e,null)},st=function(e){let t=null,n=nt(e);for(w(h.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)w(h.uponSanitizeShadowNode,t,null),ot(t),rt(t),t.content instanceof O&&st(t.content);w(h.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,f=null,_=null;if(Le=!i,Le&&(i="<!-->"),typeof i!="string"&&!Ie(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!o.isSupported)return i;if(Ae||ye(e),o.removed=[],typeof i=="string"&&(q=!1),q){if(i.nodeName){let L=p(i.nodeName);if(!T[L]||V[L])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof _e)t=tt("<!---->"),n=t.ownerDocument.importNode(i,!0),n.nodeType===te.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!H&&!k&&!v&&i.indexOf("<")===-1)return g&&fe?g.createHTML(i):i;if(t=tt(i),!t)return H?null:fe?j:""}t&&Se&&y(t.firstChild);let m=nt(q?i:t);for(;f=m.nextNode();)ot(f),rt(f),f.content instanceof O&&st(f.content);if(q)return i;if(H){if(k){t.normalize();let L=t.innerHTML;Z([ae,re,se],P=>{L=B(L,P," ")}),t.innerHTML=L}if(ce)for(_=Nt.call(t.ownerDocument);t.firstChild;)_.appendChild(t.firstChild);else _=t;return(d.shadowroot||d.shadowrootmode)&&(_=wt.call(a,_,!0)),_}let D=v?t.outerHTML:t.innerHTML;return v&&T["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&A(At,t.ownerDocument.doctype.name)&&(D="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
2
|
+
`+D),k&&Z([ae,re,se],L=>{D=B(D,L," ")}),g&&fe?g.createHTML(D):D},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ye(i),Ae=!0},o.clearConfig=function(){W=null,Ae=!1},o.isValidAttribute=function(i,e,t){W||ye({});let n=p(i),f=p(e);return it(n,f,t)},o.addHook=function(i,e){typeof e=="function"&&J(h[i],e)},o.removeHook=function(i,e){if(e!==void 0){let t=Vt(h[i],e);return t===-1?void 0:$t(h[i],t,1)[0]}return ut(h[i])},o.removeHooks=function(i){h[i]=[]},o.removeAllHooks=function(){h=_t()},o}var mn=St();export{mn as default};
|
|
3
|
+
/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
dompurify/dist/purify.es.mjs:
|
|
6
|
+
(*! @license DOMPurify 3.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.0/LICENSE *)
|
|
7
|
+
*/
|
|
8
|
+
//# sourceMappingURL=VSS64DLN.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/.pnpm/dompurify@3.4.0/node_modules/dompurify/src/utils.ts", "../node_modules/.pnpm/dompurify@3.4.0/node_modules/dompurify/src/tags.ts", "../node_modules/.pnpm/dompurify@3.4.0/node_modules/dompurify/src/attrs.ts", "../node_modules/.pnpm/dompurify@3.4.0/node_modules/dompurify/src/regexp.ts", "../node_modules/.pnpm/dompurify@3.4.0/node_modules/dompurify/src/purify.ts"],
|
|
4
|
+
"sourcesContent": ["const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!freeze) {\n freeze = function <T>(x: T): T {\n return x;\n };\n}\n\nif (!seal) {\n seal = function <T>(x: T): T {\n return x;\n };\n}\n\nif (!apply) {\n apply = function <T>(\n func: (thisArg: any, ...args: any[]) => T,\n thisArg: any,\n ...args: any[]\n ): T {\n return func.apply(thisArg, args);\n };\n}\n\nif (!construct) {\n construct = function <T>(Func: new (...args: any[]) => T, ...args: any[]): T {\n return new Func(...args);\n };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\nconst arraySplice = unapply(Array.prototype.splice);\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply<T>(\n func: (thisArg: any, ...args: any[]) => T\n): (thisArg: any, ...args: any[]) => T {\n return (thisArg: any, ...args: any[]): T => {\n if (thisArg instanceof RegExp) {\n thisArg.lastIndex = 0;\n }\n\n return apply(func, thisArg, args);\n };\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct<T>(\n Func: new (...args: any[]) => T\n): (...args: any[]) => T {\n return (...args: any[]): T => construct(Func, args);\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(\n set: Record<string, any>,\n array: readonly any[],\n transformCaseFunc: ReturnType<typeof unapply<string>> = stringToLowerCase\n): Record<string, any> {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n (array as any[])[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray<T>(array: T[]): Array<T | null> {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone<T extends Record<string, any>>(object: T): T {\n const newObject = create(null);\n\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (\n value &&\n typeof value === 'object' &&\n value.constructor === Object\n ) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter<T extends Record<string, any>>(\n object: T,\n prop: string\n): ReturnType<typeof unapply<any>> | (() => null) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue(): null {\n return null;\n }\n\n return fallbackValue;\n}\n\nexport {\n // Array\n arrayForEach,\n arrayIndexOf,\n arrayLastIndexOf,\n arrayPop,\n arrayPush,\n arraySlice,\n arraySplice,\n // Object\n entries,\n freeze,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n isFrozen,\n setPrototypeOf,\n seal,\n clone,\n create,\n objectHasOwnProperty,\n // RegExp\n regExpTest,\n // String\n stringIndexOf,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringTrim,\n // Errors\n typeErrorCreate,\n // Other\n lookupGetter,\n addToSet,\n // Reflect\n unapply,\n unconstruct,\n};\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blink',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'content',\n 'data',\n 'datalist',\n 'dd',\n 'decorator',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'element',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'marquee',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'nobr',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'search',\n 'section',\n 'select',\n 'shadow',\n 'slot',\n 'small',\n 'source',\n 'spacer',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const);\n\nexport const svg = freeze([\n 'svg',\n 'a',\n 'altglyph',\n 'altglyphdef',\n 'altglyphitem',\n 'animatecolor',\n 'animatemotion',\n 'animatetransform',\n 'circle',\n 'clippath',\n 'defs',\n 'desc',\n 'ellipse',\n 'enterkeyhint',\n 'exportparts',\n 'filter',\n 'font',\n 'g',\n 'glyph',\n 'glyphref',\n 'hkern',\n 'image',\n 'inputmode',\n 'line',\n 'lineargradient',\n 'marker',\n 'mask',\n 'metadata',\n 'mpath',\n 'part',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialgradient',\n 'rect',\n 'stop',\n 'style',\n 'switch',\n 'symbol',\n 'text',\n 'textpath',\n 'title',\n 'tref',\n 'tspan',\n 'view',\n 'vkern',\n] as const);\n\nexport const svgFilters = freeze([\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n] as const);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n 'animate',\n 'color-profile',\n 'cursor',\n 'discard',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'foreignobject',\n 'hatch',\n 'hatchpath',\n 'mesh',\n 'meshgradient',\n 'meshpatch',\n 'meshrow',\n 'missing-glyph',\n 'script',\n 'set',\n 'solidcolor',\n 'unknown',\n 'use',\n] as const);\n\nexport const mathMl = freeze([\n 'math',\n 'menclose',\n 'merror',\n 'mfenced',\n 'mfrac',\n 'mglyph',\n 'mi',\n 'mlabeledtr',\n 'mmultiscripts',\n 'mn',\n 'mo',\n 'mover',\n 'mpadded',\n 'mphantom',\n 'mroot',\n 'mrow',\n 'ms',\n 'mspace',\n 'msqrt',\n 'mstyle',\n 'msub',\n 'msup',\n 'msubsup',\n 'mtable',\n 'mtd',\n 'mtext',\n 'mtr',\n 'munder',\n 'munderover',\n 'mprescripts',\n] as const);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n 'maction',\n 'maligngroup',\n 'malignmark',\n 'mlongdiv',\n 'mscarries',\n 'mscarry',\n 'msgroup',\n 'mstack',\n 'msline',\n 'msrow',\n 'semantics',\n 'annotation',\n 'annotation-xml',\n 'mprescripts',\n 'none',\n] as const);\n\nexport const text = freeze(['#text'] as const);\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'accept',\n 'action',\n 'align',\n 'alt',\n 'autocapitalize',\n 'autocomplete',\n 'autopictureinpicture',\n 'autoplay',\n 'background',\n 'bgcolor',\n 'border',\n 'capture',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'cite',\n 'class',\n 'clear',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'controlslist',\n 'coords',\n 'crossorigin',\n 'datetime',\n 'decoding',\n 'default',\n 'dir',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'enctype',\n 'enterkeyhint',\n 'exportparts',\n 'face',\n 'for',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'id',\n 'inert',\n 'inputmode',\n 'integrity',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'loading',\n 'loop',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'method',\n 'min',\n 'minlength',\n 'multiple',\n 'muted',\n 'name',\n 'nonce',\n 'noshade',\n 'novalidate',\n 'nowrap',\n 'open',\n 'optimum',\n 'part',\n 'pattern',\n 'placeholder',\n 'playsinline',\n 'popover',\n 'popovertarget',\n 'popovertargetaction',\n 'poster',\n 'preload',\n 'pubdate',\n 'radiogroup',\n 'readonly',\n 'rel',\n 'required',\n 'rev',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'spellcheck',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'slot',\n 'span',\n 'srclang',\n 'start',\n 'src',\n 'srcset',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'xmlns',\n 'slot',\n] as const);\n\nexport const svg = freeze([\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'amplitude',\n 'ascent',\n 'attributename',\n 'attributetype',\n 'azimuth',\n 'basefrequency',\n 'baseline-shift',\n 'begin',\n 'bias',\n 'by',\n 'class',\n 'clip',\n 'clippathunits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'cx',\n 'cy',\n 'd',\n 'dx',\n 'dy',\n 'diffuseconstant',\n 'direction',\n 'display',\n 'divisor',\n 'dur',\n 'edgemode',\n 'elevation',\n 'end',\n 'exponent',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterunits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyphref',\n 'gradientunits',\n 'gradienttransform',\n 'height',\n 'href',\n 'id',\n 'image-rendering',\n 'in',\n 'in2',\n 'intercept',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kerning',\n 'keypoints',\n 'keysplines',\n 'keytimes',\n 'lang',\n 'lengthadjust',\n 'letter-spacing',\n 'kernelmatrix',\n 'kernelunitlength',\n 'lighting-color',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerheight',\n 'markerunits',\n 'markerwidth',\n 'maskcontentunits',\n 'maskunits',\n 'max',\n 'mask',\n 'mask-type',\n 'media',\n 'method',\n 'mode',\n 'min',\n 'name',\n 'numoctaves',\n 'offset',\n 'operator',\n 'opacity',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'paint-order',\n 'path',\n 'pathlength',\n 'patterncontentunits',\n 'patterntransform',\n 'patternunits',\n 'points',\n 'preservealpha',\n 'preserveaspectratio',\n 'primitiveunits',\n 'r',\n 'rx',\n 'ry',\n 'radius',\n 'refx',\n 'refy',\n 'repeatcount',\n 'repeatdur',\n 'restart',\n 'result',\n 'rotate',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'slope',\n 'specularconstant',\n 'specularexponent',\n 'spreadmethod',\n 'startoffset',\n 'stddeviation',\n 'stitchtiles',\n 'stop-color',\n 'stop-opacity',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke',\n 'stroke-width',\n 'style',\n 'surfacescale',\n 'systemlanguage',\n 'tabindex',\n 'tablevalues',\n 'targetx',\n 'targety',\n 'transform',\n 'transform-origin',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textlength',\n 'type',\n 'u1',\n 'u2',\n 'unicode',\n 'values',\n 'viewbox',\n 'visibility',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'width',\n 'word-spacing',\n 'wrap',\n 'writing-mode',\n 'xchannelselector',\n 'ychannelselector',\n 'x',\n 'x1',\n 'x2',\n 'xmlns',\n 'y',\n 'y1',\n 'y2',\n 'z',\n 'zoomandpan',\n] as const);\n\nexport const mathMl = freeze([\n 'accent',\n 'accentunder',\n 'align',\n 'bevelled',\n 'close',\n 'columnalign',\n 'columnlines',\n 'columnspacing',\n 'columnspan',\n 'denomalign',\n 'depth',\n 'dir',\n 'display',\n 'displaystyle',\n 'encoding',\n 'fence',\n 'frame',\n 'height',\n 'href',\n 'id',\n 'largeop',\n 'length',\n 'linethickness',\n 'lquote',\n 'lspace',\n 'mathbackground',\n 'mathcolor',\n 'mathsize',\n 'mathvariant',\n 'maxsize',\n 'minsize',\n 'movablelimits',\n 'notation',\n 'numalign',\n 'open',\n 'rowalign',\n 'rowlines',\n 'rowspacing',\n 'rowspan',\n 'rspace',\n 'rquote',\n 'scriptlevel',\n 'scriptminsize',\n 'scriptsizemultiplier',\n 'selection',\n 'separator',\n 'separators',\n 'stretchy',\n 'subscriptshift',\n 'supscriptshift',\n 'symmetric',\n 'voffset',\n 'width',\n 'xmlns',\n]);\n\nexport const xml = freeze([\n 'xlink:href',\n 'xml:id',\n 'xlink:title',\n 'xml:space',\n 'xmlns:xlink',\n] as const);\n", "import { seal } from './utils.js';\n\n// eslint-disable-next-line unicorn/better-regex\nexport const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nexport const TMPLIT_EXPR = seal(/\\$\\{[\\w\\W]*/gm); // eslint-disable-line unicorn/better-regex\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\nexport const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n", "/* eslint-disable @typescript-eslint/indent */\n\nimport type {\n TrustedHTML,\n TrustedTypesWindow,\n} from 'trusted-types/lib/index.js';\nimport type { Config, UseProfilesConfig } from './config';\nimport * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n addToSet,\n clone,\n entries,\n freeze,\n arrayForEach,\n arrayLastIndexOf,\n arrayPop,\n arrayPush,\n arraySplice,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringIndexOf,\n stringTrim,\n regExpTest,\n typeErrorCreate,\n lookupGetter,\n create,\n objectHasOwnProperty,\n} from './utils.js';\n\nexport type { Config } from './config';\n\ndeclare const VERSION: string;\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5, // Deprecated\n entityNode: 6, // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12, // Deprecated\n};\n\nconst getGlobal = function (): WindowLike {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function (\n trustedTypes: TrustedTypePolicyFactory,\n purifyHostElement: HTMLScriptElement\n) {\n if (\n typeof trustedTypes !== 'object' ||\n typeof trustedTypes.createPolicy !== 'function'\n ) {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n },\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn(\n 'TrustedTypes policy ' + policyName + ' could not be created.'\n );\n return null;\n }\n};\n\nconst _createHooksMap = function (): HooksMap {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: [],\n };\n};\n\nfunction createDOMPurify(window: WindowLike = getGlobal()): DOMPurify {\n const DOMPurify: DOMPurify = (root: WindowLike) => createDOMPurify(root);\n\n DOMPurify.version = VERSION;\n\n DOMPurify.removed = [];\n\n if (\n !window ||\n !window.document ||\n window.document.nodeType !== NODE_TYPE.document ||\n !window.Element\n ) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n let { document } = window;\n\n const originalDocument = document;\n const currentScript: HTMLScriptElement =\n originalDocument.currentScript as HTMLScriptElement;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || (window as any).MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes,\n } = window;\n\n const ElementPrototype = Element.prototype;\n\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n let trustedTypesPolicy;\n let emptyHTML = '';\n\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName,\n } = document;\n const { importNode } = originalDocument;\n\n let hooks = _createHooksMap();\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported =\n typeof entries === 'function' &&\n typeof getParentNode === 'function' &&\n implementation &&\n implementation.createHTMLDocument !== undefined;\n\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT,\n } = EXPRESSIONS;\n\n let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n ...TAGS.html,\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.mathMl,\n ...TAGS.text,\n ]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n ...ATTRS.html,\n ...ATTRS.svg,\n ...ATTRS.mathMl,\n ...ATTRS.xml,\n ]);\n\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(\n create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false,\n },\n })\n );\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */\n const EXTRA_ELEMENT_HANDLING = Object.seal(\n create(null, {\n tagCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n })\n );\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES: UseProfilesConfig | false = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n 'annotation-xml',\n 'audio',\n 'colgroup',\n 'desc',\n 'foreignobject',\n 'head',\n 'iframe',\n 'math',\n 'mi',\n 'mn',\n 'mo',\n 'ms',\n 'mtext',\n 'noembed',\n 'noframes',\n 'noscript',\n 'plaintext',\n 'script',\n 'style',\n 'svg',\n 'template',\n 'thead',\n 'title',\n 'video',\n 'xmp',\n ]);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n 'audio',\n 'video',\n 'img',\n 'source',\n 'image',\n 'track',\n ]);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n 'alt',\n 'class',\n 'for',\n 'id',\n 'label',\n 'name',\n 'pattern',\n 'placeholder',\n 'role',\n 'summary',\n 'title',\n 'value',\n 'style',\n 'xmlns',\n ]);\n\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n {},\n [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n stringToString\n );\n\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [\n 'mi',\n 'mo',\n 'mn',\n 'ms',\n 'mtext',\n ]);\n\n let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n 'title',\n 'style',\n 'font',\n 'a',\n 'script',\n ]);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE: null | DOMParserSupportedType = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc: null | Parameters<typeof addToSet>[2] = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG: Config | null = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n\n const isRegexOrFunction = function (\n testValue: unknown\n ): testValue is Function | RegExp {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function (cfg: Config = {}): void {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n ? DEFAULT_PARSER_MEDIA_TYPE\n : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc =\n PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n ? stringToString\n : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS')\n ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc)\n : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR')\n ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc)\n : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES')\n ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString)\n : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR')\n ? addToSet(\n clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n cfg.ADD_URI_SAFE_ATTR,\n transformCaseFunc\n )\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS')\n ? addToSet(\n clone(DEFAULT_DATA_URI_TAGS),\n cfg.ADD_DATA_URI_TAGS,\n transformCaseFunc\n )\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS')\n ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc)\n : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS')\n ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc)\n : clone({});\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR')\n ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc)\n : clone({});\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES')\n ? cfg.USE_PROFILES\n : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI = cfg.ALLOWED_URI_REGEXP || EXPRESSIONS.IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n MATHML_TEXT_INTEGRATION_POINTS =\n cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n HTML_INTEGRATION_POINTS =\n cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || create(null);\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements ===\n 'boolean'\n ) {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, TAGS.text);\n ALLOWED_ATTR = create(null);\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, TAGS.html);\n addToSet(ALLOWED_ATTR, ATTRS.html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, TAGS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, TAGS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n }\n\n /* Always reset function-based ADD_TAGS / ADD_ATTR checks to prevent\n * leaking across calls when switching from function to array config */\n EXTRA_ELEMENT_HANDLING.tagCheck = null;\n EXTRA_ELEMENT_HANDLING.attributeCheck = null;\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (typeof cfg.ADD_TAGS === 'function') {\n EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n } else {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n }\n\n if (cfg.ADD_ATTR) {\n if (typeof cfg.ADD_ATTR === 'function') {\n EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n } else {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n if (cfg.ADD_FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.'\n );\n }\n\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.'\n );\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(\n trustedTypes,\n currentScript\n );\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.svgDisallowed,\n ]);\n const ALL_MATHML_TAGS = addToSet({}, [\n ...TAGS.mathMl,\n ...TAGS.mathMlDisallowed,\n ]);\n\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function (element: Element): boolean {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template',\n };\n }\n\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return (\n tagName === 'svg' &&\n (parentTagName === 'annotation-xml' ||\n MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n );\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (\n parent.namespaceURI === SVG_NAMESPACE &&\n !HTML_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n if (\n parent.namespaceURI === MATHML_NAMESPACE &&\n !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return (\n !ALL_MATHML_TAGS[tagName] &&\n (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n );\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n ALLOWED_NAMESPACES[element.namespaceURI]\n ) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function (node: Node): void {\n arrayPush(DOMPurify.removed, { element: node });\n\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function (name: string, element: Element): void {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element,\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element,\n });\n }\n\n element.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function (dirty: string): Document {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n NAMESPACE === HTML_NAMESPACE\n ) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty =\n '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' +\n dirty +\n '</body></html>';\n }\n\n const dirtyPayload = trustedTypesPolicy\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT\n ? emptyHTML\n : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n const body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(\n document.createTextNode(leadingWhitespace),\n body.childNodes[0] || null\n );\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(\n doc,\n WHOLE_DOCUMENT ? 'html' : 'body'\n )[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function (root: Node): NodeIterator {\n return createNodeIterator.call(\n root.ownerDocument || root,\n root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT |\n NodeFilter.SHOW_COMMENT |\n NodeFilter.SHOW_TEXT |\n NodeFilter.SHOW_PROCESSING_INSTRUCTION |\n NodeFilter.SHOW_CDATA_SECTION,\n null\n );\n };\n\n /**\n * _isClobbered\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function (element: Element): boolean {\n return (\n element instanceof HTMLFormElement &&\n (typeof element.nodeName !== 'string' ||\n typeof element.textContent !== 'string' ||\n typeof element.removeChild !== 'function' ||\n !(element.attributes instanceof NamedNodeMap) ||\n typeof element.removeAttribute !== 'function' ||\n typeof element.setAttribute !== 'function' ||\n typeof element.namespaceURI !== 'string' ||\n typeof element.insertBefore !== 'function' ||\n typeof element.hasChildNodes !== 'function')\n );\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param value object to check whether it's a DOM node\n * @return true is object is a DOM node\n */\n const _isNode = function (value: unknown): value is Node {\n return typeof Node === 'function' && value instanceof Node;\n };\n\n function _executeHooks<T extends HookFunction>(\n hooks: HookFunction[],\n currentNode: Parameters<T>[0],\n data: Parameters<T>[1]\n ): void {\n arrayForEach(hooks, (hook: T) => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n const _sanitizeElements = function (currentNode: any): boolean {\n let content = null;\n\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS,\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (\n SAFE_FOR_XML &&\n currentNode.hasChildNodes() &&\n !_isNode(currentNode.firstElementChild) &&\n regExpTest(/<[/\\w!]/g, currentNode.innerHTML) &&\n regExpTest(/<[/\\w!]/g, currentNode.textContent)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove risky CSS construction leading to mXSS */\n if (\n SAFE_FOR_XML &&\n currentNode.namespaceURI === HTML_NAMESPACE &&\n tagName === 'style' &&\n _isNode(currentNode.firstElementChild)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (\n SAFE_FOR_XML &&\n currentNode.nodeType === NODE_TYPE.comment &&\n regExpTest(/<[/\\w]/g, currentNode.data)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (\n FORBID_TAGS[tagName] ||\n (!(\n EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function &&\n EXTRA_ELEMENT_HANDLING.tagCheck(tagName)\n ) &&\n !ALLOWED_TAGS[tagName])\n ) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n ) {\n return false;\n }\n\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)\n ) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if (\n (tagName === 'noscript' ||\n tagName === 'noembed' ||\n tagName === 'noframes') &&\n regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr: RegExp) => {\n content = stringReplace(content, expr, ' ');\n });\n\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function (\n lcTag: string,\n lcName: string,\n value: string\n ): boolean {\n /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */\n if (FORBID_ATTR[lcName]) {\n return false;\n }\n\n /* Make sure attribute cannot clobber */\n if (\n SANITIZE_DOM &&\n (lcName === 'id' || lcName === 'name') &&\n (value in document || value in formElement)\n ) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (\n ALLOW_DATA_ATTR &&\n !FORBID_ATTR[lcName] &&\n regExpTest(DATA_ATTR, lcName)\n ) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n // This attribute is safe\n /* Check if ADD_ATTR function allows this attribute */\n } else if (\n EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function &&\n EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)\n ) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n (_isBasicCustomElement(lcTag) &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))) &&\n ((CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName)) ||\n (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)))) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n (lcName === 'is' &&\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))\n ) {\n // If user has supplied a regexp or function in CUSTOM_ELEMENT_HANDLING.tagNameCheck, we need to also allow derived custom elements using the same tagName test.\n // Additionally, we need to allow attributes passing the CUSTOM_ELEMENT_HANDLING.attributeNameCheck user has configured, as custom elements can define these at their own discretion.\n } else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (\n regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if (\n (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n lcTag !== 'script' &&\n stringIndexOf(value, 'data:') === 0 &&\n DATA_URI_TAGS[lcTag]\n ) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (\n ALLOW_UNKNOWN_PROTOCOLS &&\n !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Check for binary attributes */\n } else if (value) {\n return false;\n } else {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n }\n\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function (tagName: string): RegExpMatchArray {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function (currentNode: Element): void {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n\n const { attributes } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined,\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const { name, namespaceURI, value: attrValue } = attr;\n const lcName = transformCaseFunc(name);\n\n const initValue = attrValue;\n let value = name === 'value' ? initValue : stringTrim(initValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Work around a security issue with comments inside attributes */\n if (\n SAFE_FOR_XML &&\n regExpTest(\n /((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,\n value\n )\n ) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Make sure we cannot easily use animated hrefs, even if animations are allowed */\n if (lcName === 'attributename' && stringMatch(value, 'href')) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr: RegExp) => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Handle attributes that require Trusted Types */\n if (\n trustedTypesPolicy &&\n typeof trustedTypes === 'object' &&\n typeof trustedTypes.getAttributeType === 'function'\n ) {\n if (namespaceURI) {\n /* Namespaces are not yet supported, see https://bugs.chromium.org/p/chromium/issues/detail?id=1305293 */\n } else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML': {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n\n case 'TrustedScriptURL': {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n if (value !== initValue) {\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {\n _removeAttribute(name, currentNode);\n }\n }\n }\n\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function (fragment: DocumentFragment): void {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n\n while ((shadowNode = shadowIterator.nextNode())) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode);\n\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n }\n\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg = {}) {\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if ((dirty as Node).nodeName) {\n const tagName = transformCaseFunc((dirty as Node).nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate(\n 'root node is forbidden and cannot be sanitized in-place'\n );\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (\n importedNode.nodeType === NODE_TYPE.element &&\n importedNode.nodeName === 'BODY'\n ) {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (\n !RETURN_DOM &&\n !SAFE_FOR_TEMPLATES &&\n !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1\n ) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while ((currentNode = nodeIterator.nextNode())) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode);\n\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (SAFE_FOR_TEMPLATES) {\n body.normalize();\n let html = body.innerHTML;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr: RegExp) => {\n html = stringReplace(html, expr, ' ');\n });\n body.innerHTML = html;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (\n WHOLE_DOCUMENT &&\n ALLOWED_TAGS['!doctype'] &&\n body.ownerDocument &&\n body.ownerDocument.doctype &&\n body.ownerDocument.doctype.name &&\n regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n ) {\n serializedHTML =\n '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr: RegExp) => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(serializedHTML)\n : serializedHTML;\n };\n\n DOMPurify.setConfig = function (cfg = {}) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n DOMPurify.addHook = function (\n entryPoint: keyof HooksMap,\n hookFunction: HookFunction\n ) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n DOMPurify.removeHook = function (\n entryPoint: keyof HooksMap,\n hookFunction: HookFunction\n ) {\n if (hookFunction !== undefined) {\n const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n\n return index === -1\n ? undefined\n : arraySplice(hooks[entryPoint], index, 1)[0];\n }\n\n return arrayPop(hooks[entryPoint]);\n };\n\n DOMPurify.removeHooks = function (entryPoint: keyof HooksMap) {\n hooks[entryPoint] = [];\n };\n\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n\n return DOMPurify;\n}\n\nexport default createDOMPurify();\n\nexport interface DOMPurify {\n /**\n * Creates a DOMPurify instance using the given window-like object. Defaults to `window`.\n */\n (root?: WindowLike): DOMPurify;\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n version: string;\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n removed: Array<RemovedElement | RemovedAttribute>;\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n isSupported: boolean;\n\n /**\n * Set the configuration once.\n *\n * @param cfg configuration object\n */\n setConfig(cfg?: Config): void;\n\n /**\n * Removes the configuration.\n */\n clearConfig(): void;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty string or DOM node\n * @param cfg object\n * @returns Sanitized TrustedHTML.\n */\n sanitize(\n dirty: string | Node,\n cfg: Config & { RETURN_TRUSTED_TYPE: true }\n ): TrustedHTML;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty DOM node\n * @param cfg object\n * @returns Sanitized DOM node.\n */\n sanitize(dirty: Node, cfg: Config & { IN_PLACE: true }): Node;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty string or DOM node\n * @param cfg object\n * @returns Sanitized DOM node.\n */\n sanitize(dirty: string | Node, cfg: Config & { RETURN_DOM: true }): Node;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty string or DOM node\n * @param cfg object\n * @returns Sanitized document fragment.\n */\n sanitize(\n dirty: string | Node,\n cfg: Config & { RETURN_DOM_FRAGMENT: true }\n ): DocumentFragment;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty string or DOM node\n * @param cfg object\n * @returns Sanitized string.\n */\n sanitize(dirty: string | Node, cfg?: Config): string;\n\n /**\n * Checks if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n *\n * @param tag Tag name of containing element.\n * @param attr Attribute name.\n * @param value Attribute value.\n * @returns Returns true if `value` is valid. Otherwise, returns false.\n */\n isValidAttribute(tag: string, attr: string, value: string): boolean;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(entryPoint: BasicHookName, hookFunction: NodeHook): void;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(entryPoint: ElementHookName, hookFunction: ElementHook): void;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(\n entryPoint: DocumentFragmentHookName,\n hookFunction: DocumentFragmentHook\n ): void;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(\n entryPoint: 'uponSanitizeElement',\n hookFunction: UponSanitizeElementHook\n ): void;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(\n entryPoint: 'uponSanitizeAttribute',\n hookFunction: UponSanitizeAttributeHook\n ): void;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: BasicHookName,\n hookFunction?: NodeHook\n ): NodeHook | undefined;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: ElementHookName,\n hookFunction?: ElementHook\n ): ElementHook | undefined;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: DocumentFragmentHookName,\n hookFunction?: DocumentFragmentHook\n ): DocumentFragmentHook | undefined;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: 'uponSanitizeElement',\n hookFunction?: UponSanitizeElementHook\n ): UponSanitizeElementHook | undefined;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: 'uponSanitizeAttribute',\n hookFunction?: UponSanitizeAttributeHook\n ): UponSanitizeAttributeHook | undefined;\n\n /**\n * Removes all DOMPurify hooks at a given entryPoint\n *\n * @param entryPoint entry point for the hooks to remove\n */\n removeHooks(entryPoint: HookName): void;\n\n /**\n * Removes all DOMPurify hooks.\n */\n removeAllHooks(): void;\n}\n\n/**\n * An element removed by DOMPurify.\n */\nexport interface RemovedElement {\n /**\n * The element that was removed.\n */\n element: Node;\n}\n\n/**\n * An element removed by DOMPurify.\n */\nexport interface RemovedAttribute {\n /**\n * The attribute that was removed.\n */\n attribute: Attr | null;\n\n /**\n * The element that the attribute was removed.\n */\n from: Node;\n}\n\ntype BasicHookName =\n | 'beforeSanitizeElements'\n | 'afterSanitizeElements'\n | 'uponSanitizeShadowNode';\ntype ElementHookName = 'beforeSanitizeAttributes' | 'afterSanitizeAttributes';\ntype DocumentFragmentHookName =\n | 'beforeSanitizeShadowDOM'\n | 'afterSanitizeShadowDOM';\ntype UponSanitizeElementHookName = 'uponSanitizeElement';\ntype UponSanitizeAttributeHookName = 'uponSanitizeAttribute';\n\ninterface HooksMap {\n beforeSanitizeElements: NodeHook[];\n afterSanitizeElements: NodeHook[];\n beforeSanitizeShadowDOM: DocumentFragmentHook[];\n uponSanitizeShadowNode: NodeHook[];\n afterSanitizeShadowDOM: DocumentFragmentHook[];\n beforeSanitizeAttributes: ElementHook[];\n afterSanitizeAttributes: ElementHook[];\n uponSanitizeElement: UponSanitizeElementHook[];\n uponSanitizeAttribute: UponSanitizeAttributeHook[];\n}\n\ntype ArrayElement<T> = T extends Array<infer U> ? U : never;\n\ntype HookFunction = ArrayElement<HooksMap[keyof HooksMap]>;\n\nexport type HookName =\n | BasicHookName\n | ElementHookName\n | DocumentFragmentHookName\n | UponSanitizeElementHookName\n | UponSanitizeAttributeHookName;\n\nexport type NodeHook = (\n this: DOMPurify,\n currentNode: Node,\n hookEvent: null,\n config: Config\n) => void;\n\nexport type ElementHook = (\n this: DOMPurify,\n currentNode: Element,\n hookEvent: null,\n config: Config\n) => void;\n\nexport type DocumentFragmentHook = (\n this: DOMPurify,\n currentNode: DocumentFragment,\n hookEvent: null,\n config: Config\n) => void;\n\nexport type UponSanitizeElementHook = (\n this: DOMPurify,\n currentNode: Node,\n hookEvent: UponSanitizeElementHookEvent,\n config: Config\n) => void;\n\nexport type UponSanitizeAttributeHook = (\n this: DOMPurify,\n currentNode: Element,\n hookEvent: UponSanitizeAttributeHookEvent,\n config: Config\n) => void;\n\nexport interface UponSanitizeElementHookEvent {\n tagName: string;\n allowedTags: Record<string, boolean>;\n}\n\nexport interface UponSanitizeAttributeHookEvent {\n attrName: string;\n attrValue: string;\n keepAttr: boolean;\n allowedAttributes: Record<string, boolean>;\n forceKeepAttr: boolean | undefined;\n}\n\n/**\n * A `Window`-like object containing the properties and types that DOMPurify requires.\n */\nexport type WindowLike = Pick<\n typeof globalThis,\n | 'DocumentFragment'\n | 'HTMLTemplateElement'\n | 'Node'\n | 'Element'\n | 'NodeFilter'\n | 'NamedNodeMap'\n | 'HTMLFormElement'\n | 'DOMParser'\n> & {\n document?: Document;\n MozNamedAttrMap?: typeof window.NamedNodeMap;\n} & Pick<TrustedTypesWindow, 'trustedTypes'>;\n"],
|
|
5
|
+
"mappings": "AAAA,GAAM,CACJA,QAAAA,GACAC,eAAAA,GACAC,SAAAA,GACAC,eAAAA,GACAC,yBAAAA,EAAwB,EACtBC,OAEA,CAAEC,OAAAA,EAAQC,KAAAA,EAAMC,OAAAA,EAAM,EAAKH,OAC3B,CAAEI,MAAAA,GAAOC,UAAAA,EAAS,EAAK,OAAOC,QAAY,KAAeA,QAExDL,IACHA,EAAS,SAAaM,EAAI,CACxB,OAAOA,CACT,GAGGL,IACHA,EAAO,SAAaK,EAAI,CACtB,OAAOA,CACT,GAGGH,KACHA,GAAQ,SACNI,EACAC,EACc,CAAA,QAAAC,EAAAC,UAAAC,OAAXC,EAAW,IAAAC,MAAAJ,EAAA,EAAAA,EAAA,EAAA,CAAA,EAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAXF,EAAWE,EAAA,CAAA,EAAAJ,UAAAI,CAAA,EAEd,OAAOP,EAAKJ,MAAMK,EAASI,CAAI,CACjC,GAGGR,KACHA,GAAY,SAAaW,EAA+C,CAAA,QAAAC,EAAAN,UAAAC,OAAXC,EAAW,IAAAC,MAAAG,EAAA,EAAAA,EAAA,EAAA,CAAA,EAAAC,EAAA,EAAAA,EAAAD,EAAAC,IAAXL,EAAWK,EAAA,CAAA,EAAAP,UAAAO,CAAA,EACtE,OAAO,IAAIF,EAAK,GAAGH,CAAI,CACzB,GAGF,IAAMM,EAAeC,EAAQN,MAAMO,UAAUC,OAAO,EAE9CC,GAAmBH,EAAQN,MAAMO,UAAUG,WAAW,EACtDC,GAAWL,EAA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,MACA,MACA,QACA,aACA,OACA,KACA,SACA,SACA,UACA,SACA,OACA,OACA,MACA,WACA,UACA,OACA,WACA,KACA,YACA,MACA,UACA,MACA,SACA,MACA,MACA,KACA,KACA,UACA,KACA,WACA,aACA,SACA,OACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,OACA,SACA,SACA,KACA,OACA,IACA,MACA,QACA,MACA,MACA,QACA,SACA,KACA,OACA,MACA,OACA,UACA,OACA,WACA,QACA,MACA,OACA,KACA,WACA,SACA,SACA,IACA,UACA,MACA,WACA,IACA,KACA,KACA,OACA,IACA,OACA,SACA,UACA,SACA,SACA,OACA,QACA,SACA,SACA,OACA,SACA,SACA,QACA,MACA,UACA,MACA,QACA,QACA,KACA,WACA,WACA,QACA,KACA,QACA,OACA,KACA,QACA,KACA,IACA,KACA,MACA,QACA,KAAK,CACG,EAEG8E,GAAM9E,EAAO,CACxB,MACA,IACA,WACA,cACA,eACA,eACA,gBACA,mBACA,SACA,WACA,OACA,OACA,UACA,eACA,cACA,SACA,OACA,IACA,QACA,WACA,QACA,QACA,YACA,OACA,iBACA,SACA,OACA,WACA,QACA,OACA,OACA,UACA,UACA,WACA,iBACA,OACA,OACA,QACA,SACA,SACA,OACA,WACA,QACA,OACA,QACA,OACA,OAAO,CACC,EAEG+E,GAAa/E,EAAO,CAC/B,UACA,gBACA,sBACA,cACA,mBACA,oBACA,oBACA,iBACA,eACA,UACA,UACA,UACA,UACA,UACA,iBACA,UACA,UACA,cACA,eACA,WACA,eACA,qBACA,cACA,SACA,cAAc,CACN,EAMGgF,GAAgBhF,EAAO,CAClC,UACA,gBACA,SACA,UACA,YACA,mBACA,iBACA,gBACA,gBACA,gBACA,QACA,YACA,OACA,eACA,YACA,UACA,gBACA,SACA,MACA,aACA,UACA,KAAK,CACG,EAEGiF,GAASjF,EAAO,CAC3B,OACA,WACA,SACA,UACA,QACA,SACA,KACA,aACA,gBACA,KACA,KACA,QACA,UACA,WACA,QACA,OACA,KACA,SACA,QACA,SACA,OACA,OACA,UACA,SACA,MACA,QACA,MACA,SACA,aACA,aAAa,CACL,EAIGkF,GAAmBlF,EAAO,CACrC,UACA,cACA,aACA,WACA,YACA,UACA,UACA,SACA,SACA,QACA,YACA,aACA,iBACA,cACA,MAAM,CACE,EAEGmF,GAAOnF,EAAO,CAAC,OAAO,CAAU,EC1RhC6E,GAAO7E,EAAO,CACzB,SACA,SACA,QACA,MACA,iBACA,eACA,uBACA,WACA,aACA,UACA,SACA,UACA,cACA,cACA,UACA,OACA,QACA,QACA,QACA,OACA,UACA,WACA,eACA,SACA,cACA,WACA,WACA,UACA,MACA,WACA,0BACA,wBACA,WACA,YACA,UACA,eACA,cACA,OACA,MACA,UACA,SACA,SACA,OACA,OACA,WACA,KACA,QACA,YACA,YACA,QACA,OACA,QACA,OACA,OACA,UACA,OACA,MACA,MACA,YACA,QACA,SACA,MACA,YACA,WACA,QACA,OACA,QACA,UACA,aACA,SACA,OACA,UACA,OACA,UACA,cACA,cACA,UACA,gBACA,sBACA,SACA,UACA,UACA,aACA,WACA,MACA,WACA,MACA,WACA,OACA,OACA,UACA,aACA,QACA,WACA,QACA,OACA,QACA,OACA,OACA,UACA,QACA,MACA,SACA,OACA,QACA,UACA,WACA,QACA,YACA,OACA,SACA,SACA,QACA,QACA,OACA,QACA,MAAM,CACE,EAEG8E,GAAM9E,EAAO,CACxB,gBACA,aACA,WACA,qBACA,YACA,SACA,gBACA,gBACA,UACA,gBACA,iBACA,QACA,OACA,KACA,QACA,OACA,gBACA,YACA,YACA,QACA,sBACA,8BACA,gBACA,kBACA,KACA,KACA,IACA,KACA,KACA,kBACA,YACA,UACA,UACA,MACA,WACA,YACA,MACA,WACA,OACA,eACA,YACA,SACA,cACA,cACA,gBACA,cACA,YACA,mBACA,eACA,aACA,eACA,cACA,KACA,KACA,KACA,KACA,aACA,WACA,gBACA,oBACA,SACA,OACA,KACA,kBACA,KACA,MACA,YACA,IACA,KACA,KACA,KACA,KACA,UACA,YACA,aACA,WACA,OACA,eACA,iBACA,eACA,mBACA,iBACA,QACA,aACA,aACA,eACA,eACA,cACA,cACA,mBACA,YACA,MACA,OACA,YACA,QACA,SACA,OACA,MACA,OACA,aACA,SACA,WACA,UACA,QACA,SACA,cACA,SACA,WACA,cACA,OACA,aACA,sBACA,mBACA,eACA,SACA,gBACA,sBACA,iBACA,IACA,KACA,KACA,SACA,OACA,OACA,cACA,YACA,UACA,SACA,SACA,QACA,OACA,kBACA,QACA,mBACA,mBACA,eACA,cACA,eACA,cACA,aACA,eACA,mBACA,oBACA,iBACA,kBACA,oBACA,iBACA,SACA,eACA,QACA,eACA,iBACA,WACA,cACA,UACA,UACA,YACA,mBACA,cACA,kBACA,iBACA,aACA,OACA,KACA,KACA,UACA,SACA,UACA,aACA,UACA,aACA,gBACA,gBACA,QACA,eACA,OACA,eACA,mBACA,mBACA,IACA,KACA,KACA,QACA,IACA,KACA,KACA,IACA,YAAY,CACJ,EAEGiF,GAASjF,EAAO,CAC3B,SACA,cACA,QACA,WACA,QACA,cACA,cACA,gBACA,aACA,aACA,QACA,MACA,UACA,eACA,WACA,QACA,QACA,SACA,OACA,KACA,UACA,SACA,gBACA,SACA,SACA,iBACA,YACA,WACA,cACA,UACA,UACA,gBACA,WACA,WACA,OACA,WACA,WACA,aACA,UACA,SACA,SACA,cACA,gBACA,uBACA,YACA,YACA,aACA,WACA,iBACA,iBACA,YACA,UACA,QACA,OAAO,CACR,EAEYoF,GAAMpF,EAAO,CACxB,aACA,SACA,cACA,YACA,aAAa,CACL,ECrXGqF,GAAgBpF,EAAK,2BAA2B,EAChDqF,GAAWrF,EAAK,uBAAuB,EACvCsF,GAActF,EAAK,eAAe,EAClCuF,GAAYvF,EAAK,8BAA8B,EAC/CwF,GAAYxF,EAAK,gBAAgB,EACjCyF,GAAiBzF,EAC5B,oGAEW0F,GAAoB1F,EAAK,uBAAuB,EAChD2F,GAAkB3F,EAC7B,+DAEW4F,GAAe5F,EAAK,SAAS,EAC7B6F,GAAiB7F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"getOwnPropertyDescriptor", "Object", "freeze", "seal", "create", "apply", "construct", "Reflect", "x", "func", "thisArg", "_len", "arguments", "length", "args", "Array", "_key", "Func", "_len2", "_key2", "arrayForEach", "unapply", "prototype", "forEach", "arrayLastIndexOf", "lastIndexOf", "arrayPop", "pop", "arrayPush", "push", "arraySplice", "splice", "stringToLowerCase", "String", "toLowerCase", "stringToString", "toString", "stringMatch", "match", "stringReplace", "replace", "stringIndexOf", "indexOf", "stringTrim", "trim", "objectHasOwnProperty", "hasOwnProperty", "regExpTest", "RegExp", "test", "typeErrorCreate", "unconstruct", "TypeError", "lastIndex", "_len3", "_key3", "_len4", "_key4", "addToSet", "set", "array", "transformCaseFunc", "l", "element", "lcElement", "cleanArray", "index", "clone", "object", "newObject", "property", "value", "isArray", "constructor", "lookupGetter", "prop", "desc", "get", "fallbackValue", "html", "svg", "svgFilters", "svgDisallowed", "mathMl", "mathMlDisallowed", "text", "xml", "MUSTACHE_EXPR", "ERB_EXPR", "TMPLIT_EXPR", "DATA_ATTR", "ARIA_ATTR", "IS_ALLOWED_URI", "IS_SCRIPT_OR_DATA", "ATTR_WHITESPACE", "DOCTYPE_NAME", "CUSTOM_ELEMENT", "NODE_TYPE", "progressingInstruction", "comment", "document", "getGlobal", "window", "_createTrustedTypesPolicy", "trustedTypes", "purifyHostElement", "createPolicy", "suffix", "ATTR_NAME", "hasAttribute", "getAttribute", "policyName", "createHTML", "createScriptURL", "scriptUrl", "console", "warn", "_createHooksMap", "afterSanitizeAttributes", "afterSanitizeElements", "afterSanitizeShadowDOM", "beforeSanitizeAttributes", "beforeSanitizeElements", "beforeSanitizeShadowDOM", "uponSanitizeAttribute", "uponSanitizeElement", "uponSanitizeShadowNode", "createDOMPurify", "undefined", "DOMPurify", "root", "version", "VERSION", "removed", "nodeType", "Element", "isSupported", "originalDocument", "currentScript", "DocumentFragment", "HTMLTemplateElement", "Node", "NodeFilter", "NamedNodeMap", "MozNamedAttrMap", "HTMLFormElement", "DOMParser", "ElementPrototype", "cloneNode", "remove", "getNextSibling", "getChildNodes", "getParentNode", "template", "createElement", "content", "ownerDocument", "trustedTypesPolicy", "emptyHTML", "implementation", "createNodeIterator", "createDocumentFragment", "getElementsByTagName", "importNode", "hooks", "createHTMLDocument", "EXPRESSIONS", "ALLOWED_TAGS", "DEFAULT_ALLOWED_TAGS", "TAGS", "ALLOWED_ATTR", "DEFAULT_ALLOWED_ATTR", "ATTRS", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck", "writable", "configurable", "enumerable", "attributeNameCheck", "allowCustomizedBuiltInElements", "FORBID_TAGS", "FORBID_ATTR", "EXTRA_ELEMENT_HANDLING", "tagCheck", "attributeCheck", "ALLOW_ARIA_ATTR", "ALLOW_DATA_ATTR", "ALLOW_UNKNOWN_PROTOCOLS", "ALLOW_SELF_CLOSE_IN_ATTR", "SAFE_FOR_TEMPLATES", "SAFE_FOR_XML", "WHOLE_DOCUMENT", "SET_CONFIG", "FORCE_BODY", "RETURN_DOM", "RETURN_DOM_FRAGMENT", "RETURN_TRUSTED_TYPE", "SANITIZE_DOM", "SANITIZE_NAMED_PROPS", "SANITIZE_NAMED_PROPS_PREFIX", "KEEP_CONTENT", "IN_PLACE", "USE_PROFILES", "FORBID_CONTENTS", "DEFAULT_FORBID_CONTENTS", "DATA_URI_TAGS", "DEFAULT_DATA_URI_TAGS", "URI_SAFE_ATTRIBUTES", "DEFAULT_URI_SAFE_ATTRIBUTES", "MATHML_NAMESPACE", "SVG_NAMESPACE", "HTML_NAMESPACE", "NAMESPACE", "IS_EMPTY_INPUT", "ALLOWED_NAMESPACES", "DEFAULT_ALLOWED_NAMESPACES", "MATHML_TEXT_INTEGRATION_POINTS", "HTML_INTEGRATION_POINTS", "COMMON_SVG_AND_HTML_ELEMENTS", "PARSER_MEDIA_TYPE", "SUPPORTED_PARSER_MEDIA_TYPES", "DEFAULT_PARSER_MEDIA_TYPE", "CONFIG", "formElement", "isRegexOrFunction", "testValue", "Function", "_parseConfig", "cfg", "ADD_URI_SAFE_ATTR", "ADD_DATA_URI_TAGS", "ALLOWED_URI_REGEXP", "ADD_TAGS", "ADD_ATTR", "ADD_FORBID_CONTENTS", "table", "tbody", "TRUSTED_TYPES_POLICY", "ALL_SVG_TAGS", "ALL_MATHML_TAGS", "_checkValidNamespace", "parent", "tagName", "namespaceURI", "parentTagName", "Boolean", "_forceRemove", "node", "removeChild", "_removeAttribute", "name", "attribute", "getAttributeNode", "from", "removeAttribute", "setAttribute", "_initDocument", "dirty", "doc", "leadingWhitespace", "matches", "dirtyPayload", "parseFromString", "documentElement", "createDocument", "innerHTML", "body", "insertBefore", "createTextNode", "childNodes", "call", "_createNodeIterator", "SHOW_ELEMENT", "SHOW_COMMENT", "SHOW_TEXT", "SHOW_PROCESSING_INSTRUCTION", "SHOW_CDATA_SECTION", "_isClobbered", "nodeName", "textContent", "attributes", "hasChildNodes", "_isNode", "_executeHooks", "currentNode", "data", "hook", "_sanitizeElements", "allowedTags", "firstElementChild", "_isBasicCustomElement", "parentNode", "childCount", "i", "childClone", "__removalCount", "expr", "_isValidAttribute", "lcTag", "lcName", "_sanitizeAttributes", "hookEvent", "attrName", "attrValue", "keepAttr", "allowedAttributes", "forceKeepAttr", "attr", "initValue", "getAttributeType", "setAttributeNS", "_sanitizeShadowDOM", "fragment", "shadowNode", "shadowIterator", "nextNode", "sanitize", "importedNode", "returnNode", "appendChild", "firstChild", "nodeIterator", "normalize", "shadowroot", "shadowrootmode", "serializedHTML", "outerHTML", "doctype", "setConfig", "clearConfig", "isValidAttribute", "tag", "addHook", "entryPoint", "hookFunction", "removeHook", "removeHooks", "removeAllHooks", "purify"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
// iife:/home/runner/work/transportr/transportr/dist/content-type.js
|
|
3
|
+
var i = { AAC: "audio/aac", ABW: "application/x-abiword", ARC: "application/x-freearc", AVIF: "image/avif", AVI: "video/x-msvideo", AZW: "application/vnd.amazon.ebook", BIN: "application/octet-stream", BMP: "image/bmp", BZIP: "application/x-bzip", BZIP2: "application/x-bzip2", CDA: "application/x-cdf", CSH: "application/x-csh", CSS: "text/css", CSV: "text/csv", DOC: "application/msword", DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", EOT: "application/vnd.ms-fontobject", EPUB: "application/epub+zip", GZIP: "application/gzip", GIF: "image/gif", HTML: "text/html", ICO: "image/vnd.microsoft.icon", ICS: "text/calendar", JAR: "application/java-archive", JPEG: "image/jpeg", JAVA_SCRIPT: "text/javascript", JSON: "application/json", JSON_LD: "application/ld+json", JSON_MERGE_PATCH: "application/merge-patch+json", MID: "audio/midi", X_MID: "audio/x-midi", MP3: "audio/mpeg", MP4A: "audio/mp4", MP4: "video/mp4", MPEG: "video/mpeg", MPKG: "application/vnd.apple.installer+xml", ODP: "application/vnd.oasis.opendocument.presentation", ODS: "application/vnd.oasis.opendocument.spreadsheet", ODT: "application/vnd.oasis.opendocument.text", OGA: "audio/ogg", OGV: "video/ogg", OGX: "application/ogg", OPUS: "audio/opus", OTF: "font/otf", PNG: "image/png", PDF: "application/pdf", PHP: "application/x-httpd-php", PPT: "application/vnd.ms-powerpoint", PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation", RAR: "application/vnd.rar", RTF: "application/rtf", SH: "application/x-sh", SVG: "image/svg+xml", TAR: "application/x-tar", TIFF: "image/tiff", TRANSPORT_STREAM: "video/mp2t", TTF: "font/ttf", TEXT: "text/plain", VSD: "application/vnd.visio", WAV: "audio/wav", WEBA: "audio/webm", WEBM: "video/webm", WEBP: "image/webp", WOFF: "font/woff", WOFF2: "font/woff2", FORM: "application/x-www-form-urlencoded", MULTIPART_FORM_DATA: "multipart/form-data", XHTML: "application/xhtml+xml", XLS: "application/vnd.ms-excel", XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", XML: "application/xml", XUL: "application/vnd.mozilla.xul+xml", ZIP: "application/zip", "3GP": "video/3gpp", "3G2": "video/3gpp2", "7Z": "application/x-7z-compressed" };
|
|
4
|
+
|
|
5
|
+
Object.assign(globalThis, { ContentType: i });
|
|
6
|
+
})();
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=content-type.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/content-type.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * A collection of some of the available HTTP media types.\n * @see {@link https://www.iana.org/assignments/media-types/media-types.xhtml | IANA Media Types}\n */\nconst ContentType = {\n\t/** Advanced Audio Coding (AAC) */\n\tAAC: 'audio/aac',\n\t/** AbiWord */\n\tABW: 'application/x-abiword',\n\t/** Archive document (multiple files embedded) */\n\tARC: 'application/x-freearc',\n\t/** AVIF image */\n\tAVIF: 'image/avif',\n\t/** Audio Video Interleave (AVI) */\n\tAVI: 'video/x-msvideo',\n\t/** Amazon Kindle eBook format */\n\tAZW: 'application/vnd.amazon.ebook',\n\t/** Binary Data */\n\tBIN: 'application/octet-stream',\n\t/** Windows OS/2 Bitmap Graphics */\n\tBMP: 'image/bmp',\n\t/** Bzip Archive */\n\tBZIP: 'application/x-bzip',\n\t/** Bzip2 Archive */\n\tBZIP2: 'application/x-bzip2',\n\t/** CD audio */\n\tCDA: 'application/x-cdf',\n\t/** C Shell Script */\n\tCSH: 'application/x-csh',\n\t/** Cascading Style Sheets (CSS) */\n\tCSS: 'text/css',\n\t/** Comma-Separated Values */\n\tCSV: 'text/csv',\n\t/** Microsoft Office Word Document */\n\tDOC: 'application/msword',\n\t/** Microsoft Office Word Document (OpenXML) */\n\tDOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n\t/** Microsoft Embedded OpenType */\n\tEOT: 'application/vnd.ms-fontobject',\n\t/** Electronic Publication (EPUB) */\n\tEPUB: 'application/epub+zip',\n\t/** GZip Compressed Archive */\n\tGZIP: 'application/gzip',\n\t/** Graphics Interchange Format */\n\tGIF: 'image/gif',\n\t/** HyperText Markup Language (HTML) */\n\tHTML: 'text/html',\n\t/** Icon Format */\n\tICO: 'image/vnd.microsoft.icon',\n\t/** iCalendar Format */\n\tICS: 'text/calendar',\n\t/** Java Archive (JAR) */\n\tJAR: 'application/java-archive',\n\t/** JPEG Image */\n\tJPEG: 'image/jpeg',\n\t/** JavaScript */\n\tJAVA_SCRIPT: 'text/javascript',\n\t/** JavaScript Object Notation Format (JSON) */\n\tJSON: 'application/json',\n\t/** JavaScript Object Notation LD Format */\n\tJSON_LD: 'application/ld+json',\n\t/** JavaScript Object Notation (JSON) Merge Patch */\n\tJSON_MERGE_PATCH: 'application/merge-patch+json',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tMID: 'audio/midi',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tX_MID: 'audio/x-midi',\n\t/** MP3 Audio */\n\tMP3: 'audio/mpeg',\n\t/** MPEG-4 Audio */\n\tMP4A: 'audio/mp4',\n\t/** MPEG-4 Video */\n\tMP4: 'video/mp4',\n\t/** MPEG Video */\n\tMPEG: 'video/mpeg',\n\t/** Apple Installer Package */\n\tMPKG: 'application/vnd.apple.installer+xml',\n\t/** OpenDocument Presentation Document */\n\tODP: 'application/vnd.oasis.opendocument.presentation',\n\t/** OpenDocument Spreadsheet Document */\n\tODS: 'application/vnd.oasis.opendocument.spreadsheet',\n\t/** OpenDocument Text Document */\n\tODT: 'application/vnd.oasis.opendocument.text',\n\t/** Ogg Audio */\n\tOGA: 'audio/ogg',\n\t/** Ogg Video */\n\tOGV: 'video/ogg',\n\t/** Ogg */\n\tOGX: 'application/ogg',\n\t/** Opus audio */\n\tOPUS: 'audio/opus',\n\t/** OpenType Font File */\n\tOTF: 'font/otf',\n\t/** Portable Network Graphics (PNG) */\n\tPNG: 'image/png',\n\t/** Adobe Portable Document Format */\n\tPDF: 'application/pdf',\n\t/** Hypertext Preprocessor (Personal Home Page) */\n\tPHP: 'application/x-httpd-php',\n\t/** Microsoft PowerPoint */\n\tPPT: 'application/vnd.ms-powerpoint',\n\t/** Microsoft Office Presentation (OpenXML) */\n\tPPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n\t/** RAR Archive */\n\tRAR: 'application/vnd.rar',\n\t/** Rich Text Format */\n\tRTF: 'application/rtf',\n\t/** Bourne Shell Script */\n\tSH: 'application/x-sh',\n\t/** Scalable Vector Graphics (SVG) */\n\tSVG: 'image/svg+xml',\n\t/** Tape Archive (TAR) */\n\tTAR: 'application/x-tar',\n\t/** Tagged Image File Format (TIFF) */\n\tTIFF: 'image/tiff',\n\t/** MPEG transport stream */\n\tTRANSPORT_STREAM: 'video/mp2t',\n\t/** TrueType Font */\n\tTTF: 'font/ttf',\n\t/** Text, (generally ASCII or ISO 8859-n) */\n\tTEXT: 'text/plain',\n\t/** Microsoft Visio */\n\tVSD: 'application/vnd.visio',\n\t/** Waveform Audio Format (WAV) */\n\tWAV: 'audio/wav',\n\t/** Open Web Media Project - Audio */\n\tWEBA: 'audio/webm',\n\t/** Open Web Media Project - Video */\n\tWEBM: 'video/webm',\n\t/** WebP Image */\n\tWEBP: 'image/webp',\n\t/** Web Open Font Format */\n\tWOFF: 'font/woff',\n\t/** Web Open Font Format */\n\tWOFF2: 'font/woff2',\n\t/** Form - Encoded */\n\tFORM: 'application/x-www-form-urlencoded',\n\t/** Multipart FormData */\n\tMULTIPART_FORM_DATA: 'multipart/form-data',\n\t/** XHTML - The Extensible HyperText Markup Language */\n\tXHTML: 'application/xhtml+xml',\n\t/** Microsoft Excel Document */\n\tXLS: 'application/vnd.ms-excel',\n\t/** Microsoft Office Spreadsheet Document (OpenXML) */\n\tXLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n\t/** Extensible Markup Language (XML) */\n\tXML: 'application/xml',\n\t/** XML User Interface Language (XUL) */\n\tXUL: 'application/vnd.mozilla.xul+xml',\n\t/** Zip Archive */\n\tZIP: 'application/zip',\n\t/** 3GPP audio/video container */\n\t'3GP': 'video/3gpp',\n\t/** 3GPP2 audio/video container */\n\t'3G2': 'video/3gpp2',\n\t/** 7-Zip Archive */\n\t'7Z': 'application/x-7z-compressed'\n} as const;\n\nexport { ContentType };"],
|
|
5
|
+
"mappings": ";AAIA,IAAMA,IAAc,EAEnB,KAAK,aAEL,KAAK,yBAEL,KAAK,yBAEL,MAAM,cAEN,KAAK,mBAEL,KAAK,gCAEL,KAAK,4BAEL,KAAK,aAEL,MAAM,sBAEN,OAAO,uBAEP,KAAK,qBAEL,KAAK,qBAEL,KAAK,YAEL,KAAK,YAEL,KAAK,sBAEL,MAAM,2EAEN,KAAK,iCAEL,MAAM,wBAEN,MAAM,oBAEN,KAAK,aAEL,MAAM,aAEN,KAAK,4BAEL,KAAK,iBAEL,KAAK,4BAEL,MAAM,cAEN,aAAa,mBAEb,MAAM,oBAEN,SAAS,uBAET,kBAAkB,gCAElB,KAAK,cAEL,OAAO,gBAEP,KAAK,cAEL,MAAM,aAEN,KAAK,aAEL,MAAM,cAEN,MAAM,uCAEN,KAAK,mDAEL,KAAK,kDAEL,KAAK,2CAEL,KAAK,aAEL,KAAK,aAEL,KAAK,mBAEL,MAAM,cAEN,KAAK,YAEL,KAAK,aAEL,KAAK,mBAEL,KAAK,2BAEL,KAAK,iCAEL,MAAM,6EAEN,KAAK,uBAEL,KAAK,mBAEL,IAAI,oBAEJ,KAAK,iBAEL,KAAK,qBAEL,MAAM,cAEN,kBAAkB,cAElB,KAAK,YAEL,MAAM,cAEN,KAAK,yBAEL,KAAK,aAEL,MAAM,cAEN,MAAM,cAEN,MAAM,cAEN,MAAM,aAEN,OAAO,cAEP,MAAM,qCAEN,qBAAqB,uBAErB,OAAO,yBAEP,KAAK,4BAEL,MAAM,qEAEN,KAAK,mBAEL,KAAK,mCAEL,KAAK,mBAEL,OAAO,cAEP,OAAO,eAEP,MAAM,8BACP;",
|
|
6
|
+
"names": ["ContentType"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
// iife:/home/runner/work/transportr/transportr/dist/request-header.js
|
|
3
|
+
var e = { ACCEPT: "accept", ACCEPT_CHARSET: "accept-charset", ACCEPT_ENCODING: "accept-encoding", ACCEPT_LANGUAGE: "accept-language", AUTHORIZATION: "authorization", CACHE_CONTROL: "cache-control", CONNECTION: "connection", COOKIE: "cookie", CONTENT_LENGTH: "content-length", CONTENT_MD5: "content-md5", CONTENT_TYPE: "content-type", DATE: "date", HOST: "host", IF_MATCH: "if-match", IF_MODIFIED_SINCE: "if-modified-since", IF_NONE_MATCH: "if-none-match", IF_RANGE: "if-range", IF_UNMODIFIED_SINCE: "if-unmodified-since", MAX_FORWARDS: "max-forwards", ORIGIN: "origin", PRAGMA: "pragma", PROXY_AUTHORIZATION: "proxy-authorization", RANGE: "range", REFERER: "referer", TE: "te", USER_AGENT: "user-agent", UPGRADE: "upgrade", WARNING: "warning", X_REQUESTED_WITH: "x-requested-with", X_FORWARDED_FOR: "x-forwarded-for", X_FORWARDED_HOST: "x-forwarded-host", X_FORWARDED_PROTO: "x-forwarded-proto" };
|
|
4
|
+
|
|
5
|
+
Object.assign(globalThis, { RequestHeader: e });
|
|
6
|
+
})();
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=request-header.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/request-header.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Defining a constant object with all the HTTP request headers.\n */\nconst RequestHeader = {\n\t/**\n\t * Content-Types that are acceptable for the response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept: text/plain</code>\n\t */\n\tACCEPT: 'accept',\n\t/**\n\t * Character sets that are acceptable. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Charset: utf-8</code>\n\t */\n\tACCEPT_CHARSET: 'accept-charset',\n\t/**\n\t * List of acceptable encodings. See HTTP compression. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Encoding: gzip, deflate</code>\n\t */\n\tACCEPT_ENCODING: 'accept-encoding',\n\t/**\n\t * List of acceptable human languages for response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Language: en-US</code>\n\t */\n\tACCEPT_LANGUAGE: 'accept-language',\n\t/**\n\t * Authentication credentials for HTTP authentication. Permanent.\n\t *\n\t * @example\n\t * <code>Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tAUTHORIZATION: 'authorization',\n\t/**\n\t * Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Cache-Control: no-cache</code>\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop request fields. Permanent.\n\t *\n\t * @example\n\t * <code>Connection: keep-alive</code>\n\t * <code>Connection: Upgrade</code>\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An HTTP cookie previously sent by the server with Set-Cookie (below). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Cookie: $Version=1, Skin=new,</code>\n\t */\n\tCOOKIE: 'cookie',\n\t/**\n\t * The length of the request body in octets (8-bit bytes). Permanent.\n\t *\n\t * @example\n\t * <code>Content-Length: 348</code>\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * A Base64-encoded binary MD5 sum of the content of the request body. Obsolete.\n\t *\n\t * @example\n\t * <code>Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==</code>\n\t */\n\tCONTENT_MD5: 'content-md5',\n\t/**\n\t * The MIME type of the body of the request (used with POST and PUT requests). Permanent.\n\t * <code>Content-Type: application/x-www-form-urlencoded</code>\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231 Date/Time Formats).\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Date: Tue, 15 Nov 1994 08:12:31 GMT</code>\n\t */\n\tDATE: 'date',\n\t/**\n\t * The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The\n\t * port number may be omitted if the port is the standard port for the service requested. Permanent. Mandatory since\n\t * HTTP/1.1.\n\t *\n\t * @example\n\t * <code>Host: en.wikipedia.org:80</code>\n\t * <code>Host: en.wikipedia.org</code>\n\t */\n\tHOST: 'host',\n\t/**\n\t * Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for\n\t * methods like PUT to only update a resource if it has not been modified since the user last updated it. Permanent.\n\t *\n\t * @example\n\t * <code>If-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_MATCH: 'if-match',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged. Permanent.\n\t *\n\t * @example\n\t * <code>If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_MODIFIED_SINCE: 'if-modified-since',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag. Permanent.\n\t *\n\t * @example\n\t * <code>If-None-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_NONE_MATCH: 'if-none-match',\n\t/**\n\t * If the entity is unchanged, send me the part(s) that I am missing, otherwise, send me the entire new entity.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>If-Range: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_RANGE: 'if-range',\n\t/**\n\t * Only send the response if the entity has not been modified since a specific time. Permanent.\n\t *\n\t * @example\n\t * <code>If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_UNMODIFIED_SINCE: 'if-unmodified-since',\n\t/**\n\t * Limit the number of times the message can be forwarded through proxies or gateways. Permanent.\n\t *\n\t * @example\n\t * <code>Max-Forwards: 10</code>\n\t */\n\tMAX_FORWARDS: 'max-forwards',\n\t/**\n\t * Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response\n\t * field). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Origin: http://www.example-social-network.com</code>\n\t */\n\tORIGIN: 'origin',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain. Permanent.\n\t *\n\t * @example\n\t * <code>Pragma: no-cache</code>\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Authorization credentials for connecting to a proxy. Permanent.\n\t *\n\t * @example\n\t * <code>Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tPROXY_AUTHORIZATION: 'proxy-authorization',\n\t/**\n\t * Request only part of an entity. Bytes are numbered from 0. See Byte serving. Permanent.\n\t *\n\t * @example\n\t * <code>Range: bytes=500-999</code>\n\t */\n\tRANGE: 'range',\n\t/**\n\t * This is the address of the previous web page from which a link to the currently requested page was followed. (The\n\t * word \"referrer\" has been misspelled in the RFC as well as in most implementations to the point that it has become\n\t * standard usage and is considered correct terminology). Permanent.\n\t *\n\t * @example\n\t * <code>Referer: http://en.wikipedia.org/wiki/Main_Page</code>\n\t */\n\tREFERER: 'referer',\n\t/**\n\t * The transfer encodings the user agent is willing to accept: the same values as for the response header field\n\t * Transfer-Encoding can be used, plus the \"trailers\" value (related to the \"chunked\" transfer method) to notify the\n\t * server it expects to receive additional fields in the trailer after the last, zero-sized, chunk. Permanent.\n\t *\n\t * @example\n\t * <code>TE: trailers, deflate</code>\n\t */\n\tTE: 'te',\n\t/**\n\t * The user agent string of the user agent. Permanent.\n\t *\n\t * @example\n\t * <code>User-Agent: Mozilla/5.0 (X11, Linux x86_64, rv:12.0) Gecko/20100101 Firefox/21.0</code>\n\t */\n\tUSER_AGENT: 'user-agent',\n\t/**\n\t * Ask the server to upgrade to another protocol. Permanent.\n\t *\n\t * @example\n\t * <code>Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11</code>\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * A general warning about possible problems with the entity body. Permanent.\n\t *\n\t * @example\n\t * <code>Warning: 199 Miscellaneous warning</code>\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * mainly used to identify Ajax requests. Most JavaScript frameworks send this field with value of XMLHttpRequest.\n\t *\n\t * @example\n\t * <code>X-Requested-With: XMLHttpRequest</code>\n\t */\n\tX_REQUESTED_WITH: 'x-requested-with',\n\t/**\n\t * A de facto standard for identifying the originating IP address of a client connecting to a web server through an\n\t * HTTP proxy or load balancer.\n\t *\n\t * @example\n\t * <code>X-Forwarded-For: client1, proxy1, proxy2</code>\n\t * <code>X-Forwarded-For: 129.78.138.66, 129.78.64.103</code>\n\t */\n\tX_FORWARDED_FOR: 'x-forwarded-for',\n\t/**\n\t * A de facto standard for identifying the original host requested by the client in the Host HTTP request header, since\n\t * the host name and/or port of the reverse proxy (load balancer) may differ from the origin server handling the\n\t * request.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Host: en.wikipedia.org:80</code>\n\t * <code>X-Forwarded-Host: en.wikipedia.org</code>\n\t */\n\tX_FORWARDED_HOST: 'x-forwarded-host',\n\t/**\n\t * A de facto standard for identifying the originating protocol of an HTTP request, since a reverse proxy (load\n\t * balancer) may communicate with a web server using HTTP even if the request to the reverse proxy is HTTPS. An\n\t * alternative form of the header (X-ProxyUser-Ip) is used by Google clients talking to Google servers.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Proto: https</code>\n\t */\n\tX_FORWARDED_PROTO: 'x-forwarded-proto'\n} as const;\n\nexport { RequestHeader };"],
|
|
5
|
+
"mappings": ";AAGA,IAAMA,IAAgB,EAOrB,QAAQ,UAOR,gBAAgB,kBAOhB,iBAAiB,mBAOjB,iBAAiB,mBAOjB,eAAe,iBAQf,eAAe,iBAQf,YAAY,cAOZ,QAAQ,UAOR,gBAAgB,kBAOhB,aAAa,eAKb,cAAc,gBAQd,MAAM,QAUN,MAAM,QAQN,UAAU,YAOV,mBAAmB,qBAOnB,eAAe,iBAQf,UAAU,YAOV,qBAAqB,uBAOrB,cAAc,gBAQd,QAAQ,UAOR,QAAQ,UAOR,qBAAqB,uBAOrB,OAAO,SASP,SAAS,WAST,IAAI,MAOJ,YAAY,cAOZ,SAAS,WAOT,SAAS,WAOT,kBAAkB,oBASlB,iBAAiB,mBAUjB,kBAAkB,oBASlB,mBAAmB,oBACpB;",
|
|
6
|
+
"names": ["RequestHeader"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
// iife:/home/runner/work/transportr/transportr/dist/request-method.js
|
|
3
|
+
var T = { OPTIONS: "OPTIONS", GET: "GET", HEAD: "HEAD", POST: "POST", PUT: "PUT", DELETE: "DELETE", TRACE: "TRACE", CONNECT: "CONNECT", PATCH: "PATCH" };
|
|
4
|
+
|
|
5
|
+
Object.assign(globalThis, { RequestMethod: T });
|
|
6
|
+
})();
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=request-method.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/request-method.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Defining a constant object with the name RequestMethod.\n */\nconst RequestMethod = {\n\t/**\n\t * The OPTIONS method represents a request for information about the communication options available on the\n\t * request/response chain identified by the Request-URI. This method allows the client to determine the options and/or\n\t * requirements associated with a resource, or the capabilities of a server, without implying a resource action or\n\t * initiating a resource retrieval.\n\t *\n\t * Responses to this method are not cacheable.\n\t *\n\t * If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or\n\t * Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does\n\t * not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed\n\t * queries on the server. A server that does not support such an extension MAY discard the request body.\n\t *\n\t * If the Request-URI is an asterisk (\"*\"), the OPTIONS request is intended to apply to the server in general rather\n\t * than to a specific resource. Since a server's communication options typically depend on the resource, the \"*\"\n\t * request is only useful as a \"ping\" or \"no-op\" type of method, it does nothing beyond allowing the client to test the\n\t * capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof).\n\t *\n\t * If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when\n\t * communicating with that resource.\n\t *\n\t * A 200 response SHOULD include any header fields that indicate optional features implemented by the server and\n\t * applicable to that resource (e.g., Allow), possibly including extensions not defined by this specification. The\n\t * response body, if any, SHOULD also include information about the communication options. The format for such a body\n\t * is not defined by this specification, but might be defined by future extensions to HTTP. Content negotiation MAY be\n\t * used to select the appropriate response format. If no response body is included, the response MUST include a\n\t * Content-Length field with a field-value of \"0\".\n\t *\n\t * The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. When a proxy\n\t * receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a\n\t * Max-Forwards field. If the Max-Forwards field-value is zero (\"0\"), the proxy MUST NOT forward the message, instead,\n\t * the proxy SHOULD respond with its own communication options. If the Max-Forwards field-value is an integer greater\n\t * than zero, the proxy MUST decrement the field-value when it forwards the request. If no Max-Forwards field is\n\t * present in the request, then the forwarded request MUST NOT include a Max-Forwards field.\n\t */\n\tOPTIONS: 'OPTIONS',\n\t/**\n\t * The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If\n\t * the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in\n\t * the response and not the source text of the process, unless that text happens to be the output of the process.\n\t *\n\t * The semantics of the GET method change to a \"conditional GET\" if the request message includes an If-Modified-Since;\n\t * If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the\n\t * entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET\n\t * method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring\n\t * multiple requests or transferring data already held by the client.\n\t *\n\t * The semantics of the GET method change to a \"partial GET\" if the request message includes a Range header field. A\n\t * partial GET requests that only part of the entity be transferred, as described in section 14.35. The partial GET\n\t * method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed\n\t * without transferring data already held by the client.\n\t *\n\t * The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching described in\n\t * section 13.\n\t *\n\t * See section 15.1.3 for security considerations when used for forms.\n\t */\n\tGET: 'GET',\n\t/**\n\t * The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The\n\t * meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information\n\t * sent in response to a GET request. This method can be used for obtaining meta information about the entity implied by\n\t * the request without transferring the entity-body itself. This method is often used for testing hypertext links for\n\t * validity, accessibility, and recent modification.\n\t *\n\t * The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be\n\t * used to update a previously cached entity from that resource. If the new field values indicate that the cached\n\t * entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or\n\t * Last-Modified), then the cache MUST treat the cache entry as stale.\n\t */\n\tHEAD: 'HEAD',\n\t/**\n\t * The POST method is used to request that the origin server accept the entity enclosed in the request as a new\n\t * subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform\n\t * method to cover the following functions:\n\t * <ul>\n\t * <li>Annotation of existing resources,</li>\n\t * <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles,</li>\n\t * <li>Providing a block of data, such as the result of submitting a form, to a data-handling process,</li>\n\t * <li>Extending a database through an append operation.</li>\n\t * </ul>\n\t *\n\t * The actual function performed by the POST method is determined by the server and is usually dependent on the\n\t * Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory\n\t * containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a\n\t * database.\n\t *\n\t * The action performed by the POST method might not result in a resource that can be identified by a URI. In this\n\t * case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the\n\t * response includes an entity that describes the result.\n\t *\n\t * If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity\n\t * which describes the status of the request and refers to the new resource, and a Location header (see section 14.30).\n\t *\n\t * Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header\n\t * fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource.\n\t *\n\t * POST requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * See section 15.1.3 for security considerations.\n\t */\n\tPOST: 'POST',\n\t/**\n\t * The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers\n\t * to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing\n\t * on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being\n\t * defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If\n\t * a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an\n\t * existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate\n\t * successful completion of the request. If the resource could not be created or modified with the Request-URI, an\n\t * appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST\n\t * \\NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a\n\t * 501 (Not Implemented) response in such cases.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t *\n\t * The fundamental difference between the POST and PUT requests is reflected in the different meaning of the\n\t * Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource\n\t * might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations.\n\t * In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what\n\t * URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires\n\t * that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response, the user agent MAY\n\t * then make its own decision regarding whether or not to redirect the request.\n\t *\n\t * A single resource MAY be identified by many different URIs. For example, an article might have a URI for identifying\n\t * \"the current version\" which is separate from the URI identifying each particular version. In this case, a PUT\n\t * request on a general URI might result in several other URIs being defined by the origin server.\n\t *\n\t * HTTP/1.1 does not define how a PUT method affects the state of an origin server.\n\t *\n\t * PUT requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied\n\t * to the resource created or modified by the PUT.\n\t */\n\tPUT: 'PUT',\n\t/**\n\t * The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY\n\t * be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the\n\t * operation has been carried out, even if the status code returned from the origin server indicates that the action\n\t * has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response\n\t * is given, it intends to delete the resource or move it to an inaccessible location.\n\t *\n\t * A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if\n\t * the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not\n\t * include an entity.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t */\n\tDELETE: 'DELETE',\n\t/**\n\t * The TRACE method is used to invoke a remote, application-layer loop- back of the request message. The final\n\t * recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK)\n\t * response. The final recipient is either the origin server or the first proxy or gateway to receive a Max-Forwards\n\t * value of zero (0) in the request (see section 14.31). A TRACE request MUST NOT include an entity.\n\t *\n\t * TRACE allows the client to see what is being received at the other end of the request chain and use that data for\n\t * testing or diagnostic information. The value of the Via header field (section 14.45) is of particular interest,\n\t * since it acts as a trace of the request chain. Use of the Max-Forwards header field allows the client to limit the\n\t * length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop.\n\t *\n\t * If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a\n\t * Content-Type of \"message/http\". Responses to this method MUST NOT be cached.\n\t */\n\tTRACE: 'TRACE',\n\t/**\n\t * This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a\n\t * tunnel (e.g. SSL tunneling [44]).\n\t */\n\tCONNECT: 'CONNECT',\n\t/**\n\t * The PATCH method requests that a set of changes described in the\n\t * request entity be applied to the resource identified by the Request-\n\t * URI. The set of changes is represented in a format called a \"patch\n\t * document\" identified by a media type. If the Request-URI does not\n\t * point to an existing resource, the server MAY create a new resource,\n\t * depending on the patch document type (whether it can logically modify\n\t * a null resource) and permissions, etc.\n\t *\n\t * The difference between the PUT and PATCH requests is reflected in the\n\t * way the server processes the enclosed entity to modify the resource\n\t * identified by the Request-URI. In a PUT request, the enclosed entity\n\t * is considered to be a modified version of the resource stored on the\n\t * origin server, and the client is requesting that the stored version\n\t * be replaced. With PATCH, however, the enclosed entity contains a set\n\t * of instructions describing how a resource currently residing on the\n\t * origin server should be modified to produce a new version. The PATCH\n\t * method affects the resource identified by the Request-URI, and it\n\t * also MAY have side effects on other resources; i.e., new resources\n\t * may be created, or existing ones modified, by the application of a\n\t * PATCH.\n\t *\n\t * PATCH is neither safe nor idempotent as defined by [RFC2616], Section\n\t * 9.1.\n\t *\n\t * A PATCH request can be issued in such a way as to be idempotent,\n\t * which also helps prevent bad outcomes from collisions between two\n\t * PATCH requests on the same resource in a similar time frame.\n\t * Collisions from multiple PATCH requests may be more dangerous than\n\t * PUT collisions because some patch formats need to operate from a\n\t * known base-point or else they will corrupt the resource. Clients\n\t * using this kind of patch application SHOULD use a conditional request\n\t * such that the request will fail if the resource has been updated\n\t * since the client last accessed the resource. For example, the client\n\t * can use a strong ETag [RFC2616] in an If-Match header on the PATCH\n\t * request.\n\t *\n\t * There are also cases where patch formats do not need to operate from\n\t * a known base-point (e.g., appending text lines to log files, or non-\n\t * colliding rows to database tables), in which case the same care in\n\t * client requests is not needed.\n\t *\n\t * The server MUST apply the entire set of changes atomically and never\n\t * provide (e.g., in response to a GET during this operation) a\n\t * partially modified representation. If the entire patch document\n\t * cannot be successfully applied, then the server MUST NOT apply any of\n\t * the changes. The determination of what constitutes a successful\n\t * PATCH can vary depending on the patch document and the type of\n\t * resource(s) being modified. For example, the common 'diff' utility\n\t * can generate a patch document that applies to multiple files in a\n\t * directory hierarchy. The atomicity requirement holds for all\n\t * directly affected files. See \"Error Handling\", Section 2.2, for\n\t * details on status codes and possible error conditions.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies\n\t * one or more currently cached entities, those entries SHOULD be\n\t * treated as stale. A response to this method is only cacheable if it\n\t * contains explicit freshness information (such as an Expires header or\n\t * \"Cache-Control: max-age\" directive) as well as the Content-Location\n\t * header matching the Request-URI, indicating that the PATCH response\n\t * body is a resource representation. A cached PATCH response can only\n\t * be used to respond to subsequent GET and HEAD requests; it MUST NOT\n\t * be used to respond to other methods (in particular, PATCH).\n\t *\n\t * Note that entity-headers contained in the request apply only to the\n\t * contained patch document and MUST NOT be applied to the resource\n\t * being modified. Thus, a Content-Language header could be present on\n\t * the request, but it would only mean (for whatever that's worth) that\n\t * the patch document had a language. Servers SHOULD NOT store such\n\t * headers except as trace information, and SHOULD NOT use such header\n\t * values the same way they might be used on PUT requests. Therefore,\n\t * this document does not specify a way to modify a document's Content-\n\t * Type or Content-Language value through headers, though a mechanism\n\t * could well be designed to achieve this goal through a patch document.\n\t *\n\t * There is no guarantee that a resource can be modified with PATCH.\n\t * Further, it is expected that different patch document formats will be\n\t * appropriate for different types of resources and that no single\n\t * format will be appropriate for all types of resources. Therefore,\n\t * there is no single default patch document format that implementations\n\t * are required to support. Servers MUST ensure that a received patch\n\t * document is appropriate for the type of resource identified by the\n\t * Request-URI.\n\t *\n\t * Clients need to choose when to use PATCH rather than PUT. For\n\t * example, if the patch document size is larger than the size of the\n\t * new resource data that would be used in a PUT, then it might make\n\t * sense to use PUT instead of PATCH. A comparison to POST is even more\n\t * difficult, because POST is used in widely varying ways and can\n\t * encompass PUT and PATCH-like operations if the server chooses. If\n\t * the operation does not modify the resource identified by the Request-\n\t * URI in a predictable way, POST should be considered instead of PATCH\n\t * or PUT.\n\t */\n\tPATCH: 'PATCH'\n} as const;\n\nexport { RequestMethod };"],
|
|
5
|
+
"mappings": ";AAGA,IAAMA,IAAgB,EAoCrB,SAAS,WAsBT,KAAK,OAaL,MAAM,QA+BN,MAAM,QAmCN,KAAK,OAeL,QAAQ,UAeR,OAAO,SAKP,SAAS,WA+FT,OAAO,QACR;",
|
|
6
|
+
"names": ["RequestMethod"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
// iife:/home/runner/work/transportr/transportr/dist/response-header.js
|
|
3
|
+
var t = { PROXY_CONNECTION: "proxy-connection", X_UIDH: "x-uidh", X_CSRF_TOKEN: "x-csrf-token", ACCESS_CONTROL_ALLOW_ORIGIN: "access-control-allow-origin", ACCEPT_PATCH: "accept-patch", ACCEPT_RANGES: "accept-ranges", AGE: "age", ALLOW: "allow", CACHE_CONTROL: "cache-control", CONNECTION: "connection", CONTENT_DISPOSITION: "content-disposition", CONTENT_ENCODING: "content-encoding", CONTENT_LANGUAGE: "content-language", CONTENT_LENGTH: "content-length", CONTENT_LOCATION: "content-location", CONTENT_RANGE: "content-range", CONTENT_TYPE: "content-type", DATE: "date", ETAG: "etag", EXPIRES: "expires", LAST_MODIFIED: "last-modified", LINK: "link", LOCATION: "location", P3P: "p3p", PRAGMA: "pragma", PROXY_AUTHENTICATION: "proxy-authenticate", PUBLIC_KEY_PINS: "public-key-pins", RETRY_AFTER: "retry-after", SERVER: "server", SET_COOKIE: "set-cookie", STATUS: "status", STRICT_TRANSPORT_SECURITY: "strict-transport-security", TRAILER: "trailer", TRANSFER_ENCODING: "transfer-encoding", UPGRADE: "upgrade", VARY: "vary", VIA: "via", WARNING: "warning", WWW_AUTHENTICATE: "www-authenticate", X_XSS_PROTECTION: "x-xss-protection", CONTENT_SECURITY_POLICY: "content-security-policy", X_CONTENT_TYPE_OPTIONS: "x-content-type-options", X_POWERED_BY: "x-powered-by" };
|
|
4
|
+
|
|
5
|
+
Object.assign(globalThis, { ResponseHeader: t });
|
|
6
|
+
})();
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=response-header.js.map
|