theseus/bundled-addons/docx-editor/vendor/docx-vendor.js

254 lines
1 MiB
JavaScript
Raw Normal View History

feat(docx-editor): edit Word documents without quietly eating what Word put in them A .docx editor is easy to write badly: read the file into HTML, let someone edit it, write a fresh document back, and hand them a file that lost its headers, its page size and half its formatting without ever saying so. Three things keep this one honest. The reader doesn't use mammoth's HTML. mammoth's converter is deliberately semantic, and HTML has nowhere to put a run's colour or a paragraph's line spacing, so it drops them — and those are controls this editor puts in the ribbon. Taking its parsed document model instead means what the ribbon offers is what the file can actually carry. Six properties mammoth's model didn't keep are added by build-time patches, each asserting its anchor so an upgrade that moves the code fails the build rather than shipping a lossy reader. The writer rebuilds the body but carries the rest of the package across: headers, footers, footnotes, endnotes, the document's own style catalogue, its theme and its page setup, with relationship ids and content types re-wired. Word features the editor can't model are still lost, so they are detected when the file opens and named in a banner before anyone edits. Tracked changes get their own gate. mammoth renders insertions as ordinary text and drops deletions, so saving would accept every pending revision without Word ever asking. Such a document opens read-only until the user says that is what they want. Verified over 66 real documents: 65 round-trip with an identical model and a structurally valid package, the one exception being a 7 MB WMF picture, which no browser can display and the writer cannot emit. Also driven end to end through a real Theseus over CDP — sidebar, ribbon, typing, save, reopen.
2026-09-20 20:46:29 +02:00
(()=>{var x3=Object.create;var fu=Object.defineProperty;var E3=Object.getOwnPropertyDescriptor;var A3=Object.getOwnPropertyNames;var S3=Object.getPrototypeOf,T3=Object.prototype.hasOwnProperty;var vr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ce=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var pe=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Ut=(e,t)=>{for(var r in t)fu(e,r,{get:t[r],enumerable:!0})},c1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of A3(t))!T3.call(e,i)&&i!==r&&fu(e,i,{get:()=>t[i],enumerable:!(n=E3(t,i))||n.enumerable});return e};var f1=(e,t,r)=>(r=e!=null?x3(S3(e)):{},c1(t||!e||!e.__esModule?fu(r,"default",{value:e,enumerable:!0}):r,e)),it=e=>c1(fu({},"__esModule",{value:!0}),e);var Ys,wh,Qs,hu,bh,h1,Gr,yn,d1,_h,p1,m1,xh,Eh,Ah,g1,y1,du,Sh,v1,Ye=ce(()=>{Ys="1.13.8",wh=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Qs=Array.prototype,hu=Object.prototype,bh=typeof Symbol<"u"?Symbol.prototype:null,h1=Qs.push,Gr=Qs.slice,yn=hu.toString,d1=hu.hasOwnProperty,_h=typeof ArrayBuffer<"u",p1=typeof DataView<"u",m1=Array.isArray,xh=Object.keys,Eh=Object.create,Ah=_h&&ArrayBuffer.isView,g1=isNaN,y1=isFinite,du=!{toString:null}.propertyIsEnumerable("toString"),Sh=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],v1=Math.pow(2,53)-1});function je(e,t){return t=t==null?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=arguments[i+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=n,e.apply(this,o)}}var Jt=ce(()=>{});function Nt(e){var t=typeof e;return t==="function"||t==="object"&&!!e}var Xn=ce(()=>{});function pu(e){return e===null}var w1=ce(()=>{});function Ao(e){return e===void 0}var Th=ce(()=>{});function So(e){return e===!0||e===!1||yn.call(e)==="[object Boolean]"}var Ch=ce(()=>{Ye()});function mu(e){return!!(e&&e.nodeType===1)}var b1=ce(()=>{});function Be(e){var t="[object "+e+"]";return function(r){return yn.call(r)===t}}var wt=ce(()=>{Ye()});var Ni,gu=ce(()=>{wt();Ni=Be("String")});var ea,kh=ce(()=>{wt();ea=Be("Number")});var Dh,_1=ce(()=>{wt();Dh=Be("Date")});var Nh,x1=ce(()=>{wt();Nh=Be("RegExp")});var Oh,E1=ce(()=>{wt();Oh=Be("Error")});var ta,Rh=ce(()=>{wt();ta=Be("Symbol")});var ra,Ih=ce(()=>{wt();ra=Be("ArrayBuffer")});var A1,C3,Ve,fr=ce(()=>{wt();Ye();A1=Be("Function"),C3=wh.document&&wh.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof C3!="function"&&(A1=function(e){return typeof e=="function"||!1});Ve=A1});var Fh,S1=ce(()=>{wt();Fh=Be("Object")});var yu,To,Co=ce(()=>{Ye();S1();yu=p1&&(!/\[native code\]/.test(String(DataView))||Fh(new DataView(new ArrayBuffer(8)))),To=typeof Map<"u"&&Fh(new Map)});function D3(e){return e!=null&&Ve(e.getInt8)&&ra(e.buffer)}var k3,Zn,vu=ce(()=>{wt();fr();Ih();Co();k3=Be("DataView");Zn=yu?D3:k3});var qt,Jn=ce(()=>{Ye();wt();qt=m1||Be("Array")});function bt(e,t){return e!=null&&d1.call(e,t)}var vn=ce(()=>{Ye()});var Mh,Oi,wu=ce(()=>{wt();vn();Mh=Be("Arguments");(function(){Mh(arguments)||(Mh=function(e){return bt(e,"callee")})})();Oi=Mh});function bu(e){return!ta(e)&&y1(e)&&!isNaN(parseFloat(e))}var T1=ce(()=>{Ye();Rh()});function ko(e){return ea(e)&&g1(e)}var Bh=ce(()=>{Ye();kh()});function Do(e){return function(){return e}}var Lh=ce(()=>{});function na(e){return function(t){var r=e(t);return typeof r=="number"&&r>=0&&r<=v1}}var Ph=ce(()=>{Ye()});function ia(e){return function(t){return t?.[e]}}var zh=ce(()=>{});var Ri,_u=ce(()=>{zh();Ri=ia("byteLength")});var C1,k1=ce(()=>{Ph();_u();C1=na(Ri)});function O3(e){return
((__t=(`+f+`))==null?'':_.escape(__t))+
'`:h?o+=`'+
((__t=(`+h+`))==null?'':__t)+
'`:p&&(o+=`';
`+p+`
__p+='`),c}),o+=`';
`;var s=t.variable;if(s){if(!L3.test(s))throw new Error("variable is not a bare identifier: "+s)}else o=`with(obj||{}){
`+o+`}
`,s="obj";o=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
`+o+`return __p;
`;var a;try{a=new Function(s,"_",o)}catch(c){throw c.source=o,c}var u=function(c){return a.call(this,c,De)};return u.source="function("+s+`){
`+o+"}",u}var dd,F3,M3,L3,Q1=ce(()=>{Qh();Yt();hd();dd=/(.)^/,F3={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},M3=/\\|'|\r|\n|\u2028|\u2029/g;L3=/^\s*(\w|\$)+\s*$/});function ju(e,t,r){t=Rr(t);var n=t.length;if(!n)return Ve(r)?r.call(e):r;for(var i=0;i<n;i++){var o=e?.[t[i]];o===void 0&&(o=r,i=n),e=Ve(o)?o.call(e):o}return e}var ey=ce(()=>{fr();Fo()});function Hu(e){var t=++P3+"";return e?e+t:t}var P3,ty=ce(()=>{P3=0});function Wu(e){var t=De(e);return t._chain=!0,t}var ry=ce(()=>{Yt()});function pa(e,t,r,n,i){if(!(n instanceof t))return e.apply(r,i);var o=ua(e.prototype),s=e.apply(o,i);return Nt(s)?s:o}var pd=ce(()=>{ed();Xn()});var md,bn,ma=ce(()=>{Jt();pd();Yt();md=je(function(e,t){var r=md.placeholder,n=function(){for(var i=0,o=t.length,s=Array(o),a=0;a<o;a++)s[a]=t[a]===r?arguments[i++]:t[a];for(;i<arguments.length;)s.push(arguments[i++]);return pa(e,n,this,this,s)};return n});md.placeholder=De;bn=md});var ga,gd=ce(()=>{Jt();fr();pd();ga=je(function(e,t,r){if(!Ve(e))throw new TypeError("Bind must be called on a function");var n=je(function(i){return pa(e,n,t,this,r.concat(i))});return n})});var Ze,er=ce(()=>{Ph();hr();Ze=na(Ge)});function dr(e,t,r){!t&&t!==0&&(t=1/0);for(var n=[],i=0,o=0,s=Ge(e)||0,a=[];;){if(o>=s){if(!a.length)break;var u=a.pop();o=u.i,e=u.v,s=Ge(e);continue}var c=e[o++];a.length>=t?n[i++]=c:Ze(c)&&(qt(c)||Oi(c))?(a.push({i:o,v:e}),o=0,e=c,s=Ge(e)):r||(n[i++]=c)}return n}var zi=ce(()=>{hr();er();Jn();wu()});var yd,ny=ce(()=>{Jt();zi();gd();yd=je(function(e,t){t=dr(t,!1,!1);var r=t.length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=t[r];e[n]=ga(e[n],e)}return e})});function Vu(e,t){var r=function(n){var i=r.cache,o=""+(t?t.apply(this,arguments):n);return bt(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return r.cache={},r}var iy=ce(()=>{vn()});var ya,vd=ce(()=>{Jt();ya=je(function(e,t,r){return setTimeout(function(){return e.apply(null,r)},t)})});var wd,oy=ce(()=>{ma();vd();Yt();wd=bn(ya,De,1)});function Gu(e,t,r){var n,i,o,s,a=0;r||(r={});var u=function(){a=r.leading===!1?0:wn(),n=null,s=e.apply(i,o),n||(i=o=null)},c=function(){var f=wn();!a&&r.leading===!1&&(a=f);var h=t-(f-a);return i=this,o=arguments,h<=0||h>t?(n&&(clearTimeout(n),n=null),a=f,s=e.apply(i,o),n||(i=o=null)):!n&&r.trailing!==!1&&(n=setTimeout(u,h)),s};return c.cancel=function(){clearTimeout(n),a=0,n=i=o=null},c}var sy=ce(()=>{zu()});function Ku(e,t,r){var n,i,o,s,a,u=function(){var f=wn()-i;t>f?n=setTimeout(u,t-f):(n=null,r||(s=e.apply(a,o)),n||(o=a=null))},c=je(function(f){return a=this,o=f,i=wn(),n||(n=setTimeout(u,t),r&&(s=e.apply(a,o))),s});return c.cancel=function(){clearTimeout(n),n=o=a=null},c}var ay=ce(()=>{Jt();zu()});function $u(e,t){return bn(t,e)}var ly=ce(()=>{ma()});function ti(e){return function(){return!e.apply(this,arguments)}}var Xu=ce(()=>{});function Zu(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}}var uy=ce(()=>{});function Ju(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}var cy=ce(()=>{});function Po(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}}var bd=ce(()=>{});var _d,fy=ce(()=>{ma();bd();_d=bn(Po,2)});function zo(e,t,r){t=He(t,r);for(var n=Re(e),i,o=0,s=n.length;o<s;o++)if(i=n[o],t(e[i],i,e))return i}var xd=ce(()=>{jt();ft()});function va(e){return function(t,r,n){r=He(r,n);for(var i=Ge(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(r(t[o],o,t))return o;return-1}}var Ed=ce(()=>{jt();hr()});var Ui,Yu=ce(()=>{Ed();Ui=va(1)});var wa,Ad=ce(()=>{Ed();wa=va(-1)});function Uo(e,t,r,n){r=He(r,n,1);for(var i=r(t),o=0,s=Ge(e);o<s;){var a=Math.floor((o+s)/2);r(e[a])<i?o=a+1:s=a}return o}var Sd=ce(()=>{jt();hr()});function ba(e,t,r){return function(n,i,o){var s=0,a=Ge(n);if(typeof o=="number")e>0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(r&&o&&a)return o=r(n,i),n[o]===i?o:-1;if(i!==i)return o=t(Gr.call(n,s,a),ko),o>=0?o+s:-1;for(o=e>0?s:a-1;o>=0&&o<a;o+=e)if(n[o]===i)return o;return-1}}var Td=ce(()=>{hr();Ye();Bh()})
See http://goo.gl/MqrFmX
`)},rp=np.getNativePromise();np.isNode&&typeof MutationObserver>"u"?(tv=global.setImmediate,rv=process.nextTick,Gi=np.isRecentNode?function(e){tv.call(global,e)}:function(e){rv.call(process,e)}):typeof rp=="function"&&typeof rp.resolve=="function"?(nv=rp.resolve(),Gi=function(e){nv.then(e)}):typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))?Gi=(function(){var e=document.createElement("div"),t={attributes:!0},r=!1,n=document.createElement("div"),i=new MutationObserver(function(){e.classList.toggle("foo"),r=!1});i.observe(n,t);var o=function(){r||(r=!0,n.classList.toggle("foo"))};return function(a){var u=new MutationObserver(function(){u.disconnect(),a()});u.observe(e,t),o()}})():typeof setImmediate<"u"?Gi=function(e){setImmediate(e)}:typeof setTimeout<"u"?Gi=function(e){setTimeout(e,0)}:Gi=U3;var tv,rv,nv;iv.exports=Gi});var av=pe((pZ,sv)=>{"use strict";function q3(e,t,r,n,i){for(var o=0;o<i;++o)r[o+n]=e[o+t],e[o+t]=void 0}function oi(e){this._capacity=e,this._length=0,this._front=0}oi.prototype._willBeOverCapacity=function(e){return this._capacity<e};oi.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1);var r=this._front+t&this._capacity-1;this[r]=e,this._length=t+1};oi.prototype.push=function(e,t,r){var n=this.length()+3;if(this._willBeOverCapacity(n)){this._pushOne(e),this._pushOne(t),this._pushOne(r);return}var i=this._front+n-3;this._checkCapacity(n);var o=this._capacity-1;this[i+0&o]=e,this[i+1&o]=t,this[i+2&o]=r,this._length=n};oi.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t};oi.prototype.length=function(){return this._length};oi.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)};oi.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e;var r=this._front,n=this._length,i=r+n&t-1;q3(this,0,this,t,i)};sv.exports=oi});var pv=pe((mZ,ip)=>{"use strict";var hv;try{throw new Error}catch(e){hv=e}var j3=ov(),lv=av(),dv=$e();function dt(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new lv(16),this._normalQueue=new lv(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=j3}dt.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t};dt.prototype.hasCustomScheduler=function(){return this._customScheduler};dt.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};dt.prototype.disableTrampolineIfNecessary=function(){dv.hasDevTools&&(this._trampolineEnabled=!1)};dt.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};dt.prototype.fatalError=function(e,t){t?(process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+`
`),process.exit(2)):this.throwLater(e)};dt.prototype.throwLater=function(e,t){if(arguments.length===1&&(t=e,e=function(){throw t}),typeof setTimeout<"u")setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch{throw new Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function uv(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()}function cv(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()}function fv(e){this._normalQueue._pushOne(e),this._queueTick()}dv.hasDevTools?(dt.prototype.invokeLater=function(e,t,r){this._trampolineEnabled?uv.call(this,e,t,r):this._schedule(function(){setTimeout(function(){e.call(t,r)},100)})},dt.prototype.invoke=function(e,t,r){this._trampolineEnabled?cv.call(this,e,t,r):this._schedule(function(){e.call(t,r)})},dt.prototype.settlePromises=function(e){this._trampolineEnabled?fv.call(this,e):this._schedule(function(){e._settlePromises()})}):(dt.prototype.invokeLater=uv,dt.prototype.invoke=cv,dt.prototype.settlePromises=fv);dt.prototype._drainQueue=function(e){for(;e.length()>0;){var t=e.shift();if(typeof t!="function"){t._settlePromises();continue}var r=e.shift(),n=e.shift();t.call(r,n)}};dt.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};dt.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))};dt.prototype._reset=function(){this._isTickUsed=!1};ip.exports=dt;ip.exports.firstLineError=hv});var xn=pe((gZ,yv)=>{"use strict";var ap=Vi(),H3=ap.freeze,mv=$e(),gv=mv.inherits,Jo=mv.notEnumerableProp;function Yo(e,t){function r(n){if(!(this instanceof r))return new r(n);Jo(this,"message",typeof n=="string"?n:t),Jo(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return gv(r,Error),r}var op,sp,W3=Yo("Warning","warning"),V3=Yo("CancellationError","cancellation error"),G3=Yo("TimeoutError","timeout error"),Na=Yo("AggregateError","aggregate error");try{op=TypeError,sp=RangeError}catch{op=Yo("TypeError","type error"),sp=Yo("RangeError","range error")}var gc="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(Zo=0;Zo<gc.length;++Zo)typeof Array.prototype[gc[Zo]]=="function"&&(Na.prototype[gc[Zo]]=Array.prototype[gc[Zo]]);var Zo;ap.defineProperty(Na.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});Na.prototype.isOperational=!0;var yc=0;Na.prototype.toString=function(){var e=Array(yc*4+1).join(" "),t=`
`+e+`AggregateError of:
`;yc++,e=Array(yc*4+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split(`
`),o=0;o<i.length;++o)i[o]=e+i[o];n=i.join(`
`),t+=n+`
`}return yc--,t};function Da(e){if(!(this instanceof Da))return new Da(e);Jo(this,"name","OperationalError"),Jo(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(Jo(this,"message",e.message),Jo(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}gv(Da,Error);var Ki=Error.__BluebirdErrorTypes__;Ki||(Ki=H3({CancellationError:V3,TimeoutError:G3,OperationalError:Da,RejectionError:Da,AggregateError:Na}),ap.defineProperty(Error,"__BluebirdErrorTypes__",{value:Ki,writable:!1,enumerable:!1,configurable:!1}));yv.exports={Error,TypeError:op,RangeError:sp,CancellationError:Ki.CancellationError,OperationalError:Ki.OperationalError,TimeoutError:Ki.TimeoutError,AggregateError:Ki.AggregateError,Warning:W3}});var wv=pe((yZ,vv)=>{"use strict";vv.exports=function(e,t){var r=$e(),n=r.errorObj,i=r.isObject;function o(h,p){if(i(h)){if(h instanceof e)return h;var d=a(h);if(d===n){p&&p._pushContext();var m=e.reject(d.e);return p&&p._popContext(),m}else if(typeof d=="function"){if(c(h)){var m=new e(t);return h._then(m._fulfill,m._reject,void 0,m,null),m}return f(h,d,p)}}return h}function s(h){return h.then}function a(h){try{return s(h)}catch(p){return n.e=p,n}}var u={}.hasOwnProperty;function c(h){try{return u.call(h,"_promise0")}catch{return!1}}function f(h,p,d){var m=new e(t),g=m;d&&d._pushContext(),m._captureStackTrace(),d&&d._popContext();var y=!0,w=r.tryCatch(p).call(h,E,b);y=!1,m&&w===n&&(m._rejectCallback(w.e,!0,!0),m=null);function E(C){m&&(m._resolveCallback(C),m=null)}function b(C){m&&(m._rejectCallback(C,y,!0),m=null)}return g}return o}});var _v=pe((vZ,bv)=>{"use strict";bv.exports=function(e,t,r,n,i){var o=$e(),s=o.isArray;function a(c){switch(c){case-2:return[];case-3:return{}}}function u(c){var f=this._promise=new e(t);c instanceof e&&f._propagateFrom(c,3),f._setOnCancel(this),this._values=c,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(u,i),u.prototype.length=function(){return this._length},u.prototype.promise=function(){return this._promise},u.prototype._init=function c(f,h){var p=r(this._values,this._promise);if(p instanceof e){p=p._target();var d=p._bitField;if(this._values=p,(d&50397184)===0)return this._promise._setAsyncGuaranteed(),p._then(c,this._reject,void 0,this,h);if((d&33554432)!==0)p=p._value();else return(d&16777216)!==0?this._reject(p._reason()):this._cancel()}if(p=o.asArray(p),p===null){var m=n("expecting an array or an iterable object but got "+o.classString(p)).reason();this._promise._rejectCallback(m,!1);return}if(p.length===0){h===-5?this._resolveEmptyArray():this._resolve(a(h));return}this._iterate(p)},u.prototype._iterate=function(c){var f=this.getActualLength(c.length);this._length=f,this._values=this.shouldCopyValues()?new Array(f):this._values;for(var h=this._promise,p=!1,d=null,m=0;m<f;++m){var g=r(c[m],h);g instanceof e?(g=g._target(),d=g._bitField):d=null,p?d!==null&&g.suppressUnhandledRejections():d!==null?(d&50397184)===0?(g._proxy(this,m),this._values[m]=g):(d&33554432)!==0?p=this._promiseFulfilled(g._value(),m):(d&16777216)!==0?p=this._promiseRejected(g._reason(),m):p=this._promiseCancelled(m):p=this._promiseFulfilled(g,m)}p||h._setAsyncGuaranteed()},u.prototype._isResolved=function(){return this._values===null},u.prototype._resolve=function(c){this._values=null,this._promise._fulfill(c)},u.prototype._cancel=function(){this._isResolved()||!this._promise._isCancellable()||(this._values=null,this._promise._cancel())},u.prototype._reject=function(c){this._values=null,this._promise._rejectCallback(c,!1)},u.prototype._promiseFulfilled=function(c,f){this._values[f]=c;var h=++this._totalResolved;return h>=this._length?(this._resolve(this._values),!0):!1},u.prototype._promiseCancelled=function(){return this._cancel(),!0},u.prototype._promiseRejected=function(c){return this._totalResolved++,this._reject(c),!0},u.prototype._resultCancelled=function(){if(!this._isResolved()){var c=this._values;if(this._cancel(),c instanceof e)c.cancel();else for(var f=0;f<c.length;++f)c[f]instanceof e&&c[f].cancel()}},u.prototype
See http://goo.gl/MqrFmX
`);if(!Z.longStackTraces&&I()){var K=e.prototype._captureStackTrace,te=e.prototype._attachExtraTrace;Z.longStackTraces=!0,C=function(){if(n.haveItemsQueued()&&!Z.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);e.prototype._captureStackTrace=K,e.prototype._attachExtraTrace=te,t.deactivateLongStackTraces(),n.enableTrampoline(),Z.longStackTraces=!1},e.prototype._captureStackTrace=G,e.prototype._attachExtraTrace=X,t.activateLongStackTraces(),n.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return Z.longStackTraces&&I()};var S=(function(){try{if(typeof CustomEvent=="function"){var K=new CustomEvent("CustomEvent");return o.global.dispatchEvent(K),function(te,ie){var se=new CustomEvent(te.toLowerCase(),{detail:ie,cancelable:!0});return!o.global.dispatchEvent(se)}}else if(typeof Event=="function"){var K=new Event("CustomEvent");return o.global.dispatchEvent(K),function(ie,se){var de=new Event(ie.toLowerCase(),{cancelable:!0});return de.detail=se,!o.global.dispatchEvent(de)}}else{var K=document.createEvent("CustomEvent");return K.initCustomEvent("testingtheevent",!1,!0,{}),o.global.dispatchEvent(K),function(ie,se){var de=document.createEvent("CustomEvent");return de.initCustomEvent(ie.toLowerCase(),!1,!0,se),!o.global.dispatchEvent(de)}}}catch{}return function(){return!1}})(),A=(function(){return o.isNode?function(){return process.emit.apply(process,arguments)}:o.global?function(K){var te="on"+K.toLowerCase(),ie=o.global[te];return ie?(ie.apply(o.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}})();function k(K,te){return{promise:te}}var B={promiseCreated:k,promiseFulfilled:k,promiseRejected:k,promiseResolved:k,promiseCancelled:k,promiseChained:function(K,te,ie){return{promise:te,child:ie}},warning:function(K,te){return{warning:te}},unhandledRejection:function(K,te,ie){return{reason:te,promise:ie}},rejectionHandled:k},O=function(K){var te=!1;try{te=A.apply(null,arguments)}catch(se){n.throwLater(se),te=!0}var ie=!1;try{ie=S(K,B[K].apply(null,arguments))}catch(se){n.throwLater(se),ie=!0}return ie||te};e.config=function(K){if(K=Object(K),"longStackTraces"in K&&(K.longStackTraces?e.longStackTraces():!K.longStackTraces&&e.hasLongStackTraces()&&C()),"warnings"in K){var te=K.warnings;Z.warnings=!!te,b=Z.warnings,o.isObject(te)&&"wForgottenReturn"in te&&(b=!!te.wForgottenReturn)}if("cancellation"in K&&K.cancellation&&!Z.cancellation){if(n.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=J,e.prototype._propagateFrom=j,e.prototype._onCancel=W,e.prototype._setOnCancel=F,e.prototype._attachCancellationCallback=_,e.prototype._execute=Y,$=j,Z.cancellation=!0}return"monitoring"in K&&(K.monitoring&&!Z.monitoring?(Z.monitoring=!0,e.prototype._fireEvent=O):!K.monitoring&&Z.monitoring&&(Z.monitoring=!1,e.prototype._fireEvent=P)),e};function P(){return!1}e.prototype._fireEvent=P,e.prototype._execute=function(K,te,ie){try{K(te,ie)}catch(se){return se}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(K){},e.prototype._attachCancellationCallback=function(K){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(K,te){};function Y(K,te,ie){var se=this;try{K(te,ie,function(de){if(typeof de!="function")throw new TypeError("onCancel must be a function, got: "+o.toString(de));se._attachCancellationCallback(de)})}catch(de){return de}}function _(K){if(!this._isCancellable())return this;var te=this._onCancel();te!==void 0?o.isArray(te)?te.push(K):this._setOnCancel([te,K]):this._setOnCancel(K)}function W(){return this._onCancelField}function F(K){this._onCancelField=K}function J(){this._cancellationParent=void 0,this._onCancelField=void 0}function j(K,te){if((te&1)!==0){this._cancellationParent=K;var ie=K._branchesRemainingToCancel;ie===void 0&&(ie=0),K._branchesRemainingToCancel=ie+1}(te&2)!==0&&K._isBound()&&this._setBoundTo(K._boundTo)}function H(K,te){(te&2)!==0&&K._isBound()&&this._setBoundTo(K._boundTo)}var $=H;function z(){var K=this._boundTo;return K!==void 0&&K instanceof e?K.isFulfilled()?K.value():void 0:K}function G(){this._trace=new U(this._peekContext())}function X(K,te){if(s(K)){var ie=this._trace;if(ie!=
`+se.stack.join(`
`)),o.notEnumerableProp(K,"__stackCleaned__",!0)}}}function q(K,te,ie,se,de){if(K===void 0&&te!==null&&b){if(de!==void 0&&de._returnedNonUndefined()||(se._bitField&65535)===0)return;ie&&(ie=ie+" ");var xe="",Te="";if(te._trace){for(var Ae=te._trace.stack.split(`
`),Se=M(Ae),Pe=Se.length-1;Pe>=0;--Pe){var Ie=Se[Pe];if(!f.test(Ie)){var Qe=Ie.match(h);Qe&&(xe="at "+Qe[1]+":"+Qe[2]+":"+Qe[3]+" ");break}}if(Se.length>0){for(var $n=Se[0],Pe=0;Pe<Ae.length;++Pe)if(Ae[Pe]===$n){Pe>0&&(Te=`
`+Ae[Pe-1]);break}}}var cr="a promise was created in a "+ie+"handler "+xe+"but was not returned from it, see http://goo.gl/rRqMUw"+Te;se._warn(cr,!0,te)}}function Q(K,te){var ie=K+" is deprecated and will be removed in a future version.";return te&&(ie+=" Use "+te+" instead."),oe(ie)}function oe(K,te,ie){if(Z.warnings){var se=new i(K),de;if(te)ie._attachExtraTrace(se);else if(Z.longStackTraces&&(de=e._peekContext()))de.attachExtraTrace(se);else{var xe=ne(se);se.stack=xe.message+`
`+xe.stack.join(`
`)}O("warning",se)||fe(se,"",!0)}}function ae(K,te){for(var ie=0;ie<te.length-1;++ie)te[ie].push("From previous event:"),te[ie]=te[ie].join(`
`);return ie<te.length&&(te[ie]=te[ie].join(`
`)),K+`
`+te.join(`
`)}function he(K){for(var te=0;te<K.length;++te)(K[te].length===0||te+1<K.length&&K[te][0]===K[te+1][0])&&(K.splice(te,1),te--)}function L(K){for(var te=K[0],ie=1;ie<K.length;++ie){for(var se=K[ie],de=te.length-1,xe=te[de],Te=-1,Ae=se.length-1;Ae>=0;--Ae)if(se[Ae]===xe){Te=Ae;break}for(var Ae=Te;Ae>=0;--Ae){var Se=se[Ae];if(te[de]===Se)te.pop(),de--;else break}te=se}}function M(K){for(var te=[],ie=0;ie<K.length;++ie){var se=K[ie],de=se===" (No stack trace)"||p.test(se),xe=de&&T(se);de&&!xe&&(m&&se.charAt(0)!==" "&&(se=" "+se),te.push(se))}return te}function re(K){for(var te=K.stack.replace(/\s+$/g,"").split(`
`),ie=0;ie<te.length;++ie){var se=te[ie];if(se===" (No stack trace)"||p.test(se))break}return ie>0&&K.name!="SyntaxError"&&(te=te.slice(ie)),te}function ne(K){var te=K.stack,ie=K.toString();return te=typeof te=="string"&&te.length>0?re(K):[" (No stack trace)"],{message:ie,stack:K.name=="SyntaxError"?te:M(te)}}function fe(K,te,ie){if(typeof console<"u"){var se;if(o.isObject(K)){var de=K.stack;se=te+d(de,K)}else se=te+String(K);typeof g=="function"?g(se,ie):(typeof console.log=="function"||typeof console.log=="object")&&console.log(se)}}function D(K,te,ie,se){var de=!1;try{typeof te=="function"&&(de=!0,K==="rejectionHandled"?te(se):te(ie,se))}catch(xe){n.throwLater(xe)}K==="unhandledRejection"?!O(K,ie,se)&&!de&&fe(ie,"Unhandled rejection "):O(K,se)}function V(K){var te;if(typeof K=="function")te="[function "+(K.name||"anonymous")+"]";else{te=K&&typeof K.toString=="function"?K.toString():o.toString(K);var ie=/\[object [a-zA-Z0-9$_]+\]/;if(ie.test(te))try{var se=JSON.stringify(K);te=se}catch{}te.length===0&&(te="(empty array)")}return"(<"+N(te)+">, no stack trace)"}function N(K){var te=41;return K.length<te?K:K.substr(0,te-3)+"..."}function I(){return typeof ee=="function"}var T=function(){return!1},v=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function x(K){var te=K.match(v);if(te)return{fileName:te[1],line:parseInt(te[2],10)}}function R(K,te){if(I()){for(var ie=K.stack.split(`
`),se=te.stack.split(`
`),de=-1,xe=-1,Te,Ae,Se=0;Se<ie.length;++Se){var Pe=x(ie[Se]);if(Pe){Te=Pe.fileName,de=Pe.line;break}}for(var Se=0;Se<se.length;++Se){var Pe=x(se[Se]);if(Pe){Ae=Pe.fileName,xe=Pe.line;break}}de<0||xe<0||!Te||!Ae||Te!==Ae||de>=xe||(T=function(Ie){if(c.test(Ie))return!0;var Qe=x(Ie);return!!(Qe&&Qe.fileName===Te&&de<=Qe.line&&Qe.line<=xe)})}}function U(K){this._parent=K,this._promisesCreated=0;var te=this._length=1+(K===void 0?0:K._length);ee(this,U),te>32&&this.uncycle()}o.inherits(U,Error),t.CapturedTrace=U,U.prototype.uncycle=function(){var K=this._length;if(!(K<2)){for(var te=[],ie={},se=0,de=this;de!==void 0;++se)te.push(de),de=de._parent;K=this._length=se;for(var se=K-1;se>=0;--se){var xe=te[se].stack;ie[xe]===void 0&&(ie[xe]=se)}for(var se=0;se<K;++se){var Te=te[se].stack,Ae=ie[Te];if(Ae!==void 0&&Ae!==se){Ae>0&&(te[Ae-1]._parent=void 0,te[Ae-1]._length=1),te[se]._parent=void 0,te[se]._length=1;var Se=se>0?te[se-1]:this;Ae<K-1?(Se._parent=te[Ae+1],Se._parent.uncycle(),Se._length=Se._parent._length+1):(Se._parent=void 0,Se._length=1);for(var Pe=Se._length+1,Ie=se-2;Ie>=0;--Ie)te[Ie]._length=Pe,Pe++;return}}}},U.prototype.attachExtraTrace=function(K){if(!K.__stackCleaned__){this.uncycle();for(var te=ne(K),ie=te.message,se=[te.stack],de=this;de!==void 0;)se.push(M(de.stack.split(`
`))),de=de._parent;L(se),he(se),o.notEnumerableProp(K,"stack",ae(ie,se)),o.notEnumerableProp(K,"__stackCleaned__",!0)}};var ee=(function(){var te=/^\s*at\s*/,ie=function(Te,Ae){return typeof Te=="string"?Te:Ae.name!==void 0&&Ae.message!==void 0?Ae.toString():V(Ae)};if(typeof Error.stackTraceLimit=="number"&&typeof Error.captureStackTrace=="function"){Error.stackTraceLimit+=6,p=te,d=ie;var se=Error.captureStackTrace;return T=function(Te){return c.test(Te)},function(Te,Ae){Error.stackTraceLimit+=6,se(Te,Ae),Error.stackTraceLimit-=6}}var de=new Error;if(typeof de.stack=="string"&&de.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return p=/@/,d=ie,m=!0,function(Ae){Ae.stack=new Error().stack};var xe;try{throw new Error}catch(Te){xe="stack"in Te}return!("stack"in de)&&xe&&typeof Error.stackTraceLimit=="number"?(p=te,d=ie,function(Ae){Error.stackTraceLimit+=6;try{throw new Error}catch(Se){Ae.stack=Se.stack}Error.stackTraceLimit-=6}):(d=function(Te,Ae){return typeof Te=="string"?Te:(typeof Ae=="object"||typeof Ae=="function")&&Ae.name!==void 0&&Ae.message!==void 0?Ae.toString():V(Ae)},null)})([]);typeof console<"u"&&typeof console.warn<"u"&&(g=function(K){console.warn(K)},o.isNode&&process.stderr.isTTY?g=function(K,te){var ie=te?"\x1B[33m":"\x1B[31m";console.warn(ie+K+`\x1B[0m
`)}:!o.isNode&&typeof new Error().stack=="string"&&(g=function(K,te){console.warn("%c"+K,te?"color: darkorange":"color: red")}));var Z={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1};return E&&e.longStackTraces(),{longStackTraces:function(){return Z.longStackTraces},warnings:function(){return Z.warnings},cancellation:function(){return Z.cancellation},monitoring:function(){return Z.monitoring},propagateFromFunction:function(){return $},boundValueFunction:function(){return z},checkForgottenReturns:q,setBounds:R,warn:oe,deprecated:Q,CapturedTrace:U,fireDomEvent:S,fireGlobalEvent:A}}});var Cv=pe((_Z,Tv)=>{"use strict";Tv.exports=function(e,t){var r=$e(),n=e.CancellationError,i=r.errorObj;function o(h,p,d){this.promise=h,this.type=p,this.handler=d,this.called=!1,this.cancelPromise=null}o.prototype.isFinallyHandler=function(){return this.type===0};function s(h){this.finallyHandler=h}s.prototype._resultCancelled=function(){a(this.finallyHandler)};function a(h,p){return h.cancelPromise!=null?(arguments.length>1?h.cancelPromise._reject(p):h.cancelPromise._cancel(),h.cancelPromise=null,!0):!1}function u(){return f.call(this,this.promise._target()._settledValue())}function c(h){if(!a(this,h))return i.e=h,i}function f(h){var p=this.promise,d=this.handler;if(!this.called){this.called=!0;var m=this.isFinallyHandler()?d.call(p._boundValue()):d.call(p._boundValue(),h);if(m!==void 0){p._setReturnedNonUndefined();var g=t(m,p);if(g instanceof e){if(this.cancelPromise!=null)if(g._isCancelled()){var y=new n("late cancellation observer");return p._attachExtraTrace(y),i.e=y,i}else g.isPending()&&g._attachCancellationCallback(new s(this));return g._then(u,c,void 0,this,void 0)}}}return p.isRejected()?(a(this),i.e=h,i):(a(this),h)}return e.prototype._passThrough=function(h,p,d,m){return typeof h!="function"?this.then():this._then(d,m,void 0,new o(this,p,h),void 0)},e.prototype.lastly=e.prototype.finally=function(h){return this._passThrough(h,0,f,f)},e.prototype.tap=function(h){return this._passThrough(h,1,f)},o}});var Dv=pe((xZ,kv)=>{"use strict";kv.exports=function(e){var t=$e(),r=Vi().keys,n=t.tryCatch,i=t.errorObj;function o(s,a,u){return function(c){var f=u._boundValue();e:for(var h=0;h<s.length;++h){var p=s[h];if(p===Error||p!=null&&p.prototype instanceof Error){if(c instanceof p)return n(a).call(f,c)}else if(typeof p=="function"){var d=n(p).call(f,c);if(d===i)return d;if(d)return n(a).call(f,c)}else if(t.isObject(c)){for(var m=r(p),g=0;g<m.length;++g){var y=m[g];if(p[y]!=c[y])continue e}return n(a).call(f,c)}}return e}}return o}});var lp=pe((EZ,Rv)=>{"use strict";var Nv=$e(),K3=Nv.maybeWrapAsError,$3=xn(),X3=$3.OperationalError,Ov=Vi();function Z3(e){return e instanceof Error&&Ov.getPrototypeOf(e)===Error.prototype}var J3=/^(?:name|message|stack|cause)$/;function Y3(e){var t;if(Z3(e)){t=new X3(e),t.name=e.name,t.message=e.message,t.stack=e.stack;for(var r=Ov.keys(e),n=0;n<r.length;++n){var i=r[n];J3.test(i)||(t[i]=e[i])}return t}return Nv.markAsOriginatingFromRejection(e),e}function Q3(e,t){return function(r,n){if(e!==null){if(r){var i=Y3(K3(r));e._attachExtraTrace(i),e._reject(i)}else if(!t)e._fulfill(n);else{for(var o=arguments.length,s=new Array(Math.max(o-1,0)),a=1;a<o;++a)s[a-1]=arguments[a];e._fulfill(s)}e=null}}}Rv.exports=Q3});var Fv=pe((AZ,Iv)=>{"use strict";Iv.exports=function(e,t,r,n,i){var o=$e(),s=o.tryCatch;e.method=function(a){if(typeof a!="function")throw new e.TypeError("expecting a function but got "+o.classString(a));return function(){var u=new e(t);u._captureStackTrace(),u._pushContext();var c=s(a).apply(this,arguments),f=u._popContext();return i.checkForgottenReturns(c,f,"Promise.method",u),u._resolveFromSyncValue(c),u}},e.attempt=e.try=function(a){if(typeof a!="function")return n("expecting a function but got "+o.classString(a));var u=new e(t);u._captureStackTrace(),u._pushContext();var c;if(arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var f=arguments[1],h=arguments[2];c=o.isArray(f)?s(a).apply(h,f):s(a).call(h,f)}else c=s(a)();var p=u._popContext();return i.checkFor
See http://goo.gl/MqrFmX
`);return this._settledValue()},n=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError(`cannot get rejection reason of a non-rejected promise
See http://goo.gl/MqrFmX
`);return this._settledValue()},i=t.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},o=t.prototype.isRejected=function(){return(this._bitField&16777216)!==0},s=t.prototype.isPending=function(){return(this._bitField&50397184)===0},a=t.prototype.isResolved=function(){return(this._bitField&50331648)!==0};t.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},e.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},e.prototype.isPending=function(){return s.call(this._target())},e.prototype.isRejected=function(){return o.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var u=this._target();return u._unsetRejectionIsUnhandled(),n.call(u)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}});var Wv=pe((DZ,Hv)=>{"use strict";Hv.exports=function(e,t,r,n,i,o){var s=$e(),a=s.canEvaluate,u=s.tryCatch,c=s.errorObj,f;if(a){for(var h=function(E){return new Function("value","holder",`
'use strict';
holder.pIndex = value;
holder.checkFulfillment(this);
`.replace(/Index/g,E))},p=function(E){return new Function("promise","holder",`
'use strict';
holder.pIndex = promise;
`.replace(/Index/g,E))},d=function(E){for(var b=new Array(E),C=0;C<b.length;++C)b[C]="this.p"+(C+1);var S=b.join(" = ")+" = null;",A=`var promise;
`+b.map(function(P){return`
promise = `+P+`;
if (promise instanceof Promise) {
promise.cancel();
}
`}).join(`
`),k=b.join(", "),B="Holder$"+E,O=`return function(tryCatch, errorObj, Promise, async) {
'use strict';
function [TheName](fn) {
[TheProperties]
this.fn = fn;
this.asyncNeeded = true;
this.now = 0;
}
[TheName].prototype._callFunction = function(promise) {
promise._pushContext();
var ret = tryCatch(this.fn)([ThePassedArguments]);
promise._popContext();
if (ret === errorObj) {
promise._rejectCallback(ret.e, false);
} else {
promise._resolveCallback(ret);
}
};
[TheName].prototype.checkFulfillment = function(promise) {
var now = ++this.now;
if (now === [TheTotal]) {
if (this.asyncNeeded) {
async.invoke(this._callFunction, this, promise);
} else {
this._callFunction(promise);
}
}
};
[TheName].prototype._resultCancelled = function() {
[CancellationCode]
};
return [TheName];
}(tryCatch, errorObj, Promise, async);
`;return O=O.replace(/\[TheName\]/g,B).replace(/\[TheTotal\]/g,E).replace(/\[ThePassedArguments\]/g,k).replace(/\[TheProperties\]/g,S).replace(/\[CancellationCode\]/g,A),new Function("tryCatch","errorObj","Promise","async",O)(u,c,e,i)},m=[],g=[],y=[],w=0;w<8;++w)m.push(d(w+1)),g.push(h(w+1)),y.push(p(w+1));f=function(E){this._reject(E)}}e.join=function(){var E=arguments.length-1,b;if(E>0&&typeof arguments[E]=="function"&&(b=arguments[E],E<=8&&a)){var F=new e(n);F._captureStackTrace();for(var C=m[E-1],S=new C(b),A=g,k=0;k<E;++k){var B=r(arguments[k],F);if(B instanceof e){B=B._target();var O=B._bitField;(O&50397184)===0?(B._then(A[k],f,void 0,F,S),y[k](B,S),S.asyncNeeded=!1):(O&33554432)!==0?A[k].call(F,B._value(),S):(O&16777216)!==0?F._reject(B._reason()):F._cancel()}else A[k].call(F,B,S)}if(!F._isFateSealed()){if(S.asyncNeeded){var P=o();P!==null&&(S.fn=s.domainBind(P,S.fn))}F._setAsyncGuaranteed(),F._setOnCancel(S)}return F}for(var Y=arguments.length,_=new Array(Y),W=0;W<Y;++W)_[W]=arguments[W];b&&_.pop();var F=new t(_).promise();return b!==void 0?F.spread(b):F}}});var Gv=pe((NZ,Vv)=>{"use strict";Vv.exports=function(e,t,r,n,i,o){var s=e._getDomain,a=$e(),u=a.tryCatch,c=a.errorObj,f=e._async;function h(d,m,g,y){this.constructor$(d),this._promise._captureStackTrace();var w=s();this._callback=w===null?m:a.domainBind(w,m),this._preservedValues=y===i?new Array(this.length()):null,this._limit=g,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}a.inherits(h,t),h.prototype._asyncInit=function(){this._init$(void 0,-2)},h.prototype._init=function(){},h.prototype._promiseFulfilled=function(d,m){var g=this._values,y=this.length(),w=this._preservedValues,E=this._limit;if(m<0){if(m=m*-1-1,g[m]=d,E>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(E>=1&&this._inFlight>=E)return g[m]=d,this._queue.push(m),!1;w!==null&&(w[m]=d);var b=this._promise,C=this._callback,S=b._boundValue();b._pushContext();var A=u(C).call(S,d,m,y),k=b._popContext();if(o.checkForgottenReturns(A,k,w!==null?"Promise.filter":"Promise.map",b),A===c)return this._reject(A.e),!0;var B=n(A,this._promise);if(B instanceof e){B=B._target();var O=B._bitField;if((O&50397184)===0)return E>=1&&this._inFlight++,g[m]=B,B._proxy(this,(m+1)*-1),!1;if((O&33554432)!==0)A=B._value();else return(O&16777216)!==0?(this._reject(B._reason()),!0):(this._cancel(),!0)}g[m]=A}var P=++this._totalResolved;return P>=y?(w!==null?this._filter(g,w):this._resolve(g),!0):!1},h.prototype._drainQueue=function(){for(var d=this._queue,m=this._limit,g=this._values;d.length>0&&this._inFlight<m;){if(this._isResolved())return;var y=d.pop();this._promiseFulfilled(g[y],y)}},h.prototype._filter=function(d,m){for(var g=m.length,y=new Array(g),w=0,E=0;E<g;++E)d[E]&&(y[w++]=m[E]);y.length=w,this._resolve(y)},h.prototype.preservedValues=function(){return this._preservedValues};function p(d,m,g,y){if(typeof m!="function")return r("expecting a function but got "+a.classString(m));var w=0;if(g!==void 0)if(typeof g=="object"&&g!==null){if(typeof g.concurrency!="number")return e.reject(new TypeError("'concurrency' must be a number but it is "+a.classString(g.concurrency)));w=g.concurrency}else return e.reject(new TypeError("options argument must be an object but it is "+a.classString(g)));return w=typeof w=="number"&&isFinite(w)&&w>=1?w:0,new h(d,m,w,y).promise()}e.prototype.map=function(d,m){return p(this,d,m,null)},e.map=function(d,m,g,y){return p(d,m,g,y)}}});var $v=pe((OZ,Kv)=>{"use strict";var up=Object.create;up&&(cp=up(null),fp=up(null),cp[" size"]=fp[" size"]=0);var cp,fp;Kv.exports=function(e){var t=$e(),r=t.canEvaluate,n=t.isIdentifier,i,o,s=function(d){return new Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
ensureMethod(obj, 'methodName');
switch(len) {
case 1: return obj.methodName(this[0]);
case 2: return obj.methodName(this[0], this[1]);
case 3: return obj.methodName(this[0], this[1], this[2]);
case 0: return obj.methodName();
default:
return obj.methodName.apply(obj, this);
}
};
`.replace(/methodName/g,d))(c)},a=function(d){return new Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",d))},u=function(d,m,g){var y=g[d];if(typeof y!="function"){if(!n(d))return null;if(y=m(d),g[d]=y,g[" size"]++,g[" size"]>512){for(var w=Object.keys(g),E=0;E<256;++E)delete g[w[E]];g[" size"]=w.length-256}}return y};i=function(d){return u(d,s,cp)},o=function(d){return u(d,a,fp)};function c(d,m){var g;if(d!=null&&(g=d[m]),typeof g!="function"){var y="Object "+t.classString(d)+" has no method '"+t.toString(m)+"'";throw new e.TypeError(y)}return g}function f(d){var m=this.pop(),g=c(d,m);return g.apply(d,this)}e.prototype.call=function(d){for(var m=arguments.length,g=new Array(Math.max(m-1,0)),y=1;y<m;++y)g[y-1]=arguments[y];if(r){var w=i(d);if(w!==null)return this._then(w,void 0,void 0,g,void 0)}return g.push(d),this._then(f,void 0,void 0,g,void 0)};function h(d){return d[this]}function p(d){var m=+this;return m<0&&(m=Math.max(0,m+d.length)),d[m]}e.prototype.get=function(d){var m=typeof d=="number",g;if(m)g=p;else if(r){var y=o(d);g=y!==null?y:h}else g=h;return this._then(g,void 0,void 0,d,void 0)}}});var Zv=pe((RZ,Xv)=>{"use strict";Xv.exports=function(e,t,r,n,i,o){var s=$e(),a=xn().TypeError,u=$e().inherits,c=s.errorObj,f=s.tryCatch,h={};function p(b){setTimeout(function(){throw b},0)}function d(b){var C=r(b);return C!==b&&typeof b._isDisposable=="function"&&typeof b._getDisposer=="function"&&b._isDisposable()&&C._setDisposable(b._getDisposer()),C}function m(b,C){var S=0,A=b.length,k=new e(i);function B(){if(S>=A)return k._fulfill();var O=d(b[S++]);if(O instanceof e&&O._isDisposable()){try{O=r(O._getDisposer().tryDispose(C),b.promise)}catch(P){return p(P)}if(O instanceof e)return O._then(B,p,null,null,null)}B()}return B(),k}function g(b,C,S){this._data=b,this._promise=C,this._context=S}g.prototype.data=function(){return this._data},g.prototype.promise=function(){return this._promise},g.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},g.prototype.tryDispose=function(b){var C=this.resource(),S=this._context;S!==void 0&&S._pushContext();var A=C!==h?this.doDispose(C,b):null;return S!==void 0&&S._popContext(),this._promise._unsetDisposable(),this._data=null,A},g.isDisposer=function(b){return b!=null&&typeof b.resource=="function"&&typeof b.tryDispose=="function"};function y(b,C,S){this.constructor$(b,C,S)}u(y,g),y.prototype.doDispose=function(b,C){var S=this.data();return S.call(b,b,C)};function w(b){return g.isDisposer(b)?(this.resources[this.index]._setDisposable(b),b.promise()):b}function E(b){this.length=b,this.promise=null,this[b-1]=null}E.prototype._resultCancelled=function(){for(var b=this.length,C=0;C<b;++C){var S=this[C];S instanceof e&&S.cancel()}},e.using=function(){var b=arguments.length;if(b<2)return t("you must pass at least 2 arguments to Promise.using");var C=arguments[b-1];if(typeof C!="function")return t("expecting a function but got "+s.classString(C));var S,A=!0;b===2&&Array.isArray(arguments[0])?(S=arguments[0],b=S.length,A=!1):(S=arguments,b--);for(var k=new E(b),B=0;B<b;++B){var O=S[B];if(g.isDisposer(O)){var P=O;O=O.promise(),O._setDisposable(P)}else{var Y=r(O);Y instanceof e&&(O=Y._then(w,null,null,{resources:k,index:B},void 0))}k[B]=O}for(var _=new Array(k.length),B=0;B<_.length;++B)_[B]=e.resolve(k[B]).reflect();var W=e.all(_).then(function(J){for(var j=0;j<J.length;++j){var H=J[j];if(H.isRejected())return c.e=H.error(),c;if(!H.isFulfilled()){W.cancel();return}J[j]=H.value()}F._pushContext(),C=f(C);var $=A?C.apply(void 0,J):C(J),z=F._popContext();return o.checkForgottenReturns($,z,"Promise.using",F),$}),F=W.lastly(function(){var J=new e.PromiseInspection(W);return m(k,J)});return k.promise=F,F._setOnCancel(k),F},e.prototype._setDisposable=function(b){this._bitField=this._bitField|131072,this._disposer=b},e.prototype._isDisposable=function(){return(this._bitField&131072)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},e.prototype.disposer=function(b){if(typeof b=="function")return new y(b,this,n());throw new a}}})
See http://goo.gl/MqrFmX
`.replace("%s",y)+`From coroutine:
`+this._stack.split(`
`).slice(1,-7).join(`
`)));return}w=w._target();var E=w._bitField;(E&50397184)===0?(this._yieldedPromise=w,w._proxy(this,null)):(E&33554432)!==0?e._async.invoke(this._promiseFulfilled,this,w._value()):(E&16777216)!==0?e._async.invoke(this._promiseRejected,this,w._reason()):this._promiseCancelled()},e.coroutine=function(m,g){if(typeof m!="function")throw new a(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var y=Object(g).yieldHandler,w=d,E=new Error().stack;return function(){var b=m.apply(this,arguments),C=new w(void 0,void 0,y,E),S=C.promise();return C._generator=b,C._promiseFulfilled(void 0),S}},e.coroutine.addYieldHandler=function(m){if(typeof m!="function")throw new a("expecting a function but got "+u.classString(m));h.push(m)},e.spawn=function(m){if(o.deprecated("Promise.spawn()","Promise.coroutine()"),typeof m!="function")return t(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var g=new d(m,this),y=g.promise();return g._run(e.spawn),y}}});var r2=pe((MZ,t2)=>{"use strict";t2.exports=function(e){var t=$e(),r=e._async,n=t.tryCatch,i=t.errorObj;function o(u,c){var f=this;if(!t.isArray(u))return s.call(f,u,c);var h=n(c).apply(f._boundValue(),[null].concat(u));h===i&&r.throwLater(h.e)}function s(u,c){var f=this,h=f._boundValue(),p=u===void 0?n(c).call(h,null):n(c).call(h,null,u);p===i&&r.throwLater(p.e)}function a(u,c){var f=this;if(!u){var h=new Error(u+"");h.cause=u,u=h}var p=n(c).call(f._boundValue(),u);p===i&&r.throwLater(p.e)}e.prototype.asCallback=e.prototype.nodeify=function(u,c){if(typeof u=="function"){var f=s;c!==void 0&&Object(c).spread&&(f=o),this._then(f,a,void 0,this,u)}return this}}});var i2=pe((BZ,n2)=>{"use strict";n2.exports=function(e,t){var r={},n=$e(),i=lp(),o=n.withAppended,s=n.maybeWrapAsError,a=n.canEvaluate,u=xn().TypeError,c="Async",f={__isPromisified__:!0},h=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],p=new RegExp("^(?:"+h.join("|")+")$"),d=function(W){return n.isIdentifier(W)&&W.charAt(0)!=="_"&&W!=="constructor"};function m(W){return!p.test(W)}function g(W){try{return W.__isPromisified__===!0}catch{return!1}}function y(W,F,J){var j=n.getDataPropertyOrDefault(W,F+J,f);return j?g(j):!1}function w(W,F,J){for(var j=0;j<W.length;j+=2){var H=W[j];if(J.test(H)){for(var $=H.replace(J,""),z=0;z<W.length;z+=2)if(W[z]===$)throw new u(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",F))}}}function E(W,F,J,j){for(var H=n.inheritedDataKeys(W),$=[],z=0;z<H.length;++z){var G=H[z],X=W[G],q=j===d?!0:d(G,X,W);typeof X=="function"&&!g(X)&&!y(W,G,F)&&j(G,X,W,q)&&$.push(G,X)}return w($,F,J),$}var b=function(W){return W.replace(/([$])/,"\\$")},C,S=function(W){for(var F=[W],J=Math.max(0,W-1-3),j=W-1;j>=J;--j)F.push(j);for(var j=W+1;j<=3;++j)F.push(j);return F},A=function(W){return n.filledRange(W,"_arg","")},k=function(W){return n.filledRange(Math.max(W,3),"_arg","")},B=function(W){return typeof W.length=="number"?Math.max(Math.min(W.length,1024),0):0};C=function(W,F,J,j,H,$){var z=Math.max(0,B(j)-1),G=S(z),X=typeof W=="string"||F===r;function q(he){var L=A(he).join(", "),M=he>0?", ":"",re;return X?re=`ret = callback.call(this, {{args}}, nodeback); break;
`:re=F===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`,re.replace("{{args}}",L).replace(", ",M)}function Q(){for(var he="",L=0;L<G.length;++L)he+="case "+G[L]+":"+q(G[L]);return he+=`
default:
var args = new Array(len + 1);
var i = 0;
for (var i = 0; i < len; ++i) {
args[i] = arguments[i];
}
args[i] = nodeback;
[CodeForCall]
break;
`.replace("[CodeForCall]",X?`ret = callback.apply(this, args);
`:`ret = callback.apply(receiver, args);
`),he}var oe=typeof W=="string"?"this != null ? this['"+W+"'] : fn":"fn",ae=`'use strict';
var ret = function (Parameters) {
'use strict';
var len = arguments.length;
var promise = new Promise(INTERNAL);
promise._captureStackTrace();
var nodeback = nodebackForPromise(promise, `+$+`);
var ret;
var callback = tryCatch([GetFunctionCode]);
switch(len) {
[CodeForSwitchCase]
}
if (ret === errorObj) {
promise._rejectCallback(maybeWrapAsError(ret.e), true, true);
}
if (!promise._isFateSealed()) promise._setAsyncGuaranteed();
return promise;
};
notEnumerableProp(ret, '__isPromisified__', true);
return ret;
`.replace("[CodeForSwitchCase]",Q()).replace("[GetFunctionCode]",oe);return ae=ae.replace("Parameters",k(z)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",ae)(e,j,F,o,s,i,n.tryCatch,n.errorObj,n.notEnumerableProp,t)};function O(W,F,J,j,H,$){var z=(function(){return this})(),G=W;typeof G=="string"&&(W=j);function X(){var q=F;F===r&&(q=this);var Q=new e(t);Q._captureStackTrace();var oe=typeof G=="string"&&this!==z?this[G]:W,ae=i(Q,$);try{oe.apply(q,o(arguments,ae))}catch(he){Q._rejectCallback(s(he),!0,!0)}return Q._isFateSealed()||Q._setAsyncGuaranteed(),Q}return n.notEnumerableProp(X,"__isPromisified__",!0),X}var P=a?C:O;function Y(W,F,J,j,H){for(var $=new RegExp(b(F)+"$"),z=E(W,F,$,J),G=0,X=z.length;G<X;G+=2){var q=z[G],Q=z[G+1],oe=q+F;if(j===P)W[oe]=P(q,r,q,Q,F,H);else{var ae=j(Q,function(){return P(q,r,q,Q,F,H)});n.notEnumerableProp(ae,"__isPromisified__",!0),W[oe]=ae}}return n.toFastProperties(W),W}function _(W,F,J){return P(W,F,void 0,W,null,J)}e.promisify=function(W,F){if(typeof W!="function")throw new u("expecting a function but got "+n.classString(W));if(g(W))return W;F=Object(F);var J=F.context===void 0?r:F.context,j=!!F.multiArgs,H=_(W,J,j);return n.copyDescriptors(W,H,m),H},e.promisifyAll=function(W,F){if(typeof W!="function"&&typeof W!="object")throw new u(`the target of promisifyAll must be an object or a function
See http://goo.gl/MqrFmX
`);F=Object(F);var J=!!F.multiArgs,j=F.suffix;typeof j!="string"&&(j=c);var H=F.filter;typeof H!="function"&&(H=d);var $=F.promisifier;if(typeof $!="function"&&($=P),!n.isIdentifier(j))throw new RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);for(var z=n.inheritedDataKeys(W),G=0;G<z.length;++G){var X=W[z[G]];z[G]!=="constructor"&&n.isClass(X)&&(Y(X.prototype,j,H,$,J),Y(X,j,H,$,J))}return Y(W,j,H,$,J)}}});var s2=pe((LZ,o2)=>{"use strict";o2.exports=function(e,t,r,n){var i=$e(),o=i.isObject,s=Vi(),a;typeof Map=="function"&&(a=Map);var u=(function(){var p=0,d=0;function m(g,y){this[p]=g,this[p+d]=y,p++}return function(y){d=y.size,p=0;var w=new Array(y.size*2);return y.forEach(m,w),w}})(),c=function(p){for(var d=new a,m=p.length/2|0,g=0;g<m;++g){var y=p[m+g],w=p[g];d.set(y,w)}return d};function f(p){var d=!1,m;if(a!==void 0&&p instanceof a)m=u(p),d=!0;else{var g=s.keys(p),y=g.length;m=new Array(y*2);for(var w=0;w<y;++w){var E=g[w];m[w]=p[E],m[w+y]=E}}this.constructor$(m),this._isMap=d,this._init$(void 0,-3)}i.inherits(f,t),f.prototype._init=function(){},f.prototype._promiseFulfilled=function(p,d){this._values[d]=p;var m=++this._totalResolved;if(m>=this._length){var g;if(this._isMap)g=c(this._values);else{g={};for(var y=this.length(),w=0,E=this.length();w<E;++w)g[this._values[w+y]]=this._values[w]}return this._resolve(g),!0}return!1},f.prototype.shouldCopyValues=function(){return!1},f.prototype.getActualLength=function(p){return p>>1};function h(p){var d,m=r(p);if(o(m))m instanceof e?d=m._then(e.props,void 0,void 0,void 0,void 0):d=new f(m).promise();else return n(`cannot await properties of a non-object
See http://goo.gl/MqrFmX
`);return m instanceof e&&d._propagateFrom(m,2),d}e.prototype.props=function(){return h(this)},e.props=function(p){return h(p)}}});var l2=pe((PZ,a2)=>{"use strict";a2.exports=function(e,t,r,n){var i=$e(),o=function(a){return a.then(function(u){return s(u,a)})};function s(a,u){var c=r(a);if(c instanceof e)return o(c);if(a=i.asArray(a),a===null)return n("expecting an array or an iterable object but got "+i.classString(a));var f=new e(t);u!==void 0&&f._propagateFrom(u,3);for(var h=f._fulfill,p=f._reject,d=0,m=a.length;d<m;++d){var g=a[d];g===void 0&&!(d in a)||e.cast(g)._then(h,p,void 0,f,null)}return f}e.race=function(a){return s(a,void 0)},e.prototype.race=function(){return s(this,void 0)}}});var c2=pe((zZ,u2)=>{"use strict";u2.exports=function(e,t,r,n,i,o){var s=e._getDomain,a=$e(),u=a.tryCatch;function c(m,g,y,w){this.constructor$(m);var E=s();this._fn=E===null?g:a.domainBind(E,g),y!==void 0&&(y=e.resolve(y),y._attachCancellationCallback(this)),this._initialValue=y,this._currentCancellable=null,w===i?this._eachValues=Array(this._length):w===0?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}a.inherits(c,t),c.prototype._gotAccum=function(m){this._eachValues!==void 0&&this._eachValues!==null&&m!==i&&this._eachValues.push(m)},c.prototype._eachComplete=function(m){return this._eachValues!==null&&this._eachValues.push(m),this._eachValues},c.prototype._init=function(){},c.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},c.prototype.shouldCopyValues=function(){return!1},c.prototype._resolve=function(m){this._promise._resolveCallback(m),this._values=null},c.prototype._resultCancelled=function(m){if(m===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},c.prototype._iterate=function(m){this._values=m;var g,y,w=m.length;if(this._initialValue!==void 0?(g=this._initialValue,y=0):(g=e.resolve(m[0]),y=1),this._currentCancellable=g,!g.isRejected())for(;y<w;++y){var E={accum:null,value:m[y],index:y,length:w,array:this};g=g._then(p,void 0,void 0,E,void 0)}this._eachValues!==void 0&&(g=g._then(this._eachComplete,void 0,void 0,this,void 0)),g._then(f,f,void 0,g,this)},e.prototype.reduce=function(m,g){return h(this,m,g,null)},e.reduce=function(m,g,y,w){return h(m,g,y,w)};function f(m,g){this.isFulfilled()?g._resolve(m):g._reject(m)}function h(m,g,y,w){if(typeof g!="function")return r("expecting a function but got "+a.classString(g));var E=new c(m,g,y,w);return E.promise()}function p(m){this.accum=m,this.array._gotAccum(m);var g=n(this.value,this.array._promise);return g instanceof e?(this.array._currentCancellable=g,g._then(d,void 0,void 0,this,void 0)):d.call(this,g)}function d(m){var g=this.array,y=g._promise,w=u(g._fn);y._pushContext();var E;g._eachValues!==void 0?E=w.call(y._boundValue(),m,this.index,this.length):E=w.call(y._boundValue(),this.accum,m,this.index,this.length),E instanceof e&&(g._currentCancellable=E);var b=y._popContext();return o.checkForgottenReturns(E,b,g._eachValues!==void 0?"Promise.each":"Promise.reduce",y),E}}});var h2=pe((UZ,f2)=>{"use strict";f2.exports=function(e,t,r){var n=e.PromiseInspection,i=$e();function o(s){this.constructor$(s)}i.inherits(o,t),o.prototype._promiseResolved=function(s,a){this._values[s]=a;var u=++this._totalResolved;return u>=this._length?(this._resolve(this._values),!0):!1},o.prototype._promiseFulfilled=function(s,a){var u=new n;return u._bitField=33554432,u._settledValueField=s,this._promiseResolved(a,u)},o.prototype._promiseRejected=function(s,a){var u=new n;return u._bitField=16777216,u._settledValueField=s,this._promiseResolved(a,u)},e.settle=function(s){return r.deprecated(".settle()",".reflect()"),new o(s).promise()},e.prototype.settle=function(){return e.settle(this)}}});var p2=pe((qZ,d2)=>{"use strict";d2.exports=function(e,t,r){var n=$e(),i=xn().RangeError,o=xn().AggregateError,s=n.isArra
See http://goo.gl/MqrFmX
`);var p=new u(f),d=p.promise();return p.setHowMany(h),p.init(),d}e.some=function(f,h){return c(f,h)},e.prototype.some=function(f){return c(this,f)},e._SomePromiseArray=u}});var g2=pe((jZ,m2)=>{"use strict";m2.exports=function(e,t){var r=e.map;e.prototype.filter=function(n,i){return r(this,n,i,t)},e.filter=function(n,i,o){return r(n,i,o,t)}}});var v2=pe((HZ,y2)=>{"use strict";y2.exports=function(e,t){var r=e.reduce,n=e.all;function i(){return n(this)}function o(s,a){return r(s,a,t,t)}e.prototype.each=function(s){return r(this,s,t,0)._then(i,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(s){return r(this,s,t,t)},e.each=function(s,a){return r(s,a,t,0)._then(i,void 0,void 0,s,void 0)},e.mapSeries=o}});var b2=pe((WZ,w2)=>{"use strict";w2.exports=function(e){var t=e._SomePromiseArray;function r(n){var i=new t(n),o=i.promise();return i.setHowMany(1),i.setUnwrap(),i.init(),o}e.any=function(n){return r(n)},e.prototype.any=function(){return r(this)}}});var _2=pe((VZ,hp)=>{"use strict";hp.exports=function(){var e=function(){return new h(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},t=function(){return new _.PromiseInspection(this._target())},r=function(j){return _.reject(new h(j))};function n(){}var i={},o=$e(),s;o.isNode?s=function(){var j=process.domain;return j===void 0&&(j=null),j}:s=function(){return null},o.notEnumerableProp(_,"_getDomain",s);var a=Vi(),u=pv(),c=new u;a.defineProperty(_,"_async",{value:c});var f=xn(),h=_.TypeError=f.TypeError;_.RangeError=f.RangeError;var p=_.CancellationError=f.CancellationError;_.TimeoutError=f.TimeoutError,_.OperationalError=f.OperationalError,_.RejectionError=f.OperationalError,_.AggregateError=f.AggregateError;var d=function(){},m={},g={},y=wv()(_,d),w=_v()(_,d,y,r,n),E=Ev()(_),b=E.create,C=Sv()(_,E),S=C.CapturedTrace,A=Cv()(_,y),k=Dv()(g),B=lp(),O=o.errorObj,P=o.tryCatch;function Y(j,H){if(typeof H!="function")throw new h("expecting a function but got "+o.classString(H));if(j.constructor!==_)throw new h(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function _(j){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,j!==d&&(Y(this,j),this._resolveFromExecutor(j)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}_.prototype.toString=function(){return"[object Promise]"},_.prototype.caught=_.prototype.catch=function(j){var H=arguments.length;if(H>1){var $=new Array(H-1),z=0,G;for(G=0;G<H-1;++G){var X=arguments[G];if(o.isObject(X))$[z++]=X;else return r("expecting an object but got A catch statement predicate "+o.classString(X))}return $.length=z,j=arguments[G],this.then(void 0,k($,j,this))}return this.then(void 0,j)},_.prototype.reflect=function(){return this._then(t,t,void 0,this,void 0)},_.prototype.then=function(j,H){if(C.warnings()&&arguments.length>0&&typeof j!="function"&&typeof H!="function"){var $=".then() only accepts functions but was passed: "+o.classString(j);arguments.length>1&&($+=", "+o.classString(H)),this._warn($)}return this._then(j,H,void 0,void 0,void 0)},_.prototype.done=function(j,H){var $=this._then(j,H,void 0,void 0,void 0);$._setIsFinal()},_.prototype.spread=function(j){return typeof j!="function"?r("expecting a function but got "+o.classString(j)):this.all()._then(j,void 0,void 0,m,void 0)},_.prototype.toJSON=function(){var j={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(j.fulfillmentValue=this.value(),j.isFulfilled=!0):this.isRejected()&&(j.rejectionReason=this.reason(),j.isRejected=!0),j},_.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new w(this).promise()},_.prototype.error=function(j){return this.caught(o.originatesFromRejection,j)},_.getNewLibraryCopy=hp.exports,_.is=function(j){return j instanceof _},_.fromNode=_.fromCallback=function(j){var H=new _(d);H._captureStackTrace();var $=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,z=P(j)(B(H,$));return z===O&&H._rejectCallback(z.e,!0),H._isFateSealed()||H._setAsyncGuaranteed(),H},_.all=function(j){return new w(j).promise()},_.cast=function(j){var H=y(j);return H instanceof _||(H=new _(d),H._captureStackTrace(),H._setFulfilled(),H._rejectionHandler0=j),H},_.resolve=_.fulfilled=_.cast,_.reject=_.rejected=function(j){var H=new _(d);return H._captureStackTrace(),H._rejectCallback(j,!0),H},_.setScheduler=function(j){if(typeof j!="function")throw new h("expecting a function but got "+o.classString(j));return c.setScheduler(j)},_.prototype._then=function(j,H,$,z,G){var X=G!==void 0,q=X?G:new _(d),Q=this._target(),oe=Q._bitField;X||(q._propagateFrom(this,3),q._captureStackTrace(),z===void 0&&(this._bitField&2097152)!==0&&((oe&50397184)!==0?z=this._boundValue():z=Q===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,q));var ae=s();if((oe&50397184)!==0){var he,L,M=Q._settlePromiseCtx;(oe&33554432)!==0?(L=Q._rejectionHandler0,he=j):(oe&16777216)!==0?(L=Q._fulfillmentHandler0,he=H,Q._unsetRejectionIsUnhandled()):(M=Q._settlePromiseLateCancellationObserver,L=new p("late cancellation observer"),Q._attachExtraTrace(L),he=H),c.invoke(M,Q,{handler:ae===null?he:typeof he=="function"&&o.domainBind(ae,he),promise:q,receiver:z,value:L})}else Q._addCallbacks(j,H,q,z,ae);return q},_.prototype._length=function(){return this._bitField&65535},_.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},_.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},_.prototype._setLength=function(j){this._bitField=this._bitField&-65536|j&65535},_.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},_.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},_.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},_.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},_.prototype._isFinal=function(){return(this._bitField&4194304)>0},_.prototype._unsetCan
\0`,q+=n(z,2),q+=C.magic,q+=n(w,2),q+=n(E,2),q+=n($.crc32,4),q+=n($.compressedSize,4),q+=n($.uncompressedSize,4),q+=n(A.length,2),q+=n(W.length,2),{fileRecord:c.LOCAL_FILE_HEADER+q+A+W,dirRecord:c.CENTRAL_FILE_HEADER+n(X,2)+q+n(O.length,2)+"\0\0\0\0"+n(G,4)+n(m,4)+A+W+O}}var o=e("../utils"),s=e("../stream/GenericWorker"),a=e("../utf8"),u=e("../crc32"),c=e("../signature");function f(h,p,d,m){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=d,this.encodeFileName=m,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(f,s),f.prototype.push=function(h){var p=h.meta.percent||0,d=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,s.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:d?(p+100*(d-m-1))/d:100}}))},f.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var d=i(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:d.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,d=i(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(d.dirRecord),p)this.push({data:(function(m){return c.DATA_DESCRIPTOR+n(m.crc32,4)+n(m.compressedSize,4)+n(m.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:d.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var d=this.bytesWritten-h,m=(function(g,y,w,E,b){var C=o.transformTo("string",b(E));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(g,2)+n(g,2)+n(y,4)+n(w,4)+n(C.length,2)+C})(this.dirRecords.length,d,h,this.zipComment,this.encodeFileName);this.push({data:m,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(h){this._sources.push(h);var p=this;return h.on("data",function(d){p.processChunk(d)}),h.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),h.on("error",function(d){p.error(d)}),this},f.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(h){var p=this._sources;if(!s.prototype.error.call(this,h))return!1;for(var d=0;d<p.length;d++)try{p[d].error(h)}catch{}return!0},f.prototype.lock=function(){s.prototype.lock.call(this);for(var h=this._sources,p=0;p<h.length;p++)h[p].lock()},t.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(o,s,a){var u=new i(s.streamFiles,a,s.platform,s.encodeFileName),c=0;try{o.forEach(function(f,h){c++;var p=(function(y,w){var E=y||w,b=n[E];if(!b)throw new Error(E+" is not a valid compression method !");return b})(h.options.compression,s.compression),d=h.options.compressionOptions||s.compressionOptions||{},m=h.dir,g=h.date;h._compressWorker(p,d).withStreamInfo("file",{name:f,dir:m,date:g,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(u)}),u.entriesCount=c}catch(f){u.error(f)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JS
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u01
`).replace(/[\r\u0085\u2028]/g,`
`)}function gw(e){this.options=e||{locator:{}}}gw.prototype.parseFromString=function(e,t){var r=this.options,n=new h5,i=r.domBuilder||new Wa,o=r.errorHandler,s=r.locator,a=r.xmlns||{},u=/\/x?html?$/.test(t),c=u?fw.HTML_ENTITIES:fw.XML_ENTITIES;s&&i.setDocumentLocator(s),n.errorHandler=d5(o,i,s),n.domBuilder=r.domBuilder||i,u&&(a[""]=hw.HTML),a.xml=a.xml||hw.XML;var f=r.normalizeLineEndings||mw;return e&&typeof e=="string"?n.parse(f(e),a,c):n.errorHandler.error("invalid doc source"),i.doc};function d5(e,t,r){if(!e){if(t instanceof Wa)return t;e=t}var n={},i=e instanceof Function;r=r||{};function o(s){var a=e[s];!a&&i&&(a=e.length==2?function(u){e(s,u)}:e),n[s]=a&&function(u){a("[xmldom "+s+"] "+u+Mp(r))}||function(){}}return o("warning"),o("error"),o("fatalError"),n}function Wa(){this.cdata=!1}function cs(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}Wa.prototype={startDocument:function(){this.doc=new c5().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,n){var i=this.doc,o=i.createElementNS(e,r||t),s=n.length;Ic(this,o),this.currentElement=o,this.locator&&cs(this.locator,o);for(var a=0;a<s;a++){var e=n.getURI(a),u=n.getValue(a),r=n.getQName(a),c=i.createAttributeNS(e,r);this.locator&&cs(n.getLocator(a),c),c.value=c.nodeValue=u,o.setAttributeNode(c)}},endElement:function(e,t,r){var n=this.currentElement,i=n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&cs(this.locator,r),Ic(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){if(e=dw.apply(this,arguments),e){if(this.cdata)var n=this.doc.createCDATASection(e);else var n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&cs(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,r){e=dw.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&cs(this.locator,n),Ic(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(e,t,r);this.locator&&cs(this.locator,i),Ic(this,i),this.doc.doctype=i}},warning:function(e){console.warn("[xmldom warning] "+e,Mp(this.locator))},error:function(e){console.error("[xmldom error] "+e,Mp(this.locator))},fatalError:function(e){throw new f5(e,this.locator)}};function Mp(e){if(e)return`
@`+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function dw(e,t,r){return typeof e=="string"?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){Wa.prototype[e]=function(){return null}});function Ic(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Fc.__DOMHandler=Wa;Fc.normalizeLineEndings=mw;Fc.DOMParser=gw});var ww=pe(Mc=>{var vw=Oc();Mc.DOMImplementation=vw.DOMImplementation;Mc.XMLSerializer=vw.XMLSerializer;Mc.DOMParser=yw().DOMParser});var bw=pe(Bp=>{var p5=ww(),m5=Oc();function g5(e){var t=null,r=new p5.DOMParser({errorHandler:function(i,o){t={level:i,message:o}}}),n=r.parseFromString(e);if(t===null)return n;throw new Error(t.level+": "+t.message)}Bp.parseFromString=g5;Bp.Node=m5.Node});var Tw=pe(Sw=>{var Lp=En(),_w=(rt(),it(tt)),Ew=bw(),Aw=wp(),y5=Aw.Element;Sw.readString=v5;var xw=Ew.Node;function v5(e,t){t=t||{};try{var r=Ew.parseFromString(e,"text/xml")}catch(s){return Lp.reject(s)}if(r.documentElement.tagName==="parsererror")return Lp.resolve(new Error(r.documentElement.textContent));function n(s){switch(s.nodeType){case xw.ELEMENT_NODE:return i(s);case xw.TEXT_NODE:return Aw.text(s.nodeValue)}}function i(s){var a=o(s),u=[];_w.forEach(s.childNodes,function(f){var h=n(f);h&&u.push(h)});var c=Object.create(null);return _w.forEach(s.attributes,function(f){c[o(f)]=f.value}),new y5(a,c,u)}function o(s){if(s.namespaceURI){var a=t[s.namespaceURI],u;return a?u=a+":":u="{"+s.namespaceURI+"}",u+s.localName}else return s.localName}return Lp.resolve(n(r.documentElement))}});var Dn=pe((Cw,li)=>{(function(){var e,t,r,n,i,o,s,a=[].slice,u={}.hasOwnProperty;e=function(){var c,f,h,p,d,m;if(m=arguments[0],d=2<=arguments.length?a.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(c=0,h=d.length;c<h;c++)if(p=d[c],p!=null)for(f in p)u.call(p,f)&&(m[f]=p[f]);return m},i=function(c){return!!c&&Object.prototype.toString.call(c)==="[object Function]"},o=function(c){var f;return!!c&&((f=typeof c)=="function"||f==="object")},r=function(c){return i(Array.isArray)?Array.isArray(c):Object.prototype.toString.call(c)==="[object Array]"},n=function(c){var f;if(r(c))return!c.length;for(f in c)if(u.call(c,f))return!1;return!0},s=function(c){var f,h;return o(c)&&(h=Object.getPrototypeOf(c))&&(f=h.constructor)&&typeof f=="function"&&f instanceof f&&Function.prototype.toString.call(f)===Function.prototype.toString.call(Object)},t=function(c){return i(c.valueOf)?c.valueOf():c},li.exports.assign=e,li.exports.isFunction=i,li.exports.isObject=o,li.exports.isArray=r,li.exports.isEmpty=n,li.exports.isPlainObject=s,li.exports.getValue=t}).call(Cw)});var Pp=pe((kw,Dw)=>{(function(){var e;Dw.exports=e=(function(){function t(r,n,i){if(this.options=r.options,this.stringify=r.stringify,this.parent=r,n==null)throw new Error("Missing attribute name. "+this.debugInfo(n));if(i==null)throw new Error("Missing attribute value. "+this.debugInfo(n));this.name=this.stringify.attName(n),this.value=this.stringify.attValue(i)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(r){return this.options.writer.set(r).attribute(this)},t.prototype.debugInfo=function(r){return r=r||this.name,r==null?"parent: <"+this.parent.name+">":"attribute: {"+r+"}, parent: <"+this.parent.name+">"},t})()}).call(kw)});var Va=pe((Nw,Ow)=>{(function(){var e,t,r,n,i,o,s,a=function(c,f){for(var h in f)u.call(f,h)&&(c[h]=f[h]);function p(){this.constructor=c}return p.prototype=f.prototype,c.prototype=new p,c.__super__=f.prototype,c},u={}.hasOwnProperty;s=Dn(),o=s.isObject,i=s.isFunction,n=s.getValue,r=Wt(),e=Pp(),Ow.exports=t=(function(c){a(f,c);function f(h,p,d){if(f.__super__.constructor.call(this,h),p==null)throw new Error("Missing element name. "+this.debugInfo());this.name=this.stringify.eleName(p),this.attributes={},d!=null&&this.attribute(d),h.isDocument&&(this.isRoot=!0,this.
`,this.offset=(u=n.offset)!=null?u:0,this.dontprettytextnodes=(c=n.dontprettytextnodes)!=null?c:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(f=n.spacebeforeslash)!=null?f:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,h=n.writer||{};for(i in h)t.call(h,i)&&(p=h[i],this[i]=p)}return r.prototype.set=function(n){var i,o,s;n||(n={}),"pretty"in n&&(this.pretty=n.pretty),"allowEmpty"in n&&(this.allowEmpty=n.allowEmpty),this.pretty?(this.indent="indent"in n?n.indent:" ",this.newline="newline"in n?n.newline:`
`,this.offset="offset"in n?n.offset:0,this.dontprettytextnodes="dontprettytextnodes"in n?n.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in n?n.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,o=n.writer||{};for(i in o)t.call(o,i)&&(s=o[i],this[i]=s);return this},r.prototype.space=function(n){var i;return this.pretty?(i=(n||0)+this.offset+1,i>0?new Array(i).join(this.indent):""):""},r})()}).call(sb)});var Lc=pe((lb,ub)=>{(function(){var e,t,r,n,i,o,s,a,u,c,f,h,p,d,m,g=function(w,E){for(var b in E)y.call(E,b)&&(w[b]=E[b]);function C(){this.constructor=w}return C.prototype=E.prototype,w.prototype=new C,w.__super__=E.prototype,w},y={}.hasOwnProperty;s=$a(),a=Qa(),e=Ga(),t=Ka(),c=Va(),h=el(),d=tl(),f=rl(),u=Bc(),r=Xa(),n=Ja(),i=Za(),o=Ya(),m=Up(),ub.exports=p=(function(w){g(E,w);function E(b){E.__super__.constructor.call(this,b)}return E.prototype.document=function(b){var C,S,A,k,B;for(this.textispresent=!1,k="",B=b.children,S=0,A=B.length;S<A;S++)C=B[S],!(C instanceof u)&&(k+=(function(){switch(!1){case!(C instanceof s):return this.declaration(C);case!(C instanceof a):return this.docType(C);case!(C instanceof t):return this.comment(C);case!(C instanceof f):return this.processingInstruction(C);default:return this.element(C,0)}}).call(this));return this.pretty&&k.slice(-this.newline.length)===this.newline&&(k=k.slice(0,-this.newline.length)),k},E.prototype.attribute=function(b){return" "+b.name+'="'+b.value+'"'},E.prototype.cdata=function(b,C){return this.space(C)+"<![CDATA["+b.text+"]]>"+this.newline},E.prototype.comment=function(b,C){return this.space(C)+"<!-- "+b.text+" -->"+this.newline},E.prototype.declaration=function(b,C){var S;return S=this.space(C),S+='<?xml version="'+b.version+'"',b.encoding!=null&&(S+=' encoding="'+b.encoding+'"'),b.standalone!=null&&(S+=' standalone="'+b.standalone+'"'),S+=this.spacebeforeslash+"?>",S+=this.newline,S},E.prototype.docType=function(b,C){var S,A,k,B,O;if(C||(C=0),B=this.space(C),B+="<!DOCTYPE "+b.root().name,b.pubID&&b.sysID?B+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.sysID&&(B+=' SYSTEM "'+b.sysID+'"'),b.children.length>0){for(B+=" [",B+=this.newline,O=b.children,A=0,k=O.length;A<k;A++)S=O[A],B+=(function(){switch(!1){case!(S instanceof r):return this.dtdAttList(S,C+1);case!(S instanceof n):return this.dtdElement(S,C+1);case!(S instanceof i):return this.dtdEntity(S,C+1);case!(S instanceof o):return this.dtdNotation(S,C+1);case!(S instanceof e):return this.cdata(S,C+1);case!(S instanceof t):return this.comment(S,C+1);case!(S instanceof f):return this.processingInstruction(S,C+1);default:throw new Error("Unknown DTD node type: "+S.constructor.name)}}).call(this);B+="]"}return B+=this.spacebeforeslash+">",B+=this.newline,B},E.prototype.element=function(b,C){var S,A,k,B,O,P,Y,_,W,F,J,j,H;C||(C=0),H=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),j=this.space(C),_="",_+=j+"<"+b.name,W=b.attributes;for(Y in W)y.call(W,Y)&&(S=W[Y],_+=this.attribute(S));if(b.children.length===0||b.children.every(function($){return $.value===""}))this.allowEmpty?_+="></"+b.name+">"+this.newline:_+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&b.children.length===1&&b.children[0].value!=null)_+=">",_+=b.children[0].value,_+="</"+b.name+">"+this.newline;else{if(this.dontprettytextnodes){for(F=b.children,k=0,O=F.length;k<O;k++)if(A=F[k],A.value!=null){this.textispresent++,H=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,j=this.space(C)),_+=">"+this.newline,J=b.children,B=0,P=J.length;B<P;B++)A=J[B],_+=(function(){switch(!1){case!(A instanceof e):return this.cdata(A,C+1);case!(A instanceof t):return this.comment(A,C+1);case!(A instanceof c):return this.element(A,C+1);case!(A instanceof h):return this.raw(A,C+1);case!(A instanceof d):return this.text(A,C+1);case!(A instanceof f):return this.processingInstruction(A,C+1);case!(A i
cannot open linked files from a web browser`))}return{read:e}}});var c_=pe(Yp=>{Yp.read=v8;Yp._findPartPaths=l_;var h8=En(),d8=si(),Jp=$r().Result,Kc=vp(),a_=Tb().readXmlFromZipFile,p8=qb().createBodyReader,m8=Hb().DocumentXmlReader,hs=Wb(),r_=Gb(),n_=Kb(),i_=Xb(),o_=Jb(),g8=Qb(),y8=t_().Files;function v8(e,t,r){t=t||{},r=r||{};var n=new y8({externalFileAccess:r.externalFileAccess,relativeToFile:t.path});return h8.props({contentTypes:b8(e),partPaths:l_(e),docxFile:e,files:n}).also(function(i){return{styles:x8(e,i.partPaths.styles)}}).also(function(i){return{numbering:_8(e,i.partPaths.numbering,i.styles)}}).also(function(i){return{footnotes:Gc(i.partPaths.footnotes,i,function(o,s){return s?o_.createFootnotesReader(o)(s):new Jp([])}),endnotes:Gc(i.partPaths.endnotes,i,function(o,s){return s?o_.createEndnotesReader(o)(s):new Jp([])}),comments:Gc(i.partPaths.comments,i,function(o,s){return s?g8.createCommentsReader(o)(s):new Jp([])})}}).also(function(i){return{notes:i.footnotes.flatMap(function(o){return i.endnotes.map(function(s){return new d8.Notes(o.concat(s))})})}}).then(function(i){return Gc(i.partPaths.mainDocument,i,function(o,s){return i.notes.flatMap(function(a){return i.comments.flatMap(function(u){var c=new m8({bodyReader:o,notes:a,comments:u});return c.convertXmlToDocument(s)})})})})}function l_(e){return E8(e).then(function(t){var r=s_({docxFile:e,relationships:t,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",basePath:"",fallbackPath:"word/document.xml"});if(!e.exists(r))throw new Error("Could not find main document part. Are you sure this is a valid .docx file?");return ds({filename:u_(r),readElement:hs.readRelationships,defaultValue:hs.defaultValue})(e).then(function(n){function i(o){return s_({docxFile:e,relationships:n,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"+o,basePath:Kc.splitPath(r).dirname,fallbackPath:"word/"+o+".xml"})}return{mainDocument:r,comments:i("comments"),endnotes:i("endnotes"),footnotes:i("footnotes"),numbering:i("numbering"),styles:i("styles")}})})}function s_(e){var t=e.docxFile,r=e.relationships,n=e.relationshipType,i=e.basePath,o=e.fallbackPath,s=r.findTargetsByType(n),a=s.map(function(c){return w8(Kc.joinPath(i,c),"/")}),u=a.filter(function(c){return t.exists(c)});return u.length===0?o:u[0]}function w8(e,t){return e.substring(0,t.length)===t?e.substring(t.length):e}function ds(e){return function(t){return a_(t,e.filename).then(function(r){return r?e.readElement(r):e.defaultValue})}}function Gc(e,t,r){var n=ds({filename:u_(e),readElement:hs.readRelationships,defaultValue:hs.defaultValue});return n(t.docxFile).then(function(i){var o=new p8({relationships:i,contentTypes:t.contentTypes,docxFile:t.docxFile,numbering:t.numbering,styles:t.styles,files:t.files});return a_(t.docxFile,e).then(function(s){return r(o,s)})})}function u_(e){var t=Kc.splitPath(e);return Kc.joinPath(t.dirname,"_rels",t.basename+".rels")}var b8=ds({filename:"[Content_Types].xml",readElement:r_.readContentTypesFromXml,defaultValue:r_.defaultContentTypes});function _8(e,t,r){return ds({filename:t,readElement:function(n){return n_.readNumberingXml(n,{styles:r})},defaultValue:n_.defaultNumbering})(e)}function x8(e,t){return ds({filename:t,readElement:i_.readStylesXml,defaultValue:i_.defaultStyles})(e)}var E8=ds({filename:"_rels/.rels",readElement:hs.readRelationships,defaultValue:hs.defaultValue})});var d_=pe(Qp=>{var A8=(rt(),it(tt)),S8=En(),sl=zc();Qp.writeStyleMap=C8;Qp.readStyleMap=N8;var T8="http://schemas.zwobble.org/mammoth/style-map",$c="mammoth/style-map",f_="/"+$c;function C8(e,t){return e.write($c,t),k8(e).then(function(){return D8(e)})}function k8(e){var t="word/_rels/document.xml.rels",r="http://schemas.openxmlformats.org/package/2006/relationships",n="{"+r+"}Relationship";return e.read(t,"utf8").then(sl.readString).then(function(i){var o=i.children;h_(o,n,"Id",{Id:"rMammothStyleMap",Type:T8,Target:f_});var s={"":r};return e.write(t,sl.writeString(i,s))})}function D8(e){var t="[Content_Types].xml",r="http://sche
`,`
`+t);o.text(g)}function c(m,g){p(),o.selfClosing(m,g)}function f(){return r.length===0||Jc[r[r.length-1]]}function h(){i||(p(),i=!0)}function p(){if(i=!1,!n&&f()&&!d()){o._append(`
`);for(var m=0;m<e;m++)o._append(t)}}function d(){return A_.some(r,function(m){return m==="pre"})}return{asString:o.asString,open:s,close:a,text:u,selfClosing:c}}function S_(){var e=[];function t(u,c){var f=i(c);e.push("<"+u+f+">")}function r(u){e.push("</"+u+">")}function n(u,c){var f=i(c);e.push("<"+u+f+" />")}function i(u){return A_.map(u,function(c,f){return" "+f+'="'+oN(c)+'"'}).join("")}function o(u){e.push(iN(u))}function s(u){e.push(u)}function a(){return e.join("")}return{asString:a,open:t,close:r,text:o,selfClosing:n,_append:s}}function iN(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function oN(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}});var I_=pe(R_=>{var sN=(rt(),it(tt));function k_(e){return Yc(e,e)}function Yc(e,t){return function(){return{start:e,end:t}}}function aN(e){var t=e.href||"";return t?{start:"[",end:"]("+t+")",anchorPosition:"before"}:{}}function lN(e){var t=e.src||"",r=e.alt||"";return t||r?{start:"!["+r+"]("+t+")"}:{}}function D_(e){return function(t,r){return{start:r?`
`:"",end:r?"":`
`,list:{isOrdered:e.isOrdered,indent:r?r.indent+1:0,count:0}}}}function uN(e,t,r){t=t||{indent:0,isOrdered:!1,count:0},t.count++,r.hasClosed=!1;var n=t.isOrdered?t.count+".":"-",i=O_(" ",t.indent)+n+" ";return{start:i,end:function(){if(!r.hasClosed)return r.hasClosed=!0,`
`}}}var N_={p:Yc("",`
`),br:Yc("",`
`),ul:D_({isOrdered:!1}),ol:D_({isOrdered:!0}),li:uN,strong:k_("__"),em:k_("*"),a:aN,img:lN};(function(){for(var e=1;e<=6;e++)N_["h"+e]=Yc(O_("#",e)+" ",`
`)})();function O_(e,t){return new Array(t+1).join(e)}function cN(){var e=[],t=[],r=null,n={};function i(f,h){h=h||{};var p=N_[f]||function(){return{}},d=p(h,r,n);t.push({end:d.end,list:r}),d.list&&(r=d.list);var m=d.anchorPosition==="before";m&&o(h),e.push(d.start||""),m||o(h)}function o(f){f.id&&e.push('<a id="'+f.id+'"></a>')}function s(f){var h=t.pop();r=h.list;var p=sN.isFunction(h.end)?h.end():h.end;e.push(p||"")}function a(f,h){i(f,h),s(f)}function u(f){e.push(fN(f))}function c(){return e.join("")}return{asString:c,open:i,close:s,text:u,selfClosing:a}}R_.writer=cN;function fN(e){return e.replace(/\\/g,"\\\\").replace(/([\`\*_\{\}\[\]\(\)\#\+\-\.\!])/g,"\\$1")}});var M_=pe(F_=>{var hN=C_(),dN=I_();F_.writer=pN;function pN(e){return e=e||{},e.outputFormat==="markdown"?dN.writer():hN.writer(e)}});var z_=pe(um=>{var ci=(rt(),it(tt)),B_=En(),Qc=si(),Er=al(),lm=$r(),mN=sm(),Fe=ll(),gN=M_();um.DocumentConverter=yN;function yN(e){return{convertToHtml:function(t){var r=ci.indexBy(t.type===Qc.types.document?t.comments:[],"commentId"),n=new vN(e,r);return n.convertToHtml(t)}}}function vN(e,t){var r=1,n=[],i=[];e=ci.extend({ignoreEmptyParagraphs:!0},e);var o=e.idPrefix===void 0?"":e.idPrefix,s=e.ignoreEmptyParagraphs,a=Er.topLevelElement("p"),u=e.styleMap||[];function c($){var z=[],G=h($,z,Object.create(null)),X=[];P_(G,function(Q){Q.type==="deferred"&&X.push(Q)});var q=Object.create(null);return B_.mapSeries(X,function(Q){return Q.value().then(function(oe){q[Q.id]=oe})}).then(function(){function Q(ae){return am(ae,function(he){return he.type==="deferred"?q[he.id]:he.children?[ci.extend({},he,{children:Q(he.children)})]:[he]})}var oe=gN.writer({prettyPrint:e.prettyPrint,outputFormat:e.outputFormat});return Fe.write(oe,Fe.simplify(Q(G))),new lm.Result(oe.asString(),z)})}function f($,z,G){return am($,function(X){return h(X,z,G)})}function h($,z,G){if(!G)throw new Error("options not set");var X=H[$.type];return X?X($,z,G):[]}function p($,z,G){return d($,z).wrap(function(){var X=f($.children,z,G);return s?X:[Fe.forceWrite].concat(X)})}function d($,z){var G=w($);return G?G.to:($.styleId&&z.push(L_("paragraph",$)),a)}function m($,z,G){var X=function(){return f($.children,z,G)},q=[];if($.highlight!==null){var Q=y({type:"highlight",color:$.highlight});Q&&q.push(Q)}$.isSmallCaps&&q.push(g("smallCaps")),$.isAllCaps&&q.push(g("allCaps")),$.isStrikethrough&&q.push(g("strikethrough","s")),$.isUnderline&&q.push(g("underline")),$.verticalAlignment===Qc.verticalAlignment.subscript&&q.push(Er.element("sub",{},{fresh:!1})),$.verticalAlignment===Qc.verticalAlignment.superscript&&q.push(Er.element("sup",{},{fresh:!1})),$.isItalic&&q.push(g("italic","em")),$.isBold&&q.push(g("bold","strong"));var oe=Er.empty,ae=w($);return ae?oe=ae.to:$.styleId&&z.push(L_("run",$)),q.push(oe),q.forEach(function(he){X=he.wrap.bind(he,X)}),X()}function g($,z){var G=y({type:$});return G||(z?Er.element(z,{},{fresh:!1}):Er.empty)}function y($,z){var G=w($);return G?G.to:z}function w($){for(var z=0;z<u.length;z++)if(u[z].from.matches($))return u[z]}function E($){return function(z,G){return B_.attempt(function(){return $(z,G)}).caught(function(X){return G.push(lm.error(X)),[]})}}function b($){return S($.noteType,$.noteId)}function C($){return A($.noteType,$.noteId)}function S($,z){return k($+"-"+z)}function A($,z){return k($+"-ref-"+z)}function k($){return o+$}var B=Er.elements([Er.element("table",{},{fresh:!0})]);function O($,z,G){return y($,B).wrap(function(){return P($,z,G)})}function P($,z,G){var X=ci.findIndex($.children,function(ae){return!ae.type===Qc.types.tableRow||!ae.isHeader});X===-1&&(X=$.children.length);var q;if(X===0)q=f($.children,z,ci.extend({},G,{isTableHeader:!1}));else{var Q=f($.children.slice(0,X),z,ci.extend({},G,{isTableHeader:!0})),oe=f($.children.slice(X),z,ci.extend({},G,{isTableHeader:!1}));q=[Fe.freshElement("thead",{},Q),Fe.freshElement("tbody",{},oe)]}return[Fe.forceWrite].concat(q)}function Y($,z,G){var X=f($.children,z,G);return[Fe.freshElement("tr",{},[Fe.forceWrite].concat(X))]}function _($,z,G){var X=G.isTableHeader?"th":"td",q=f($.c
`:"";return(e.children||[]).map(U_).join("")+t}q_.convertElementToRawText=U_});var W_=pe((VJ,H_)=>{var ys=H_.exports=function(e,t){this._tokens=e,this._startIndex=t||0};ys.prototype.head=function(){return this._tokens[this._startIndex]};ys.prototype.tail=function(e){return new ys(this._tokens,this._startIndex+1)};ys.prototype.toArray=function(){return this._tokens.slice(this._startIndex)};ys.prototype.end=function(){return this._tokens[this._tokens.length-1]};ys.prototype.to=function(e){var t=this.head().source,r=e.head()||e.end();return t.to(r.source)}});var G_=pe(V_=>{var EN=W_();V_.Parser=function(e){var t=function(r,n){return r(new EN(n))};return{parseTokens:t}}});var $_=pe(Pr=>{Pr.none=Object.create({value:function(){throw new Error("Called value on none")},isNone:function(){return!0},isSome:function(){return!1},map:function(){return Pr.none},flatMap:function(){return Pr.none},filter:function(){return Pr.none},toArray:function(){return[]},orElse:K_,valueOrElse:K_});function K_(e){return typeof e=="function"?e():e}Pr.some=function(e){return new gr(e)};var gr=function(e){this._value=e};gr.prototype.value=function(){return this._value};gr.prototype.isNone=function(){return!1};gr.prototype.isSome=function(){return!0};gr.prototype.map=function(e){return new gr(e(this._value))};gr.prototype.flatMap=function(e){return e(this._value)};gr.prototype.filter=function(e){return e(this._value)?this:Pr.none};gr.prototype.toArray=function(){return[this._value]};gr.prototype.orElse=function(e){return this};gr.prototype.valueOrElse=function(e){return this._value};Pr.isOption=function(e){return e===Pr.none||e instanceof gr};Pr.fromNullable=function(e){return e==null?Pr.none:new gr(e)}});var ef=pe(($J,X_)=>{X_.exports={failure:function(e,t){if(e.length<1)throw new Error("Failure must have errors");return new It({status:"failure",remaining:t,errors:e})},error:function(e,t){if(e.length<1)throw new Error("Failure must have errors");return new It({status:"error",remaining:t,errors:e})},success:function(e,t,r){return new It({status:"success",value:e,source:r,remaining:t,errors:[]})},cut:function(e){return new It({status:"cut",remaining:e,errors:[]})}};var It=function(e){this._value=e.value,this._status=e.status,this._hasValue=e.value!==void 0,this._remaining=e.remaining,this._source=e.source,this._errors=e.errors};It.prototype.map=function(e){return this._hasValue?new It({value:e(this._value,this._source),status:this._status,remaining:this._remaining,source:this._source,errors:this._errors}):this};It.prototype.changeRemaining=function(e){return new It({value:this._value,status:this._status,remaining:e,source:this._source,errors:this._errors})};It.prototype.isSuccess=function(){return this._status==="success"||this._status==="cut"};It.prototype.isFailure=function(){return this._status==="failure"};It.prototype.isError=function(){return this._status==="error"};It.prototype.isCut=function(){return this._status==="cut"};It.prototype.value=function(){return this._value};It.prototype.remaining=function(){return this._remaining};It.prototype.source=function(){return this._source};It.prototype.errors=function(){return this._errors}});var cm=pe(Z_=>{Z_.error=function(e){return new tf(e)};var tf=function(e){this.expected=e.expected,this.actual=e.actual,this._location=e.location};tf.prototype.describe=function(){var e=this._location?this._location.describe()+`:
`:"";return e+"Expected "+this.expected+`
but got `+this.actual};tf.prototype.lineNumber=function(){return this._location.lineNumber()};tf.prototype.characterNumber=function(){return this._location.characterNumber()}});var Y_=pe(J_=>{var ZJ=J_.fromArray=function(e){var t=0,r=function(){return t<e.length};return new eo({hasNext:r,next:function(){if(r())return e[t++];throw new Error("No more elements")}})},eo=function(e){this._iterator=e};eo.prototype.map=function(e){var t=this._iterator;return new eo({hasNext:function(){return t.hasNext()},next:function(){return e(t.next())}})};eo.prototype.filter=function(e){var t=this._iterator,r=!1,n=!1,i,o=function(){if(!r)for(r=!0,n=!1;t.hasNext()&&!n;)i=t.next(),n=e(i)};return new eo({hasNext:function(){return o(),n},next:function(){o();var s=i;return r=!1,s}})};eo.prototype.first=function(){var e=this._iterator;return this._iterator.hasNext()?e.next():null};eo.prototype.toArray=function(){for(var e=[];this._iterator.hasNext();)e.push(this._iterator.next());return e}});var fm=pe(ze=>{var rf=(rt(),it(tt)),Q_=$_(),Ar=ef(),ex=cm(),AN=Y_();ze.token=function(e,t){var r=t!==void 0;return function(n){var i=n.head();if(i&&i.name===e&&(!r||i.value===t))return Ar.success(i.value,n.tail(),i.source);var o=rx({name:e,value:t});return nx(n,o)}};ze.tokenOfType=function(e){return ze.token(e)};ze.firstOf=function(e,t){return rf.isArray(t)||(t=Array.prototype.slice.call(arguments,1)),function(r){return AN.fromArray(t).map(function(n){return n(r)}).filter(function(n){return n.isSuccess()||n.isError()}).first()||nx(r,e)}};ze.then=function(e,t){return function(r){var n=e(r);return n.map||console.log(n),n.map(t)}};ze.sequence=function(){var e=Array.prototype.slice.call(arguments,0),t=function(n){var i=rf.foldl(e,function(s,a){var u=s.result,c=s.hasCut;if(!u.isSuccess())return{result:u,hasCut:c};var f=a(u.remaining());if(f.isCut())return{result:u,hasCut:!0};if(f.isSuccess()){var h;a.isCaptured?h=u.value().withValue(a,f.value()):h=u.value();var p=f.remaining(),d=n.to(p);return{result:Ar.success(h,p,d),hasCut:c}}else return c?{result:Ar.error(f.errors(),f.remaining()),hasCut:c}:{result:f,hasCut:c}},{result:Ar.success(new ul,n),hasCut:!1}).result,o=n.to(i.remaining());return i.map(function(s){return s.withValue(ze.sequence.source,o)})};t.head=function(){var n=rf.find(e,r);return ze.then(t,ze.sequence.extract(n))},t.map=function(n){return ze.then(t,function(i){return n.apply(this,i.toArray())})};function r(n){return n.isCaptured}return t};var ul=function(e,t){this._values=e||{},this._valuesArray=t||[]};ul.prototype.withValue=function(e,t){if(e.captureName&&e.captureName in this._values)throw new Error('Cannot add second value for capture "'+e.captureName+'"');var r=rf.clone(this._values);r[e.captureName]=t;var n=this._valuesArray.concat([t]);return new ul(r,n)};ul.prototype.get=function(e){if(e.captureName in this._values)return this._values[e.captureName];throw new Error('No value for capture "'+e.captureName+'"')};ul.prototype.toArray=function(){return this._valuesArray};ze.sequence.capture=function(e,t){var r=function(){return e.apply(this,arguments)};return r.captureName=t,r.isCaptured=!0,r};ze.sequence.extract=function(e){return function(t){return t.get(e)}};ze.sequence.applyValues=function(e){var t=Array.prototype.slice.call(arguments,1);return function(r){var n=t.map(function(i){return r.get(i)});return e.apply(this,n)}};ze.sequence.source={captureName:"\u2603source\u2603"};ze.sequence.cut=function(){return function(e){return Ar.cut(e)}};ze.optional=function(e){return function(t){var r=e(t);return r.isSuccess()?r.map(Q_.some):r.isFailure()?Ar.success(Q_.none,t):r}};ze.zeroOrMoreWithSeparator=function(e,t){return tx(e,t,!1)};ze.oneOrMoreWithSeparator=function(e,t){return tx(e,t,!0)};var SN=ze.zeroOrMore=function(e){return function(t){for(var r=[],n;(n=e(t))&&n.isSuccess();)t=n.remaining(),r.push(n.value());return n.isError()?n:Ar.success(r,t)}};ze.oneOrMore=function(e){return ze.oneOrMoreWithSeparator(e,TN)};function TN(e){return Ar.success(null,e)}var tx=function(e,t,r){return function(n){var i=e(n);if(i.isSuccess()){var o=ze.sequence.capture
`:"";return t+"Line number: "+e.lineNumber+`
Character number: `+e.characterNumber};to.prototype.lineNumber=function(){return this._position().lineNumber};to.prototype.characterNumber=function(){return this._position().characterNumber};to.prototype._position=function(){for(var e=this,t=0,r=function(){return e._string.indexOf(`
`,t)},n=1;r()!==-1&&r()<this._startIndex;)t=r()+1,n+=1;var i=this._startIndex-t+1;return{lineNumber:n,characterNumber:i}}});var dm=pe((tY,ox)=>{ox.exports=function(e,t,r){this.name=e,this.value=t,r&&(this.source=r)}});var ax=pe(nf=>{var sx=fm(),CN=ef();nf.parser=function(e,t,r){var n={rule:a,leftAssociative:u,rightAssociative:c},i=new pm(r.map(s)),o=sx.firstOf(e,t);function s(p){return{name:p.name,rule:kN(p.ruleBuilder.bind(null,n))}}function a(){return f(i)}function u(p){return f(i.untilExclusive(p))}function c(p){return f(i.untilInclusive(p))}function f(p){return h.bind(null,p)}function h(p,d){var m=o(d);return m.isSuccess()?p.apply(m):m}return n};function pm(e){function t(s){return new pm(e.slice(0,n().indexOf(s)))}function r(s){return new pm(e.slice(0,n().indexOf(s)+1))}function n(){return e.map(function(s){return s.name})}function i(s){for(var a,u;;)if(a=o(s.remaining()),a.isSuccess())u=s.source().to(a.source()),s=CN.success(a.value()(s.value(),u),a.remaining(),u);else return a.isFailure()?s:a}function o(s){return sx.firstOf("infix",e.map(function(a){return a.rule}))(s)}return{apply:i,untilExclusive:t,untilInclusive:r}}nf.infix=function(e,t){function r(n){return nf.infix(e,function(i){var o=t(i);return function(s){var a=o(s);return a.map(function(u){return function(c,f){return n(c,u,f)}})}})}return{name:e,ruleBuilder:t,map:r}};var kN=function(e){var t;return function(r){return t||(t=e()),t(r)}}});var ux=pe(lx=>{var mm=dm(),DN=hm();lx.RegexTokeniser=NN;function NN(e){e=e.map(function(i){return{name:i.name,regex:new RegExp(i.regex.source,"g")}});function t(i,o){for(var s=new DN(i,o),a=0,u=[];a<i.length;){var c=r(i,a,s);a=c.endIndex,u.push(c.token)}return u.push(n(i,s)),u}function r(i,o,s){for(var a=0;a<e.length;a++){var u=e[a].regex;u.lastIndex=o;var c=u.exec(i);if(c){var h=o+c[0].length;if(c.index===o&&h>o){var f=c[1],p=new mm(e[a].name,f,s.range(o,h));return{token:p,endIndex:h}}}}var h=o+1,p=new mm("unrecognisedCharacter",i.substring(o,h),s.range(o,h));return{token:p,endIndex:h}}function n(i,o){return new mm("end",null,o.range(i.length,i.length))}return{tokenise:t}}});var gm=pe(Qr=>{Qr.Parser=G_().Parser;Qr.rules=fm();Qr.errors=cm();Qr.results=ef();Qr.StringSource=hm();Qr.Token=dm();Qr.bottomUp=ax();Qr.RegexTokeniser=ux().RegexTokeniser;Qr.rule=function(e){var t;return function(r){return t||(t=e()),t(r)}}});var fx=pe(Et=>{Et.paragraph=ON;Et.run=RN;Et.table=IN;Et.bold=new zr("bold");Et.italic=new zr("italic");Et.underline=new zr("underline");Et.strikethrough=new zr("strikethrough");Et.allCaps=new zr("allCaps");Et.smallCaps=new zr("smallCaps");Et.highlight=FN;Et.commentReference=new zr("commentReference");Et.lineBreak=new of({breakType:"line"});Et.pageBreak=new of({breakType:"page"});Et.columnBreak=new of({breakType:"column"});Et.equalTo=BN;Et.startsWith=LN;function ON(e){return new zr("paragraph",e)}function RN(e){return new zr("run",e)}function IN(e){return new zr("table",e)}function FN(e){return new cx(e)}function zr(e,t){t=t||{},this._elementType=e,this._styleId=t.styleId,this._styleName=t.styleName,t.list&&(this._listIndex=t.list.levelIndex,this._listIsOrdered=t.list.isOrdered)}zr.prototype.matches=function(e){return e.type===this._elementType&&(this._styleId===void 0||e.styleId===this._styleId)&&(this._styleName===void 0||e.styleName&&this._styleName.operator(this._styleName.operand,e.styleName))&&(this._listIndex===void 0||MN(e,this._listIndex,this._listIsOrdered))&&(this._breakType===void 0||this._breakType===e.breakType)};function cx(e){e=e||{},this._color=e.color}cx.prototype.matches=function(e){return e.type==="highlight"&&(this._color===void 0||e.color===this._color)};function of(e){e=e||{},this._breakType=e.breakType}of.prototype.matches=function(e){return e.type==="break"&&(this._breakType===void 0||e.breakType===this._breakType)};function MN(e,t,r){return e.numbering&&e.numbering.level==t&&e.numbering.isOrdered==r}function BN(e){return{operator:PN,operand:e}}function LN(e){return{operator:zN,operand:e}}function PN(e,t){return e.toUpperCase()===t.toUpperCase()}function zN(e,t){return t.toUpperCase().ind
`,r:"\r",t:" "};function yx(e){return e.replace(/\\(.)/g,function(t,r){return ZN[r]||r})}var JN=ge.rules.sequence(ge.rules.tokenOfType("open-square-bracket"),ge.rules.sequence.cut(),ge.rules.sequence.capture(af),ge.rules.tokenOfType("equals"),ge.rules.sequence.capture(vs),ge.rules.tokenOfType("close-square-bracket")).map(function(e,t){return{name:e,value:t,append:!1}}),YN=ge.rules.sequence(ge.rules.tokenOfType("dot"),ge.rules.sequence.cut(),ge.rules.sequence.capture(af)).map(function(e){return{name:"class",value:e,append:!0}}),QN=ge.rules.firstOf("attribute or class",JN,YN);function vm(e,t){var r=WN(t),n=ge.Parser(),i=n.parseTokens(e,r);return i.isSuccess()?ym.success(i.value()):new ym.Result(null,[ym.warning(eO(t,i))])}function eO(e,t){return"Did not understand this style mapping, so ignored it: "+e+`
`+t.errors().map(tO).join(`
`)}function tO(e){return"Error was at character number "+e.characterNumber()+": Expected "+e.expected+" but got "+e.actual}var rO=GN()});var _x=pe(uf=>{uf.readOptions=oO;var bx=(rt(),it(tt)),nO=uf._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],iO=uf._standardOptions={externalFileAccess:!1,transformDocument:sO,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function oO(e){return e=e||{},bx.extend({},iO,e,{customStyleMap:wx(e.styleMap),readStyleMap:function(){var t=this.customStyleMap;return this.includeEmbeddedStyleMap&&(t=t.concat(wx(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(t=t.concat(nO)),t}})}function wx(e){return e?bx.isString(e)?e.split(`
`).map(function(t){return t.trim()}).filter(function(t){return t!==""&&t.charAt(0)!=="#"}):e:[]}function sO(e){return e}});var Ax=pe(Ex=>{var xx=En(),aO=vp();Ex.openZip=lO;function lO(e){return e.arrayBuffer?xx.resolve(aO.openArrayBuffer(e.arrayBuffer)):xx.reject(new Error("Could not find file in options"))}});var Tx=pe(Sx=>{var uO=al(),cO=ll();Sx.element=fO;function fO(e){return function(t){return cO.elementWithTag(uO.element(e),[t])}}});var kx=pe(Ur=>{var hO=(rt(),it(tt)),Cx=c_(),wm=d_(),dO=z_().DocumentConverter,pO=j_().convertElementToRawText,mO=vx().readStyle,gO=_x().readOptions,cf=Ax(),yO=$r().Result;Ur.convertToHtml=vO;Ur.convertToMarkdown=wO;Ur.convert=bm;Ur.extractRawText=EO;Ur.images=sm();Ur.transforms=Vp();Ur.underline=Tx();Ur.embedStyleMap=AO;Ur.readEmbeddedStyleMap=bO;function vO(e,t){return bm(e,t)}function wO(e,t){var r=Object.create(t||{});return r.outputFormat="markdown",bm(e,r)}function bm(e,t){return t=gO(t),cf.openZip(e).tap(function(r){return wm.readStyleMap(r).then(function(n){t.embeddedStyleMap=n})}).then(function(r){return Cx.read(r,e,t).then(function(n){return n.map(t.transformDocument)}).then(function(n){return _O(n,t)})})}function bO(e){return cf.openZip(e).then(wm.readStyleMap)}function _O(e,t){var r=xO(t.readStyleMap()),n=hO.extend({},t,{styleMap:r.value}),i=new dO(n);return e.flatMapThen(function(o){return r.flatMapThen(function(s){return i.convertToHtml(o)})})}function xO(e){return yO.combine((e||[]).map(mO)).map(function(t){return t.filter(function(r){return!!r})})}function EO(e){return cf.openZip(e).then(Cx.read).then(function(t){return t.map(pO)})}function AO(e,t){return cf.openZip(e).tap(function(r){return wm.writeStyleMap(r,t)}).then(function(r){return r.toArrayBuffer()}).then(function(r){return{toArrayBuffer:function(){return r},toBuffer:function(){return Buffer.from(r)}}})}Ur.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)}});var b3=f1(kx(),1);var kg={};Ut(kg,{AbstractNumbering:()=>qm,AlignmentType:()=>qr,AnnotationReference:()=>EI,Attributes:()=>ut,BaseXmlComponent:()=>yl,Body:()=>wS,Bookmark:()=>AA,BookmarkEnd:()=>TA,BookmarkStart:()=>SA,Border:()=>TE,BorderStyle:()=>Df,BuilderElement:()=>ve,CarriageReturn:()=>kI,CellMerge:()=>XA,CellMergeAttributes:()=>$A,CharacterSet:()=>JI,CheckBox:()=>UF,CheckBoxSymbolElement:()=>wf,CheckBoxUtil:()=>HS,Column:()=>T9,ColumnBreak:()=>BI,Comment:()=>Lm,CommentRangeEnd:()=>cI,CommentRangeStart:()=>uI,CommentReference:()=>fI,Comments:()=>dA,CommentsExtended:()=>pA,ConcreteHyperlink:()=>Ns,ConcreteNumbering:()=>jm,ContinuationSeparator:()=>TI,DayLong:()=>bI,DayShort:()=>yI,DeletedTableCell:()=>KA,DeletedTableRow:()=>VA,DeletedTextRun:()=>L4,Document:()=>NF,DocumentAttributeNamespaces:()=>_f,DocumentAttributes:()=>Ol,DocumentBackground:()=>_S,DocumentBackgroundAttributes:()=>bS,DocumentDefaults:()=>MS,DocumentGridType:()=>g9,Drawing:()=>Nf,DropCapType:()=>r4,EMPTY_OBJECT:()=>Zx,EmphasisMarkType:()=>ag,EmptyElement:()=>gt,EndnoteIdReference:()=>jS,EndnoteReference:()=>mA,EndnoteReferenceRun:()=>zF,EndnoteReferenceRunAttributes:()=>qS,Endnotes:()=>AS,ExternalHyperlink:()=>dg,File:()=>NF,FileChild:()=>Nl,FootNoteReferenceRunAttributes:()=>zS,FootNotes:()=>TS,Footer:()=>LF,FooterWrapper:()=>SS,FootnoteReference:()=>US,FootnoteReferenceElement:()=>AI,FootnoteReferenceRun:()=>PF,FrameAnchorType:()=>n4,FrameWrap:()=>i4,GridSpan:()=>eS,Header:()=>BF,HeaderFooterReferenceType:()=>io,HeaderFooterType:()=>Um,HeaderWrapper:()=>CS,HeadingLevel:()=>LI,HeightRule:()=>n9,HighlightColor:()=>J6,HorizontalPositionAlign:()=>R6,HorizontalPositionRelativeFrom:()=>HE,HpsMeasureElement:()=>df,HyperlinkType:()=>HI,IgnoreIfEmptyXmlComponent:()=>Mn,ImageRun:()=>YR,ImportedRootElementAttributes:()=>wE,ImportedXmlComponent:()=>vE,InitializableXmlComponent:()=>tg,InsertedTableCell:()=>GA,InsertedTableRow:()=>WA,InsertedTextRun:()=>I4,InternalHyperlink:()=>EA,LastRenderedPageBreak:()=>DI,LeaderType:()=>PI,Level:()=>kS,LevelBase:()=>Ag,LevelF
`)>-1&&(L?re=re.split(`
`).map(function(fe){return" "+fe}).join(`
`).slice(2):re=`
`+re.split(`
`).map(function(fe){return" "+fe}).join(`
`))):re=q.stylize("[Circular]","special")),k(M)){if(L&&he.match(/^\d+$/))return re;M=JSON.stringify(""+he),M.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(M=M.slice(1,-1),M=q.stylize(M,"name")):(M=M.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),M=q.stylize(M,"string"))}return M+": "+re}function g(q,Q,oe){var ae=0;return q.reduce(function(he,L){return ae++,L.indexOf(`
`)>=0&&ae++,he+L.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?oe[0]+(Q===""?"":Q+`
`)+" "+q.join(`,
`)+" "+oe[1]:oe[0]+Q+" "+q.join(", ")+" "+oe[1]}e.types=m6();function y(q){return Array.isArray(q)}e.isArray=y;function w(q){return typeof q=="boolean"}e.isBoolean=w;function E(q){return q===null}e.isNull=E;function b(q){return q==null}e.isNullOrUndefined=b;function C(q){return typeof q=="number"}e.isNumber=C;function S(q){return typeof q=="string"}e.isString=S;function A(q){return typeof q=="symbol"}e.isSymbol=A;function k(q){return q===void 0}e.isUndefined=k;function B(q){return O(q)&&F(q)==="[object RegExp]"}e.isRegExp=B,e.types.isRegExp=B;function O(q){return typeof q=="object"&&q!==null}e.isObject=O;function P(q){return O(q)&&F(q)==="[object Date]"}e.isDate=P,e.types.isDate=P;function Y(q){return O(q)&&(F(q)==="[object Error]"||q instanceof Error)}e.isError=Y,e.types.isNativeError=Y;function _(q){return typeof q=="function"}e.isFunction=_;function W(q){return q===null||typeof q=="boolean"||typeof q=="number"||typeof q=="string"||typeof q=="symbol"||typeof q>"u"}e.isPrimitive=W,e.isBuffer=g6();function F(q){return Object.prototype.toString.call(q)}function J(q){return q<10?"0"+q.toString(10):q.toString(10)}var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function H(){var q=new Date,Q=[J(q.getHours()),J(q.getMinutes()),J(q.getSeconds())].join(":");return[q.getDate(),j[q.getMonth()],Q].join(" ")}e.log=function(){console.log("%s - %s",H(),e.format.apply(e,arguments))},e.inherits=pi(),e._extend=function(q,Q){if(!Q||!O(Q))return q;for(var oe=Object.keys(Q),ae=oe.length;ae--;)q[oe[ae]]=Q[oe[ae]];return q};function $(q,Q){return Object.prototype.hasOwnProperty.call(q,Q)}var z=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(Q){if(typeof Q!="function")throw new TypeError('The "original" argument must be of type Function');if(z&&Q[z]){var oe=Q[z];if(typeof oe!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(oe,z,{value:oe,enumerable:!1,writable:!1,configurable:!0}),oe}function oe(){for(var ae,he,L=new Promise(function(ne,fe){ae=ne,he=fe}),M=[],re=0;re<arguments.length;re++)M.push(arguments[re]);M.push(function(ne,fe){ne?he(ne):ae(fe)});try{Q.apply(this,M)}catch(ne){he(ne)}return L}return Object.setPrototypeOf(oe,Object.getPrototypeOf(Q)),z&&Object.defineProperty(oe,z,{value:oe,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(oe,t(Q))},e.promisify.custom=z;function G(q,Q){if(!q){var oe=new Error("Promise was rejected with a falsy value");oe.reason=q,q=oe}return Q(q)}function X(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');function Q(){for(var oe=[],ae=0;ae<arguments.length;ae++)oe.push(arguments[ae]);var he=oe.pop();if(typeof he!="function")throw new TypeError("The last argument must be of type Function");var L=this,M=function(){return he.apply(L,arguments)};q.apply(this,oe).then(function(re){Oe.nextTick(M.bind(null,null,re))},function(re){Oe.nextTick(G.bind(null,re,M))})}return Object.setPrototypeOf(Q,Object.getPrototypeOf(q)),Object.defineProperties(Q,t(q)),Q}e.callbackify=X})),y6=we(((e,t)=>{function r(m,g){var y=Object.keys(m);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(m);g&&(w=w.filter(function(E){return Object.getOwnPropertyDescriptor(m,E).enumerable})),y.push.apply(y,w)}return y}function n(m){for(var g=1;g<arguments.length;g++){var y=arguments[g]!=null?arguments[g]:{};g%2?r(Object(y),!0).forEach(function(w){i(m,w,y[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(y)):r(Object(y)).forEach(function(w){Object.defineProperty(m,w,Object.getOwnPropertyDescriptor(y,w))})}return m}function i(m,g,y){return g=u(g),g in m?Object.defineProperty(m,g,{value:y,enumerable:!0,configurable:!0,writable:!0}):m[g]=y,m}function o(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function s(m,g){for(var y=0;y<g.length;y++){var w=g[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.definePropert
`||L==="\r"||L===" "}function S(L){return L==='"'||L==="'"}function A(L){return L===">"||C(L)}function k(L,M){return L.test(M)}function B(L,M){return!k(L,M)}var O=0;t.STATE={BEGIN:O++,BEGIN_WHITESPACE:O++,TEXT:O++,TEXT_ENTITY:O++,OPEN_WAKA:O++,SGML_DECL:O++,SGML_DECL_QUOTED:O++,DOCTYPE:O++,DOCTYPE_QUOTED:O++,DOCTYPE_DTD:O++,DOCTYPE_DTD_QUOTED:O++,COMMENT_STARTING:O++,COMMENT:O++,COMMENT_ENDING:O++,COMMENT_ENDED:O++,CDATA:O++,CDATA_ENDING:O++,CDATA_ENDING_2:O++,PROC_INST:O++,PROC_INST_BODY:O++,PROC_INST_ENDING:O++,OPEN_TAG:O++,OPEN_TAG_SLASH:O++,ATTRIB:O++,ATTRIB_NAME:O++,ATTRIB_NAME_SAW_WHITE:O++,ATTRIB_VALUE:O++,ATTRIB_VALUE_QUOTED:O++,ATTRIB_VALUE_CLOSED:O++,ATTRIB_VALUE_UNQUOTED:O++,ATTRIB_VALUE_ENTITY_Q:O++,ATTRIB_VALUE_ENTITY_U:O++,CLOSE_TAG:O++,CLOSE_TAG_SAW_WHITE:O++,SCRIPT:O++,SCRIPT_ENDING:O++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(L){var M=t.ENTITIES[L],re=typeof M=="number"?String.fromCharCode(M):M;t.ENTITIES[L]=re});for(var P in t.STATE)t.STATE[t.STATE[P]]=P;O=t.STATE;function Y(L,M,re){L[M]&&L[M](re)}function _(L,M,re){L.textNode&&W(L),Y(L,M,re)}function W(L){L.textNode=F(L.opt,L.textNode),L.textNode&&Y(L,"ontext",L.textNode),L.textNode=""}function F(L,M){return L.trim&&(M=M.trim()),L.normalize&&(M=M.replace(/\s+/g," ")),M}function J(L,M){return W(L),L.trackPosition&&(M+=`
Line: `+L.line+`
Column: `+L.column+`
Char: `+L.c),M=new Error(M),L.error=M,Y(L,"onerror",M),L}function j(L){return L.sawRoot&&!L.closedRoot&&H(L,"Unclosed root tag"),L.state!==O.BEGIN&&L.state!==O.BEGIN_WHITESPACE&&L.state!==O.TEXT&&J(L,"Unexpected end"),W(L),L.c="",L.closed=!0,Y(L,"onend"),n.call(L,L.strict,L.opt),L}function H(L,M){if(typeof L!="object"||!(L instanceof n))throw new Error("bad call to strictFail");L.strict&&J(L,M)}function $(L){L.strict||(L.tagName=L.tagName[L.looseCase]());var M=L.tags[L.tags.length-1]||L,re=L.tag={name:L.tagName,attributes:{}};L.opt.xmlns&&(re.ns=M.ns),L.attribList.length=0,_(L,"onopentagstart",re)}function z(L,M){var re=L.indexOf(":")<0?["",L]:L.split(":"),ne=re[0],fe=re[1];return M&&L==="xmlns"&&(ne="xmlns",fe=""),{prefix:ne,local:fe}}function G(L){if(L.strict||(L.attribName=L.attribName[L.looseCase]()),L.attribList.indexOf(L.attribName)!==-1||L.tag.attributes.hasOwnProperty(L.attribName)){L.attribName=L.attribValue="";return}if(L.opt.xmlns){var M=z(L.attribName,!0),re=M.prefix,ne=M.local;if(re==="xmlns")if(ne==="xml"&&L.attribValue!==d)H(L,"xml: prefix must be bound to "+d+`
Actual: `+L.attribValue);else if(ne==="xmlns"&&L.attribValue!==m)H(L,"xmlns: prefix must be bound to "+m+`
Actual: `+L.attribValue);else{var fe=L.tag,D=L.tags[L.tags.length-1]||L;fe.ns===D.ns&&(fe.ns=Object.create(D.ns)),fe.ns[ne]=L.attribValue}L.attribList.push([L.attribName,L.attribValue])}else L.tag.attributes[L.attribName]=L.attribValue,_(L,"onattribute",{name:L.attribName,value:L.attribValue});L.attribName=L.attribValue=""}function X(L,M){if(L.opt.xmlns){var re=L.tag,ne=z(L.tagName);re.prefix=ne.prefix,re.local=ne.local,re.uri=re.ns[ne.prefix]||"",re.prefix&&!re.uri&&(H(L,"Unbound namespace prefix: "+JSON.stringify(L.tagName)),re.uri=ne.prefix);var fe=L.tags[L.tags.length-1]||L;re.ns&&fe.ns!==re.ns&&Object.keys(re.ns).forEach(function(Z){_(L,"onopennamespace",{prefix:Z,uri:re.ns[Z]})});for(var D=0,V=L.attribList.length;D<V;D++){var N=L.attribList[D],I=N[0],T=N[1],v=z(I,!0),x=v.prefix,R=v.local,U=x===""?"":re.ns[x]||"",ee={name:I,value:T,prefix:x,local:R,uri:U};x&&x!=="xmlns"&&!U&&(H(L,"Unbound namespace prefix: "+JSON.stringify(x)),ee.uri=x),L.tag.attributes[I]=ee,_(L,"onattribute",ee)}L.attribList.length=0}L.tag.isSelfClosing=!!M,L.sawRoot=!0,L.tags.push(L.tag),_(L,"onopentag",L.tag),M||(!L.noscript&&L.tagName.toLowerCase()==="script"?L.state=O.SCRIPT:L.state=O.TEXT,L.tag=null,L.tagName=""),L.attribName=L.attribValue="",L.attribList.length=0}function q(L){if(!L.tagName){H(L,"Weird empty close tag."),L.textNode+="</>",L.state=O.TEXT;return}if(L.script){if(L.tagName!=="script"){L.script+="</"+L.tagName+">",L.tagName="",L.state=O.SCRIPT;return}_(L,"onscript",L.script),L.script=""}var M=L.tags.length,re=L.tagName;L.strict||(re=re[L.looseCase]());for(var ne=re;M--&&L.tags[M].name!==ne;)H(L,"Unexpected close tag");if(M<0){H(L,"Unmatched closing tag: "+L.tagName),L.textNode+="</"+L.tagName+">",L.state=O.TEXT;return}L.tagName=re;for(var fe=L.tags.length;fe-- >M;){var D=L.tag=L.tags.pop();L.tagName=L.tag.name,_(L,"onclosetag",L.tagName);var V={};for(var N in D.ns)V[N]=D.ns[N];var I=L.tags[L.tags.length-1]||L;L.opt.xmlns&&D.ns!==I.ns&&Object.keys(D.ns).forEach(function(T){var v=D.ns[T];_(L,"onclosenamespace",{prefix:T,uri:v})})}M===0&&(L.closedRoot=!0),L.tagName=L.attribValue=L.attribName="",L.attribList.length=0,L.state=O.TEXT}function Q(L){var M=L.entity,re=M.toLowerCase(),ne,fe="";return L.ENTITIES[M]?L.ENTITIES[M]:L.ENTITIES[re]?L.ENTITIES[re]:(M=re,M.charAt(0)==="#"&&(M.charAt(1)==="x"?(M=M.slice(2),ne=parseInt(M,16),fe=ne.toString(16)):(M=M.slice(1),ne=parseInt(M,10),fe=ne.toString(10))),M=M.replace(/^0+/,""),isNaN(ne)||fe.toLowerCase()!==M?(H(L,"Invalid character entity"),"&"+L.entity+";"):String.fromCodePoint(ne))}function oe(L,M){M==="<"?(L.state=O.OPEN_WAKA,L.startTagPosition=L.position):C(M)||(H(L,"Non-whitespace before first tag."),L.textNode=M,L.state=O.TEXT)}function ae(L,M){var re="";return M<L.length&&(re=L.charAt(M)),re}function he(L){var M=this;if(this.error)throw this.error;if(M.closed)return J(M,"Cannot write after close. Assign an onready handler.");if(L===null)return j(M);typeof L=="object"&&(L=L.toString());for(var re=0,ne="";ne=ae(L,re++),M.c=ne,!!ne;)switch(M.trackPosition&&(M.position++,ne===`
`?(M.line++,M.column=0):M.column++),M.state){case O.BEGIN:if(M.state=O.BEGIN_WHITESPACE,ne==="\uFEFF")continue;oe(M,ne);continue;case O.BEGIN_WHITESPACE:oe(M,ne);continue;case O.TEXT:if(M.sawRoot&&!M.closedRoot){for(var fe=re-1;ne&&ne!=="<"&&ne!=="&";)ne=ae(L,re++),ne&&M.trackPosition&&(M.position++,ne===`
`?(M.line++,M.column=0):M.column++);M.textNode+=L.substring(fe,re-1)}ne==="<"&&!(M.sawRoot&&M.closedRoot&&!M.strict)?(M.state=O.OPEN_WAKA,M.startTagPosition=M.position):(!C(ne)&&(!M.sawRoot||M.closedRoot)&&H(M,"Text data outside of root node."),ne==="&"?M.state=O.TEXT_ENTITY:M.textNode+=ne);continue;case O.SCRIPT:ne==="<"?M.state=O.SCRIPT_ENDING:M.script+=ne;continue;case O.SCRIPT_ENDING:ne==="/"?M.state=O.CLOSE_TAG:(M.script+="<"+ne,M.state=O.SCRIPT);continue;case O.OPEN_WAKA:if(ne==="!")M.state=O.SGML_DECL,M.sgmlDecl="";else if(!C(ne))if(k(y,ne))M.state=O.OPEN_TAG,M.tagName=ne;else if(ne==="/")M.state=O.CLOSE_TAG,M.tagName="";else if(ne==="?")M.state=O.PROC_INST,M.procInstName=M.procInstBody="";else{if(H(M,"Unencoded <"),M.startTagPosition+1<M.position){var D=M.position-M.startTagPosition;ne=new Array(D).join(" ")+ne}M.textNode+="<"+ne,M.state=O.TEXT}continue;case O.SGML_DECL:(M.sgmlDecl+ne).toUpperCase()===h?(_(M,"onopencdata"),M.state=O.CDATA,M.sgmlDecl="",M.cdata=""):M.sgmlDecl+ne==="--"?(M.state=O.COMMENT,M.comment="",M.sgmlDecl=""):(M.sgmlDecl+ne).toUpperCase()===p?(M.state=O.DOCTYPE,(M.doctype||M.sawRoot)&&H(M,"Inappropriately located doctype declaration"),M.doctype="",M.sgmlDecl=""):ne===">"?(_(M,"onsgmldeclaration",M.sgmlDecl),M.sgmlDecl="",M.state=O.TEXT):(S(ne)&&(M.state=O.SGML_DECL_QUOTED),M.sgmlDecl+=ne);continue;case O.SGML_DECL_QUOTED:ne===M.q&&(M.state=O.SGML_DECL,M.q=""),M.sgmlDecl+=ne;continue;case O.DOCTYPE:ne===">"?(M.state=O.TEXT,_(M,"ondoctype",M.doctype),M.doctype=!0):(M.doctype+=ne,ne==="["?M.state=O.DOCTYPE_DTD:S(ne)&&(M.state=O.DOCTYPE_QUOTED,M.q=ne));continue;case O.DOCTYPE_QUOTED:M.doctype+=ne,ne===M.q&&(M.q="",M.state=O.DOCTYPE);continue;case O.DOCTYPE_DTD:M.doctype+=ne,ne==="]"?M.state=O.DOCTYPE:S(ne)&&(M.state=O.DOCTYPE_DTD_QUOTED,M.q=ne);continue;case O.DOCTYPE_DTD_QUOTED:M.doctype+=ne,ne===M.q&&(M.state=O.DOCTYPE_DTD,M.q="");continue;case O.COMMENT:ne==="-"?M.state=O.COMMENT_ENDING:M.comment+=ne;continue;case O.COMMENT_ENDING:ne==="-"?(M.state=O.COMMENT_ENDED,M.comment=F(M.opt,M.comment),M.comment&&_(M,"oncomment",M.comment),M.comment=""):(M.comment+="-"+ne,M.state=O.COMMENT);continue;case O.COMMENT_ENDED:ne!==">"?(H(M,"Malformed comment"),M.comment+="--"+ne,M.state=O.COMMENT):M.state=O.TEXT;continue;case O.CDATA:ne==="]"?M.state=O.CDATA_ENDING:M.cdata+=ne;continue;case O.CDATA_ENDING:ne==="]"?M.state=O.CDATA_ENDING_2:(M.cdata+="]"+ne,M.state=O.CDATA);continue;case O.CDATA_ENDING_2:ne===">"?(M.cdata&&_(M,"oncdata",M.cdata),_(M,"onclosecdata"),M.cdata="",M.state=O.TEXT):ne==="]"?M.cdata+="]":(M.cdata+="]]"+ne,M.state=O.CDATA);continue;case O.PROC_INST:ne==="?"?M.state=O.PROC_INST_ENDING:C(ne)?M.state=O.PROC_INST_BODY:M.procInstName+=ne;continue;case O.PROC_INST_BODY:if(!M.procInstBody&&C(ne))continue;ne==="?"?M.state=O.PROC_INST_ENDING:M.procInstBody+=ne;continue;case O.PROC_INST_ENDING:ne===">"?(_(M,"onprocessinginstruction",{name:M.procInstName,body:M.procInstBody}),M.procInstName=M.procInstBody="",M.state=O.TEXT):(M.procInstBody+="?"+ne,M.state=O.PROC_INST_BODY);continue;case O.OPEN_TAG:k(w,ne)?M.tagName+=ne:($(M),ne===">"?X(M):ne==="/"?M.state=O.OPEN_TAG_SLASH:(C(ne)||H(M,"Invalid character in tag name"),M.state=O.ATTRIB));continue;case O.OPEN_TAG_SLASH:ne===">"?(X(M,!0),q(M)):(H(M,"Forward-slash in opening tag not followed by >"),M.state=O.ATTRIB);continue;case O.ATTRIB:if(C(ne))continue;ne===">"?X(M):ne==="/"?M.state=O.OPEN_TAG_SLASH:k(y,ne)?(M.attribName=ne,M.attribValue="",M.state=O.ATTRIB_NAME):H(M,"Invalid attribute name");continue;case O.ATTRIB_NAME:ne==="="?M.state=O.ATTRIB_VALUE:ne===">"?(H(M,"Attribute without value"),M.attribValue=M.attribName,G(M),X(M)):C(ne)?M.state=O.ATTRIB_NAME_SAW_WHITE:k(w,ne)?M.attribName+=ne:H(M,"Invalid attribute name");continue;case O.ATTRIB_NAME_SAW_WHITE:if(ne==="=")M.state=O.ATTRIB_VALUE;else{if(C(ne))continue;H(M,"Attribute without value"),M.tag.attributes[M.attribName]="",M.attribValue="",_(M,"onattribute",{name:M.attribName,value:""}),M.attribName="",ne===">"?X(M):k(y,ne)?(M.attribName=ne,M.state=O.ATTRIB_NAME):(H(M,"Invalid attribute name"
`:"")+Array(A+1).join(S.spaces)}function u(S,A,k){if(A.ignoreAttributes)return"";"attributesFn"in A&&(S=A.attributesFn(S,o,i));var B,O,P,Y,_=[];for(B in S)S.hasOwnProperty(B)&&S[B]!==null&&S[B]!==void 0&&(Y=A.noQuotesForNativeAttributes&&typeof S[B]!="string"?"":'"',O=""+S[B],O=O.replace(/"/g,"&quot;"),P="attributeNameFn"in A?A.attributeNameFn(B,O,o,i):B,_.push(A.spaces&&A.indentAttributes?a(A,k+1,!1):" "),_.push(P+"="+Y+("attributeValueFn"in A?A.attributeValueFn(O,B,o,i):O)+Y));return S&&Object.keys(S).length&&A.spaces&&A.indentAttributes&&_.push(a(A,k,!1)),_.join("")}function c(S,A,k){return i=S,o="xml",A.ignoreDeclaration?"":"<?xml"+u(S[A.attributesKey],A,k)+"?>"}function f(S,A,k){if(A.ignoreInstruction)return"";var B;for(B in S)if(S.hasOwnProperty(B))break;var O="instructionNameFn"in A?A.instructionNameFn(B,S[B],o,i):B;if(typeof S[B]=="object")return i=S,o=O,"<?"+O+u(S[B][A.attributesKey],A,k)+"?>";var P=S[B]?S[B]:"";return"instructionFn"in A&&(P=A.instructionFn(P,B,o,i)),"<?"+O+(P?" "+P:"")+"?>"}function h(S,A){return A.ignoreComment?"":"<!--"+("commentFn"in A?A.commentFn(S,o,i):S)+"-->"}function p(S,A){return A.ignoreCdata?"":"<![CDATA["+("cdataFn"in A?A.cdataFn(S,o,i):S.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function d(S,A){return A.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in A?A.doctypeFn(S,o,i):S)+">"}function m(S,A){return A.ignoreText?"":(S=""+S,S=S.replace(/&amp;/g,"&"),S=S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in A?A.textFn(S,o,i):S)}function g(S,A){var k;if(S.elements&&S.elements.length)for(k=0;k<S.elements.length;++k)switch(S.elements[k][A.typeKey]){case"text":if(A.indentText)return!0;break;case"cdata":if(A.indentCdata)return!0;break;case"instruction":if(A.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function y(S,A,k){i=S,o=S.name;var B=[],O="elementNameFn"in A?A.elementNameFn(S.name,S):S.name;B.push("<"+O),S[A.attributesKey]&&B.push(u(S[A.attributesKey],A,k));var P=S[A.elementsKey]&&S[A.elementsKey].length||S[A.attributesKey]&&S[A.attributesKey]["xml:space"]==="preserve";return P||("fullTagEmptyElementFn"in A?P=A.fullTagEmptyElementFn(S.name,S):P=A.fullTagEmptyElement),P?(B.push(">"),S[A.elementsKey]&&S[A.elementsKey].length&&(B.push(w(S[A.elementsKey],A,k+1)),i=S,o=S.name),B.push(A.spaces&&g(S,A)?`
`+Array(k+1).join(A.spaces):""),B.push("</"+O+">")):B.push("/>"),B.join("")}function w(S,A,k,B){return S.reduce(function(O,P){var Y=a(A,k,B&&!O);switch(P.type){case"element":return O+Y+y(P,A,k);case"comment":return O+Y+h(P[A.commentKey],A);case"doctype":return O+Y+d(P[A.doctypeKey],A);case"cdata":return O+(A.indentCdata?Y:"")+p(P[A.cdataKey],A);case"text":return O+(A.indentText?Y:"")+m(P[A.textKey],A);case"instruction":var _={};return _[P[A.nameKey]]=P[A.attributesKey]?P:P[A.instructionKey],O+(A.indentInstruction?Y:"")+f(_,A,k)}},"")}function E(S,A,k){var B;for(B in S)if(S.hasOwnProperty(B))switch(B){case A.parentKey:case A.attributesKey:break;case A.textKey:if(A.indentText||k)return!0;break;case A.cdataKey:if(A.indentCdata||k)return!0;break;case A.instructionKey:if(A.indentInstruction||k)return!0;break;case A.doctypeKey:case A.commentKey:return!0;default:return!0}return!1}function b(S,A,k,B,O){i=S,o=A;var P="elementNameFn"in k?k.elementNameFn(A,S):A;if(typeof S>"u"||S===null||S==="")return"fullTagEmptyElementFn"in k&&k.fullTagEmptyElementFn(A,S)||k.fullTagEmptyElement?"<"+P+"></"+P+">":"<"+P+"/>";var Y=[];if(A){if(Y.push("<"+P),typeof S!="object")return Y.push(">"+m(S,k)+"</"+P+">"),Y.join("");S[k.attributesKey]&&Y.push(u(S[k.attributesKey],k,B));var _=E(S,k,!0)||S[k.attributesKey]&&S[k.attributesKey]["xml:space"]==="preserve";if(_||("fullTagEmptyElementFn"in k?_=k.fullTagEmptyElementFn(A,S):_=k.fullTagEmptyElement),_)Y.push(">");else return Y.push("/>"),Y.join("")}return Y.push(C(S,k,B+1,!1)),i=S,o=A,A&&Y.push((O?a(k,B,!1):"")+"</"+P+">"),Y.join("")}function C(S,A,k,B){var O,P,Y,_=[];for(P in S)if(S.hasOwnProperty(P))for(Y=n(S[P])?S[P]:[S[P]],O=0;O<Y.length;++O){switch(P){case A.declarationKey:_.push(c(Y[O],A,k));break;case A.instructionKey:_.push((A.indentInstruction?a(A,k,B):"")+f(Y[O],A,k));break;case A.attributesKey:case A.parentKey:break;case A.textKey:_.push((A.indentText?a(A,k,B):"")+m(Y[O],A));break;case A.cdataKey:_.push((A.indentCdata?a(A,k,B):"")+p(Y[O],A));break;case A.doctypeKey:_.push(a(A,k,B)+d(Y[O],A));break;case A.commentKey:_.push(a(A,k,B)+h(Y[O],A));break;default:_.push(a(A,k,B)+b(Y[O],P,A,k,E(Y[O],A)))}B=B&&!_.length}return _.join("")}t.exports=function(S,A){A=s(A);var k=[];return i=S,o="_root_",A.compact?k.push(C(S,A,0,!0)):(S[A.declarationKey]&&k.push(c(S[A.declarationKey],A,0)),S[A.elementsKey]&&S[A.elementsKey].length&&k.push(w(S[A.elementsKey],A,0,!k.length))),k.join("")}})),T6=we(((e,t)=>{var r=yE();t.exports=function(n,i){n instanceof Buffer&&(n=n.toString());var o=null;if(typeof n=="string")try{o=JSON.parse(n)}catch{throw new Error("The JSON structure is invalid")}else o=n;return r(o,i)}})),Tf=we(((e,t)=>{t.exports={xml2js:gE(),xml2json:S6(),js2xml:yE(),json2xml:T6()}}))(),Cf=e=>{switch(e.type){case void 0:case"element":let t=new vE(e.name,e.attributes),r=e.elements||[];for(let n of r){let i=Cf(n);i!==void 0&&t.push(i)}return t;case"text":return e.text;default:return}},C6=class extends Ee{},vE=class extends le{static fromXmlString(e){return Cf((0,Tf.xml2js)(e,{compact:!1}))}constructor(e,t){super(e),t&&this.root.push(new C6(t))}push(e){this.root.push(e)}},wE=class extends le{constructor(e){super(""),ue(this,"_attr",void 0),this._attr=e}prepForXml(e){return{_attr:this._attr}}},k6="",tg=class extends le{constructor(e,t){super(e),t&&(this.root=t.root)}},lt=e=>{if(isNaN(e))throw new Error(`Invalid value '${e}' specified. Must be an integer.`);return Math.floor(e)},El=e=>{let t=lt(e);if(t<0)throw new Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},kf=(e,t)=>{let r=t*2;if(e.length!==r||isNaN(+`0x${e}`))throw new Error(`Invalid hex value '${e}'. Expected ${r} digit hex value`);return e},D6=e=>kf(e,4),bE=e=>kf(e,2),Im=e=>kf(e,1),Al=e=>{let t=e.slice(-2),r=e.substring(0,e.length-2);return`${Number(r)}${t}`},rg=e=>{let t=Al(e);if(parseFloat(t)<0)throw new Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},oo=e=>e==="auto"?e:kf(e.charAt(0)==="#"?e.substring(1):e,3),on=e=>typeof e=="string"?Al(e):lt(e),_E=e=>typeof e=="string"?rg(e):El(e),N6=e=
\0`,oe+=o(X,2),oe+=A.magic,oe+=o(b,2),oe+=o(C,2),oe+=o(G.crc32,4),oe+=o(G.compressedSize,4),oe+=o(G.uncompressedSize,4),oe+=o(B.length,2),oe+=o(J.length,2),{fileRecord:h.LOCAL_FILE_HEADER+oe+B+J,dirRecord:h.CENTRAL_FILE_HEADER+o(Q,2)+oe+o(Y.length,2)+"\0\0\0\0"+o(q,4)+o(y,4)+B+J+Y}}var a=r("../utils"),u=r("../stream/GenericWorker"),c=r("../utf8"),f=r("../crc32"),h=r("../signature");function p(d,m,g,y){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=g,this.encodeFileName=y,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,u),p.prototype.push=function(d){var m=d.meta.percent||0,g=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,u.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:g?(m+100*(g-y-1))/g:100}}))},p.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var m=this.streamFiles&&!d.file.dir;if(m){var g=s(d,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(d){this.accumulate=!1;var m=this.streamFiles&&!d.file.dir,g=s(d,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),m)this.push({data:(function(y){return h.DATA_DESCRIPTOR+o(y.crc32,4)+o(y.compressedSize,4)+o(y.uncompressedSize,4)})(d),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var d=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var g=this.bytesWritten-d,y=(function(w,E,b,C,S){var A=a.transformTo("string",S(C));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(w,2)+o(w,2)+o(E,4)+o(b,4)+o(A.length,2)+A})(this.dirRecords.length,g,d,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(d){this._sources.push(d);var m=this;return d.on("data",function(g){m.processChunk(g)}),d.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),d.on("error",function(g){m.error(g)}),this},p.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(d){var m=this._sources;if(!u.prototype.error.call(this,d))return!1;for(var g=0;g<m.length;g++)try{m[g].error(d)}catch{}return!0},p.prototype.lock=function(){u.prototype.lock.call(this);for(var d=this._sources,m=0;m<d.length;m++)d[m].lock()},n.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,n,i){"use strict";var o=r("../compressions"),s=r("./ZipFileWorker");i.generateWorker=function(a,u,c){var f=new s(u.streamFiles,c,u.platform,u.encodeFileName),h=0;try{a.forEach(function(p,d){h++;var m=(function(E,b){var C=E||b,S=o[C];if(!S)throw new Error(C+" is not a valid compression method !");return S})(d.options.compression,u.compression),g=d.options.compressionOptions||u.compressionOptions||{},y=d.dir,w=d.date;d._compressWorker(m,g).withStreamInfo("file",{name:p,dir:y,date:w,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(f)}),f.entriesCount=h}catch(p){f.error(p)}return f}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,n,i){"use strict";function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been re
`:"")),d&&d()}function y(w){return w.interrupt?(w.interrupt.append=h,w.interrupt.end=g,w.interrupt=!1,h(!0),!0):!1}if(h(!1,p.indents+(p.name?"<"+p.name:"")+(p.attributes.length?" "+p.attributes.join(" "):"")+(m?p.name?">":"":p.name?"/>":"")+(p.indent&&m>1?`
`:"")),!m)return h(!1,p.indent?`
`:"");y(p)||g()}function f(h,p){return h+'="'+r(p)+'"'}t.exports=o,t.exports.element=t.exports.Element=s})),QF=Ym(),Ts=Wm(ZF(),1),Xe=Wm(YF(),1),fl=0,Cm=32,eM=32,tM=(e,t)=>{let r=t.replace(/-/g,"");if(r.length!==eM)throw new Error(`Error: Cannot extract GUID from font filename: ${t}`);let n=r.replace(/(..)/g,"$1 ").trim().split(" ").map(s=>parseInt(s,16));n.reverse();let i=e.slice(fl,Cm).map((s,a)=>s^n[a%n.length]),o=new Uint8Array(fl+i.length+Math.max(0,e.length-Cm));return o.set(e.slice(0,fl)),o.set(i,fl),o.set(e.slice(Cm),fl+i.length),o},Sg=class{format(e,t={stack:[]}){let r=e.prepForXml(t);if(r)return r;throw Error("XMLComponent did not format correctly")}},WS=class{replace(e,t,r){let n=e;return t.forEach((i,o)=>{n=n.replace(new RegExp(`{${i.fileName}}`,"g"),(r+o).toString())}),n}getMediaData(e,t){return t.Array.filter(r=>e.search(`{${r.fileName}}`)>0)}},rM=class{replace(e,t){let r=e;for(let n of t)r=r.replace(new RegExp(`{${n.reference}-${n.instance}}`,"g"),n.numId.toString());return r}},nM=class{constructor(){ue(this,"formatter",void 0),ue(this,"imageReplacer",void 0),ue(this,"numberingReplacer",void 0),this.formatter=new Sg,this.imageReplacer=new WS,this.numberingReplacer=new rM}compile(e,t,r=[]){let n=new Ts.default,i=this.xmlifyFile(e,t),o=new Map(Object.entries(i));for(let[,s]of o)if(Array.isArray(s))for(let a of s)n.file(a.path,ml(a.data));else n.file(s.path,ml(s.data));for(let s of r)n.file(s.path,ml(s.data));for(let s of e.Media.Array)s.type!=="svg"?n.file(`word/media/${s.fileName}`,s.data):(n.file(`word/media/${s.fileName}`,s.data),n.file(`word/media/${s.fallback.fileName}`,s.fallback.data));for(let[s,{data:a,fontKey:u}]of e.FontTable.fontOptionsWithKey.entries())n.file(`word/fonts/font${s+1}.odttf`,tM(a,u));return n}xmlifyFile(e,t){let r=e.Document.Relationships.RelationshipCount+1,n=(0,Xe.default)(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),i=e.Comments.Relationships.RelationshipCount+1,o=(0,Xe.default)(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),s=e.FootNotes.Relationships.RelationshipCount+1,a=(0,Xe.default)(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),u=this.imageReplacer.getMediaData(n,e.Media),c=this.imageReplacer.getMediaData(o,e.Media),f=this.imageReplacer.getMediaData(a,e.Media);return be(be({Relationships:{data:(u.forEach((h,p)=>{e.Document.Relationships.addRelationship(r+p,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${h.fileName}`)}),e.Document.Relationships.addRelationship(e.Document.Relationships.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),(0,Xe.default)(this.formatter.format(e.Document.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{let h=this.imageReplacer.replace(n,u,r);return this.numberingReplacer.replace(h,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{let h=(0,Xe.default)(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(h,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:(0,Xe.default)(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:(0,Xe.default)(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:(0,Xe.default)(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent
`)}};wi.empty=new wi(!0);var Fg=class{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}};function yT(e){let t=[];do t.push(kM(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function kM(e){let t=[];do t.push(DM(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function DM(e){let t=RM(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=NM(e,t);else break;return t}function QS(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function NM(e,t){let r=QS(e),n=r;return e.eat(",")&&(e.next!="}"?n=QS(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function OM(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let i=[];for(let o in r){let s=r[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function RM(e){if(e.eat("(")){let t=yT(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=OM(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function IM(e){let t=[[]];return i(o(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,u){let c={term:u,to:a};return t[s].push(c),c}function i(s,a){s.forEach(u=>u.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((u,c)=>u.concat(o(c,a)),[]);if(s.type=="seq")for(let u=0;;u++){let c=o(s.exprs[u],a);if(u==s.exprs.length-1)return c;i(c,a=r())}else if(s.type=="star"){let u=r();return n(a,u),i(o(s.expr,u),u),[n(u)]}else if(s.type=="plus"){let u=r();return i(o(s.expr,a),u),i(o(s.expr,u),u),[n(u)]}else{if(s.type=="opt")return[n(a)].concat(o(s.expr,a));if(s.type=="range"){let u=a;for(let c=0;c<s.min;c++){let f=r();i(o(s.expr,u),f),u=f}if(s.max==-1)i(o(s.expr,u),u);else for(let c=s.min;c<s.max;c++){let f=r();n(u,f),i(o(s.expr,u),f),u=f}return[n(u)]}else{if(s.type=="name")return[n(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function vT(e,t){return t-e}function eT(e,t){let r=[];return n(t),r.sort(vT);function n(i){let o=e[i];if(o.length==1&&!o[0].term)return n(o[0].to);r.push(i);for(let s=0;s<o.length;s++){let{term:a,to:u}=o[s];!a&&r.indexOf(u)==-1&&n(u)}}}function FM(e){let t=Object.create(null);return r(eT(e,0));function r(n){let i=[];n.forEach(s=>{e[s].forEach(({term:a,to:u})=>{if(!a)return;let c;for(let f=0;f<i.length;f++)i[f][0]==a&&(c=i[f][1]);eT(e,u).forEach(f=>{c||i.push([a,c=[]]),c.indexOf(f)==-1&&c.push(f)})})});let o=t[n.join(",")]=new wi(n.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(vT);o.next.push({type:i[s][0],next:t[a.join(",")]||r(a)})}return o}}function MM(e,t){for(let r=0,n=[e];r<n.length;r++){let i=n[r],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:u,next:c}=i.next[a];s.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),n.indexOf(c)==-1&&n.push(c)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function wT(e){let t=Object.create(null);for(let r in e){let n=e[r];if(!n.hasDefault)return null;t[r]=n.default}return t}function bT(e,t){let r=Object.create(null);for(let n in e){let i=t&&t[n];if(i===void 0){let o=e[n];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function _T(e,t,r,n){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${n}`);for(let i in e)e[i].validate&&e[i].validate(t[i])}function xT(
`);else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=n.split(/\r?\n|\r/);for(let u=0;u<a.length;u++)u&&this.insertNode(s.linebreakReplacement.create(),r,!0),a[u]&&this.insertNode(s.text(a[u]),r,!/\S/.test(a[u]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],u=t.previousSibling;(!a||u&&u.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(n=n.slice(1))}n&&this.insertNode(s.text(n),r,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,r,n){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;AT.hasOwnProperty(s)&&this.parser.normalizeLists&&UM(t);let u=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,n));e:if(u?u.ignore:zM.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,r);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(t=u.skip);let c,f=this.needsBlock;if(ET.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,r);break e}let h=u&&u.skip?r:this.readStyles(t,r);h&&this.addAll(t,h),c&&this.sync(o),this.needsBlock=f}else{let c=this.readStyles(t,r);c&&this.addElementByRule(t,u,c,u.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(t,r){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
`),r)}ignoreFallback(t,r){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(t,r){let n=t.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=n.getPropertyValue(o);if(s)for(let a=void 0;;){let u=this.parser.matchStyle(o,s,this,a);if(!u)break;if(u.ignore)return null;if(u.clearMark?r=r.filter(c=>!u.clearMark(c)):r=r.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)a=u;else break}}return r}addElementByRule(t,r,n,i){let o,s;if(r.node)if(s=this.parser.schema.nodes[r.node],s.isLeaf)this.insertNode(s.create(r.attrs),n,t.nodeName=="BR")||this.leafFallback(t,n);else{let u=this.enter(s,r.attrs||null,n,r.preserveWhitespace);u&&(o=!0,n=u)}else{let u=this.parser.schema.marks[r.mark];n=n.concat(u.create(r.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,n,i);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u,n,!1));else{let u=t;typeof r.contentElement=="string"?u=t.querySelector(r.contentElement):typeof r.contentElement=="function"?u=r.contentElement(t):r.contentElement&&(u=r.contentElement),this.findAround(t,u,!0),this.addAll(u,n),this.findAround(t,u,!1)}o&&this.sync(a)&&this.open--}addAll(t,r,n,i){let o=n||0;for(let s=n?t.childNodes[n]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,r);this.findAtPoint(t,o)}findPlace(t,r,n){let i,o;for(let s=this.open,a=0;s>=0;s--){let u=this.nodes[s],c=u.findWrapping(t);if(c&&(!i||i.length>c.length+a)&&(i=c,o=u,!c.length))break;if(u.solid){if(n)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)r=this.enterInner(i[s],null,r,!1);return r}insertNode(t,r,n){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(r=this.enterInner(o,null,r))}let i=this.findPlace(t,r,n);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let s=Le.none;for(let a of i.concat(t.marks))(o.type?o.type.allowsMarkType(a.type):iT(a.type,t.type))&&(s=a.addToSet(s));return o.content.push(t.mark(s)),!0}return!1}enter(t,r,n,i){let o=this.findPlace(t.create(r),n,!1);return o&&(o=this.enterInner(t,r,n,!0,i)),o}enterInner(t,r,n,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=rT(t,o,s.options);s.options&Il&&s.content.length==0&&(a|=Il);let u=Le.none;return n=n.filter(c=>(s.type?s.type.allowsMarkType(c.type):iT(c.type,t))?(u=c.addToSet(u),!1):!0),this.nodes.push(new Fs(t,r,u,i,null,a)),this.open++,n}closeExtra(t=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let r=this.open;r>=0;r--){if(this.nodes[r]==t)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=Ll)}return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)t+=n[i].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(t,r,n){if(t!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&(this.find[r].pos=this.currentPos-(t.nodeValue.length-this.find[r].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,i=!this.isOpen&&(!n||
`))}})}function eB(e,t,r){let n=e.resolve(t),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function tB(e,t,r,n,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");r||(r=o.type);let s=r.create(n,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!r.validContent(o.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new vt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new _e(ye.from(s),0,0),1,!0))}function _i(e,t,r=1,n){let i=e.resolve(t),o=i.depth-r,s=n&&n[n.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,f=r-2;c>o;c--,f--){let h=i.node(c),p=i.index(c);if(h.type.spec.isolating)return!1;let d=h.content.cutByIndex(p,h.childCount),m=n&&n[f+1];m&&(d=d.replaceChild(0,m.type.create(m.attrs)));let g=n&&n[f]||h;if(!h.canReplace(p+1,h.childCount)||!g.type.validContent(d))return!1}let a=i.indexAfter(o),u=n&&n[0];return i.node(o).canReplaceWith(a,a,u?u.type:i.node(o+1).type)}function rB(e,t,r=1,n){let i=e.doc.resolve(t),o=ye.empty,s=ye.empty;for(let a=i.depth,u=i.depth-r,c=r-1;a>u;a--,c--){o=ye.from(i.node(a).copy(o));let f=n&&n[c];s=ye.from(f?f.type.create(f.attrs,s):i.node(a).copy(s))}e.step(new Kt(t,t,new _e(o.append(s),r,r),!0))}function cn(e,t){let r=e.resolve(t),n=r.index();return BT(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function nB(e,t){t.content.size||e.type.compatibleContent(t.type);let r=e.contentMatchAt(e.childCount),{linebreakReplacement:n}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==n?e.type.schema.nodes.text:o.type;if(r=r.matchType(s),!r||!e.type.allowsMarks(o.marks))return!1}return r.validEnd}function BT(e,t){return!!(e&&t&&!e.isLeaf&&nB(e,t))}function Wg(e,t,r=-1){let n=e.resolve(t);for(let i=n.depth;;i--){let o,s,a=n.index(i);if(i==n.depth?(o=n.nodeBefore,s=n.nodeAfter):r>0?(o=n.node(i+1),a++,s=n.node(i).maybeChild(a)):(o=n.node(i).maybeChild(a-1),s=n.node(i+1)),o&&!o.isTextblock&&BT(o,s)&&n.node(i).canReplace(a,a+1))return t;if(i==0)break;t=r<0?n.before(i):n.after(i)}}function iB(e,t,r){let n=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-r),s=o.node().type;if(i&&s.inlineContent){let f=s.whitespace=="pre",h=!!s.contentMatch.matchType(i);f&&!h?n=!1:!f&&h&&(n=!0)}let a=e.steps.length;if(n===!1){let f=e.doc.resolve(t+r);MT(e,f.node(),f.before(),a)}s.inlineContent&&Hg(e,t+r-1,s,o.node().contentMatchAt(o.index()),n==null);let u=e.mapping.slice(a),c=u.map(t-r);if(e.step(new Kt(c,u.map(t+r,-1),_e.empty,!0)),n===!0){let f=e.doc.resolve(c);FT(e,f.node(),f.before(),e.steps.length)}return e}function oB(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let o=n.index(i);if(n.node(i).canReplaceWith(o,o,r))return n.before(i+1);if(o>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let o=n.indexAfter(i);if(n.node(i).canReplaceWith(o,o,r))return n.after(i+1);if(o<n.node(i).childCount)return null}return null}function jf(e,t,r){let n=e.resolve(t);if(!r.content.size)return t;let i=r.content;for(let o=0;o<r.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(r.openStart==0&&r.size?2:1);o++)for(let s=n.depth;s>=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,u=n.index(s)+(a>0?1:0),c=n.node(s),f=!1;if(o==1)f=c.canReplace(u,u,i);else{let h=c.contentMatchAt(u).findWrapping(i.firstChild.type);f=h&&c.canReplaceWith(u,u,h[0])}if(f)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function Wl(e,t,r=t,n=_e.empty){if(t==r&&!n.size)return null;let i=e.resolve(t),o=e.resolve(r);return LT(i,o,n)?new Kt(t,r,n):new qg(i,o,n).fit()}function LT(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}var qg=class{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=ye.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i
`),h&&m==d.nodeValue.length)for(let g=d,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(a=u={node:y.parentNode,offset:St(y)+1});break}let w=g.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let g=d.childNodes[m-1];h=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Dr&&f.focusNode&&f.focusNode!=u.node&&f.focusNode.nodeType==1){let d=f.focusNode.childNodes[f.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||h&&zt)&&_o(a.node,a.offset,f.anchorNode,f.anchorOffset)&&_o(u.node,u.offset,f.focusNode,f.focusOffset))return;let p=!1;if((c.extend||t==r)&&!(h&&Dr)){c.collapse(a.node,a.offset);try{t!=r&&c.extend(u.node,u.offset),p=!0}catch{}}if(!p){if(t>r){let m=a;a=u,u=m}let d=document.createRange();d.setEnd(u.node,u.offset),d.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,i=0;i<this.children.length;i++){let o=this.children[i],s=n+o.size;if(n==s?t<=s&&r>=n:t<s&&r>n){let a=n+o.border,u=s-o.border;if(t>=a&&r<=u){this.dirty=t==n||r==s?mo:tC,t==a&&r==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Hr:o.markDirty(t-a,r-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?mo:Hr}n=s}this.dirty=mo}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?mo:tC;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}},Gf=class extends xo{constructor(t,r,n,i){let o,s=r.type.toDOM;if(typeof s=="function"&&(s=s(n,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.hasAttribute("contenteditable")||(s.contentEditable="false"),s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=r,this.widget=r,o=this}matchesWidget(t){return this.dirty==Nr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},o0=class extends xo{constructor(t,r,n,i){super(t,[],r,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}},yo=class e extends xo{constructor(t,r,n,i,o){super(t,[],n,i),this.mark=r,this.spec=o}static create(t,r,n,i){let o=i.nodeViews[r.type.name],s=o&&o(r,i,n);return(!s||!s.dom)&&(s=bi.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new e(t,r,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Hr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Hr&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=Nr){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=Nr}}slice(t,r,n){let i=e.create(this.parent,this.mark,!0,n),o=this.children,s=this.size;r<s&&(o=u0(o,r,s,n)),t>0&&(o=u0(o,0,t,n));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Si=class e extends xo{constructor(t,r,n,i,o,s,a){super(t,[],o,s),this.node=r,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=a}static create(t,r,n,i,o,s){let a=o.nodeViews[r.type.name],u,c=a&&a(r,o,()=>{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},n,i),f=c&&c.dom,h=c&&c.contentDOM;i
`);return{dom:u,text:p,slice:t}}function A0(e,t,r,n,i){let o=i.parent.type.spec.code,s,a;if(!r&&!t)return null;let u=!!t&&(n||o||!r);if(u){if(e.someProp("transformPastedText",p=>{t=p(t,o||n,e)}),o)return a=new _e(ye.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0),e.someProp("transformPasted",p=>{a=p(a,e,!0)}),a;let h=e.someProp("clipboardTextParser",p=>p(t,i,n,e));if(h)a=h;else{let p=i.marks(),{schema:d}=e.state,m=bi.fromSchema(d);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(d.text(g,p)))})}}else e.someProp("transformPastedHTML",h=>{r=h(r,e)}),s=tL(r),tu&&rL(s);let c=s&&s.querySelector("[data-pm-slice]"),f=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Bs.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!YB.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)a=nL(pC(a,+f[1],+f[2]),f[4]);else if(a=_e.maxOpen(QB(a.content,i),!0),a.openStart||a.openEnd){let h=0,p=0;for(let d=a.content.firstChild;h<a.openStart&&!d.type.spec.isolating;h++,d=d.firstChild);for(let d=a.content.lastChild;p<a.openEnd&&!d.type.spec.isolating;p++,d=d.lastChild);a=pC(a,h,p)}return e.someProp("transformPasted",h=>{a=h(a,e,u)}),a}var YB=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function QB(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let i=t.node(r).contentMatchAt(t.index(r)),o,s=[];if(e.forEach(a=>{if(!s)return;let u=i.findWrapping(a.type),c;if(!u)return s=null;if(c=s.length&&o.length&&jC(u,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=HC(s[s.length-1],o.length));let f=qC(a,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return ye.from(s)}return e}function qC(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,ye.from(e));return e}function jC(e,t,r,n,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=jC(e,t,r,n.lastChild,i+1);if(o)return n.copy(n.content.replaceChild(n.childCount-1,o));if(n.contentMatchAt(n.childCount).matchType(i==e.length-1?r.type:e[i+1]))return n.copy(n.content.append(ye.from(qC(r,e,i+1))))}}function HC(e,t){if(t==0)return e;let r=e.content.replaceChild(e.childCount-1,HC(e.lastChild,t-1)),n=e.contentMatchAt(e.childCount).fillBefore(ye.empty,!0);return e.copy(r.append(n))}function h0(e,t,r,n,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<n-1&&(a=h0(a,t,r,n,i+1,o)),i>=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ye.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function pC(e,t,r){return t<e.openStart&&(e=new _e(h0(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),r<e.openEnd&&(e=new _e(h0(e.content,1,r,e.openEnd,0,0),e.openStart,r)),e}var WC={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function VC(){return document.implementation.createHTMLDocument("title")}var Kl=null;function eL(e){let t=window.trustedTypes;if(!t)return e;if(!Kl){if(Kl=t.defaultPolicy)try{return Kl.createHTML(e)}catch{}Kl=t.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})}return Kl.createHTML(e)}function tL(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=VC(),n=r.body,i=/<([a-z][^>\s]+)/i.exec(e),o;if((o=i&&WC[i[1].toLowerCase()])&&(e=o.map(s=>"<"+s+">").join("")+e+o.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=eL(e),o)for(let s=0;s<o.length;s++)n=n.querySelector(o[s])||n;for(let s=0;s<r.styleSheets.length;s++){let a=r.styleSheets[s];for(let u=0;u<a.rules.length;u++){let c=a.rules[u];if(c instanceof CSSStyleRule){let f=n.querySelectorAll(c.selectorText);for(let h=0;h<f.length;h++)f[h].style.cssText+=c.style.cssText}}}return n}function rL(e){let t=e.querySelectorAll(Tt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<t.length;r++){let n=t[r];n.childNodes.length==1&&n.textContent=="\xA0"&&n.
`).scrollIntoView()),!0)};function t1(e){for(let t=0;t<e.edgeCount;t++){let{type:r}=e.edge(t);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}var o3=(e,t)=>{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),o=r.indexAfter(-1),s=t1(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=r.after(),u=e.tr.replaceWith(a,a,s.createAndFill());u.setSelection(ke.near(u.doc.resolve(a),1)),t(u.scrollIntoView())}return!0},s3=(e,t)=>{let r=e.selection,{$from:n,$to:i}=r;if(r instanceof ar||n.parent.inlineContent||i.parent.inlineContent)return!1;let o=t1(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(Ne.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},a3=(e,t)=>{let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let o=r.before();if(_i(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let n=r.blockRange(),i=n&&fo(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)};function l3(e){return(t,r)=>{if(t.selection instanceof Ce&&t.selection.node.isBlock){let{$from:d}=t.selection;return!d.parentOffset||!_i(t.doc,d.pos)?!1:(r&&r(t.tr.split(d.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let n=t.tr;!t.selection.empty&&(t.selection instanceof Ne||t.selection instanceof ar)&&n.deleteSelection();let{$from:i}=n.selection,o=n.steps.length,s=[],a,u,c=!1,f=!1;for(let d=i.depth;;d--)if(i.node(d).isBlock){c=i.end(d)==i.pos+(i.depth-d),f=i.start(d)==i.pos-(i.depth-d),u=t1(i.node(d-1).contentMatchAt(i.indexAfter(d-1)));let g=e&&e(i.parent,c,i);s.unshift(g||(c&&u?{type:u}:null)),a=d;break}else{if(d==1)return!1;s.unshift(null)}let h=i.pos,p=_i(n.doc,h,s.length,s);if(p||(s[0]=u?{type:u}:null,p=_i(n.doc,h,s.length,s)),!p)return!1;if(n.split(h,s.length,s),!c&&f&&i.node(a).type!=u){let d=n.mapping.slice(o),m=d.map(i.before(a)),g=n.doc.resolve(m);u&&i.node(a-1).canReplaceWith(g.index(),g.index()+1,u)&&n.setNodeMarkup(d.map(i.before(a)),u)}return r&&r(n.scrollIntoView()),!0}}var r1=l3(),B7=(e,t)=>r1(e,t&&(r=>{let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();n&&r.ensureMarks(n),t(r)})),L7=(e,t)=>{let{$from:r,to:n}=e.selection,i,o=r.sharedDepth(n);return o==0?!1:(i=r.before(o),t&&t(e.tr.setSelection(Ce.create(e.doc,i))),!0)},u3=(e,t)=>(t&&t(e.tr.setSelection(new ar(e.doc))),!0);function P7(e,t,r){let n=t.nodeBefore,i=t.nodeAfter,o=t.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&t.parent.canReplace(o-1,o)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||cn(e.doc,t.pos))?!1:(r&&r(e.tr.join(t.pos).scrollIntoView()),!0)}function c3(e,t,r,n){let i=t.nodeBefore,o=t.nodeAfter,s,a,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&P7(e,t,r))return!0;let c=!u&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(r){let d=t.pos+o.nodeSize,m=ye.empty;for(let w=s.length-1;w>=0;w--)m=ye.from(s[w].create(null,m));m=ye.from(i.copy(m));let g=e.tr.step(new vt(t.pos-1,d,t.pos,d,new _e(m,1,0),s.length,!0)),y=g.doc.resolve(d+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&cn(g.doc,y.pos)&&g.join(y.pos),r(g.scrollIntoView())}return!0}let f=o.type.spec.isolating||n>0&&u?null:ke.findFrom(t,1),h=f&&f.$from.blockRange(f.$to),p=h&&fo(h);if(p!=null&&p>=t.depth)return r&&r(e.tr.lift(h,p).scrollIntoView()),!0;if(c&&Zs(o,"start",!0)&&Zs(i,"end")){let d=i,m=[];for(;m.push(d),!d.isTextblock;)d=d.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(d.canReplace(d.childCount,d.childCount,g.content)){if(r){let w=ye.empty;for(let b=m.length-1;b>=0;b--)w=ye.from(m[b].copy(w));let E=e.tr.step(new vt(t.pos-m.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new _e(w,m.length,0),0,!0));r(E.scrollIntoView())}return!0}}return!1}function f3(e){return function(t,r)