openlearn-next 0.1.5 → 0.1.7
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/README.md +16 -5
- package/dist/assets/{courseware-Djq-abmg.js → courseware-BD1ksVla.js} +1 -1
- package/dist/assets/index-BCFaLj6T.css +1 -0
- package/dist/assets/{index-DNBTB2GR.js → index-BejAcbMi.js} +235 -294
- package/dist/assets/{index.es-CY0Jf_ui.js → index.es-C4q5HQQu.js} +1 -1
- package/dist/assets/purify.es-Csrj9YNg.js +3 -0
- package/dist/assets/{vendor-konva-BRP-lFzZ.js → vendor-konva-DA6-nIw3.js} +18 -18
- package/dist/assets/{vendor-pptx-w8e1eCEK.js → vendor-pptx-mq6Wpied.js} +1 -1
- package/dist/assets/{whiteboard-FFuMxeyx.js → whiteboard-CcOx2g2x.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/plugins/ext-ai-quiz-pro.zip +0 -0
- package/dist/plugins/ext-hello-world.zip +0 -0
- package/dist/plugins/ext-memo.zip +0 -0
- package/dist/plugins/ext-mindmap-assistant.zip +0 -0
- package/dist/plugins/ext-quiz-generator.zip +0 -0
- package/dist/plugins/ext-raffle-vote.zip +0 -0
- package/dist/plugins/ext-roll-call.zip +0 -0
- package/dist/server.cjs +84 -7
- package/package.json +4 -2
- package/dist/assets/index-ZE_dOjBv.css +0 -1
- package/dist/assets/purify.es-V6uLfjnH.js +0 -3
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.4.8 | (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.8/LICENSE */function Ot(n,o){(o==null||o>n.length)&&(o=n.length);for(var a=0,s=Array(o);a<o;a++)s[a]=n[a];return s}function rn(n){if(Array.isArray(n))return n}function an(n,o){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var s,u,p,O,re=[],I=!0,ie=!1;try{if(p=(a=a.call(n)).next,o!==0)for(;!(I=(s=p.call(a)).done)&&(re.push(s.value),re.length!==o);I=!0);}catch(Ce){ie=!0,u=Ce}finally{try{if(!I&&a.return!=null&&(O=a.return(),Object(O)!==O))return}finally{if(ie)throw u}}return re}}function sn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ln(n,o){return rn(n)||an(n,o)||cn(n,o)||sn()}function cn(n,o){if(n){if(typeof n=="string")return Ot(n,o);var a={}.toString.call(n).slice(8,-1);return a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set"?Array.from(n):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Ot(n,o):void 0}}const Ft=Object.entries,Rt=Object.setPrototypeOf,un=Object.isFrozen,fn=Object.getPrototypeOf,mn=Object.getOwnPropertyDescriptor;let N=Object.freeze,w=Object.seal,oe=Object.create,Ut=typeof Reflect<"u"&&Reflect,Qe=Ut.apply,et=Ut.construct;N||(N=function(o){return o});w||(w=function(o){return o});Qe||(Qe=function(o,a){for(var s=arguments.length,u=new Array(s>2?s-2:0),p=2;p<s;p++)u[p-2]=arguments[p];return o.apply(a,u)});et||(et=function(o){for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];return new o(...s)});const $=E(Array.prototype.forEach),pn=E(Array.prototype.lastIndexOf),Dt=E(Array.prototype.pop),ee=E(Array.prototype.push),dn=E(Array.prototype.splice),D=Array.isArray,me=E(String.prototype.toLowerCase),Ve=E(String.prototype.toString),Nt=E(String.prototype.match),te=E(String.prototype.replace),It=E(String.prototype.indexOf),Tn=E(String.prototype.trim),_n=E(Number.prototype.toString),gn=E(Boolean.prototype.toString),Lt=typeof BigInt>"u"?null:E(BigInt.prototype.toString),Ct=typeof Symbol>"u"?null:E(Symbol.prototype.toString),d=E(Object.prototype.hasOwnProperty),fe=E(Object.prototype.toString),b=E(RegExp.prototype.test),ne=hn(TypeError);function E(n){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];return Qe(n,o,s)}}function hn(n){return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return et(n,a)}}function l(n,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:me;if(Rt&&Rt(n,null),!D(o))return n;let s=o.length;for(;s--;){let u=o[s];if(typeof u=="string"){const p=a(u);p!==u&&(un(o)||(o[s]=p),u=p)}n[u]=!0}return n}function En(n){for(let o=0;o<n.length;o++)d(n,o)||(n[o]=null);return n}function R(n){const o=oe(null);for(const s of Ft(n)){var a=ln(s,2);const u=a[0],p=a[1];d(n,u)&&(D(p)?o[u]=En(p):p&&typeof p=="object"&&p.constructor===Object?o[u]=R(p):o[u]=p)}return o}function An(n){switch(typeof n){case"string":return n;case"number":return _n(n);case"boolean":return gn(n);case"bigint":return Lt?Lt(n):"0";case"symbol":return Ct?Ct(n):"Symbol()";case"undefined":return fe(n);case"function":case"object":{if(n===null)return fe(n);const o=n,a=U(o,"toString");if(typeof a=="function"){const s=a(o);return typeof s=="string"?s:fe(s)}return fe(n)}default:return fe(n)}}function U(n,o){for(;n!==null;){const s=mn(n,o);if(s){if(s.get)return E(s.get);if(typeof s.value=="function")return E(s.value)}n=fn(n)}function a(){return null}return a}function Sn(n){try{return b(n,""),!0}catch{return!1}}const wt=N(["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"]),qe=N(["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"]),Ke=N(["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"]),yn=N(["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"]),Ze=N(["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"]),bn=N(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mt=N(["#text"]),Pt=N(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),Je=N(["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"]),xt=N(["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"]),Le=N(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),On=w(/{{[\w\W]*|^[\w\W]*}}/g),Rn=w(/<%[\w\W]*|^[\w\W]*%>/g),Dn=w(/\${[\w\W]*/g),Nn=w(/^data-[\-\w.\u00B7-\uFFFF]+$/),In=w(/^aria-[\-\w]+$/),kt=w(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ln=w(/^(?:\w+script|data):/i),Cn=w(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wn=w(/^html$/i),Mn=w(/^[a-z][.\w]*(-[.\w]+)+$/i),F={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Pn=function(){return typeof window>"u"?null:window},xn=function(o,a){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let s=null;const u="data-tt-policy-suffix";a&&a.hasAttribute(u)&&(s=a.getAttribute(u));const p="dompurify"+(s?"#"+s:"");try{return o.createPolicy(p,{createHTML(O){return O},createScriptURL(O){return O}})}catch{return console.warn("TrustedTypes policy "+p+" could not be created."),null}},vt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ht(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pn();const o=i=>Ht(i);if(o.version="3.4.8",o.removed=[],!n||!n.document||n.document.nodeType!==F.document||!n.Element)return o.isSupported=!1,o;let a=n.document;const s=a,u=s.currentScript;n.DocumentFragment;const p=n.HTMLTemplateElement,O=n.Node,re=n.Element,I=n.NodeFilter,ie=n.NamedNodeMap;ie===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const Ce=n.DOMParser,pe=n.trustedTypes,B=re.prototype,zt=U(B,"cloneNode"),Gt=U(B,"remove"),Wt=U(B,"nextSibling"),de=U(B,"childNodes"),Te=U(B,"parentNode"),_e=U(B,"shadowRoot"),Bt=U(B,"attributes"),M=O&&O.prototype?U(O.prototype,"nodeType"):null,z=O&&O.prototype?U(O.prototype,"nodeName"):null;if(typeof p=="function"){const i=a.createElement("template");i.content&&i.content.ownerDocument&&(a=i.content.ownerDocument)}let L,ae="",we=0;const X=function(e){if(we>0)throw ne('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');we++;try{return L.createHTML(e)}finally{we--}},ge=a,Me=ge.implementation,tt=ge.createNodeIterator,Yt=ge.createDocumentFragment,jt=ge.getElementsByTagName,$t=s.importNode;let S=vt();o.isSupported=typeof Ft=="function"&&typeof Te=="function"&&Me&&Me.createHTMLDocument!==void 0;const he=On,Ee=Rn,Ae=Dn,Xt=Nn,Vt=In,qt=Ln,nt=Cn,Kt=Mn;let ot=kt,T=null;const Pe=l({},[...wt,...qe,...Ke,...Ze,...Mt]);let h=null;const xe=l({},[...Pt,...Je,...xt,...Le]);let _=Object.seal(oe(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}})),se=null,Se=null;const G=Object.seal(oe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let rt=!0,ke=!0,it=!1,at=!0,W=!1,le=!0,Y=!1,ve=!1,Fe=!1,V=!1,ye=!1,be=!1,st=!0,lt=!1;const ct="user-content-";let Ue=!0,ce=!1,q={},k=null;const He=l({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ut=null;const ft=l({},["audio","video","img","source","image","track"]);let ze=null;const mt=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Oe="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",v="http://www.w3.org/1999/xhtml";let K=v,Ge=!1,We=null;const Zt=l({},[Oe,Re,v],Ve);let Be=l({},["mi","mo","mn","ms","mtext"]),Ye=l({},["annotation-xml"]);const Jt=l({},["title","style","font","a","script"]);let ue=null;const Qt=["application/xhtml+xml","text/html"],en="text/html";let g=null,Z=null;const tn=a.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},je=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Z&&Z===e)return;(!e||typeof e!="object")&&(e={}),e=R(e),ue=Qt.indexOf(e.PARSER_MEDIA_TYPE)===-1?en:e.PARSER_MEDIA_TYPE,g=ue==="application/xhtml+xml"?Ve:me,T=d(e,"ALLOWED_TAGS")&&D(e.ALLOWED_TAGS)?l({},e.ALLOWED_TAGS,g):Pe,h=d(e,"ALLOWED_ATTR")&&D(e.ALLOWED_ATTR)?l({},e.ALLOWED_ATTR,g):xe,We=d(e,"ALLOWED_NAMESPACES")&&D(e.ALLOWED_NAMESPACES)?l({},e.ALLOWED_NAMESPACES,Ve):Zt,ze=d(e,"ADD_URI_SAFE_ATTR")&&D(e.ADD_URI_SAFE_ATTR)?l(R(mt),e.ADD_URI_SAFE_ATTR,g):mt,ut=d(e,"ADD_DATA_URI_TAGS")&&D(e.ADD_DATA_URI_TAGS)?l(R(ft),e.ADD_DATA_URI_TAGS,g):ft,k=d(e,"FORBID_CONTENTS")&&D(e.FORBID_CONTENTS)?l({},e.FORBID_CONTENTS,g):He,se=d(e,"FORBID_TAGS")&&D(e.FORBID_TAGS)?l({},e.FORBID_TAGS,g):R({}),Se=d(e,"FORBID_ATTR")&&D(e.FORBID_ATTR)?l({},e.FORBID_ATTR,g):R({}),q=d(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?R(e.USE_PROFILES):e.USE_PROFILES:!1,rt=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,it=e.ALLOW_UNKNOWN_PROTOCOLS||!1,at=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,W=e.SAFE_FOR_TEMPLATES||!1,le=e.SAFE_FOR_XML!==!1,Y=e.WHOLE_DOCUMENT||!1,V=e.RETURN_DOM||!1,ye=e.RETURN_DOM_FRAGMENT||!1,be=e.RETURN_TRUSTED_TYPE||!1,Fe=e.FORCE_BODY||!1,st=e.SANITIZE_DOM!==!1,lt=e.SANITIZE_NAMED_PROPS||!1,Ue=e.KEEP_CONTENT!==!1,ce=e.IN_PLACE||!1,ot=Sn(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:kt,K=typeof e.NAMESPACE=="string"?e.NAMESPACE:v,Be=d(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS=="object"?R(e.MATHML_TEXT_INTEGRATION_POINTS):l({},["mi","mo","mn","ms","mtext"]),Ye=d(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS=="object"?R(e.HTML_INTEGRATION_POINTS):l({},["annotation-xml"]);const t=d(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING=="object"?R(e.CUSTOM_ELEMENT_HANDLING):oe(null);if(_=oe(null),d(t,"tagNameCheck")&&pt(t.tagNameCheck)&&(_.tagNameCheck=t.tagNameCheck),d(t,"attributeNameCheck")&&pt(t.attributeNameCheck)&&(_.attributeNameCheck=t.attributeNameCheck),d(t,"allowCustomizedBuiltInElements")&&typeof t.allowCustomizedBuiltInElements=="boolean"&&(_.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),W&&(ke=!1),ye&&(V=!0),q&&(T=l({},Mt),h=oe(null),q.html===!0&&(l(T,wt),l(h,Pt)),q.svg===!0&&(l(T,qe),l(h,Je),l(h,Le)),q.svgFilters===!0&&(l(T,Ke),l(h,Je),l(h,Le)),q.mathMl===!0&&(l(T,Ze),l(h,xt),l(h,Le))),G.tagCheck=null,G.attributeCheck=null,d(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?G.tagCheck=e.ADD_TAGS:D(e.ADD_TAGS)&&(T===Pe&&(T=R(T)),l(T,e.ADD_TAGS,g))),d(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?G.attributeCheck=e.ADD_ATTR:D(e.ADD_ATTR)&&(h===xe&&(h=R(h)),l(h,e.ADD_ATTR,g))),d(e,"ADD_URI_SAFE_ATTR")&&D(e.ADD_URI_SAFE_ATTR)&&l(ze,e.ADD_URI_SAFE_ATTR,g),d(e,"FORBID_CONTENTS")&&D(e.FORBID_CONTENTS)&&(k===He&&(k=R(k)),l(k,e.FORBID_CONTENTS,g)),d(e,"ADD_FORBID_CONTENTS")&&D(e.ADD_FORBID_CONTENTS)&&(k===He&&(k=R(k)),l(k,e.ADD_FORBID_CONTENTS,g)),Ue&&(T["#text"]=!0),Y&&l(T,["html","head","body"]),T.table&&(l(T,["tbody"]),delete se.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const r=L;L=e.TRUSTED_TYPES_POLICY;try{ae=X("")}catch(f){throw L=r,f}}else L===void 0&&e.TRUSTED_TYPES_POLICY!==null&&(L=xn(pe,u)),L&&typeof ae=="string"&&(ae=X(""));(S.uponSanitizeElement.length>0||S.uponSanitizeAttribute.length>0)&&T===Pe&&(T=R(T)),S.uponSanitizeAttribute.length>0&&h===xe&&(h=R(h)),N&&N(e),Z=e},dt=l({},[...qe,...Ke,...yn]),Tt=l({},[...Ze,...bn]),nn=function(e){let t=Te(e);(!t||!t.tagName)&&(t={namespaceURI:K,tagName:"template"});const r=me(e.tagName),f=me(t.tagName);return We[e.namespaceURI]?e.namespaceURI===Re?t.namespaceURI===v?r==="svg":t.namespaceURI===Oe?r==="svg"&&(f==="annotation-xml"||Be[f]):!!dt[r]:e.namespaceURI===Oe?t.namespaceURI===v?r==="math":t.namespaceURI===Re?r==="math"&&Ye[f]:!!Tt[r]:e.namespaceURI===v?t.namespaceURI===Re&&!Ye[f]||t.namespaceURI===Oe&&!Be[f]?!1:!Tt[r]&&(Jt[r]||!dt[r]):!!(ue==="application/xhtml+xml"&&We[e.namespaceURI]):!1},P=function(e){ee(o.removed,{element:e});try{Te(e).removeChild(e)}catch{Gt(e)}},j=function(e,t){try{ee(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{ee(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(V||ye)try{P(t)}catch{}else try{t.setAttribute(e,"")}catch{}},_t=function(e){let t=null,r=null;if(Fe)e="<remove></remove>"+e;else{const m=Nt(e,/^[\r\n\t ]+/);r=m&&m[0]}ue==="application/xhtml+xml"&&K===v&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const f=L?X(e):e;if(K===v)try{t=new Ce().parseFromString(f,ue)}catch{}if(!t||!t.documentElement){t=Me.createDocument(K,"template",null);try{t.documentElement.innerHTML=Ge?ae:f}catch{}}const c=t.body||t.documentElement;return e&&r&&c.insertBefore(a.createTextNode(r),c.childNodes[0]||null),K===v?jt.call(t,Y?"html":"body")[0]:Y?t.documentElement:c},gt=function(e){return tt.call(e.ownerDocument||e,e,I.SHOW_ELEMENT|I.SHOW_COMMENT|I.SHOW_TEXT|I.SHOW_PROCESSING_INSTRUCTION|I.SHOW_CDATA_SECTION,null)},$e=function(e){var t,r;e.normalize();const f=tt.call(e.ownerDocument||e,e,I.SHOW_TEXT|I.SHOW_COMMENT|I.SHOW_CDATA_SECTION|I.SHOW_PROCESSING_INSTRUCTION,null);let c=f.nextNode();for(;c;){let A=c.data;$([he,Ee,Ae],C=>{A=te(A,C," ")}),c.data=A,c=f.nextNode()}const m=(t=(r=e.querySelectorAll)===null||r===void 0?void 0:r.call(e,"template"))!==null&&t!==void 0?t:[];$(Array.from(m),A=>{J(A.content)&&$e(A.content)})},De=function(e){const t=z?z(e):null;return typeof t!="string"||g(t)!=="form"?!1:typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||e.attributes!==Bt(e)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function"||e.nodeType!==M(e)||e.childNodes!==de(e)},J=function(e){if(!M||typeof e!="object"||e===null)return!1;try{return M(e)===F.documentFragment}catch{return!1}},Ne=function(e){if(!M||typeof e!="object"||e===null)return!1;try{return typeof M(e)=="number"}catch{return!1}};function H(i,e,t){$(i,r=>{r.call(o,e,t,Z)})}const ht=function(e){let t=null;if(H(S.beforeSanitizeElements,e,null),De(e))return P(e),!0;const r=g(z?z(e):e.nodeName);if(H(S.uponSanitizeElement,e,{tagName:r,allowedTags:T}),le&&e.hasChildNodes()&&!Ne(e.firstElementChild)&&b(/<[/\w!]/g,e.innerHTML)&&b(/<[/\w!]/g,e.textContent)||le&&e.namespaceURI===v&&r==="style"&&Ne(e.firstElementChild)||e.nodeType===F.progressingInstruction||le&&e.nodeType===F.comment&&b(/<[/\w]/g,e.data))return P(e),!0;if(se[r]||!(G.tagCheck instanceof Function&&G.tagCheck(r))&&!T[r]){if(!se[r]&&At(r)&&(_.tagNameCheck instanceof RegExp&&b(_.tagNameCheck,r)||_.tagNameCheck instanceof Function&&_.tagNameCheck(r)))return!1;if(Ue&&!k[r]){const c=Te(e),m=de(e);if(m&&c){const A=m.length;for(let C=A-1;C>=0;--C){const x=zt(m[C],!0);c.insertBefore(x,Wt(e))}}}return P(e),!0}return(M?M(e):e.nodeType)===F.element&&!nn(e)||(r==="noscript"||r==="noembed"||r==="noframes")&&b(/<\/no(script|embed|frames)/i,e.innerHTML)?(P(e),!0):(W&&e.nodeType===F.text&&(t=e.textContent,$([he,Ee,Ae],c=>{t=te(t,c," ")}),e.textContent!==t&&(ee(o.removed,{element:e.cloneNode()}),e.textContent=t)),H(S.afterSanitizeElements,e,null),!1)},Et=function(e,t,r){if(Se[t]||st&&(t==="id"||t==="name")&&(r in a||r in tn))return!1;const f=h[t]||G.attributeCheck instanceof Function&&G.attributeCheck(t,e);if(!(ke&&!Se[t]&&b(Xt,t))){if(!(rt&&b(Vt,t))){if(!f||Se[t]){if(!(At(e)&&(_.tagNameCheck instanceof RegExp&&b(_.tagNameCheck,e)||_.tagNameCheck instanceof Function&&_.tagNameCheck(e))&&(_.attributeNameCheck instanceof RegExp&&b(_.attributeNameCheck,t)||_.attributeNameCheck instanceof Function&&_.attributeNameCheck(t,e))||t==="is"&&_.allowCustomizedBuiltInElements&&(_.tagNameCheck instanceof RegExp&&b(_.tagNameCheck,r)||_.tagNameCheck instanceof Function&&_.tagNameCheck(r))))return!1}else if(!ze[t]){if(!b(ot,te(r,nt,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&It(r,"data:")===0&&ut[e])){if(!(it&&!b(qt,te(r,nt,"")))){if(r)return!1}}}}}}return!0},on=l({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),At=function(e){return!on[me(e)]&&b(Kt,e)},St=function(e){H(S.beforeSanitizeAttributes,e,null);const t=e.attributes;if(!t||De(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:h,forceKeepAttr:void 0};let f=t.length;for(;f--;){const c=t[f],m=c.name,A=c.namespaceURI,C=c.value,x=g(m),Xe=C;let y=m==="value"?Xe:Tn(Xe);if(r.attrName=x,r.attrValue=y,r.keepAttr=!0,r.forceKeepAttr=void 0,H(S.uponSanitizeAttribute,e,r),y=r.attrValue,lt&&(x==="id"||x==="name")&&It(y,ct)!==0&&(j(m,e),y=ct+y),le&&b(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,y)){j(m,e);continue}if(x==="attributename"&&Nt(y,"href")){j(m,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){j(m,e);continue}if(!at&&b(/\/>/i,y)){j(m,e);continue}W&&$([he,Ee,Ae],bt=>{y=te(y,bt," ")});const yt=g(e.nodeName);if(!Et(yt,x,y)){j(m,e);continue}if(L&&typeof pe=="object"&&typeof pe.getAttributeType=="function"&&!A)switch(pe.getAttributeType(yt,x)){case"TrustedHTML":{y=X(y);break}case"TrustedScriptURL":{y=L.createScriptURL(y);break}}if(y!==Xe)try{A?e.setAttributeNS(A,m,y):e.setAttribute(m,y),De(e)?P(e):Dt(o.removed)}catch{j(m,e)}}H(S.afterSanitizeAttributes,e,null)},Ie=function(e){let t=null;const r=gt(e);for(H(S.beforeSanitizeShadowDOM,e,null);t=r.nextNode();)if(H(S.uponSanitizeShadowNode,t,null),ht(t),St(t),J(t.content)&&Ie(t.content),(M?M(t):t.nodeType)===F.element){const c=_e?_e(t):t.shadowRoot;J(c)&&(Q(c),Ie(c))}H(S.afterSanitizeShadowDOM,e,null)},Q=function(e){const t=M?M(e):e.nodeType;if(t===F.element){const c=_e?_e(e):e.shadowRoot;J(c)&&(Q(c),Ie(c))}const r=de?de(e):e.childNodes;if(!r)return;const f=[];$(r,c=>{ee(f,c)});for(const c of f)Q(c);if(t===F.element){const c=z?z(e):null;if(typeof c=="string"&&g(c)==="template"){const m=e.content;J(m)&&Q(m)}}};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,r=null,f=null,c=null;if(Ge=!i,Ge&&(i="<!-->"),typeof i!="string"&&!Ne(i)&&(i=An(i),typeof i!="string"))throw ne("dirty is not a string, aborting");if(!o.isSupported)return i;if(ve||je(e),o.removed=[],typeof i=="string"&&(ce=!1),ce){const C=z?z(i):i.nodeName;if(typeof C=="string"){const x=g(C);if(!T[x]||se[x])throw ne("root node is forbidden and cannot be sanitized in-place")}if(De(i))throw ne("root node is clobbered and cannot be sanitized in-place");Q(i)}else if(Ne(i))t=_t("<!---->"),r=t.ownerDocument.importNode(i,!0),r.nodeType===F.element&&r.nodeName==="BODY"||r.nodeName==="HTML"?t=r:t.appendChild(r),Q(r);else{if(!V&&!W&&!Y&&i.indexOf("<")===-1)return L&&be?X(i):i;if(t=_t(i),!t)return V?null:be?ae:""}t&&Fe&&P(t.firstChild);const m=gt(ce?i:t);for(;f=m.nextNode();)ht(f),St(f),J(f.content)&&Ie(f.content);if(ce)return W&&$e(i),i;if(V){if(W&&$e(t),ye)for(c=Yt.call(t.ownerDocument);t.firstChild;)c.appendChild(t.firstChild);else c=t;return(h.shadowroot||h.shadowrootmode)&&(c=$t.call(s,c,!0)),c}let A=Y?t.outerHTML:t.innerHTML;return Y&&T["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&b(wn,t.ownerDocument.doctype.name)&&(A="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
3
|
-
`+A),W&&$([he,Ee,Ae],C=>{A=te(A,C," ")}),L&&be?X(A):A},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};je(i),ve=!0},o.clearConfig=function(){Z=null,ve=!1},o.isValidAttribute=function(i,e,t){Z||je({});const r=g(i),f=g(e);return Et(r,f,t)},o.addHook=function(i,e){typeof e=="function"&&ee(S[i],e)},o.removeHook=function(i,e){if(e!==void 0){const t=pn(S[i],e);return t===-1?void 0:dn(S[i],t,1)[0]}return Dt(S[i])},o.removeHooks=function(i){S[i]=[]},o.removeAllHooks=function(){S=vt()},o}var kn=Ht();export{kn as default};
|