@bitcaster/printkit 0.0.0-stage → 0.1.0

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 (56) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +8 -2
  3. package/README.npm.md +9 -0
  4. package/THIRD_PARTY_NOTICES.md +1973 -0
  5. package/dist/assets/fonts/C400.ttf +0 -0
  6. package/dist/assets/fonts/M400.ttf +0 -0
  7. package/dist/assets/fonts/M600.ttf +0 -0
  8. package/dist/assets/fonts/M700.ttf +0 -0
  9. package/dist/assets/fonts/OFL-IBMPlexMono.txt +93 -0
  10. package/dist/assets/fonts/OFL-LibreCaslonText.txt +93 -0
  11. package/dist/assets/fonts/OFL-Manrope.txt +93 -0
  12. package/dist/assets/fonts/P400.ttf +0 -0
  13. package/dist/assets/fonts/P500.ttf +0 -0
  14. package/dist/assets/pdf.worker.min.mjs +29 -0
  15. package/dist/components/index.d.ts +42 -0
  16. package/dist/components/index.js +1 -0
  17. package/dist/components/p-6By_vSL9.js +1 -0
  18. package/dist/components/p-B85ddf5i.js +58 -0
  19. package/dist/components/p-BEuF_WyR.js +15 -0
  20. package/dist/components/p-C06-VTon.js +1 -0
  21. package/dist/components/p-C5up7ejY.js +22 -0
  22. package/dist/components/p-ChB3W-Ln.js +3 -0
  23. package/dist/components/p-DpEO5JlK.js +2 -0
  24. package/dist/components/p-DzTdZECU.js +21 -0
  25. package/dist/components/pk-editor.d.ts +11 -0
  26. package/dist/components/pk-editor.js +277 -0
  27. package/dist/components/pk-help.d.ts +11 -0
  28. package/dist/components/pk-help.js +1 -0
  29. package/dist/components/pk-template-editor.d.ts +11 -0
  30. package/dist/components/pk-template-editor.js +1 -0
  31. package/dist/types/.stencil/components/pk-editor/pk-editor.d.ts +113 -0
  32. package/dist/types/.stencil/components/pk-help/help.content.d.ts +1 -0
  33. package/dist/types/.stencil/components/pk-help/pk-help.d.ts +9 -0
  34. package/dist/types/.stencil/components/pk-template-editor/pk-template-editor.d.ts +203 -0
  35. package/dist/types/.stencil/services/background-load.d.ts +20 -0
  36. package/dist/types/.stencil/services/background.d.ts +70 -0
  37. package/dist/types/.stencil/services/card-engine.d.ts +123 -0
  38. package/dist/types/.stencil/services/card-render.d.ts +5 -0
  39. package/dist/types/.stencil/services/card.config.d.ts +48 -0
  40. package/dist/types/.stencil/services/cmyk-lut.d.ts +4 -0
  41. package/dist/types/.stencil/services/collide.d.ts +19 -0
  42. package/dist/types/.stencil/services/color.d.ts +12 -0
  43. package/dist/types/.stencil/services/design.d.ts +106 -0
  44. package/dist/types/.stencil/services/fonts.d.ts +32 -0
  45. package/dist/types/.stencil/services/layouts.d.ts +15 -0
  46. package/dist/types/.stencil/services/logo.d.ts +19 -0
  47. package/dist/types/.stencil/services/palette.d.ts +31 -0
  48. package/dist/types/.stencil/services/pdf.d.ts +26 -0
  49. package/dist/types/.stencil/services/qr.d.ts +21 -0
  50. package/dist/types/.stencil/services/spot.d.ts +49 -0
  51. package/dist/types/.stencil/services/terms.d.ts +1 -0
  52. package/dist/types/.stencil/types/card.types.d.ts +403 -0
  53. package/dist/types/.stencil/types/editor.types.d.ts +48 -0
  54. package/dist/types/components.d.ts +320 -0
  55. package/dist/types/stencil-public-runtime.d.ts +1879 -0
  56. package/package.json +46 -4
@@ -0,0 +1,3 @@
1
+ /*! @license DOMPurify 3.4.17 | (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.17/LICENSE */
2
+ function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}const e=Object.entries,n=Object.setPrototypeOf,r=Object.isFrozen,o=Object.getPrototypeOf,i=Object.getOwnPropertyDescriptor;let a=Object.freeze,l=Object.seal,c=Object.create,u="undefined"!=typeof Reflect&&Reflect,s=u.apply,f=u.construct;a||(a=function(t){return t}),l||(l=function(t){return t}),s||(s=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.apply(e,r)}),f||(f=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new t(...n)});const p=N(Array.prototype.forEach),m=N(Array.prototype.lastIndexOf),d=N(Array.prototype.pop),h=N(Array.prototype.push),y=N(Array.prototype.slice),g=N(Array.prototype.splice),b=Array.isArray,w=C(Set),v=N(Set.prototype.add),x=N(Set.prototype.has),S=N(String.prototype.toLowerCase),k=N(String.prototype.toString),T=N(String.prototype.match),A=N(String.prototype.replace),O=N(String.prototype.indexOf),z=N(String.prototype.trim),E=N(Number.prototype.toString),D=N(Boolean.prototype.toString),R="undefined"==typeof BigInt?null:N(BigInt.prototype.toString),_="undefined"==typeof Symbol?null:N(Symbol.prototype.toString),j=N(Object.prototype.hasOwnProperty),L=N(Object.prototype.toString),I=N(RegExp.prototype.test),M=C(TypeError);function N(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(t,e,r)}}function C(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return f(t,n)}}function F(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;if(n&&n(t,null),!b(e))return t;let i=e.length;for(;i--;){let n=e[i];if("string"==typeof n){const t=o(n);t!==n&&(r(e)||(e[i]=t),n=t)}t[n]=!0}return t}function B(t){for(let e=0;e<t.length;e++)j(t,e)||(t[e]=null);return t}function P(n){const r=c(null);for(const l of e(n)){var o=(a=2,function(t){if(Array.isArray(t))return t}(i=l)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(i,a)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(i,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
3
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */());const e=o[0],c=o[1];j(n,e)&&(r[e]=b(c)?B(c):c&&"object"==typeof c&&c.constructor===Object?P(c):c)}var i,a;return r}function U(t,e){for(;null!==t;){const n=i(t,e);if(n){if(n.get)return N(n.get);if("function"==typeof n.value)return N(n.value)}t=o(t)}return function(){return null}}const Y=a(["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"]),G=a(["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"]),q=a(["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"]),H=a(["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"]),W=a(["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"]),$=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),K=a(["#text"]),V=a(["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"]),X=a(["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","dominant-baseline","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","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),J=a(["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"]),Q=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Z=l(/{{[\w\W]*|^[\w\W]*}}/g),tt=l(/<%[\w\W]*|^[\w\W]*%>/g),et=l(/\${[\w\W]*/g),nt=l(/^data-[\-\w.\u00B7-\uFFFF]+$/),rt=l(/^aria-[\-\w]+$/),ot=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),it=l(/^(?:\w+script|data):/i),at=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lt=l(/^html$/i),ct=l(/^[a-z][.\w]*(-[.\w]+)+$/i),ut=l(/<[/\w!]/g),st=l(/<[/\w]/g),ft=l(/<\/no(script|embed|frames)/i),pt=l(/\/>/i),mt=a(F({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),dt=function(){return"undefined"==typeof window?null:window},ht=function(t,e,n,r){return j(t,e)&&b(t[e])?F(r.base?P(r.base):{},t[e],r.transform):n},yt=function(t,e,n){const r=j(t,e)?t[e]:void 0;return r&&"object"==typeof r?P(r):n()};var gt=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dt();const r=e=>t(e);if(r.version="3.4.17",r.removed=[],!n||!n.document||9!==n.document.nodeType||!n.Element)return r.isSupported=!1,r;let u=n.document;const s=u,f=s.currentScript,C=n.HTMLTemplateElement,B=n.Node,gt=n.NodeFilter,bt=n.DOMParser,wt=n.trustedTypes,vt=n.Element.prototype,xt=U(vt,"cloneNode"),St=U(vt,"remove"),kt=U(vt,"removeAttributeNode"),Tt=U(vt,"nextSibling"),At=U(vt,"childNodes"),Ot=U(vt,"parentNode"),zt=U(vt,"shadowRoot"),Et=U(vt,"attributes"),Dt=B&&B.prototype?U(B.prototype,"nodeType"):null,Rt=B&&B.prototype?U(B.prototype,"nodeName"):null,_t=B&&B.prototype?U(B.prototype,"ownerDocument"):null,jt=function(t){return Dt?Dt(t):t.nodeType},Lt=function(t){return Rt?Rt(t):t.nodeName},It=function(t){for(;null!==t;){const e=i(t,"namespaceURI");if(e)return e.get?N(e.get):null;t=o(t)}return null}(vt),Mt=function(t){return It?It(t):t.namespaceURI};if("function"==typeof C){const t=u.createElement("template");t.content&&t.content.ownerDocument&&(u=t.content.ownerDocument)}let Nt,Ct,Ft="",Bt=!1,Pt=0;const Ut=function(){if(Pt>0)throw M('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Yt=function(t){Ut(),Pt++;try{return Nt.createHTML(t)}finally{Pt--}},Gt=u.implementation,qt=u.createNodeIterator,Ht=u.createDocumentFragment,Wt=u.getElementsByTagName,$t=s.importNode;let Kt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};r.isSupported="function"==typeof e&&"function"==typeof Ot&&Gt&&void 0!==Gt.createHTMLDocument;const Vt=Z,Xt=tt,Jt=et,Qt=nt,Zt=rt,te=it,ee=at,ne=ct;let re=ot,oe=null;const ie=F({},[...Y,...G,...q,...W,...K]);let ae=null;const le=F({},[...V,...X,...J,...Q]);let ce=Object.seal(c(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}})),ue=null,se=null;const fe=Object.seal(c(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pe=!0,me=!0,de=!1,he=!0,ye=!1,ge=!0,be=!1,we=!1,ve=null,xe=null,Se=!1,ke=!1,Te=!1,Ae=!1,Oe=!0,ze=!1;const Ee="user-content-";let De=!0,Re=!1,_e=null,je={},Le=null;const Ie=F({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Me=null;const Ne=F({},["audio","video","img","source","image","track"]);let Ce=null;const Fe=F({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Be="http://www.w3.org/1998/Math/MathML",Pe="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let Ye=Ue,Ge=!1,qe=null;const He=F({},[Be,Pe,Ue],k),We=a(["mi","mo","mn","ms","mtext"]);let $e=F({},We);const Ke=a(["annotation-xml"]);let Ve=F({},Ke);const Xe=F({},["title","style","font","a","script"]);let Je=null;const Qe=["application/xhtml+xml","text/html"];let Ze=null,tn=null;const en=u.createElement("form"),nn=function(t){return t instanceof RegExp||t instanceof Function},rn=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(tn&&tn===t)return;t&&"object"==typeof t||(t={}),t=P(t),Je=-1===Qe.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Ze="application/xhtml+xml"===Je?k:S,oe=ht(t,"ALLOWED_TAGS",ie,{transform:Ze}),ae=ht(t,"ALLOWED_ATTR",le,{transform:Ze}),qe=ht(t,"ALLOWED_NAMESPACES",He,{transform:k}),Ce=ht(t,"ADD_URI_SAFE_ATTR",Fe,{transform:Ze,base:Fe}),Me=ht(t,"ADD_DATA_URI_TAGS",Ne,{transform:Ze,base:Ne}),Le=ht(t,"FORBID_CONTENTS",Ie,{transform:Ze}),ue=ht(t,"FORBID_TAGS",P({}),{transform:Ze}),se=ht(t,"FORBID_ATTR",P({}),{transform:Ze}),je=!!j(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?P(t.USE_PROFILES):t.USE_PROFILES),pe=!1!==t.ALLOW_ARIA_ATTR,me=!1!==t.ALLOW_DATA_ATTR,de=t.ALLOW_UNKNOWN_PROTOCOLS||!1,he=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ye=t.SAFE_FOR_TEMPLATES||!1,ge=!1!==t.SAFE_FOR_XML,be=t.WHOLE_DOCUMENT||!1,ke=t.RETURN_DOM||!1,Te=t.RETURN_DOM_FRAGMENT||!1,Ae=t.RETURN_TRUSTED_TYPE||!1,Se=t.FORCE_BODY||!1,Oe=!1!==t.SANITIZE_DOM,ze=t.SANITIZE_NAMED_PROPS||!1,De=!1!==t.KEEP_CONTENT,Re=t.IN_PLACE||!1,re=function(t){try{return I(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:ot,Ye="string"==typeof t.NAMESPACE?t.NAMESPACE:Ue,$e=yt(t,"MATHML_TEXT_INTEGRATION_POINTS",(()=>F({},We))),Ve=yt(t,"HTML_INTEGRATION_POINTS",(()=>F({},Ke)));const e=yt(t,"CUSTOM_ELEMENT_HANDLING",(()=>c(null)));if(ce=c(null),j(e,"tagNameCheck")&&nn(e.tagNameCheck)&&(ce.tagNameCheck=e.tagNameCheck),j(e,"attributeNameCheck")&&nn(e.attributeNameCheck)&&(ce.attributeNameCheck=e.attributeNameCheck),j(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ce.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),l(ce),ye&&(me=!1),Te&&(ke=!0),je&&(oe=F({},K),ae=c(null),!0===je.html&&(F(oe,Y),F(ae,V)),!0===je.svg&&(F(oe,G),F(ae,X),F(ae,Q)),!0===je.svgFilters&&(F(oe,q),F(ae,X),F(ae,Q)),!0===je.mathMl&&(F(oe,W),F(ae,J),F(ae,Q))),fe.tagCheck=null,fe.attributeCheck=null,j(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?fe.tagCheck=t.ADD_TAGS:b(t.ADD_TAGS)&&(oe===ie&&(oe=P(oe)),F(oe,t.ADD_TAGS,Ze))),j(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?fe.attributeCheck=t.ADD_ATTR:b(t.ADD_ATTR)&&(ae===le&&(ae=P(ae)),F(ae,t.ADD_ATTR,Ze))),j(t,"ADD_FORBID_CONTENTS")&&b(t.ADD_FORBID_CONTENTS)&&(Le===Ie&&(Le=P(Le)),F(Le,t.ADD_FORBID_CONTENTS,Ze)),De&&(oe["#text"]=!0),be&&F(oe,["html","head","body"]),oe.table&&(F(oe,["tbody"]),delete ue.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw M('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw M('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Nt;Nt=t.TRUSTED_TYPES_POLICY;try{Ft=Yt("")}catch(t){throw Nt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(Nt=void 0,Ft=""):(void 0===Nt&&(Bt||(Ct=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(wt,f),Bt=!0),Nt=Ct),Nt&&"string"==typeof Ft&&(Ft=Yt("")));a&&a(t),tn=t},on=F({},[...G,...q,...H]),an=F({},[...W,...$]),ln=function(t){h(r.removed,{element:t});try{Ot(t).removeChild(t)}catch(e){if(St(t),!Ot(t))throw M("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},cn=function(t,e,n){try{kt(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},un=function(t){mn(t);const e=At(t);e&&p(y(e),(t=>{try{St(t)}catch(t){}}));const n=1===jt(t)?Et(t):null;if(n)for(let e=n.length-1;e>=0;--e){const r=n[e],o=r&&r.name;"string"==typeof o&&cn(t,r,o)}},sn=function(t,e,n){if(!n)try{n=e.getAttributeNode(t)}catch(t){n=null}h(r.removed,{attribute:n||null,from:e});try{n?kt(e,n):e.removeAttribute(t)}catch(n){try{e.removeAttribute(t)}catch(t){}}if("is"===t)if(ke||Te)try{ln(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},fn=function(t){const e=Et(t);if(e)for(let n=e.length-1;n>=0;--n){const r=e[n],o=r&&r.name;"string"!=typeof o||ae[Ze(o)]||cn(t,r,o)}},pn=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[t];for(;r.length>0;){const t=r.pop();if(!1===e(t))continue;if(n&&1===jt(t)){const e=zt(t);Tn(e)&&r.push(e)}const o=At(t);if(o)for(let t=o.length-1;t>=0;--t)r.push(o[t])}},mn=function(t){pn(t,(t=>{1===jt(t)&&fn(t)}))},dn=function(t){const e=[];return pn(t,(t=>{e.push(t)}),!0),e},hn=function(t,e){let n=!1;return p(r.removed,(e=>{e.element&&(n=n||e.element===t,mn(e.element))})),function(t,e){const n=w();p(dn(t),(t=>{1===jt(t)&&v(n,t)})),p(e,(t=>{1!==jt(t)||x(n,t)||fn(t)}))}(t,e),n},yn=function(t,e,n,r){const o=wn(t);let i;for(;i=o.nextNode();)x(r,i)&&!x(_e,i)&&(e&&On(Kt.uponSanitizeShadowNode,i,null),Rn(i,n),Cn(i,n),Tn(i.content)&&Fn(i.content))},gn=function(t,e){return!!ge&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},bn=function(t){let e=null,n=null;if(Se)t="<remove></remove>"+t;else{const e=T(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Je&&Ye===Ue&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=Nt?Yt(t):t;if(Ye===Ue)try{e=(new bt).parseFromString(r,Je)}catch(t){}if(!e||!e.documentElement){e=Gt.createDocument(Ye,"template",null);try{e.documentElement.innerHTML=Ge?Ft:r}catch(t){}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(u.createTextNode(n),o.childNodes[0]||null),Ye===Ue?Wt.call(e,be?"html":"body")[0]:be?e.documentElement:o},wn=function(t){const e=_t?_t(t):t.ownerDocument;return qt.call(e||t,t,gt.SHOW_ELEMENT|gt.SHOW_COMMENT|gt.SHOW_TEXT|gt.SHOW_PROCESSING_INSTRUCTION|gt.SHOW_CDATA_SECTION,null)},vn=function(t){return t=A(t,Vt," "),t=A(t,Xt," "),A(t,Jt," ")},xn=function(t){var e;Sn(t);const n=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");n&&p(n,(t=>{Tn(t.content)&&xn(t.content)}))},Sn=function(t){t.normalize();const e=_t?_t(t):t.ownerDocument,n=qt.call(e||t,t,gt.SHOW_TEXT|gt.SHOW_COMMENT|gt.SHOW_CDATA_SECTION|gt.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=vn(r.data),r=n.nextNode()},kn=function(t){const e=Rt?Rt(t):null;return"string"==typeof e&&"form"===Ze(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==Et(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==Dt(t)||t.childNodes!==At(t))},Tn=function(t){if(!Dt||"object"!=typeof t||null===t)return!1;try{return 11===Dt(t)}catch(t){return!1}},An=function(t){if(!Dt||"object"!=typeof t||null===t)return!1;try{return"number"==typeof Dt(t)}catch(t){return!1}};function On(t,e,n){0!==t.length&&p(t,(t=>{t.call(r,e,n,tn)}))}const zn=function(t,e){if(t instanceof RegExp)return I(t,e);if(t instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Boolean(t(e,...r))}return!1},En=function(t,e,n,r){return 0===t.length?e:e===n||e===r?P(e):e},Dn=function(t,e){return t!==e&&null===Ot(t)&&(Re&&mn(t),!0)},Rn=function(t,e){if(_e&&v(_e,t),On(Kt.beforeSanitizeElements,t,null),Dn(t,e))return!0;if(kn(t))return ln(t),!0;const n=Ze(Lt(t));if(oe=En(Kt.uponSanitizeElement,oe,ie,ve),On(Kt.uponSanitizeElement,t,{tagName:n,allowedTags:oe}),Dn(t,e))return!0;if(function(t,e){return!!(ge&&t.hasChildNodes()&&!An(t.firstElementChild)&&I(ut,t.textContent)&&I(ut,t.innerHTML))||!!(ge&&mt[e]&&1===jt(t)&&Mt(t)===Ue&&(An(t.firstElementChild)||"string"==typeof t.textContent&&I(ut,t.textContent)))||7===t.nodeType||!(!ge||8!==t.nodeType||!I(st,t.data))}(t,n))return ln(t),!0;if(ue[n]||!(fe.tagCheck instanceof Function&&fe.tagCheck(n))&&!oe[n]){const r=function(t,e,n){if(!ue[e]&&Ln(e)&&zn(ce.tagNameCheck,e))return!1;if(De&&!Le[e]&&!Le[S(e)]){const e=Ot(t),r=At(t);if(r&&e)for(let o=r.length-1;o>=0;--o){const i=t===n?xt(r[o],!0):r[o];e.insertBefore(i,Tt(t))}}return ln(t),!0}(t,n,e);return!(!1!==r||(On(Kt.afterSanitizeElements,t,null),!Dn(t,e)))||r}if(1===jt(t)&&!function(t){const e=Mt(t),n=S(Lt(t)),r=Ot(t);let o,i;return r&&1===jt(r)?(o={namespaceURI:Mt(r)},i=S(Lt(r))):(o={namespaceURI:Ye},i="template"),!!qe[e]&&(e===Pe?function(t,e,n){return e.namespaceURI===Ue?"svg"===t:e.namespaceURI===Be?"svg"===t&&("annotation-xml"===n||$e[n]):Boolean(on[t])}(n,o,i):e===Be?function(t,e,n){return e.namespaceURI===Ue?"math"===t:e.namespaceURI===Pe?"math"===t&&Ve[n]:Boolean(an[t])}(n,o,i):e===Ue?function(t,e,n){return!(e.namespaceURI===Pe&&!Ve[n])&&!(e.namespaceURI===Be&&!$e[n])&&!an[t]&&(Xe[t]||!on[t])}(n,o,i):!("application/xhtml+xml"!==Je||!qe[e]))}(t))return ln(t),!0;if(("noscript"===n||"noembed"===n||"noframes"===n)&&I(ft,t.innerHTML))return ln(t),!0;if(ye&&3===t.nodeType){const e=vn(t.textContent);t.textContent!==e&&(h(r.removed,{element:t.cloneNode()}),t.textContent=e)}return On(Kt.afterSanitizeElements,t,null),Dn(t,e)},_n=function(t,e,n){if(se[e])return!1;if(gn(e,t))return!1;if(Oe&&("id"===e||"name"===e)&&(n in u||n in en))return!1;const r=ae[e]||fe.attributeCheck instanceof Function&&fe.attributeCheck(e,t);return!(!me||!I(Qt,e))||!(!pe||!I(Zt,e))||(r?!(!Ce[e]&&!I(re,A(n,ee,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==O(n,"data:")||!Me[t])&&(!de||I(te,A(n,ee,"")))&&n):Ln(t)&&zn(ce.tagNameCheck,t)&&zn(ce.attributeNameCheck,e,t)||"is"===e&&ce.allowCustomizedBuiltInElements&&zn(ce.tagNameCheck,n))},jn=F({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ln=function(t){return!jn[S(t)]&&I(ne,t)},In=function(t,e,n,r){if(Nt&&"object"==typeof wt&&"function"==typeof wt.getAttributeType&&!n)switch(wt.getAttributeType(t,e)){case"TrustedHTML":return Yt(r);case"TrustedScriptURL":return function(t){Ut(),Pt++;try{return Nt.createScriptURL(t)}finally{Pt--}}(r)}return r},Mn=function(t,e,n,r){try{return n?t.setAttributeNS(n,e,r):t.setAttribute(e,r),!kn(t)||(ln(t),!1)}catch(n){return sn(e,t),!1}},Nn=function(t,e){return!(!ge||!I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,e))||"attributename"===S(t)&&null!==T(e,"href")},Cn=function(t,e){if(On(Kt.beforeSanitizeAttributes,t,null),Dn(t,e))return;const n=t.attributes;if(!n||kn(t))return;ae=En(Kt.uponSanitizeAttribute,ae,le,xe);const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0};let i=n.length;const a=Ze(t.nodeName);for(;i--;){const e=n[i],l=e.name,c=e.namespaceURI,u=e.value,s=Ze(l),f=u;let p="value"===l?f:z(f),m=!1;o.attrName=s,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,On(Kt.uponSanitizeAttribute,t,o),p=o.attrValue,!ze||"id"!==s&&"name"!==s||0===O(p,Ee)||(sn(l,t,e),p=Ee+p,m=!0),Nn(l,p)?sn(l,t,e):o.forceKeepAttr||(!o.keepAttr||!he&&I(pt,p)?sn(l,t,e):(ye&&(p=vn(p)),_n(a,s,p)?(p=In(a,s,c,p),p!==f&&Mn(t,l,c,p)&&m&&d(r.removed)):sn(l,t,e)))}On(Kt.afterSanitizeAttributes,t,null),Dn(t,e)},Fn=function(t){let e=null;const n=wn(t);for(On(Kt.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(On(Kt.uponSanitizeShadowNode,e,null),Rn(e,t),Cn(e,t),Tn(e.content)&&Fn(e.content),1===jt(e)){const t=zt(e);Tn(t)&&(Bn(t),Fn(t))}ye&&Sn(t),On(Kt.afterSanitizeShadowDOM,t,null)},Bn=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){Fn(t.shadow);continue}const n=t.node,r=1===jt(n),o=At(n);if(o)for(let t=o.length-1;t>=0;--t)e.push({node:o[t],shadow:null});if(r){const t=Rt?Rt(n):null;if("string"==typeof t&&"template"===Ze(t)){const t=n.content;Tn(t)&&e.push({node:t,shadow:null})}}if(r){const t=zt(n);Tn(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return r.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,i=null,a=null;if(Ge=!t,Ge&&(t="\x3c!--\x3e"),"string"!=typeof t&&!An(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return E(t);case"boolean":return D(t);case"bigint":return R?R(t):"0";case"symbol":return _?_(t):"Symbol()";case"undefined":default:return L(t);case"function":case"object":{if(null===t)return L(t);const e=t,n=U(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:L(t)}return L(t)}}}(t)))throw M("dirty is not a string, aborting");if(!r.isSupported)return t;we?(oe=ve,ae=xe):rn(e),(Kt.uponSanitizeElement.length>0||Kt.uponSanitizeAttribute.length>0)&&(oe=P(oe)),Kt.uponSanitizeAttribute.length>0&&(ae=P(ae)),r.removed=[];const l=Re&&"string"!=typeof t&&An(t);let c=[];const u=_e;if(l){ge&&pn(t,(t=>{const e=jt(t);if(7===e||8===e&&I(st,t.data)){try{St(t)}catch(t){}return!1}if(1===e){const e=t,n=Ze(Lt(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&gn("for",n)&&e.removeAttribute("for")}catch(t){}}return!0}));const e=Lt(t);if("string"==typeof e){const n=Ze(e);if(!oe[n]||ue[n])throw un(t),M("root node is forbidden and cannot be sanitized in-place")}if(kn(t))throw un(t),M("root node is clobbered and cannot be sanitized in-place");c=dn(t),_e=w()}else if(An(t))n=bn("\x3c!----\x3e"),o=n.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o),Bn(n);else{if(!ke&&!ye&&!be&&-1===t.indexOf("<"))return Nt&&Ae?Yt(t):t;if(n=bn(t),!n)return ke?null:Ae?Ft:""}n&&Se&&ln(n.firstChild);const f=l?t:n;try{l&&Bn(t);const e=wn(f);for(;i=e.nextNode();)Rn(i,f),Cn(i,f),Tn(i.content)&&Fn(i.content);l&&function(t,e){const n=_e;let r=null;const o=()=>(r||(r=w(),p(e,(t=>{v(r,t)}))),r);for(let e=0;;e++){const r=dn(t),i=[t];let a=!1;if(p(r,(t=>{11===jt(t)?h(i,t):a||x(n,t)||(a=x(o(),t))})),!a)return;if(e>=8)throw M("the tree kept changing during in-place sanitization; refusing to return it");p(i,((e,n)=>{yn(e,n>0,t,o())}))}}(t,c)}catch(e){throw l&&(un(t),hn(t,c)),e}finally{_e=u}if(l){if(hn(t,c))throw M("a node selected for removal could not be safely returned; refusing to sanitize in place");return ye&&xn(t),t}if(ke){if(ye&&xn(n),Te)for(a=Ht.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return(ae.shadowroot||ae.shadowrootmode)&&(a=$t.call(s,a,!0)),a}let m=be?n.outerHTML:n.innerHTML;return be&&oe["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&I(lt,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ye&&(m=vn(m)),Nt&&Ae?Yt(m):m},r.setConfig=function(){rn(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),we=!0,ve=oe,xe=ae},r.clearConfig=function(){tn=null,we=!1,ve=null,xe=null,Nt=Ct,Ft=""},r.isValidAttribute=function(t,e,n){tn||rn({});const r=Ze(t),o=Ze(e);return("string"!=typeof n||!(Nn(e,n)||!he&&I(pt,n)))&&_n(r,o,n)},r.addHook=function(t,e){"function"==typeof e&&j(Kt,t)&&h(Kt[t],e)},r.removeHook=function(t,e){if(j(Kt,t)){if(void 0!==e){const n=m(Kt[t],e);return-1===n?void 0:g(Kt[t],n,1)[0]}return d(Kt[t])}},r.removeHooks=function(t){j(Kt,t)&&(Kt[t]=[])},r.removeAllHooks=function(){Kt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},r}();export{gt as default}