Q?Q:l+a));return 1===i?(n=t[r-1],o.push(e[n>>2]+e[n<<4&63]+"==")):2===i&&(n=(t[r-2]<<8)+t[r-1],o.push(e[n>>10]+e[n>>4&63]+e[n<<2&63]+"=")),o.join("")};for(var e=[],t=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function s(t,n,r){for(var i,o,a=[],s=n;s >18&63]+e[o>>12&63]+e[o>>6&63]+e[63&o]);return a.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,Ae}(),n=(ve||(ve=1,pe.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1< >1,v=-7,c=n?i-1:0,u=n?-1:1,A=e[t+c];for(c+=u,o=A&(1<<-v)-1,A>>=-v,v+=s;v>0;o=256*o+e[t+c],c+=u,v-=8);for(a=o&(1<<-v)-1,o>>=-v,v+=r;v>0;a=256*a+e[t+c],c+=u,v-=8);if(0===o)o=1-Q;else{if(o===l)return a?NaN:1/0*(A?-1:1);a+=Math.pow(2,r),o-=Q}return(A?-1:1)*a*Math.pow(2,o-r)},pe.write=function(e,t,n,r,i,o){var a,s,l,Q=8*o-i-1,v=(1<>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=v):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+c>=1?u/l:u*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=v?(s=0,a=v):a+c>=1?(s=(t*l-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[n+A]=255&s,A+=p,s/=256,i-=8);for(a=a<0;e[n+A]=255&a,A+=p,a/=256,Q-=8);e[n+A-p]|=128*m}),pe),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},e.INSPECT_MAX_BYTES=50;var i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return Q(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|A(e,t),r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(D(e,Uint8Array)){var t=new Uint8Array(e);return c(t.buffer,t.byteOffset,t.byteLength)}return v(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return c(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(D(e,SharedArrayBuffer)||e&&D(e.buffer,SharedArrayBuffer)))return c(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);var i=function(e){if(a.isBuffer(e)){var t=0|u(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||R(e.length)?o(0):v(e):"Buffer"===e.type&&Array.isArray(e.data)?v(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Q(e){return l(e),o(e<0?0:0|u(e))}function v(e){for(var t=e.length<0?0:0|u(e.length),n=o(t),r=0;r=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function A(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return N(e).length;default:if(i)return r?-1:L(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return B(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function f(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),R(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:d(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):d(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function d(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function Q(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var v=-1;for(o=n;o s&&(n=s-l),o=n;o>=0;o--){for(var c=!0,u=0;ui&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a >8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function x(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function _(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i 239?4:Q>223?3:Q>191?2:1;if(i+c<=n)switch(c){case 1:Q<128&&(v=Q);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&Q)<<6|63&o)>127&&(v=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&Q)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(v=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&Q)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(v=l)}null===v?(v=65533,c=1):v>65535&&(v-=65536,r.push(v>>>10&1023|55296),v=56320|1023&v),r.push(v),i+=c}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);for(var n="",r=0;r r.length?a.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},a.byteLength=A,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t n&&(t+=" ... ")," "},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(e,t,n,r,i){if(D(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),l=Math.min(o,s),Q=this.slice(r,i),v=e.slice(t,n),c=0;c >>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return h(this,e,t,n);case"utf8":case"utf-8":return g(this,e,t,n);case"ascii":case"latin1":case"binary":return b(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function B(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i r)&&(n=r);for(var i="",o=t;o n)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t e.length)throw new RangeError("Index out of range")}function I(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,r,i,o){return t=+t,r>>>=0,o||I(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function j(e,t,r,i,o){return t=+t,r>>>=0,o||I(e,0,r,8),n.write(e,t,r,i,52,8),r+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t >>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,o=0;++o >>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,o=0;++o =(i*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||T(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o >>=0,n>>>=0,r||T(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);T(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o >0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);T(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r =this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t >>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o 55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function N(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,n,r){for(var i=0;i =t.length||i>=e.length);++i)t[i+n]=e[i];return i}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function R(e){return e!=e}var M=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()}(ue)),ue}var fe,de,he,ge,be,we,ye,xe,_e,ke,Be,Ce,Ee,Se,Oe,Te,Ie={},Fe={};function je(){return de?fe:(de=1,fe=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0})}function Pe(){if(ge)return he;ge=1;var e=je();return he=function(){return e()&&!!Symbol.toStringTag}}function Le(){if(Ce)return Be;Ce=1;var e=function(){if(ke)return _e;ke=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(e,t){for(var n=[],r=0;r 1&&"boolean"!=typeof n)throw new r('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,e))throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=B(e),a=i.length>0?i[0]:"",s=C("%"+a+"%",n),l=s.name,Q=s.value,v=!1,c=s.alias;c&&(a=c[0],b(i,g([0,1],c)));for(var u=1,p=!0;u =i.length){var w=o(Q,m);Q=(p=!!w)&&"get"in w&&!("originalValue"in w.get)?w.get:Q[m]}else p=h(Q,m),Q=Q[m];p&&!v&&(A[l]=Q)}}return Q},Oe}var Ue,De,Re,Me,He,Ge,ze,Ke,qe,Ve,We,Je,Ye,Xe,$e,Ze,et,tt,nt,rt,it,ot,at,st,lt,Qt,vt,ct,ut,At,pt,mt,ft,dt={exports:{}};function ht(){if(De)return Ue;De=1;var e=Ne()("%Object.defineProperty%",!0),t=function(){if(e)try{return e({},"a",{value:1}),!0}catch(e){return!1}return!1};return t.hasArrayLengthDefineBug=function(){if(!t())return null;try{return 1!==e([],"length",{value:1}).length}catch(e){return!0}},Ue=t}function gt(){if(Me)return Re;Me=1;var e=Ne()("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch(t){e=null}return Re=e}function bt(){return qe||(qe=1,function(e){var t=Le(),n=Ne(),r=function(){if(Ke)return ze;Ke=1;var e=Ne(),t=function(){if(Ge)return He;Ge=1;var e=ht()(),t=Ne(),n=e&&t("%Object.defineProperty%",!0);if(n)try{n({},"a",{value:1})}catch(e){n=!1}var r=t("%SyntaxError%"),i=t("%TypeError%"),o=gt();return He=function(e,t,a){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,Q=arguments.length>5?arguments[5]:null,v=arguments.length>6&&arguments[6],c=!!o&&o(e,t);if(n)n(e,t,{configurable:null===Q&&c?c.configurable:!Q,enumerable:null===s&&c?c.enumerable:!s,value:a,writable:null===l&&c?c.writable:!l});else{if(!v&&(s||l||Q))throw new r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=a}},He}(),n=ht()(),r=gt(),i=e("%TypeError%"),o=e("%Math.floor%");return ze=function(e,a){if("function"!=typeof e)throw new i("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||o(a)!==a)throw new i("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],l=!0,Q=!0;if("length"in e&&r){var v=r(e,"length");v&&!v.configurable&&(l=!1),v&&!v.writable&&(Q=!1)}return(l||Q||!s)&&(n?t(e,"length",a,!0,!0):t(e,"length",a)),e},ze}(),i=n("%TypeError%"),o=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||t.call(a,o),l=n("%Object.defineProperty%",!0),Q=n("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){if("function"!=typeof e)throw new i("a function is required");var n=s(t,a,arguments);return r(n,1+Q(0,e.length-(arguments.length-1)),!0)};var v=function(){return s(t,o,arguments)};l?l(e.exports,"apply",{value:v}):e.exports.apply=v}(dt)),dt.exports}function wt(){if(We)return Ve;We=1;var e=Ne(),t=bt(),n=t(e("String.prototype.indexOf"));return Ve=function(r,i){var o=e(r,!!i);return"function"==typeof o&&n(r,".prototype.")>-1?t(o):o}}function yt(){if(at)return ot;at=1;var e=function(){if(nt)return tt;nt=1;var e=function(){if(et)return Ze;et=1;var e,t,n=Function.prototype.toString,r="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof r&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw t}}),t={},r((function(){throw 42}),null,e)}catch(e){e!==t&&(r=null)}else r=null;var i=/^\s*class\b/,o=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},a=function(e){try{return!o(e)&&(n.call(e),!0)}catch(e){return!1}},s=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,Q=!(0 in[,]),v=function(){return!1};if("object"==typeof document){var c=document.all;s.call(c)===s.call(document.all)&&(v=function(e){if((Q||!e)&&(void 0===e||"object"==typeof e))try{var t=s.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}return Ze=r?function(n){if(v(n))return!0;if(!n)return!1;if("function"!=typeof n&&"object"!=typeof n)return!1;try{r(n,null,e)}catch(e){if(e!==t)return!1}return!o(n)&&a(n)}:function(e){if(v(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(l)return a(e);if(o(e))return!1;var t=s.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}}(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(e,t,r){for(var i=0,o=e.length;i =3&&(l=s),"[object Array]"===t.call(n)?r(n,a,l):"string"==typeof n?i(n,a,l):o(n,a,l)},tt}(),t=function(){if(it)return rt;it=1;var e=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],t="undefined"==typeof globalThis?w:globalThis;return rt=function(){for(var n=[],r=0;r -1?n:"Object"===n&&function(t){var n=!1;return e(u,(function(e,r){if(!n)try{e(t),n=Q(r,1)}catch(e){}})),n}(t)}return i?function(t){var n=!1;return e(u,(function(e,r){if(!n)try{"$"+e(t)===r&&(n=Q(r,1))}catch(e){}})),n}(t):null}}function xt(){return Qt||(Qt=1,function(e){var t=function(){if(Ye)return Je;Ye=1;var e=Pe()(),t=wt()("Object.prototype.toString"),n=function(n){return!(e&&n&&"object"==typeof n&&Symbol.toStringTag in n)&&"[object Arguments]"===t(n)},r=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==t(e)&&"[object Function]"===t(e.callee)},i=function(){return n(arguments)}();return n.isLegacyArguments=r,Je=i?n:r}(),n=function(){if($e)return Xe;$e=1;var e,t=Object.prototype.toString,n=Function.prototype.toString,r=/^\s*(?:function)?\*/,i=Pe()(),o=Object.getPrototypeOf;return Xe=function(a){if("function"!=typeof a)return!1;if(r.test(n.call(a)))return!0;if(!i)return"[object GeneratorFunction]"===t.call(a);if(!o)return!1;if(void 0===e){var s=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(e){}}();e=!!s&&o(s)}return o(a)===e}}(),r=yt(),i=function(){if(lt)return st;lt=1;var e=yt();return st=function(t){return!!e(t)}}();function o(e){return e.call.bind(e)}var a="undefined"!=typeof BigInt,s="undefined"!=typeof Symbol,l=o(Object.prototype.toString),Q=o(Number.prototype.valueOf),v=o(String.prototype.valueOf),c=o(Boolean.prototype.valueOf);if(a)var u=o(BigInt.prototype.valueOf);if(s)var A=o(Symbol.prototype.valueOf);function p(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===l(e)}function f(e){return"[object Set]"===l(e)}function d(e){return"[object WeakMap]"===l(e)}function h(e){return"[object WeakSet]"===l(e)}function g(e){return"[object ArrayBuffer]"===l(e)}function b(e){return"undefined"!=typeof ArrayBuffer&&(g.working?g(e):e instanceof ArrayBuffer)}function w(e){return"[object DataView]"===l(e)}function y(e){return"undefined"!=typeof DataView&&(w.working?w(e):e instanceof DataView)}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=i,e.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},e.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||y(e)},e.isUint8Array=function(e){return"Uint8Array"===r(e)},e.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===r(e)},e.isUint16Array=function(e){return"Uint16Array"===r(e)},e.isUint32Array=function(e){return"Uint32Array"===r(e)},e.isInt8Array=function(e){return"Int8Array"===r(e)},e.isInt16Array=function(e){return"Int16Array"===r(e)},e.isInt32Array=function(e){return"Int32Array"===r(e)},e.isFloat32Array=function(e){return"Float32Array"===r(e)},e.isFloat64Array=function(e){return"Float64Array"===r(e)},e.isBigInt64Array=function(e){return"BigInt64Array"===r(e)},e.isBigUint64Array=function(e){return"BigUint64Array"===r(e)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},f.working="undefined"!=typeof Set&&f(new Set),e.isSet=function(e){return"undefined"!=typeof Set&&(f.working?f(e):e instanceof Set)},d.working="undefined"!=typeof WeakMap&&d(new WeakMap),e.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(d.working?d(e):e instanceof WeakMap)},h.working="undefined"!=typeof WeakSet&&h(new WeakSet),e.isWeakSet=function(e){return h(e)},g.working="undefined"!=typeof ArrayBuffer&&g(new ArrayBuffer),e.isArrayBuffer=b,w.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&w(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=y;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function _(e){return"[object SharedArrayBuffer]"===l(e)}function k(e){return void 0!==x&&(void 0===_.working&&(_.working=_(new x)),_.working?_(e):e instanceof x)}function B(e){return p(e,Q)}function C(e){return p(e,v)}function E(e){return p(e,c)}function S(e){return a&&p(e,u)}function O(e){return s&&p(e,A)}e.isSharedArrayBuffer=k,e.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},e.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},e.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},e.isGeneratorObject=function(e){return"[object Generator]"===l(e)},e.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},e.isNumberObject=B,e.isStringObject=C,e.isBooleanObject=E,e.isBigIntObject=S,e.isSymbolObject=O,e.isBoxedPrimitive=function(e){return B(e)||C(e)||E(e)||S(e)||O(e)},e.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(b(e)||k(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))}(Fe)),Fe}function _t(){return ut||(ut=1,function(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r =o)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}})),l=i[r];r =3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),A(n)?r.showHidden=n:n&&e._extend(r,n),d(r.showHidden)&&(r.showHidden=!1),d(r.depth)&&(r.depth=2),d(r.colors)&&(r.colors=!1),d(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),Q(r,t,r.depth)}function s(e,t){var n=a.styles[t];return n?"["+a.colors[n][0]+"m"+e+"["+a.colors[n][1]+"m":e}function l(e,t){return e}function Q(t,n,r){if(t.customInspect&&n&&y(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return f(i)||(i=Q(t,i,r)),i}var o=function(e,t){if(d(t))return e.stylize("undefined","undefined");if(f(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):A(t)?e.stylize(""+t,"boolean"):p(t)?e.stylize("null","null"):void 0}(t,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),w(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return v(n);if(0===a.length){if(y(n)){var l=n.name?": "+n.name:"";return t.stylize("[Function"+l+"]","special")}if(h(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(b(n))return t.stylize(Date.prototype.toString.call(n),"date");if(w(n))return v(n)}var g,x="",_=!1,k=["{","}"];return u(n)&&(_=!0,k=["[","]"]),y(n)&&(x=" [Function"+(n.name?": "+n.name:"")+"]"),h(n)&&(x=" "+RegExp.prototype.toString.call(n)),b(n)&&(x=" "+Date.prototype.toUTCString.call(n)),w(n)&&(x=" "+v(n)),0!==a.length||_&&0!=n.length?r<0?h(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),g=_?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a 60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(g,x,k)):k[0]+x+k[1]}function v(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,n,r,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),C(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=p(n)?Q(e,l.value,null):Q(e,l.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),d(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function u(e){return Array.isArray(e)}function A(e){return"boolean"==typeof e}function p(e){return null===e}function m(e){return"number"==typeof e}function f(e){return"string"==typeof e}function d(e){return void 0===e}function h(e){return g(e)&&"[object RegExp]"===x(e)}function g(e){return"object"==typeof e&&null!==e}function b(e){return g(e)&&"[object Date]"===x(e)}function w(e){return g(e)&&("[object Error]"===x(e)||e instanceof Error)}function y(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function _(e){return e<10?"0"+e.toString(10):e.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!r[t])if(i.test(t)){var n=oe.pid;r[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else r[t]=function(){};return r[t]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=xt(),e.isArray=u,e.isBoolean=A,e.isNull=p,e.isNullOrUndefined=function(e){return null==e},e.isNumber=m,e.isString=f,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=d,e.isRegExp=h,e.types.isRegExp=h,e.isObject=g,e.isDate=b,e.types.isDate=b,e.isError=w,e.types.isNativeError=w,e.isFunction=y,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},e.isBuffer=ct?vt:(ct=1,vt=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8});var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var e=new Date,t=[_(e.getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){console.log("%s - %s",B(),e.format.apply(e,arguments))},e.inherits=H,e._extend=function(e,t){if(!t||!g(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var E="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function S(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}e.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(E&&e[E]){var n;if("function"!=typeof(n=e[E]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(n,E,{value:n,enumerable:!1,writable:!1,configurable:!0}),n}function n(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],o=0;o2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}return t("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,a,s,l;if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var Q=("number"!=typeof l&&(l=0),l+".".length>(s=e).length||-1===s.indexOf(".",l)?"argument":"property");a='The "'.concat(e,'" ').concat(Q," ").concat(i," ").concat(n(t,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Pt.codes=e,Pt}function Nt(){if(Et)return Ct;Et=1;var e=Lt().codes.ERR_INVALID_OPT_VALUE;return Ct={getHighWaterMark:function(t,n,r,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(n,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new e(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}}function Ut(){if(Ot)return St;function e(e){try{if(!w.localStorage)return!1}catch(e){return!1}var t=w.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}return Ot=1,St=function(t,n){if(e("noDeprecation"))return t;var r=!1;return function(){if(!r){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),r=!0}return t.apply(this,arguments)}},St}function Dt(){if(It)return Tt;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var t;It=1,Tt=y,y.WritableState=b;var n,r={deprecate:Ut()},i=le(),o=me().Buffer,a=w.Uint8Array||function(){},s=kt(),l=Nt().getHighWaterMark,Q=Lt().codes,v=Q.ERR_INVALID_ARG_TYPE,c=Q.ERR_METHOD_NOT_IMPLEMENTED,u=Q.ERR_MULTIPLE_CALLBACK,A=Q.ERR_STREAM_CANNOT_PIPE,p=Q.ERR_STREAM_DESTROYED,m=Q.ERR_STREAM_NULL_VALUES,f=Q.ERR_STREAM_WRITE_AFTER_END,d=Q.ERR_UNKNOWN_ENCODING,h=s.errorOrDestroy;function g(){}function b(n,r,i){t=t||Rt(),n=n||{},"boolean"!=typeof i&&(i=r instanceof t),this.objectMode=!!n.objectMode,i&&(this.objectMode=this.objectMode||!!n.writableObjectMode),this.highWaterMark=l(this,n,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===n.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new u;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(oe.nextTick(i,r),oe.nextTick(E,e,t),e._writableState.errorEmitted=!0,h(e,r)):(i(r),e._writableState.errorEmitted=!0,h(e,r),E(e,t))}(e,n,r,t,i);else{var o=B(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||k(e,n),r?oe.nextTick(_,e,n,o,i):_(e,n,o,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==n.emitClose,this.autoDestroy=!!n.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function y(e){var r=this instanceof(t=t||Rt());if(!r&&!n.call(y,this))return new y(e);this._writableState=new b(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),i.call(this)}function x(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new p("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),E(e,t)}function k(t,n){n.bufferProcessing=!0;var r=n.bufferedRequest;if(t._writev&&r&&r.next){var i=n.bufferedRequestCount,o=new Array(i),a=n.corkedRequestsFree;a.entry=r;for(var s=0,l=!0;r;)o[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;o.allBuffers=l,x(t,n,!0,n.length,o,"",a.finish),n.pendingcb++,n.lastBufferedRequest=null,a.next?(n.corkedRequestsFree=a.next,a.next=null):n.corkedRequestsFree=new e(n),n.bufferedRequestCount=0}else{for(;r;){var Q=r.chunk,v=r.encoding,c=r.callback;if(x(t,n,!1,n.objectMode?1:Q.length,Q,v,c),r=r.next,n.bufferedRequestCount--,n.writing)break}null===r&&(n.lastBufferedRequest=null)}n.bufferedRequest=r,n.bufferProcessing=!1}function B(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final((function(n){t.pendingcb--,n&&h(e,n),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var n=B(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,oe.nextTick(C,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}return H(y,i),b.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(b.prototype,"buffer",{get:r.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(n=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!n.call(this,e)||this===y&&e&&e._writableState instanceof b}})):n=function(e){return e instanceof this},y.prototype.pipe=function(){h(this,new A)},y.prototype.write=function(e,t,n){var r,i=this._writableState,s=!1,l=!i.objectMode&&(r=e,o.isBuffer(r)||r instanceof a);return l&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(n=t,t=null),l?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ending?function(e,t){var n=new f;h(e,n),oe.nextTick(t,n)}(this,n):(l||function(e,t,n,r){var i;return null===n?i=new m:"string"==typeof n||t.objectMode||(i=new v("chunk",["string","Buffer"],n)),!i||(h(e,i),oe.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,s=function(e,t,n,r,i,a){if(!n){var s=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,n)),t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var l=t.objectMode?1:r.length;t.length+=l;var Q=t.length -1))throw new d(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new c("_write()"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,E(e,t),n&&(t.finished?oe.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(y.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(y.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=s.destroy,y.prototype._undestroy=s.undestroy,y.prototype._destroy=function(e,t){t(e)},Tt}function Rt(){if(jt)return Ft;jt=1;var e=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};Ft=a;var t=Qn(),n=Dt();H(a,t);for(var r=e(n.prototype),i=0;i >5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function s(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Q(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):""}return rn.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n =0?(o>0&&(e.lastNeed=o-1),o):--i =0?(o>0&&(e.lastNeed=o-2),o):--i =0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},rn}function sn(){if(zt)return Gt;zt=1;var e=Lt().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return Gt=function n(r,i,o){if("function"==typeof i)return n(r,null,i);i||(i={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i 0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return r.alloc(0);for(var t,n,i,o=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=o,i=s,r.prototype.copy.call(t,n,i),s+=a.data.length,a=a.next;return o}},{key:"consume",value:function(e,t){var n;return e i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=r.allocUnsafe(e),n=this.head,i=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0==(e-=a)){a===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++i}return this.length-=i,t}},{key:o,value:function(n,r){return i(this,function(n){for(var r=1;r 0)if("string"==typeof n||Q.objectMode||Object.getPrototypeOf(n)===i.prototype||(n=function(e){return i.from(e)}(n)),a)Q.endEmitted?h(e,new d):_(e,Q,n,!0);else if(Q.ended)h(e,new m);else{if(Q.destroyed)return!1;Q.reading=!1,Q.decoder&&!r?(n=Q.decoder.write(n),Q.objectMode||0!==n.length?_(e,Q,n,!1):S(e,Q)):_(e,Q,n,!1)}else a||(Q.reading=!1,S(e,Q));return!Q.ended&&(Q.length t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function C(e){var n=e._readableState;t("emitReadable",n.needReadable,n.emittedReadable),n.needReadable=!1,n.emittedReadable||(t("emitReadable",n.flowing),n.emittedReadable=!0,oe.nextTick(E,e))}function E(e){var n=e._readableState;t("emitReadable_",n.destroyed,n.length,n.ended),n.destroyed||!n.length&&!n.ended||(e.emit("readable"),n.emittedReadable=!1),n.needReadable=!n.flowing&&!n.ended&&n.length<=n.highWaterMark,j(e)}function S(e,t){t.readingMore||(t.readingMore=!0,oe.nextTick(O,e,t))}function O(e,n){for(;!n.reading&&!n.ended&&(n.length 0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){t("readable nexttick read 0"),e.read(0)}function F(e,n){t("resume",n.reading),n.reading||e.read(0),n.resumeScheduled=!1,e.emit("resume"),j(e),n.flowing&&!n.reading&&e.read(0)}function j(e){var n=e._readableState;for(t("flow",n.flowing);n.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function L(e){var n=e._readableState;t("endReadable",n.endEmitted),n.endEmitted||(n.ended=!0,oe.nextTick(N,n,e))}function N(e,n){if(t("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,n.readable=!1,n.emit("end"),e.autoDestroy)){var r=n._writableState;(!r||r.autoDestroy&&r.finished)&&n.destroy()}}function U(e,t){for(var n=0,r=e.length;n =n.highWaterMark:n.length>0)||n.ended))return t("read: emitReadable",n.length,n.ended),0===n.length&&n.ended?L(this):C(this),null;if(0===(e=B(e,n))&&n.ended)return 0===n.length&&L(this),null;var i,o=n.needReadable;return t("need readable",o),(0===n.length||n.length-e 0?P(e,n):null)?(n.needReadable=n.length<=n.highWaterMark,e=0):(n.length-=e,n.awaitDrain=0),0===n.length&&(n.ended||(n.needReadable=!0),r!==e&&n.ended&&L(this)),null!==i&&this.emit("data",i),i},y.prototype._read=function(e){h(this,new f("_read()"))},y.prototype.pipe=function(e,r){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,t("pipe count=%d opts=%j",o.pipesCount,r);var a=r&&!1===r.end||e===oe.stdout||e===oe.stderr?p:s;function s(){t("onend"),e.end()}o.endEmitted?oe.nextTick(a):i.once("end",a),e.on("unpipe",(function n(r,a){t("onunpipe"),r===i&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,t("cleanup"),e.removeListener("close",u),e.removeListener("finish",A),e.removeListener("drain",l),e.removeListener("error",c),e.removeListener("unpipe",n),i.removeListener("end",s),i.removeListener("end",p),i.removeListener("data",v),Q=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var r=e._readableState;t("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&n(e,"data")&&(r.flowing=!0,j(e))}}(i);e.on("drain",l);var Q=!1;function v(n){t("ondata");var r=e.write(n);t("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==U(o.pipes,e))&&!Q&&(t("false write response, pause",o.awaitDrain),o.awaitDrain++),i.pause())}function c(r){t("onerror",r),p(),e.removeListener("error",c),0===n(e,"error")&&h(e,r)}function u(){e.removeListener("finish",A),p()}function A(){t("onfinish"),e.removeListener("close",u),p()}function p(){t("unpipe"),i.unpipe(e)}return i.on("data",v),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(n):e._events.error=[n,e._events.error]:e.on(t,n)}(e,"error",c),e.once("close",u),e.once("finish",A),e.emit("pipe",i),o.flowing||(t("pipe resume"),i.resume()),e},y.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,t("on readable",o.length,o.reading),o.length?C(this):o.reading||oe.nextTick(I,this))),i},y.prototype.addListener=y.prototype.on,y.prototype.removeListener=function(e,t){var n=r.prototype.removeListener.call(this,e,t);return"readable"===e&&oe.nextTick(T,this),n},y.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||oe.nextTick(T,this),t},y.prototype.resume=function(){var e=this._readableState;return e.flowing||(t("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,oe.nextTick(F,e,t))}(this,e)),e.paused=!1,this},y.prototype.pause=function(){return t("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(t("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},y.prototype.wrap=function(e){var n=this,r=this._readableState,i=!1;for(var o in e.on("end",(function(){if(t("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&n.push(e)}n.push(null)})),e.on("data",(function(o){t("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(n.push(o)||(i=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a 0,(function(e){i||(i=e),e&&v.forEach(a),r||(v.forEach(a),Q(i))}))}));return t.reduce(s)},tn}(),An.Stream=An,An.prototype.pipe=function(e,t){var n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",a),n.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(Q(),0===un.listenerCount(this,"error"))throw e}function Q(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",a),n.removeListener("close",s),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",Q),n.removeListener("close",Q),e.removeListener("close",Q)}return n.on("error",l),e.on("error",l),n.on("end",Q),n.on("close",Q),e.on("close",Q),e.emit("pipe",n),e},function(e){e.parser=function(e,t){return new r(e,t)},e.SAXParser=r,e.SAXStream=o,e.createStream=function(e,t){return new o(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function r(t,i){if(!(this instanceof r))return new r(t,i);var o=this;!function(e){for(var t=0,r=n.length;t "===o?(_(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=w.TEXT):p(o)?(r.state=w.SGML_DECL_QUOTED,r.sgmlDecl+=o):r.sgmlDecl+=o;continue;case w.SGML_DECL_QUOTED:o===r.q&&(r.state=w.SGML_DECL,r.q=""),r.sgmlDecl+=o;continue;case w.DOCTYPE:">"===o?(r.state=w.TEXT,_(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=o,"["===o?r.state=w.DOCTYPE_DTD:p(o)&&(r.state=w.DOCTYPE_QUOTED,r.q=o));continue;case w.DOCTYPE_QUOTED:r.doctype+=o,o===r.q&&(r.q="",r.state=w.DOCTYPE);continue;case w.DOCTYPE_DTD:r.doctype+=o,"]"===o?r.state=w.DOCTYPE:p(o)&&(r.state=w.DOCTYPE_DTD_QUOTED,r.q=o);continue;case w.DOCTYPE_DTD_QUOTED:r.doctype+=o,o===r.q&&(r.state=w.DOCTYPE_DTD,r.q="");continue;case w.COMMENT:"-"===o?r.state=w.COMMENT_ENDING:r.comment+=o;continue;case w.COMMENT_ENDING:"-"===o?(r.state=w.COMMENT_ENDED,r.comment=B(r.opt,r.comment),r.comment&&_(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+o,r.state=w.COMMENT);continue;case w.COMMENT_ENDED:">"!==o?(S(r,"Malformed comment"),r.comment+="--"+o,r.state=w.COMMENT):r.state=w.TEXT;continue;case w.CDATA:"]"===o?r.state=w.CDATA_ENDING:r.cdata+=o;continue;case w.CDATA_ENDING:"]"===o?r.state=w.CDATA_ENDING_2:(r.cdata+="]"+o,r.state=w.CDATA);continue;case w.CDATA_ENDING_2:">"===o?(r.cdata&&_(r,"oncdata",r.cdata),_(r,"onclosecdata"),r.cdata="",r.state=w.TEXT):"]"===o?r.cdata+="]":(r.cdata+="]]"+o,r.state=w.CDATA);continue;case w.PROC_INST:"?"===o?r.state=w.PROC_INST_ENDING:A(o)?r.state=w.PROC_INST_BODY:r.procInstName+=o;continue;case w.PROC_INST_BODY:if(!r.procInstBody&&A(o))continue;"?"===o?r.state=w.PROC_INST_ENDING:r.procInstBody+=o;continue;case w.PROC_INST_ENDING:">"===o?(_(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=w.TEXT):(r.procInstBody+="?"+o,r.state=w.PROC_INST_BODY);continue;case w.OPEN_TAG:f(v,o)?r.tagName+=o:(O(r),">"===o?F(r):"/"===o?r.state=w.OPEN_TAG_SLASH:(A(o)||S(r,"Invalid character in tag name"),r.state=w.ATTRIB));continue;case w.OPEN_TAG_SLASH:">"===o?(F(r,!0),j(r)):(S(r,"Forward-slash in opening tag not followed by >"),r.state=w.ATTRIB);continue;case w.ATTRIB:if(A(o))continue;">"===o?F(r):"/"===o?r.state=w.OPEN_TAG_SLASH:f(Q,o)?(r.attribName=o,r.attribValue="",r.state=w.ATTRIB_NAME):S(r,"Invalid attribute name");continue;case w.ATTRIB_NAME:"="===o?r.state=w.ATTRIB_VALUE:">"===o?(S(r,"Attribute without value"),r.attribValue=r.attribName,I(r),F(r)):A(o)?r.state=w.ATTRIB_NAME_SAW_WHITE:f(v,o)?r.attribName+=o:S(r,"Invalid attribute name");continue;case w.ATTRIB_NAME_SAW_WHITE:if("="===o)r.state=w.ATTRIB_VALUE;else{if(A(o))continue;S(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",_(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===o?F(r):f(Q,o)?(r.attribName=o,r.state=w.ATTRIB_NAME):(S(r,"Invalid attribute name"),r.state=w.ATTRIB)}continue;case w.ATTRIB_VALUE:if(A(o))continue;p(o)?(r.q=o,r.state=w.ATTRIB_VALUE_QUOTED):(S(r,"Unquoted attribute value"),r.state=w.ATTRIB_VALUE_UNQUOTED,r.attribValue=o);continue;case w.ATTRIB_VALUE_QUOTED:if(o!==r.q){"&"===o?r.state=w.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=o;continue}I(r),r.q="",r.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:A(o)?r.state=w.ATTRIB:">"===o?F(r):"/"===o?r.state=w.OPEN_TAG_SLASH:f(Q,o)?(S(r,"No whitespace between attributes"),r.attribName=o,r.attribValue="",r.state=w.ATTRIB_NAME):S(r,"Invalid attribute name");continue;case w.ATTRIB_VALUE_UNQUOTED:if(!m(o)){"&"===o?r.state=w.ATTRIB_VALUE_ENTITY_U:r.attribValue+=o;continue}I(r),">"===o?F(r):r.state=w.ATTRIB;continue;case w.CLOSE_TAG:if(r.tagName)">"===o?j(r):f(v,o)?r.tagName+=o:r.script?(r.script+=""+r.tagName,r.tagName="",r.state=w.SCRIPT):(A(o)||S(r,"Invalid tagname in closing tag"),r.state=w.CLOSE_TAG_SAW_WHITE);else{if(A(o))continue;d(Q,o)?r.script?(r.script+=""+o,r.state=w.SCRIPT):S(r,"Invalid tagname in closing tag."):r.tagName=o}continue;case w.CLOSE_TAG_SAW_WHITE:if(A(o))continue;">"===o?j(r):S(r,"Invalid characters in closing tag");continue;case w.TEXT_ENTITY:case w.ATTRIB_VALUE_ENTITY_Q:case w.ATTRIB_VALUE_ENTITY_U:var l,h;switch(r.state){case w.TEXT_ENTITY:l=w.TEXT,h="textNode";break;case w.ATTRIB_VALUE_ENTITY_Q:l=w.ATTRIB_VALUE_QUOTED,h="attribValue";break;case w.ATTRIB_VALUE_ENTITY_U:l=w.ATTRIB_VALUE_UNQUOTED,h="attribValue"}";"===o?(r[h]+=P(r),r.entity="",r.state=l):f(r.entity.length?u:c,o)?r.entity+=o:(S(r,"Invalid character in entity name"),r[h]+="&"+r.entity+o,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}return r.position>=r.bufferCheckPosition&&function(t){for(var r=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,o=0,a=n.length;or)switch(n[o]){case"textNode":k(t);break;case"cdata":_(t,"oncdata",t.cdata),t.cdata="";break;case"script":_(t,"onscript",t.script),t.script="";break;default:C(t,"Max buffer length exceeded: "+n[o])}i=Math.max(i,s)}var l=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=l+t.position}(r),r},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;k(e=this),""!==e.cdata&&(_(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(_(e,"onscript",e.script),e.script="")}};try{t=cn.Stream}catch(e){t=function(){}}var i=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function o(e,n){if(!(this instanceof o))return new o(e,n);t.apply(this),this._parser=new r(e,n),this.writable=!0,this.readable=!0;var a=this;this._parser.onend=function(){a.emit("end")},this._parser.onerror=function(e){a.emit("error",e),a._parser.error=null},this._decoder=null,i.forEach((function(e){Object.defineProperty(a,"on"+e,{get:function(){return a._parser["on"+e]},set:function(t){if(!t)return a.removeAllListeners(e),a._parser["on"+e]=t,t;a.on(e,t)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(t.prototype,{constructor:{value:o}}),o.prototype.write=function(e){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)){if(!this._decoder){var t=an().StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},o.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},o.prototype.on=function(e,n){var r=this;return r._parser["on"+e]||-1===i.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var a="http://www.w3.org/XML/1998/namespace",s="http://www.w3.org/2000/xmlns/",l={xml:a,xmlns:s},Q=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,c=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,u=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function A(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function p(e){return'"'===e||"'"===e}function m(e){return">"===e||A(e)}function f(e,t){return e.test(t)}function d(e,t){return!f(e,t)}var h,g,b,w=0;for(var y in e.STATE={BEGIN:w++,BEGIN_WHITESPACE:w++,TEXT:w++,TEXT_ENTITY:w++,OPEN_WAKA:w++,SGML_DECL:w++,SGML_DECL_QUOTED:w++,DOCTYPE:w++,DOCTYPE_QUOTED:w++,DOCTYPE_DTD:w++,DOCTYPE_DTD_QUOTED:w++,COMMENT_STARTING:w++,COMMENT:w++,COMMENT_ENDING:w++,COMMENT_ENDED:w++,CDATA:w++,CDATA_ENDING:w++,CDATA_ENDING_2:w++,PROC_INST:w++,PROC_INST_BODY:w++,PROC_INST_ENDING:w++,OPEN_TAG:w++,OPEN_TAG_SLASH:w++,ATTRIB:w++,ATTRIB_NAME:w++,ATTRIB_NAME_SAW_WHITE:w++,ATTRIB_VALUE:w++,ATTRIB_VALUE_QUOTED:w++,ATTRIB_VALUE_CLOSED:w++,ATTRIB_VALUE_UNQUOTED:w++,ATTRIB_VALUE_ENTITY_Q:w++,ATTRIB_VALUE_ENTITY_U:w++,CLOSE_TAG:w++,CLOSE_TAG_SAW_WHITE:w++,SCRIPT:w++,SCRIPT_ENDING:w++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.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(e.ENTITIES).forEach((function(t){var n=e.ENTITIES[t],r="number"==typeof n?String.fromCharCode(n):n;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[y]]=y;function x(e,t,n){e[t]&&e[t](n)}function _(e,t,n){e.textNode&&k(e),x(e,t,n)}function k(e){e.textNode=B(e.opt,e.textNode),e.textNode&&x(e,"ontext",e.textNode),e.textNode=""}function B(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function C(e,t){return k(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,x(e,"onerror",t),e}function E(e){return e.sawRoot&&!e.closedRoot&&S(e,"Unclosed root tag"),e.state!==w.BEGIN&&e.state!==w.BEGIN_WHITESPACE&&e.state!==w.TEXT&&C(e,"Unexpected end"),k(e),e.c="",e.closed=!0,x(e,"onend"),r.call(e,e.strict,e.opt),e}function S(e,t){if("object"!=typeof e||!(e instanceof r))throw new Error("bad call to strictFail");e.strict&&C(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,_(e,"onopentagstart",n)}function T(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function I(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=T(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==a)S(e,"xml: prefix must be bound to "+a+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==s)S(e,"xmlns: prefix must be bound to "+s+"\nActual: "+e.attribValue);else{var i=e.tag,o=e.tags[e.tags.length-1]||e;i.ns===o.ns&&(i.ns=Object.create(o.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,_(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function F(e,t){if(e.opt.xmlns){var n=e.tag,r=T(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(S(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){_(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var o=0,a=e.attribList.length;o",void(e.state=w.TEXT);if(e.script){if("script"!==e.tagName)return e.script+=""+e.tagName+">",e.tagName="",void(e.state=w.SCRIPT);_(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)S(e,"Unexpected close tag");if(t<0)return S(e,"Unmatched closing tag: "+e.tagName),e.textNode+=""+e.tagName+">",void(e.state=w.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,_(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];var l=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==l.ns&&Object.keys(o.ns).forEach((function(t){var n=o.ns[t];_(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=w.TEXT}function P(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==n?(S(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function L(e,t){"<"===t?(e.state=w.OPEN_WAKA,e.startTagPosition=e.position):A(t)||(S(e,"Non-whitespace before first tag."),e.textNode=t,e.state=w.TEXT)}function N(e,t){var n="";return t 1114111||g(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(i+1===o||r.length>n)&&(a+=h.apply(null,r),r.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:b,configurable:!0,writable:!0}):String.fromCodePoint=b)}(_);var pn,mn,fn=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},dn=fn,hn={copyOptions:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},ensureFlagExists:function(e,t){e in t&&"boolean"==typeof t[e]||(t[e]=!1)},ensureSpacesExists:function(e){(!("spaces"in e)||"number"!=typeof e.spaces&&"string"!=typeof e.spaces)&&(e.spaces=0)},ensureAlwaysArrayExists:function(e){"alwaysArray"in e&&("boolean"==typeof e.alwaysArray||dn(e.alwaysArray))||(e.alwaysArray=!1)},ensureKeyExists:function(e,t){e+"Key"in t&&"string"==typeof t[e+"Key"]||(t[e+"Key"]=t.compact?"_"+e:e)},checkFnExists:function(e,t){return e+"Fn"in t}},gn=_,bn=hn,wn=fn;function yn(e){var t=Number(e);if(!isNaN(t))return t;var n=e.toLowerCase();return"true"===n||"false"!==n&&e}function xn(e,t){var n;if(pn.compact){if(!mn[pn[e+"Key"]]&&(wn(pn.alwaysArray)?-1!==pn.alwaysArray.indexOf(pn[e+"Key"]):pn.alwaysArray)&&(mn[pn[e+"Key"]]=[]),mn[pn[e+"Key"]]&&!wn(mn[pn[e+"Key"]])&&(mn[pn[e+"Key"]]=[mn[pn[e+"Key"]]]),e+"Fn"in pn&&"string"==typeof t&&(t=pn[e+"Fn"](t,mn)),"instruction"===e&&("instructionFn"in pn||"instructionNameFn"in pn))for(n in t)if(t.hasOwnProperty(n))if("instructionFn"in pn)t[n]=pn.instructionFn(t[n],n,mn);else{var r=t[n];delete t[n],t[pn.instructionNameFn(n,r,mn)]=r}wn(mn[pn[e+"Key"]])?mn[pn[e+"Key"]].push(t):mn[pn[e+"Key"]]=t}else{mn[pn.elementsKey]||(mn[pn.elementsKey]=[]);var i={};if(i[pn.typeKey]=e,"instruction"===e){for(n in t)if(t.hasOwnProperty(n))break;i[pn.nameKey]="instructionNameFn"in pn?pn.instructionNameFn(n,t,mn):n,pn.instructionHasAttributes?(i[pn.attributesKey]=t[n][pn.attributesKey],"instructionFn"in pn&&(i[pn.attributesKey]=pn.instructionFn(i[pn.attributesKey],n,mn))):("instructionFn"in pn&&(t[n]=pn.instructionFn(t[n],n,mn)),i[pn.instructionKey]=t[n])}else e+"Fn"in pn&&(t=pn[e+"Fn"](t,mn)),i[pn[e+"Key"]]=t;pn.addParent&&(i[pn.parentKey]=mn),mn[pn.elementsKey].push(i)}}function _n(e){var t;if("attributesFn"in pn&&e&&(e=pn.attributesFn(e,mn)),(pn.trim||"attributeValueFn"in pn||"attributeNameFn"in pn||pn.nativeTypeAttributes)&&e)for(t in e)if(e.hasOwnProperty(t)&&(pn.trim&&(e[t]=e[t].trim()),pn.nativeTypeAttributes&&(e[t]=yn(e[t])),"attributeValueFn"in pn&&(e[t]=pn.attributeValueFn(e[t],t,mn)),"attributeNameFn"in pn)){var n=e[t];delete e[t],e[pn.attributeNameFn(t,e[t],mn)]=n}return e}function kn(e){var t={};if(e.body&&("xml"===e.name.toLowerCase()||pn.instructionHasAttributes)){for(var n,r=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(n=r.exec(e.body));)t[n[1]]=n[2]||n[3]||n[4];t=_n(t)}if("xml"===e.name.toLowerCase()){if(pn.ignoreDeclaration)return;mn[pn.declarationKey]={},Object.keys(t).length&&(mn[pn.declarationKey][pn.attributesKey]=t),pn.addParent&&(mn[pn.declarationKey][pn.parentKey]=mn)}else{if(pn.ignoreInstruction)return;pn.trim&&(e.body=e.body.trim());var i={};pn.instructionHasAttributes&&Object.keys(t).length?(i[e.name]={},i[e.name][pn.attributesKey]=t):i[e.name]=e.body,xn("instruction",i)}}function Bn(e,t){var n;if("object"==typeof e&&(t=e.attributes,e=e.name),t=_n(t),"elementNameFn"in pn&&(e=pn.elementNameFn(e,mn)),pn.compact){var r;if(n={},!pn.ignoreAttributes&&t&&Object.keys(t).length)for(r in n[pn.attributesKey]={},t)t.hasOwnProperty(r)&&(n[pn.attributesKey][r]=t[r]);!(e in mn)&&(wn(pn.alwaysArray)?-1!==pn.alwaysArray.indexOf(e):pn.alwaysArray)&&(mn[e]=[]),mn[e]&&!wn(mn[e])&&(mn[e]=[mn[e]]),wn(mn[e])?mn[e].push(n):mn[e]=n}else mn[pn.elementsKey]||(mn[pn.elementsKey]=[]),(n={})[pn.typeKey]="element",n[pn.nameKey]=e,!pn.ignoreAttributes&&t&&Object.keys(t).length&&(n[pn.attributesKey]=t),pn.alwaysChildren&&(n[pn.elementsKey]=[]),mn[pn.elementsKey].push(n);n[pn.parentKey]=mn,mn=n}function Cn(e){pn.ignoreText||(e.trim()||pn.captureSpacesBetweenElements)&&(pn.trim&&(e=e.trim()),pn.nativeType&&(e=yn(e)),pn.sanitize&&(e=e.replace(/&/g,"&").replace(//g,">")),xn("text",e))}function En(e){pn.ignoreComment||(pn.trim&&(e=e.trim()),xn("comment",e))}function Sn(e){var t=mn[pn.parentKey];pn.addParent||delete mn[pn.parentKey],mn=t}function On(e){pn.ignoreCdata||(pn.trim&&(e=e.trim()),xn("cdata",e))}function Tn(e){pn.ignoreDoctype||(e=e.replace(/^ /,""),pn.trim&&(e=e.trim()),xn("doctype",e))}function In(e){e.note=e}var Fn=function(e,t){var n=gn.parser(!0,{}),r={};if(mn=r,pn=function(e){return pn=bn.copyOptions(e),bn.ensureFlagExists("ignoreDeclaration",pn),bn.ensureFlagExists("ignoreInstruction",pn),bn.ensureFlagExists("ignoreAttributes",pn),bn.ensureFlagExists("ignoreText",pn),bn.ensureFlagExists("ignoreComment",pn),bn.ensureFlagExists("ignoreCdata",pn),bn.ensureFlagExists("ignoreDoctype",pn),bn.ensureFlagExists("compact",pn),bn.ensureFlagExists("alwaysChildren",pn),bn.ensureFlagExists("addParent",pn),bn.ensureFlagExists("trim",pn),bn.ensureFlagExists("nativeType",pn),bn.ensureFlagExists("nativeTypeAttributes",pn),bn.ensureFlagExists("sanitize",pn),bn.ensureFlagExists("instructionHasAttributes",pn),bn.ensureFlagExists("captureSpacesBetweenElements",pn),bn.ensureAlwaysArrayExists(pn),bn.ensureKeyExists("declaration",pn),bn.ensureKeyExists("instruction",pn),bn.ensureKeyExists("attributes",pn),bn.ensureKeyExists("text",pn),bn.ensureKeyExists("comment",pn),bn.ensureKeyExists("cdata",pn),bn.ensureKeyExists("doctype",pn),bn.ensureKeyExists("type",pn),bn.ensureKeyExists("name",pn),bn.ensureKeyExists("elements",pn),bn.ensureKeyExists("parent",pn),bn.checkFnExists("doctype",pn),bn.checkFnExists("instruction",pn),bn.checkFnExists("cdata",pn),bn.checkFnExists("comment",pn),bn.checkFnExists("text",pn),bn.checkFnExists("instructionName",pn),bn.checkFnExists("elementName",pn),bn.checkFnExists("attributeName",pn),bn.checkFnExists("attributeValue",pn),bn.checkFnExists("attributes",pn),pn}(t),n.opt={strictEntities:!0},n.onopentag=Bn,n.ontext=Cn,n.oncomment=En,n.onclosetag=Sn,n.onerror=In,n.oncdata=On,n.ondoctype=Tn,n.onprocessinginstruction=kn,n.write(e).close(),r[pn.elementsKey]){var i=r[pn.elementsKey];delete r[pn.elementsKey],r[pn.elementsKey]=i,delete r.text}return r};var jn=Fn;const Pn=e=>{switch(e.type){case void 0:case"element":const t=new Nn(e.name,e.attributes),n=e.elements||[];for(const e of n){const n=Pn(e);void 0!==n&&t.push(n)}return t;case"text":return e.text;default:return}};class Ln extends h{}class Nn extends f{static fromXmlString(e){const t=jn(e,{compact:!1});return Pn(t)}constructor(e,t){super(e),t&&this.root.push(new Ln(t))}push(e){this.root.push(e)}}class Un extends f{constructor(e){super(""),this._attr=e}prepForXml(e){return{_attr:this._attr}}}class Dn extends f{constructor(e,t){super(e),t&&(this.root=t.root)}}const Rn=e=>{if(isNaN(e))throw new Error(`Invalid value '${e}' specified. Must be an integer.`);return Math.floor(e)},Mn=e=>{const t=Rn(e);if(t<0)throw new Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},Hn=(e,t)=>{const n=2*t;if(e.length!==n||isNaN(Number(`0x${e}`)))throw new Error(`Invalid hex value '${e}'. Expected ${n} digit hex value`);return e},Gn=e=>Hn(e,1),zn=e=>{const t=e.slice(-2),n=e.substring(0,e.length-2);return`${Number(n)}${t}`},Kn=e=>{const t=zn(e);if(parseFloat(t)<0)throw new Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},qn=e=>{if("auto"===e)return e;const t="#"===e.charAt(0)?e.substring(1):e;return Hn(t,3)},Vn=e=>"string"==typeof e?zn(e):Rn(e),Wn=e=>"string"==typeof e?Kn(e):Mn(e),Jn=e=>"string"==typeof e?Kn(e):Mn(e),Yn=Mn,Xn=Mn;class $n extends f{constructor(e,t=!0){super(e),!0!==t&&this.root.push(new b({val:t}))}}class Zn extends f{constructor(e,t){super(e),this.root.push(new b({val:Wn(t)}))}}class er extends f{constructor(e,t){super(e),this.root.push(new b({val:t}))}}const tr=(e,t)=>new or({name:e,attributes:{value:{key:"w:val",value:t}}});class nr extends f{constructor(e,t){super(e),this.root.push(new b({val:t}))}}class rr extends f{constructor(e,t){super(e),this.root.push(new b({val:t}))}}class ir extends f{constructor(e,t){super(e),this.root.push(t)}}class or extends f{constructor({name:e,attributes:t,children:n}){super(e),t&&this.root.push(new g(t)),n&&this.root.push(...n)}}const ar="left";class sr extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class lr extends f{constructor(e){super("w:jc"),this.root.push(new sr({val:e}))}}class Qr extends f{constructor(e,{color:t,size:n,space:r,style:i}){super(e),this.root.push(new vr({style:i,color:void 0===t?void 0:qn(t),size:void 0===n?void 0:Yn(n),space:void 0===r?void 0:Xn(r)}))}}class vr extends h{constructor(){super(...arguments),u(this,"xmlKeys",{style:"w:val",color:"w:color",size:"w:sz",space:"w:space"})}}const cr="single";class ur extends d{constructor(e){super("w:pBdr"),e.top&&this.root.push(new Qr("w:top",e.top)),e.bottom&&this.root.push(new Qr("w:bottom",e.bottom)),e.left&&this.root.push(new Qr("w:left",e.left)),e.right&&this.root.push(new Qr("w:right",e.right))}}class Ar extends f{constructor(){super("w:pBdr");const e=new Qr("w:bottom",{color:"auto",space:1,style:cr,size:6});this.root.push(e)}}class pr extends f{constructor({start:e,end:t,left:n,right:r,hanging:i,firstLine:o}){super("w:ind"),this.root.push(new g({start:{key:"w:start",value:void 0===e?void 0:Vn(e)},end:{key:"w:end",value:void 0===t?void 0:Vn(t)},left:{key:"w:left",value:void 0===n?void 0:Vn(n)},right:{key:"w:right",value:void 0===r?void 0:Vn(r)},hanging:{key:"w:hanging",value:void 0===i?void 0:Jn(i)},firstLine:{key:"w:firstLine",value:void 0===o?void 0:Jn(o)}}))}}let mr=class extends f{constructor(){super("w:br")}};class fr extends h{constructor(){super(...arguments),u(this,"xmlKeys",{type:"w:fldCharType",dirty:"w:dirty"})}}class dr extends f{constructor(e){super("w:fldChar"),this.root.push(new fr({type:"begin",dirty:e}))}}class hr extends f{constructor(e){super("w:fldChar"),this.root.push(new fr({type:"separate",dirty:e}))}}class gr extends f{constructor(e){super("w:fldChar"),this.root.push(new fr({type:"end",dirty:e}))}}const br="preserve";class wr extends h{constructor(){super(...arguments),u(this,"xmlKeys",{space:"xml:space"})}}class yr extends f{constructor(){super("w:instrText"),this.root.push(new wr({space:br})),this.root.push("PAGE")}}class xr extends f{constructor(){super("w:instrText"),this.root.push(new wr({space:br})),this.root.push("NUMPAGES")}}class _r extends f{constructor(){super("w:instrText"),this.root.push(new wr({space:br})),this.root.push("SECTIONPAGES")}}class kr extends f{constructor(){super("w:instrText"),this.root.push(new wr({space:br})),this.root.push("SECTION")}}class Br extends h{constructor(){super(...arguments),u(this,"xmlKeys",{fill:"w:fill",color:"w:color",type:"w:val"})}}class Cr extends f{constructor({fill:e,color:t,type:n}){super("w:shd"),this.root.push(new Br({fill:void 0===e?void 0:qn(e),color:void 0===t?void 0:qn(t),type:n}))}}class Er extends h{constructor(){super(...arguments),u(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}}class Sr extends f{constructor(e){super("w:em"),this.root.push(new b({val:e}))}}class Or extends Sr{constructor(e="dot"){super(e)}}class Tr extends f{constructor(e){super("w:spacing"),this.root.push(new b({val:Vn(e)}))}}class Ir extends f{constructor(e){super("w:color"),this.root.push(new b({val:qn(e)}))}}class Fr extends f{constructor(e){super("w:highlight"),this.root.push(new b({val:e}))}}class jr extends f{constructor(e){super("w:highlightCs"),this.root.push(new b({val:e}))}}class Pr extends h{constructor(){super(...arguments),u(this,"xmlKeys",{ascii:"w:ascii",cs:"w:cs",eastAsia:"w:eastAsia",hAnsi:"w:hAnsi",hint:"w:hint"})}}class Lr extends f{constructor(e,t){if(super("w:rFonts"),"string"==typeof e){const n=e;this.root.push(new Pr({ascii:n,cs:n,eastAsia:n,hAnsi:n,hint:t}))}else{const t=e;this.root.push(new Pr(t))}}}let Nr=class extends f{constructor(e){super("w:vertAlign"),this.root.push(new b({val:e}))}};class Ur extends Nr{constructor(){super("superscript")}}class Dr extends Nr{constructor(){super("subscript")}}const Rr="single";class Mr extends f{constructor(e="single",t){super("w:u"),this.root.push(new b({val:e,color:void 0===t?void 0:qn(t)}))}}class Hr extends d{constructor(e){var t,n;if(super("w:rPr"),!e)return;void 0!==e.noProof&&this.push(new $n("w:noProof",e.noProof)),void 0!==e.bold&&this.push(new $n("w:b",e.bold)),(void 0===e.boldComplexScript&&void 0!==e.bold||e.boldComplexScript)&&this.push(new $n("w:bCs",null!=(t=e.boldComplexScript)?t:e.bold)),void 0!==e.italics&&this.push(new $n("w:i",e.italics)),(void 0===e.italicsComplexScript&&void 0!==e.italics||e.italicsComplexScript)&&this.push(new $n("w:iCs",null!=(n=e.italicsComplexScript)?n:e.italics)),e.underline&&this.push(new Mr(e.underline.type,e.underline.color)),e.effect&&this.push(new er("w:effect",e.effect)),e.emphasisMark&&this.push(new Or(e.emphasisMark.type)),e.color&&this.push(new Ir(e.color)),e.kern&&this.push(new Zn("w:kern",e.kern)),e.position&&this.push(new er("w:position",e.position)),void 0!==e.size&&this.push(new Zn("w:sz",e.size));const r=void 0===e.sizeComplexScript||!0===e.sizeComplexScript?e.size:e.sizeComplexScript;r&&this.push(new Zn("w:szCs",r)),void 0!==e.rightToLeft&&this.push(new $n("w:rtl",e.rightToLeft)),void 0!==e.smallCaps?this.push(new $n("w:smallCaps",e.smallCaps)):void 0!==e.allCaps&&this.push(new $n("w:caps",e.allCaps)),void 0!==e.strike&&this.push(new $n("w:strike",e.strike)),void 0!==e.doubleStrike&&this.push(new $n("w:dstrike",e.doubleStrike)),e.subScript&&this.push(new Dr),e.superScript&&this.push(new Ur),e.style&&this.push(new er("w:rStyle",e.style)),e.font&&("string"==typeof e.font?this.push(new Lr(e.font)):"name"in e.font?this.push(new Lr(e.font.name,e.font.hint)):this.push(new Lr(e.font))),e.highlight&&this.push(new Fr(e.highlight));const i=void 0===e.highlightComplexScript||!0===e.highlightComplexScript?e.highlight:e.highlightComplexScript;i&&this.push(new jr(i)),e.characterSpacing&&this.push(new Tr(e.characterSpacing)),void 0!==e.emboss&&this.push(new $n("w:emboss",e.emboss)),void 0!==e.imprint&&this.push(new $n("w:imprint",e.imprint)),e.shading&&this.push(new Cr(e.shading)),e.revision&&this.push(new Gr(e.revision)),e.border&&this.push(new Qr("w:bdr",e.border)),void 0!==e.snapToGrid&&this.push(new $n("w:snapToGrid",e.snapToGrid)),e.vanish&&this.push(new $n("w:vanish",e.vanish)),e.specVanish&&this.push(new $n("w:specVanish",e.vanish)),void 0!==e.scale&&this.push(new nr("w:w",e.scale)),e.language&&this.push((e=>new or({name:"w:lang",attributes:{value:{key:"w:val",value:e.value},eastAsia:{key:"w:eastAsia",value:e.eastAsia},bidirectional:{key:"w:bidi",value:e.bidirectional}}}))(e.language)),e.math&&this.push(new $n("w:oMath",e.math))}push(e){this.root.push(e)}}class Gr extends f{constructor(e){super("w:rPrChange"),this.root.push(new Er({id:e.id,author:e.author,date:e.date})),this.addChildElement(new Hr(e))}}class zr extends f{constructor(e){var t;return super("w:t"),"string"==typeof e?(this.root.push(new wr({space:br})),this.root.push(e),this):(this.root.push(new wr({space:null!=(t=e.space)?t:"default"})),this.root.push(e.text),this)}}const Kr="CURRENT",qr="TOTAL_PAGES";class Vr extends f{constructor(e){if(super("w:r"),u(this,"properties"),this.properties=new Hr(e),this.root.push(this.properties),e.break)for(let t=0;t Math.floor(72*e*20),Yr=(e=0)=>{let t=e;return()=>++t},Xr=()=>((e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})().toLowerCase(),$r=e=>((e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r})("1234567890abcdef",e)();class Zr extends h{constructor(){super(...arguments),u(this,"xmlKeys",{x:"x",y:"y"})}}class ei extends f{constructor(){super("wp:simplePos"),this.root.push(new Zr({x:0,y:0}))}}class ti extends f{constructor(e){super("wp:align"),this.root.push(e)}}class ni extends f{constructor(e){super("wp:posOffset"),this.root.push(e.toString())}}class ri extends h{constructor(){super(...arguments),u(this,"xmlKeys",{relativeFrom:"relativeFrom"})}}class ii extends f{constructor(e){if(super("wp:positionH"),this.root.push(new ri({relativeFrom:e.relative||"page"})),e.align)this.root.push(new ti(e.align));else{if(void 0===e.offset)throw new Error("There is no configuration provided for floating position (Align or offset)");this.root.push(new ni(e.offset))}}}class oi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{relativeFrom:"relativeFrom"})}}class ai extends f{constructor(e){if(super("wp:positionV"),this.root.push(new oi({relativeFrom:e.relative||"page"})),e.align)this.root.push(new ti(e.align));else{if(void 0===e.offset)throw new Error("There is no configuration provided for floating position (Align or offset)");this.root.push(new ni(e.offset))}}}class si extends h{constructor(){super(...arguments),u(this,"xmlKeys",{uri:"uri"})}}class li extends h{constructor(){super(...arguments),u(this,"xmlKeys",{embed:"r:embed",cstate:"cstate"})}}class Qi extends f{constructor(e){super("a:blip"),this.root.push(new li({embed:`rId{${e.fileName}}`,cstate:"none"}))}}class vi extends f{constructor(){super("a:srcRect")}}class ci extends f{constructor(){super("a:fillRect")}}class ui extends f{constructor(){super("a:stretch"),this.root.push(new ci)}}class Ai extends f{constructor(e){super("pic:blipFill"),this.root.push(new Qi(e)),this.root.push(new vi),this.root.push(new ui)}}class pi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{noChangeAspect:"noChangeAspect",noChangeArrowheads:"noChangeArrowheads"})}}class mi extends f{constructor(){super("a:picLocks"),this.root.push(new pi({noChangeAspect:1,noChangeArrowheads:1}))}}class fi extends f{constructor(){super("pic:cNvPicPr"),this.root.push(new mi)}}const di=(e,t)=>new or({name:"a:hlinkClick",attributes:c(v({},t?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{id:{key:"r:id",value:`rId${e}`}})});class hi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{id:"id",name:"name",descr:"descr"})}}class gi extends f{constructor(){super("pic:cNvPr"),this.root.push(new hi({id:0,name:"",descr:""}))}prepForXml(e){for(let t=e.stack.length-1;t>=0;t--){const n=e.stack[t];if(n instanceof Co){this.root.push(di(n.linkId,!1));break}}return super.prepForXml(e)}}class bi extends f{constructor(){super("pic:nvPicPr"),this.root.push(new gi),this.root.push(new fi)}}class wi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{xmlns:"xmlns:pic"})}}class yi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class xi extends f{constructor(e,t){super("a:ext"),u(this,"attributes"),this.attributes=new yi({cx:e,cy:t}),this.root.push(this.attributes)}}class _i extends h{constructor(){super(...arguments),u(this,"xmlKeys",{x:"x",y:"y"})}}class ki extends f{constructor(){super("a:off"),this.root.push(new _i({x:0,y:0}))}}class Bi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{flipVertical:"flipV",flipHorizontal:"flipH",rotation:"rot"})}}class Ci extends f{constructor(e){var t,n;super("a:xfrm"),u(this,"extents"),this.root.push(new Bi({flipVertical:null==(t=e.flip)?void 0:t.vertical,flipHorizontal:null==(n=e.flip)?void 0:n.horizontal,rotation:e.rotation})),this.extents=new xi(e.emus.x,e.emus.y),this.root.push(new ki),this.root.push(this.extents)}}const Ei=()=>new or({name:"a:noFill"}),Si=e=>new or({name:"a:schemeClr",attributes:{value:{key:"val",value:e.value}}}),Oi=e=>new or({name:"a:srgbClr",attributes:{value:{key:"val",value:e.value}}}),Ti=e=>new or({name:"a:solidFill",children:["rgb"===e.type?Oi(e):Si(e)]});class Ii extends f{constructor(){super("a:avLst")}}class Fi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{prst:"prst"})}}class ji extends f{constructor(){super("a:prstGeom"),this.root.push(new Fi({prst:"rect"})),this.root.push(new Ii)}}class Pi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{bwMode:"bwMode"})}}class Li extends f{constructor({outline:e,transform:t}){var n;super("pic:spPr"),u(this,"form"),this.root.push(new Pi({bwMode:"auto"})),this.form=new Ci(t),this.root.push(this.form),this.root.push(new ji),e&&(this.root.push(Ei()),this.root.push(new or({name:"a:ln",attributes:{width:{key:"w",value:(n=e).width},cap:{key:"cap",value:n.cap},compoundLine:{key:"cmpd",value:n.compoundLine},align:{key:"algn",value:n.align}},children:["noFill"===n.type?Ei():"rgb"===n.solidFillType?Ti({type:"rgb",value:n.value}):Ti({type:"scheme",value:n.value})]})))}}class Ni extends f{constructor({mediaData:e,transform:t,outline:n}){super("pic:pic"),this.root.push(new wi({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.root.push(new bi),this.root.push(new Ai(e)),this.root.push(new Li({transform:t,outline:n}))}}class Ui extends f{constructor({mediaData:e,transform:t,outline:n}){super("a:graphicData"),u(this,"pic"),this.root.push(new si({uri:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.pic=new Ni({mediaData:e,transform:t,outline:n}),this.root.push(this.pic)}}class Di extends h{constructor(){super(...arguments),u(this,"xmlKeys",{a:"xmlns:a"})}}class Ri extends f{constructor({mediaData:e,transform:t,outline:n}){super("a:graphic"),u(this,"data"),this.root.push(new Di({a:"http://schemas.openxmlformats.org/drawingml/2006/main"})),this.data=new Ui({mediaData:e,transform:t,outline:n}),this.root.push(this.data)}}class Mi extends f{constructor(){super("wp:wrapNone")}}class Hi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",wrapText:"wrapText"})}}class Gi extends f{constructor(e,t={top:0,bottom:0,left:0,right:0}){super("wp:wrapSquare"),this.root.push(new Hi({wrapText:e.side||"bothSides",distT:t.top,distB:t.bottom,distL:t.left,distR:t.right}))}}class zi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{distT:"distT",distB:"distB"})}}class Ki extends f{constructor(e={top:0,bottom:0}){super("wp:wrapTight"),this.root.push(new zi({distT:e.top,distB:e.bottom}))}}class qi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{distT:"distT",distB:"distB"})}}class Vi extends f{constructor(e={top:0,bottom:0}){super("wp:wrapTopAndBottom"),this.root.push(new qi({distT:e.top,distB:e.bottom}))}}class Wi extends f{constructor({name:e,description:t,title:n}={name:"",description:"",title:""}){super("wp:docPr"),u(this,"docPropertiesUniqueNumericId",Yr()),this.root.push(new g({id:{key:"id",value:this.docPropertiesUniqueNumericId()},name:{key:"name",value:e},description:{key:"descr",value:t},title:{key:"title",value:n}}))}prepForXml(e){for(let t=e.stack.length-1;t>=0;t--){const n=e.stack[t];if(n instanceof Co){this.root.push(di(n.linkId,!0));break}}return super.prepForXml(e)}}const Ji=({top:e,right:t,bottom:n,left:r})=>new or({name:"wp:effectExtent",attributes:{top:{key:"t",value:e},right:{key:"r",value:t},bottom:{key:"b",value:n},left:{key:"l",value:r}}});class Yi extends h{constructor(){super(...arguments),u(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class Xi extends f{constructor(e,t){super("wp:extent"),u(this,"attributes"),this.attributes=new Yi({cx:e,cy:t}),this.root.push(this.attributes)}}class $i extends h{constructor(){super(...arguments),u(this,"xmlKeys",{xmlns:"xmlns:a",noChangeAspect:"noChangeAspect"})}}class Zi extends f{constructor(){super("a:graphicFrameLocks"),this.root.push(new $i({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/main",noChangeAspect:1}))}}class eo extends f{constructor(){super("wp:cNvGraphicFramePr"),this.root.push(new Zi)}}class to extends h{constructor(){super(...arguments),u(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",allowOverlap:"allowOverlap",behindDoc:"behindDoc",layoutInCell:"layoutInCell",locked:"locked",relativeHeight:"relativeHeight",simplePos:"simplePos"})}}class no extends f{constructor({mediaData:e,transform:t,drawingOptions:n}){super("wp:anchor");const r=v({allowOverlap:!0,behindDocument:!1,lockAnchor:!1,layoutInCell:!0,verticalPosition:{},horizontalPosition:{}},n.floating);if(this.root.push(new to({distT:r.margins&&r.margins.top||0,distB:r.margins&&r.margins.bottom||0,distL:r.margins&&r.margins.left||0,distR:r.margins&&r.margins.right||0,simplePos:"0",allowOverlap:!0===r.allowOverlap?"1":"0",behindDoc:!0===r.behindDocument?"1":"0",locked:!0===r.lockAnchor?"1":"0",layoutInCell:!0===r.layoutInCell?"1":"0",relativeHeight:r.zIndex?r.zIndex:t.emus.y})),this.root.push(new ei),this.root.push(new ii(r.horizontalPosition)),this.root.push(new ai(r.verticalPosition)),this.root.push(new Xi(t.emus.x,t.emus.y)),this.root.push(Ji({top:0,right:0,bottom:0,left:0})),void 0!==n.floating&&void 0!==n.floating.wrap)switch(n.floating.wrap.type){case 1:this.root.push(new Gi(n.floating.wrap,n.floating.margins));break;case 2:this.root.push(new Ki(n.floating.margins));break;case 3:this.root.push(new Vi(n.floating.margins));break;default:this.root.push(new Mi)}else this.root.push(new Mi);this.root.push(new Wi(n.docProperties)),this.root.push(new eo),this.root.push(new Ri({mediaData:e,transform:t,outline:n.outline}))}}class ro extends f{constructor(e,t={}){super("w:drawing"),t.floating?this.root.push(new no({mediaData:e,transform:e.transformation,drawingOptions:t})):this.root.push((({mediaData:e,transform:t,docProperties:n,outline:r})=>{var i,o,a,s;return new or({name:"wp:inline",attributes:{distanceTop:{key:"distT",value:0},distanceBottom:{key:"distB",value:0},distanceLeft:{key:"distL",value:0},distanceRight:{key:"distR",value:0}},children:[new Xi(t.emus.x,t.emus.y),Ji(r?{top:2*(null!=(i=r.width)?i:9525),right:2*(null!=(o=r.width)?o:9525),bottom:2*(null!=(a=r.width)?a:9525),left:2*(null!=(s=r.width)?s:9525)}:{top:0,right:0,bottom:0,left:0}),new Wi(n),new eo,new Ri({mediaData:e,transform:t,outline:r})]})})({mediaData:e,transform:e.transformation,docProperties:t.docProperties,outline:t.outline}))}}class io extends Vr{constructor(e){super({}),u(this,"key",`${Xr()}.png`),u(this,"imageData");const t="string"==typeof e.data?this.convertDataURIToBinary(e.data):e.data;this.imageData={stream:t,fileName:this.key,transformation:{pixels:{x:Math.round(e.transformation.width),y:Math.round(e.transformation.height)},emus:{x:Math.round(9525*e.transformation.width),y:Math.round(9525*e.transformation.height)},flip:e.transformation.flip,rotation:e.transformation.rotation?6e4*e.transformation.rotation:void 0}};const n=new ro(this.imageData,{floating:e.floating,docProperties:e.altText,outline:e.outline});this.root.push(n)}prepForXml(e){return e.file.Media.addImage(this.key,this.imageData),super.prepForXml(e)}convertDataURIToBinary(e){if("function"==typeof atob){const t=";base64,",n=e.indexOf(t),r=-1===n?0:n+t.length;return new Uint8Array(atob(e.substring(r)).split("").map((e=>e.charCodeAt(0))))}return new(require("buffer").Buffer)(e,"base64")}}class oo extends h{constructor(){super(...arguments),u(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}}class ao extends h{constructor(){super(...arguments),u(this,"xmlKeys",{"xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps"})}}class so extends f{constructor({id:e,initials:t,author:n,date:r=new Date,children:i}){super("w:comment"),this.root.push(new oo({id:e,initials:t,author:n,date:r.toISOString()}));for(const e of i)this.root.push(e)}}class lo extends f{constructor({children:e}){super("w:comments"),this.root.push(new ao({"xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}));for(const t of e)this.root.push(new so(t))}}class Qo extends f{constructor(e){super("w:ptab"),this.root.push(new g({alignment:{key:"w:alignment",value:e.alignment},relativeTo:{key:"w:relativeTo",value:e.relativeTo},leader:{key:"w:leader",value:e.leader}}))}}class vo extends f{constructor(){super("w:pageBreakBefore")}}const co="auto";class uo extends h{constructor(){super(...arguments),u(this,"xmlKeys",{after:"w:after",before:"w:before",line:"w:line",lineRule:"w:lineRule"})}}class Ao extends f{constructor(e){super("w:spacing"),this.root.push(new uo(e))}}const po={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"};let mo=class extends f{constructor(e){super("w:pStyle"),this.root.push(new b({val:e}))}};class fo extends f{constructor(e){super("w:tabs");for(const t of e)this.root.push(new go(t))}}class ho extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val",pos:"w:pos",leader:"w:leader"})}}class go extends f{constructor({type:e,position:t,leader:n}){super("w:tab"),this.root.push(new ho({val:e,pos:t,leader:n}))}}class bo extends f{constructor(e,t){super("w:numPr"),this.root.push(new wo(t)),this.root.push(new yo(e))}}class wo extends f{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new b({val:e}))}}class yo extends f{constructor(e){super("w:numId"),this.root.push(new b({val:"string"==typeof e?`{${e}}`:e}))}}class xo extends f{constructor(){super(...arguments),u(this,"fileChild",Symbol())}}class _o extends h{constructor(){super(...arguments),u(this,"xmlKeys",{id:"Id",type:"Type",target:"Target",targetMode:"TargetMode"})}}class ko extends f{constructor(e,t,n,r){super("Relationship"),this.root.push(new _o({id:e,type:t,target:n,targetMode:r}))}}class Bo extends h{constructor(){super(...arguments),u(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}}class Co extends f{constructor(e,t,n){super("w:hyperlink"),u(this,"linkId"),this.linkId=t;const r={history:1,anchor:n||void 0,id:n?void 0:`rId${this.linkId}`},i=new Bo(r);this.root.push(i),e.forEach((e=>{this.root.push(e)}))}}class Eo extends Co{constructor(e){super(e.children,Xr(),e.anchor)}}class So extends f{constructor(e){super("w:externalHyperlink"),this.options=e}}class Oo extends h{constructor(){super(...arguments),u(this,"xmlKeys",{id:"w:id",name:"w:name"})}}class To extends h{constructor(){super(...arguments),u(this,"xmlKeys",{id:"w:id"})}}class Io{constructor(e){u(this,"bookmarkUniqueNumericId",Yr()),u(this,"start"),u(this,"children"),u(this,"end");const t=this.bookmarkUniqueNumericId();this.start=new Fo(e.id,t),this.children=e.children,this.end=new jo(t)}}class Fo extends f{constructor(e,t){super("w:bookmarkStart");const n=new Oo({name:e,id:t});this.root.push(n)}}class jo extends f{constructor(e){super("w:bookmarkEnd");const t=new To({id:e});this.root.push(t)}}class Po extends f{constructor(e){super("w:outlineLvl"),this.level=e,this.root.push(new b({val:e}))}}class Lo extends h{constructor(){super(...arguments),u(this,"xmlKeys",{verticalAlign:"w:val"})}}class No extends f{constructor(e){super("w:vAlign"),this.root.push(new Lo({verticalAlign:e}))}}const Uo="default";class Do extends h{constructor(){super(...arguments),u(this,"xmlKeys",{type:"w:type",id:"r:id"})}}class Ro extends f{constructor(e,t){super(e),this.root.push(new Do({type:t.type||Uo,id:`rId${t.id}`}))}}class Mo extends f{constructor({space:e,count:t,separate:n,equalWidth:r,children:i}){super("w:cols"),this.root.push(new g({space:{key:"w:space",value:void 0===e?void 0:Jn(e)},count:{key:"w:num",value:void 0===t?void 0:Rn(t)},separate:{key:"w:sep",value:n},equalWidth:{key:"w:equalWidth",value:r}})),!r&&i&&i.forEach((e=>this.addChildElement(e)))}}class Ho extends h{constructor(){super(...arguments),u(this,"xmlKeys",{type:"w:type",linePitch:"w:linePitch",charSpace:"w:charSpace"})}}class Go extends f{constructor(e,t,n){super("w:docGrid"),this.root.push(new Ho({type:n,linePitch:Rn(e),charSpace:t?Rn(t):void 0}))}}class zo extends h{constructor(){super(...arguments),u(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}}class Ko extends d{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new zo({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new zo({})),e.pageBorderTop&&this.root.push(new Qr("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(new Qr("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(new Qr("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(new Qr("w:right",e.pageBorderRight))}}class qo extends f{constructor(e,t,n,r,i,o,a){super("w:pgMar"),this.root.push(new g({top:{key:"w:top",value:Vn(e)},right:{key:"w:right",value:Jn(t)},bottom:{key:"w:bottom",value:Vn(n)},left:{key:"w:left",value:Jn(r)},header:{key:"w:header",value:Jn(i)},footer:{key:"w:footer",value:Jn(o)},gutter:{key:"w:gutter",value:Jn(a)}}))}}class Vo extends h{constructor(){super(...arguments),u(this,"xmlKeys",{start:"w:start",formatType:"w:fmt",separator:"w:chapSep"})}}class Wo extends f{constructor({start:e,formatType:t,separator:n}){super("w:pgNumType"),this.root.push(new Vo({start:void 0===e?void 0:Rn(e),formatType:t,separator:n}))}}class Jo extends f{constructor(e,t,n){super("w:pgSz");const r="landscape"===n,i=Jn(e),o=Jn(t);this.root.push(new g({width:{key:"w:w",value:r?o:i},height:{key:"w:h",value:r?i:o},orientation:{key:"w:orient",value:n}}))}}class Yo extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class Xo extends f{constructor(e){super("w:textDirection"),this.root.push(new Yo({val:e}))}}class $o extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class Zo extends f{constructor(e){super("w:type"),this.root.push(new $o({val:e}))}}class ea extends f{constructor({page:{size:{width:e=11906,height:t=16838,orientation:n="portrait"}={},margin:{top:r=1440,right:i=1440,bottom:o=1440,left:a=1440,header:s=708,footer:l=708,gutter:Q=0}={},pageNumbers:v={},borders:c,textDirection:u}={},grid:{linePitch:A=360,charSpace:p,type:m}={},headerWrapperGroup:f={},footerWrapperGroup:d={},lineNumbers:h,titlePage:g,verticalAlign:b,column:w,type:y}={}){super("w:sectPr"),this.addHeaderFooterGroup("w:headerReference",f),this.addHeaderFooterGroup("w:footerReference",d),y&&this.root.push(new Zo(y)),this.root.push(new Jo(e,t,n)),this.root.push(new qo(r,i,o,a,s,l,Q)),c&&this.root.push(new Ko(c)),h&&this.root.push((({countBy:e,start:t,restart:n,distance:r})=>new or({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:void 0===e?void 0:Rn(e)},start:{key:"w:start",value:void 0===t?void 0:Rn(t)},restart:{key:"w:restart",value:n},distance:{key:"w:distance",value:void 0===r?void 0:Jn(r)}}}))(h)),this.root.push(new Wo(v)),w&&this.root.push(new Mo(w)),b&&this.root.push(new No(b)),void 0!==g&&this.root.push(new $n("w:titlePg",g)),u&&this.root.push(new Xo(u)),this.root.push(new Go(A,p,m))}addHeaderFooterGroup(e,t){t.default&&this.root.push(new Ro(e,{type:Uo,id:t.default.View.ReferenceId})),t.first&&this.root.push(new Ro(e,{type:"first",id:t.first.View.ReferenceId})),t.even&&this.root.push(new Ro(e,{type:"even",id:t.even.View.ReferenceId}))}}class ta extends f{constructor(){super("w:body"),u(this,"sections",[])}addSection(e){const t=this.sections.pop();this.root.push(this.createSectionParagraph(t)),this.sections.push(new ea(e))}prepForXml(e){return 1===this.sections.length&&(this.root.splice(0,1),this.root.push(this.sections.pop())),super.prepForXml(e)}push(e){this.root.push(e)}createSectionParagraph(e){const t=new ua({}),n=new ca({});return n.push(e),t.addChildElement(n),t}}class na extends h{constructor(){super(...arguments),u(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",aink:"xmlns:aink",am3d:"xmlns:am3d",w16cex:"xmlns:w16cex",w16cid:"xmlns:w16cid",w16:"xmlns:w16",w16sdtdh:"xmlns:w16sdtdh",w16se:"xmlns:w16se"})}}class ra extends h{constructor(){super(...arguments),u(this,"xmlKeys",{color:"w:color",themeColor:"w:themeColor",themeShade:"w:themeShade",themeTint:"w:themeTint"})}}class ia extends f{constructor(e){super("w:background"),this.root.push(new ra({color:void 0===e.color?void 0:qn(e.color),themeColor:e.themeColor,themeShade:void 0===e.themeShade?void 0:Gn(e.themeShade),themeTint:void 0===e.themeTint?void 0:Gn(e.themeTint)}))}}class oa extends f{constructor(e){super("w:document"),u(this,"body"),this.root.push(new na({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex",Ignorable:"w14 w15 wp14"})),this.body=new ta,e.background&&this.root.push(new ia(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}}class aa extends h{constructor(){super(...arguments),u(this,"xmlKeys",{xmlns:"xmlns"})}}class sa extends f{constructor(){super("Relationships"),this.root.push(new aa({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}createRelationship(e,t,n,r){const i=new ko(`rId${e}`,t,n,r);return this.root.push(i),i}get RelationshipCount(){return this.root.length-1}}class la{constructor(e){u(this,"document"),u(this,"relationships"),this.document=new oa(e),this.relationships=new sa}get View(){return this.document}get Relationships(){return this.relationships}}class Qa extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class va extends f{constructor(){super("w:wordWrap"),this.root.push(new Qa({val:0}))}}class ca extends d{constructor(e){var t,n;if(super("w:pPr"),u(this,"numberingReferences",[]),!e)return this;e.heading&&this.push(new mo(e.heading)),e.bullet&&this.push(new mo("ListParagraph")),e.numbering&&(e.style||e.heading||e.numbering.custom||this.push(new mo("ListParagraph"))),e.style&&this.push(new mo(e.style)),void 0!==e.keepNext&&this.push(new $n("w:keepNext",e.keepNext)),void 0!==e.keepLines&&this.push(new $n("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new vo),e.frame&&this.push((e=>{var t,n;return new or({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:e.anchorLock},dropCap:{key:"w:dropCap",value:e.dropCap},width:{key:"w:w",value:e.width},height:{key:"w:h",value:e.height},x:{key:"w:x",value:e.position?e.position.x:void 0},y:{key:"w:y",value:e.position?e.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:e.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:e.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:null==(t=e.space)?void 0:t.horizontal},spaceVertical:{key:"w:vSpace",value:null==(n=e.space)?void 0:n.vertical},rule:{key:"w:hRule",value:e.rule},alignmentX:{key:"w:xAlign",value:e.alignment?e.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:e.alignment?e.alignment.y:void 0},lines:{key:"w:lines",value:e.lines},wrap:{key:"w:wrap",value:e.wrap}}})})(e.frame)),void 0!==e.widowControl&&this.push(new $n("w:widowControl",e.widowControl)),e.bullet&&this.push(new bo(1,e.bullet.level)),e.numbering&&(this.numberingReferences.push({reference:e.numbering.reference,instance:null!=(t=e.numbering.instance)?t:0}),this.push(new bo(`${e.numbering.reference}-${null!=(n=e.numbering.instance)?n:0}`,e.numbering.level))),e.border&&this.push(new ur(e.border)),e.thematicBreak&&this.push(new Ar),e.shading&&this.push(new Cr(e.shading)),e.wordWrap&&this.push(new va),e.overflowPunctuation&&this.push(new $n("w:overflowPunct",e.overflowPunctuation));const r=[...void 0!==e.rightTabStop?[{type:"right",position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...void 0!==e.leftTabStop?[{type:"left",position:e.leftTabStop}]:[]];r.length>0&&this.push(new fo(r)),void 0!==e.bidirectional&&this.push(new $n("w:bidi",e.bidirectional)),e.spacing&&this.push(new Ao(e.spacing)),e.indent&&this.push(new pr(e.indent)),void 0!==e.contextualSpacing&&this.push(new $n("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(new lr(e.alignment)),void 0!==e.outlineLevel&&this.push(new Po(e.outlineLevel)),void 0!==e.suppressLineNumbers&&this.push(new $n("w:suppressLineNumbers",e.suppressLineNumbers)),void 0!==e.autoSpaceEastAsianText&&this.push(new $n("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new Hr(e.run))}push(e){this.root.push(e)}prepForXml(e){if(e.viewWrapper instanceof la)for(const t of this.numberingReferences)e.file.Numbering.createConcreteNumberingInstance(t.reference,t.instance);return super.prepForXml(e)}}class ua extends xo{constructor(e){if(super("w:p"),u(this,"properties"),"string"==typeof e)return this.properties=new ca({}),this.root.push(this.properties),this.root.push(new Wr(e)),this;if(this.properties=new ca(e),this.root.push(this.properties),e.text&&this.root.push(new Wr(e.text)),e.children)for(const t of e.children)if(t instanceof Io){this.root.push(t.start);for(const e of t.children)this.root.push(e);this.root.push(t.end)}else this.root.push(t)}prepForXml(e){for(const t of this.root)if(t instanceof So){const n=this.root.indexOf(t),r=new Co(t.options.children,Xr());e.viewWrapper.Relationships.createRelationship(r.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",t.options.link,"External"),this.root[n]=r}return super.prepForXml(e)}addRunToFront(e){return this.root.splice(1,0,e),this}}class Aa extends f{constructor(e){super("w:tblGrid");for(const t of e)this.root.push(new pa(t))}}class pa extends f{constructor(e){super("w:gridCol"),void 0!==e&&this.root.push(new g({width:{key:"w:w",value:Jn(e)}}))}}class ma extends d{constructor(e,{marginUnitType:t=fa.DXA,top:n,left:r,bottom:i,right:o}){super(e),void 0!==n&&this.root.push(new da("w:top",{type:t,size:n})),void 0!==r&&this.root.push(new da("w:left",{type:t,size:r})),void 0!==i&&this.root.push(new da("w:bottom",{type:t,size:i})),void 0!==o&&this.root.push(new da("w:right",{type:t,size:o}))}}const fa={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"};class da extends f{constructor(e,{type:t=fa.AUTO,size:n}){super(e);let r=n;var i;t===fa.PERCENTAGE&&"number"==typeof n&&(r=`${n}%`),this.root.push(new g({type:{key:"w:type",value:t},size:{key:"w:w",value:(i=r,"number"==typeof i?Rn(i):"%"===i.slice(-1)?(e=>{const t=e.substring(0,e.length-1);return`${Number(t)}%`})(i):zn(i))}}))}}class ha extends d{constructor(e){super("w:tcBorders"),e.top&&this.root.push(new Qr("w:top",e.top)),e.start&&this.root.push(new Qr("w:start",e.start)),e.left&&this.root.push(new Qr("w:left",e.left)),e.bottom&&this.root.push(new Qr("w:bottom",e.bottom)),e.end&&this.root.push(new Qr("w:end",e.end)),e.right&&this.root.push(new Qr("w:right",e.right))}}class ga extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class ba extends f{constructor(e){super("w:gridSpan"),this.root.push(new ga({val:Rn(e)}))}}class wa extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class ya extends f{constructor(e){super("w:vMerge"),this.root.push(new wa({val:e}))}}class xa extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class _a extends f{constructor(e){super("w:textDirection"),this.root.push(new xa({val:e}))}}class ka extends d{constructor(e){super("w:tcPr"),e.width&&this.root.push(new da("w:tcW",e.width)),e.columnSpan&&this.root.push(new ba(e.columnSpan)),e.verticalMerge?this.root.push(new ya(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new ya("restart")),e.borders&&this.root.push(new ha(e.borders)),e.shading&&this.root.push(new Cr(e.shading)),e.margins&&this.root.push(new ma("w:tcMar",e.margins)),e.textDirection&&this.root.push(new _a(e.textDirection)),e.verticalAlign&&this.root.push(new No(e.verticalAlign))}}class Ba extends f{constructor(e){super("w:tc"),this.options=e,this.root.push(new ka(e));for(const t of e.children)this.root.push(t)}prepForXml(e){return this.root[this.root.length-1]instanceof ua||this.root.push(new ua({})),super.prepForXml(e)}}const Ca={style:"none",size:0,color:"auto"},Ea={style:cr,size:4,color:"auto"};class Sa extends f{constructor(e){super("w:tblBorders"),e.top?this.root.push(new Qr("w:top",e.top)):this.root.push(new Qr("w:top",Ea)),e.left?this.root.push(new Qr("w:left",e.left)):this.root.push(new Qr("w:left",Ea)),e.bottom?this.root.push(new Qr("w:bottom",e.bottom)):this.root.push(new Qr("w:bottom",Ea)),e.right?this.root.push(new Qr("w:right",e.right)):this.root.push(new Qr("w:right",Ea)),e.insideHorizontal?this.root.push(new Qr("w:insideH",e.insideHorizontal)):this.root.push(new Qr("w:insideH",Ea)),e.insideVertical?this.root.push(new Qr("w:insideV",e.insideVertical)):this.root.push(new Qr("w:insideV",Ea))}}u(Sa,"NONE",{top:Ca,bottom:Ca,left:Ca,right:Ca,insideHorizontal:Ca,insideVertical:Ca});class Oa extends f{constructor({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:n,relativeHorizontalPosition:r,absoluteVerticalPosition:i,relativeVerticalPosition:o,bottomFromText:a,topFromText:s,leftFromText:l,rightFromText:Q,overlap:v}){super("w:tblpPr"),this.root.push(new g({leftFromText:{key:"w:leftFromText",value:void 0===l?void 0:Jn(l)},rightFromText:{key:"w:rightFromText",value:void 0===Q?void 0:Jn(Q)},topFromText:{key:"w:topFromText",value:void 0===s?void 0:Jn(s)},bottomFromText:{key:"w:bottomFromText",value:void 0===a?void 0:Jn(a)},absoluteHorizontalPosition:{key:"w:tblpX",value:void 0===n?void 0:Vn(n)},absoluteVerticalPosition:{key:"w:tblpY",value:void 0===i?void 0:Vn(i)},horizontalAnchor:{key:"w:horzAnchor",value:void 0===e?void 0:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:r},relativeVerticalPosition:{key:"w:tblpYSpec",value:o},verticalAnchor:{key:"w:vertAnchor",value:t}})),v&&this.root.push(new rr("w:tblOverlap",v))}}class Ta extends h{constructor(){super(...arguments),u(this,"xmlKeys",{type:"w:type"})}}class Ia extends f{constructor(e){super("w:tblLayout"),this.root.push(new Ta({type:e}))}}class Fa extends d{constructor(e){super("w:tblPr"),e.style&&this.root.push(new er("w:tblStyle",e.style)),e.float&&this.root.push(new Oa(e.float)),void 0!==e.visuallyRightToLeft&&this.root.push(new $n("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push(new da("w:tblW",e.width)),e.alignment&&this.root.push(new lr(e.alignment)),e.indent&&this.root.push(new da("w:tblInd",e.indent)),e.borders&&this.root.push(new Sa(e.borders)),e.shading&&this.root.push(new Cr(e.shading)),e.layout&&this.root.push(new Ia(e.layout)),e.cellMargin&&this.root.push(new ma("w:tblCellMar",e.cellMargin))}}class ja extends xo{constructor({rows:e,width:t,columnWidths:n=Array(Math.max(...e.map((e=>e.CellCount)))).fill(100),margins:r,indent:i,float:o,layout:a,style:s,borders:l,alignment:Q,visuallyRightToLeft:v}){super("w:tbl"),this.root.push(new Fa({borders:null!=l?l:{},width:null!=t?t:{size:100},indent:i,float:o,layout:a,style:s,alignment:Q,cellMargin:r,visuallyRightToLeft:v})),this.root.push(new Aa(n));for(const t of e)this.root.push(t);e.forEach(((t,n)=>{if(n===e.length-1)return;let r=0;t.cells.forEach((t=>{if(t.options.rowSpan&&t.options.rowSpan>1){const i=new Ba({rowSpan:t.options.rowSpan-1,columnSpan:t.options.columnSpan,borders:t.options.borders,children:[],verticalMerge:"continue"});e[n+1].addCellToColumnIndex(i,r)}r+=t.options.columnSpan||1}))}))}}class Pa extends h{constructor(){super(...arguments),u(this,"xmlKeys",{value:"w:val",rule:"w:hRule"})}}class La extends f{constructor(e,t){super("w:trHeight"),this.root.push(new Pa({value:Jn(e),rule:t}))}}class Na extends d{constructor(e){super("w:trPr"),void 0!==e.cantSplit&&this.root.push(new $n("w:cantSplit",e.cantSplit)),void 0!==e.tableHeader&&this.root.push(new $n("w:tblHeader",e.tableHeader)),e.height&&this.root.push(new La(e.height.value,e.height.rule))}}class Ua extends f{constructor(e){super("w:tr"),this.options=e,this.root.push(new Na(e));for(const t of e.children)this.root.push(t)}get CellCount(){return this.options.children.length}get cells(){return this.root.filter((e=>e instanceof Ba))}addCellToIndex(e,t){this.root.splice(t+1,0,e)}addCellToColumnIndex(e,t){const n=this.columnIndexToRootIndex(t,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error("cell 'rootIndex' should between 1 to "+(this.root.length-1));let t=0;for(let n=1;n =this.root.length){if(t)return this.root.length;throw new Error("cell 'columnIndex' should not great than "+(n-1))}const e=this.root[r];r+=1,n+=e&&e.options.columnSpan||1}return r-1}}class Da extends h{constructor(){super(...arguments),u(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class Ra extends f{constructor(){super("Properties"),this.root.push(new Da({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}}class Ma extends h{constructor(){super(...arguments),u(this,"xmlKeys",{xmlns:"xmlns"})}}class Ha extends h{constructor(){super(...arguments),u(this,"xmlKeys",{contentType:"ContentType",extension:"Extension"})}}class Ga extends f{constructor(e,t){super("Default"),this.root.push(new Ha({contentType:e,extension:t}))}}class za extends h{constructor(){super(...arguments),u(this,"xmlKeys",{contentType:"ContentType",partName:"PartName"})}}class Ka extends f{constructor(e,t){super("Override"),this.root.push(new za({contentType:e,partName:t}))}}class qa extends f{constructor(){super("Types"),this.root.push(new Ma({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(new Ga("image/png","png")),this.root.push(new Ga("image/jpeg","jpeg")),this.root.push(new Ga("image/jpeg","jpg")),this.root.push(new Ga("image/bmp","bmp")),this.root.push(new Ga("image/gif","gif")),this.root.push(new Ga("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(new Ga("application/xml","xml")),this.root.push(new Ga("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(new Ka("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml")),this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml"))}addFooter(e){this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addHeader(e){this.root.push(new Ka("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}}class Va extends f{constructor(e){super("cp:coreProperties"),this.root.push(new na({cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"})),e.title&&this.root.push(new ir("dc:title",e.title)),e.subject&&this.root.push(new ir("dc:subject",e.subject)),e.creator&&this.root.push(new ir("dc:creator",e.creator)),e.keywords&&this.root.push(new ir("cp:keywords",e.keywords)),e.description&&this.root.push(new ir("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new ir("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new ir("cp:revision",String(e.revision))),this.root.push(new Wa("dcterms:created")),this.root.push(new Wa("dcterms:modified"))}}class Wa extends f{constructor(e){super(e),this.root.push(new na({type:"dcterms:W3CDTF"})),this.root.push((new Date).toISOString())}}class Ja extends h{constructor(){super(...arguments),u(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class Ya extends h{constructor(){super(...arguments),u(this,"xmlKeys",{fmtid:"fmtid",pid:"pid",name:"name"})}}class Xa extends f{constructor(e,t){super("property"),this.root.push(new Ya({fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:t.name})),this.root.push(new $a(t.value))}}class $a extends f{constructor(e){super("vt:lpwstr"),this.root.push(e)}}class Za extends f{constructor(e){super("Properties"),u(this,"nextId"),u(this,"properties",[]),this.root.push(new Ja({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(const t of e)this.addCustomProperty(t)}prepForXml(e){return this.properties.forEach((e=>this.root.push(e))),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new Xa(this.nextId++,e))}}class es extends h{constructor(){super(...arguments),u(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}}let ts=class extends Dn{constructor(e,t){super("w:ftr",t),u(this,"refId"),this.refId=e,t||this.root.push(new es({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}};class ns{constructor(e,t,n){u(this,"footer"),u(this,"relationships"),this.media=e,this.footer=new ts(t,n),this.relationships=new sa}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}}class rs extends h{constructor(){super(...arguments),u(this,"xmlKeys",{type:"w:type",id:"w:id"})}}class is extends f{constructor(){super("w:footnoteRef")}}class os extends Vr{constructor(){super({style:"FootnoteReference"}),this.root.push(new is)}}class as extends f{constructor(e){super("w:footnote"),this.root.push(new rs({type:e.type,id:e.id}));for(let t=0;t 9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new gs({ilvl:Rn(e),tentative:1}))}}class Bs extends ks{}class Cs extends f{constructor(e){super("w:multiLevelType"),this.root.push(new b({val:e}))}}class Es extends h{constructor(){super(...arguments),u(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}}class Ss extends f{constructor(e,t){super("w:abstractNum"),u(this,"id"),this.root.push(new Es({abstractNumId:Rn(e),restartNumberingAfterBreak:0})),this.root.push(new Cs("hybridMultilevel")),this.id=e;for(const e of t)this.root.push(new Bs(e))}}class Os extends f{constructor(e){super("w:abstractNumId"),this.root.push(new b({val:e}))}}class Ts extends h{constructor(){super(...arguments),u(this,"xmlKeys",{numId:"w:numId"})}}class Is extends f{constructor(e){if(super("w:num"),u(this,"numId"),u(this,"reference"),u(this,"instance"),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.root.push(new Ts({numId:Rn(e.numId)})),this.root.push(new Os(Rn(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(const t of e.overrideLevels)this.root.push(new js(t.num,t.start))}}class Fs extends h{constructor(){super(...arguments),u(this,"xmlKeys",{ilvl:"w:ilvl"})}}class js extends f{constructor(e,t){super("w:lvlOverride"),this.root.push(new Fs({ilvl:e})),void 0!==t&&this.root.push(new Ls(t))}}class Ps extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class Ls extends f{constructor(e){super("w:startOverride"),this.root.push(new Ps({val:e}))}}class Ns extends f{constructor(e){super("w:numbering"),u(this,"abstractNumberingMap",new Map),u(this,"concreteNumberingMap",new Map),u(this,"referenceConfigMap",new Map),u(this,"abstractNumUniqueNumericId",Yr()),u(this,"concreteNumUniqueNumericId",Yr(1)),this.root.push(new na({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));const t=new Ss(this.abstractNumUniqueNumericId(),[{level:0,format:hs,text:"●",alignment:ar,style:{paragraph:{indent:{left:Jr(.5),hanging:Jr(.25)}}}},{level:1,format:hs,text:"○",alignment:ar,style:{paragraph:{indent:{left:Jr(1),hanging:Jr(.25)}}}},{level:2,format:hs,text:"■",alignment:ar,style:{paragraph:{indent:{left:2160,hanging:Jr(.25)}}}},{level:3,format:hs,text:"●",alignment:ar,style:{paragraph:{indent:{left:2880,hanging:Jr(.25)}}}},{level:4,format:hs,text:"○",alignment:ar,style:{paragraph:{indent:{left:3600,hanging:Jr(.25)}}}},{level:5,format:hs,text:"■",alignment:ar,style:{paragraph:{indent:{left:4320,hanging:Jr(.25)}}}},{level:6,format:hs,text:"●",alignment:ar,style:{paragraph:{indent:{left:5040,hanging:Jr(.25)}}}},{level:7,format:hs,text:"●",alignment:ar,style:{paragraph:{indent:{left:5760,hanging:Jr(.25)}}}},{level:8,format:hs,text:"●",alignment:ar,style:{paragraph:{indent:{left:6480,hanging:Jr(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new Is({numId:1,abstractNumId:t.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",t);for(const t of e.config)this.abstractNumberingMap.set(t.reference,new Ss(this.abstractNumUniqueNumericId(),t.levels)),this.referenceConfigMap.set(t.reference,t.levels)}prepForXml(e){for(const e of this.abstractNumberingMap.values())this.root.push(e);for(const e of this.concreteNumberingMap.values())this.root.push(e);return super.prepForXml(e)}createConcreteNumberingInstance(e,t){const n=this.abstractNumberingMap.get(e);if(!n)return;const r=`${e}-${t}`;if(this.concreteNumberingMap.has(r))return;const i=this.referenceConfigMap.get(e),o=i&&i[0].start,a={numId:this.concreteNumUniqueNumericId(),abstractNumId:n.id,reference:e,instance:t,overrideLevels:[o&&Number.isInteger(o)?{num:0,start:o}:{num:0,start:1}]};this.concreteNumberingMap.set(r,new Is(a))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}}class Us extends h{constructor(){super(...arguments),u(this,"xmlKeys",{version:"w:val",name:"w:name",uri:"w:uri"})}}class Ds extends f{constructor(e){super("w:compatSetting"),this.root.push(new Us({version:e,uri:"http://schemas.microsoft.com/office/word",name:"compatibilityMode"}))}}class Rs extends f{constructor(e){super("w:compat"),e.version&&this.root.push(new Ds(e.version)),e.useSingleBorderforContiguousCells&&this.root.push(new $n("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new $n("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new $n("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new $n("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new $n("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new $n("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new $n("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new $n("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new $n("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new $n("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new $n("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new $n("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new $n("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new $n("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new $n("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new $n("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new $n("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new $n("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new $n("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new $n("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new $n("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new $n("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new $n("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new $n("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new $n("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new $n("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new $n("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new $n("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new $n("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new $n("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new $n("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new $n("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new $n("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new $n("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new $n("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new $n("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new $n("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new $n("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new $n("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new $n("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new $n("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new $n("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new $n("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new $n("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new $n("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new $n("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new $n("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new $n("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new $n("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new $n("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new $n("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new $n("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new $n("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new $n("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new $n("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new $n("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new $n("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new $n("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new $n("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new $n("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new $n("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new $n("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new $n("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new $n("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new $n("w:cachedColBalance",e.cachedColumnBalance))}}class Ms extends h{constructor(){super(...arguments),u(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class Hs extends f{constructor(e){var t,n,r,i;super("w:settings"),this.root.push(new Ms({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new $n("w:displayBackgroundShape",!0)),void 0!==e.trackRevisions&&this.root.push(new $n("w:trackRevisions",e.trackRevisions)),void 0!==e.evenAndOddHeaders&&this.root.push(new $n("w:evenAndOddHeaders",e.evenAndOddHeaders)),void 0!==e.updateFields&&this.root.push(new $n("w:updateFields",e.updateFields)),void 0!==e.defaultTabStop&&this.root.push(new nr("w:defaultTabStop",e.defaultTabStop)),this.root.push(new Rs(c(v({},null!=(t=e.compatibility)?t:{}),{version:null!=(i=null!=(r=null==(n=e.compatibility)?void 0:n.version)?r:e.compatibilityModeVersion)?i:15})))}}class Gs extends h{constructor(){super(...arguments),u(this,"xmlKeys",{val:"w:val"})}}class zs extends f{constructor(e){super("w:name"),this.root.push(new Gs({val:e}))}}class Ks extends f{constructor(e){super("w:uiPriority"),this.root.push(new Gs({val:Rn(e)}))}}class qs extends h{constructor(){super(...arguments),u(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}}class Vs extends f{constructor(e,t){super("w:style"),this.root.push(new qs(e)),t.name&&this.root.push(new zs(t.name)),t.basedOn&&this.root.push(new er("w:basedOn",t.basedOn)),t.next&&this.root.push(new er("w:next",t.next)),t.link&&this.root.push(new er("w:link",t.link)),void 0!==t.uiPriority&&this.root.push(new Ks(t.uiPriority)),void 0!==t.semiHidden&&this.root.push(new $n("w:semiHidden",t.semiHidden)),void 0!==t.unhideWhenUsed&&this.root.push(new $n("w:unhideWhenUsed",t.unhideWhenUsed)),void 0!==t.quickFormat&&this.root.push(new $n("w:qFormat",t.quickFormat))}}class Ws extends Vs{constructor(e){super({type:"paragraph",styleId:e.id},e),u(this,"paragraphProperties"),u(this,"runProperties"),this.paragraphProperties=new ca(e.paragraph),this.runProperties=new Hr(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}}class Js extends Vs{constructor(e){super({type:"character",styleId:e.id},v({uiPriority:99,unhideWhenUsed:!0},e)),u(this,"runProperties"),this.runProperties=new Hr(e.run),this.root.push(this.runProperties)}}class Ys extends Ws{constructor(e){super(v({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}}class Xs extends Ys{constructor(e){super(v({id:"Title",name:"Title"},e))}}class $s extends Ys{constructor(e){super(v({id:"Heading1",name:"Heading 1"},e))}}class Zs extends Ys{constructor(e){super(v({id:"Heading2",name:"Heading 2"},e))}}class el extends Ys{constructor(e){super(v({id:"Heading3",name:"Heading 3"},e))}}class tl extends Ys{constructor(e){super(v({id:"Heading4",name:"Heading 4"},e))}}class nl extends Ys{constructor(e){super(v({id:"Heading5",name:"Heading 5"},e))}}class rl extends Ys{constructor(e){super(v({id:"Heading6",name:"Heading 6"},e))}}class il extends Ys{constructor(e){super(v({id:"Strong",name:"Strong"},e))}}class ol extends Ws{constructor(e){super(v({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}}class al extends Ws{constructor(e){super(v({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:co}},run:{size:20}},e))}}class sl extends Js{constructor(e){super(v({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}}class ll extends Js{constructor(e){super(v({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}}class Ql extends Js{constructor(e){super(v({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:Rr}}},e))}}class vl extends f{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(const t of e.importedStyles)this.root.push(t);if(e.paragraphStyles)for(const t of e.paragraphStyles)this.root.push(new Ws(t));if(e.characterStyles)for(const t of e.characterStyles)this.root.push(new Js(t))}}class cl extends f{constructor(e){super("w:pPrDefault"),this.root.push(new ca(e))}}class ul extends f{constructor(e){super("w:rPrDefault"),this.root.push(new Hr(e))}}class Al extends f{constructor(e){super("w:docDefaults"),u(this,"runPropertiesDefaults"),u(this,"paragraphPropertiesDefaults"),this.runPropertiesDefaults=new ul(e.run),this.paragraphPropertiesDefaults=new cl(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}}class pl{newInstance(e){const t=jn(e,{compact:!1});let n;for(const e of t.elements||[])"w:styles"===e.name&&(n=e);if(void 0===n)throw new Error("can not find styles element");const r=n.elements||[];return new vl({initialStyles:new Un(n.attributes),importedStyles:r.map((e=>Pn(e)))})}}class ml{newInstance(e={}){var t;return{initialStyles:new na({mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",Ignorable:"w14 w15"}),importedStyles:[new Al(null!=(t=e.document)?t:{}),new Xs(v({run:{size:56}},e.title)),new $s(v({run:{color:"2E74B5",size:32}},e.heading1)),new Zs(v({run:{color:"2E74B5",size:26}},e.heading2)),new el(v({run:{color:"1F4D78",size:24}},e.heading3)),new tl(v({run:{color:"2E74B5",italics:!0}},e.heading4)),new nl(v({run:{color:"2E74B5"}},e.heading5)),new rl(v({run:{color:"1F4D78"}},e.heading6)),new il(v({run:{bold:!0}},e.strong)),new ol(e.listParagraph||{}),new Ql(e.hyperlink||{}),new sl(e.footnoteReference||{}),new al(e.footnoteText||{}),new ll(e.footnoteTextChar||{})]}}}const fl=({id:e,fontKey:t,subsetted:n},r)=>new or({name:r,attributes:v({id:{key:"r:id",value:e}},t?{fontKey:{key:"w:fontKey",value:`{${t}}`}}:{}),children:[...n?[new $n("w:subsetted",n)]:[]]});class dl{constructor(e){var t;u(this,"fontTable"),u(this,"relationships"),u(this,"fontOptionsWithKey",[]),this.options=e,this.fontOptionsWithKey=e.map((e=>c(v({},e),{fontKey:`${$r(8)}-${$r(4)}-${$r(4)}-${$r(4)}-${$r(12)}`}))),this.fontTable=(t=this.fontOptionsWithKey,new or({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:t.map(((e,t)=>(({name:e,index:t,fontKey:n,characterSet:r})=>(({name:e,altName:t,panose1:n,charset:r,family:i,notTrueType:o,pitch:a,sig:s,embedRegular:l,embedBold:Q,embedItalic:v,embedBoldItalic:c})=>new or({name:"w:font",attributes:{name:{key:"w:name",value:e}},children:[...t?[tr("w:altName",t)]:[],...n?[tr("w:panose1",n)]:[],...r?[tr("w:charset",r)]:[],...i?[tr("w:family",i)]:[],...o?[new $n("w:notTrueType",o)]:[],...a?[tr("w:pitch",a)]:[],...s?[new or({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:s.usb0},usb1:{key:"w:usb1",value:s.usb1},usb2:{key:"w:usb2",value:s.usb2},usb3:{key:"w:usb3",value:s.usb3},csb0:{key:"w:csb0",value:s.csb0},csb1:{key:"w:csb1",value:s.csb1}}})]:[],...l?[fl(l,"w:embedRegular")]:[],...Q?[fl(Q,"w:embedBold")]:[],...v?[fl(v,"w:embedItalic")]:[],...c?[fl(c,"w:embedBoldItalic")]:[]]}))({name:e,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:r,family:"auto",pitch:"variable",embedRegular:{fontKey:n,id:`rId${t}`}}))({name:e.name,index:t+1,fontKey:e.fontKey})))})),this.relationships=new sa;for(let t=0;t e.header))}get Footers(){return this.footers.map((e=>e.footer))}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get FontTable(){return this.fontWrapper}}class gl{constructor(e={children:[]}){u(this,"options"),this.options=e}}class bl{constructor(e={children:[]}){u(this,"options"),this.options=e}}function wl(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var yl={exports:{}};yl.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(!s&&wl)return wl(a);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var Q=n[a]={exports:{}};t[a][0].call(Q.exports,(function(e){return i(t[a][1][e]||e)}),Q,Q.exports,e,t,n,r)}return n[a].exports}for(var o=wl,a=0;a >2,s=(3&t)<<4|n>>4,l=1>6:64,Q=2>4,n=(15&a)<<4|(s=o.indexOf(e.charAt(Q++)))>>2,r=(3&s)<<6|(l=o.indexOf(e.charAt(Q++))),u[v++]=t,64!==s&&(u[v++]=n),64!==l&&(u[v++]=r);return u}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e("./utils"),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,n,r){var o=i,a=0+n;e^=-1;for(var s=0;s>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,n,r){var o=i,a=0+n;e^=-1;for(var s=0;s>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r;r="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=r?"uint8array":"array";function l(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",o.inherits(l,a),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},l.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r="";for(n=0;n >>=8;return r}function i(e,t,n,i,a,v){var c,u,A=e.file,p=e.compression,m=v!==s.utf8encode,f=o.transformTo("string",v(A.name)),d=o.transformTo("string",s.utf8encode(A.name)),h=A.comment,g=o.transformTo("string",v(h)),b=o.transformTo("string",s.utf8encode(h)),w=d.length!==A.name.length,y=b.length!==h.length,x="",_="",k="",B=A.dir,C=A.date,E={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(E.crc32=e.crc32,E.compressedSize=e.compressedSize,E.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),m||!w&&!y||(S|=2048);var O,T,I=0,F=0;B&&(I|=16),"UNIX"===a?(F=798,I|=(T=O=A.unixPermissions,O||(T=B?16893:33204),(65535&T)<<16)):(F=20,I|=function(e){return 63&(e||0)}(A.dosPermissions)),c=C.getUTCHours(),c<<=6,c|=C.getUTCMinutes(),c<<=5,c|=C.getUTCSeconds()/2,u=C.getUTCFullYear()-1980,u<<=4,u|=C.getUTCMonth()+1,u<<=5,u|=C.getUTCDate(),w&&(_=r(1,1)+r(l(f),4)+d,x+="up"+r(_.length,2)+_),y&&(k=r(1,1)+r(l(g),4)+b,x+="uc"+r(k.length,2)+k);var j="";return j+="\n\0",j+=r(S,2),j+=p.magic,j+=r(c,2),j+=r(u,2),j+=r(E.crc32,4),j+=r(E.compressedSize,4),j+=r(E.uncompressedSize,4),j+=r(f.length,2),j+=r(x.length,2),{fileRecord:Q.LOCAL_FILE_HEADER+j+f+x,dirRecord:Q.CENTRAL_FILE_HEADER+r(F,2)+j+r(g.length,2)+"\0\0\0\0"+r(I,4)+r(i,4)+f+x+g}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),l=e("../crc32"),Q=e("../signature");function v(e,t,n,r){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(v,a),v.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},v.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},v.prototype.closedSource=function(e){this.accumulate=!1;var t,n=this.streamFiles&&!e.file.dir,o=i(e,n,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(o.dirRecord),n)this.push({data:(t=e,Q.DATA_DESCRIPTOR+r(t.crc32,4)+r(t.compressedSize,4)+r(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:o.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},v.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t =this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e("./Uint8ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e("./DataReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e("./ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new l(r.transformTo("uint8array",e)):new o(r.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){var r=e("./GenericWorker"),i=e("../utils");function o(e){r.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,r),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e("./GenericWorker"),i=e("../crc32");function o(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,r),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}r.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n "+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),s=e("../support"),l=e("../external"),Q=null;if(s.nodestream)try{Q=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function v(e,t,n){var a=t;switch(t){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=t,this._mimeType=n,r.checkSupport(a),this._worker=e.pipe(new i(a)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}v.prototype={accumulate:function(e){return function(e,t){return new l.Promise((function(n,i){var o=[],s=e._internalType,l=e._outputType,Q=e._mimeType;e.on("data",(function(e,n){o.push(e),t&&t(n)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return a.encode(t);default:return r.transformTo(e,t)}}(l,function(e,t){var n,r=0,i=null,o=0;for(n=0;n >>6:(n<65536?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63),t[a++]=128|n>>>6&63),t[a++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,o,a=e.length,l=new Array(2*a);for(t=n=0;t>10&1023,l[n++]=56320|1023&i)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),r.applyFromCharCode(l)}(e=r.transformTo(i.uint8array?"uint8array":"array",e))},r.inherits(Q,a),Q.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}(t),l=t;a!==t.length&&(i.uint8array?(l=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(l=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:n.utf8decode(l),meta:e.meta})},Q.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=Q,r.inherits(v,a),v.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=v},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),a=e("./external");function s(e){return e}function l(e,t){for(var n=0;n >8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(n<65536?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63),t[a++]=128|n>>>6&63),t[a++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,Q[r++]=56320|1023&i)}return l(Q,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3 >>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var o=r,a=i+n;e^=-1;for(var s=i;s>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),l=e("./messages"),Q=-2,v=258,c=262,u=113;function A(e,t){return e.msg=l[t],t}function p(e){return(e<<1)-(4 e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function d(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,f(e.strm)}function h(e,t){e.pending_buf[e.pending++]=t}function g(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function b(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-c?e.strstart-(e.w_size-c):0,Q=e.window,u=e.w_mask,A=e.prev,p=e.strstart+v,m=Q[o+a-1],f=Q[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(Q[(n=t)+a]===f&&Q[n+a-1]===m&&Q[n]===Q[o]&&Q[++n]===Q[o+1]){o+=2,n++;do{}while(Q[++o]===Q[++n]&&Q[++o]===Q[++n]&&Q[++o]===Q[++n]&&Q[++o]===Q[++n]&&Q[++o]===Q[++n]&&Q[++o]===Q[++n]&&Q[++o]===Q[++n]&&Q[++o]===Q[++n]&&o l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function w(e){var t,n,r,o,l,Q,v,u,A,p,m=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-c)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);o+=m}if(0===e.strm.avail_in)break;if(Q=e.strm,v=e.window,u=e.strstart+e.lookahead,p=void 0,(A=o)<(p=Q.avail_in)&&(p=A),n=0===p?0:(Q.avail_in-=p,i.arraySet(v,Q.input,Q.next_in,p,u),1===Q.state.wrap?Q.adler=a(Q.adler,v,p,u):2===Q.state.wrap&&(Q.adler=s(Q.adler,v,p,u)),Q.next_in+=p,Q.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<
=3&&(e.ins_h=(e.ins_h< =3)if(r=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h< =3&&(e.ins_h=(e.ins_h< =3&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,r=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h< e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,d(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-c&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(d(e,!1),e.strm.avail_out),1)})),new _(4,4,8,4,y),new _(4,5,16,8,y),new _(4,6,32,32,y),new _(4,4,16,16,x),new _(8,16,32,32,x),new _(8,16,128,128,x),new _(8,32,128,256,x),new _(32,128,258,1024,x),new _(32,258,258,4096,x)],n.deflateInit=function(e,t){return E(e,t,8,15,8,0)},n.deflateInit2=E,n.deflateReset=C,n.deflateResetKeep=B,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?Q:(e.state.gzhead=t,0):Q},n.deflate=function(e,t){var n,i,a,l;if(!e||!e.state||5 >8&255),h(i,i.gzhead.time>>16&255),h(i,i.gzhead.time>>24&255),h(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),h(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(h(i,255&i.gzhead.extra.length),h(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(h(i,0),h(i,0),h(i,0),h(i,0),h(i,0),h(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),h(i,3),i.status=u);else{var c=8+(i.w_bits-8<<4)<<8;c|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(c|=32),c+=31-c%31,i.status=u,g(i,c),0!==i.strstart&&(g(i,e.adler>>>16),g(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),f(e),a=i.pending,i.pending!==i.pending_buf_size));)h(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),f(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),f(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&f(e),i.pending+2<=i.pending_buf_size&&(h(i,255&e.adler),h(i,e.adler>>8&255),e.adler=0,i.status=u)):i.status=u),0!==i.pending){if(f(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(n)&&4!==t)return A(e,-5);if(666===i.status&&0!==e.avail_in)return A(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var b=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var n,r,i,a,s=e.window;;){if(e.lookahead<=v){if(w(e),e.lookahead<=v&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0 e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(i,t):r[i.level].func(i,t);if(3!==b&&4!==b||(i.status=666),1===b||3===b)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===b&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),f(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(h(i,255&e.adler),h(i,e.adler>>8&255),h(i,e.adler>>16&255),h(i,e.adler>>24&255),h(i,255&e.total_in),h(i,e.total_in>>8&255),h(i,e.total_in>>16&255),h(i,e.total_in>>24&255)):(g(i,e.adler>>>16),g(i,65535&e.adler)),f(e),0 =n.w_size&&(0===s&&(m(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new i.Buf8(n.w_size),i.arraySet(u,t,A-n.w_size,n.w_size,0),t=u,A=n.w_size),l=e.avail_in,v=e.next_in,c=e.input,e.avail_in=A,e.next_in=0,e.input=t,w(n);n.lookahead>=3;){for(r=n.strstart,o=n.lookahead-2;n.ins_h=(n.ins_h< >>=b=g>>>24,p-=b,0==(b=g>>>16&255))B[o++]=65535&g;else{if(!(16&b)){if(0==(64&b)){g=m[(65535&g)+(A&(1<>>=b,p-=b),p<15&&(A+=k[r++]< >>=b=g>>>24,p-=b,!(16&(b=g>>>16&255))){if(0==(64&b)){g=f[(65535&g)+(A&(1<>>=b,p-=b,(b=o-a)
>3,A&=(1<<(p-=w<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):l}function u(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,c(e)):l}function A(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15 =a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave >>8&255,n.check=o(n.check,L,2,0),d=f=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&f)<<8)+(f>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&f)){e.msg="unknown compression method",n.mode=30;break}if(d-=4,T=8+(15&(f>>>=4)),0===n.wbits)n.wbits=T;else if(T>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1< >8&1),512&n.flags&&(L[0]=255&f,L[1]=f>>>8&255,n.check=o(n.check,L,2,0)),d=f=0,n.mode=3;case 3:for(;d<32;){if(0===p)break e;p--,f+=v[u++]< >>8&255,L[2]=f>>>16&255,L[3]=f>>>24&255,n.check=o(n.check,L,4,0)),d=f=0,n.mode=4;case 4:for(;d<16;){if(0===p)break e;p--,f+=v[u++]< >8),512&n.flags&&(L[0]=255&f,L[1]=f>>>8&255,n.check=o(n.check,L,2,0)),d=f=0,n.mode=5;case 5:if(1024&n.flags){for(;d<16;){if(0===p)break e;p--,f+=v[u++]< >>8&255,n.check=o(n.check,L,2,0)),d=f=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(p<(y=n.length)&&(y=p),y&&(n.head&&(T=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,v,u,y,T)),512&n.flags&&(n.check=o(n.check,v,y,u)),p-=y,u+=y,n.length-=y),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break e;for(y=0;T=v[u+y++],n.head&&T&&n.length<65536&&(n.head.name+=String.fromCharCode(T)),T&&y >9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;d<32;){if(0===p)break e;p--,f+=v[u++]<
>>=7&d,d-=7&d,n.mode=27;break}for(;d<3;){if(0===p)break e;p--,f+=v[u++]< >>=1)){case 0:n.mode=14;break;case 1:if(h(n),n.mode=20,6!==t)break;f>>>=2,d-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}f>>>=2,d-=2;break;case 14:for(f>>>=7&d,d-=7&d;d<32;){if(0===p)break e;p--,f+=v[u++]< >>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&f,d=f=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(y=n.length){if(p >>=5,d-=5,n.ndist=1+(31&f),f>>>=5,d-=5,n.ncode=4+(15&f),f>>>=4,d-=4,286 >>=3,d-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,F={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,F),n.lenbits=F.bits,I){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have >>16&255,C=65535&P,!((k=P>>>24)<=d);){if(0===p)break e;p--,f+=v[u++]< >>=k,d-=k,n.lens[n.have++]=C;else{if(16===C){for(j=k+2;d >>=k,d-=k,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}T=n.lens[n.have-1],y=3+(3&f),f>>>=2,d-=2}else if(17===C){for(j=k+3;d >>=k)),f>>>=3,d-=3}else{for(j=k+7;d >>=k)),f>>>=7,d-=7}if(n.have+y>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;y--;)n.lens[n.have++]=T}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,F={bits:n.lenbits},I=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,F),n.lenbits=F.bits,I){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,F={bits:n.distbits},I=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,F),n.distbits=F.bits,I){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=p&&258<=m){e.next_out=A,e.avail_out=m,e.next_in=u,e.avail_in=p,n.hold=f,n.bits=d,a(e,w),A=e.next_out,c=e.output,m=e.avail_out,u=e.next_in,v=e.input,p=e.avail_in,f=n.hold,d=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;B=(P=n.lencode[f&(1< >>16&255,C=65535&P,!((k=P>>>24)<=d);){if(0===p)break e;p--,f+=v[u++]< >E)])>>>16&255,C=65535&P,!(E+(k=P>>>24)<=d);){if(0===p)break e;p--,f+=v[u++]< >>=E,d-=E,n.back+=E}if(f>>>=k,d-=k,n.back+=k,n.length=C,0===B){n.mode=26;break}if(32&B){n.back=-1,n.mode=12;break}if(64&B){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&B,n.mode=22;case 22:if(n.extra){for(j=n.extra;d >>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;B=(P=n.distcode[f&(1< >>16&255,C=65535&P,!((k=P>>>24)<=d);){if(0===p)break e;p--,f+=v[u++]< >E)])>>>16&255,C=65535&P,!(E+(k=P>>>24)<=d);){if(0===p)break e;p--,f+=v[u++]< >>=E,d-=E,n.back+=E}if(f>>>=k,d-=k,n.back+=k,64&B){e.msg="invalid distance code",n.mode=30;break}n.offset=C,n.extra=15&B,n.mode=24;case 24:if(n.extra){for(j=n.extra;d >>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===m)break e;if(y=w-m,n.offset>y){if((y=n.offset-y)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}x=y>n.wnext?(y-=n.wnext,n.wsize-y):n.wnext-y,y>n.length&&(y=n.length),_=n.window}else _=c,x=A-n.offset,y=n.length;for(m h?(b=N[U+c[_]],F[j+c[_]]):(b=96,0),A=1< >S)+(p-=A)]=g<<24|b<<16|w|0,0!==p;);for(A=1< >=1;if(0!==A?(I&=A-1,I+=A):I=0,_++,0==--P[x]){if(x===B)break;x=t[n+c[_]]}if(C >>7)]}function k(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function B(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t< >16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t< >>=1,n<<=1,0<--t;);return n>>>1}function S(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=l;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=E(o[s]++,s))}}function O(e){var t;for(t=0;t>1;1<=n;n--)F(e,o,n);for(i=Q;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],F(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,F(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,Q=t.dyn_tree,v=t.max_code,c=t.stat_desc.static_tree,u=t.stat_desc.has_stree,A=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,m=t.stat_desc.max_length,f=0;for(o=0;o<=l;o++)e.bl_count[o]=0;for(Q[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)m<(o=Q[2*Q[2*(r=e.heap[n])+1]+1]+1)&&(o=m,f++),Q[2*r+1]=o,v >=7;r >>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==t?D(e,t,n,r):4===e.strategy||a===i?(B(e,2+(r?1:0),3),j(e,A,p)):(B(e,4+(r?1:0),3),function(e,t,n,r){var i;for(B(e,t-257,5),B(e,n-1,5),B(e,r-4,4),i=0;i >>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(f[n]+o+1)]++,e.dyn_dtree[2*_(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){var t;B(e,2,3),C(e,256,A),16===(t=e).bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){!function(e,t){if(!e.setImmediate){var n,r,i,o,a=1,s={},l=!1,Q=e.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(e);v=v&&v.setTimeout?v:e,n="[object process]"==={}.toString.call(e.process)?function(e){oe.nextTick((function(){u(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",A,!1):e.attachEvent("onmessage",A),function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){u(e.data)},function(e){i.port2.postMessage(e)}):Q&&"onreadystatechange"in Q.createElement("script")?(r=Q.documentElement,function(e){var t=Q.createElement("script");t.onreadystatechange=function(){u(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(u,0,e)},v.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r ":">"},Bl=function(e){return e&&e.replace?e.replace(/([&"<>'])/g,(function(e,t){return kl[t]})):e},Cl=cn.Stream;function El(e,t,n){n=n||0;var r,i,o=(r=t,new Array(n||0).join(r||"")),a=e;if("object"==typeof e&&(a=e[i=Object.keys(e)[0]])&&a._elem)return a._elem.name=i,a._elem.icount=n,a._elem.indent=t,a._elem.indents=o,a._elem.interrupt=a,a._elem;var s,l=[],Q=[];function v(e){Object.keys(e).forEach((function(t){l.push(function(e,t){return e+'="'+Bl(t)+'"'}(t,e[t]))}))}switch(typeof a){case"object":if(null===a)break;a._attr&&v(a._attr),a._cdata&&Q.push(("/g,"]]]]>")+"]]>"),a.forEach&&(s=!1,Q.push(""),a.forEach((function(e){"object"==typeof e?"_attr"==Object.keys(e)[0]?v(e._attr):Q.push(El(e,t,n+1)):(Q.pop(),s=!0,Q.push(Bl(e)))})),s||Q.push(""));break;default:Q.push(Bl(a))}return{name:i,interrupt:!1,attributes:l,content:Q,icount:n,indents:o,indent:t}}function Sl(e,t,n){if("object"!=typeof t)return e(!1,t);var r=t.interrupt?1:t.content.length;function i(){for(;t.content.length;){var i=t.content.shift();if(void 0!==i){if(o(i))return;Sl(e,i)}}e(!1,(r>1?t.indents:"")+(t.name?""+t.name+">":"")+(t.indent&&!n?"\n":"")),n&&n()}function o(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=i,t.interrupt=!1,e(!0),!0)}if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(r?t.name?">":"":t.name?"/>":"")+(t.indent&&r>1?"\n":"")),!r)return e(!1,t.indent?"\n":"");o(t)||i()}_l.exports=function(e,t){"object"!=typeof t&&(t={indent:t});var n,r,i=t.stream?new Cl:null,o="",a=!1,s=t.indent?!0===t.indent?" ":t.indent:"",l=!0;function Q(e){l?oe.nextTick(e):e()}function v(e,t){if(void 0!==t&&(o+=t),e&&!a&&(i=i||new Cl,a=!0),e&&a){var n=o;Q((function(){i.emit("data",n)})),o=""}}function c(e,t){Sl(v,El(e,s,s?1:0),t)}function u(){if(i){var e=o;Q((function(){i.emit("data",e),i.emit("end"),i.readable=!1,i.emit("close")}))}}return Q((function(){l=!1})),t.declaration&&(r={version:"1.0",encoding:(n=t.declaration).encoding||"UTF-8"},n.standalone&&(r.standalone=n.standalone),c({"?xml":{_attr:r}}),o=o.replace("/>","?>")),e&&e.forEach?e.forEach((function(t,n){var r;n+1===e.length&&(r=u),c(t,r)})):c(e,u),i?(i.readable=!0,i):o},_l.exports.element=_l.exports.Element=function(){var e=Array.prototype.slice.call(arguments),t={_elem:El(e),push:function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,n=this._elem.indent;Sl(this.append,El(e,n,this._elem.icount+(n?1:0)),(function(){t.append(!0)}))},close:function(e){void 0!==e&&this.push(e),this.end&&this.end()}};return t};const Ol=y(_l.exports),Tl=(e,t)=>{const n=t.replace(/-/g,"");if(32!==n.length)throw new Error(`Error: Cannot extract GUID from font filename: ${t}`);const r=n.replace(/(..)/g,"$1 ").trim().split(" ").map((e=>parseInt(e,16)));r.reverse();const i=e.slice(0,32).map(((e,t)=>e^r[t%r.length]));return Buffer.concat([e.slice(0,0),i,e.slice(32)])};class Il{format(e,t={stack:[]}){const n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}}class Fl{replace(e,t,n){let r=e;return t.forEach(((e,t)=>{r=r.replace(new RegExp(`{${e.fileName}}`,"g"),(n+t).toString())})),r}getMediaData(e,t){return t.Array.filter((t=>e.search(`{${t.fileName}}`)>0))}}class jl{replace(e,t){let n=e;for(const e of t)n=n.replace(new RegExp(`{${e.reference}-${e.instance}}`,"g"),e.numId.toString());return n}}const Pl=e=>!0===e?" ":!1===e?void 0:e;class Ll{static toString(e,t){return A(this,null,(function*(){const n=this.compiler.compile(e,Pl(t));return yield n.generateAsync({type:"string",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})}))}static toBuffer(e,t){return A(this,null,(function*(){const n=this.compiler.compile(e,Pl(t));return yield n.generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})}))}static toBase64String(e,t){return A(this,null,(function*(){const n=this.compiler.compile(e,Pl(t));return yield n.generateAsync({type:"base64",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})}))}static toBlob(e,t){return A(this,null,(function*(){const n=this.compiler.compile(e,Pl(t));return yield n.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})}))}static toStream(e,t){const n=new cn.Stream;return this.compiler.compile(e,Pl(t)).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then((e=>{n.emit("data",e),n.emit("end")})),n}}u(Ll,"compiler",new class{constructor(){u(this,"formatter"),u(this,"imageReplacer"),u(this,"numberingReplacer"),this.formatter=new Il,this.imageReplacer=new Fl,this.numberingReplacer=new jl}compile(e,t){const n=new xl,r=this.xmlifyFile(e,t),i=new Map(Object.entries(r));for(const[,e]of i)if(Array.isArray(e))for(const t of e)n.file(t.path,t.data);else n.file(e.path,e.data);for(const{stream:t,fileName:r}of e.Media.Array)n.file(`word/media/${r}`,t);for(const{data:t,name:r,fontKey:i}of e.FontTable.fontOptionsWithKey){const[e]=r.split(".");n.file(`word/fonts/${e}.odttf`,Tl(t,i))}return n}xmlifyFile(e,t){const n=e.Document.Relationships.RelationshipCount+1,r=Ol(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),i=this.imageReplacer.getMediaData(r,e.Media);return{Relationships:{data:(()=>(i.forEach(((t,r)=>{e.Document.Relationships.createRelationship(n+r,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${t.fileName}`)})),Ol(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:(()=>{const t=this.imageReplacer.replace(r,i,n);return this.numberingReplacer.replace(t,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{const n=Ol(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(n,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:Ol(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:Ol(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:Ol(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map(((n,r)=>{const i=Ol(this.formatter.format(n.View,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(i,e.Media).forEach(((e,t)=>{n.Relationships.createRelationship(t,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${e.fileName}`)})),{data:Ol(this.formatter.format(n.Relationships,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${r+1}.xml.rels`}})),FooterRelationships:e.Footers.map(((n,r)=>{const i=Ol(this.formatter.format(n.View,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(i,e.Media).forEach(((e,t)=>{n.Relationships.createRelationship(t,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${e.fileName}`)})),{data:Ol(this.formatter.format(n.Relationships,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${r+1}.xml.rels`}})),Headers:e.Headers.map(((n,r)=>{const i=Ol(this.formatter.format(n.View,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),o=this.imageReplacer.getMediaData(i,e.Media),a=this.imageReplacer.replace(i,o,0);return{data:this.numberingReplacer.replace(a,e.Numbering.ConcreteNumbering),path:`word/header${r+1}.xml`}})),Footers:e.Footers.map(((n,r)=>{const i=Ol(this.formatter.format(n.View,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),o=this.imageReplacer.getMediaData(i,e.Media),a=this.imageReplacer.replace(i,o,0);return{data:this.numberingReplacer.replace(a,e.Numbering.ConcreteNumbering),path:`word/footer${r+1}.xml`}})),ContentTypes:{data:Ol(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:Ol(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:Ol(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:Ol(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/footnotes.xml"},FootNotesRelationships:{data:Ol(this.formatter.format(e.FootNotes.Relationships,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/footnotes.xml.rels"},Settings:{data:Ol(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:Ol(this.formatter.format(e.Comments,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/comments.xml"},FontTable:{data:Ol(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:(()=>Ol(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}))(),path:"word/_rels/fontTable.xml.rels"}}}}),new Il,new Il,new Fl;var Nl=n(25078);function Ul(e){return Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ul(e)}n(87669);var Dl=["addSectionSpacing"],Rl=["type","children"],Ml=["positionalTab"];function Hl(){Hl=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function Q(e,t,n,i){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),s=new k(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function v(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=Q;var c={};function u(){}function A(){}function p(){}var m={};l(m,o,(function(){return this}));var f=Object.getPrototypeOf,d=f&&f(f(B([])));d&&d!==t&&n.call(d,o)&&(m=d);var h=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var l=v(e[r],e,o);if("throw"!==l.type){var Q=l.arg,c=Q.value;return c&&"object"==Ul(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(c).then((function(e){Q.value=e,a(Q)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=y(a,n);if(s){if(s===c)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=v(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=v(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function B(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function Gl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zl(e){for(var t=1;t =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Vl(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Wl(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Vl(o,r,i,a,s,"next",e)}function s(e){Vl(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Jl(e){return function(e){if(Array.isArray(e))return Yl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Yl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yl(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 0&&n.forEach((function(e){return r.push.apply(r,Jl($l(o,Zl).call(o,e)))})),r}},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(n=this,r=Zl),r.set(n,i),this.website=t,this.doc=null}var t,n,r,i,o,a,s,l,Q,v,c;return t=e,n=[{key:"getPageDocx",value:function(e){var t=this,n=this.website.activePage.childBlocks,r=this.website.getRemoteReportFns(),i=null,o=null,a=[];return n.forEach((function(e){var n=e.docx,r=e.targetElement,s=e.childBlocks;n&&("page_header"===r?i=n:"page_footer"===r?o=n:a.push(n)),s.length>0&&s.forEach((function(e){return e.docx&&a.push.apply(a,Jl($l(t,Zl).call(t,e)))}))})),{header:i,footer:o,sections:a,configs:r}}},{key:"setPageDoc",value:(c=Wl(Hl().mark((function e(t){var n,r,i,o,a,s,l,Q,v,c,u;return Hl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.docx,r=t.download,i=void 0!==r&&r,o=n.header,a=n.footer,s=n.sections,l=n.configs,Q=l.addSectionSpacing,v=void 0!==Q&&Q,c=ql(l,Dl),v&&s.forEach((function(e,t){t 0&&void 0!==r[0]?r[0]:"document.docx",this.doc){e.next=4;break}return console.error("Document not set"),e.abrupt("return");case 4:return e.next=6,Ll.toBlob(this.doc);case 6:n=e.sent,(0,Nl.saveAs)(n,t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getPagePDF",value:function(e){var t=this.website.activePage.childBlocks,n=this.website.getRemoteReportFns(),r=null,i=null,o=[];return t.forEach((function(e){var t=e.pdf,n=e.targetElement;e.childBlocks,t&&("page_header"===n?r=t:"page_footer"===n?i=t:o.push(t))})),{header:r,footer:i,sections:o,configs:n}}},{key:"setPagePDF",value:(a=Wl(Hl().mark((function e(t){var n,r;return Hl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.pdf,t.download,t.createElementFromData,n.header,n.footer,r=n.sections,console.log("sections",r),e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})}],r=[{key:"createDocElement",value:(o=Wl(Hl().mark((function e(t){var n,r,i,o,a,s,l,Q,v,c,u,A,p,m,f=this;return Hl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.type,r=t.children,i=void 0===r?[]:r,o=ql(t,Rl),e.prev=1,e.t0=n,e.next="paragraph"===e.t0?5:"text"===e.t0?10:"externalHyperlink"===e.t0?22:"internalHyperlink"===e.t0?26:"image"===e.t0?30:"table"===e.t0?41:"tableRow"===e.t0?45:"tableCell"===e.t0?49:"bookmark"===e.t0?53:57;break;case 5:return o.heading&&(o.heading=po[o.heading]),e.next=8,Promise.all(i.map((function(e){return f.createDocElement(e)})));case 8:return a=e.sent.filter(Boolean),e.abrupt("return",new ua(zl({children:a},o)));case 10:if(!o.positionalTab){e.next=13;break}return s=o.positionalTab,l=ql(o,Ml),e.abrupt("return",new Wr(zl({children:[new Qo(zl({},s)),t.content]},l)));case 13:if("_currentPage"!==t.content){e.next=17;break}return e.abrupt("return",new Wr(zl({children:[Kr]},o)));case 17:if("_totalPages"!==t.content){e.next=21;break}return e.abrupt("return",new Wr(zl({children:[qr]},o)));case 21:return e.abrupt("return",new Wr(zl({text:t.content},o)));case 22:return e.next=24,Promise.all(i.map((function(e){return f.createDocElement(e)}))).then((function(e){return e.filter(Boolean)}));case 24:return Q=e.sent,e.abrupt("return",new So({children:Q,link:t.link}));case 26:return e.next=28,Promise.all(i.map((function(e){return f.createDocElement(e)}))).then((function(e){return e.filter(Boolean)}));case 28:return v=e.sent,e.abrupt("return",new Eo({children:v,anchor:t.anchor}));case 30:return e.prev=30,e.next=33,this.fetchImageData(t.src);case 33:return c=e.sent,e.abrupt("return",new io(zl({data:c},o)));case 37:return e.prev=37,e.t1=e.catch(30),console.error("Error fetching image data: ".concat(e.t1)),e.abrupt("return",null);case 41:return e.next=43,Promise.all(i.map((function(e){return f.createDocElement(e).catch((function(){return null}))}))).then((function(e){return e.filter(Boolean)}));case 43:return u=e.sent,e.abrupt("return",new ja(zl({rows:u},o)));case 45:return e.next=47,Promise.all(i.map((function(e){return f.createDocElement(e).catch((function(){return null}))}))).then((function(e){return e.filter(Boolean)}));case 47:return A=e.sent,e.abrupt("return",new Ua(zl({children:A},o)));case 49:return e.next=51,Promise.all(i.map((function(e){return f.createDocElement(e).catch((function(){return null}))}))).then((function(e){return e.filter(Boolean)}));case 51:return p=e.sent,e.abrupt("return",new Ba(zl({children:p,margins:{left:Jr(.05),right:Jr(.05)}},o)));case 53:return e.next=55,Promise.all(i.map((function(e){return f.createDocElement(e).catch((function(){return null}))}))).then((function(e){return e.filter(Boolean)}));case 55:return m=e.sent,e.abrupt("return",new Io({id:t.id,children:m}));case 57:return console.error("Unhandled element type: ".concat(n)),e.abrupt("return",null);case 59:e.next=65;break;case 61:return e.prev=61,e.t2=e.catch(1),console.error("Error creating element for type ".concat(n,": ").concat(e.t2)),e.abrupt("return",null);case 65:case"end":return e.stop()}}),e,this,[[1,61],[30,37]])}))),function(e){return o.apply(this,arguments)})},{key:"fetchImageData",value:(i=Wl(Hl().mark((function e(t){var n,r;return Hl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:if((n=e.sent).ok){e.next=6;break}throw new Error("HTTP error! status: ".concat(n.status));case 6:return e.next=8,n.blob();case 8:return r=e.sent,e.abrupt("return",new Promise((function(e,t){var n=new FileReader;n.onloadend=function(){return e(n.result)},n.onerror=function(){return t(new Error("Failed to read blob."))},n.readAsArrayBuffer(r)})));case 12:throw e.prev=12,e.t0=e.catch(0),console.error("Error fetching image from URL: ".concat(t),e.t0),e.t0;case 16:case"end":return e.stop()}}),e,null,[[0,12]])}))),function(e){return i.apply(this,arguments)})}],n&&Xl(t.prototype,n),r&&Xl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},52644:(e,t,n)=>{"use strict";n.d(t,{Z:()=>L});var r=n(8053),i=n(16498),o=n(68713),a=(n(32797),n(46598));function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),B(n),A}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;B(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),A}},e}function u(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,s,"next",e)}function s(e){u(o,r,i,a,s,"throw",e)}a(void 0)}))}}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 1&&void 0!==arguments[1]?arguments[1]:{},r=n.type,i=n.subFolder,o=n.withFolder,a=void 0===o||o,s=this.getProfiles(r,i);if(!e)return s;var l=e.split(" "),Q=s.filter((function(e){var t,n=e.getBasicInfo().title,r=!1,i=e.options.tags,o=m(l);try{var a=function(){var e=t.value;return n.toLowerCase().includes(e.toLowerCase())||i.length&&i.some((function(t){return t.toLowerCase().includes(e.toLowerCase())}))?(r=!0,"break"):void 0};for(o.s();!(t=o.n()).done&&"break"!==a(););}catch(e){o.e(e)}finally{o.f()}return r})),v=[];if(a){var c=this.getProfiles("folder/profile",i),u=c.filter((function(e){var t,n=e.getBasicInfo().title,r=e.options.tags,i=!1,o=m(l);try{var a=function(){var e=t.value;return n.toLowerCase().includes(e.toLowerCase())||r.length&&r.some((function(t){return t.toLowerCase().includes(e.toLowerCase())}))?(i=!0,"break"):void 0};for(o.s();!(t=o.n()).done&&"break"!==a(););}catch(e){o.e(e)}finally{o.f()}return i}));u.forEach((function(e){v=v.concat(t.getProfiles(r,e.folder.fileId))}))}var A=[];return[].concat(p(Q),p(v)).forEach((function(e){var t=e.getProfileType(),n=e.getId(),r="".concat(t,"_").concat(n),i=A[r];i&&(e.options.tags=p(new Set([].concat(p(i.options.tags||[]),p(e.options.tags||[]))))),A[r]=e})),Object.values(A)}},{key:"filter",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mode,r=void 0===n?"all":n,i=t.types,o=void 0===i?[]:i,a=t.withHierarchy,s=void 0!==a&&a,l=t.unique,Q=void 0===l||l,v=t.subFolder,c=Object.values(this.profiles);if(v){var u=this.getDescendantFileIds(v,!0);c=u.map((function(t){return e.profiles[t]}))}var A=[];if("all"===r?A=c:(s&&!o.includes("folder/profile")&&o.push("folder/profile"),A=c.filter((function(e){return o.includes(e.getProfileType())}))),Q){var m=[];A.forEach((function(e){var t=e.getProfileType(),n=e.getId(),r="".concat(t,"_").concat(n),i=m[r];i&&(e.options.tags=p(new Set([].concat(p(i.options.tags||[]),p(e.options.tags||[]))))),m[r]=e})),A=Object.values(m)}return A}},{key:"fetchContents",value:(a=A(c().mark((function e(){var t=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.fetchPromise){e.next=2;break}return e.abrupt("return",this.fetchPromise);case 2:if(!this.profiles){e.next=4;break}return e.abrupt("return",Promise.resolve(this.profiles));case 4:return this.fetchPromise=this.folderProfile.initialize().then((function(e){var n,r,i=e.getData();if(t.name=e.getBasicInfo().title,!t.name)return t.profiles={},null;t.parentFolder?t.path=t.parentFolder.path+"/"+t.name:t.path=t.name;var o=null==i||null===(n=i.info)||void 0===n?void 0:n._structure,a=o?Object.values(o)[0]:"",s=a?JSON.parse(a):{},l=(null===(r=Object.values(s))||void 0===r?void 0:r[0])||"";return t.order=l,t.parseFileContents(i.files),t.fetchPromise=null,Promise.all(Object.values(t.profiles).map((function(e){return e.initialize()}))).then((function(){return t.profiles}))})).catch((function(e){throw t.fetchPromise=null,e})),e.abrupt("return",this.fetchPromise);case 6:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getFiles",value:(o=A(c().mark((function e(t){var n=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.fetchContents().then((function(){return n.filter(t)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"parseFileContents",value:(i=A(c().mark((function e(t){var n,r,i,o,a,s,l,v,u,A,p,f,d,h,g,b,w,y,x=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.profiles={},n=[],r=[],i=m(t);try{for(i.s();!(o=i.n()).done;)s=o.value,l=null,v="",u=null,A={fileId:s.id,tags:(null===(a=s.metadata)||void 0===a?void 0:a.tags)||[]},s.profile?(p=s.profile)&&(u=Q(Q({},A),{},{head:p[1]}),v=p[6]._subtype,l=p[0]):s.file||s.url?(v="webasset/profile",l=this.contentId+"_"+s.id,u=Q(Q({},A),{},{data:this.makeWebAssetProfileData(s)})):(n.push(s),r.push(s.id)),v&&l&&(this.profiles[s.id]=L.newProfile(v,l,u))}catch(e){i.e(e)}finally{i.f()}if(f=[],!r.length){e.next=20;break}case 7:if(f.length===r.length){e.next=20;break}d=0;case 9:if(!(d 1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.order.split(","),i=new Set;return r.forEach((function(r){var o=r.split("/"),a=o.indexOf(e);if(-1!==a)if(t)if(n){var s=o.slice(a+1).join("/");s&&i.add(s)}else for(var l=a+1;l =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=S(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function k(){k=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function Q(e,t,n,i){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),s=new B(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function v(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=Q;var c={};function u(){}function A(){}function p(){}var m={};l(m,o,(function(){return this}));var f=Object.getPrototypeOf,d=f&&f(f(C([])));d&&d!==t&&n.call(d,o)&&(m=d);var h=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var l=v(e[r],e,o);if("throw"!==l.type){var Q=l.arg,c=Q.value;return c&&"object"==T(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(c).then((function(e){Q.value=e,a(Q)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=y(a,n);if(s){if(s===c)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=v(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=v(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function B(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function B(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function C(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){B(o,r,i,a,s,"next",e)}function s(e){B(o,r,i,a,s,"throw",e)}a(void 0)}))}}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 0&&void 0!==arguments[0]?arguments[0]:"social_media_links",n=i.findInFull(t),r=[];return n&&(Array.isArray(n)?n.forEach((function(t){r.push(e.parseMediaLinkValue(t))})):"object"===T(n)&&Object.keys(n).length&&r.push(e.parseMediaLinkValue(data)(n))),r}));var o=r||{},a=o.data,s=o.head,l=o.format,Q=o.website,v=o.lang,c=o.contentInfo;this.options=r,this.profileType=e.completeProfileType(t);var u=E(e.parseProfileType(this.profileType),2);this.contentType=u[0],this.viewType=u[1],this.contentId=n,this.website=Q||uniweb.getActiveWebsite(),this.activeLang=v||this.website.getLanguage(),this.key=e.makeProfileKey(this.profileType,this.contentId,this.activeLang),this.fetchPromise=null,this.setAsyncData(a,s,l,c)}var t,n,s,l,Q,v,c,u;return t=e,n=[{key:"isReady",value:function(){return!!this.rawData}},{key:"setAsyncData",value:function(t,n,r,i){var o,a,s,l;null!==(o=this.rawData)&&void 0!==o||(this.rawData=t),r&&(null!==(a=this.format)&&void 0!==a||(this.format=r)),i&&(null!==(s=this.contentInfo)&&void 0!==s||(this.contentInfo=i)),n?"string"==typeof n&&(n=JSON.parse(n)):(n=e.parseHeadItem(t),this.contentInfo&&Object.assign(n,this.contentInfo)),null!==(l=this.rawHead)&&void 0!==l||(this.rawHead=n),this.basicInfo=null,this.simpleData=null,this.displayData=null,this.fullData=null,this.typeInfo=null,this.sectionIndex=null,this.fieldTypeSchema=null,this.richData=null}},{key:"initialize",value:(u=C(k().mark((function e(){var t,n,r=arguments;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:null,n=this.fetchContents(),"function"==typeof t&&n.then((function(e){return t(e)})),e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"fetchContents",value:(c=C(k().mark((function t(){var n=this;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isReady()){t.next=2;break}return t.abrupt("return",Promise.resolve(this));case 2:if(!this.fetchPromise){t.next=4;break}return t.abrupt("return",this.fetchPromise);case 4:return this.fetchPromise=e.fetch(this.profileType,this.contentId,this.activeLang).then((function(e){return n.setAsyncData(e.rawData,e.rawHead,e.format,e.contentInfo),n.fetchPromise=null,n})).catch((function(e){n.fetchPromise=null,console.log(e),console.log("Cannot fetch ".concat(n.profileType,"/").concat(n.contentId))})),t.abrupt("return",this.fetchPromise);case 6:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"getLanguage",value:function(){return this.activeLang}},{key:"getProfileType",value:function(){return this.profileType}},{key:"getContentType",value:function(){return this.contentType}},{key:"getViewType",value:function(){return this.viewType}},{key:"getId",value:function(){return this.contentId}},{key:"getHandle",value:function(){var e;return null===(e=this.rawHead)||void 0===e?void 0:e.handle}},{key:"info",value:function(){return{id:this.contentId,contentType:this.contentType,viewType:this.viewType}}},{key:"getData",value:function(){var t;return null!==(t=this.simpleData)&&void 0!==t?t:this.simpleData=this.rawData?e.parseAsSimpleData(this.rawData,this.website):null}},{key:"getDisplayData",value:function(){var t;return null!==(t=this.displayData)&&void 0!==t?t:this.displayData=this.rawData?e.parseAsDisplayData(this.rawData,this.website):null}},{key:"getEditData",value:function(){var t;return e.editableMode()?null!==(t=this.richData)&&void 0!==t?t:this.richData=this.rawData?e.parseAsRichData(this.rawData):null:null}},{key:"resetComputedData",value:function(){this.setAsyncData()}},{key:"getFullData",value:function(){var e;return null!==(e=this.fullData)&&void 0!==e?e:this.fullData=this.rawData?(0,i.HN)({sections:this.rawData,format:this.format,contentInfo:this.contentInfo},null,!0,this.activeLang):null}},{key:"getTopSectionName",value:function(){return Object.keys(this.getSectionIndex())[0]}},{key:"getTypeInfo",value:function(){var e;return null!==(e=this.typeInfo)&&void 0!==e?e:this.typeInfo=(0,r.pe)(this.contentType,this.viewType)}},{key:"getSectionIndex",value:function(){return null===this.sectionIndex&&this.rawData&&(this.sectionIndex={},e.indexSectionInfo(this.sectionIndex,this.rawData)),this.sectionIndex||{}}},{key:"getSectionInfo",value:function(e){return Array.isArray(e)&&e.join("/"),this.getSectionIndex()[e]}},{key:"getFieldTypeSchema",value:function(){var t;return null!==(t=this.fieldTypeSchema)&&void 0!==t?t:this.fieldTypeSchema=this.rawData?e.parseAsSchema(this.rawData):null}},{key:"getContentId",value:function(){return this.contentId}},{key:"isHeadless",value:function(){var e;return null===(e=this.getTypeInfo())||void 0===e?void 0:e.headless}},{key:"getBasicInfo",value:function(){if(null===this.basicInfo&&this.rawHead){var t=this.rawHead&&"string"==typeof this.rawHead?JSON.parse(this.rawHead):this.rawHead,n=(0,r.uZ)(this.getContentType(),this.isHeadless()?"profile":this.viewType,t,this.activeLang),i=n.titleField,o=void 0===i?"":i,a=n.captionField;a&&"object"===T(a)&&(a=a.title?a.title:Object.values(a).filter(Boolean)[0]||""),this.basicInfo={title:o,subtitle:a,avatar:t._avatar,banner:t._banner,coverImg:null==t?void 0:t._coverImg,lastEditTime:t.last_edit,lastLocalEditTime:e.convertTimestampToLocalString(t.last_edit),handle:t.handle,head:t}}return this.basicInfo}},{key:"getDisplayName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.getBasicInfo().title||e}},{key:"getVisibility",value:function(){var e=this.getBasicInfo().head,t=(void 0===e?{}:e).visibility,n=Array.isArray(t)?t[0]:t;return parseInt(n||3)}},{key:"isHidden",value:function(){return 3===this.getVisibility()}},{key:"getAvatar",value:function(){return this.rawHead._avatar}},{key:"getBanner",value:function(){return this.rawHead._banner}},{key:"getLastEditTime",value:function(){return this.rawHead.last_edit}},{key:"getResources",value:function(e){var t,n,r=null!==(t=null===(n=this.getFullData().filter((function(t){return t.name===e})))||void 0===n?void 0:n[0])&&void 0!==t?t:null;if(!r)return[];var i=this.getSectionInfo(e);r.fields=i.fields;var a=(0,o.H3)(r);return(null==a?void 0:a.cards)||[]}},{key:"getLinkedProfileCards",value:function(t){var n,i,a=null!==(n=null===(i=this.getFullData().filter((function(e){return e.name===t})))||void 0===i?void 0:i[0])&&void 0!==n?n:null;if(!a)return{cards:[],filters:{}};var s="",l={searchKey:"title",histograms:{}};Object.values(a.fields).forEach((function(e){"profile"===e.type&&(s=e.subtype)})),s&&e.getFilterableFields(s).forEach((function(t){var n=t.label,i=t.name;n=(0,r.NC)(n,"",e.websiteLang),l.histograms[n]=i}));var Q=(0,o.H3)(a,l),v=Q.cards,c=void 0===v?[]:v,u=Q.filters;return{cards:c,filters:void 0===u?{}:u}}},{key:"getSectionsWithRelationFields",value:function(){var e=this.getSectionIndex(),t=[];for(var n in e){var r=e[n];r.profileLinks&&t.push(r)}return t}},{key:"findRelationField",value:function(t,n,r){if(t=e.completeProfileType(t),!n)for(var i=this.getSectionsWithRelationFields(),o=0;o 1&&void 0!==arguments[1]&&arguments[1],r=n?this.getEditData():this.getData();"string"==typeof t&&(t=t.split("/"));var i,o=_(t);try{for(o.s();!(i=o.n()).done;){var a,s=i.value;if(Array.isArray(r)&&(r=null!==(a=r[0])&&void 0!==a?a:null),!e.isPlainObject(r))return null;r=r[s]}}catch(e){o.e(e)}finally{o.f()}return Array.isArray(r)&&(r=r.map((function(e){return F(F({},e),{},{"@":{name:t[t.length-1]}})}))),Array.isArray(r)&&1==r.length&&this.isSingleItemSection(t)?r[0]:r}},{key:"findInFull",value:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getFullData();if(!r)return null;if("string"==typeof t&&(t=t.split("/")),1===t.length){var i,o,a=t[0],s=this.hasFields(a);return Array.isArray(r)?s?null!==(i=null===(o=r.find((function(e){return e.name===a})))||void 0===o?void 0:o.value)&&void 0!==i?i:null:r.map((function(e){return e[a]})):r[a]}var l,Q,v=t[0];if(Array.isArray(r))l=null===(Q=r.find((function(e){return e.name===v})))||void 0===Q?void 0:Q.value;else if(e.isPlainObject(r)){var c;l=null===(c=Object.values(r).find((function(e){return e.name===v})))||void 0===c?void 0:c.value}if(l){if(Array.isArray(l)){var u=l.map((function(e){return n.findInFull(t.slice(1),e)}));return u.flat().filter(Boolean)}return console.log("find out why section data is not array",l),null}return null}},{key:"hasFields",value:function(e){var t,n=null===(t=this.getSectionInfo(e))||void 0===t?void 0:t.has_fields;return!!n&&parseInt(n)}},{key:"getMaxItemCount",value:function(e){var t,n=null===(t=this.getSectionInfo(e))||void 0===t?void 0:t.max_item_count;return n?parseInt(n):null}},{key:"isSingleItemSection",value:function(e){return 1===this.getMaxItemCount(e)}},{key:"isSectionGroup",value:function(e){return!this.hasFields(e)&&this.isSingleItemSection(e)}},{key:"getLinkedProfileInfoFromSection",value:function(e){var t,n=(null===(t=this.getSectionFields(e).filter((function(e){return"profile"===e.type})))||void 0===t?void 0:t[0])||{};return{field:n.name,type:n.subtype}}},{key:"renderProfileCards",value:function(e,t,n){var r=this.getLinkedProfileInfoFromSection(e),i=r.field,o=r.type,a=this.getLinkedProfiles(o,e,i);return a.length&&t?(n&&(a=n(a)),a.map((function(e,n){return t(e,n)}))):null}},{key:"findSectionByFieldName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=this.getSectionIndex();for(var o in i){var a=i[o].fields;if(!t||t&&1===Object.keys(a).length)for(var s in a){var l=a[s];if(l.name===e){if(!n||!Object.keys(n).length){r=o;break}for(var Q in n)if(l[Q]===n[Q]){r=o;break}}}}return r}},{key:"useReadyStateEffect",value:function(e,t){var n=this,r=E(e(),2)[1];return t((function(){n.initialize(r)}),[]),this.isReady()}},{key:"getImageInfo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"banner",n=arguments.length>1?arguments[1]:void 0,r=this.getBasicInfo().coverImg,i="";if(r)i=r;else{var o,a=this.website.getAssetRootUrl(),s="banner"===t?this.getBanner():this.getAvatar(),l="original"===n;l?o="jpeg":(n||(n="banner"===t?"md":"sm"),n=e.calcFinalImageSize(n),o=this.website.isWebpSupported()?"webp":"jpeg"),i="".concat(a).concat(this.contentType,"/");var Q="".concat(this.contentId,"/").concat(t,"/").concat(this.contentType,"_").concat(this.isHeadless()?"profile":this.viewType,"_v").concat(s);i+=s&&"_default"!==s?l?"".concat(Q,".").concat(o):"".concat(Q,"_").concat(n,".").concat(o):l?"default/".concat(t,"/").concat(this.contentType,"_default.").concat(o):"default/".concat(t,"/").concat(this.contentType,"_default_").concat(n,".").concat(o)}return{url:i,alt:"Profile ".concat(t," for ").concat(this.contentType," ").concat(this.contentId)}}},{key:"getAssetInfo",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r="resources"===this.contentType?"equipment":this.contentType;if(!e)return{};var i=e.split("/"),o=E(i,3),a=o[0],s=o[1],l=o[2],Q=e.split(".").pop(),v=t&&!["jpg","jpeg","png","webp","gif","svg"].includes(Q),c=this.website.getProfileAssetRootUrl(),u="",A=this.isHeadless()?"profile":this.viewType;["jpg","jpeg","png"].includes(Q)&&(u="".concat(c).concat(r,"/").concat(A,"/").concat(this.contentId,"/").concat(s,"_v").concat(a,".webp"));var p="".concat(c).concat(r,"/").concat(A,"/").concat(this.contentId,"/").concat(v?"".concat(s,"_preview"):s,"_v").concat(a,".").concat(v?"webp":Q),m=this.website.localize(n)||l,f=this.website.buildLoadProfileAssetURL(this.contentId,this.contentType,e,A,s);return{src:p,href:f,alt:m,optSrc:u}}},{key:"getContent",value:function(){if(!this.isReady())return null;if("profile"==this.viewType)switch(this.contentType){case"article":return new a.Z(this.at("article_body"));case"list":return e.getProfilesInList(this.contentId)}return this.getData()}},{key:"makeOwnHref",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.tab,i=void 0===r?"":r,o=n.searchParams,a=this.contentType,s=this.viewType,l=this.getId(),Q=s||"profile",v="",c="equipment"===a?"resources":a;v="view/".concat(Q,"/").concat(c),l&&(v+="/".concat(l),i&&(v+="/".concat(i))),o&&(v+=o);var u=null===(e=uniweb.config.data)||void 0===e||null===(t=e.domainsInfo)||void 0===t?void 0:t.appDomain;return"".concat(u.endsWith("/")?u:"".concat(u,"/")).concat(v)}},{key:"getMetaInfo",value:function(e){var t=this.getSectionInfo(e);if(t)return t;if(e.includes("/")){var n=e.split("/"),r=n.pop(),i=n.join("/");return this.getFieldInfo(i,r)}}},{key:"getValue",value:function(e){if("@link"===(e=e.replace(/\./g,"/")))return this.makeOwnHref();if("@lastEditTime"===e)return this.getLastEditTime()||"";var t,n,r;if("@title"===e)return(null===(t=this.getBasicInfo())||void 0===t?void 0:t.title)||"";if("@subtitle"===e)return(null===(n=this.getBasicInfo())||void 0===n?void 0:n.subtitle)||"";if("@avatar"===e||"@banner"===e)return null===(r=this.getImageInfo(e.slice(1),"md"))||void 0===r?void 0:r.url;if(!e.includes("/")&&!e.includes("@")){if(this.getSectionInfo(e))return this.at(e)||"";var i=this.getTopSectionName();return this.at("".concat(i,"/").concat(e))||""}if(!e.includes("@"))return this.at(e)||"";if(e.includes("@")){var o=e.split("@"),a=o.pop(),s=o.join("");if(a){var l=this.getSectionInfo(s);if(l)return(null==l?void 0:l[a])||"";var Q=s.split("/"),v=Q.pop(),c=Q.join("/"),u=this.getFieldInfo(c,v);if(u)return(null==u?void 0:u[a])||""}}return""}},{key:"useContent",value:function(e,t){return this.useReadyStateEffect(e,t),this.getContent()}},{key:"getProfileTabs",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,r.D0)(this.getContentType(),this.getViewType());n=n.filter((function(e){return e.sectionName}));var i=t.filterEmpty,o=void 0===i||i;return o&&(n=n.filter((function(t){var n;return null===(n=e.at(t.sectionName))||void 0===n?void 0:n.length}))),n}}],s=[{key:"makeProfileKey",value:function(t,n,r){return t=e.completeProfileType(t),"".concat(n,"/").concat(t).concat(r?"/".concat(r):"")}},{key:"completeProfileType",value:function(e){return e.includes("/")||(e+="/profile"),e}},{key:"newProfile",value:function(t,n,r){var i=new e(t,n,r);return!e.editableMode()&&null!=r&&r.data&&e.setCashedProfile(i),"folder/profile"==t&&(i.folder=new b(i,r)),i}},{key:"getCashedProfile",value:function(t,n){var r=e.makeProfileKey(t,n);return e.cache.profiles[r]}},{key:"setCashedProfile",value:function(t){e.cache.profiles[t.key]=t}},{key:"clearCashedProfile",value:function(t,n){delete e.cache.profiles[e.makeProfileKey(t,n)]}},{key:"getCashedFormat",value:function(t){return t=e.completeProfileType(t),e.cache.formats[t]}},{key:"setCashedFormat",value:function(t,n){t=e.completeProfileType(t),e.cache.formats[t]=n}},{key:"fetch",value:(v=C(k().mark((function t(n,i,o){var a,s,l,Q,v,c,u;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(a=e.getCashedProfile(n,i))||!a.isReady()){t.next=3;break}return t.abrupt("return",Promise.resolve(a));case 3:return s=e.parseProfileType(n),l=E(s,2),Q=l[0],v=l[1],c={action:"display",editable:!1,contentType:Q,viewType:v,contentId:i,profileLang:o,withFormat:!e.getCashedFormat(n)},u=function(t){var r=t.data,o=r.sections;return r.format&&e.setCashedFormat(n,t.data.format),e.newProfile(n,i,{data:o})},t.abrupt("return",r.ZP.get("profiles.php",{params:c}).then(u));case 7:case"end":return t.stop()}}),t)}))),function(e,t,n){return v.apply(this,arguments)})},{key:"fetchAll",value:(Q=C(k().mark((function t(n,i,o){var a,s,l,Q,v,c,u,A,p,m,f,d;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=[],s=[],l=_(i);try{for(l.s();!(Q=l.n()).done;)v=Q.value,(c=e.getCashedProfile(n,v))&&c.isReady()?s.push(c):a.push(v)}catch(e){l.e(e)}finally{l.f()}if(a.length){t.next=6;break}return t.abrupt("return",Promise.resolve(s));case 6:return u=e.parseProfileType(n),A=E(u,2),p=A[0],m=A[1],f={action:"displayProfiles",contentType:p,viewType:m,contentIds:a,profileLang:o,withFormat:!e.getCashedFormat(n)},d=function(t){var r=t.data,i=r.profiles,o=r.format;for(var a in o&&e.setCashedFormat(n,o),i){var l=i[a],Q=l.sections,v=l.contentInfo;s.push(e.newProfile(n,a,{data:Q,contentInfo:v}))}return s},t.abrupt("return",r.ZP.get("profiles.php",{params:f}).then(d));case 10:case"end":return t.stop()}}),t)}))),function(e,t,n){return Q.apply(this,arguments)})},{key:"fetchBasicInfo",value:(l=C(k().mark((function t(n){var i,o,a,s,l,Q,v,c,u,A,p,m,f=arguments;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=f.length>1&&void 0!==f[1]?f[1]:"public",a=f.length>2&&void 0!==f[2]?f[2]:[],s=f.length>3&&void 0!==f[3]?f[3]:null,l=e.parseProfileType(n),Q=E(l,2),v=Q[0],c=Q[1],u=!(e.editableMode()||null!=a&&a.contentIds),null!==(i=s)&&void 0!==i||(s=this.activeLang),A={action:"getBasicInfo",contentType:v,viewType:c,scope:o,filter:a},!u){t.next=12;break}if(u=e.generateCacheKey(A),!(p=e.cache.queries[u])){t.next=12;break}return t.abrupt("return",Promise.resolve(p));case 12:return m=function(t){var r,i=[],o=_(t.data);try{for(o.s();!(r=o.n()).done;){var a=E(r.value,6),s=a[0],l=a[1],Q=a[2],v=a[3],c=a[4],A=a[5];i.push(new e(n,s,{head:F(F({},l),{},{ownerId:Q,visibility:v,lastEdit:c,handle:A})}))}}catch(e){o.e(e)}finally{o.f()}return u&&(e.cache.queries[u]=i),i},t.abrupt("return",r.ZP.get("profiles.php",{params:A}).then(m));case 14:case"end":return t.stop()}}),t,this)}))),function(e){return l.apply(this,arguments)})},{key:"generateCacheKey",value:function(e){return Object.keys(e).sort().map((function(t){return"".concat(t,"=").concat(encodeURIComponent(e[t]))})).join("&")}},{key:"getProfileSection",value:function(e,t,n,i){return(0,r.CO)(e,t,n,!1,i)}},{key:"getListProfileItems",value:function(t,n){return(0,r.V2)(t,e.websiteLang,n)}},{key:"getProfilesInList",value:function(t,n){return(0,r.V2)(t,e.websiteLang,n).then((function(t){return t.map((function(t){var n=t.contentId,r=t.contentType,i=t.viewType,o=t.head,a=t.ownerId,s=t.lastEditTime,l=t.handle;return o="string"==typeof o?JSON.parse(o):o,new e("".concat(r,"/").concat(i),n,{head:F(F({},o),{},{ownerId:a,lastEdit:s,handle:l})})}))}))}},{key:"getAttributeName",value:function(e){var t;return null===(t=uniweb.config.data.attributeTypes)||void 0===t?void 0:t[e]}},{key:"parseAsSimpleData",value:function(t,n){var r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=i?{}:[],a=_(t);try{for(a.s();!(r=a.n()).done;){var s,l=r.value,Q=[],v=l.max_item_count?parseInt(l.max_item_count):null,c=_(l.items);try{for(c.s();!(s=c.n()).done;){var u=s.value,A={id:u.id};for(var p in u.attributes){var m=e.getAttributeName(p);m&&(A["_"+m]=u.attributes[p])}for(var f in u.values){var d=l.fields[f],h=u.values[f];if("section"==d.type){var g=l.subsections[d.subsection_id];g.items=h,h=e.parseAsSimpleData([g],n,!1)}else if(h&&"localstr"==d.type)h=n.localize(h);else if(h&&"json"==d.type)h="string"==typeof h?JSON.parse(h):h;else if(!h||"systable"!=d.type&&"lov"!=d.type){if(h&&"reftable"===d.type)h=(h=h[1]).split("|").map((function(e){return["not required","non requis"].includes(e.toLowerCase())?"":e}));else if(h&&"address"==d.type)h=JSON.parse(h);else if("bilingual"===d.type){var b,w,y=(null===(b=h)||void 0===b?void 0:b.english)||"",x=(null===(w=h)||void 0===w?void 0:w.french)||"";h="en"===e.websiteLang?y:"fr"===e.websiteLang?x||y:""}}else h=h[1];A[d.name]=h}Q.push(A)}}catch(e){c.e(e)}finally{c.f()}Q.length&&1===v&&(Q=Q[0]),i?o[l.name]=Q:o=Q}}catch(e){a.e(e)}finally{a.f()}return o}},{key:"parseAsDisplayData",value:function(t,n){var i,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=o?{}:[],s=0,l=_(t);try{for(l.s();!(i=l.n()).done;){var Q,v=i.value,c=[],u=_(v.items);try{for(u.s();!(Q=u.n()).done;){var A=Q.value,p={};for(var m in A.values){var f=v.fields[m],d=f.type,h=A.values[m];if(h&&"order"!==f.name){var g={label:f.label};if("section"==f.type){var b=v.subsections[f.subsection_id];b.items=h;var w=e.parseAsDisplayData([b],n,!1);g.isSection=!0,g.label=w.label,g.value=w.value}else if("localstr"==d)g.isHTML=!0,g.value=n.localize(h);else if("json"==d)g.isJSON=!0,g.value="string"==typeof h?JSON.parse(h):h;else if("systable"==d||"lov"==d)g.value=h[1],"WebsiteTypes"===f.subtype&&(g.rawValue=h[2]);else if("address"==d)h=JSON.parse(h),g.isAddress=!0,g.rawValue=h,g.value=h.formatted_address;else if("bilingual"===d)g.value=Object.values(h)[0];else if("profile"===d){f.subtype&&(h[6]={_subtype:f.subtype});var y,x=(0,r.WD)(h);x&&(g.isProfile=!0,g.profileId=x[0].contentId,g.rawValue=x,g.value=(null==x||null===(y=x[0])||void 0===y?void 0:y.title)||"")}else g.value="string"==typeof h?h:h.toString();p[f.name]=g}}Object.keys(p).length&&c.push(p)}}catch(e){u.e(e)}finally{u.f()}if(o){var k={label:v.label,value:c};0===s&&(k.isInfo=!0),a[v.name]=k}else a={label:v.label,value:c};s++}}catch(e){l.e(e)}finally{l.f()}return a}},{key:"parseAsRichData",value:function(t){var n,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=i?{}:[],a=_(t);try{for(a.s();!(n=a.n()).done;){var s,l=n.value,Q=[],v=l.max_item_count?parseInt(l.max_item_count):null,c=_(l.items);try{for(c.s();!(s=c.n()).done;){var u=s.value,A={id:u.id,attributes:{},fields:{}};for(var p in u.attributes){var m=e.getAttributeName(p);m&&(A.attributes[m]=u.attributes[p])}for(var f in u.values){var d=l.fields[f],h=u.values[f];if("section"==d.type){var g=l.subsections[d.subsection_id];g.items=h,h=e.parseAsRichData([g],!1)}else h&&"localstr"==d.type?h=(0,r.NC)(h,"",this.activeLang):h&&"json"==d.type?h="string"==typeof h?JSON.parse(h):h:h&&"address"==d.type&&(h=JSON.parse(h));A.fields[d.name]={fieldId:f,value:h}}Q.push(A)}}catch(e){c.e(e)}finally{c.f()}Q.length&&1===v&&(Q=Q[0]),i?o[l.name]=Q:o=Q}}catch(e){a.e(e)}finally{a.f()}return o}},{key:"parseAsSchema",value:function(t){var n,r,i,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=[],s=_(t);try{for(s.s();!(i=s.n()).done;){var l=i.value;for(var Q in r={},l.fields){var v=l.fields[Q];if("section"==v.type){var c=l.subsections[v.subsection_id];n=e.parseAsSchema(c,!1)}else n=F({},v);r[v.name]=n}o?a[l.name]=r:a.push(r)}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"isPlainObject",value:function(e){return"object"===T(e)&&null!==e&&!Array.isArray(e)&&e.constructor===Object}},{key:"indexSectionInfo",value:function(t,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=_(n);try{for(o.s();!(r=o.n()).done;){var a,s=r.value,l=i?i+"/"+s.name:s.name,Q=(null===(a=s.items)||void 0===a?void 0:a.length)||0;t[l]=F(F({},s),{},{itemCount:Q});var v=null;for(var c in s.fields){var u=s.fields[c];if("section"==u.type){var A=s.subsections[u.subsection_id];e.indexSectionInfo(t,[A],l)}else if("profile"==u.type){var p,m,f,d;null!==(p=v)&&void 0!==p||(v={}),null!==(d=(m=v)[f=u.subtype])&&void 0!==d||(m[f]=u.name)}}v&&(t[l].profileLinks=v)}}catch(e){o.e(e)}finally{o.f()}}},{key:"getFilterableFields",value:function(t){var n=E(e.parseProfileType(t),2),i=n[0],o=n[1],a=(0,r.pe)(i,o).filterableFieldNames;return void 0===a?[]:a}},{key:"setWebsiteLanguage",value:function(t){e.websiteLang=t}},{key:"parseProfileType",value:function(e){var t=E(e.split("/"),2),n=t[0],r=t[1];return[n,void 0===r?"profile":r]}},{key:"parseHeadItem",value:function(t){if(!t||!t[0])return null;var n=t[0],r=n.items[0]||{},i={},o=["handle","visibility","last_edit","ownerId","_coverImg"];for(var a in r.attributes){var s=e.getAttributeName(a);if(s){var l,Q=r.attributes[a]||{};"avatar"!=s&&"banner"!==s||(Q=null===(l=Object.values(Q))||void 0===l?void 0:l[0]),i["_"+s]=Q}else o.includes(a)&&(i[a]=r.attributes[a]||"")}for(var v in r.values)i[n.fields[v].name]=r.values[v];return i}},{key:"useCompleteProfile",value:function(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=a.initVal,l=void 0===s?null:s,Q=a.lang,v=void 0===Q?null:Q,c=t(l),u=E(c,2),A=u[0],p=u[1];return n((function(){i&&e.newProfile(r,i,{lang:v}).initialize(p)}),[r,i,o,v]),A&&A.isReady()?A:null}},{key:"calcFinalImageSize",value:function(e){if(window.devicePixelRatio>1){if("xs"===e)return"sm";if("sm"===e)return"md";if("md"===e)return"lg"}return e}},{key:"editableMode",value:function(){return!!uniweb&&!!uniweb.activeUserId()}},{key:"parseMediaLinkValue",value:function(t){var n,i=t.url,o=t.website_type,a=t.link_name,s=(null==o||null===(n=o.other_values)||void 0===n?void 0:n[0])||(null==o?void 0:o.rawValue)||null,l=null==i?void 0:i.value,Q="",v="";if(l&&s){l.startsWith("https://")?Q=l:v=l;var c="";switch(s){case"facebook":c="https://www.facebook.com/";break;case"linkedin":c="https://www.linkedin.com/in/";break;case"medium":c="https://medium.com/";break;case"mendeley":c="https://www.mendeley.com/profiles/";break;case"orcid_page":c="https://orcid.org/";break;case"pinterest":c="https://www.pinterest.com/";break;case"quora":c="https://www.quora.com/profile/";break;case"researchgate":c="https://www.researchgate.net/";break;case"tumblr":c="https://www.tumblr.com/";break;case"twitter":c="https://twitter.com/";break;case"youtube":c="https://www.youtube.com/"}v?Q="".concat(c).concat(v):v=Q.replace(c,"")}return{type:s,url:Q,name:(null==o?void 0:o.value)||"",label:null!=a&&a.value?(0,r.NC)(null==a?void 0:a.value,"",e.websiteLang):"",handle:v}}},{key:"convertTimestampToLocalString",value:function(e){if(!e)return null;if(!Number(e)||!new Date(Number(e)).getTime())return e;var t="en"===uniweb.language()?"en-CA":"fr-CA",n=(e*=1e3,new Date(e).getTimezoneOffset());return new Date(e-60*n*1e3).toISOString(t).slice(0,19).replace("T"," ")}},{key:"getProfileTitleAndCaptionFieldName",value:function(t){var n=E(e.parseProfileType(t),2),i=n[0],o=n[1],a=(0,r.pe)(i,o)||{},s=a.titleFieldName,l=void 0===s?"":s,Q=a.captionFieldName;return{titleFieldName:l,captionFieldName:void 0===Q?"":Q}}}],n&&j(t.prototype,n),s&&j(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();L.websiteLang=null,L.cache={formats:{},profiles:{},queries:{}}},74739:(e,t,n)=>{"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t =e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n Me});var Q=/\s+/,v=/([+\-*\/=<>!&|]+)/,c={"|":1,"&":2,"=":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6,"!":7};function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.keys(t),i=n.minQuoteLevel||0,o=n.splitText||!1,s=n.skipCommas||!0,l=[],v=0,c="",u=!1,A="",m=[],f="",d=0,h=["'",'"',"`","‘","’","“","”"],g=function(e,t){return e===t||["‘","’"].includes(e)&&["‘","’"].includes(t)||["“","”"].includes(e)&&["“","”"].includes(t)};function b(e,t){if(o&&"text"==e){var n,r=a(t.trim().split(Q));try{for(r.s();!(n=r.n()).done;){var i=n.value;s&&(i=p(i)),""!==i&&l.push({type:e,value:i})}}catch(e){r.e(e)}finally{r.f()}}else l.push({type:e,value:t});c=""}function w(e){0===d?(""!==c&&b("text",c),c=e):c+=e}for(;v i?(w(y),u=!0,A=y):u&&g(A,y)?(c+=y,u=!1,0===d&&b("quote",c)):c+=y:(c+=y,m.pop(),f=--d>0?t[m[d-1]]:"",0===d&&b("enclosure",c)),v++}return""!==c&&b("text",c),l}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("string"!=typeof e)return e instanceof Object?i({},e):{};var n=u(e,{"{":"}","(":")"},{minQuoteLevel:1}),r={};function o(e,n,r){var i="Invalid ".concat(e," for snippet: ").concat(r,". Expecting: ").concat(n);t.push(i),console.error(i)}n.length<=1&&o("input","[name arg ...] { ... }",e);for(var a=1;a =t&&","===e[n];)n--;return e.slice(t,n+1)}function m(e){var t,n,r,i,o=[],s=[],l=a(e);try{for(l.s();!(i=l.n()).done;){var Q=i.value;if(Q.isOperator){for(;s.length>0&&c[s[s.length-1]]>=c[Q.value];)t=s.pop(),n=o.pop(),r=o.pop(),o.push("(".concat(t," ").concat(r," ").concat(n,")"));s.push(Q.value)}else o.push(Q.value)}}catch(e){l.e(e)}finally{l.f()}for(;s.length>0;)t=s.pop(),n=o.pop(),r=o.pop(),o.push("(".concat(t," ").concat(r," ").concat(n,")"));return o[0]}function f(e){var t,n=[{type:"text",value:e.name}],r=a(e.args);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(i)}}catch(e){r.e(e)}finally{r.f()}for(var o in e.flags){var s=e.flags[o];!0===s?n.push({type:"text",value:"-"+o}):n.push({type:"text",value:"-"+o+"="},s)}return n}var d=n(89746),h=n(95511),g=["style","locale"];function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e){if(Array.isArray(e))return e}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=B(e);if(t){var i=B(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return k(this,n)}}function k(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},B(e)}function C(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n =e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function N(e,t){if(e){if("string"==typeof e)return U(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(e,t):void 0}}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n >":{prop:"*",desc:!0,date:!0},"#":{currency:"*",row:"*",sep:"*",wrap:"*",unit:"unit",number:["decimal","currency","percent","unit"],string:[],date:["medium","full","long","short","year","ym"],list:[],object:[],json:[],debug:[],range:["open"],citation:["apa","mla","chicago","harvard","vancouver"],text:"string",map:"object",tag:["bold","italic","underline","strikethrough","superscript","subscript","span","h1","h2","h3","h4","h5","h6"]}},M={accessor:{"":{handler:function(e,t,n){var r=n[0],i=n.slice(1);if(!i.length)return r;if(se(r)){if(i.length>1||Qe(i[0])){var o,a=[],s=L(1==i.length?i[0]:i);try{for(s.s();!(o=s.n()).done;){var l=o.value;a.push(e(r,l))}}catch(e){s.e(e)}finally{s.f()}return a}return e(r,i[0])}return 1==i.length?e(r,i[0]):e(r,i)},minArgs:2,spread:!1},".":function(e,t){if(ce(e)&&(e=e.toString()),le(e))return ae(e,t);if(Qe(e)){var n,r={},i=L(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r[o]=ae(o,t)}}catch(e){i.e(e)}finally{i.f()}return r}if(se(e)){var a={};for(var s in e)a[e[s]]=ae(s,t);return a}}},collector:{"":function(e,t,n){var r=Y(n);return r.length?r.reduce(e):""},"++":V,"++!!":function(e,t){return oe(t)?e:e+1}},creator:{"":{handler:function(e,t,n){if(["~","phone","address","ref"].includes(t._name)&&ve(n)){var r=q(t,n);return"phone"===t._name&&(r=r.filter((function(e){return e[0]}))),r.map((function(n){return e(t,n)}))}return e(t,n)},spread:!1},"^":q,"~":function(e,t){return new ke(e,t)},"\\":function(e,t){return new RegExp(t,e)},"@":function(e,t){return new _e(e,t)},"<>":function(e,t){return new Be(e,t)},phone:function(e,t){return new Ce(e,t)},address:function(e,t){return new Ee(e,t)},org:function(e,t){return new Se(e,t)},ref:function(e,t){return new Oe(e,t)},currency:function(e,t){return new Te(e,t)}},filter:{"":function(e,t,n){if(!ve(n))return e(n);for(var r=q({},n),i=[],o=0;o =t.length){if(e.endsWith(t))return e.slice(0,-t.length)}else if(t.startsWith(e))return t.slice(e.length);return e}return null},"%":function(e,t){return t/e*100},"*":function(e,t){return e*t},"/":function(e,t){return ce(e)&&ce(t)?e/t:e.toString().split(t.toString())},">":function(e,t){return e>t},"<":function(e,t){return e =":function(e,t){return e>=t},"<=":function(e,t){return e<=t},"=":ee,"==":function(e,t){return e===t},"!=":function(e,t){return e!=t},"!==":function(e,t){return e!==t}},sorter:{"":function(e,t,n){if(!ve(n))return e(t,n);for(var r=q({},n),i=[],o=0;o >":function(e,t){var n=e.date?te:ne,r=e.desc?-1:1;return t.sort((function(t,i){return r*n(e,t,i)}))}},switcher:{"":function(e,t,n){var r=[],i=[];if("?:"===t._name)r=n,i=n;else{var o=parseInt(t.cases);if(o||(o={"??":2,"???":3}[t._name]||1),o>=n.length)return null;r=n.slice(0,o),i=n.slice(o)}if(ve(r)||ve(i)){for(var a=Math.max(K(r),K(i)),s={sz:a},l=q(s,r),Q=q(s,i),v=[],c=0;cl.length?a.push([].concat(T(l),T(Array(r-l.length).fill(i)))):r =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,g);return new d.Z(t,n,r,i).render()}(t,n);default:return n?(null==n?void 0:n.toString())||"":(console.warn("Cannot format type: ".concat(t.type," for the value ").concat(n)),"")}}(r,j(j({},i),{},P({},e.type,e[e.type]))||{},t),e.title&&le(t)&&(t=de(t,e.locale)),e.aux&&(Qe(t)&&(t=t.join(e.sep||", ")),t=ye(e,t)),e.label&&(Qe(t)&&(t=t.join(e.sep||", ")),!0===e.label&&(e.label=e._params[0]),t=function(e,t){return t||e.force?new Be(e,[["u-inline-value-group",new Be(e,[["label",e.label],["span",t]])]]).format():""}(e,t)),e.heading&&(Qe(t)&&(t=t.join(e.sep||", ")),!0===e.heading&&(e.heading=e._params[0]),t=function(e,t){if(!t&&!e.force)return"";var n=e.level||3;return new Be(e,[["u-value-group",new Be(e,[["h".concat(n),e.heading],["span",t]])]]).format()}(e,t)),e.wrap&&(oe(t)?t="":(!0===e.wrap&&(e.wrap="()"),t=e.wrap[0]+t+e.wrap[1])),t}function ee(e,t){return e==t}function te(e,t,n){var r=re(t),i=re(n);return ue(r)&&ue(i)?Ae(r,"date").getTime()-Ae(i,"date").getTime():ne(e,t,n)}function ne(e,t,n){var r=re(t),i=re(n),o=ce(r),a=ce(i);return o&&a?Number(r)-Number(i):o||a?o?-1:1:("string"!=typeof r&&(r=String(r)),"string"!=typeof i&&(i=String(i)),r.localeCompare(i,e.locale))}function re(e){return Qe(e)?e[0]:e instanceof Map?e.values().next().value:se(e)?e[Object.keys(e)[0]]:e}function ie(e,t,n){for(var r=0;r t.length?n[t.length]:null}function oe(e){return!e||"0"===e||(Array.isArray(e)?0===e.length:!!(e instanceof xe&&"function"==typeof e.isEmpty&&e.isEmpty())||"object"===O(e)&&e.constructor===Object&&0===Object.keys(e).length)}function ae(e,t){for(var n=e.split("."),r=t,i=0;i 2&&void 0!==arguments[2]?arguments[2]:{};switch(t){case"boolean":return!oe(e);case"date":return ue(e)?e instanceof Date?e:new Date(e):null;case"text":case"string":return le(e)?e:W(Y(e));case"list":return Qe(e)?e:se(e)?Y(e):null;case"object":return se(e)?e:null;case"number":return ce(e)?parseFloat(e):ue(e)?Ae(e,"date").getTime():0;case"range":return e instanceof ke?e:Qe(e)?new ke(n,e):se(e)?new ke(n,[e.start,e.end]):new ke(n,[e]);case"tag":return e instanceof Be?e:Qe(e)?new Be(n,[e]):e instanceof xe?new Be(n,[[null,e,null]]):se(e)?new Be(n,[e]):new Be(n,[[null,e,null]])}return e}function pe(e){if(e instanceof xe)return"entity";if(e instanceof Date)return"date";var t=O(e);return"undefined"==t||null===e?"null":"boolean"==t?t:Qe(e)?"list":ce(e)?"number":ue(e)?"date":se(e)?"object":t}function me(e,t){var n,r=[],i=L(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;Qe(o)?o=me(e,o):se(o)&&(o=fe(0,o)),o&&r.push(o)}}catch(e){i.e(e)}finally{i.f()}return r.join(void 0===e.sep?" ":e.sep)}function fe(e,t){return JSON.stringify(t)}function de(e,t){t=ge(t);var n=new Set(["and","or","but","a","an","the","in","on","at","to","for","with","not"]);function r(e){return e.charAt(0).toLocaleUpperCase(t)+e.slice(1).toLocaleLowerCase(t)}return t.toLowerCase().startsWith("en")?e.split(" ").map((function(e,t,i){return 0!==t&&t!==i.length-1&&n.has(e.toLowerCase())?e.toLowerCase():r(e)})).join(" "):r(e)}function he(e){D=e||document.documentElement.getAttribute("lang")||"en"}function ge(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return D||he(),e||D}function be(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return ge(e).split("-")[0].toLowerCase()}function we(e){return{en:"Present",fr:"présent",es:"presente",de:"heute",it:"presente",pt:"presente",zh:"至今",ja:"現在",ko:"현재",ru:"настоящее время",ar:"الحاضر",hi:"वर्तमान",bn:"বর্তমান",id:"sekarang",nl:"heden",pl:"obecnie",ro:"prezent",sv:"nuvarande",tr:"günümüz",uk:"теперішній час",vi:"hiện tại"}[be(e)]}function ye(e,t){return t?new Be(e,[["u-aux",t]]).format():""}var xe=function(){function e(t,n){if(C(this,e),this.flags=j({},t),this.values=Array.isArray(n)?T(n):"object"===O(n)?j({},n):n,this.parsedArgs=null,(this instanceof e?this.constructor:void 0)===e)throw new TypeError("Cannot instantiate BaseEntity directly.")}return S(e,[{key:"format",value:function(){return this.values}},{key:"isEmpty",value:function(){throw new Error("Method 'isEmpty()' must be implemented.")}},{key:"toString",value:function(){throw new Error("Method 'toString()' must be implemented.")}},{key:"getParsedArgs",value:function(e){var t=this;if(this.parsedArgs)return this.parsedArgs;var n={},r=this.getFieldMapping(),i=Object.keys(e);return Object.keys(r).forEach((function(o){var a=r[o];Array.isArray(a)||(a=[a]);var s=[],l=[];a.forEach((function(n){if(Array.isArray(n)){var r=t.applyFunction(e,n);s.push(r),l.push(r)}else s.push(i.includes(n)),l.push((null==e?void 0:e[n])||"")}));var Q=ie(0,s,l);n[o]=Q})),n}},{key:"applyFunction",value:function(e,t){if("."===t.shift()){var n=t[1];if(null==e||!e[n])return!1;var r=e[n],i=t[0];return i||0===i?r[i]:""}return!1}},{key:"getFieldMapping",value:function(){return{}}}]),e}(),_e=function(e){y(n,e);var t=_(n);function n(e,r){var i;C(this,n),i=t.call(this,e,r);var o=Qe(r)?null==r?void 0:r[0]:r;return i.values=se(o)?o:{},i}return S(n,[{key:"toString",value:function(){return this.values[this.flags.lang]}},{key:"isEmpty",value:function(){return!this.values||0===Object.keys(this.values).length}}]),n}(xe),ke=function(e){y(n,e);var t=_(n);function n(e,r){var i;C(this,n),i=t.call(this,e,r);var o=Y(r),a=o[0],s=o[1];return i.givenStart=a,i.givenEnd=s,i.includeStart=!e.open,i.includeEnd=!e.open,i.flags.type||(i.flags.type=pe(a||s)),i.start=Ae(a,"number"),i.end=Ae(s,"number"),i}return S(n,[{key:"contains",value:function(e){if(e instanceof n)return this.overlaps(e);e=Ae(e,"number");var t=this.includeStart?e>=this.start:e>this.start,r=this.includeEnd?e<=this.end:e =this.start:e.end>this.start;return t&&n}},{key:"format",value:function(e){var t=(e=j(j({},e),this.flags)).separator||" – ",n=this.givenStart,r=this.givenEnd;return"date"===e.type?(n=n?Z(e,n):we(e.locale),r=r?Z(e,r):we(e.locale)):"range"!==e.type&&(n=Z(e,n||""),r=Z(e,r||"")),n||r?"".concat(n).concat(t).concat(r):""}},{key:"isEmpty",value:function(){return!this.values||Array.isArray(this.values)&&!this.values.filter(Boolean).length}},{key:"toString",value:function(){return this.format()}}]),n}(xe),Be=function(e){y(n,e);var t=_(n);function n(e,r){var i;C(this,n),i=t.call(this,e,r);var o=e.tag,a=o?Qe(o)?o:[o]:[];return i.markups=r.map((function(e){var t,n,r="",i="",o={};if(Array.isArray(e)){var s=(n=3,w(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(t,n)||N(t,n)||b());r=s[0],i=s[1];var l=s[2];o=void 0===l?{}:l}else"object"===O(e)?(r=e.tag||"",i=e.children||"",o=e.attrs||{}):"string"==typeof e&&(i=e);var Q=r?[].concat(T(a),[r]):T(a);return Q.length||(Q=["span"]),{tag:Q,children:i,attrs:o}})),i}return S(n,[{key:"format",value:function(){var e="",t=["strong","em","u","s","sup","sub"];return this.markups.forEach((function(n){var r=n.tag,i=n.children,o=n.attrs,a=i||"";r.forEach((function(e,n){var r="",i={};switch(e){case"bold":r="strong";break;case"italic":r="em";break;case"underline":r="u";break;case"strikethrough":r="s";break;case"superscript":r="sup";break;case"subscript":r="sub";break;default:r=e}if(t.includes(r)){if(!a)return"";if(a instanceof xe&&a.isEmpty())return""}if(0===n&&(i=o),i&&Object.keys(i).length){r="_self"===r?"span":r;var s=Object.keys(i).reduce((function(e,t){return"".concat(e," ").concat(t,'="').concat(i[t],'"')}),"");a="<".concat(r).concat(s,">").concat(a,"").concat(r,">")}else("span"!==r||a)&&(a="_self"===r?a:"<".concat(r,">").concat(a,"").concat(r,">"))})),e+=a})),e}},{key:"isEmpty",value:function(){return!(1!==this.markups.length||1!==this.markups[0].tag.length||this.markups[0].children||this.markups[0].attrs&&Object.keys(this.markups[0].attrs).length)}},{key:"toString",value:function(){return this.format()}}]),n}(xe),Ce=function(e){y(n,e);var t=_(n);function n(e,r){var i;return C(this,n),(i=t.call(this,e,r)).parsedArgs=i.getParsedArgs((null==r?void 0:r[0])||{}),i}return S(n,[{key:"getFieldMapping",value:function(){return{type:["type","phone_type","telephone_type"],country:["country","country_code","telephone_country","phone_country"],area:["area","area_code","telephone_area","phone_area"],number:["number","telephone_number","phone_number"],ext:["ext","extension","telephone_extension","phone_extension"],start:["start","telephone_start_date","phone_start_date"],end:["end","telephone_end_date","phone_end_date","telephone_expiration_date","phone_expiration_date"]}}},{key:"format",value:function(){if(this.isEmpty())return"";this.flags.link;var e=this.parsedArgs,t=e.type,n=e.country,r=e.ext,i=e.start,o=e.end,a=new ke({},[i,o]).format();return[J([t,":"]),J(["+",n]),this.buildNumber(),J(["x ",r]),a?new Be({},[["u-aux",a]]).format():""].filter(Boolean).join(" ")}},{key:"buildNumber",value:function(){var e=this.parsedArgs,t=e.area,n=e.number;return t||n?J([J(["(",t,") "]),n]):""}},{key:"isEmpty",value:function(){return!this.buildNumber()}},{key:"toString",value:function(){return this.format()}}]),n}(xe),Ee=function(e){y(n,e);var t=_(n);function n(e,r){var i;return C(this,n),(i=t.call(this,e,r)).parsedArgs=i.getParsedArgs(null==r?void 0:r[0]),i}return S(n,[{key:"getFieldMapping",value:function(){return{type:["type","address_type"],line1:["line1","line_1","address_-_line_1","address_line_1"],line2:["line2","line_2","address_-_line_2","address_line_2"],line3:["line3","line_3","address_-_line_3","address_line_3"],line4:["line4","line_4","address_-_line_4","address_line_4"],line5:["line5","line_5","address_-_line_5","address_line_5"],start:["start","address_start_date","start_date"],end:["end","address_end_date","end_date","expiration_date","address_expiration_date"],city:["city","address_city"],province:[[".",0,"location"],"province","address_province","state","address_state"],country:[[".",1,"location"],"country","address_country"],zip:["zip","postal_code","address_zip","address_postal_code","postal_zip_code"]}}},{key:"format",value:function(){if(this.isEmpty())return"";var e=this.parsedArgs,t=e.type,n=e.country,r=e.city,i=e.line1,o=void 0===i?"":i,a=e.line2,s=void 0===a?"":a,l=e.line3,Q=void 0===l?"":l,v=e.line4,c=void 0===v?"":v,u=e.line5,A=void 0===u?"":u,p=e.province,m=e.zip,f=void 0===m?"":m,d=e.start,h=void 0===d?"":d,g=e.end,b=void 0===g?"":g;return[W(0,[" ",Z({tag:"bold",type:"tag",bold:!0},J([t,":"])),W(0,[" ",o,J(["(",new ke({},[h,b]),")"])])]),s,Q,c,A,W(0,[", ",r,W(0,[" ",p,J(["(",n,")"])])]),f].filter(Boolean).join("")}},{key:"isEmpty",value:function(){var e=this.parsedArgs,t=e.country,n=e.city,r=e.line1,i=void 0===r?"":r,o=e.province;return!(t||n||i||o)}},{key:"toString",value:function(){return this.format()}}]),n}(xe),Se=function(e){y(n,e);var t=_(n);function n(e,r){var i;return C(this,n),(i=t.call(this,e,r)).parsedArgs=i.getParsedArgs(null==r?void 0:r[0]),i}return S(n,[{key:"name",get:function(){return this.parsedArgs.organization}},{key:"country",get:function(){return this.parsedArgs.country}},{key:"province",get:function(){return this.parsedArgs.province}},{key:"type",get:function(){return this.parsedArgs.type}},{key:"getFieldMapping",value:function(){return{organization:[[".",0,"organization"],"organization","other_organization","other_organization_type"],country:[[".",1,"organization"]],province:[[".",2,"organization"],"province","organization_province","state","organization_state"],type:[[".",3,"organization"],"type","organization_type"]}}},{key:"format",value:function(){if(this.isEmpty())return"";var e=this.parsedArgs,t=e.type,n=e.organization,r=W(0,[" - ",e.country,e.province,t]);return new Be({},[["u-org",new Be({},[["u-org-name",n],["_self",ye({},r)]])]]).format()}},{key:"isEmpty",value:function(){return!this.parsedArgs.organization}},{key:"toString",value:function(){return this.format()}}]),n}(xe),Oe=function(e){y(n,e);var t=_(n);function n(e,r){return C(this,n),t.call(this,e,Y(r))}return S(n,[{key:"format",value:function(){var e,t=w(e=this.values)||I(e)||N(e)||b(),n=t[0],r=t.slice(1),i=W(0,[" - "].concat(T(r)));return n?new Be({},[["u-ref",new Be({},[["u-ref-name",n],["_self",ye({},i)]])]]).format():""}},{key:"isEmpty",value:function(){return!this.values||!this.values.length}},{key:"toString",value:function(){return this.format()}}]),n}(xe),Te=function(e){y(n,e);var t=_(n);function n(e,r){var i;return C(this,n),(i=t.call(this,e,r)).parsedArgs=i.getParsedArgs(null==r?void 0:r[0]),i}return S(n,[{key:"getFieldMapping",value:function(){return{amount:["amount","currency_amount"],currency:["currency","currency_code"],convertedAmount:["converted_amount","converted_currency_amount"]}}},{key:"format",value:function(){if(this.isEmpty())return"";var e=this.parsedArgs,t=e.amount,n=e.currency,r=e.convertedAmount,i=h.y[n.toLowerCase()],o=[["u-amount",i?new Intl.NumberFormat("".concat(uniweb.language(),"-CA"),{style:"currency",currency:i}).format(t):t]];return n&&o.push(["u-unit",n]),r&&"0"!==r&&o.push(["u-aux",new Intl.NumberFormat("".concat(uniweb.language(),"-CA"),{style:"currency",currency:"CAD"}).format(r)]),new Be({},[["u-currency",new Be({},o)]]).format()}},{key:"isEmpty",value:function(){return!this.parsedArgs.amount}},{key:"toString",value:function(){return this.format()}}]),n}(xe);function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}function Fe(e){return function(e){if(Array.isArray(e))return Le(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Pe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Pe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Pe(e,t){if(e){if("string"==typeof e)return Le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Le(e,t):void 0}}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ne(this,e),this.snippets=A(t),this.functions=n}var t,n;return t=e,n=[{key:"setVariables",value:function(e){this.variables="function"==typeof e?e:function(t){return ae(t,e)}}},{key:"render",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t&&this.setVariables(t);var r,i=u(e,{"{":"}"}),o="",a=je(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;if("enclosure"===s.type){var l=s.value.slice(1,-1);l.startsWith("{")&&l.endsWith("}")&&(l=l.slice(1,-1));try{"string"!=typeof(l=this.evaluateText(l,null,n))&&(l=z("#",{l:!0,sep:", "},[l]))}catch(e){l=e}o+=l}else o+=s.value}}catch(e){a.e(e)}finally{a.f()}return o}},{key:"evaluateText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e=e.trim(),t&&this.setVariables(t),De.test(e)?this.getVariable(e,n):this.evaluateFunction(e,n)}},{key:"evaluateList",value:function(e,t){var n=u(e,{"(":")","[":"]","{":"}"},{minQuoteLevel:-1,splitText:!0});if(!n.length)return"";var r,i=[],o=je(n);try{for(o.s();!(r=o.n()).done;){var a=r.value;i.push(this.evaluateExpression(a,t).value)}}catch(e){o.e(e)}finally{o.f()}return i}},{key:"evaluateObject",value:function(e,t){var n=u(e,{"(":")","[":"]","{":"}"},{minQuoteLevel:-1,splitText:!0});if(!n.length)return"";var r,i,o,a=function(e){var t=0,n="",r="",i=!1,o=new Map;function a(e,t){o.set(r,{type:e,value:t}),i=!1,n=""}function s(e){o.set(e,{type:"text",value:!0}),i=!0,r=e,n=""}for(;t >"},r=n[e[0].value.toLowerCase()];if(!r)return e;e=function(e){var t,n=function(e){var t,n,r,i,o=[],s=a(e);try{for(s.s();!(i=s.n()).done;){var l=i.value;if("text"===l.type)if((t=l.value.split(v)).length<=1)o.push(l);else for(var Q=0;Q !&|".includes(n[0]),"!"===n&&o.push({type:"text",value:""}),o.push({type:"text",value:n,isOperator:r}));else o.push(l)}}catch(e){s.e(e)}finally{s.f()}return o}(e),r=function(e){for(var t=[],n=0,r=!1,i=[];n 0&&Q.unshift.apply(Q,function(e){if(Array.isArray(e))return l(e)}(t=Q.splice(g,1))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||s(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());break}for(var b=Q.shift(),w=0,y=Q;w 1&&void 0!==arguments[1]?arguments[1]:null,n=e.value,r=e.type;if("quote"===r)return{value:n.slice(1,-1),type:r};if("enclosure"===e.type){if(n.startsWith("(")&&n.endsWith(")"))return{value:this.evaluateFunction(n.slice(1,-1),t),type:"function"};if(n.startsWith("[")&&n.endsWith("]"))return{value:this.evaluateList(n.slice(1,-1),t),type:"list"};if(n.startsWith("{")&&n.endsWith("}"))return{value:this.evaluateObject(n.slice(1,-1),t),type:"object"}}return t&&t.has(n)?{value:t.get(n),type:"aux"}:De.test(n)?{value:this.getVariable(n,t),label:this.getVariableMeta(n).label,type:"variable"}:Re.test(n)?{value:parseFloat(n),type:"number"}:{value:this.getError(103,"Invalid expression",n),type:"error"}}},{key:"getVariable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e.startsWith("@"))return this.getVariableMeta(e.slice(1)).label;var n=this.variables(e);if(void 0!==n){var r=this.getVariableMeta(e);return r.type?Ae(n,r.type):n}return t&&t.has(e)?t.get(e):this.snippets.hasOwnProperty(e)?this.callSnippet(e):this.functions.hasOwnProperty(e)?this.callCustomFunction(this.functions[e],[]):"_now"===e?new Date:{true:!0,false:!1,null:null}[e]}},{key:"callSnippet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.snippets[e];return"function"!=typeof r&&(r=this.makeSnippetFunction(r),this.snippets[e]=r),r(t,n)}},{key:"makeSnippetFunction",value:function(e){var t=this,n=e.args||[],r=e.isText,i=e.body,o=e.hasFlags,a=new Map;return function(e,s){o&&a.set("$0",e);for(var l=0;l {"use strict";function r(e,t){for(var n=0;n 1,"There should be at least a property and a value");for(var o=0;o 1||fetch("engine.php?action=getAsyncData").then((function(e){return e.json()})).then((function(e){t.hasData=!0,t.units=null==e?void 0:e.units,t.permissions=null==e?void 0:e.permissions;for(var n=0;n =0}return!1}},{key:"getPermittedUnitIds",value:function(e,t){var n,r=null===(n=this.permissions)||void 0===n?void 0:n[e];return r&&r[t]||[]}},{key:"getPermittedUnits",value:function(e,t){var n,r=[],i={},o=[];for(var a in this.units)n=this.getUnitData(a),this.permission(e,t,a)&&(r.push([a,n.unitName]),i[a]=n);for(var a in i)i[i[a].parentId]||o.push(a);return{options:r,roots:o}}},{key:"getUnitColor",value:function(e){var t;if(!this.unitColors)for(var n in this.unitColors={},this.units)t=this.getUnitData(n),this.unitColors[t.unitName]=this.getUnitColorRecursive(t);return this.unitColors[e]}},{key:"getUnitColorRecursive",value:function(e){return e.color?"#"+e.color:e.parentId?this.getUnitColorRecursive(this.getUnitData(e.parentId)):"#aaa"}},{key:"getUnitId",value:function(e){if(e)for(var t in this.units)if(this.getUnitData(t).urlName==e)return t;return 1}},{key:"getUnitURLName",value:function(e){return this.getUnitData(e).urlName}},{key:"getParentUnitURLName",value:function(e){var t=this.getUnitData(e).parentId;return t?this.getUnitURLName(t):null}},{key:"getUnitNameById",value:function(e){return this.getUnitData(e).unitName}},{key:"getUnitData",value:function(e){var t=this.units[e];return t||(t={}),{id:e,urlName:t[0],parentId:t[1],unitName:t[2],homepage:t[3],title:t[4],visible:"1"==t[5],color:t[6]}}},{key:"getUnitTree",value:function(){var e,t={},n=[];for(var r in this.units)e=this.getUnitData(r),t[r]?(t[r][0]=e.unitName,t[r][2]=e.urlName):t[r]=[e.unitName,[],e.urlName],e.parentId?(t[e.parentId]||(t[e.parentId]=[null,[],null]),t[e.parentId][1].push(r)):n.push(r);for(var i=[],o=0;o =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),B(n),A}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;B(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),A}},e}function c(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){c(o,r,i,a,s,"next",e)}function s(e){c(o,r,i,a,s,"throw",e)}a(void 0)}))}}function A(e,t){for(var n=0;n 1&&void 0!==arguments[1]?arguments[1]:"",r=[e,""];n&&r.push(n),(t=window.history).replaceState.apply(t,r)}},{key:"updateState",value:function(e){var t=window.history.state||{};if(!t.currentIndex){var n=window.history.length,r=this.state.lastUsedUrl,i=this.isSignificantChange(r,e)?n:this.state.lastExitIndex;this.replaceState(g(g({},t),{},{currentIndex:n,exitIndex:i})),this.state={lastUsedUrl:e,lastExitIndex:i,currentIndex:n}}}},{key:"updateChildState",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!t&&null!==(e=this.state)&&void 0!==e&&e.frameReady){var n=window.history.state||{};t=n.currentIndex||window.history.length}else t&&(this.state.frameReady=!0);t&&(this.replaceState({currentIndex:t}),uniweb.messenger.sendToParent("setChildFrameIndex",t))}},{key:"isSignificantChange",value:function(e,t){if(!t.startsWith("/")||!e)return!1;if(e.startsWith("/edit")&&t.startsWith("/edit")||e.startsWith("/view")&&t.startsWith("/view")){var n=function(e){var t=e.match(/^\/(edit|view)(?:\/([^\/]*))?(?:\/([^\/]*))?(?:\/([^\/]*))?/);return t?t.slice(1):null},r=n(e),i=n(t);if(!r||!i)return console.log("One or both URLs do not follow the expected format."),!1;for(var o=r.length>i.length?r:i,a=0;a e.length)&&(t=e.length);for(var n=0,r=new Array(t);n =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function F(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function j(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){F(o,r,i,a,s,"next",e)}function s(e){F(o,r,i,a,s,"throw",e)}a(void 0)}))}}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t 2&&void 0!==arguments[2]?arguments[2]:null,i=this.siteGlobals.defaultComponents,o=r&&i?i[r]:null,a=e&&null!==(n=uniweb.getModule(e)[t])&&void 0!==n?n:o;return a||console.log("Missing ".concat(e?"remote ".concat(e):""," category ").concat(t)),a}},{key:"hasWebsiteRemote",value:function(){return this.hasModule("WebsiteRemote")}},{key:"setWebsiteRemote",value:function(e){var t=e.default;this.addModule("WebsiteRemote",t),this.activeWebsite.remoteSite=e.site||{}}},{key:"changeLanguage",value:function(e){fetch("?lang=".concat(e)).then((function(){"?lang=fr"==window.location.search||"?lang=en"==window.location.search?window.location.search="":window.location.reload()}))}},{key:"canUseWebP",value:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))&&0==e.toDataURL("image/webp").indexOf("data:image/webp")}},{key:"clearMetaFromServer",value:function(){["title","[name='description']","[name='twitter:card']","[name='twitter:title']","[name='twitter:description']","[property='og:title']","[property='og:description']","[property='og:type']"].forEach((function(e){var t=document.querySelector(e);t&&t.parentNode.removeChild(t)}))}},{key:"setContentFormat",value:function(e,t,n){this.data.setAsyncData(e,t,n)}},{key:"uniqueId",value:function(e){var t=(new Date).getTime();return e?e+t:t}},{key:"permittedUnits",value:function(e,t){return this.activeUserId()?this.data.getPermittedUnitIds(e,t):void 0}},{key:"checkUserPermission",value:function(e,t){if(!e)return!0;if(!t){var n=e.split("_"),r=n.shift(),i=n.join("_");return!!this.data.getPermittedUnitIds(r,i).length}var o=t[e];return o&&"0"!=o}},{key:"getActiveUser",value:function(){return this.config.activeUser()}},{key:"activeUserId",value:function(){return this.getActiveUser().id}},{key:"language",value:function(){return this.config.activeLanguage()}},{key:"newProfile",value:function(e,t,n){return l.Z.newProfile(e,t,n)}},{key:"getServices",value:function(){return this.services}},{key:"getComponent",value:(v=j(I().mark((function e(t,n){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.components.getComponent(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getProfileRenderer",value:(Q=j(I().mark((function e(t){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.components.getProfileRenderer(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return Q.apply(this,arguments)})},{key:"setCookie",value:function(e,t,n){var r,i;n?((i=new Date).setTime(i.getTime()+24*n*60*60*1e3),r="; expires="+i.toGMTString()):r="",document.cookie=e+"="+t+r+"; path=/"}},{key:"deleteCookie",value:function(e){this.setCookie(e,"",-1)}},{key:"getInitSiteInfo",value:function(){return this.config.data.initSite||null}},{key:"getActiveWebsite",value:function(){return this.activeWebsite}},{key:"preloadFont",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",r="https://fonts.googleapis.com/css?family=".concat(encodeURIComponent(e),":").concat(t).concat(n);if(!this.loadedFonts[r]){var i=document.createElement("link");i.href=r,i.rel="stylesheet",document.head.appendChild(i),this.loadedFonts[r]=!0}}},{key:"onErrorResponse",value:function(e){var t=this;if(console.error(e),console.trace(),e.response&&e.response.data){var n=e.response.data.message||e.response.data.error||"Server error";this.errorMessages||(this.errorMessages=[],setTimeout((function(){var e=t.errorMessages.join("\n");t.errorMessages=!1,t.showError&&t.showError(e)}),500)),401!==e.response.status||uniweb.activeUserId(),this.errorMessages.push(n+" [code ".concat(e.response.status,"]"))}}},{key:"onUnhandledRejection",value:function(e){console.error("Unhandled promise rejection:",e.reason)}},{key:"log",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r {"use strict";n.d(t,{Z:()=>ae});var r=n(12012),i=n(52644),o=n(44357),a=n(8053),s=n(75490),l=n(46598);function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}function v(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),B(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;B(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function m(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){m(o,r,i,a,s,"next",e)}function s(e){m(o,r,i,a,s,"throw",e)}a(void 0)}))}}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t o?"ASC"===p?1:-1:0}))),s&&(l=l.slice(0,parseInt(s))),l}},{key:"isFilterable",value:function(e){var t=e.select,n=void 0===t?{}:t,r=n.type,i=void 0===r?"primary":r,o=n.params,a=void 0===o?{}:o;if("primary"===i)return!0;var s=a.mode,l=a.types;return!("all"===s||(void 0===l?[]:l).length>1)}},{key:"fetchAndCache",value:(m=f(p().mark((function t(n){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.fetch(n));case 1:case"end":return t.stop()}}),t)}))),function(e){return m.apply(this,arguments)})},{key:"getDetail",value:function(e,t,n){var r=e.at(t);return n&&r&&(r=Array.isArray(r)?r.map((function(e){return e[n]})):r[n]),r}},{key:"fetch",value:(A=f(p().mark((function t(n){var r,i,o,a,s,l,Q,v,c,u,A,m,f,d,g,b,w,y,x;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.select,i=void 0===r?{}:r,o=n.format,a=void 0===o?{}:o,s=i.type,l=void 0===s?"primary":s,Q=i.detail,v=void 0===Q?{}:Q,c=i.params,u=void 0===c?{}:c,A=v.type,m=void 0===A?"full":A,f=v.params,d=void 0===f?{}:f,g=a.report,b="",w="","partial"===m&&(x=(null===(y=Object.values(d))||void 0===y?void 0:y[0])||{},b=null==x?void 0:x.section,w=null==x?void 0:x.field),t.abrupt("return",e.fetchPrimaryProfiles(n).then((function(t){if("primary"===l){var r=t[0];return"folder/profile"===(r?r.getProfileType():"")?Promise.all(t.map((function(t){return t.folder.getFiles().then((function(n){var r={contentProfile:t};return b&&(r.data=e.getDetail(t,b,w)),r}))}))).then((function(e){return e.flat()})):t.map((function(t){var r={contentProfile:t};return b?r.data=e.getDetail(t,b,w):g&&(r.data=e.getSectionItems(t,g,n)),r}))}if(t.length){var i=t[0].getProfileType(),o=u.mode,a=u.types,s=void 0===a?[]:a,Q=null;if("list/profile"===i?(b="",Q=e.fetchFromList(h(h({},n),{},{mainProfiles:t}))):"folder/profile"===i?(b="",Q=e.fetchFromFolder(h(h({},n),{},{mainProfiles:t}))):(Q=e.fetchLinkedProfiles(h(h({},n),{},{mainProfiles:t})),("all"===o||s.length>1)&&(b="")),Q)return Q.then((function(t){return e.fetchUniqueProfiles(t).map((function(t){var n={contentProfile:t};return b&&(n.data=e.getDetail(t,b,w)),n}))}))}return Promise.resolve([])})));case 7:case"end":return t.stop()}}),t)}))),function(e){return A.apply(this,arguments)})},{key:"fetchUniqueProfiles",value:function(e){var t={};return e.forEach((function(e){var n=e.getProfileType(),r=e.getId(),i="".concat(n,"_").concat(r);t[i]=e})),Object.values(t)}},{key:"fetchPrimaryProfiles",value:(u=f(p().mark((function t(n){var r,i,o,a,s,l,Q,v,c,u,A,m;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.from,i=void 0===r?{}:r,o=n.activeLang,a=n.website,s=i.type,l=i.params,Q=void 0===l?{}:l,"main"===s?v=Promise.resolve([a.getMainProfile()]):"manual"===s?(c=Q.type,u=Q.id,v=e.fetchFromManualSection({activeLang:o,type:c,ids:u})):"dynamic"===s&&(A=Q.mode,m=Q.id,v=e.fetchFromDynamicContent({activeLang:o,mode:A,id:m,website:a})),t.abrupt("return",v);case 4:case"end":return t.stop()}}),t)}))),function(e){return u.apply(this,arguments)})},{key:"fetchFromManualSection",value:(Q=f(p().mark((function e(t){var n,r,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.type,r=t.ids,o=t.activeLang,e.abrupt("return",i.Z.fetchAll(n,r,o).then((function(e){return e})));case 2:case"end":return e.stop()}}),e)}))),function(e){return Q.apply(this,arguments)})},{key:"fetchFromDynamicContent",value:(l=f(p().mark((function t(n){var r,i,o,a,s,l,Q,v,c;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.mode,i=n.id,o=n.activeLang,a=n.website,"current"===r?(Q=a.activePage,(v=Q.getRoute()).includes("/index")||"index"===v?"index"===v?s=a.getPageInfo("/[id]","id"):(c=v.replace("/index","/[id]"),s=a.getPageInfo(c,"id")):s=Q.getPageId()):s="single"===r?a.activePage.getPageId():i,s){t.next=4;break}return t.abrupt("return",Promise.resolve([]));case 4:return l=a.getPageInfo(s,"data_source_info"),t.abrupt("return",e.fetchAndCache(h(h({},l),{},{activeLang:o,website:a})).then((function(t){return e.sortAndFilter(l,t)})).then((function(e){var t=e.map((function(e){return e.contentProfile}));if("single"===r){var n=a.activePage.getTargetDSId(),i=t.filter((function(e){return e.getId()===n||e.getHandle()===n}));if(i.length){var o=i[0];return o.isReady()?[i[0]]:o.initialize().then((function(e){return[e]}))}return[]}if("current"===r){var s=a.activePage.getTargetDSId();return s?t.filter((function(e){return e.getId()!==s&&e.getHandle()!==s})):t}return t})));case 6:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)})},{key:"fetchLinkedProfiles",value:(s=f(p().mark((function t(n){var r,i,o,a,s,l,Q,u,A,m,d,h,g,b,w,y,x;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.select,i=void 0===r?{}:r,o=n.mainProfiles,a=n.activeLang,s=i.params,Q=(l=void 0===s?{}:s).mode,u=l.types,A=void 0===u?[]:u,m=[],d=null==o?void 0:o[0],"all"===Q?(h=d.getSectionsWithRelationFields(),m=[],h.forEach((function(e){var t=e.name,n=e.profileLinks,r=void 0===n?{}:n,i=Object.keys(r);i=i.map((function(e){var n=c(d.findRelationField(e,t),2);return{type:e,section:n[0],field:n[1]}})),m=[].concat(v(m),v(i))}))):"custom"===Q?m=A.map((function(e){var t=c(d.findRelationField(e),2);return{type:e,section:t[0],field:t[1]}})):"specific"===Q&&(g=null==A?void 0:A[0],b=d.findRelationField(g,(null==l?void 0:l.section)||""),w=c(b,2),y=w[0],x=w[1],m=[{type:g,section:y,field:x}]),t.abrupt("return",Promise.all(o.map(function(){var t=f(p().mark((function t(n){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.all(m.map((function(t){var r=t.type,i=t.section,o=t.field,s=n.getLinkedProfiles(r,i,o).map((function(e){return e.getId()}));return e.fetchFromManualSection({type:r,ids:s,activeLang:a})}))).then((function(e){return e.flat()})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())).then((function(e){return e.flat()})));case 7:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)})},{key:"fetchFromFolder",value:(a=f(p().mark((function e(t){var n,r,i,o,a,s,l,Q,v;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.select,r=void 0===n?{}:n,i=t.mainProfiles,o=t.activeLang,a=r.params,l=(s=void 0===a?{}:a).mode,Q=s.types,v={activeLang:o,mode:l,types:void 0===Q?[]:Q},e.abrupt("return",Promise.all(i.map((function(e){return e.folder.getFiles(v).then((function(e){return e}))}))).then((function(e){return e.flat()})));case 5:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"fetchFromList",value:(o=f(p().mark((function t(n){var r,o,a,s,l,Q,v,c,u,A;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.select,o=void 0===r?{}:r,a=n.mainProfiles,s=n.activeLang,l=o.params,v=(Q=void 0===l?{}:l).mode,c=Q.types,u=void 0===c?[]:c,A=a.map((function(e){return e.getId()})),t.abrupt("return",Promise.all(A.map((function(e){return i.Z.getListProfileItems(e)}))).then(function(){var t=f(p().mark((function t(n){var r,i;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},n.forEach((function(e){e.forEach((function(e){var t=e.profile_type,n=e.contentId;("all"===v||"custom"===v&&u.includes(t))&&(r[t]||(r[t]=[]),r[t].push(n))}))})),i=[],Object.keys(r).map((function(t){var n=r[t];i.push(e.fetchFromManualSection({type:t,ids:n,activeLang:s}))})),t.abrupt("return",Promise.all(i).then((function(e){return e.flat()})));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 5:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)})},{key:"getSectionItems",value:function(e,t,n){var r=n.website.getTemplateEngine(),i=t.select,o=t.filter;if(i){var a=r.evaluateText(i,(function(t){return e.getValue(t)}));return o&&Array.isArray(a)&&(a=a.filter((function(e){return r.evaluateText(o,(function(t){return e[t]}))}))),a&&!Array.isArray(a)&&(a=[a]),a}return[]}}],n&&b(t.prototype,n),r&&b(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t 1&&void 0!==arguments[1]?arguments[1]:"transparent",n=e.color,r=void 0===n?"":n,i=e.shade,o=void 0===i?500:i,a=e.opacity,s=void 0===a?100:a;return"white"===r||"black"===r?r:0===parseInt(s)?t:r?"rgba(var(--".concat(r,"-").concat(o,") / ").concat(s/100,")"):t}},{key:"getWrapperProps",value:function(){var e=(this.block.disableTheming()?"":this.block.themeName)||"",t=this.block.standardOptions,n=t.background,r=void 0===n?{}:n,i=t.colors,o=void 0===i?{}:i,a={};if(r){var s=r.mode,l=void 0===s?"color":s;if("color"===l){var Q=(null==r?void 0:r.color)||{};Q.color&&(a["--bg-color"]=this.buildColorVal(Q))}else if("gradient"===l){var v=(null==r?void 0:r.gradient)||{},c=v.start,u=void 0===c?{}:c,A=v.end,p=void 0===A?{}:A,m=v.rotation,f=void 0===m?0:m,d=this.buildColorVal(u),h=this.buildColorVal(p);a["--bg-color"]="linear-gradient(".concat(f,"deg, ").concat(d," 0%, ").concat(h," 100%)")}else"image"!==l&&"video"!==l||(a=x(x({},a),{},{position:"relative",maxWidth:"100%","--bg-color":"transparent"}))}var g=o.paragraph,b=o.heading,w=o.link,y=o.icon,_=o.button;return g&&g.color&&(a["--text-color"]=this.buildColorVal(g)),b&&b.color&&(a["--heading-color"]=this.buildColorVal(b)),w&&w.color&&(a["--link-color"]=this.buildColorVal(w)),y&&y.color&&(a["--icon-color"]=this.buildColorVal(y)),_&&_.color&&(a["--btn-color"]=this.buildColorVal(_)),{id:"Section".concat(this.block.id),style:a,className:e}}},{key:"getBgComponentProps",value:function(){var e=this.block.standardOptions.background,t={};if(e){var n=e.mode,r=void 0===n?"color":n;if("video"===r){var i=(null==e?void 0:e.video)||{},o=i.url,a=void 0===o?"":o,s=i.file,l=(void 0===s?{}:s).src,Q=(void 0===l?"":l)||a;Q&&(t={video:{src:Q}})}else if("image"===r){var v=(null==e?void 0:e.image)||{},c=v.url,u=void 0===c?"":c,A=v.file,p=(void 0===A?{}:A).optSrc,m=u||p;m&&(t={image:{imgPos:!0,url:m}})}}return t}}],n&&k(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||T(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(){S=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function Q(e,t,n,i){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),s=new k(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function v(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=Q;var c={};function u(){}function A(){}function p(){}var m={};l(m,o,(function(){return this}));var f=Object.getPrototypeOf,d=f&&f(f(B([])));d&&d!==t&&n.call(d,o)&&(m=d);var h=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var l=v(e[r],e,o);if("throw"!==l.type){var Q=l.arg,c=Q.value;return c&&"object"==C(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(c).then((function(e){Q.value=e,a(Q)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=y(a,n);if(s){if(s===c)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=v(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=v(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function B(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function O(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function T(e,t){if(e){if("string"==typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 0&&void 0!==arguments[0]?arguments[0]:{},n=this.page.website;if(t.nested){var r,i=(null===(r=this.main.body)||void 0===r?void 0:r.lists)||[],o=i[0];return e.parseNestedLinks(o,n)}var a,s=(null===(a=this.main.body)||void 0===a?void 0:a.links)||[];return s.map((function(e){return{route:n.makeHref(e.href),label:e.label}}))}},{key:"getBlockProperties",value:function(){return this.params||{}}},{key:"getBlockItems",value:function(){var t,n=[],r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=T(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(this.items);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(e.parseBlockItem(i))}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"getBlockInfo",value:function(){var e;return{theme:this.themeName,category:null===(e=this.widget)||void 0===e?void 0:e.category,state:this.state}}},{key:"getNextBlockInfo",value:function(){var e=this.page.getBlockIndex(this);return e>=0?this.page.getBlockInfo(e+1):null}},{key:"disableTheming",value:function(){var e,t;return(null===(e=this.website.getRemoteProps())||void 0===e?void 0:e.disableTheming)||(null===(t=this.state)||void 0===t?void 0:t.disableTheming)}},{key:"hasInput",value:function(){var e=this.contentProfile.info,t=void 0===e?{}:e;return Object.keys(t).length}},{key:"renderInputData",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.input)return null;var r=this.input.profiles;return r.length&&e?(t&&(r=t(r)),n?e(r):r.map((function(t,n){return e(t,n)}))):null}},{key:"getRenderingInput",value:function(){var e;return!this.input||null!==(e=this.input.format)&&void 0!==e&&e.manual?{profiles:[]}:this.input}},{key:"getBlockIdentifier",value:function(){return"".concat(this.page.getPageId(),"_").concat(this.page.options.pathname,"_").concat(this.id)}},{key:"resetInput",value:function(e){this.input=e,this.initBlockContent()}},{key:"stripTags",value:function(e){return l.Z.stripTags(e)}},{key:"fetchInput",value:(i=S().mark((function e(){var t,n,r=this;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.input){e.next=2;break}return e.abrupt("return",Promise.resolve(this.input));case 2:return t=this.contentProfile.info||{},n=new w(t,this.website),e.abrupt("return",n.fetchData().then((function(e){return r.resetInput(n),n})));case 5:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){O(o,n,r,a,s,"next",e)}function s(e){O(o,n,r,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{key:"getChildBlockRenderer",value:function(){return this.website.getChildBlockRenderer()}},{key:"useBlockState",value:function(e,t){var n=this;void 0!==t&&null===this.startState?(this.startState=t,this.state=t):t=this.startState;var r=E(e(t),2),i=r[0],o=r[1];return this.resetStateHook=function(){return o(t)},[i,function(e){return o(n.state=e)}]}}],r=[{key:"parseBlockItem",value:function(e){var t=e.banner,n=e.body,r=e.header,i=(null==r?void 0:r.title)||"",o=(null==r?void 0:r.pretitle)||"",a=(null==r?void 0:r.subtitle)||"",s=(null==r?void 0:r.description)||"",l=(null==n?void 0:n.links)||[],Q=(null==n?void 0:n.imgs)||[];return{banner:t,pretitle:o,title:i,subtitle:a,description:s,paragraphs:(null==n?void 0:n.paragraphs)||[],images:Q,links:l,icons:(null==n?void 0:n.icons)||[],videos:(null==n?void 0:n.videos)||[],lists:(null==n?void 0:n.lists)||[]}}},{key:"parseChildBlocks",value:function(t,n,r){var i=[];return null!=t&&t.size&&Array.from(t).forEach((function(t){var o=E(t,2),a=(o[0],o[1]);if(!a.hidden||"0"===a.hidden){var s=new e(n.website.parseTopicSection(a,r,!0),n);i.push(s)}})),i}}],n&&j(t.prototype,n),r&&j(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();P(L,"parseNestedLinks",(function(e,t){var n=[];return null!=e&&e.length&&e.forEach((function(e){var r=e.links,i=e.lists,o=e.paragraphs,a=r[0],s=i[0],l=o[0],Q="",v="",c=[],u=!0;a?(Q=a.label,v=a.href,s&&(c=L.parseNestedLinks(s,t))):(Q=l,u=!1,s&&(c=L.parseNestedLinks(s,t))),n.push({label:Q,route:t.makeHref(v),child_items:c,hasData:u})})),n}));var N=["activeRoute","targetRoute","pageProps","activeLang"];function U(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=D(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function D(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,N);!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.activeRoute=r,this.targetRoute=i,this.activeLang=a,this.pageProps=o||{},this.options=s||{},this.website=n,this.childBlocks=[],this.blockGroups=null,this.scrollY=0,this.profile=null,Object.preventExtensions(this)}var t,n;return t=e,n=[{key:"getBlockIndex",value:function(e){return this.childBlocks.indexOf(e)}},{key:"getBlockInfo",value:function(e){var t;return null===(t=this.childBlocks[e])||void 0===t?void 0:t.getBlockInfo()}},{key:"createBlock",value:function(e){var t=new L(e,this);return this.childBlocks.push(t),t}},{key:"getRoute",value:function(){return this.activeRoute}},{key:"getRoutes",value:function(){return this.options.fullRoute||{}}},{key:"getTargetRoute",value:function(){return this.targetRoute}},{key:"getTargetDSId",value:function(){var e,t;return(null===(e=this.options)||void 0===e||null===(t=e.activeContent)||void 0===t?void 0:t.targetDSId)||""}},{key:"isIndexPage",value:function(){var e,t,n,r;return(null===(e=this.options)||void 0===e||null===(t=e.activeContent)||void 0===t?void 0:t.data_source_info)&&(null===(n=this.options)||void 0===n||null===(r=n.activeContent)||void 0===r?void 0:r.indexPage)}},{key:"getPageProfile",value:function(){var e,t,n;return null!==(e=this.profile)&&void 0!==e?e:this.profile=new i.Z("docufolio",null===(t=this.options)||void 0===t||null===(n=t.activeContent)||void 0===n?void 0:n.docId)}},{key:"getPageId",value:function(){return this.options.activeContent.id}},{key:"getTemplateId",value:function(){return this.options.template}},{key:"getPageContent",value:function(){return this.options.activeContent}},{key:"getPageBody",value:function(){var e;return null===(e=this.options.activeContent)||void 0===e?void 0:e.sections}},{key:"getLayoutPreferences",value:function(){var e,t,n=null===(e=this.options)||void 0===e||null===(t=e.activeContent)||void 0===t?void 0:t.page_options;return n?JSON.parse(n):{}}},{key:"getPageProps",value:function(){return this.pageProps}},{key:"getPageProp",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(null===(t=this.pageProps)||void 0===t?void 0:t[e])||n}},{key:"getPageTitle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,a.NC)(this.getPageProp("title",e),"",this.activeLang)||e}},{key:"getPageLeadText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,a.NC)(this.getPageProp("lead_text",e),"",this.activeLang)||e}},{key:"getPageHeaderImg",value:function(){return this.getPageProp("header_image","")}},{key:"getPageHeaderImgHiddenState",value:function(){var e=this.getPageProp("hide_header_image","");return e&&"0"!==e}},{key:"getPageOptions",value:function(){var e=this.getPageProp("options","");return e?JSON.parse(e):{}}},{key:"getPageMeta",value:function(){var e=this.options,t=e.title,n=e.description,r=this.pageProps,i=r.title,o=r.lead_text;return{title:(0,a.NC)(i,"",this.activeLang)||t,description:(0,a.NC)(o,"",this.activeLang)||n}}},{key:"createBlockGroup",value:function(e,t){for(var n=[],r=0,i=Array.from(e);r 2&&void 0!==arguments[2]?arguments[2]:0,r=n>0?Date.now()+1e3*n:null;this.store.set(e,{value:t,expiresAt:r})}},{key:"get",value:function(e){var t=this.store.get(e);return t?t.expiresAt&&t.expiresAt =0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev =0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function Y(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Y(o,r,i,a,s,"next",e)}function s(e){Y(o,r,i,a,s,"throw",e)}a(void 0)}))}}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||Z(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){if(e){if("string"==typeof e)return ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ee(e,t):void 0}}function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 2&&void 0!==arguments[2]?arguments[2]:"Website";ie(this,e),this.websiteData=(null==t?void 0:t.websiteData)||null,this.domainsInfo=(null==t?void 0:t.domainsInfo)||{},this.isSitePublic=(null==t?void 0:t.isWebsitePublic)||!1,this.mainProfile=null,this.websiteProfile=null,this.defaultLang=(null===(r=t.langs)||void 0===r?void 0:r[0])||n||"en",this.docufolio=null,this.ga=null,this.activePage=null,this.type=l,this.pageHierarchy=null,this.pageRoutes={},this.rootClassName="",this.remoteSite={},this.initLang((null===(i=this.domainsInfo)||void 0===i||null===(o=i.info)||void 0===o?void 0:o.lang)||this.getPrimaryLang()),this.initDocuments(),this.pages=new K,this.activePath=null,this.timeStep=0,this.defineConstProperty("siteId",(null===(a=this.domainsInfo.info)||void 0===a?void 0:a.siteId)||(null==t||null===(s=t.initSite)||void 0===s?void 0:s.siteId)),this.layout={},Object.preventExtensions(this)}var t,n,l,Q,v,c;return t=e,n=[{key:"initLang",value:function(e){this.websiteLang=e,i.Z.setWebsiteLanguage(e),this.initGA()}},{key:"setLang",value:function(e){this.initLang(e),this.getMainProfile().resetComputedData(),this.resetDocuments()}},{key:"initDocuments",value:function(){var e,t=this,n=(null===(e=this.websiteData)||void 0===e?void 0:e.documents)||[];n.length&&(this.websiteData.documents=n.map((function(e){var n=e.pages;return{docId:e.docId,pages:t.initPageRoutes(n)}})))}},{key:"initPageRoutes",value:function(e){var t=this,n=this.getLanguage();return e.map((function(e){var r=(null==e?void 0:e.child_items)||[],i=(null==e?void 0:e.fullRoute)||{},o=null==i?void 0:i[n];return t.pageRoutes[e.id]=i,ne(ne({},e),{},{route:o,fullRoute:i,child_items:t.initPageRoutes(r,i)})}))}},{key:"resetDocuments",value:function(){var e,t=this,n=(null===(e=this.websiteData)||void 0===e?void 0:e.documents)||[];n.length&&(this.websiteData.documents=n.map((function(e){var n=e.pages;return{docId:e.docId,pages:t.flipPageRoutes(n)}})))}},{key:"flipPageRoutes",value:function(e){var t=this;return e.map((function(e){var n=(null==e?void 0:e.child_items)||[],r=(null==e?void 0:e.fullRoute)||{},i=null==r?void 0:r[t.getLanguage()];return ne(ne({},e),{},{route:i,child_items:t.flipPageRoutes(n)})}))}},{key:"initGA",value:function(){var e=this.getAnalyticId();e&&(G.ZP.initialize(e,{legacyDimensionMetric:!1,debug:!0}),this.ga=G.ZP)}},{key:"getSiteId",value:function(){return this.siteId}},{key:"getDomains",value:function(){return this.domainsInfo.domains}},{key:"getDomainsInfo",value:function(){var e;return null===(e=this.domainsInfo)||void 0===e?void 0:e.info}},{key:"isPublic",value:function(){return this.isSitePublic}},{key:"inPublishedMode",value:function(){var e;return null===(e=this.domainsInfo)||void 0===e?void 0:e.publishedMode}},{key:"getLanguage",value:function(){return this.websiteLang}},{key:"getLanguagePreference",value:function(){var e;return null===(e=this.websiteData)||void 0===e?void 0:e.language}},{key:"getSnippets",value:function(){var e;return(null===(e=this.websiteData)||void 0===e?void 0:e.snippets)||{}}},{key:"getLanguages",value:function(){var e,t=null===(e=this.websiteData)||void 0===e?void 0:e.language;try{return JSON.parse(t)||[]}catch(e){}return[]}},{key:"getPrimaryLang",value:function(){var e,t;return(null===(e=this.getLanguages())||void 0===e||null===(t=e[0])||void 0===t?void 0:t.value)||this.defaultLang}},{key:"getData",value:function(){return this.websiteData||{}}},{key:"getWebsiteProfile",value:function(){if(null===this.websiteProfile){var e,t,n,r,o={_avatar:null===(e=this.getData())||void 0===e||null===(t=e.siteMeta)||void 0===t?void 0:t._avatar,_banner:null===(n=this.getData())||void 0===n||null===(r=n.siteMeta)||void 0===r?void 0:r._banner};this.websiteProfile=new i.Z("website",this.getSiteId(),{head:o})}return this.websiteProfile}},{key:"getDocs",value:function(){var e;return(null===(e=this.websiteData)||void 0===e?void 0:e.documents)||[]}},{key:"getTemplateParams",value:function(){return this.getData().templateParams}},{key:"getDataSource",value:function(){return this.getData().dataSource||{}}},{key:"getDataSourceInfo",value:function(){var e=this.getDataSource(),t=e.type,n=void 0===t?"":t,r=e.id,i=$(n.split("/"),2);return{contentType:i[0],viewType:i[1],id:r}}},{key:"getSearchData",value:(c=X(J().mark((function e(){return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch("website.php?action=getSearchData&siteId=".concat(this.getSiteId(),"&activeLang=").concat(this.getLanguage())).then((function(e){return e.json()})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"getAnalyticId",value:function(){var e;return(0,a.NC)(null===(e=this.getData())||void 0===e?void 0:e.analyticId,"",this.getLanguage(),!0)}},{key:"search",value:function(e){}},{key:"submitEvent",value:function(e,t){this.ga&&(e?this.ga.event(e,t):this.ga.send(t))}},{key:"getWebsiteStructure",value:function(){var e=this;if(null===this.docufolio){var t=this.getData(),n=t.documents,r=void 0===n?[]:n,i=t.layouts,o=void 0===i?{}:i,a=t.template,l=r.map((function(t){var n=t.pages;return{docId:t.docId,pages:e.getFlatPages(n)}}));this.docufolio=new s.Z(l,o,a,this)}return this.docufolio}},{key:"createPage",value:function(e){var t=this.pages.get(e);if(!t){var n=this.getWebsiteStructure().getDocInfo(e,this.getLanguage());t=new H(n,this),this.pages.add(e,t,3600)}return this.activePage=t}},{key:"getPageInfo",value:function(e,t){var n=this.getWebsiteStructure().getPageInfo(e);return t?null==n?void 0:n[t]:n}},{key:"getPageHierarchy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getDocs(),n=[];t.forEach((function(e){var t=e.pages;n=[].concat(W(n),W(t))}));var r=e.nested,i=void 0===r||r;return i||(n=this.getFlatPages(n)),this.getParsedPageHierarchy(n,e)}},{key:"getFlatPages",value:function(e){var t=this,n=[];return e.forEach((function(e){var r=W((null==e?void 0:e.child_items)||[]);delete r.child_items,n.push(e),n=[].concat(W(n),W(t.getFlatPages(r)))})),n}},{key:"getParsedPageHierarchy",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[],o=t.filterEmpty,a=void 0===o||o,s=t.pageOnly,l=void 0!==s&&s,Q=t.dynamicPageOnly,v=void 0!==Q&&Q;e.forEach((function(e,o){var s=e.id,Q=e.label,c=e.child_items,u=e.hidden,A=e.route,p=e.title,m=e.description,f=e.sections,d=e.page_options,h=n.localize(A),g=h.includes("[id]"),b=h.includes("/index"),w=d?JSON.parse(d):{},y=(null==w?void 0:w.hierarchyMode)||"auto";if(!r&&("/"===h||!h&&0===o)||"include"===y||(!u||"0"===u)&&"exclude"!==y&&(!a||n.hasDataInRequiredSections(f))&&!b&&(!l||f.length)&&(!v||g)){var x={id:s,label:n.localize(Q),route:"/"===h?"":h,title:n.localize(p),description:n.localize(m),child_items:c?n.getParsedPageHierarchy(c,t,!0):null,inputs:n.getSectionInputs(f),hasData:!(null==f||!f.length)};g&&(x.route=h.replace("/[id]","")),i.push(x)}}));var c=t.sort;return c?c(i):i}},{key:"getSectionInputs",value:function(e){for(var t=this.getMainProfile(),n=[],r=0;r 1&&void 0!==arguments[1]?arguments[1]:this.getLanguage();return(0,o.e)(e,t)}},{key:"dateFromNow",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLanguage();return(0,o.Zh)((0,o.e)(e,t))}},{key:"localize",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getLanguage();return e instanceof Date?(0,o.p6)(e):(0,a.NC)(e,t,n,!0)}},{key:"isReady",value:function(){return!!this.websiteData}},{key:"initialize",value:(v=X(J().mark((function t(){var n,r,i=arguments;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=i.length>0&&void 0!==i[0]?i[0]:null)||"function"==typeof n){t.next=3;break}throw"Invalid callback";case 3:if(!this.isReady()){t.next=8;break}return n&&n(this),t.abrupt("return",Promise.resolve(this));case 8:return r=this.getSiteId(),t.abrupt("return",e.fetch(r).then((function(e){return n&&n(e),e})).catch((function(e){console.log(e),console.log("Cannot fetch website/".concat(r))})));case 10:case"end":return t.stop()}}),t,this)}))),function(){return v.apply(this,arguments)})},{key:"submitWebsiteForm",value:function(e,t){return(0,a.j0)("website.php",{action:"submitWebsiteForm",siteId:this.getSiteId(),data:t,tag:e})}},{key:"submitInfoData",value:function(e,t){return(0,a.j0)("website.php",{action:"submitInfoData",route:e,data:t})}},{key:"parseTopicSection",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getData().remote,i=this.getLanguage();return this.getWebsiteStructure().parseTopicSection(e,t,r,i,n)}},{key:"findComponent",value:function(e){var t=e.remoteName,n=e.category,r=e.widgetName;return uniweb.getWidget(t,n,r)}},{key:"changeLanguage",value:function(e){var t,n=this;if(this.getLanguage()===e||!this.activePage)return null;var r=this.getDomains(),i=this.activePage.getRoute(),o=(null===(t=this.activePage.getRoutes())||void 0===t?void 0:t[e])||"",a=this.activePage.options.pathname,s=Object.keys(r),l=s.find((function(t){var n;return(null===(n=r[t])||void 0===n?void 0:n.lang)===e})),Q=s.find((function(e){var t;return(null===(t=r[e])||void 0===t?void 0:t.lang)===n.getLanguage()}));i.includes("[id]")&&(i=i.replace("[id]",""),o=o.replace("[id]",""));var v=a.replace(i,o),c="";if(l||Q){var u=l||Q;c="".concat(u.endsWith("/")?u:"".concat(u,"/")).concat(v)}else{var A=window.location.origin,p=window.location.href.replace(A,""),m=p.startsWith("/websites")?"/websites":p.startsWith("/sites")?"/sites":"";c="".concat(A).concat(m,"/").concat(e,"/").concat(this.getSiteId(),"/").concat(v)}window.location.replace(c)}},{key:"getRoutingComponents",value:function(){return uniweb.siteGlobals.routingComponents}},{key:"getComponent",value:function(e){return uniweb.siteGlobals.defaultComponents[e]||null}},{key:"getChildBlockRenderer",value:function(){return uniweb.siteGlobals.childBlockRenderer}},{key:"inProfileTypeSite",value:function(){var e=this.getDataSource().type;return!["docufolio/profile","folder/profile","list/profile"].includes(e)}},{key:"getRemoteLayout",value:function(){return this.remoteSite.Layout||null}},{key:"getRemoteProps",value:function(){return this.remoteSite.props||null}},{key:"getRemoteReportFns",value:function(){var e;return(null===(e=this.websiteData)||void 0===e?void 0:e.functions)||this.remoteSite.report||{}}},{key:"getTemplateEngine",value:function(){return new q.Z(this.getSnippets(),this.getRemoteReportFns())}},{key:"getRootClassName",value:function(){return this.rootClassName}},{key:"setRootClassName",value:function(e){this.rootClassName=e}}],l=[{key:"fetch",value:(Q=X(J().mark((function t(n){var r,i;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={action:"getWebsiteData",contentId:n},i=function(t){return new e({websiteData:t.data,initSite:{siteId:n}},uniweb.language())},t.abrupt("return",a.ZP.get("website.php",{params:r}).then(i));case 3:case"end":return t.stop()}}),t)}))),function(e){return Q.apply(this,arguments)})},{key:"useCompleteWebsite",value:function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=t(null),a=$(o,2),s=a[0],l=a[1];return n((function(){new e({initSite:{siteId:r}},uniweb.language()).initialize(l)}),[r,i]),s&&s.isReady()?s:null}}],n&&oe(t.prototype,n),l&&oe(t,l),Object.defineProperty(t,"prototype",{writable:!1}),e}()},68713:(e,t,n)=>{"use strict";n.d(t,{Gx:()=>y,H3:()=>k,Mn:()=>E,Z7:()=>j,_7:()=>C,b5:()=>L,c6:()=>w,qI:()=>F,uD:()=>S,uK:()=>O});var r=n(24474),i=n.n(r),o=n(43474),a=n.n(o),s=n(8053),l=["itemId","_attributes"],Q=["head","sectionId"];function v(e){var t=function(e,t){if("object"!==A(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==A(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===A(t)?t:String(t)}function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 1&&void 0!==arguments[1]?arguments[1]:{},n=h({action:"getCardList",contentType:e},t);return b.get("ui/cards.php",{params:n}).then((function(e){return{data:e.data}})).catch((function(e){}))}function y(e,t){var n={},r=e.cards,i=void 0===r?[]:r,o=e.filters,a=e.navbar,s=e.options;o&&o.histograms&&(o.histograms.data||[]).forEach((function(e){var r=p(e,4),i=r[0],o=(r[1],r[2]),a=r[3]||t||o.replace("Filter by","No");n[o]||(n[o]={}),n[o][a]||(n[o][a]=[]),n[o][a].push(i)}));var l=a?_(a.data):null;return i.forEach((function(e){e.href&&delete e.href})),{cards:i,filters:n,navbar:l,hierarchicalCards:B(i,null==s?void 0:s.hierarchy)}}b.defaults.headers.patch["Content-Type"]="application/merge-patch+json";var x=function(e,t){var n={};return e.forEach((function(e){var r=p(e,4),i=r[0],o=(r[1],r[2]),a=r[3];n[o]||(n[o]={});var s=a||t||o.replace("Filter by","No");"object"===A(s)&&(s=s.title||s.name||Object.values(s)[0]),n[o][s]||(n[o][s]=[]),n[o][s].push(i)})),{filters:n}},_=function(e){var t=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t.active,i=void 0!==r&&r,o=t.children,a=void 0===o?[]:o,s=t.href,l=t.id,Q=t.opened,v=void 0!==Q&&Q,c=t.value,A=[].concat(u(n),[l]),p={active:i,link:s,name:l,open:v,label:c,subItems:[],itemPath:A};return a.forEach((function(t){p.subItems.push(e(t,A))})),p},n={title:"",items:[]};return e.forEach((function(e){"label"in e?n.title=e.label:n.items.push(t(e))})),n.activeItems=function e(t){var n=[];return t.length&&t.forEach((function(t){var r=t.active,i=t.subItems;r&&(n.push(t),n.push.apply(n,u(e(i))))})),n}(n.items),n},k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.label,r=e.name,i=e.fields,o=e.section_id,a=e.value,s=[],Q=[],v=t.histograms;a.forEach((function(e){var n=e.itemId,r=e._attributes,i=c(e,l),o=!0;if(Object.values(i).forEach((function(e){"profile"===e.type&&(e.value||(o=!1))})),o){var a={itemId:n};r&&(a._attributes={},Object.keys(r).forEach((function(e){a._attributes[e]=Object.values(null==r?void 0:r[e])[0]})));for(var u=0,A=Object.entries(i);u 1&&void 0!==arguments[1]?arguments[1]:"",r=null;return t.length&&t.forEach((function(t){var i,o=t.contentId,a=t.subCards;n&&o==n&&(r=t),null!=a&&a.length&&(r=null!==(i=r)&&void 0!==i?i:e(a,n))})),r},E=function(e,t,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null!==(r=t)&&void 0!==r||(t={}),null!==(i=n)&&void 0!==i||(n={});var s=a()(t),l=S(e,t,n,o);Object.values(s).forEach((function(e){Object.keys(e).forEach((function(t){var n=[];e[t].forEach((function(e){-1!==(null==l?void 0:l.findIndex((function(t){return t.contentId===e})))&&n.push(e)})),e[t]=n}))}));var Q={};return Object.keys(n).forEach((function(r){if("searchText"!==r){var i=n,s=(i[r],c(i,[r].map(v))),l=S(e,t,s,o),u=a()(t);Object.values(u).forEach((function(e){Object.keys(e).forEach((function(t){var n=[];e[t].forEach((function(e){-1!==(null==l?void 0:l.findIndex((function(t){return t.contentId===e})))&&n.push(e)})),e[t]=n}))})),Q[r]=u}})),Object.keys(s).forEach((function(e){Q[e]&&(s[e]=Q[e][e])})),s},S=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!1;if(n&&Object.values(n).forEach((function(e){e&&(i=!0)})),null!=e&&e.length&&i){var o=r?O(e):e;return o.filter((function(e){for(var r in n)if(t[r]){var i=n[r]||"";if(i&&!t[r][i].includes(e.contentId))return!1}else if(!((null==e?void 0:e[r])||"").toLowerCase().includes(n[r].toLowerCase()))return!1;return!0}))}return e},O=function e(t){var n=a()(t),r=[];return n.length&&n.forEach((function(t){var n=t.subCards;r.push(t),t.hasOwnProperty("depth")&&(t.depth=0),null!=n&&n.length&&(r=[].concat(u(r),u(e(n))),delete t.subCards,delete t.open)})),r},T=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=function(e){if("string"!=typeof e)return e;var t=[];return e.split(".").forEach((function(e){e.split(/\[([^}]+)\]/g).forEach((function(e){e.length>0&&t.push(e)}))})),t};t=r(t);for(var i=e,o=0;o 1&&void 0!==arguments[1]?arguments[1]:"profile",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return b.get("profiles.php",{params:{action:"getCardProfiles",contentType:e,viewType:t,filter:n}}).then((function(n){var i=n.data,o=i.cards,a=i.filters,s=I(o,r,e,t);return{cards:s.parsedCards,hierarchicalCards:s.parseHierarchicalCards,filters:a}}))},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"profile",n=arguments.length>2?arguments[2]:void 0;return b.get("profiles.php",{params:{action:"getProfileFieldOptions",contentType:e,viewType:t,fieldInfo:JSON.stringify(n)}}).then((function(n){var r=n.data,i=r.cards,o=r.filters,a=I(i,"",e,t);return{cards:a.parsedCards,hierarchicalCards:a.parseHierarchicalCards,filters:o}}))},P=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t.length&&t.forEach((function(t){var r=t.subCards,i=t.title,o=n?"".concat(n,"/").concat(i):i;t.itemPath=o,e(r,o)}))},L=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"a-z";t.sort((function(e,t){var r=e.title.toLowerCase(),i=t.title.toLowerCase();return"a-z"===n?r.localeCompare(i):i.localeCompare(r)})),t.forEach((function(t){var r;null!==(r=t.subCards)&&void 0!==r&&r.length&&e(t.subCards,n)}))}},8053:(e,t,n)=>{"use strict";n.d(t,{Hm:()=>Ae,B3:()=>K,ZP:()=>x,ge:()=>H,dy:()=>me,Yk:()=>J,kd:()=>Y,PR:()=>W,J0:()=>F,V2:()=>ce,Ai:()=>O,dr:()=>D,nl:()=>R,OB:()=>ue,CO:()=>I,D0:()=>ae,uZ:()=>se,pe:()=>oe,cp:()=>ie,pm:()=>V,lP:()=>T,zM:()=>z,uL:()=>P,mF:()=>q,NC:()=>Qe,Fv:()=>le,a5:()=>pe,Zd:()=>te,HN:()=>o.HN,WD:()=>ne,jk:()=>re,M8:()=>ee,jt:()=>_,j0:()=>C,FU:()=>U,fi:()=>$,xO:()=>ve,QI:()=>M,Cp:()=>X});var r=n(24474),i=n.n(r),o=n(16498),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return e&&(e=e.filter(Boolean)).length?(e=e.map((function(e){return e.trim()}))).join(t):""},s=["contentId","head","sectionId","itemId"],l=["_banner","_avatar"],Q=["_banner","_avatar"],v=["targetProfile"];function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 3&&void 0!==arguments[3]?arguments[3]:"",o=i||"".concat(t);for(var a in n[t])"object"===g(n[t][a])?e(a,n[t],r,"".concat(o,"[").concat(a,"]")):r.append("".concat(o,"[").concat(a,"]"),n[t][a])},B=function(e){var t=new URLSearchParams;return Object.keys(e).forEach((function(n){Array.isArray(e[n])?e[n].forEach((function(r){Array.isArray(r)?console.error("Unhandled case when post request body has array of array"):"object"==g(r)?k(n,e,t,n):t.append("".concat(n,"[]"),r)})):"object"==g(e[n])?k(n,e,t):t.append(n,e[n])})),t};function C(e,t){return _.post(e,B(t))}function E(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"profile",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o={action:"display",editable:n,contentType:e,contentId:isNaN(t)?t:parseInt(t),viewType:r,withFormat:!0};return i&&(o.profileLang=i),y.get("profiles.php",{params:o}).then((function(e){return{data:e.data}})).catch((function(n){return console.warn("Cannot get the profile: "+"".concat(e," ").concat(t)),window.uniweb.onErrorResponse(n),{data:{}}}))}var S=function(e,t){var n={action:"getContentInfo",contentType:e,contentId:isNaN(t)?t:parseInt(t)};return y.get("profiles.php",{params:n})};function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"members",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"profile",a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=E(e,t,r,i);return s.then((function(e){if(e){var t=e.data,r=t.sections,i=t.format,s=t.contentInfo;return(0,o.HN)({sections:r,format:i,contentInfo:s},n,a)}}))}function T(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"profile";return E(e,t,n,r).then((function(e){return e.data}))}function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"members",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"profile",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s={skip:"all",keep:Array.isArray(n)?f(n):[n],ignoreEmpty:!0},l=E(e,t,!1,i,a);return l.then((function(e){if(e){var t=e.data,n=t.sections,i=t.format,a=t.contentInfo;return(0,o.HN)({sections:n,format:i,contentInfo:a},s,r)}}))}function F(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"profile",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5?arguments[5]:void 0;return I(e,n,t,i,r,o).then((function(e){var t,n,r,i=e[0],o=i.section_id,a=i.value;if(null!==(t=a[0])&&void 0!==t&&t._attributes){var s=a[0]._attributes,l=s.banner,Q=s.avatar;n=l?l[Object.keys(l)[0]]:"",r=Q?Q[Object.keys(Q)[0]]:""}return p(p({section_id:o},a[0]),{},{_banner:n,_avatar:r})}))}var j=function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o={action:"getMultiFieldEditOptions",contentType:n,viewType:r};i&&(o.contentId=i);var a={},s=e.map((function(e){return Array.isArray(e)?e[0]:e}));Object.keys(t).forEach((function(e){var n=t[e],r=n.field_id,i=n.subtype_id,o=n.subtype,l=n.type;s.includes(i)&&(a[i]={field_id:r,subtype:o,type:l})}));var l=e.map((function(e){var t=Array.isArray(e)?e[0]:e;return a[t].field_id}));return l.length?y.get("profiles.php",{params:p(p({},o),{},{fieldIds:l})}).then((function(t){return t.data.map((function(t,n){var r=Array.isArray(e[n])?e[n][0]:e[n];return{subtype:a[r].subtype,type:a[r].type,options:t}}))})):{}},P=function(e,t){var n={action:"subtypeOptions",contentType:t},r=e.map((function(e){var t;return t=Array.isArray(e)?p(p({},n),{},{subtypeId:e[0]}):p(p({},n),{},{subtypeId:e}),y.get("profiles.php",{params:t})}));return Promise.all(r).then((function(e){return e.map((function(e){return e.data}))}))},L=function(e){var t=e.map((function(e){var t={action:"getCardList",contentType:"generic",viewType:e};return y.get("ui/cards.php",{params:t})}));return Promise.all(t).then((function(e){return e.map((function(e){return e.data}))}))};function N(e){var t=e.fields,n=e.subsections,r=p({},t);return n&&Object.values(n).forEach((function(e){r=p(p({},r),N(e))})),r}function U(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e.sections,s=e.format,l=e.contentInfo,Q=null===(r=(0,o.HN)({sections:a,format:s,contentInfo:l},!1,!0))||void 0===r?void 0:r[0],v=uniweb.activeUserId();if(Q){var c=Q.cardFileNames,u=Q.subtypeIds,A=(Q.fields,N(Q)),p=v?j(u,A,t,n,i):P(u,t);return Promise.all([p,L(c)]).then((function(e){var t={},n={},r=e[0],i=e[1];return u.forEach((function(e,n){var i,a=r[n];if(v){var s=a.subtype,l=a.options,Q=a.type;i="profile"===Q&&l?s?l.map((function(e){return(0,o.ZZ)(Q,s,e)})).filter(Boolean):re(l):l}else i=a;Array.isArray(e)?t[e[0]]=i:t[e]=i})),c.forEach((function(e,t){n[e]=i[t]})),{section:Q,lovOptions:t,stringCards:n,format:s}}))}console.log("invalid parsed profile item data",Q)}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"profile";return y.get("profiles.php",{params:{action:"getCreationSchema",contentType:e,viewType:t}}).then((function(n){return U(n.data,e,t)}))}function R(e,t,n,r,i,o,a){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",l={action:"edit",editable:!0,contentType:e,contentId:t,viewType:n,section:r,itemId:i,withFormat:!0};return s&&(l.templateId=s),y.get("profiles.php",{params:l}).then((function(r){return U(r.data,e,n,t)}))}function M(e,t,n,r,i,o,a,s){var l=new FormData;return"0"===i||0===i?l.append("action","insert"):l.append("action","update"),l.append("contentType",e),l.append("contentId",t),l.append("viewType",n),l.append("sectionId",r),l.append("itemId",i),o&&l.append("parentItemId",o),a&&l.append("parentFieldId",a),s.forEach((function(e){for(var t=0,n=Object.entries(e);t 1&&void 0!==arguments[1]?arguments[1]:"",r=[];return t.forEach((function(t){var i=t.name,o=t.has_fields,a=t.subsections,s=void 0===a?[]:a,l=n?"".concat(n,"/").concat(i):i;r.push(l),o&&"0"!==o||(r=[].concat(f(r),f(e(Object.values(s),l))))})),r};function z(e){return G(e)}function K(e,t,n){return S(e,t).then((function(e){var t=e.data,r=t.is_owner,i=uniweb.checkUserPermission(n,t);return r||i&&uniweb.activeUserId()}))}function q(e,t){return S(e,t).then((function(e){return e.data.is_owner}))}function V(e,t){return new URLSearchParams(e).get(t)||""}function W(e){var t=V(e,"item"),n=t?t.split(","):["",""];return{sectionId:n[0],itemId:n[1],parentItemId:n[2],parentFieldId:n[3]}}function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i={action:"display",editable:n,contentType:"members",contentId:e,viewType:"cv",withFormat:!0};r&&(i.templateId=r);var a=y.get("profiles.php",{params:i}).then((function(e){return{data:(null==e?void 0:e.data)||{}}})).catch((function(e){}));return a.then((function(e){var n=(null==e?void 0:e.data)||{},r=n.sections,i=n.format,a=n.contentInfo,s=n.validation;return uniweb.setContentFormat("members","cv",i),{sections:(0,o.HN)({sections:r,format:i,contentInfo:a},t),contentInfo:a,format:i,validation:s}}))}function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={action:"getReportsAndTemplates",contentType:"members",viewType:"cv"};return e&&(t.section=e),y.get("schema.php",{params:t}).then((function(e){return{data:e.data}})).catch((function(e){return null}))}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};Object.keys(t).forEach((function(e){var r=t[e].file;n[e]={name:r.name,type:r.type}}));var r=p(p({},e),{},{action:"uploadProfileAssets",fields:JSON.stringify(n)});return C("file_loader.php",r).then((function(e){var n=e.data;return Promise.all(Object.keys(n).map((function(e){var r=n[e],i=r.url,o=r.fields,a=r.info,s=new FormData;Object.keys(o).forEach((function(e){s.append(e,o[e])}));var l=t[e],Q=l.file,v=l.fieldValue;return s.append("Content-Type",Q.type),s.append("file",Q),fetch(i,{method:"POST",body:s}).then((function(t){return t.ok?m({},e,a):{error:m({},e,v)}})).catch((function(t){return{error:m({},e,v)}}))}))).then((function(e){return e}))}))}var $=function(e){var t=e.contentType,n=e.contentId,r=e.viewType,i=e.sectionId,o=e.itemId;return _.post("profiles.php",B({action:"setPrimaryItem",contentType:t,contentId:n,viewType:r,"data[sectionId]":i,"data[itemId]":o}))},Z=function(e,t){var n=t.name,r=t.type,i=t.subtype;if(null==e||!e[n])return null;if("systable"===r)return null==e?void 0:e[n][1];if("address"===r){var o,a,s=null!==(o=null==e?void 0:e[n])&&void 0!==o?o:"";return null===(a=s=s?"string"==typeof s?JSON.parse(s):s:{})||void 0===a?void 0:a.formatted_address}if("profile"!==r)return null==e?void 0:e[n];var l,Q=null==e?void 0:e[n][1],v=oe(i.split("/")[0],i.split("/")[1]).titleFieldName;return"string"==typeof Q&&(Q=JSON.parse(Q)),"string"==typeof v?null===(l=Q)||void 0===l?void 0:l[v]:Array.isArray(v)?v.map((function(e){var t,n=e.split("."),r=n[n.length-1];return null===(t=Q)||void 0===t?void 0:t[r]})).join(" "):void 0},ee=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"profile",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=oe(t,n),o=null==i?void 0:i.titleFieldName,a=(null==i?void 0:i.captionFieldName)||"";o&&!Array.isArray(o)&&(o=[o]),a&&!Array.isArray(a)&&(a=[a]);var l=28;return e.length?C("profiles.php",{action:"getFieldsInSection",sectionId:r,contentType:t,viewType:n}).then((function(t){var n=t.data,r=[],i=[],Q=0;Object.keys(n).forEach((function(e){var t=n[e],s=t.name,v=t.type,c=t.subtype,u=t.label,A=t.constraints;if(A=A?JSON.parse(A):{},o.includes(s))r.push({name:s,label:u,type:v,subtype:c,width:"".concat(l/o.length,"%"),highlight:!0,primary:!0});else if(a&&a.includes(s)||"systable"===v||"string"===v&&A.select){Q++;var p={name:s,label:u,type:v,subtype:c,width:"".concat(100-l)};("systable"===v||"string"===v&&A.select)&&(p.filterable=!0),a.includes(s)?(p.secondary=!0,i.unshift(p)):i.push(p)}}));var v=[].concat(r,f(i.map((function(e){return p(p({},e),{},{width:"".concat((100-l)/Q,"%")})})))),u=e.map((function(e){var t=e.contentId,n=e.head,r=e.sectionId,i=e.itemId,o=c(e,s),a=n&&"string"==typeof n?JSON.parse(n):n||{},l={contentId:t,sectionId:r,itemId:i};v.forEach((function(e){var t=e.name,n=Z(a,e);l[t]=n}));var Q=a._banner,u=a._avatar;return Q&&(l.banner=Q),u&&(l.avatarVersion=u),p(p(p({},l),o),{},{head:a})}));return{filteredFields:v,filteredProfiles:u,titleFieldName:o,captionFieldName:a}})):Promise.resolve({filteredFields:[],filteredProfiles:[],titleFieldName:o,captionFieldName:a})},te=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"profile",r=oe(t,n);return e.map((function(e){var i=e.contentId,o=e.head,s=e.ownerId,Q=o?JSON.parse(o):{},v=Q._banner,A=void 0===v?"":v,p=Q._avatar,m=void 0===p?"":p,f=c(Q,l),d={contentId:i,ownerId:s,head:{}};if("members"===t&&"profile"===n){var h,b;d.title=a([null==f?void 0:f.first_name,null==f?void 0:f.last_name]),d.subtitle=a([null==f||null===(h=f.position_title)||void 0===h?void 0:h[1],null==f||null===(b=f.academic_unit)||void 0===b?void 0:b[1]],", ")}else{var w=null==r?void 0:r.titleFieldName,y=null==r?void 0:r.captionFieldName,x=f[w],_=f[y];x=Array.isArray(x)?x[1]:x,(_=Array.isArray(_)?_[1]:_)&&"object"===g(_)&&(_=[w]in _?_[w]:Object.values(_)[0]),d.title=x,d.subtitle=_}return Object.entries(f).forEach((function(e){var t=u(e,2),n=t[0],r=t[1];Array.isArray(r)?"string"==typeof r[1]?d[n]=r[1]:g(r[1]):d[n]=r})),r.hasBanner&&(d.banner=A),r.hasAvatar&&(d.avatar=m),d}))},ne=function(e){var t=u(e,7),n=t[0],r=t[1],i=t[4],o=void 0===i?"":i,s=t[6],l=void 0===s?{}:s,Q=(null==l?void 0:l._subtype)||"",v=u(Q.split("/"),2),c=v[0],A=v[1],p=void 0===A?"profile":A;if("profile"===p&&r){var m=oe(c,p),f=Qe(null==m?void 0:m.label),d=JSON.parse(r),h={contentId:n,head:d,lastEditTime:o};if("members"===c&&"profile"===p){var b,w;h.title=a([null==d?void 0:d.first_name,null==d?void 0:d.last_name]),h.subtitle=a([null==d||null===(b=d.position_title)||void 0===b?void 0:b[1],null==d||null===(w=d.academic_unit)||void 0===w?void 0:w[1]],", ")}else{var y=null==m?void 0:m.titleFieldName,x=null==m?void 0:m.captionFieldName,_=d[y],k=d[x];_=Array.isArray(_)?_[1]:_,(k=Array.isArray(k)?k[1]:k)&&"object"===g(k)&&(k=[y]in k?k[y]:Object.values(k)[0]),h.title=_,h.subtitle=k}return[h,Q,f]}return null},re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r={};e.forEach((function(e){var t=ne(e);if(t){var n=u(t,3),i=n[0],o=n[1],a=n[2];null!=r&&r[o]||(r[o]={label:a,data:[]}),r[o].data.push(i)}}));var i={};return null!=t&&t.length?t.forEach((function(e){null!=r&&r[e]&&(i[e]=null==r?void 0:r[e])})):i=r,null!=n&&n.length&&n.forEach((function(e){var t=e.type,n=e.id;t in i&&n&&(i[t].data=i[t].data.filter((function(e){return e.contentId!==n})))})),i},ie=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],l=oe(e,t);return y.get("profiles.php",{params:{action:"getProfiles",contentType:e,viewType:t,filter:n,orderBy:i,profileLang:o}}).then((function(n){return n.data.map((function(n){var i=n.contentId,o=n.head,v=n.ownerId,A=n.handle;if(!o)return null;var p=o?JSON.parse(o):{},m=p._banner,f=void 0===m?"":m,d=p._avatar,h=void 0===d?"":d,b=c(p,Q),w={contentId:i,ownerId:v,handle:A,head:{},rawHead:p};if(s.forEach((function(e){w.head[e]=null==p?void 0:p[e]})),r)if("members"===e&&"profile"===t){var y,x;w.title=a([null==b?void 0:b.first_name,null==b?void 0:b.last_name]),w.subtitle=a([null==b||null===(y=b.position_title)||void 0===y?void 0:y[1],null==b||null===(x=b.academic_unit)||void 0===x?void 0:x[1]],", ")}else{var _=null==l?void 0:l.titleFieldName,k=null==l?void 0:l.captionFieldName,B=b[_],C=b[k];B=Array.isArray(B)?B[1]:B,(C=Array.isArray(C)?C[1]:C)&&"object"===g(C)&&(C=[_]in C?C[_]:Object.values(C)[0]),w.title=B,w.subtitle=C}return Object.entries(b).forEach((function(e){var t=u(e,2),n=t[0],r=t[1];Array.isArray(r)?"string"==typeof r[1]?w[n]=r[1]:g(r[1]):w[n]=r})),l.hasBanner&&(w.banner=f),l.hasAvatar&&(w.avatar=h),w})).filter(Boolean)}))},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=uniweb.clientConfigs.menus,r="resources"===e?"equipment":e;if(r&&t)return n["".concat(r,"/").concat(t)];if(r){var i={};return Object.keys(n).forEach((function(e){e.startsWith("".concat(r,"/"))&&(i[e]=n[e])})),i}return n},ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"profile",n=uniweb.clientConfigs.menus;if(e&&t){var r,i=null===(r=n["".concat(e,"/").concat(t)])||void 0===r?void 0:r.tabs;if(null!=i&&i.length){var o=[];return i.forEach((function(e){var t=e.targetProfile,n=c(e,v),r={};if(t){var i=u(t.split("/"),2),a=i[0],s=i[1],l=oe(a,s).filterableFieldNames;null!=l&&l.length&&l.forEach((function(e){var t=e.name,n=e.label,i=e.byProfile,o=Qe(n);if(i){var a=u(i.split("/"),2),s=a[0],l=a[1],Q=oe(s,l).titleFieldName;r[o]=[t,1,Q]}else r[o]=t}))}o.push(p(p({},n),{},{histograms:r}))})),o}}return[]},se=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ";e&&!Array.isArray(e)&&(e=[e]);var i=e.map((function(e){var n,i=e.split("."),o=i[i.length-1],a=(null==t?void 0:t[o])||"";return Array.isArray(a)&&(a=null===(n=a)||void 0===n?void 0:n[1]),"string"==typeof a&&/^\{.*\}$/g.test(a)&&(a=JSON.parse(a)),"object"!==g(a)||Array.isArray(a)||!("en"in a)&&!("fr"in a)?a:Qe(a,Qe(a,"",uniweb.language()),r)}));return n?i.join(n):(null==i?void 0:i[0])||""},o=oe(e,t),a=o.titleFieldName,s=o.captionFieldName,l=o.captionGlue,Q=void 0===l?null:l,v=i(a,n),c=s?i(s,n,Q):"";return{titleField:v,captionField:c}};function le(e){return e.trim().replace(/\s|'/g,"-").normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Qe(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o||uniweb.language(),l=window.uniweb?null===(t=window.uniweb)||void 0===t||null===(n=t.config)||void 0===n||null===(r=n.languages())||void 0===r?void 0:r[0]:"en";if("object"===g(e)&&!Array.isArray(e))return a?(null==e?void 0:e[s])||(null==e?void 0:e[l])||i:(null==e?void 0:e[s])||i;if("string"==typeof e)try{var Q=JSON.parse(e);return"object"===g(Q)?a?(null==Q?void 0:Q[s])||(null==Q?void 0:Q[l])||i:(null==Q?void 0:Q[s])||i:Q}catch(t){return e}return i}function ve(){var e,t,n=location.protocol+"//"+location.host;return!uniweb.activeUserId()||n===(null===(e=uniweb.config.data)||void 0===e||null===(t=e.domainsInfo)||void 0===t?void 0:t.publicDomain)}function ce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r="profiles.php/get/list/profile/".concat(e);t&&(r+="?profileLang=".concat(t));var i=[];return y.get(r).then((function(e){var t=e.data,r=t.search_queries,o=void 0===r?[]:r,a=t.selected_items,s=void 0===a?[]:a,l={},Q=o.map((function(e){var t=e.filter,n=e.profile_type,r=u(n.split("/"),2),i={action:"getProfiles",contentType:r[0],viewType:r[1]};return t&&(i.filter={sql:JSON.parse(t)}),y.get("profiles.php",{params:i}).then((function(e){return e.data.map((function(e){return p(p({},e),{},{profile_type:n})}))}))}));s.forEach((function(e){var t=e.profile_type,n=e.profile_id;l[t]||(l[t]=[]),l[t].push(n)}));var v=Object.keys(l),c=[].concat(f(Q),f(v.map((function(e){var t=l[e],n=u(e.split("/"),2),r=n[0],i=n[1];return y.get("profiles.php",{params:{action:"getProfiles",contentType:r,viewType:i,filter:{sql:["IN","content_id","(".concat(t.join(", "),")")]}}}).then((function(t){return t.data.map((function(t){return p(p({},t),{},{profile_type:e})}))}))}))));return Promise.all(c).then((function(e){if(e.forEach((function(e){i=[].concat(f(i),f(e))})),n&&Object.keys(n).length){var t=[],r=[];i.forEach((function(e){Object.keys(n).includes(e.profile_type)?r.push(e):t.push(e)}));var o={};r.forEach((function(e){var t=e.profile_type;o[t]?o[t].push(e.contentId):o[t]=[e.contentId]}));var a=Object.keys(o).map((function(e){var t=u(e.split("/"),2),r=t[0],i=t[1];return y.get("profiles.php",{params:{action:"getProfilesSectionData",contentType:r,viewType:i,contentIds:o[e],section:n[e].section}})}));return Promise.all(a).then((function(e){return e.forEach((function(e,t){var i=e.data,a=Object.keys(o)[t],s=n[a].section;Object.entries(i).forEach((function(e){var t=u(e,2),n=t[0],i=t[1],o=r.find((function(e){return e.profile_type===a&&e.contentId===n}));o&&(o[s]=i)}))})),[].concat(t,r)}))}return i}))}))}var ue=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r="resources"===e?"equipment":e,i=oe(r,t);return n?null!=i&&i.label_plural?Qe(i.label_plural):"":null!=i&&i.label?Qe(i.label):""},Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=(0,o.HN)(e,t,n),a=e.sections;return a.forEach((function(e){e.items.length||r.push(e.name)})),[i,{empty:r}]};function pe(e){var t,n,r,i=e.section_id,o=e.value;if(null!==(t=o=o[0])&&void 0!==t&&t._attributes){var a=o._attributes,s=a.banner,l=a.avatar;n=s?Object.values(s)[0]:"",r=l?Object.values(l)[0]:""}return p(p({section_id:i},o),{},{_banner:n,_avatar:r})}function me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return e.filter((function(e){var i=e.name,o=e.sectionName;if(t.includes(i))return!1;if(n&&o&&r.length){var a=r.find((function(e){return e.name===o}));if(!a)return!1;if(!a.items.filter((function(e){var t,n,r=(null==e||null===(t=e._attributes)||void 0===t?void 0:t.status)||{};return"Pending"!==((null===(n=Object.values(r))||void 0===n?void 0:n[0])||"")})).length)return!1}return!0}))}},12012:(e,t,n)=>{"use strict";n.d(t,{Av:()=>f,PJ:()=>v,Yo:()=>d,cl:()=>u,dP:()=>h,eT:()=>c,s2:()=>p});var r=n(8053),i=(n(46598),n(44357),["id"]);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 3&&void 0!==arguments[3]?arguments[3]:0,s=Array.from(t),Q="en"===n?"fr":"en",v=0;v 1){var s=t[t.length-2];o=null==i?void 0:i[s]}r.push(a(a({},null==i?void 0:i[n]),{},{parentInfo:o}))})),r},u=function(e,t){if(!t)return new Map;var n=t.split(","),r=new Map,i={};return e.forEach((function(e){i[null==e?void 0:e.id]=a({},e)})),n.forEach((function(e){var t=e.split("/");if(1===t.length){var n,o,s=!(null!=i&&null!==(n=i[e])&&void 0!==n&&null!==(o=n.sections)&&void 0!==o&&o.length);r.set(e,a(a({},null==i?void 0:i[e]),{},{child_items:new Map,isFolder:s}))}else for(var l=0,Q=null;l 1&&void 0!==arguments[1]?arguments[1]:null;return e?null==e||null===(t=e.entries())||void 0===t||null===(n=t.next())||void 0===n||null===(r=n.value)||void 0===r?void 0:r[1]:i},h=function e(t){var n=t.map((function(t){var n=t.id,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,i),o=(null==r?void 0:r.child_items)||{};return Object.keys(o).length&&(r.child_items=e(o)),[n,a({id:n},r)]}));return new Map(n)}},16498:(e,t,n)=>{"use strict";n.d(t,{HN:()=>k,ZZ:()=>b});var r=n(8053),i=["@"];function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t =0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q(e){return f(e)||c(e)||p(e)||A()}function v(e){return function(e){if(Array.isArray(e))return m(e)}(e)||c(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e,t){return f(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||p(e,t)||A()}function A(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0;if(null===n)return{value:null};var v={};switch(e){case"profile":if(!Array.isArray(n))return null;var c=u(n,7),A=c[0],p=c[1],m=c[2],f=c[3],d=c[5],h=c[6];if(!p)return null;var g=n[n.length-1],b=uniweb.config.data.profileTypes,w="string"==typeof p?JSON.parse(p):p,y=null;try{y=g&&"string"==typeof g?JSON.parse(g):g||null}catch(e){}if(!t&&null!=h&&h._subtype){var x,_=(0,r.WD)(n),k="";return{contentId:A,value:k=null===(x=_[0])||void 0===x?void 0:x.title,rawValue:["".concat(h._subtype,"|").concat(A),k,y,m,f]}}switch(t){case"members/system":case"members/profile":var B=w.first_name,C=w.last_name,E=w.position_title,S=w.academic_unit,O=w._banner,T=void 0===O?"":O,I=w._avatar,F=void 0===I?"":I,j="".concat(B," ").concat(C),P=null!=S&&S[1]?(0,r.NC)(S[1],"",a):"",L=null!=E&&E[1]?(0,r.NC)(E[1],"",a):"";return{contentId:A,title:j,subtitle:[L,P].filter(Boolean).join(", "),value:j,rawValue:[A,j,y,m,f],version:F,bannerVersion:T,position:L,unit:P,head:w,handle:d};case"disciplines/profile":var N,U=w.name,D=w.parent_discipline,R=void 0===D?[]:D,M=w._banner,H=Object.values((null==o?void 0:o.status)||{});H=H.length?H[0]:"Connected";var G=(null==R?void 0:R[1])||"";return G&&"string"==typeof G&&(G=JSON.parse(G)),{contentId:A,title:U,subtitle:G&&(null===(N=G)||void 0===N?void 0:N.name)||"",value:"Connected"===H?U:"".concat(U," (").concat(H,")"),rawValue:[A,U,y,m,f],version:M,parent_discipline_name:(null==R?void 0:R[1])||"",head:w,handle:d};case"project/profile":var z,K=w.project_name,q=w.category,V=w._banner;return{contentId:A,title:K,subtitle:q&&(null===(z=q[1])||void 0===z?void 0:z.title)||"",value:K,rawValue:[A,K,y,m,f],version:V||"",head:w,handle:d};default:var W,J,Y=t.split("/")[0],X="".concat(Y,"/profile"),$=b[X],Z=null===(W=b[X])||void 0===W?void 0:W.titleFieldName,ee=null===(J=b[X])||void 0===J?void 0:J.captionFieldName,te=w[Z],ne=w[ee],re=w._banner,ie=void 0===re?"":re,oe=w._avatar,ae=void 0===oe?"":oe;te=Array.isArray(te)?te[1]:te,(ne=Array.isArray(ne)?ne[1]:ne)instanceof Object&&(ne=ne[Z]);var se=(0,r.NC)(te,"",a),le={contentId:A,title:se,subtitle:(0,r.NC)(ne,"",a),value:se,rawValue:[A,se,y,m,f],head:w,handle:d};return null!=$&&$.hasBanner&&null!=$&&$.hasAvatar?(le.version=ae,le.bannerVersion=ie):null!=$&&$.hasBanner?le.version=ie:null!=$&&$.hasAvatar&&(le.version=ae),le}case"systable":case"lov":case"reftable":switch(t){case"MemberProfileHead":var Qe=u(n,10),ve=Qe[0],ce=Qe[1],ue=Qe[2],Ae=Qe[3],pe=Qe[4],me=(Qe[5],Qe[6],Qe[7]),fe=Qe[8],de=Qe[9];return{contentId:ve,title:"".concat(ce," ").concat(ue),subtitle:"".concat(Ae,", ").concat(pe),version:fe,bannerVersion:me,position:Ae,unit:pe,handle:de};case"EquipmentProfileHead":var he=u(n,4),ge=he[0],be=he[1],we=he[2],ye=he[3];return{contentId:ge,title:be,subtitle:we,version:ye,type:we};case"GroupProfileHead":var xe=u(n,4),_e=xe[0],ke=xe[1],Be=xe[2],Ce=xe[3];return{contentId:_e,title:ke,subtitle:Be,version:Ce,type:Be};case"ArticleProfileHead":var Ee=u(n,4),Se=Ee[0],Oe=Ee[1],Te=Ee[2],Ie=Ee[3];return{contentId:Se,title:Oe,subtitle:Te,version:Ie,type:Te};case"DisciplineProfileHead":var Fe=u(n,4),je=Fe[0],Pe=Fe[1],Le=Fe[2],Ne=Fe[3];return{contentId:je,title:Pe,subtitle:Le,version:Ne,parent_discipline_name:Le||""};default:var Ue=Q(n),De=Ue[0],Re=Ue[1],Me=void 0===Re?null:Re,He=Ue.slice(2),Ge={value_id:De};return Me&&(Ge.value=Me),He&&(Ge.other_values=He),Ge}case"bilingual":return n.english&&(v.en=n.english),n.french&&(v.fr=n.french),{value:v};case"localstr":try{v=JSON.parse(n)}catch(e){var ze;l(ze={},uniweb.language(),n),l(ze,"@",{}),v=ze}var Ke=v,qe=Ke["@"],Ve=void 0===qe?{}:qe,We=s(Ke,i);return{value:We,activeValue:We[uniweb.language()],activeLang:uniweb.language(),metadata:Ve};case"address":return{value:JSON.parse(n)};default:return{value:n}}},w=function e(t,n,r){for(var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5?arguments[5]:void 0,s={},l=0,Q=Object.entries(t);l 3&&void 0!==arguments[3]?arguments[3]:{skip:[],keep:[],ignoreEmpty:!1},o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,l=t.name,Q=t.sectionPath,v=t.label,c=t.max_item_count,A=t.section_id,p=t.fields,m=t.has_fields,f=t.disabled,b=t.items,_=t.description,k=t.constraints,B=void 0===k?{}:k,C=t.subsections,E=i.skip,S=i.keep,O=i.ignoreEmpty,T=[],I=[],F=[],j=!1;if(-1!==S.indexOf(l)&&(j=!0),"1"===f)return null;if(("all"===E||-1!==E.indexOf(l))&&!j)return null;if(y(p),x(C),"1"===m)b&&b.forEach((function(e){var t=e.id,r=e.values,i=e.attributes,o={};i&&(!0===i.primary?o._primaryItem=!0:n&&(o._attributes=d(i,n)));var l=a(a({itemId:t},w(p,r,C,null,null==o?void 0:o._attributes,s)),o);T.push(l)})),I=g(p,C),F=h(p,C);else if(null!=b&&b[0])for(var P=b[0],L=P.values,N=P.id,U=0,D=Object.entries(p);U 2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=[],o={},a=e.sections,s=e.format,l=e.contentInfo;return o=t?!0===t?{skip:[],keep:[],ignoreEmpty:!0}:Object.assign({skip:[],keep:[],ignoreEmpty:!1},t):{skip:[],keep:[],ignoreEmpty:!1},a.forEach((function(e){var t=_(e,s,l,o,n,r);t&&i.push(t)})),i}},22692:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Q});var r=n(25202),i=n.n(r),o=n(19619),a=n.n(o),s=n(6162);a()(s.Z,{insert:"head",singleton:!1}),s.Z.locals;var l=i().plugins.config.get("@csl");l.templates.add("chicago",'\n'),l.templates.add("mla",'\n');const Q=i()},6162:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9927),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,"div.admonition {\n border-left: 1px solid #aaaaaa;\n border-right: 1px solid #aaaaaa;\n border-bottom: 1px solid #aaaaaa;\n background: #d4e3ec;\n padding: 12px;\n margin-bottom: 6px;\n}\n#integrator-notes li {\n margin-bottom: 1em;\n background: #efefef;\n padding: 0.5em;\n border-radius: 0.5em;\n}\n.footnote-mark::before {\n content: '[';\n}\n.footnote-mark::after {\n content: ']';\n}\n#cite-menu .menu {\n line-height: 0.5em;\n}\n.footnote-header {\n margin-bottom: 1em;\n}\n.footnote {\n padding-left: 1.3em;\n text-indent: -1.3em;\n margin-bottom: 0.5em;\n}\n.footnote-number {\n background: #dddddd;\n margin-right: 0.2em;\n}\n.footnote-number::before {\n content: '[';\n}\n.footnote-number::after {\n content: ']';\n}\n.citation {\n background: #dddddd;\n}\n#csl-outer-block {\n position: absolute;\n height: 0px;\n max-width: 40em;\n}\n#csl-inner-block {\n max-width: 40em;\n height: 15em;\n position: relative;\n bottom: 17em;\n left: 2em;\n}\n#csl-content-block {\n background: white;\n border: solid black 1px;\n overflow-y: scroll;\n padding: 0.5em;\n box-shadow: 10px 10px 5px #888888;\n}\n.csl-hide {\n -webkit-opacity: 0;\n -moz-opacity: 0;\n opacity: 0;\n transition: all 0.75s ease;\n transition-delay: 0.25s;\n}\n.csl-show {\n -webkit-opacity: 100;\n -moz-opacity: 100;\n opacity: 100;\n transition: all 0.75s ease;\n}\n.csl-entry {\n margin-bottom: 0.5em;\n}\n.csl-left-margin {\n vertical-align: top;\n right: 0.3em;\n top: 0px;\n}\n#dynamic-editing,\n#my-amazing-bibliography {\n padding: 1em;\n border: 1px solid #999999;\n background: #efefef;\n border-radius: 1em;\n margin-bottom: 1em;\n}\n#dynamic-editing p {\n line-height: 2em;\n}\n.citeme {\n display: inline;\n cursor: pointer;\n background: white;\n border: 1px solid #aaaaaa;\n border-radius: 2px;\n margin: 0px 5px 0px 2px;\n padding: 0px 2px 0px 2px;\n}\n#cite-menu {\n position: absolute;\n display: inline-block;\n}\n#cite-menu .menu {\n position: relative;\n top: 0px;\n /* left: 0px; */\n width: 135px;\n background: white;\n padding: 0.5em;\n border: 1px solid black;\n border-radius: 0.5em;\n z-index: 100;\n}\n",""]);const o=i},9927:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o {"use strict";var r,i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function a(e){for(var t=-1,n=0;n {"use strict";n.r(t),n.d(t,{Cite:()=>It,logger:()=>M,plugins:()=>h,util:()=>Q,version:()=>Qn});var r={};n.r(r),n.d(r,{currentVersion:()=>x,retrieveLastVersion:()=>B,retrieveVersion:()=>_,save:()=>C,undo:()=>k});var i={};n.r(i),n.d(i,{defaultOptions:()=>j,options:()=>P});var o={};n.r(o),n.d(o,{dataTypeOf:()=>N,typeOf:()=>L});var a={};n.r(a),n.d(a,{applyGraph:()=>U,removeGraph:()=>D});var s={};n.r(s),n.d(s,{DataParser:()=>te,FormatParser:()=>ne,TypeParser:()=>ee});var l={};n.r(l),n.d(l,{clean:()=>Ae});var Q={};n.r(Q),n.d(Q,{Grammar:()=>Re,Register:()=>De,TokenStack:()=>Ue,Translator:()=>He,deepCopy:()=>be,downgradeCsl:()=>he,fetchFile:()=>Fe,fetchFileAsync:()=>je,fetchId:()=>Le,setUserAgent:()=>Pe,upgradeCsl:()=>de});var v={};n.r(v),n.d(v,{add:()=>ot,addDataParser:()=>et,addTypeParser:()=>W,chain:()=>ze,chainAsync:()=>qe,chainLink:()=>Ke,chainLinkAsync:()=>Ve,data:()=>$e,dataAsync:()=>Ze,get:()=>at,has:()=>lt,hasDataParser:()=>tt,hasTypeParser:()=>J,list:()=>Qt,listDataParser:()=>rt,listTypeParser:()=>X,remove:()=>st,removeDataParser:()=>nt,removeTypeParser:()=>Y,treeTypeParser:()=>$,type:()=>V,typeMatcher:()=>Z,util:()=>vt});var c={};n.r(c),n.d(c,{add:()=>ct,addAsync:()=>ut,reset:()=>mt,set:()=>At,setAsync:()=>pt});var u={};n.r(u),n.d(u,{sort:()=>bt});var A={};n.r(A),n.d(A,{add:()=>yt,format:()=>Bt,has:()=>_t,list:()=>kt,register:()=>wt,remove:()=>xt});var p={};n.r(p),n.d(p,{format:()=>Et,get:()=>St,getIds:()=>Ct});var m={};n.r(m),n.d(m,{async:()=>Ot,validateOptions:()=>F,validateOutputOptions:()=>I});var f={};n.r(f),n.d(f,{add:()=>jt,get:()=>Ut,has:()=>Lt,htmlDict:()=>Dt,list:()=>Nt,register:()=>Ft,remove:()=>Pt,textDict:()=>Rt});var d={};n.r(d),n.d(d,{add:()=>Ht,get:()=>Gt,has:()=>zt,list:()=>qt,remove:()=>Kt});var h={};n.r(h),n.d(h,{add:()=>Jt,config:()=>d,dict:()=>f,has:()=>Xt,input:()=>v,list:()=>$t,output:()=>A,remove:()=>Yt});var g={};n.r(g),n.d(g,{parse:()=>Zt});var b={};n.r(b),n.d(b,{default:()=>tn,parse:()=>tn});var w={};n.r(w),n.d(w,{parse:()=>nn});var y={};function x(){return this.log.length}function _(e=1){if(e<=0||e>this.currentVersion())return null;{const[t,n]=this.log[e-1],r=new this.constructor(JSON.parse(t),JSON.parse(n));return r.log=this.log.slice(0,e),r}}function k(e=1){return this.retrieveVersion(this.currentVersion()-e)}function B(){return this.retrieveVersion(this.currentVersion())}function C(){return this.log.push([JSON.stringify(this.data),JSON.stringify(this._options)]),this}n.r(y),n.d(y,{parse:()=>rn});const E=["real","string"],S=["json","html","string","rtf"],O=["csl","bibtex","bibtxt","citation-*","ris","ndjson"],T=["string","function"];function I(e){if("object"!=typeof e)throw new TypeError("Options not an object!");const{format:t,type:n,style:r,lang:i,append:o,prepend:a}=e;if(t&&!E.includes(t))throw new TypeError(`Option format ("${t}") should be one of: ${E}`);if(n&&!S.includes(n))throw new TypeError(`Option type ("${n}") should be one of: ${S}`);if(r&&!O.includes(r)&&!/^citation/.test(r))throw new TypeError(`Option style ("${r}") should be one of: ${O}`);if(i&&"string"!=typeof i)throw new TypeError("Option lang should be a string, but is a "+typeof i);if(a&&!T.includes(typeof a))throw new TypeError("Option prepend should be a string or a function, but is a "+typeof a);if(o&&!T.includes(typeof o))throw new TypeError("Option append should be a string or a function, but is a "+typeof o);if(/^citation/.test(r)&&"json"===n)throw new Error(`Combination type/style of json/citation-* is not valid: ${n}/${r}`);return!0}function F(e){if("object"!=typeof e)throw new TypeError("Options should be an object");if(e.output)I(e.output);else{if(e.maxChainLength&&"number"!=typeof e.maxChainLength)throw new TypeError("Option maxChainLength should be a number");if(e.forceType&&"string"!=typeof e.forceType)throw new TypeError("Option forceType should be a string");if(null!=e.generateGraph&&"boolean"!=typeof e.generateGraph)throw new TypeError("Option generateGraph should be a boolean");if(null!=e.strict&&"boolean"!=typeof e.strict)throw new TypeError("Option strict should be a boolean");if(null!=e.target&&"string"!=typeof e.target)throw new TypeError("Option target should be a boolean")}return!0}const j={format:"real",type:"json",style:"csl",lang:"en-US"};function P(e,t){return I(e),t&&this.save(),Object.assign(this._options,e),this}function L(e){switch(e){case void 0:return"Undefined";case null:return"Null";default:return e.constructor.name}}function N(e){switch(typeof e){case"string":return"String";case"object":if(Array.isArray(e))return"Array";if("Object"===L(e))return"SimpleObject";if("Null"!==L(e))return"ComplexObject";default:return"Primitive"}}function U(e,t){if(e._graph){const n=t.findIndex((({type:e})=>"@else/list+object"===e));-1!==n&&t.splice(n+1,0,...e._graph.slice(0,-1))}return e._graph=t,e}function D(e){return delete e._graph,e}const R={_output(e,t,n){this._log.push(t,n),this._levels.indexOf(e) R._output(e,t,n);"function"==typeof console.Console?R._console=new console.Console(process.stderr):R._console=console;const M=R,H={},G={},z={};function K(e,t){switch(t){case"Array":return 0===e.length||e.every((e=>"@csl/object"===V(e)))?"@csl/list+object":"@else/list+object";case"SimpleObject":case"ComplexObject":return"@csl/object";default:return"@invalid"}}function q(e=[],t){for(const n of e)if(H[n].predicate(t))return q(H[n].extensions,t)||n}function V(e){const t=N(e);return"Array"===t&&0===e.length?K(e,t):q(G[t],e)||K(e,t)}function W(e,{dataType:t,predicate:n,extends:r}){let i=[];e in z&&(i=z[e],delete z[e],M.debug("[core]",`Subclasses "${i}" finally registered to parent type "${e}"`));const o={predicate:n,extensions:i};if(H[e]=o,r){const t=H[r];t?t.extensions.push(e):(z[r]||(z[r]=[]),z[r].push(e),M.debug("[core]",`Subclass "${e}" is waiting on parent type "${r}"`))}else(G[t]||(G[t]=[])).push(e)}function J(e){return Object.prototype.hasOwnProperty.call(H,e)}function Y(e){delete H[e];const t=[...Object.keys(G).map((e=>G[e])),...Object.keys(H).map((e=>H[e].extensions)).filter((e=>e.length>0))];t.forEach((t=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}))}function X(){return Object.keys(H)}function $(){const e=t=>({name:t,children:H[t].extensions.map(e)});return{name:"Type tree",children:Object.keys(G).map((t=>({name:t,children:G[t].map(e)})))}}const Z=/^(?:@(.+?))(?:\/(?:(.+?)\+)?(?:(.+)))?$/;class ee{constructor(e){var t,n,r,i;t=this,r=["String","Array","SimpleObject","ComplexObject","Primitive"],(n="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n="validDataTypes","string"))?i:i+"")in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.data=e}validateDataType(){const e=this.data.dataType;if(e&&!this.validDataTypes.includes(e))throw new RangeError(`dataType was ${e}; expected one of ${this.validDataTypes}`)}validateParseType(){const e=this.data.predicate;if(e&&!(e instanceof RegExp||"function"==typeof e))throw new TypeError(`predicate was ${typeof e}; expected RegExp or function`)}validateTokenList(){const e=this.data.tokenList;if(e&&"object"!=typeof e)throw new TypeError(`tokenList was ${typeof e}; expected object or RegExp`)}validatePropertyConstraint(){const e=this.data.propertyConstraint;if(e&&"object"!=typeof e)throw new TypeError(`propertyConstraint was ${typeof e}; expected array or object`)}validateElementConstraint(){const e=this.data.elementConstraint;if(e&&"string"!=typeof e)throw new TypeError(`elementConstraint was ${typeof e}; expected string`)}validateExtends(){const e=this.data.extends;if(e&&"string"!=typeof e)throw new TypeError(`extends was ${typeof e}; expected string`)}validate(){if(null===this.data||"object"!=typeof this.data)throw new TypeError(`typeParser was ${typeof this.data}; expected object`);this.validateDataType(),this.validateParseType(),this.validateTokenList(),this.validatePropertyConstraint(),this.validateElementConstraint(),this.validateExtends()}parseTokenList(){let e=this.data.tokenList;if(!e)return[];e instanceof RegExp&&(e={token:e});const{token:t,split:n=/\s+/,trim:r=!0,every:i=!0}=e,o=i?"every":"some";return[e=>(e=>r?e.trim():e)(e).split(n)[o]((e=>t.test(e)))]}parsePropertyConstraint(){return[].concat(this.data.propertyConstraint||[]).map((({props:e,match:t,value:n})=>{switch(e=[].concat(e),t){case"any":case"some":return t=>e.some((e=>e in t&&(!n||n(t[e]))));case"none":return t=>!e.some((e=>e in t&&(!n||n(t[e]))));default:return t=>e.every((e=>e in t&&(!n||n(t[e]))))}}))}parseElementConstraint(){const e=this.data.elementConstraint;return e?[t=>t.every((t=>V(t)===e))]:[]}parsePredicate(){return this.data.predicate instanceof RegExp?[this.data.predicate.test.bind(this.data.predicate)]:this.data.predicate?[this.data.predicate]:[]}getCombinedPredicate(){const e=[...this.parsePredicate(),...this.parseTokenList(),...this.parsePropertyConstraint(),...this.parseElementConstraint()];return 0===e.length?()=>!0:1===e.length?e[0]:t=>e.every((e=>e(t)))}getDataType(){return this.data.dataType?this.data.dataType:this.data.predicate instanceof RegExp||this.data.tokenList?"String":this.data.elementConstraint?"Array":"Primitive"}get dataType(){return this.getDataType()}get predicate(){return this.getCombinedPredicate()}get extends(){return this.data.extends}}class te{constructor(e,{async:t}={}){this.parser=e,this.async=t}validate(){const e=this.parser;if("function"!=typeof e)throw new TypeError(`parser was ${typeof e}; expected function`)}}class ne{constructor(e,t={}){this.format=e,t.parseType&&(this.typeParser=new ee(t.parseType)),t.parse&&(this.dataParser=new te(t.parse,{async:!1})),t.parseAsync&&(this.asyncDataParser=new te(t.parseAsync,{async:!0}))}validateFormat(){const e=this.format;if(!Z.test(e))throw new TypeError(`format name was "${e}"; didn't match expected pattern`)}validate(){this.validateFormat(),this.typeParser&&this.typeParser.validate(),this.dataParser&&this.dataParser.validate(),this.asyncDataParser&&this.asyncDataParser.validate()}}var re=n(69018);function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t