@reviseio/engine 0.0.0-stage → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/FONT-LICENSE-HAN-EXT-B.txt +91 -0
  3. package/FONT-LICENSE-KATEX.txt +95 -0
  4. package/FONT-LICENSE-LIBERATION.txt +102 -0
  5. package/FONT-LICENSE-NOTO-MULTILINGUAL.txt +93 -0
  6. package/FONT-LICENSE-NOTO-SANS-SC.txt +93 -0
  7. package/FONT-LICENSE-NOTO.txt +94 -0
  8. package/FONT-LICENSE-SOURCE-CODE-PRO.txt +94 -0
  9. package/FONT-LICENSE-SOURCE-SERIF-4.txt +93 -0
  10. package/LICENSE +141 -0
  11. package/README.md +11 -2
  12. package/THIRD-PARTY-NOTICES.md +3376 -0
  13. package/assets/historyMaterializeWorker-Kl0syEbc.js +618 -0
  14. package/chunks/AgentHtmlConverter-CnnB8-WI.js +379 -0
  15. package/chunks/AgentPageRenderViews-BTLjPZJQ.js +2 -0
  16. package/chunks/AgentPageRenderer-DLgUGrGy.js +180 -0
  17. package/chunks/BidiText-Bkp4Y90s.js +160 -0
  18. package/chunks/BlockDiff-B6-aJxHo.js +42 -0
  19. package/chunks/CanvasRenderer-C1Vegx9Y.js +110 -0
  20. package/chunks/ColorParserFull-BKH72fK8.js +446 -0
  21. package/chunks/DocumentCompare-C8295s35.js +6 -0
  22. package/chunks/DocumentLayout-CsU5MR-3.js +12 -0
  23. package/chunks/DocumentLayoutEngine-C62pyGVf.js +218 -0
  24. package/chunks/DocumentMutator-Bat_oLBQ.js +13 -0
  25. package/chunks/DocumentScrubber-BZQn_z92.js +21 -0
  26. package/chunks/DocumentSession-BDcazSEv.js +1 -0
  27. package/chunks/DocumentStylesheet-CEEt18sr.js +7 -0
  28. package/chunks/DocxConverter-BC31uYIL.js +1236 -0
  29. package/chunks/DocxGraft-L10HXM3U.js +8 -0
  30. package/chunks/HorizontalRuleOrnaments-gmUZ3R7Q.js +3 -0
  31. package/chunks/HtmlConverter-C5ihhZ6G.js +267 -0
  32. package/chunks/ListNumbering-Qlu6AuRZ.js +23 -0
  33. package/chunks/MarkdownConverter-DofaSeC4.js +57 -0
  34. package/chunks/MathRenderer-Bz9WEVvF.js +68 -0
  35. package/chunks/OdtConverter-c1fTWoAt.js +125 -0
  36. package/chunks/OfficeImportShared-CrOpHpJ-.js +30 -0
  37. package/chunks/PageNumeralFonts-BWzI061X.js +5 -0
  38. package/chunks/ParagraphDiffAnalysis-DrmStvmz.js +36 -0
  39. package/chunks/PdfConverter-DX7fsRH5.js +457 -0
  40. package/chunks/RtfConverter-hbJ2529G.js +186 -0
  41. package/chunks/TableBorders-DVhdvo6f.js +32 -0
  42. package/chunks/TableGrid-DbroRucl.js +12 -0
  43. package/chunks/TextDecoding-IPbuUqcC.js +2 -0
  44. package/chunks/TextFileDecoder-BZBBejlR.js +10 -0
  45. package/chunks/TxtConverter-YHv5FXWb.js +14 -0
  46. package/chunks/Typography-B4gndEdB.js +28 -0
  47. package/chunks/UnicodeUtils-CXtusU4g.js +10 -0
  48. package/chunks/XmlConverter-BRRluy9k.js +55 -0
  49. package/chunks/_commonjsHelpers-DaMA6jEr.js +2 -0
  50. package/chunks/_revise-sdk-lazy-harfbuzz-CDWdjF9f.js +1 -0
  51. package/chunks/base64-Di1bxoXD.js +1 -0
  52. package/chunks/browser-module-CFmqfGkE.js +1791 -0
  53. package/chunks/bundle.min-DRpfgV69.js +782 -0
  54. package/chunks/capture-i_dPkQIS.js +11 -0
  55. package/chunks/carrier-pYM9xf6x.js +6 -0
  56. package/chunks/chromeImageLayout-BiQ3Iz1-.js +18 -0
  57. package/chunks/engine-LMUnxdm2.js +520 -0
  58. package/chunks/footnoteFlatten-EE85Hjre.js +6 -0
  59. package/chunks/graftExport-G-dG7Vcc.js +104 -0
  60. package/chunks/html2canvas.esm-CntiHiYW.js +997 -0
  61. package/chunks/index-BLb10wQt.js +1002 -0
  62. package/chunks/index-BWdRWxoH.js +1807 -0
  63. package/chunks/index.es-CI0QPo8w.js +780 -0
  64. package/chunks/jspdf.es.min-DU74zN8b.js +1792 -0
  65. package/chunks/jszip.min-CPW0h1Kx.js +476 -0
  66. package/chunks/katex-DWj8TvwO.js +1462 -0
  67. package/chunks/pdf-BLWDCiFF.js +1828 -0
  68. package/chunks/purify.es-BwLardii.js +107 -0
  69. package/chunks/serverDocumentSession-DGDU5Lh3.js +1011 -0
  70. package/chunks/signatures-DTNDS2PH.js +21 -0
  71. package/chunks/suggestionAuthorship-B-IuLQlE.js +1 -0
  72. package/chunks/web-tree-sitter-BXGZGnNj.js +2 -0
  73. package/chunks/xmlScan-DXjt2cTS.js +8 -0
  74. package/engine.d.ts +179 -0
  75. package/engine.js +3 -0
  76. package/package.json +64 -4
  77. package/serverToolContract.d.ts +420 -0
  78. package/serverToolInputs.generated.d.ts +264 -0
@@ -0,0 +1,107 @@
1
+ const{entries:oe,setPrototypeOf:re,isFrozen:Be,getPrototypeOf:Ge,getOwnPropertyDescriptor:Ye}=Object;let{freeze:E,seal:N,create:ae}=Object,{apply:Rt,construct:wt}=typeof Reflect<"u"&&Reflect;E||(E=function(r){
2
+ return r}),N||(N=function(r){return r}),Rt||(Rt=function(r,o,l){return r.apply(o,l)}),wt||(wt=function(r,o){return new r(...o)});const it=_(Array.prototype.forEach),je=_(Array.prototype.lastIndexOf),ie=_(
3
+ Array.prototype.pop),X=_(Array.prototype.push),Xe=_(Array.prototype.splice),lt=_(String.prototype.toLowerCase),Ot=_(String.prototype.toString),le=_(String.prototype.match),q=_(String.prototype.replace),
4
+ qe=_(String.prototype.indexOf),$e=_(String.prototype.trim),b=_(Object.prototype.hasOwnProperty),A=_(RegExp.prototype.test),$=Ke(TypeError);function _(r){return function(o){o instanceof RegExp&&(o.lastIndex=
5
+ 0);for(var l=arguments.length,i=new Array(l>1?l-1:0),h=1;h<l;h++)i[h-1]=arguments[h];return Rt(r,o,i)}}function Ke(r){return function(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];
6
+ return wt(r,l)}}function a(r,o){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lt;re&&re(r,null);let i=o.length;for(;i--;){let h=o[i];if(typeof h=="string"){const R=l(h);R!==h&&(Be(o)||(o[i]=
7
+ R),h=R)}r[h]=!0}return r}function Ve(r){for(let o=0;o<r.length;o++)b(r,o)||(r[o]=null);return r}function C(r){const o=ae(null);for(const[l,i]of oe(r))b(r,l)&&(Array.isArray(i)?o[l]=Ve(i):i&&typeof i==
8
+ "object"&&i.constructor===Object?o[l]=C(i):o[l]=i);return o}function K(r,o){for(;r!==null;){const i=Ye(r,o);if(i){if(i.get)return _(i.get);if(typeof i.value=="function")return _(i.value)}r=Ge(r)}function l(){
9
+ return null}return l}const ce=E(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","cod\
10
+ e","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","\
11
+ 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",
12
+ "output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td",
13
+ "template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Lt=E(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransf\
14
+ orm","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline",
15
+ "radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),vt=E(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix",
16
+ "feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","\
17
+ fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ze=E(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face\
18
+ -uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ct=E(["math","menclose","merror","mfenced","mfrac","\
19
+ mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover",
20
+ "mprescripts"]),Je=E(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),se=E(["\
21
+ #text"]),ue=E(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite",
22
+ "class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download",
23
+ "draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","m\
24
+ axlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popover\
25
+ targetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","st\
26
+ art","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Dt=E(["accent-height","accumulate","additive","alignment-ba\
27
+ seline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interp\
28
+ olation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill",
29
+ "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",
30
+ "glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","\
31
+ lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskun\
32
+ its","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentun\
33
+ its","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale",
34
+ "seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","str\
35
+ oke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-\
36
+ 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-sp\
37
+ acing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),me=E(["accent","accentunder","align","bevelled","close","columnsalign","column\
38
+ lines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor",
39
+ "mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultip\
40
+ lier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ct=E(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Qe=N(
41
+ /\{\{[\w\W]*|[\w\W]*\}\}/gm),tn=N(/<%[\w\W]*|[\w\W]*%>/gm),en=N(/\$\{[\w\W]*/gm),nn=N(/^data-[\-\w.\u00B7-\uFFFF]+$/),on=N(/^aria-[\-\w]+$/),pe=N(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),
42
+ rn=N(/^(?:\w+script|data):/i),an=N(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fe=N(/^html$/i),ln=N(/^[a-z][.\w]*(-[.\w]+)+$/i);var de=Object.freeze({__proto__:null,ARIA_ATTR:on,ATTR_WHITESPACE:an,
43
+ CUSTOM_ELEMENT:ln,DATA_ATTR:nn,DOCTYPE_NAME:fe,ERB_EXPR:tn,IS_ALLOWED_URI:pe,IS_SCRIPT_OR_DATA:rn,MUSTACHE_EXPR:Qe,TMPLIT_EXPR:en});const V={element:1,text:3,progressingInstruction:7,comment:8,document:9},
44
+ cn=function(){return typeof window>"u"?null:window},sn=function(r,o){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let l=null;const i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&
45
+ (l=o.getAttribute(i));const h="dompurify"+(l?"#"+l:"");try{return r.createPolicy(h,{createHTML(R){return R},createScriptURL(R){return R}})}catch{return console.warn("TrustedTypes policy "+h+" could no\
46
+ t be created."),null}},ge=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],
47
+ uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function he(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cn();const o=t=>he(t);if(o.version="3.2.6",o.removed=
48
+ [],!r||!r.document||r.document.nodeType!==V.document||!r.Element)return o.isSupported=!1,o;let{document:l}=r;const i=l,h=i.currentScript,{DocumentFragment:R,HTMLTemplateElement:Te,Node:st,Element:xt,NodeFilter:F,
49
+ NamedNodeMap:ye=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:Ee,DOMParser:Ae,trustedTypes:Z}=r,W=xt.prototype,_e=K(W,"cloneNode"),Ne=K(W,"remove"),Se=K(W,"nextSibling"),be=K(W,"childNodes"),J=K(W,
50
+ "parentNode");if(typeof Te=="function"){const t=l.createElement("template");t.content&&t.content.ownerDocument&&(l=t.content.ownerDocument)}let T,B="";const{implementation:ut,createNodeIterator:Re,createDocumentFragment:we,
51
+ getElementsByTagName:Oe}=l,{importNode:Le}=i;let y=ge();o.isSupported=typeof oe=="function"&&typeof J=="function"&&ut&&ut.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:mt,ERB_EXPR:pt,TMPLIT_EXPR:ft,
52
+ DATA_ATTR:ve,ARIA_ATTR:Ce,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:It,CUSTOM_ELEMENT:xe}=de;let{IS_ALLOWED_URI:kt}=de,m=null;const Mt=a({},[...ce,...Lt,...vt,...Ct,...se]);let f=null;const Ut=a({},[...ue,
53
+ ...Dt,...me,...ct]);let u=Object.seal(ae(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{
54
+ writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,dt=null,Pt=!0,gt=!0,zt=!1,Ht=!0,I=!1,Q=!0,D=!1,ht=!1,Tt=!1,k=!1,tt=!1,et=!1,Ft=!0,Wt=!1;const Ie="user-content-";let yt=!0,Y=!1,M={},U=null;
55
+ const Bt=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","templat\
56
+ e","thead","title","video","xmp"]);let Gt=null;const Yt=a({},["audio","video","img","source","image","track"]);let Et=null;const jt=a({},["alt","class","for","id","label","name","pattern","placeholder",
57
+ "role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",O="http://www.w3.org/1999/xhtml";let P=O,At=!1,_t=null;const ke=a({},[nt,ot,O],
58
+ Ot);let rt=a({},["mi","mo","mn","ms","mtext"]),at=a({},["annotation-xml"]);const Me=a({},["title","style","font","a","script"]);let j=null;const Ue=["application/xhtml+xml","text/html"],Pe="text/html";
59
+ let p=null,z=null;const ze=l.createElement("form"),Xt=function(t){return t instanceof RegExp||t instanceof Function},Nt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(z&&
60
+ z===t)){if((!t||typeof t!="object")&&(t={}),t=C(t),j=Ue.indexOf(t.PARSER_MEDIA_TYPE)===-1?Pe:t.PARSER_MEDIA_TYPE,p=j==="application/xhtml+xml"?Ot:lt,m=b(t,"ALLOWED_TAGS")?a({},t.ALLOWED_TAGS,p):Mt,f=b(
61
+ t,"ALLOWED_ATTR")?a({},t.ALLOWED_ATTR,p):Ut,_t=b(t,"ALLOWED_NAMESPACES")?a({},t.ALLOWED_NAMESPACES,Ot):ke,Et=b(t,"ADD_URI_SAFE_ATTR")?a(C(jt),t.ADD_URI_SAFE_ATTR,p):jt,Gt=b(t,"ADD_DATA_URI_TAGS")?a(C(
62
+ Yt),t.ADD_DATA_URI_TAGS,p):Yt,U=b(t,"FORBID_CONTENTS")?a({},t.FORBID_CONTENTS,p):Bt,G=b(t,"FORBID_TAGS")?a({},t.FORBID_TAGS,p):C({}),dt=b(t,"FORBID_ATTR")?a({},t.FORBID_ATTR,p):C({}),M=b(t,"USE_PROFIL\
63
+ ES")?t.USE_PROFILES:!1,Pt=t.ALLOW_ARIA_ATTR!==!1,gt=t.ALLOW_DATA_ATTR!==!1,zt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ht=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,I=t.SAFE_FOR_TEMPLATES||!1,Q=t.SAFE_FOR_XML!==!1,D=t.WHOLE_DOCUMENT||
64
+ !1,k=t.RETURN_DOM||!1,tt=t.RETURN_DOM_FRAGMENT||!1,et=t.RETURN_TRUSTED_TYPE||!1,Tt=t.FORCE_BODY||!1,Ft=t.SANITIZE_DOM!==!1,Wt=t.SANITIZE_NAMED_PROPS||!1,yt=t.KEEP_CONTENT!==!1,Y=t.IN_PLACE||!1,kt=t.ALLOWED_URI_REGEXP||
65
+ pe,P=t.NAMESPACE||O,rt=t.MATHML_TEXT_INTEGRATION_POINTS||rt,at=t.HTML_INTEGRATION_POINTS||at,u=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Xt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=
66
+ t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Xt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&
67
+ typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),I&&(gt=!1),tt&&(k=!0),M&&(m=a({},
68
+ se),f=[],M.html===!0&&(a(m,ce),a(f,ue)),M.svg===!0&&(a(m,Lt),a(f,Dt),a(f,ct)),M.svgFilters===!0&&(a(m,vt),a(f,Dt),a(f,ct)),M.mathMl===!0&&(a(m,Ct),a(f,me),a(f,ct))),t.ADD_TAGS&&(m===Mt&&(m=C(m)),a(m,t.
69
+ ADD_TAGS,p)),t.ADD_ATTR&&(f===Ut&&(f=C(f)),a(f,t.ADD_ATTR,p)),t.ADD_URI_SAFE_ATTR&&a(Et,t.ADD_URI_SAFE_ATTR,p),t.FORBID_CONTENTS&&(U===Bt&&(U=C(U)),a(U,t.FORBID_CONTENTS,p)),yt&&(m["#text"]=!0),D&&a(m,
70
+ ["html","head","body"]),m.table&&(a(m,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw $('TRUSTED_TYPES_POLICY configuration option must\
71
+ provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=t.TRUSTED_TYPES_POLICY,
72
+ B=T.createHTML("")}else T===void 0&&(T=sn(Z,h)),T!==null&&typeof B=="string"&&(B=T.createHTML(""));E&&E(t),z=t}},qt=a({},[...Lt,...vt,...Ze]),$t=a({},[...Ct,...Je]),He=function(t){let n=J(t);(!n||!n.tagName)&&
73
+ (n={namespaceURI:P,tagName:"template"});const e=lt(t.tagName),c=lt(n.tagName);return _t[t.namespaceURI]?t.namespaceURI===ot?n.namespaceURI===O?e==="svg":n.namespaceURI===nt?e==="svg"&&(c==="annotation\
74
+ -xml"||rt[c]):!!qt[e]:t.namespaceURI===nt?n.namespaceURI===O?e==="math":n.namespaceURI===ot?e==="math"&&at[c]:!!$t[e]:t.namespaceURI===O?n.namespaceURI===ot&&!at[c]||n.namespaceURI===nt&&!rt[c]?!1:!$t[e]&&
75
+ (Me[e]||!qt[e]):!!(j==="application/xhtml+xml"&&_t[t.namespaceURI]):!1},x=function(t){X(o.removed,{element:t});try{J(t).removeChild(t)}catch{Ne(t)}},H=function(t,n){try{X(o.removed,{attribute:n.getAttributeNode(
76
+ t),from:n})}catch{X(o.removed,{attribute:null,from:n})}if(n.removeAttribute(t),t==="is")if(k||tt)try{x(n)}catch{}else try{n.setAttribute(t,"")}catch{}},Kt=function(t){let n=null,e=null;if(Tt)t="<remov\
77
+ e></remove>"+t;else{const s=le(t,/^[\r\n\t ]+/);e=s&&s[0]}j==="application/xhtml+xml"&&P===O&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const c=T?T.createHTML(
78
+ t):t;if(P===O)try{n=new Ae().parseFromString(c,j)}catch{}if(!n||!n.documentElement){n=ut.createDocument(P,"template",null);try{n.documentElement.innerHTML=At?B:c}catch{}}const d=n.body||n.documentElement;
79
+ return t&&e&&d.insertBefore(l.createTextNode(e),d.childNodes[0]||null),P===O?Oe.call(n,D?"html":"body")[0]:D?n.documentElement:d},Vt=function(t){return Re.call(t.ownerDocument||t,t,F.SHOW_ELEMENT|F.SHOW_COMMENT|
80
+ F.SHOW_TEXT|F.SHOW_PROCESSING_INSTRUCTION|F.SHOW_CDATA_SECTION,null)},St=function(t){return t instanceof Ee&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="functi\
81
+ on"||!(t.attributes instanceof ye)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!=
82
+ "function")},Zt=function(t){return typeof st=="function"&&t instanceof st};function L(t,n,e){it(t,c=>{c.call(o,n,e,z)})}const Jt=function(t){let n=null;if(L(y.beforeSanitizeElements,t,null),St(t))return x(
83
+ t),!0;const e=p(t.nodeName);if(L(y.uponSanitizeElement,t,{tagName:e,allowedTags:m}),Q&&t.hasChildNodes()&&!Zt(t.firstElementChild)&&A(/<[/\w!]/g,t.innerHTML)&&A(/<[/\w!]/g,t.textContent)||t.nodeType===
84
+ V.progressingInstruction||Q&&t.nodeType===V.comment&&A(/<[/\w]/g,t.data))return x(t),!0;if(!m[e]||G[e]){if(!G[e]&&te(e)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof
85
+ Function&&u.tagNameCheck(e)))return!1;if(yt&&!U[e]){const c=J(t)||t.parentNode,d=be(t)||t.childNodes;if(d&&c){const s=d.length;for(let v=s-1;v>=0;--v){const S=_e(d[v],!0);S.__removalCount=(t.__removalCount||
86
+ 0)+1,c.insertBefore(S,Se(t))}}}return x(t),!0}return t instanceof xt&&!He(t)||(e==="noscript"||e==="noembed"||e==="noframes")&&A(/<\/no(script|embed|frames)/i,t.innerHTML)?(x(t),!0):(I&&t.nodeType===V.
87
+ text&&(n=t.textContent,it([mt,pt,ft],c=>{n=q(n,c," ")}),t.textContent!==n&&(X(o.removed,{element:t.cloneNode()}),t.textContent=n)),L(y.afterSanitizeElements,t,null),!1)},Qt=function(t,n,e){if(Ft&&(n===
88
+ "id"||n==="name")&&(e in l||e in ze))return!1;if(!(gt&&!dt[n]&&A(ve,n))&&!(Pt&&A(Ce,n))){if(!f[n]||dt[n]){if(!(te(t)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,t)||u.tagNameCheck instanceof Function&&
89
+ u.tagNameCheck(t))&&(u.attributeNameCheck instanceof RegExp&&A(u.attributeNameCheck,n)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(n))||n==="is"&&u.allowCustomizedBuiltInElements&&
90
+ (u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))))return!1}else if(!Et[n]&&!A(kt,q(e,It,""))&&!((n==="src"||n==="xlink:href"||n==="href")&&
91
+ t!=="script"&&qe(e,"data:")===0&&Gt[t])&&!(zt&&!A(De,q(e,It,"")))&&e)return!1}return!0},te=function(t){return t!=="annotation-xml"&&le(t,xe)},ee=function(t){L(y.beforeSanitizeAttributes,t,null);const{
92
+ attributes:n}=t;if(!n||St(t))return;const e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:f,forceKeepAttr:void 0};let c=n.length;for(;c--;){const d=n[c],{name:s,namespaceURI:v,value:S}=d,w=p(
93
+ s),bt=S;let g=s==="value"?bt:$e(bt);if(e.attrName=w,e.attrValue=g,e.keepAttr=!0,e.forceKeepAttr=void 0,L(y.uponSanitizeAttribute,t,e),g=e.attrValue,Wt&&(w==="id"||w==="name")&&(H(s,t),g=Ie+g),Q&&A(/((--!?|])>)|<\/(style|title)/i,
94
+ g)){H(s,t);continue}if(e.forceKeepAttr)continue;if(!e.keepAttr){H(s,t);continue}if(!Ht&&A(/\/>/i,g)){H(s,t);continue}I&&it([mt,pt,ft],We=>{g=q(g,We," ")});const ne=p(t.nodeName);if(!Qt(ne,w,g)){H(s,t);
95
+ continue}if(T&&typeof Z=="object"&&typeof Z.getAttributeType=="function"&&!v)switch(Z.getAttributeType(ne,w)){case"TrustedHTML":{g=T.createHTML(g);break}case"TrustedScriptURL":{g=T.createScriptURL(g);
96
+ break}}if(g!==bt)try{v?t.setAttributeNS(v,s,g):t.setAttribute(s,g),St(t)?x(t):ie(o.removed)}catch{H(s,t)}}L(y.afterSanitizeAttributes,t,null)},Fe=function t(n){let e=null;const c=Vt(n);for(L(y.beforeSanitizeShadowDOM,
97
+ n,null);e=c.nextNode();)L(y.uponSanitizeShadowNode,e,null),Jt(e),ee(e),e.content instanceof R&&t(e.content);L(y.afterSanitizeShadowDOM,n,null)};return o.sanitize=function(t){let n=arguments.length>1&&
98
+ arguments[1]!==void 0?arguments[1]:{},e=null,c=null,d=null,s=null;if(At=!t,At&&(t="<!-->"),typeof t!="string"&&!Zt(t))if(typeof t.toString=="function"){if(t=t.toString(),typeof t!="string")throw $("di\
99
+ rty is not a string, aborting")}else throw $("toString is not a function");if(!o.isSupported)return t;if(ht||Nt(n),o.removed=[],typeof t=="string"&&(Y=!1),Y){if(t.nodeName){const w=p(t.nodeName);if(!m[w]||
100
+ G[w])throw $("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof st)e=Kt("<!---->"),c=e.ownerDocument.importNode(t,!0),c.nodeType===V.element&&c.nodeName==="BODY"||c.nodeName===
101
+ "HTML"?e=c:e.appendChild(c);else{if(!k&&!I&&!D&&t.indexOf("<")===-1)return T&&et?T.createHTML(t):t;if(e=Kt(t),!e)return k?null:et?B:""}e&&Tt&&x(e.firstChild);const v=Vt(Y?t:e);for(;d=v.nextNode();)Jt(
102
+ d),ee(d),d.content instanceof R&&Fe(d.content);if(Y)return t;if(k){if(tt)for(s=we.call(e.ownerDocument);e.firstChild;)s.appendChild(e.firstChild);else s=e;return(f.shadowroot||f.shadowrootmode)&&(s=Le.
103
+ call(i,s,!0)),s}let S=D?e.outerHTML:e.innerHTML;return D&&m["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&A(fe,e.ownerDocument.doctype.name)&&(S="<!DOCTYPE "+e.ownerDocument.
104
+ doctype.name+`>
105
+ `+S),I&&it([mt,pt,ft],w=>{S=q(S,w," ")}),T&&et?T.createHTML(S):S},o.setConfig=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Nt(t),ht=!0},o.clearConfig=function(){z=null,ht=
106
+ !1},o.isValidAttribute=function(t,n,e){z||Nt({});const c=p(t),d=p(n);return Qt(c,d,e)},o.addHook=function(t,n){typeof n=="function"&&X(y[t],n)},o.removeHook=function(t,n){if(n!==void 0){const e=je(y[t],
107
+ n);return e===-1?void 0:Xe(y[t],e,1)[0]}return ie(y[t])},o.removeHooks=function(t){y[t]=[]},o.removeAllHooks=function(){y=ge()},o}var un=he();export{un as default};