html-react-parser 5.2.17 → 6.0.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.
- package/dist/html-react-parser.js +683 -794
- package/dist/html-react-parser.js.map +1 -1
- package/dist/html-react-parser.min.js +1 -1
- package/dist/html-react-parser.min.js.map +1 -1
- package/lib/attributes-to-props.js +13 -14
- package/lib/attributes-to-props.js.map +1 -1
- package/lib/dom-to-react.js +17 -18
- package/lib/dom-to-react.js.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/utilities.d.ts +1 -1
- package/lib/utilities.js +6 -8
- package/lib/utilities.js.map +1 -1
- package/package.json +28 -28
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).HTMLReactParser=t(e.React)}(this,function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r,o={},i={},a={},l={},s={},c={};function u(){return r||(r=1,e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(t=e.ElementType||(e.ElementType={})),e.isTag=function(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style},e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype),c;var e,t}var d,p,f={};function h(){if(d)return f;d=1;var e,t=f&&f.__extends||(e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),n=f&&f.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(f,"__esModule",{value:!0}),f.cloneNode=f.hasChildren=f.isDocument=f.isDirective=f.isComment=f.isText=f.isCDATA=f.isTag=f.Element=f.Document=f.CDATA=f.NodeWithChildren=f.ProcessingInstruction=f.Comment=f.Text=f.DataNode=f.Node=void 0;var r=u(),o=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),T(this,e)},e}();f.Node=o;var i=function(e){function n(t){var n=e.call(this)||this;return n.data=t,n}return t(n,e),Object.defineProperty(n.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),n}(o);f.DataNode=i;var a=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=r.ElementType.Text,t}return t(n,e),Object.defineProperty(n.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),n}(i);f.Text=a;var l=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=r.ElementType.Comment,t}return t(n,e),Object.defineProperty(n.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),n}(i);f.Comment=l;var s=function(e){function n(t,n){var o=e.call(this,n)||this;return o.name=t,o.type=r.ElementType.Directive,o}return t(n,e),Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),n}(i);f.ProcessingInstruction=s;var c=function(e){function n(t){var n=e.call(this)||this;return n.children=t,n}return t(n,e),Object.defineProperty(n.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),n}(o);f.NodeWithChildren=c;var p=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=r.ElementType.CDATA,t}return t(n,e),Object.defineProperty(n.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),n}(c);f.CDATA=p;var h=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=r.ElementType.Root,t}return t(n,e),Object.defineProperty(n.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),n}(c);f.Document=h;var m=function(e){function n(t,n,o,i){void 0===o&&(o=[]),void 0===i&&(i="script"===t?r.ElementType.Script:"style"===t?r.ElementType.Style:r.ElementType.Tag);var a=e.call(this,o)||this;return a.name=t,a.attribs=n,a.type=i,a}return t(n,e),Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}})},enumerable:!1,configurable:!0}),n}(c);function g(e){return(0,r.isTag)(e)}function y(e){return e.type===r.ElementType.CDATA}function v(e){return e.type===r.ElementType.Text}function E(e){return e.type===r.ElementType.Comment}function b(e){return e.type===r.ElementType.Directive}function x(e){return e.type===r.ElementType.Root}function T(e,t){var r;if(void 0===t&&(t=!1),v(e))r=new a(e.data);else if(E(e))r=new l(e.data);else if(g(e)){var o=t?_(e.children):[],i=new m(e.name,n({},e.attribs),o);o.forEach(function(e){return e.parent=i}),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=n({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=n({},e["x-attribsPrefix"])),r=i}else if(y(e)){o=t?_(e.children):[];var c=new p(o);o.forEach(function(e){return e.parent=c}),r=c}else if(x(e)){o=t?_(e.children):[];var u=new h(o);o.forEach(function(e){return e.parent=u}),e["x-mode"]&&(u["x-mode"]=e["x-mode"]),r=u}else{if(!b(e))throw new Error("Not implemented yet: ".concat(e.type));var d=new s(e.name,e.data);null!=e["x-name"]&&(d["x-name"]=e["x-name"],d["x-publicId"]=e["x-publicId"],d["x-systemId"]=e["x-systemId"]),r=d}return r.startIndex=e.startIndex,r.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(r.sourceCodeLocation=e.sourceCodeLocation),r}function _(e){for(var t=e.map(function(e){return T(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}return f.Element=m,f.isTag=g,f.isCDATA=y,f.isText=v,f.isComment=E,f.isDirective=b,f.isDocument=x,f.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},f.cloneNode=T,f}function m(){return p||(p=1,function(e){var t=s&&s.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=s&&s.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=u(),o=h();n(h(),e);var i={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},a=function(){function e(e,t,n){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=i),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:i,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?r.ElementType.Tag:void 0,i=new o.Element(e,t,void 0,n);this.addNode(i),this.tagStack.push(i)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===r.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new o.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment)this.lastNode.data+=e;else{var t=new o.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new o.Text(""),t=new o.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new o.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();e.DomHandler=a,e.default=a}(s)),s}var g,y,v,E,b={};function x(){if(y)return l;y=1,Object.defineProperty(l,"__esModule",{value:!0}),l.formatAttributes=r,l.hasOpenTag=function(e,t){var n="<"+t,r=e.toLowerCase().indexOf(n);if(-1===r)return!1;var o=e[r+n.length];return">"===o||" "===o||"\t"===o||"\n"===o||"\r"===o||"/"===o},l.escapeSpecialCharacters=function(e){return e.replace(n.CARRIAGE_RETURN_REGEX,n.CARRIAGE_RETURN_PLACEHOLDER)},l.revertEscapedCharacters=i,l.formatDOM=function e(n,a,l){var s,c,u,d;void 0===a&&(a=null);for(var p,f=[],h=0,m=n.length;h<m;h++){var g=n[h];switch(g.nodeType){case 1:var y=o(g.nodeName);(p=new t.Element(y,r(g.attributes))).children=e("template"===y?g.content.childNodes:g.childNodes,p);break;case 3:p=new t.Text(i(null!==(s=g.nodeValue)&&void 0!==s?s:""));break;case 8:p=new t.Comment(null!==(c=g.nodeValue)&&void 0!==c?c:"");break;default:continue}var v=null!==(u=f[h-1])&&void 0!==u?u:null;v&&(v.next=p),p.parent=a,p.prev=v,p.next=null,f.push(p)}l&&((p=new t.ProcessingInstruction(l.substring(0,l.indexOf(" ")).toLowerCase(),l)).next=null!==(d=f[0])&&void 0!==d?d:null,p.parent=a,f.unshift(p),f[1]&&(f[1].prev=f[0]));return f};var e,t=m(),n=(g||(g=1,e=b,Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(),"__"),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")),b);function r(e){for(var t={},n=0,r=e.length;n<r;n++){var o=e[n];t[o.name]=o.value}return t}function o(e){var t=function(e){return n.CASE_SENSITIVE_TAG_NAMES_MAP[e]}(e=e.toLowerCase());return t||e}function i(e){return e.replace(n.CARRIAGE_RETURN_PLACEHOLDER_REGEX,n.CARRIAGE_RETURN)}return l}function T(){if(E)return i;E=1;var e=i&&i.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var o=r.exec(e),i=o?o[1]:void 0;return(0,n.formatDOM)((0,t.default)(e),null,i)};var t=e(function(){if(v)return a;v=1,Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(a){var s,c,u,p,h,m;a=(0,e.escapeSpecialCharacters)(a);var g=o.exec(a),y=null===(s=null==g?void 0:g[1])||void 0===s?void 0:s.toLowerCase();switch(y){case t:var v=l(a);return(0,e.hasOpenTag)(a,n)||null===(c=null==(b=v.querySelector(n))?void 0:b.parentNode)||void 0===c||c.removeChild(b),(0,e.hasOpenTag)(a,r)||null===(u=null==(b=v.querySelector(r))?void 0:b.parentNode)||void 0===u||u.removeChild(b),v.querySelectorAll(t);case n:case r:var E=i(a).querySelectorAll(y);return(0,e.hasOpenTag)(a,r)&&(0,e.hasOpenTag)(a,n)?null!==(h=null===(p=E[0].parentNode)||void 0===p?void 0:p.childNodes)&&void 0!==h?h:f():E;default:return d?d(a):null!==(m=null==(b=i(a,r).querySelector(r))?void 0:b.childNodes)&&void 0!==m?m:f();var b}};var e=x(),t="html",n="head",r="body",o=/<([a-zA-Z]+[0-9]?)/,i=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},l=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},s="object"==typeof window&&window.DOMParser;if("function"==typeof s){var c=new s;i=l=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),c.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var u=document.implementation.createHTMLDocument();i=function(e,t){if(t){var n=u.documentElement.querySelector(t);return n&&(n.innerHTML=e),u}return u.documentElement.innerHTML=e,u}}var d,p="object"==typeof document&&document.createElement("template");p&&p.content&&(d=function(e){return p.innerHTML=e,p.content.childNodes});var f=function(){return document.createDocumentFragment().childNodes};return a}()),n=x(),r=/<(![a-zA-Z\s]+)>/;return i}var _,k,C={},A={},w={};function R(){if(_)return w;_=1;w.SAME=0;return w.CAMELCASE=1,w.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1},w}var S,O,P,N={},I={};function D(){if(P)return I;P=1;var e=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(e,n){let r=null;if(!e||"string"!=typeof e)return r;const o=(0,t.default)(e),i="function"==typeof n;return o.forEach(e=>{if("declaration"!==e.type)return;const{property:t,value:o}=e;i?n(t,o,e):o&&(r=r||{},r[t]=o)}),r};const t=e(function(){if(O)return S;O=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,s="";function c(e){return e?e.replace(l,s):s}return S=function(l,u){if("string"!=typeof l)throw new TypeError("First argument must be a string");if(!l)return[];u=u||{};var d=1,p=1;function f(e){var n=e.match(t);n&&(d+=n.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),v(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=u.source}function g(e){var t=new Error(u.source+":"+d+":"+p+": "+e);if(t.reason=e,t.filename=u.source,t.line=d,t.column=p,t.source=l,!u.silent)throw t}function y(e){var t=e.exec(l);if(t){var n=t[0];return f(n),l=l.slice(n.length),t}}function v(){y(n)}function E(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var e=h();if("/"==l.charAt(0)&&"*"==l.charAt(1)){for(var t=2;s!=l.charAt(t)&&("*"!=l.charAt(t)||"/"!=l.charAt(t+1));)++t;if(t+=2,s===l.charAt(t-1))return g("End of comment missing");var n=l.slice(2,t-2);return p+=2,f(n),l=l.slice(t),p+=2,e({type:"comment",comment:n})}}function x(){var t=h(),n=y(r);if(n){if(b(),!y(o))return g("property missing ':'");var l=y(i),u=t({type:"declaration",property:c(n[0].replace(e,s)),value:l?c(l[0].replace(e,s)):s});return y(a),u}}return m.prototype.content=l,v(),function(){var e,t=[];for(E(t);e=x();)!1!==e&&(t.push(e),E(t));return t}()},S}());return I}var M,L,j,F,H,U={};function z(){if(M)return U;M=1,Object.defineProperty(U,"__esModule",{value:!0}),U.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(e,t){return t.toUpperCase()},a=function(e,t){return"".concat(t,"-")};return U.camelCase=function(l,s){return void 0===s&&(s={}),function(t){return!t||n.test(t)||e.test(t)}(l)?l:(l=l.toLowerCase(),(l=s.reactCompat?l.replace(o,a):l.replace(r,a)).replace(t,i))},U}function B(){return F||(F=1,function(t){var n=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){if(!e.includes("-"))return Boolean(t&&"string"==typeof t.is);if(i.has(e))return!1;return!0},t.setStyleProp=function(e,t){if("string"!=typeof e)return;if(!e.trim())return void(t.style={});try{t.style=(0,o.default)(e,a)}catch(e){t.style={}}};var r=e,o=n(function(){if(j)return L;j=1;var e=(L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(D()),t=z();function n(n,r){var o={};return n&&"string"==typeof n?((0,e.default)(n,function(e,n){e&&n&&(o[(0,t.camelCase)(e,r)]=n)}),o):o}return n.default=n,L=n}()),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);var a={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(r.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)};t.returnFirstArg=function(e){return e}}(N)),N}function G(){if(H)return C;H=1,Object.defineProperty(C,"__esModule",{value:!0}),C.default=function(a,l){void 0===a&&(a={});var s={},c=Boolean(a.type&&o[a.type]);for(var u in a){var d=a[u];if((0,e.isCustomAttribute)(u))s[u]=d;else{var p=u.toLowerCase(),f=i(p);if(f){var h=(0,e.getPropertyInfo)(f);switch(n.includes(f)&&r.includes(l)&&!c&&(f=i("default"+p)),s[f]=d,null==h?void 0:h.type){case e.BOOLEAN:s[f]=!0;break;case e.OVERLOADED_BOOLEAN:""===d&&(s[f]=!0)}}else t.PRESERVE_CUSTOM_ATTRIBUTES&&(s[u]=d)}}return(0,t.setStyleProp)(a.style,s),s};var e=function(){if(k)return A;function e(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}k=1;const t={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(n=>{t[n]=new e(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([n,r])=>{t[n]=new e(n,1,!1,r,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(n=>{t[n]=new e(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(n=>{t[n]=new e(n,2,!1,n,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(n=>{t[n]=new e(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(n=>{t[n]=new e(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(n=>{t[n]=new e(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(n=>{t[n]=new e(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(n=>{t[n]=new e(n,5,!1,n.toLowerCase(),null,!1,!1)});const n=/[\-\:]([a-z])/g,r=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(o=>{const i=o.replace(n,r);t[i]=new e(i,1,!1,o,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(o=>{const i=o.replace(n,r);t[i]=new e(i,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(o=>{const i=o.replace(n,r);t[i]=new e(i,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(n=>{t[n]=new e(n,1,!1,n.toLowerCase(),null,!1,!1)}),t.xlinkHref=new e("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(n=>{t[n]=new e(n,1,!1,n.toLowerCase(),null,!0,!0)});const{CAMELCASE:o,SAME:i,possibleStandardNames:a}=R(),l=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),s=Object.keys(a).reduce((e,t)=>{const n=a[t];return n===i?e[t]=t:n===o?e[t.toLowerCase()]=t:e[t]=n,e},{});return A.BOOLEAN=3,A.BOOLEANISH_STRING=2,A.NUMERIC=5,A.OVERLOADED_BOOLEAN=4,A.POSITIVE_NUMERIC=6,A.RESERVED=0,A.STRING=1,A.getPropertyInfo=function(e){return t.hasOwnProperty(e)?t[e]:null},A.isCustomAttribute=l,A.possibleStandardNames=s,A}(),t=B(),n=["checked","value"],r=["input","select","textarea"],o={reset:!0,submit:!0};function i(t){return e.possibleStandardNames[t]}return C}var V,X,q={};var W=(X||(X=1,function(t){var n=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){var n;if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,a.default)((0,r.default)(e,null!==(n=null==t?void 0:t.htmlparser2)&&void 0!==n?n:s),t):[]};var r=n(T());t.htmlToDOM=r.default;var i=n(G());t.attributesToProps=i.default;var a=n(function(){if(V)return q;V=1;var t=q&&q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q,"__esModule",{value:!0}),q.default=function e(t,n){var l,s,c,u,d;void 0===n&&(n={});for(var p=[],f="function"==typeof n.replace,h=null!==(l=n.transform)&&void 0!==l?l:o.returnFirstArg,m=null!==(s=n.library)&&void 0!==s?s:i,g=m.cloneElement,y=m.createElement,v=m.isValidElement,E=t.length,b=0;b<E;b++){var x=t[b];if(f){var T=null===(c=n.replace)||void 0===c?void 0:c.call(n,x,b);if(v(T)){E>1&&(T=g(T,{key:null!==(u=T.key)&&void 0!==u?u:b})),p.push(h(T,x,b));continue}}if("text"!==x.type){var _=x,k={};a(_)?((0,o.setStyleProp)(_.attribs.style,_.attribs),k=_.attribs):_.attribs&&(k=(0,r.default)(_.attribs,_.name));var C=void 0;switch(x.type){case"script":case"style":x.children[0]&&(k.dangerouslySetInnerHTML={__html:x.children[0].data});break;case"tag":"textarea"===x.name&&x.children[0]?k.defaultValue=x.children[0].data:(null===(d=x.children)||void 0===d?void 0:d.length)&&(C=e(x.children,n));break;default:continue}E>1&&(k.key=b),p.push(h(y(x.name,k,C),x,b))}else{var A=!x.data.trim().length;if(A&&x.parent&&!(0,o.canTextBeChildOfNode)(x.parent))continue;if(n.trim&&A)continue;p.push(h(x.data,x,b))}}return 1===p.length?p[0]:p};var n=e,r=t(G()),o=B(),i={cloneElement:n.cloneElement,createElement:n.createElement,isValidElement:n.isValidElement};function a(e){return o.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,o.isCustomComponent)(e.name,e.attribs)}return q}());t.domToReact=a.default;var l=m();Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return l.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return l.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return l.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return l.Text}});var s={lowerCaseAttributeNames:!1}}(o)),o),Y=n(W),Z=t({__proto__:null,default:Y},[W]);const $=Y;return Object.assign($,Z),$});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).HTMLReactParser=t(e.React)}(this,function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var o,i={},a={},s={},l={};!function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(o||(o={})),o.Root,o.Text,o.Directive,o.Comment,o.Script,o.Style,o.Tag,o.CDATA,o.Doctype;class c{parent=null;prev=null;next=null;startIndex=null;endIndex=null;get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return T(this,e)}}class u extends c{data;constructor(e){super(),this.data=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e}}class d extends u{type=o.Text;get nodeType(){return 3}}class p extends u{type=o.Comment;get nodeType(){return 8}}class f extends u{type=o.Directive;name;constructor(e,t){super(t),this.name=e}get nodeType(){return 1}"x-name";"x-publicId";"x-systemId"}class h extends c{children;constructor(e){super(),this.children=e}get firstChild(){return this.children[0]??null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}}class m extends h{type=o.CDATA;get nodeType(){return 4}}class g extends h{type=o.Root;get nodeType(){return 9}}class y extends h{name;attribs;type;constructor(e,t,n=[],r=("script"===e?o.Script:"style"===e?o.Style:o.Tag)){super(n),this.name=e,this.attribs=t,this.type=r}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map(e=>({name:e,value:this.attribs[e],namespace:this["x-attribsNamespace"]?.[e],prefix:this["x-attribsPrefix"]?.[e]}))}namespace;"x-attribsNamespace";"x-attribsPrefix"}function v(e){return(t=e).type===o.Tag||t.type===o.Script||t.type===o.Style;var t}function x(e){return e.type===o.CDATA}function b(e){return e.type===o.Text}function k(e){return e.type===o.Comment}function E(e){return e.type===o.Directive}function w(e){return e.type===o.Root}function T(e,t=!1){let n;if(b(e))n=new d(e.data);else if(k(e))n=new p(e.data);else if(v(e)){const r=t?S(e.children):[],o=new y(e.name,{...e.attribs},r);for(const e of r)e.parent=o;null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]={...e["x-attribsPrefix"]}),n=o}else if(x(e)){const r=t?S(e.children):[],o=new m(r);for(const e of r)e.parent=o;n=o}else if(w(e)){const r=t?S(e.children):[],o=new g(r);for(const e of r)e.parent=o;e["x-mode"]&&(o["x-mode"]=e["x-mode"]),n=o}else{if(!E(e))throw new Error(`Not implemented yet: ${e.type}`);{const t=new f(e.name,e.data);null!=e["x-name"]&&(t["x-name"]=e["x-name"],t["x-publicId"]=e["x-publicId"],t["x-systemId"]=e["x-systemId"]),n=t}}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function S(e){const t=e.map(e=>T(e,!0));for(let e=1;e<t.length;e++)t[e].prev=t[e-1],t[e-1].next=t[e];return t}const C={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class _{dom=[];root=new g(this.dom);callback;options;elementCB;done=!1;tagStack=[this.root];lastNode=null;parser=null;constructor(e,t,n){"function"==typeof t&&(n=t,t=C),"object"==typeof e&&(t=e,e=void 0),this.callback=e??null,this.options=t??C,this.elementCB=n??null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new g(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;const e=this.tagStack.pop();this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,t){const n=this.options.xmlMode?o.Tag:void 0,r=new y(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)}ontext(e){const{lastNode:t}=this;if(t&&t.type===o.Text)t.data+=e,this.options.withEndIndices&&this.parser&&(t.endIndex=this.parser.endIndex);else{const t=new d(e);this.addNode(t),this.lastNode=t}}oncomment(e){if(this.lastNode&&this.lastNode.type===o.Comment)return void(this.lastNode.data+=e);const t=new p(e);this.addNode(t),this.lastNode=t}oncommentend(){this.lastNode=null}oncdatastart(){const e=new d(""),t=new m([e]);this.addNode(t),e.parent=t,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,t){const n=new f(e,t);this.addNode(n)}handleCallback(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e}addNode(e){const t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&this.parser&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null}}var O,A,N,M,I=r(Object.freeze({__proto__:null,CDATA:m,Comment:p,DataNode:u,Document:g,DomHandler:_,Element:y,Node:c,NodeWithChildren:h,ProcessingInstruction:f,Text:d,cloneNode:T,default:_,hasChildren:function(e){return Object.hasOwn(e,"children")},isCDATA:x,isComment:k,isDirective:E,isDocument:w,isTag:v,isText:b})),P={};function R(){if(A)return l;A=1,Object.defineProperty(l,"__esModule",{value:!0}),l.hasOpenTag=function(e,t){var n="<"+t,r=e.toLowerCase().indexOf(n);if(-1===r)return!1;var o=e[r+n.length];return">"===o||" "===o||"\t"===o||"\n"===o||"\r"===o||"/"===o},l.escapeSpecialCharacters=function(e){return e.replace(o,i)},l.revertEscapedCharacters=u,l.formatDOM=function e(n,r,o){var i,a,l,d;void 0===r&&(r=null);for(var p,f=[],h=0,m=n.length;h<m;h++){var g=n[h];switch(g.nodeType){case 1:var y=c(g.nodeName);(p=new t.Element(y,s(g.attributes))).children=e("template"===y?g.content.childNodes:g.childNodes,p);break;case 3:p=new t.Text(u(null!==(i=g.nodeValue)&&void 0!==i?i:""));break;case 8:p=new t.Comment(null!==(a=g.nodeValue)&&void 0!==a?a:"");break;default:continue}var v=null!==(l=f[h-1])&&void 0!==l?l:null;v&&(v.next=p),p.parent=r,p.prev=v,p.next=null,f.push(p)}o&&((p=new t.ProcessingInstruction(o.substring(0,o.indexOf(" ")).toLowerCase(),o)).next=null!==(d=f[0])&&void 0!==d?d:null,p.parent=r,f.unshift(p),f[1]&&(f[1].prev=f[0]));return f};var e,t=I,n=(O||(O=1,e=P,Object.defineProperty(e,"__esModule",{value:!0}),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{})),P),r="\r",o=new RegExp(r,"g"),i="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(),"__"),a=new RegExp(i,"g");function s(e){for(var t={},n=0,r=e.length;n<r;n++){var o=e[n];t[o.name]=o.value}return t}function c(e){var t=function(e){return n.CASE_SENSITIVE_TAG_NAMES_MAP[e]}(e=e.toLowerCase());return t||e}function u(e){return e.replace(a,r)}return l}function D(){if(M)return a;M=1;var e=a&&a.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var o=r.exec(e),i=o?o[1]:void 0;return(0,n.formatDOM)((0,t.default)(e),null,i)};var t=e(function(){if(N)return s;N=1,Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(s){var l,c,u,p,h,m;s=(0,e.escapeSpecialCharacters)(s);var g=o.exec(s),y=null===(l=null==g?void 0:g[1])||void 0===l?void 0:l.toLowerCase();switch(y){case t:var v=a(s);return(0,e.hasOpenTag)(s,n)||null===(c=null==(b=v.querySelector(n))?void 0:b.parentNode)||void 0===c||c.removeChild(b),(0,e.hasOpenTag)(s,r)||null===(u=null==(b=v.querySelector(r))?void 0:b.parentNode)||void 0===u||u.removeChild(b),v.querySelectorAll(t);case n:case r:var x=i(s).querySelectorAll(y);return(0,e.hasOpenTag)(s,r)&&(0,e.hasOpenTag)(s,n)?null!==(h=null===(p=x[0].parentNode)||void 0===p?void 0:p.childNodes)&&void 0!==h?h:f():x;default:return d?d(s):null!==(m=null==(b=i(s,r).querySelector(r))?void 0:b.childNodes)&&void 0!==m?m:f();var b}};var e=R(),t="html",n="head",r="body",o=/<([a-zA-Z]+[0-9]?)/,i=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},a=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},l="object"==typeof window&&window.DOMParser;if("function"==typeof l){var c=new l;i=a=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),c.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var u=document.implementation.createHTMLDocument();i=function(e,t){if(t){var n=u.documentElement.querySelector(t);return n&&(n.innerHTML=e),u}return u.documentElement.innerHTML=e,u}}var d,p="object"==typeof document&&document.createElement("template");p&&p.content&&(d=function(e){return p.innerHTML=e,p.content.childNodes});var f=function(){return document.createDocumentFragment().childNodes};return s}()),n=R(),r=/<(![a-zA-Z\s]+)>/;return a}var L,F,j={},H={},z={};function B(){if(L)return z;L=1;z.SAME=0;return z.CAMELCASE=1,z.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1},z}var V,U,q,G={},X={};function W(){if(q)return X;q=1;var e=X&&X.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.default=function(e,n){let r=null;if(!e||"string"!=typeof e)return r;const o=(0,t.default)(e),i="function"==typeof n;return o.forEach(e=>{if("declaration"!==e.type)return;const{property:t,value:o}=e;i?n(t,o,e):o&&(r=r||{},r[t]=o)}),r};const t=e(function(){if(U)return V;U=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l="";function c(e){return e?e.replace(s,l):l}return V=function(s,u){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];u=u||{};var d=1,p=1;function f(e){var n=e.match(t);n&&(d+=n.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),v(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=u.source}function g(e){var t=new Error(u.source+":"+d+":"+p+": "+e);if(t.reason=e,t.filename=u.source,t.line=d,t.column=p,t.source=s,!u.silent)throw t}function y(e){var t=e.exec(s);if(t){var n=t[0];return f(n),s=s.slice(n.length),t}}function v(){y(n)}function x(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var e=h();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;l!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,l===s.charAt(t-1))return g("End of comment missing");var n=s.slice(2,t-2);return p+=2,f(n),s=s.slice(t),p+=2,e({type:"comment",comment:n})}}function k(){var t=h(),n=y(r);if(n){if(b(),!y(o))return g("property missing ':'");var s=y(i),u=t({type:"declaration",property:c(n[0].replace(e,l)),value:s?c(s[0].replace(e,l)):l});return y(a),u}}return m.prototype.content=s,v(),function(){var e,t=[];for(x(t);e=k();)!1!==e&&(t.push(e),x(t));return t}()}}());return X}var Y,Z,$,K,J,Q={};function ee(){if(Y)return Q;Y=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(e,t){return t.toUpperCase()},a=function(e,t){return"".concat(t,"-")};return Q.camelCase=function(s,l){return void 0===l&&(l={}),function(t){return!t||n.test(t)||e.test(t)}(s)?s:(s=s.toLowerCase(),(s=l.reactCompat?s.replace(o,a):s.replace(r,a)).replace(t,i))},Q}function te(){return K||(K=1,function(t){var n=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){if(!e.includes("-"))return Boolean(t&&"string"==typeof t.is);if(i.has(e))return!1;return!0},t.setStyleProp=function(e,t){if("string"!=typeof e)return;if(!e.trim())return void(t.style={});try{t.style=(0,o.default)(e,a)}catch(e){t.style={}}};const r=e,o=n(function(){if($)return Z;$=1;var e=(Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(W()),t=ee();function n(n,r){var o={};return n&&"string"==typeof n?((0,e.default)(n,function(e,n){e&&n&&(o[(0,t.camelCase)(e,r)]=n)}),o):o}return n.default=n,Z=n}()),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);const a={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(r.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);t.canTextBeChildOfNode=e=>!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name);t.returnFirstArg=e=>e}(G)),G}function ne(){if(J)return j;J=1,Object.defineProperty(j,"__esModule",{value:!0}),j.default=function(a={},s){const l={},c=Boolean(a.type&&o[a.type]);for(const o in a){const u=a[o];if((0,e.isCustomAttribute)(o)){l[o]=u;continue}const d=o.toLowerCase();let p=i(d);if(p){const t=(0,e.getPropertyInfo)(p);switch(n.includes(p)&&r.includes(s)&&!c&&(p=i("default"+d)),l[p]=u,null==t?void 0:t.type){case e.BOOLEAN:l[p]=!0;break;case e.OVERLOADED_BOOLEAN:""===u&&(l[p]=!0)}continue}t.PRESERVE_CUSTOM_ATTRIBUTES&&(l[o]=u)}return(0,t.setStyleProp)(a.style,l),l};const e=function(){if(F)return H;function e(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}F=1;const t={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(n=>{t[n]=new e(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([n,r])=>{t[n]=new e(n,1,!1,r,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(n=>{t[n]=new e(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(n=>{t[n]=new e(n,2,!1,n,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(n=>{t[n]=new e(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(n=>{t[n]=new e(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(n=>{t[n]=new e(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(n=>{t[n]=new e(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(n=>{t[n]=new e(n,5,!1,n.toLowerCase(),null,!1,!1)});const n=/[\-\:]([a-z])/g,r=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(o=>{const i=o.replace(n,r);t[i]=new e(i,1,!1,o,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(o=>{const i=o.replace(n,r);t[i]=new e(i,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(o=>{const i=o.replace(n,r);t[i]=new e(i,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(n=>{t[n]=new e(n,1,!1,n.toLowerCase(),null,!1,!1)}),t.xlinkHref=new e("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(n=>{t[n]=new e(n,1,!1,n.toLowerCase(),null,!0,!0)});const{CAMELCASE:o,SAME:i,possibleStandardNames:a}=B(),s=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),l=Object.keys(a).reduce((e,t)=>{const n=a[t];return n===i?e[t]=t:n===o?e[t.toLowerCase()]=t:e[t]=n,e},{});return H.BOOLEAN=3,H.BOOLEANISH_STRING=2,H.NUMERIC=5,H.OVERLOADED_BOOLEAN=4,H.POSITIVE_NUMERIC=6,H.RESERVED=0,H.STRING=1,H.getPropertyInfo=function(e){return t.hasOwnProperty(e)?t[e]:null},H.isCustomAttribute=s,H.possibleStandardNames=l,H}(),t=te(),n=["checked","value"],r=["input","select","textarea"],o={reset:!0,submit:!0};function i(t){return e.possibleStandardNames[t]}return j}var re,oe,ie={};var ae=(oe||(oe=1,function(t){var n=i&&i.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){var n;if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,a.default)((0,r.default)(e,null!==(n=null==t?void 0:t.htmlparser2)&&void 0!==n?n:l),t):[]};const r=n(D());t.htmlToDOM=r.default;const o=n(ne());t.attributesToProps=o.default;const a=n(function(){if(re)return ie;re=1;var t=ie&&ie.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=function e(t,n={}){var s,l,c,u,d;const p=[],f="function"==typeof n.replace,h=null!==(s=n.transform)&&void 0!==s?s:o.returnFirstArg,{cloneElement:m,createElement:g,isValidElement:y}=null!==(l=n.library)&&void 0!==l?l:i,v=t.length;for(let i=0;i<v;i++){const s=t[i];if(f){let e=null===(c=n.replace)||void 0===c?void 0:c.call(n,s,i);if(y(e)){v>1&&(e=m(e,{key:null!==(u=e.key)&&void 0!==u?u:i})),p.push(h(e,s,i));continue}}if("text"===s.type){const e=!s.data.trim().length;if(e&&s.parent&&!(0,o.canTextBeChildOfNode)(s.parent))continue;if(n.trim&&e)continue;p.push(h(s.data,s,i));continue}const l=s;let x,b={};switch(a(l)?((0,o.setStyleProp)(l.attribs.style,l.attribs),b=l.attribs):l.attribs&&(b=(0,r.default)(l.attribs,l.name)),s.type){case"script":case"style":s.children[0]&&(b.dangerouslySetInnerHTML={__html:s.children[0].data});break;case"tag":"textarea"===s.name&&s.children[0]?b.defaultValue=s.children[0].data:(null===(d=s.children)||void 0===d?void 0:d.length)&&(x=e(s.children,n));break;default:continue}v>1&&(b.key=i),p.push(h(g(s.name,b,x),s,i))}return 1===p.length?p[0]:p};const n=e,r=t(ne()),o=te(),i={cloneElement:n.cloneElement,createElement:n.createElement,isValidElement:n.isValidElement};function a(e){return o.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,o.isCustomComponent)(e.name,e.attribs)}return ie}());t.domToReact=a.default;var s=I;Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return s.Text}});const l={lowerCaseAttributeNames:!1}}(i)),i),se=n(ae),le=t({__proto__:null,default:se},[ae]);const ce=se;return Object.assign(ce,le),ce});
|
|
2
2
|
//# sourceMappingURL=html-react-parser.min.js.map
|