UNPKG

filestack-js

Version:

Official JavaScript library for Filestack

2 lines 581 kB
/*! For license information please see filestack.min.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.filestack=e():t.filestack=e()}(self,(()=>(()=>{var t,e,r,n,o={15:t=>{"use strict";t.exports=EvalError},157:t=>{"use strict";t.exports=Error},377:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o="undefined"!=typeof Symbol&&Symbol,i=r(4379);t.exports=function(){return"function"==typeof o&&"function"==typeof Symbol&&"symbol"===n(o("foo"))&&"symbol"===n(Symbol("bar"))&&i()}},395:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}t=r.nmd(t);var o="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",c="[object Boolean]",s="[object Date]",u="[object Function]",p="[object GeneratorFunction]",l="[object Map]",f="[object Number]",h="[object Object]",d="[object Promise]",m="[object RegExp]",y="[object Set]",v="[object String]",g="[object Symbol]",b="[object WeakMap]",x="[object ArrayBuffer]",w="[object DataView]",k="[object Float32Array]",S="[object Float64Array]",E="[object Int8Array]",O="[object Int16Array]",j="[object Int32Array]",F="[object Uint8Array]",_="[object Uint8ClampedArray]",P="[object Uint16Array]",A="[object Uint32Array]",T=/\w*$/,D=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,C={};C[a]=C["[object Array]"]=C[x]=C[w]=C[c]=C[s]=C[k]=C[S]=C[E]=C[O]=C[j]=C[l]=C[f]=C[h]=C[m]=C[y]=C[v]=C[g]=C[F]=C[_]=C[P]=C[A]=!0,C["[object Error]"]=C[u]=C[b]=!1;var I="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,z="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,N=I||z||Function("return this")(),R="object"==n(e)&&e&&!e.nodeType&&e,M=R&&"object"==n(t)&&t&&!t.nodeType&&t,B=M&&M.exports===R;function U(t,e){return t.set(e[0],e[1]),t}function q(t,e){return t.add(e),t}function G(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function $(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function Z(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function V(t,e){return function(r){return t(e(r))}}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Y,W=Array.prototype,K=Function.prototype,Q=Object.prototype,J=N["__core-js_shared__"],X=(Y=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",tt=K.toString,et=Q.hasOwnProperty,rt=Q.toString,nt=RegExp("^"+tt.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=B?N.Buffer:void 0,it=N.Symbol,at=N.Uint8Array,ct=V(Object.getPrototypeOf,Object),st=Object.create,ut=Q.propertyIsEnumerable,pt=W.splice,lt=Object.getOwnPropertySymbols,ft=ot?ot.isBuffer:void 0,ht=V(Object.keys,Object),dt=Nt(N,"DataView"),mt=Nt(N,"Map"),yt=Nt(N,"Promise"),vt=Nt(N,"Set"),gt=Nt(N,"WeakMap"),bt=Nt(Object,"create"),xt=qt(dt),wt=qt(mt),kt=qt(yt),St=qt(vt),Et=qt(gt),Ot=it?it.prototype:void 0,jt=Ot?Ot.valueOf:void 0;function Ft(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Pt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function At(t){this.__data__=new _t(t)}function Tt(t,e,r){var n=t[e];et.call(t,e)&&Gt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Dt(t,e){for(var r=t.length;r--;)if(Gt(t[r][0],e))return r;return-1}function Lt(t,e,r,n,o,i,d){var b;if(n&&(b=i?n(t,o,i,d):n(t)),void 0!==b)return b;if(!Yt(t))return t;var D=$t(t);if(D){if(b=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&et.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,b)}else{var L=Mt(t),I=L==u||L==p;if(Vt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(L==h||L==a||I&&!i){if($(t))return i?t:{};if(b=function(t){return"function"!=typeof t.constructor||Ut(t)?{}:Yt(e=ct(t))?st(e):{};var e}(I?{}:t),!e)return function(t,e){return It(t,Rt(t),e)}(t,function(t,e){return t&&It(e,Wt(e),t)}(b,t))}else{if(!C[L])return i?t:{};b=function(t,e,r,n){var o,i=t.constructor;switch(e){case x:return Ct(t);case c:case s:return new i(+t);case w:return function(t,e){var r=e?Ct(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case k:case S:case E:case O:case j:case F:case _:case P:case A:return function(t,e){var r=e?Ct(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case l:return function(t,e,r){return G(e?r(Z(t),!0):Z(t),U,new t.constructor)}(t,n,r);case f:case v:return new i(t);case m:return function(t){var e=new t.constructor(t.source,T.exec(t));return e.lastIndex=t.lastIndex,e}(t);case y:return function(t,e,r){return G(e?r(H(t),!0):H(t),q,new t.constructor)}(t,n,r);case g:return o=t,jt?Object(jt.call(o)):{}}}(t,L,Lt,e)}}d||(d=new At);var z=d.get(t);if(z)return z;if(d.set(t,b),!D)var N=r?function(t){return function(t,e,r){var n=e(t);return $t(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Wt,Rt)}(t):Wt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r););}(N||t,(function(o,i){N&&(o=t[i=o]),Tt(b,i,Lt(o,e,r,n,i,t,d))})),b}function Ct(t){var e=new t.constructor(t.byteLength);return new at(e).set(new at(t)),e}function It(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var a=e[o],c=n?n(r[a],t[a],a,r,t):void 0;Tt(r,a,void 0===c?t[a]:c)}return r}function zt(t,e){var r,o,i=t.__data__;return("string"==(o=n(r=e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Nt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Yt(t)||(e=t,X&&X in e))&&(Ht(t)||$(t)?nt:D).test(qt(t));var e}(r)?r:void 0}Ft.prototype.clear=function(){this.__data__=bt?bt(null):{}},Ft.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Ft.prototype.get=function(t){var e=this.__data__;if(bt){var r=e[t];return r===o?void 0:r}return et.call(e,t)?e[t]:void 0},Ft.prototype.has=function(t){var e=this.__data__;return bt?void 0!==e[t]:et.call(e,t)},Ft.prototype.set=function(t,e){return this.__data__[t]=bt&&void 0===e?o:e,this},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=Dt(e,t);return!(r<0||(r==e.length-1?e.pop():pt.call(e,r,1),0))},_t.prototype.get=function(t){var e=this.__data__,r=Dt(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return Dt(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,n=Dt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Pt.prototype.clear=function(){this.__data__={hash:new Ft,map:new(mt||_t),string:new Ft}},Pt.prototype.delete=function(t){return zt(this,t).delete(t)},Pt.prototype.get=function(t){return zt(this,t).get(t)},Pt.prototype.has=function(t){return zt(this,t).has(t)},Pt.prototype.set=function(t,e){return zt(this,t).set(t,e),this},At.prototype.clear=function(){this.__data__=new _t},At.prototype.delete=function(t){return this.__data__.delete(t)},At.prototype.get=function(t){return this.__data__.get(t)},At.prototype.has=function(t){return this.__data__.has(t)},At.prototype.set=function(t,e){var r=this.__data__;if(r instanceof _t){var n=r.__data__;if(!mt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Pt(n)}return r.set(t,e),this};var Rt=lt?V(lt,Object):function(){return[]},Mt=function(t){return rt.call(t)};function Bt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||L.test(t))&&t>-1&&t%1==0&&t<e}function Ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Q)}function qt(t){if(null!=t){try{return tt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Gt(t,e){return t===e||t!=t&&e!=e}(dt&&Mt(new dt(new ArrayBuffer(1)))!=w||mt&&Mt(new mt)!=l||yt&&Mt(yt.resolve())!=d||vt&&Mt(new vt)!=y||gt&&Mt(new gt)!=b)&&(Mt=function(t){var e=rt.call(t),r=e==h?t.constructor:void 0,n=r?qt(r):void 0;if(n)switch(n){case xt:return w;case wt:return l;case kt:return d;case St:return y;case Et:return b}return e});var $t=Array.isArray;function Zt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!Ht(t)}var Vt=ft||function(){return!1};function Ht(t){var e=Yt(t)?rt.call(t):"";return e==u||e==p}function Yt(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function Wt(t){return Zt(t)?function(t,e){var r=$t(t)||function(t){return function(t){return function(t){return!!t&&"object"==n(t)}(t)&&Zt(t)}(t)&&et.call(t,"callee")&&(!ut.call(t,"callee")||rt.call(t)==a)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],o=r.length,i=!!o;for(var c in t)!e&&!et.call(t,c)||i&&("length"==c||Bt(c,o))||r.push(c);return r}(t):function(t){if(!Ut(t))return ht(t);var e=[];for(var r in Object(t))et.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return Lt(t,!0,!0)}},428:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(1837),i=r(6234),a=r(1371),c=r(5605).S,s=a.ValidatorResult,u=a.ValidatorResultError,p=a.SchemaError,l=a.SchemaContext,f=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(d),this.attributes=Object.create(i.validators)};function h(t){var e="string"==typeof t?t:t.$ref;return"string"==typeof e&&e}f.prototype.customFormats={},f.prototype.schemas=null,f.prototype.types=null,f.prototype.attributes=null,f.prototype.unresolvedRefs=null,f.prototype.addSchema=function(t,e){var r=this;if(!t)return null;var n=c(e||"/",t),o=e||t.$id||t.id;for(var i in n.id)this.schemas[i]=n.id[i];for(var i in n.ref)this.unresolvedRefs.push(i);return this.unresolvedRefs=this.unresolvedRefs.filter((function(t){return void 0===r.schemas[t]})),this.schemas[o]},f.prototype.addSubSchemaArray=function(t,e){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addSubSchema(t,e[r])},f.prototype.addSubSchemaObject=function(t,e){if(e&&"object"==n(e))for(var r in e)this.addSubSchema(t,e[r])},f.prototype.setSchemas=function(t){this.schemas=t},f.prototype.getSchema=function(t){return this.schemas[t]},f.prototype.validate=function(t,e,r,i){if("boolean"!=typeof e&&"object"!==n(e)||null===e)throw new p("Expected `schema` to be an object or boolean");r||(r={});var a,f=e.$id||e.id,h=o.resolve(r.base||"/",f||"");if(!i){(i=new l(e,r,[],h,Object.create(this.schemas))).schemas[h]||(i.schemas[h]=e);var d=c(h,e);for(var m in d.id){var y=d.id[m];i.schemas[m]=y}}if(r.required&&void 0===t)return(a=new s(t,e,r,i)).addError("is required, but is undefined"),a;if(!(a=this.validateSchema(t,e,r,i)))throw new Error("Result undefined");if(r.throwAll&&a.errors.length)throw new u(a);return a},f.prototype.validateSchema=function(t,e,r,n){var o=new s(t,e,r,n);if("boolean"==typeof e)!0===e?e={}:!1===e&&(e={type:[]});else if(!e)throw new Error("schema is undefined");if(e.extends)if(Array.isArray(e.extends)){var c={schema:e,ctx:n};e.extends.forEach(this.schemaTraverser.bind(this,c)),e=c.schema,c.schema=null,c.ctx=null,c=null}else e=a.deepMerge(e,this.superResolve(e.extends,n));var u=h(e);if(u){var f=this.resolve(e,u,n),d=new l(f.subschema,r,n.path,f.switchSchema,n.schemas);return this.validateSchema(t,f.subschema,r,d)}var m=r&&r.skipAttributes||[];for(var y in e)if(!i.ignoreProperties[y]&&m.indexOf(y)<0){var v=null,g=this.attributes[y];if(g)v=g.call(this,t,e,r,n);else if(!1===r.allowUnknownAttributes)throw new p("Unsupported attribute: "+y,e);v&&o.importErrors(v)}if("function"==typeof r.rewrite){var b=r.rewrite.call(this,t,e,r,n);o.instance=b}return o},f.prototype.schemaTraverser=function(t,e){t.schema=a.deepMerge(t.schema,this.superResolve(e,t.ctx))},f.prototype.superResolve=function(t,e){var r=h(t);return r?this.resolve(t,r,e).subschema:t},f.prototype.resolve=function(t,e,r){if(e=r.resolve(e),r.schemas[e])return{subschema:r.schemas[e],switchSchema:e};var n=o.parse(e),i=n&&n.hash,c=i&&i.length&&e.substr(0,e.length-i.length);if(!c||!r.schemas[c])throw new p("no such schema <"+e+">",t);var s=a.objectGetPath(r.schemas[c],i.substr(1));if(void 0===s)throw new p("no such schema "+i+" located in <"+c+">",t);return{subschema:s,switchSchema:e}},f.prototype.testType=function(t,e,r,o,i){if(void 0!==i){if(null===i)throw new p('Unexpected null in "type" keyword');if("function"==typeof this.types[i])return this.types[i].call(this,t);if(i&&"object"==n(i)){var a=this.validateSchema(t,i,r,o);return void 0===a||!(a&&a.errors.length)}return!0}};var d=f.prototype.types={};d.string=function(t){return"string"==typeof t},d.number=function(t){return"number"==typeof t&&isFinite(t)},d.integer=function(t){return"number"==typeof t&&t%1==0},d.boolean=function(t){return"boolean"==typeof t},d.array=function(t){return Array.isArray(t)},d.null=function(t){return null===t},d.date=function(t){return t instanceof Date},d.any=function(t){return!0},d.object=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&!(t instanceof Date)},t.exports=f},830:(t,e,r)=>{"use strict";r.d(e,{D6:()=>zt,qg:()=>i,xp:()=>It,cN:()=>Lt,Sc:()=>Rt.S});var n=r(3186),o=["expires","from","host","if-modified-since","if-unmodified-since","age","authorization","content-length","content-type","etag","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],i=function(t){var e,r,i,a={};return t?(t.split("\n").forEach((function(t){i=t.indexOf(":"),e=(0,n.Bq)(t.substr(0,i)).toLowerCase(),r=(0,n.Bq)(t.substr(i+1)),e&&(a[e]&&o.indexOf(e)>=0||(a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([r]):a[e]?a[e]+", "+r:r))})),a):a},a=function(t,e,r,n){void 0===n&&(n=!1);var o=c(e);return t||(t={}),void 0===(t=JSON.parse(JSON.stringify(t)))[e]&&void 0===t[o]?t[o]=r:n&&(delete t[e],t[o]=r),t},c=function(t){return{"content-md5":"Content-MD5",dnt:"DNT",etag:"ETag","last-event-id":"Last-Event-ID",tcn:"TCN",te:"TE","www-authenticate":"WWW-Authenticate","x-dnsprefetch-control":"X-DNSPrefetch-Control"}[t.toLowerCase()]||t.split("-").map((function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()})).join("-")},s=r(1635),u=r(6947),p=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",l=new RegExp("^["+p+"]["+p+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function f(t,e){for(var r=[],n=e.exec(t);n;){var o=[];o.startIndex=e.lastIndex-n[0].length;for(var i=n.length,a=0;a<i;a++)o.push(n[a]);r.push(o),n=e.exec(t)}return r}var h=function(t){return!(null==l.exec(t))},d={allowBooleanAttributes:!1,unpairedTags:[]};function m(t,e){e=Object.assign({},d,e);var r=[],n=!1,o=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var i=0;i<t.length;i++)if("<"===t[i]&&"?"===t[i+1]){if((i=v(t,i+=2)).err)return i}else{if("<"!==t[i]){if(y(t[i]))continue;return O("InvalidChar","char '"+t[i]+"' is not expected.",F(t,i))}var a=i;if("!"===t[++i]){i=g(t,i);continue}var c=!1;"/"===t[i]&&(c=!0,i++);for(var s="";i<t.length&&">"!==t[i]&&" "!==t[i]&&"\t"!==t[i]&&"\n"!==t[i]&&"\r"!==t[i];i++)s+=t[i];if("/"===(s=s.trim())[s.length-1]&&(s=s.substring(0,s.length-1),i--),!h(s))return O("InvalidTag",0===s.trim().length?"Invalid space after '<'.":"Tag '"+s+"' is an invalid name.",F(t,i));var u=w(t,i);if(!1===u)return O("InvalidAttr","Attributes for '"+s+"' have open quote.",F(t,i));var p=u.value;if(i=u.index,"/"===p[p.length-1]){var l=i-p.length,f=S(p=p.substring(0,p.length-1),e);if(!0!==f)return O(f.err.code,f.err.msg,F(t,l+f.err.line));n=!0}else if(c){if(!u.tagClosed)return O("InvalidTag","Closing tag '"+s+"' doesn't have proper closing.",F(t,i));if(p.trim().length>0)return O("InvalidTag","Closing tag '"+s+"' can't have attributes or invalid starting.",F(t,a));if(0===r.length)return O("InvalidTag","Closing tag '"+s+"' has not been opened.",F(t,a));var m=r.pop();if(s!==m.tagName){var b=F(t,m.tagStartPos);return O("InvalidTag","Expected closing tag '"+m.tagName+"' (opened in line "+b.line+", col "+b.col+") instead of closing tag '"+s+"'.",F(t,a))}0==r.length&&(o=!0)}else{var x=S(p,e);if(!0!==x)return O(x.err.code,x.err.msg,F(t,i-p.length+x.err.line));if(!0===o)return O("InvalidXml","Multiple possible root nodes found.",F(t,i));-1!==e.unpairedTags.indexOf(s)||r.push({tagName:s,tagStartPos:a}),n=!0}for(i++;i<t.length;i++)if("<"===t[i]){if("!"===t[i+1]){i=g(t,++i);continue}if("?"!==t[i+1])break;if((i=v(t,++i)).err)return i}else if("&"===t[i]){var k=E(t,i);if(-1==k)return O("InvalidChar","char '&' is not expected.",F(t,i));i=k}else if(!0===o&&!y(t[i]))return O("InvalidXml","Extra text at the end",F(t,i));"<"===t[i]&&i--}return n?1==r.length?O("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",F(t,r[0].tagStartPos)):!(r.length>0)||O("InvalidXml","Invalid '"+JSON.stringify(r.map((function(t){return t.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):O("InvalidXml","Start tag expected.",1)}function y(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function v(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var n=t.substr(r,e-r);if(e>5&&"xml"===n)return O("InvalidXml","XML declaration allowed only at the start of the document.",F(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function g(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0==--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}var b='"',x="'";function w(t,e){for(var r="",n="",o=!1;e<t.length;e++){if(t[e]===b||t[e]===x)""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){o=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:o}}var k=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function S(t,e){for(var r=f(t,k),n={},o=0;o<r.length;o++){if(0===r[o][1].length)return O("InvalidAttr","Attribute '"+r[o][2]+"' has no space in starting.",_(r[o]));if(void 0!==r[o][3]&&void 0===r[o][4])return O("InvalidAttr","Attribute '"+r[o][2]+"' is without value.",_(r[o]));if(void 0===r[o][3]&&!e.allowBooleanAttributes)return O("InvalidAttr","boolean attribute '"+r[o][2]+"' is not allowed.",_(r[o]));var i=r[o][2];if(!j(i))return O("InvalidAttr","Attribute '"+i+"' is an invalid name.",_(r[o]));if(n.hasOwnProperty(i))return O("InvalidAttr","Attribute '"+i+"' is repeated.",_(r[o]));n[i]=1}return!0}function E(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function O(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function j(t){return h(t)}function F(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function _(t){return t.startIndex+t[1].length}var P={validate:m};function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}var T={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t},captureMetaData:!1};function D(t){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,allowedTags:null,tagFilter:null}:"object"===A(t)&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:null!==(e=t.maxEntitySize)&&void 0!==e?e:1e4,maxExpansionDepth:null!==(r=t.maxExpansionDepth)&&void 0!==r?r:10,maxTotalExpansions:null!==(n=t.maxTotalExpansions)&&void 0!==n?n:1e3,maxExpandedLength:null!==(o=t.maxExpandedLength)&&void 0!==o?o:1e5,allowedTags:null!==(i=t.allowedTags)&&void 0!==i?i:null,tagFilter:null!==(a=t.tagFilter)&&void 0!==a?a:null}:D(!0);var e,r,n,o,i,a}var L,C=function(t){var e=Object.assign({},T,t);return e.processEntities=D(e.processEntities),e};function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function z(t,e,r){return(e=R(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R(n.key),n)}}function R(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:String(e)}L="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var M=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tagname=e,this.child=[],this[":@"]={}}var e,r,n;return e=t,n=[{key:"getMetaDataSymbol",value:function(){return L}}],(r=[{key:"add",value:function(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push(z({},t,e))}},{key:"addChild",value:function(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(z(z({},t.tagname,t.child),":@",t[":@"])):this.child.push(z({},t.tagname,t.child)),void 0!==e&&(this.child[this.child.length-1][L]={startIndex:e})}}])&&N(e.prototype,r),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],s=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);s=!0);}catch(t){u=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?q(t,e):void 0}}(t,e)||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.")}()}function q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function G(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$(n.key),n)}}function $(t){var e=function(t){if("object"!=B(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==B(e)?e:String(e)}var Z=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.suppressValidationErr=!e,this.options=e}var e,r;return e=t,(r=[{key:"readDocType",value:function(t,e){var r={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var n=1,o=!1,i=!1;e<t.length;e++)if("<"!==t[e]||i)if(">"===t[e]){if(i?"-"===t[e-1]&&"-"===t[e-2]&&(i=!1,n--):n--,0===n)break}else"["===t[e]?o=!0:t[e];else{if(o&&H(t,"!ENTITY",e)){e+=7;var a=void 0,c=void 0,s=U(this.readEntityExp(t,e+1,this.suppressValidationErr),3);if(a=s[0],c=s[1],e=s[2],-1===c.indexOf("&")){var u=a.replace(/[.\-+*:]/g,"\\.");r[a]={regx:RegExp("&".concat(u,";"),"g"),val:c}}}else if(o&&H(t,"!ELEMENT",e))e+=8,e=this.readElementExp(t,e+1).index;else if(o&&H(t,"!ATTLIST",e))e+=8;else if(o&&H(t,"!NOTATION",e))e+=9,e=this.readNotationExp(t,e+1,this.suppressValidationErr).index;else{if(!H(t,"!--",e))throw new Error("Invalid DOCTYPE");i=!0}n++}if(0!==n)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}}},{key:"readEntityExp",value:function(t,e){e=V(t,e);for(var r="";e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)r+=t[e],e++;if(Y(r),e=V(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}var n,o=U(this.readIdentifierVal(t,e,"entity"),2);if(e=o[0],n=o[1],!1!==this.options.enabled&&this.options.maxEntitySize&&n.length>this.options.maxEntitySize)throw new Error('Entity "'.concat(r,'" size (').concat(n.length,") exceeds maximum allowed size (").concat(this.options.maxEntitySize,")"));return[r,n,--e]}},{key:"readNotationExp",value:function(t,e){e=V(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;!this.suppressValidationErr&&Y(r),e=V(t,e);var n=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==n&&"PUBLIC"!==n)throw new Error('Expected SYSTEM or PUBLIC, found "'.concat(n,'"'));e+=n.length,e=V(t,e);var o=null,i=null;if("PUBLIC"===n){var a=U(this.readIdentifierVal(t,e,"publicIdentifier"),2);if(e=a[0],o=a[1],'"'===t[e=V(t,e)]||"'"===t[e]){var c=U(this.readIdentifierVal(t,e,"systemIdentifier"),2);e=c[0],i=c[1]}}else if("SYSTEM"===n){var s=U(this.readIdentifierVal(t,e,"systemIdentifier"),2);if(e=s[0],i=s[1],!this.suppressValidationErr&&!i)throw new Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:r,publicIdentifier:o,systemIdentifier:i,index:--e}}},{key:"readIdentifierVal",value:function(t,e,r){var n="",o=t[e];if('"'!==o&&"'"!==o)throw new Error('Expected quoted string, found "'.concat(o,'"'));for(e++;e<t.length&&t[e]!==o;)n+=t[e],e++;if(t[e]!==o)throw new Error("Unterminated ".concat(r," value"));return[++e,n]}},{key:"readElementExp",value:function(t,e){e=V(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;if(!this.suppressValidationErr&&!h(r))throw new Error('Invalid element name: "'.concat(r,'"'));var n="";if("E"===t[e=V(t,e)]&&H(t,"MPTY",e))e+=4;else if("A"===t[e]&&H(t,"NY",e))e+=2;else if("("===t[e]){for(e++;e<t.length&&")"!==t[e];)n+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error('Invalid Element Expression, found "'.concat(t[e],'"'));return{elementName:r,contentModel:n.trim(),index:e}}},{key:"readAttlistExp",value:function(t,e){e=V(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;Y(r),e=V(t,e);for(var n="";e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!Y(n))throw new Error('Invalid attribute name: "'.concat(n,'"'));e=V(t,e);var o="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(o="NOTATION","("!==t[e=V(t,e+=8)])throw new Error("Expected '(', found \"".concat(t[e],'"'));e++;for(var i=[];e<t.length&&")"!==t[e];){for(var a="";e<t.length&&"|"!==t[e]&&")"!==t[e];)a+=t[e],e++;if(!Y(a=a.trim()))throw new Error('Invalid notation name: "'.concat(a,'"'));i.push(a),"|"===t[e]&&(e++,e=V(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,o+=" ("+i.join("|")+")"}else{for(;e<t.length&&!/\s/.test(t[e]);)o+=t[e],e++;if(!this.suppressValidationErr&&!["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"].includes(o.toUpperCase()))throw new Error('Invalid attribute type: "'.concat(o,'"'))}e=V(t,e);var c="";if("#REQUIRED"===t.substring(e,e+8).toUpperCase())c="#REQUIRED",e+=8;else if("#IMPLIED"===t.substring(e,e+7).toUpperCase())c="#IMPLIED",e+=7;else{var s=U(this.readIdentifierVal(t,e,"ATTLIST"),2);e=s[0],c=s[1]}return{elementName:r,attributeName:n,attributeType:o,defaultValue:c,index:e}}}])&&G(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),V=function(t,e){for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function H(t,e,r){for(var n=0;n<e.length;n++)if(e[n]!==t[r+n+1])return!1;return!0}function Y(t){if(h(t))return t;throw new Error("Invalid entity name ".concat(t))}var W=/^[-+]?0x[a-fA-F0-9]+$/,K=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Q={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var J=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tt(t,e,r){return(e=ot(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ot(n.key),n)}}function nt(t,e,r){return e&&rt(t.prototype,e),r&&rt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ot(t){var e=function(t){if("object"!=et(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=et(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==et(e)?e:String(e)}var it=nt((function t(e){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(t,e){return xt(e,10,"&#")}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(t,e){return xt(e,16,"&#x")}}},this.addExternalEntities=at,this.parseXml=lt,this.parseTextData=ct,this.resolveNameSpace=st,this.buildAttributesMap=pt,this.isItStopNode=mt,this.replaceEntitiesValue=ht,this.readStopNodeData=gt,this.saveTextToParentTag=dt,this.addChild=ft,this.ignoreAttributesFn="function"==typeof(r=this.options.ignoreAttributes)?r:Array.isArray(r)?function(t){var e,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(r);try{for(n.s();!(e=n.n()).done;){var o=e.value;if("string"==typeof o&&t===o)return!0;if(o instanceof RegExp&&o.test(t))return!0}}catch(t){n.e(t)}finally{n.f()}}:function(){return!1},this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(var n=0;n<this.options.stopNodes.length;n++){var o=this.options.stopNodes[n];"string"==typeof o&&(o.startsWith("*.")?this.stopNodesWildcard.add(o.substring(2)):this.stopNodesExact.add(o))}}}));function at(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r],o=n.replace(/[.\-+*:]/g,"\\.");this.lastEntities[n]={regex:new RegExp("&"+o+";","g"),val:t[n]}}}function ct(t,e,r,n,o,i,a){if(void 0!==t&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t,e,r));var c=this.options.tagValueProcessor(e,t,r,o,i);return null==c?t:et(c)!==et(t)||c!==t?c:this.options.trimValues||t.trim()===t?bt(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function st(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var ut=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function pt(t,e,r){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){for(var n=f(t,ut),o=n.length,i={},a=0;a<o;a++){var c=this.resolveNameSpace(n[a][1]);if(!this.ignoreAttributesFn(c,e)){var s=n[a][4],u=this.options.attributeNamePrefix+c;if(c.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),"__proto__"===u&&(u="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s,r,e);var p=this.options.attributeValueProcessor(c,s,e);null==p?i[u]=s:et(p)!==et(s)||p!==s?i[u]=p:i[u]=bt(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[u]=!0)}}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){var l={};return l[this.options.attributesGroupName]=i,l}return i}}var lt=function(t){t=t.replace(/\r\n?/g,"\n");var e=new M("!xml"),r=e,n="",o="";this.entityExpansionCount=0,this.currentExpandedLength=0;for(var i=new Z(this.options.processEntities),a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var c=yt(t,">",a,"Closing Tag is not closed."),s=t.substring(a+2,c).trim();if(this.options.removeNSPrefix){var u=s.indexOf(":");-1!==u&&(s=s.substr(u+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),r&&(n=this.saveTextToParentTag(n,r,o));var p=o.substring(o.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error("Unpaired tag can not be used as closing tag: </".concat(s,">"));var l=0;p&&-1!==this.options.unpairedTags.indexOf(p)?(l=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=o.lastIndexOf("."),o=o.substring(0,l),r=this.tagsNodeStack.pop(),n="",a=c}else if("?"===t[a+1]){var f=vt(t,a,!1,"?>");if(!f)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,o),this.options.ignoreDeclaration&&"?xml"===f.tagName||this.options.ignorePiTags);else{var h=new M(f.tagName);h.add(this.options.textNodeName,""),f.tagName!==f.tagExp&&f.attrExpPresent&&(h[":@"]=this.buildAttributesMap(f.tagExp,o,f.tagName)),this.addChild(r,h,o,a)}a=f.closeIndex+1}else if("!--"===t.substr(a+1,3)){var d=yt(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var m=t.substring(a+4,d-2);n=this.saveTextToParentTag(n,r,o),r.add(this.options.commentPropName,[tt({},this.options.textNodeName,m)])}a=d}else if("!D"===t.substr(a+1,2)){var y=i.readDocType(t,a);this.docTypeEntities=y.entities,a=y.i}else if("!["===t.substr(a+1,2)){var v=yt(t,"]]>",a,"CDATA is not closed.")-2,g=t.substring(a+9,v);n=this.saveTextToParentTag(n,r,o);var b=this.parseTextData(g,r.tagname,o,!0,!1,!0,!0);null==b&&(b=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[tt({},this.options.textNodeName,g)]):r.add(this.options.textNodeName,b),a=v+2}else{var x=vt(t,a,this.options.removeNSPrefix),w=x.tagName,k=x.rawTagName,S=x.tagExp,E=x.attrExpPresent,O=x.closeIndex;if(this.options.transformTagName){var j=this.options.transformTagName(w);S===w&&(S=j),w=j}r&&n&&"!xml"!==r.tagname&&(n=this.saveTextToParentTag(n,r,o,!1));var F=r;F&&-1!==this.options.unpairedTags.indexOf(F.tagname)&&(r=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),w!==e.tagname&&(o+=o?"."+w:w);var _=a;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,o,w)){var P="";if(S.length>0&&S.lastIndexOf("/")===S.length-1)"/"===w[w.length-1]?(w=w.substr(0,w.length-1),o=o.substr(0,o.length-1),S=w):S=S.substr(0,S.length-1),a=x.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(w))a=x.closeIndex;else{var A=this.readStopNodeData(t,k,O+1);if(!A)throw new Error("Unexpected end of ".concat(k));a=A.i,P=A.tagContent}var T=new M(w);w!==S&&E&&(T[":@"]=this.buildAttributesMap(S,o,w)),P&&(P=this.parseTextData(P,w,o,!0,E,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),T.add(this.options.textNodeName,P),this.addChild(r,T,o,_)}else{if(S.length>0&&S.lastIndexOf("/")===S.length-1){if("/"===w[w.length-1]?(w=w.substr(0,w.length-1),o=o.substr(0,o.length-1),S=w):S=S.substr(0,S.length-1),this.options.transformTagName){var D=this.options.transformTagName(w);S===w&&(S=D),w=D}var L=new M(w);w!==S&&E&&(L[":@"]=this.buildAttributesMap(S,o,w)),this.addChild(r,L,o,_),o=o.substr(0,o.lastIndexOf("."))}else{var C=new M(w);this.tagsNodeStack.push(r),w!==S&&E&&(C[":@"]=this.buildAttributesMap(S,o,w)),this.addChild(r,C,o,_),r=C}n="",a=O}}else n+=t[a];return e.child};function ft(t,e,r,n){this.options.captureMetaData||(n=void 0);var o=this.options.updateTag(e.tagname,r,e[":@"]);!1===o||("string"==typeof o?(e.tagname=o,t.addChild(e,n)):t.addChild(e,n))}var ht=function(t,e,r){if(-1===t.indexOf("&"))return t;var n=this.options.processEntities;if(!n.enabled)return t;if(n.allowedTags&&!n.allowedTags.includes(e))return t;if(n.tagFilter&&!n.tagFilter(e,r))return t;for(var o in this.docTypeEntities){var i=this.docTypeEntities[o],a=t.match(i.regx);if(a){if(this.entityExpansionCount+=a.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions)throw new Error("Entity expansion limit exceeded: ".concat(this.entityExpansionCount," > ").concat(n.maxTotalExpansions));var c=t.length;if(t=t.replace(i.regx,i.val),n.maxExpandedLength&&(this.currentExpandedLength+=t.length-c,this.currentExpandedLength>n.maxExpandedLength))throw new Error("Total expanded content size exceeded: ".concat(this.currentExpandedLength," > ").concat(n.maxExpandedLength))}}if(-1===t.indexOf("&"))return t;for(var s in this.lastEntities){var u=this.lastEntities[s];t=t.replace(u.regex,u.val)}if(-1===t.indexOf("&"))return t;if(this.options.htmlEntities)for(var p in this.htmlEntities){var l=this.htmlEntities[p];t=t.replace(l.regex,l.val)}return t.replace(this.ampEntity.regex,this.ampEntity.val)};function dt(t,e,r,n){return t&&(void 0===n&&(n=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function mt(t,e,r,n){return!(!e||!e.has(n))||!(!t||!t.has(r))}function yt(t,e,r,n){var o=t.indexOf(e,r);if(-1===o)throw new Error(n);return o+e.length-1}function vt(t,e,r){var n=function(t,e){for(var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",o="",i=e;i<t.length;i++){var a=t[i];if(r)a===r&&(r="");else if('"'===a||"'"===a)r=a;else if(a===n[0]){if(!n[1])return{data:o,index:i};if(t[i+1]===n[1])return{data:o,index:i}}else"\t"===a&&(a=" ");o+=a}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(n){var o=n.data,i=n.index,a=o.search(/\s/),c=o,s=!0;-1!==a&&(c=o.substring(0,a),o=o.substring(a+1).trimStart());var u=c;if(r){var p=c.indexOf(":");-1!==p&&(s=(c=c.substr(p+1))!==n.data.substr(p+1))}return{tagName:c,tagExp:o,closeIndex:i,attrExpPresent:s,rawTagName:u}}}function gt(t,e,r){for(var n=r,o=1;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){var i=yt(t,">",r,"".concat(e," is not closed"));if(t.substring(r+2,i).trim()===e&&0==--o)return{tagContent:t.substring(n,r),i};r=i}else if("?"===t[r+1])r=yt(t,"?>",r+1,"StopNode is not closed.");else if("!--"===t.substr(r+1,3))r=yt(t,"--\x3e",r+3,"StopNode is not closed.");else if("!["===t.substr(r+1,2))r=yt(t,"]]>",r,"StopNode is not closed.")-2;else{var a=vt(t,r,">");a&&((a&&a.tagName)===e&&"/"!==a.tagExp[a.tagExp.length-1]&&o++,r=a.closeIndex)}}function bt(t,e,r){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=Object.assign({},Q,e),!t||"string"!=typeof t)return t;var r=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if("0"===t)return 0;if(e.hex&&W.test(r))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(r);if(r.includes("e")||r.includes("E"))return function(t,e,r){if(!r.eNotation)return t;var n=e.match(J);if(n){var o=n[1]||"",i=-1===n[3].indexOf("e")?"E":"e",a=n[2],c=o?t[a.length+1]===i:t[a.length]===i;return a.length>1&&c?t:1!==a.length||!n[3].startsWith(".".concat(i))&&n[3][0]!==i?r.leadingZeros&&!c?(e=(n[1]||"")+n[3],Number(e)):t:Number(e)}return t}(t,r,e);var n,o=K.exec(r);if(o){var i=o[1]||"",a=o[2],c=(n=o[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substring(0,n.length-1)),n):n,s=i?"."===t[a.length+1]:"."===t[a.length];if(!e.leadingZeros&&(a.length>1||1===a.length&&!s))return t;var u=Number(r),p=String(u);if(0===u)return u;if(-1!==p.search(/[eE]/))return e.eNotation?u:t;if(-1!==r.indexOf("."))return"0"===p||p===c||p==="".concat(i).concat(c)?u:t;var l=a?c:r;return a?l===p||i+l===p?u:t:l===p||l===i+p?u:t}return t}(t,r)}return void 0!==t?t:""}function xt(t,e,r){var n=Number.parseInt(t,e);return n>=0&&n<=1114111?String.fromCodePoint(n):r+t+";"}var wt=M.getMetaDataSymbol();function kt(t,e){return St(t,e)}function St(t,e,r){for(var n,o={},i=0;i<t.length;i++){var a,c=t[i],s=Et(c);if(a=void 0===r?s:r+"."+s,s===e.textNodeName)void 0===n?n=c[s]:n+=""+c[s];else{if(void 0===s)continue;if(c[s]){var u=St(c[s],e,a),p=jt(u,e);void 0!==c[wt]&&(u[wt]=c[wt]),c[":@"]?Ot(u,c[":@"],a,e):1!==Object.keys(u).length||void 0===u[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(u).length&&(e.alwaysCreateTextNode?u[e.textNodeName]="":u=""):u=u[e.textNodeName],void 0!==o[s]&&o.hasOwnProperty(s)?(Array.isArray(o[s])||(o[s]=[o[s]]),o[s].push(u)):e.isArray(s,a,p)?o[s]=[u]:o[s]=u}}}return"string"==typeof n?n.length>0&&(o[e.textNodeName]=n):void 0!==n&&(o[e.textNodeName]=n),o}function Et(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(":@"!==n)return n}}function Ot(t,e,r,n){if(e)for(var o=Object.keys(e),i=o.length,a=0;a<i;a++){var c=o[a];n.isArray(c,r+"."+c,!0,!0)?t[c]=[e[c]]:t[c]=e[c]}}function jt(t,e){var r=e.textNodeName,n=Object.keys(t).length;return 0===n||!(1!==n||!t[r]&&"boolean"!=typeof t[r]&&0!==t[r])}function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function _t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Pt(n.key),n)}}function Pt(t){var e=function(t){if("object"!=Ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ft(e)?e:String(e)}var At=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.externalEntities={},this.options=C(e)}var e,r,n;return e=t,n=[{key:"getMetaDataSymbol",value:function(){return M.getMetaDataSymbol()}}],(r=[{key:"parse",value:function(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});var r=m(t,e);if(!0!==r)throw Error("".concat(r.err.msg,":").concat(r.err.line,":").concat(r.err.col))}var n=new it(this.options);n.addExternalEntities(this.externalEntities);var o=n.parseXml(t);return this.options.preserveOrder||void 0===o?o:kt(o,this.options)}},{key:"addEntity",value:function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}}])&&_t(e.prototype,r),n&&_t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Tt=r(1227),Dt=r.n(Tt)()("fs:request:data"),Lt=function(t){return t=Ct(t),(0,n.V1)(t.data)||(t.data,0)||(t.data,0)||(0,n.fo)(t.data)||(0,n.qf)(t.data)||(0,n.mw)(t.data)||((0,n.OU)(t.data)?(t.headers=a(t.headers,"content-type","application/x-www-form-urlencoded;charset=utf-8"),t.data=t.data.toString()):(0,n.Gv)(t.data)&&(t.headers=a(t.headers,"content-type","application/json",!0),t.data=JSON.stringify(t.data))),t},Ct=function(t){return t.filestackHeaders?(t.headers=a(t.headers,"filestack-source",(0,u.getVersion)()),t.headers=a(t.headers,"filestack-trace-id","".concat(Math.floor(Date.now()/1e3),"-").concat((0,u.uniqueId)())),t.headers=a(t.headers,"filestack-trace-span","jssdk-".concat((0,u.uniqueId)())),t):t},It=function(t){return(0,s.sH)(void 0,void 0,void 0,(function(){var e,r;return(0,s.YH)(this,(function(n){if(!t.headers||!t.headers["content-type"])return[2,Promise.resolve(t)];if(e=t.headers["content-type"],/application\/json/.test(e))try{t.data=JSON.parse(t.data)}catch(e){Dt("Cannot parse response %O - %O",t.data,t.headers)}else/text\/(plain|html)/.test(e)?t.data:/application\/xml/.test(e)&&(r=t.data,t.data,!0===P.validate(r)&&(t.data=new At({ignoreDeclaration:!0,ignoreAttributes:!0,trimValues:!0}).parse(r)));return[2,Promise.resolve(t)]}))}))},zt=function(t,e){if(!e)return t;var r=Nt(e),n=t.indexOf("#");return-1!==n&&(t=t.slice(0,n)),t+(-1===t.indexOf("?")?"?":"&")+r},Nt=function(t){return Object.keys(t).filter((function(e){return e&&void 0!==t[e]})).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t[e]))})).join("&")},Rt=r(6854)},863:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(5465);t.exports=i.call(n,o)},1226:t=>{"use strict";t.exports=SyntaxError},1227:(t,e,r)=>{var n;e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),this.useColors){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(n++,"%c"===t&&(o=n))})),e.splice(o,0,r)}},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){var t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));var t},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(n=!1,function(){n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0