@accounter/client
Version:
Accounter client application
3 lines • 23.7 kB
JavaScript
function e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function r(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,i){return t(e)||n(e,i)||a(e,i)||r()}function a(t,n){if(t){if(typeof t==`string`)return e(t,n);var r={}.toString.call(t).slice(8,-1);return r===`Object`&&t.constructor&&(r=t.constructor.name),r===`Map`||r===`Set`?Array.from(t):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var o=Object.entries,s=Object.setPrototypeOf,c=Object.isFrozen,l=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,d=Object.freeze,f=Object.seal,p=Object.create,ee=typeof Reflect<`u`&&Reflect,te=ee.apply,ne=ee.construct;d||=function(e){return e},f||=function(e){return e},te||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ne||=function(e){return new e(...[...arguments].slice(1))};var m=w(Array.prototype.forEach),re=w(Array.prototype.lastIndexOf),ie=w(Array.prototype.pop),h=w(Array.prototype.push),ae=w(Array.prototype.splice),g=Array.isArray,_=w(String.prototype.toLowerCase),oe=w(String.prototype.toString),se=w(String.prototype.match),v=w(String.prototype.replace),ce=w(String.prototype.indexOf),le=w(String.prototype.trim),y=w(Number.prototype.toString),b=w(Boolean.prototype.toString),ue=typeof BigInt>`u`?null:w(BigInt.prototype.toString),de=typeof Symbol>`u`?null:w(Symbol.prototype.toString),x=w(Object.prototype.hasOwnProperty),S=w(Object.prototype.toString),C=w(RegExp.prototype.test),fe=T(TypeError);function w(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return te(e,t,n)}}function T(e){return function(){return ne(e,[...arguments])}}function E(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_;if(s&&s(e,null),!g(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(c(t)||(t[r]=e),i=e)}e[i]=!0}return e}function pe(e){for(let t=0;t<e.length;t++)x(e,t)||(e[t]=null);return e}function D(e){let t=p(null);for(let r of o(e)){var n=i(r,2);let a=n[0],o=n[1];x(e,a)&&(g(o)?t[a]=pe(o):o&&typeof o==`object`&&o.constructor===Object?t[a]=D(o):t[a]=o)}return t}function me(e){switch(typeof e){case`string`:return e;case`number`:return y(e);case`boolean`:return b(e);case`bigint`:return ue?ue(e):`0`;case`symbol`:return de?de(e):`Symbol()`;case`undefined`:return S(e);case`function`:case`object`:{if(e===null)return S(e);let t=e,n=O(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:S(e)}return S(e)}default:return S(e)}}function O(e,t){for(;e!==null;){let n=u(e,t);if(n){if(n.get)return w(n.get);if(typeof n.value==`function`)return w(n.value)}e=l(e)}function n(){return null}return n}function he(e){try{return C(e,``),!0}catch{return!1}}var ge=d(`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`.split(`.`)),_e=d(`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`.split(`.`)),ve=d([`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`]),ye=d([`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`]),be=d(`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`.split(`.`)),xe=d([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Se=d([`#text`]),Ce=d(`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`.split(`.`)),we=d(`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`.split(`.`)),Te=d(`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`.split(`.`)),Ee=d([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),De=f(/{{[\w\W]*|^[\w\W]*}}/g),Oe=f(/<%[\w\W]*|^[\w\W]*%>/g),ke=f(/\${[\w\W]*/g),Ae=f(/^data-[\-\w.\u00B7-\uFFFF]+$/),je=f(/^aria-[\-\w]+$/),Me=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ne=f(/^(?:\w+script|data):/i),Pe=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fe=f(/^html$/i),Ie=f(/^[a-z][.\w]*(-[.\w]+)+$/i),k={element:1,text:3,progressingInstruction:7,comment:8,document:9},Le=function(){return typeof window>`u`?null:window},Re=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ze=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Be(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Le(),t=e=>Be(e);if(t.version=`3.4.5`,t.removed=[],!e||!e.document||e.document.nodeType!==k.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.DocumentFragment,s=e.HTMLTemplateElement,c=e.Node,l=e.Element,u=e.NodeFilter,f=e.NamedNodeMap,ee=f===void 0?e.NamedNodeMap||e.MozNamedAttrMap:f,te=e.HTMLFormElement,ne=e.DOMParser,y=e.trustedTypes,b=l.prototype,ue=O(b,`cloneNode`),de=O(b,`remove`),S=O(b,`nextSibling`),w=O(b,`childNodes`),T=O(b,`parentNode`),pe=c&&c.prototype?O(c.prototype,`nodeType`):null;if(typeof s==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let A,j=``,Ve=n,He=Ve.implementation,Ue=Ve.createNodeIterator,We=Ve.createDocumentFragment,Ge=Ve.getElementsByTagName,Ke=r.importNode,M=ze();t.isSupported=typeof o==`function`&&typeof T==`function`&&He&&He.createHTMLDocument!==void 0;let qe=De,Je=Oe,Ye=ke,Xe=Ae,Ze=je,Qe=Ne,$e=Pe,et=Ie,tt=Me,N=null,nt=E({},[...ge,..._e,...ve,...be,...Se]),P=null,rt=E({},[...Ce,...we,...Te,...Ee]),F=Object.seal(p(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}})),I=null,it=null,L=Object.seal(p(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),at=!0,ot=!0,st=!1,ct=!0,R=!1,z=!0,B=!1,lt=!1,ut=!1,V=!1,dt=!1,ft=!1,pt=!0,mt=!1,ht=`user-content-`,gt=!0,H=!1,U={},W=null,_t=E({},[`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`]),vt=null,yt=E({},[`audio`,`video`,`img`,`source`,`image`,`track`]),bt=null,xt=E({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),St=`http://www.w3.org/1998/Math/MathML`,Ct=`http://www.w3.org/2000/svg`,G=`http://www.w3.org/1999/xhtml`,K=G,wt=!1,Tt=null,Et=E({},[St,Ct,G],oe),Dt=E({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ot=E({},[`annotation-xml`]),kt=E({},[`title`,`style`,`font`,`a`,`script`]),q=null,At=[`application/xhtml+xml`,`text/html`],J=null,Y=null,jt=n.createElement(`form`),Mt=function(e){return e instanceof RegExp||e instanceof Function},Nt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Y&&Y===e)return;(!e||typeof e!=`object`)&&(e={}),e=D(e),q=At.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,J=q===`application/xhtml+xml`?oe:_,N=x(e,`ALLOWED_TAGS`)&&g(e.ALLOWED_TAGS)?E({},e.ALLOWED_TAGS,J):nt,P=x(e,`ALLOWED_ATTR`)&&g(e.ALLOWED_ATTR)?E({},e.ALLOWED_ATTR,J):rt,Tt=x(e,`ALLOWED_NAMESPACES`)&&g(e.ALLOWED_NAMESPACES)?E({},e.ALLOWED_NAMESPACES,oe):Et,bt=x(e,`ADD_URI_SAFE_ATTR`)&&g(e.ADD_URI_SAFE_ATTR)?E(D(xt),e.ADD_URI_SAFE_ATTR,J):xt,vt=x(e,`ADD_DATA_URI_TAGS`)&&g(e.ADD_DATA_URI_TAGS)?E(D(yt),e.ADD_DATA_URI_TAGS,J):yt,W=x(e,`FORBID_CONTENTS`)&&g(e.FORBID_CONTENTS)?E({},e.FORBID_CONTENTS,J):_t,I=x(e,`FORBID_TAGS`)&&g(e.FORBID_TAGS)?E({},e.FORBID_TAGS,J):D({}),it=x(e,`FORBID_ATTR`)&&g(e.FORBID_ATTR)?E({},e.FORBID_ATTR,J):D({}),U=x(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?D(e.USE_PROFILES):e.USE_PROFILES:!1,at=e.ALLOW_ARIA_ATTR!==!1,ot=e.ALLOW_DATA_ATTR!==!1,st=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ct=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,R=e.SAFE_FOR_TEMPLATES||!1,z=e.SAFE_FOR_XML!==!1,B=e.WHOLE_DOCUMENT||!1,V=e.RETURN_DOM||!1,dt=e.RETURN_DOM_FRAGMENT||!1,ft=e.RETURN_TRUSTED_TYPE||!1,ut=e.FORCE_BODY||!1,pt=e.SANITIZE_DOM!==!1,mt=e.SANITIZE_NAMED_PROPS||!1,gt=e.KEEP_CONTENT!==!1,H=e.IN_PLACE||!1,tt=he(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Me,K=typeof e.NAMESPACE==`string`?e.NAMESPACE:G,Dt=x(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?D(e.MATHML_TEXT_INTEGRATION_POINTS):E({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ot=x(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?D(e.HTML_INTEGRATION_POINTS):E({},[`annotation-xml`]);let t=x(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?D(e.CUSTOM_ELEMENT_HANDLING):p(null);if(F=p(null),x(t,`tagNameCheck`)&&Mt(t.tagNameCheck)&&(F.tagNameCheck=t.tagNameCheck),x(t,`attributeNameCheck`)&&Mt(t.attributeNameCheck)&&(F.attributeNameCheck=t.attributeNameCheck),x(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(F.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),R&&(ot=!1),dt&&(V=!0),U&&(N=E({},Se),P=p(null),U.html===!0&&(E(N,ge),E(P,Ce)),U.svg===!0&&(E(N,_e),E(P,we),E(P,Ee)),U.svgFilters===!0&&(E(N,ve),E(P,we),E(P,Ee)),U.mathMl===!0&&(E(N,be),E(P,Te),E(P,Ee))),L.tagCheck=null,L.attributeCheck=null,x(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?L.tagCheck=e.ADD_TAGS:g(e.ADD_TAGS)&&(N===nt&&(N=D(N)),E(N,e.ADD_TAGS,J))),x(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?L.attributeCheck=e.ADD_ATTR:g(e.ADD_ATTR)&&(P===rt&&(P=D(P)),E(P,e.ADD_ATTR,J))),x(e,`ADD_URI_SAFE_ATTR`)&&g(e.ADD_URI_SAFE_ATTR)&&E(bt,e.ADD_URI_SAFE_ATTR,J),x(e,`FORBID_CONTENTS`)&&g(e.FORBID_CONTENTS)&&(W===_t&&(W=D(W)),E(W,e.FORBID_CONTENTS,J)),x(e,`ADD_FORBID_CONTENTS`)&&g(e.ADD_FORBID_CONTENTS)&&(W===_t&&(W=D(W)),E(W,e.ADD_FORBID_CONTENTS,J)),gt&&(N[`#text`]=!0),B&&E(N,[`html`,`head`,`body`]),N.table&&(E(N,[`tbody`]),delete I.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw fe(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw fe(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);A=e.TRUSTED_TYPES_POLICY,j=A.createHTML(``)}else A===void 0&&(A=Re(y,i)),A!==null&&typeof j==`string`&&(j=A.createHTML(``));d&&d(e),Y=e},Pt=E({},[..._e,...ve,...ye]),Ft=E({},[...be,...xe]),It=function(e){let t=T(e);(!t||!t.tagName)&&(t={namespaceURI:K,tagName:`template`});let n=_(e.tagName),r=_(t.tagName);return Tt[e.namespaceURI]?e.namespaceURI===Ct?t.namespaceURI===G?n===`svg`:t.namespaceURI===St?n===`svg`&&(r===`annotation-xml`||Dt[r]):!!Pt[n]:e.namespaceURI===St?t.namespaceURI===G?n===`math`:t.namespaceURI===Ct?n===`math`&&Ot[r]:!!Ft[n]:e.namespaceURI===G?t.namespaceURI===Ct&&!Ot[r]||t.namespaceURI===St&&!Dt[r]?!1:!Ft[n]&&(kt[n]||!Pt[n]):!!(q===`application/xhtml+xml`&&Tt[e.namespaceURI]):!1},X=function(e){h(t.removed,{element:e});try{T(e).removeChild(e)}catch{de(e)}},Z=function(e,n){try{h(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{h(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(V||dt)try{X(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Lt=function(e){let t=null,r=null;if(ut)e=`<remove></remove>`+e;else{let t=se(e,/^[\r\n\t ]+/);r=t&&t[0]}q===`application/xhtml+xml`&&K===G&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=A?A.createHTML(e):e;if(K===G)try{t=new ne().parseFromString(i,q)}catch{}if(!t||!t.documentElement){t=He.createDocument(K,`template`,null);try{t.documentElement.innerHTML=wt?j:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),K===G?Ge.call(t,B?`html`:`body`)[0]:B?t.documentElement:a},Rt=function(e){return Ue.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},zt=function(e){e.normalize();let t=Ue.call(e.ownerDocument||e,e,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;m([qe,Je,Ye],t=>{e=v(e,t,` `)}),n.data=e,n=t.nextNode()}},Bt=function(e){return e instanceof te&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof ee)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Vt=function(e){if(!pe||typeof e!=`object`||!e)return!1;try{return typeof pe(e)==`number`}catch{return!1}};function Q(e,n,r){m(e,e=>{e.call(t,n,r,Y)})}let Ht=function(e){let n=null;if(Q(M.beforeSanitizeElements,e,null),Bt(e))return X(e),!0;let r=J(e.nodeName);if(Q(M.uponSanitizeElement,e,{tagName:r,allowedTags:N}),z&&e.hasChildNodes()&&!Vt(e.firstElementChild)&&C(/<[/\w!]/g,e.innerHTML)&&C(/<[/\w!]/g,e.textContent)||z&&e.namespaceURI===G&&r===`style`&&Vt(e.firstElementChild)||e.nodeType===k.progressingInstruction||z&&e.nodeType===k.comment&&C(/<[/\w]/g,e.data))return X(e),!0;if(I[r]||!(L.tagCheck instanceof Function&&L.tagCheck(r))&&!N[r]){if(!I[r]&&Gt(r)&&(F.tagNameCheck instanceof RegExp&&C(F.tagNameCheck,r)||F.tagNameCheck instanceof Function&&F.tagNameCheck(r)))return!1;if(gt&&!W[r]){let t=T(e)||e.parentNode,n=w(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=ue(n[i],!0);t.insertBefore(r,S(e))}}}return X(e),!0}return e instanceof l&&!It(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&C(/<\/no(script|embed|frames)/i,e.innerHTML)?(X(e),!0):(R&&e.nodeType===k.text&&(n=e.textContent,m([qe,Je,Ye],e=>{n=v(n,e,` `)}),e.textContent!==n&&(h(t.removed,{element:e.cloneNode()}),e.textContent=n)),Q(M.afterSanitizeElements,e,null),!1)},Ut=function(e,t,r){if(it[t]||pt&&(t===`id`||t===`name`)&&(r in n||r in jt))return!1;let i=P[t]||L.attributeCheck instanceof Function&&L.attributeCheck(t,e);if(!(ot&&!it[t]&&C(Xe,t))&&!(at&&C(Ze,t))){if(!i||it[t]){if(!(Gt(e)&&(F.tagNameCheck instanceof RegExp&&C(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&C(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t,e))||t===`is`&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&C(F.tagNameCheck,r)||F.tagNameCheck instanceof Function&&F.tagNameCheck(r))))return!1}else if(!bt[t]&&!C(tt,v(r,$e,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ce(r,`data:`)===0&&vt[e])&&!(st&&!C(Qe,v(r,$e,``)))&&r)return!1}return!0},Wt=E({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Gt=function(e){return!Wt[_(e)]&&C(et,e)},Kt=function(e){Q(M.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||Bt(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=J(o),u=c,d=o===`value`?u:le(u);if(r.attrName=l,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Q(M.uponSanitizeAttribute,e,r),d=r.attrValue,mt&&(l===`id`||l===`name`)&&ce(d,ht)!==0&&(Z(o,e),d=ht+d),z&&C(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){Z(o,e);continue}if(l===`attributename`&&se(d,`href`)){Z(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Z(o,e);continue}if(!ct&&C(/\/>/i,d)){Z(o,e);continue}R&&m([qe,Je,Ye],e=>{d=v(d,e,` `)});let f=J(e.nodeName);if(!Ut(f,l,d)){Z(o,e);continue}if(A&&typeof y==`object`&&typeof y.getAttributeType==`function`&&!s)switch(y.getAttributeType(f,l)){case`TrustedHTML`:d=A.createHTML(d);break;case`TrustedScriptURL`:d=A.createScriptURL(d);break}if(d!==u)try{s?e.setAttributeNS(s,o,d):e.setAttribute(o,d),Bt(e)?X(e):ie(t.removed)}catch{Z(o,e)}}Q(M.afterSanitizeAttributes,e,null)},qt=function(e){let t=null,n=Rt(e);for(Q(M.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)Q(M.uponSanitizeShadowNode,t,null),Ht(t),Kt(t),t.content instanceof a&&qt(t.content);Q(M.afterSanitizeShadowDOM,e,null)},$=function(e){if(e.nodeType===k.element&&e.shadowRoot instanceof a){let t=e.shadowRoot;$(t),qt(t)}let t=e.childNodes;if(!t)return;let n=[];m(t,e=>{h(n,e)});for(let e of n)$(e)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,s=null,c=null;if(wt=!e,wt&&(e=`<!-->`),typeof e!=`string`&&!Vt(e)&&(e=me(e),typeof e!=`string`))throw fe(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(lt||Nt(n),t.removed=[],typeof e==`string`&&(H=!1),H){let t=e.nodeName;if(typeof t==`string`){let e=J(t);if(!N[e]||I[e])throw fe(`root node is forbidden and cannot be sanitized in-place`)}$(e)}else if(Vt(e))i=Lt(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===k.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o),$(o);else{if(!V&&!R&&!B&&e.indexOf(`<`)===-1)return A&&ft?A.createHTML(e):e;if(i=Lt(e),!i)return V?null:ft?j:``}i&&ut&&X(i.firstChild);let l=Rt(H?e:i);for(;s=l.nextNode();)Ht(s),Kt(s),s.content instanceof a&&qt(s.content);if(H)return R&&zt(e),e;if(V){if(R&&zt(i),dt)for(c=We.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(P.shadowroot||P.shadowrootmode)&&(c=Ke.call(r,c,!0)),c}let u=B?i.outerHTML:i.innerHTML;return B&&N[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&C(Fe,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
`+u),R&&m([qe,Je,Ye],e=>{u=v(u,e,` `)}),A&&ft?A.createHTML(u):u},t.setConfig=function(){Nt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),lt=!0},t.clearConfig=function(){Y=null,lt=!1},t.isValidAttribute=function(e,t,n){return Y||Nt({}),Ut(J(e),J(t),n)},t.addHook=function(e,t){typeof t==`function`&&h(M[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=re(M[e],t);return n===-1?void 0:ae(M[e],n,1)[0]}return ie(M[e])},t.removeHooks=function(e){M[e]=[]},t.removeAllHooks=function(){M=ze()},t}var A=Be();export{A as default};