diff --git "a/modules/quill/streamlit_quill/frontend/build/static/js/2.c8ea490a.chunk.js" "b/modules/quill/streamlit_quill/frontend/build/static/js/2.c8ea490a.chunk.js" --- "a/modules/quill/streamlit_quill/frontend/build/static/js/2.c8ea490a.chunk.js" +++ "b/modules/quill/streamlit_quill/frontend/build/static/js/2.c8ea490a.chunk.js" @@ -1,3 +1,3 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:97d22b926da95af6718b9bd9f55dcde25020109c87be4a4773af8ac034f2ce20 -size 1031932 +/*! For license information please see 2.c8ea490a.chunk.js.LICENSE.txt */ +(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[2],[function(t,e,n){t.exports=n(41)},function(t,e,n){"use strict";t.exports=n(35)},function(t,e,n){var r=n(20),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){var r=n(56),i=n(61);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){"use strict";n.d(e,"b",(function(){return hc})),n.d(e,"a",(function(){return cc}));var r={};n.r(r),n.d(r,"memcpy",(function(){return Ut})),n.d(r,"joinUint8Arrays",(function(){return qt})),n.d(r,"toArrayBufferView",(function(){return Vt})),n.d(r,"toInt8Array",(function(){return Ht})),n.d(r,"toInt16Array",(function(){return Yt})),n.d(r,"toInt32Array",(function(){return Wt})),n.d(r,"toBigInt64Array",(function(){return Kt})),n.d(r,"toUint8Array",(function(){return Gt})),n.d(r,"toUint16Array",(function(){return $t})),n.d(r,"toUint32Array",(function(){return Zt})),n.d(r,"toBigUint64Array",(function(){return Xt})),n.d(r,"toFloat32Array",(function(){return Qt})),n.d(r,"toFloat64Array",(function(){return Jt})),n.d(r,"toUint8ClampedArray",(function(){return te})),n.d(r,"toArrayBufferViewIterator",(function(){return ne})),n.d(r,"toInt8ArrayIterator",(function(){return re})),n.d(r,"toInt16ArrayIterator",(function(){return ie})),n.d(r,"toInt32ArrayIterator",(function(){return oe})),n.d(r,"toUint8ArrayIterator",(function(){return ae})),n.d(r,"toUint16ArrayIterator",(function(){return ue})),n.d(r,"toUint32ArrayIterator",(function(){return se})),n.d(r,"toFloat32ArrayIterator",(function(){return le})),n.d(r,"toFloat64ArrayIterator",(function(){return ce})),n.d(r,"toUint8ClampedArrayIterator",(function(){return fe})),n.d(r,"toArrayBufferViewAsyncIterator",(function(){return he})),n.d(r,"toInt8ArrayAsyncIterator",(function(){return de})),n.d(r,"toInt16ArrayAsyncIterator",(function(){return ye})),n.d(r,"toInt32ArrayAsyncIterator",(function(){return ve})),n.d(r,"toUint8ArrayAsyncIterator",(function(){return me})),n.d(r,"toUint16ArrayAsyncIterator",(function(){return be})),n.d(r,"toUint32ArrayAsyncIterator",(function(){return ge})),n.d(r,"toFloat32ArrayAsyncIterator",(function(){return we})),n.d(r,"toFloat64ArrayAsyncIterator",(function(){return xe})),n.d(r,"toUint8ClampedArrayAsyncIterator",(function(){return ke})),n.d(r,"rebaseValueOffsets",(function(){return _e})),n.d(r,"compareArrayLike",(function(){return Se}));var i={};n.r(i),n.d(i,"getBool",(function(){return rn})),n.d(i,"getBit",(function(){return on})),n.d(i,"setBool",(function(){return an})),n.d(i,"truncateBitmap",(function(){return un})),n.d(i,"packBools",(function(){return sn})),n.d(i,"iterateBits",(function(){return ln})),n.d(i,"popcnt_bit_range",(function(){return cn})),n.d(i,"popcnt_array",(function(){return fn})),n.d(i,"popcnt_uint32",(function(){return hn}));var o={};n.r(o),n.d(o,"uint16ToFloat64",(function(){return Br})),n.d(o,"float64ToUint16",(function(){return Lr}));var a={};n.r(a),n.d(a,"isArrowBigNumSymbol",(function(){return qr})),n.d(a,"bignumToString",(function(){return Fr})),n.d(a,"bignumToBigInt",(function(){return Ur})),n.d(a,"BN",(function(){return Zr}));var u={};n.r(u),n.d(u,"clampIndex",(function(){return Li})),n.d(u,"clampRange",(function(){return Pi})),n.d(u,"createElementComparator",(function(){return zi}));var s={};n.r(s),n.d(s,"BaseInt64",(function(){return ta})),n.d(s,"Uint64",(function(){return ea})),n.d(s,"Int64",(function(){return na})),n.d(s,"Int128",(function(){return ra}));var l=n(29),c=n.n(l),f=n(1),h=n.n(f),p=new WeakMap,d=new WeakMap;function y(t){var e=p.get(t);return console.assert(null!=e,"'this' is expected an Event object, but got",t),e}function v(t){null==t.passiveListener?t.event.cancelable&&(t.canceled=!0,"function"===typeof t.event.preventDefault&&t.event.preventDefault()):"undefined"!==typeof console&&"function"===typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",t.passiveListener)}function m(t,e){p.set(this,{eventTarget:t,event:e,eventPhase:2,currentTarget:t,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:e.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});for(var n=Object.keys(e),r=0;r0){for(var t=new Array(arguments.length),e=0;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}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 r,i,o=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function C(t,e,n,r,i,o,a){try{var u=t[o](a),s=u.value}catch(l){return void n(l)}u.done?e(s):Promise.resolve(s).then(r,i)}function B(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){C(o,r,i,a,u,"next",t)}function u(t){C(o,r,i,a,u,"throw",t)}a(void 0)}))}}function L(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P(t,e){for(var n=0;n>>0)+4294967296*this.high},Y.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},Y.Long.ZERO=new Y.Long(0,0),Y.Builder=function(t){if(t)e=t;else var e=1024;this.bb=Y.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},Y.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},Y.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},Y.Builder.prototype.dataBuffer=function(){return this.bb},Y.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},Y.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var n=1+~(this.bb.capacity()-this.space+e)&t-1;this.space=0&&0==this.vtable[e];e--);for(var n=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var r=(n+2)*Y.SIZEOF_SHORT;this.addInt16(r);var i=0,o=this.space;t:for(e=0;e=0;r--)this.writeInt8(n.charCodeAt(r))}this.prep(this.minalign,Y.SIZEOF_INT),this.addOffset(t),this.bb.setPosition(this.space)},Y.Builder.prototype.requiredField=function(t,e){var n=this.bb.capacity()-t,r=n-this.bb.readInt32(n);if(!(0!=this.bb.readInt16(r+e)))throw new Error("FlatBuffers: field "+e+" must be set")},Y.Builder.prototype.startVector=function(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(Y.SIZEOF_INT,t*e),this.prep(n,t*e)},Y.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},Y.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var n=0;n=56320)r=i;else r=(i<<10)+t.charCodeAt(n++)+-56613888;r<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);n=0;for(var o=this.space,a=this.bb.bytes();n>24},Y.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},Y.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},Y.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},Y.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},Y.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},Y.ByteBuffer.prototype.readInt64=function(t){return new Y.Long(this.readInt32(t),this.readInt32(t+4))},Y.ByteBuffer.prototype.readUint64=function(t){return new Y.Long(this.readUint32(t),this.readUint32(t+4))},Y.ByteBuffer.prototype.readFloat32=function(t){return Y.int32[0]=this.readInt32(t),Y.float32[0]},Y.ByteBuffer.prototype.readFloat64=function(t){return Y.int32[Y.isLittleEndian?0:1]=this.readInt32(t),Y.int32[Y.isLittleEndian?1:0]=this.readInt32(t+4),Y.float64[0]},Y.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},Y.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},Y.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},Y.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},Y.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},Y.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},Y.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},Y.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},Y.ByteBuffer.prototype.writeFloat32=function(t,e){Y.float32[0]=e,this.writeInt32(t,Y.int32[0])},Y.ByteBuffer.prototype.writeFloat64=function(t,e){Y.float64[0]=e,this.writeInt32(t,Y.int32[Y.isLittleEndian?0:1]),this.writeInt32(t+4,Y.int32[Y.isLittleEndian?1:0])},Y.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&o)))}return r},Y.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},Y.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+Y.SIZEOF_INT},Y.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},Y.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=Y.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+Y.FILE_IDENTIFIER_LENGTH);for(var e=0;e>6*n)+r];n>0;){var o=e>>6*(n-1);i.push(128|63&o),n-=1}return i}}Z.prototype={decode:function(t,e){var n;n="object"===typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"===typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=K(e),this._streaming||(this._decoder=new Q({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(e.stream);for(var r,i=new G(n),o=[];!i.endOfStream()&&-1!==(r=this._decoder.handler(i,i.read()));)null!==r&&(Array.isArray(r)?o.push.apply(o,r):o.push(r));if(!this._streaming){do{if(-1===(r=this._decoder.handler(i,i.read())))break;null!==r&&(Array.isArray(r)?o.push.apply(o,r):o.push(r))}while(!i.endOfStream());this._decoder=null}return o.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===o[0]?(this._BOMseen=!0,o.shift()):this._BOMseen=!0)),function(t){for(var e="",n=0;n>10),56320+(1023&r)))}return e}(o)}},X.prototype={encode:function(t,e){t=t?String(t):"",e=K(e),this._streaming||(this._encoder=new J(this._options)),this._streaming=Boolean(e.stream);for(var n,r=[],i=new G(function(t){for(var e=String(t),n=e.length,r=0,i=[];r57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)i.push(65533);else{var a=t.charCodeAt(r+1);if(56320<=a&&a<=57343){var u=1023&o,s=1023&a;i.push(65536+(u<<10)+s),r+=1}else i.push(65533)}r+=1}return i}(t));!i.endOfStream()&&-1!==(n=this._encoder.handler(i,i.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);if(!this._streaming){for(;-1!==(n=this._encoder.handler(i,i.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);this._encoder=null}return new Uint8Array(r)}};var tt="function"===typeof Buffer?Buffer:null,et="function"===typeof TextDecoder&&"function"===typeof TextEncoder,nt=function(t){if(et||!tt){var e=new t("utf-8");return function(t){return e.decode(t)}}return function(t){var e=Gt(t),n=e.buffer,r=e.byteOffset,i=e.length;return tt.from(n,r,i).toString()}}("undefined"!==typeof TextDecoder?TextDecoder:Z),rt=function(t){if(et||!tt){var e=new t;return function(t){return e.encode(t)}}return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Gt(tt.from(t,"utf8"))}}("undefined"!==typeof TextEncoder?TextEncoder:X);function it(t,e){return(it=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ot(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&it(t,e)}function at(t){return(at=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ut(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function st(t){return(st="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ct(t,e){return!e||"object"!==st(e)&&"function"!==typeof e?lt(t):e}function ft(t){return function(){var e,n=at(t);if(ut()){var r=at(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return ct(this,e)}}var ht=Object.freeze({done:!0,value:void 0}),pt=function(){function t(e){L(this,t),this._json=e}return j(t,[{key:"schema",get:function(){return this._json.schema}},{key:"batches",get:function(){return this._json.batches||[]}},{key:"dictionaries",get:function(){return this._json.dictionaries||[]}}]),t}(),dt=function(){function t(){L(this,t)}return j(t,[{key:"tee",value:function(){return this._getDOMStream().tee()}},{key:"pipe",value:function(t,e){return this._getNodeStream().pipe(t,e)}},{key:"pipeTo",value:function(t,e){return this._getDOMStream().pipeTo(t,e)}},{key:"pipeThrough",value:function(t,e){return this._getDOMStream().pipeThrough(t,e)}},{key:"_getDOMStream",value:function(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}},{key:"_getNodeStream",value:function(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}]),t}(),yt=function(t){ot(n,t);var e=ft(n);function n(){var t;return L(this,n),(t=e.call(this))._values=[],t.resolvers=[],t._closedPromise=new Promise((function(e){return t._closedPromiseResolve=e})),t}return j(n,[{key:"cancel",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.return(e);case 2:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"write",value:function(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}},{key:"abort",value:function(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}},{key:"close",value:function(){if(this._closedPromiseResolve){for(var t=this.resolvers;t.length>0;)t.shift().resolve(ht);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}},{key:Symbol.asyncIterator,value:function(){return this}},{key:"toDOMStream",value:function(t){return Oe.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}},{key:"toNodeStream",value:function(t){return Oe.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}},{key:"throw",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.abort(e);case 2:return t.abrupt("return",ht);case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"return",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.close();case 2:return t.abrupt("return",ht);case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"read",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.next(e,"read");case 2:return t.abrupt("return",t.sent.value);case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"peek",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.next(e,"peek");case 2:return t.abrupt("return",t.sent.value);case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"next",value:function(){var t=this;return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((function(e,n){t.resolvers.push({resolve:e,reject:n})})):Promise.resolve(ht)}},{key:"_ensureOpen",value:function(){if(this._closedPromiseResolve)return!0;throw new Error("".concat(this," is closed"))}},{key:"closed",get:function(){return this._closedPromise}}]),n}(dt),vt=z(function(){var t=function(){throw new Error("BigInt is not available in this environment")};function e(){throw t()}return e.asIntN=function(){throw t()},e.asUintN=function(){throw t()},"undefined"!==typeof BigInt?[BigInt,!0]:[e,!1]}(),2),mt=vt[0],bt=vt[1],gt=z(function(){var t=function(){throw new Error("BigInt64Array is not available in this environment")};return"undefined"!==typeof BigInt64Array?[BigInt64Array,!0]:[function(){function e(){throw L(this,e),t()}return j(e,null,[{key:"of",value:function(){throw t()}},{key:"from",value:function(){throw t()}},{key:"BYTES_PER_ELEMENT",get:function(){return 8}}]),e}(),!1]}(),2),wt=gt[0],xt=(gt[1],z(function(){var t=function(){throw new Error("BigUint64Array is not available in this environment")};return"undefined"!==typeof BigUint64Array?[BigUint64Array,!0]:[function(){function e(){throw L(this,e),t()}return j(e,null,[{key:"of",value:function(){throw t()}},{key:"from",value:function(){throw t()}},{key:"BYTES_PER_ELEMENT",get:function(){return 8}}]),e}(),!1]}(),2)),kt=xt[0],_t=(xt[1],function(t){return"number"===typeof t}),St=function(t){return"boolean"===typeof t},Tt=function(t){return"function"===typeof t},Ot=function(t){return null!=t&&Object(t)===t},Et=function(t){return Ot(t)&&Tt(t.then)},At=function(t){return Ot(t)&&Tt(t[Symbol.iterator])},Nt=function(t){return Ot(t)&&Tt(t[Symbol.asyncIterator])},It=function(t){return Ot(t)&&Ot(t.schema)},Mt=function(t){return Ot(t)&&"done"in t&&"value"in t},Ct=function(t){return Ot(t)&&Tt(t.stat)&&_t(t.fd)},Bt=function(t){return Ot(t)&&Pt(t.body)},Lt=function(t){return Ot(t)&&Tt(t.abort)&&Tt(t.getWriter)&&!(t instanceof dt)},Pt=function(t){return Ot(t)&&Tt(t.cancel)&&Tt(t.getReader)&&!(t instanceof dt)},jt=function(t){return Ot(t)&&Tt(t.end)&&Tt(t.write)&&St(t.writable)&&!(t instanceof dt)},Dt=function(t){return Ot(t)&&Tt(t.read)&&Tt(t.pipe)&&St(t.readable)&&!(t instanceof dt)},zt=D.mark(ne),Rt=Y.ByteBuffer,Ft="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;function Ut(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.byteLength,i=t.byteLength,o=new Uint8Array(t.buffer,t.byteOffset,i),a=new Uint8Array(e.buffer,e.byteOffset,Math.min(r,i));return o.set(a,n),t}function qt(t,e){for(var n,r,i,o=function(t){for(var e,n,r,i,o,a,u=t[0]?[t[0]]:[],s=0,l=0,c=t.length;++s0)do{if(t[n]!==e[n])return!1}while(++n0&&(r.push(i),u+=i.byteLength),!(e||a<=u)){p.next=22;break}case 16:return p.next=18,s();case 18:h=p.sent,o=h.cmd,a=h.size;case 21:if(a0&&(i.push(o),s+=o.byteLength),!(n||u<=s)){t.next=31;break}case 25:return t.next=27,l();case 27:p=t.sent,a=p.cmd,u=p.size;case 30:if(u0&&(i.push(Gt(o)),s+=o.byteLength),!(n||u<=s)){t.next=31;break}case 25:return t.next=27,l();case 27:p=t.sent,a=p.cmd,u=p.size;case 30:if(u=i)){t.next=2;break}return t.abrupt("return",{done:!1,value:new Uint8Array(n,0,i)});case 2:return t.next=4,e.read(new Uint8Array(n,r,i-r));case 4:if(o=t.sent,a=o.done,u=o.value,!((r+=u.byteLength)0&&(l.push(c),s+=c.byteLength)),!(i||u<=s)){t.next=36;break}case 30:return t.next=32,f();case 32:y=t.sent,a=y.cmd,u=y.size;case 35:if(u=0;n--)t.addInt32(e[n]);return t.endVector()}},{key:"startTypeIdsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endUnion",value:function(t){return t.endObject()}},{key:"createUnion",value:function(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}}]),e}();e.Union=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"bitWidth",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}},{key:"isSigned",value:function(){var t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}}],[{key:"getRootAsInt",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startInt",value:function(t){t.startObject(2)}},{key:"addBitWidth",value:function(t,e){t.addFieldInt32(0,e,0)}},{key:"addIsSigned",value:function(t,e){t.addFieldInt8(1,+e,0)}},{key:"endInt",value:function(t){return t.endObject()}},{key:"createInt",value:function(e,n,r){return t.startInt(e),t.addBitWidth(e,n),t.addIsSigned(e,r),t.endInt(e)}}]),t}();t.Int=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"precision",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.Precision.HALF}}],[{key:"getRootAsFloatingPoint",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startFloatingPoint",value:function(t){t.startObject(1)}},{key:"addPrecision",value:function(e,n){e.addFieldInt16(0,n,t.apache.arrow.flatbuf.Precision.HALF)}},{key:"endFloatingPoint",value:function(t){return t.endObject()}},{key:"createFloatingPoint",value:function(t,n){return e.startFloatingPoint(t),e.addPrecision(t,n),e.endFloatingPoint(t)}}]),e}();e.FloatingPoint=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}}],[{key:"getRootAsUtf8",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startUtf8",value:function(t){t.startObject(0)}},{key:"endUtf8",value:function(t){return t.endObject()}},{key:"createUtf8",value:function(e){return t.startUtf8(e),t.endUtf8(e)}}]),t}();t.Utf8=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}}],[{key:"getRootAsBinary",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startBinary",value:function(t){t.startObject(0)}},{key:"endBinary",value:function(t){return t.endObject()}},{key:"createBinary",value:function(e){return t.startBinary(e),t.endBinary(e)}}]),t}();t.Binary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}}],[{key:"getRootAsLargeUtf8",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startLargeUtf8",value:function(t){t.startObject(0)}},{key:"endLargeUtf8",value:function(t){return t.endObject()}},{key:"createLargeUtf8",value:function(e){return t.startLargeUtf8(e),t.endLargeUtf8(e)}}]),t}();t.LargeUtf8=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}}],[{key:"getRootAsLargeBinary",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startLargeBinary",value:function(t){t.startObject(0)}},{key:"endLargeBinary",value:function(t){return t.endObject()}},{key:"createLargeBinary",value:function(e){return t.startLargeBinary(e),t.endLargeBinary(e)}}]),t}();t.LargeBinary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"byteWidth",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}}],[{key:"getRootAsFixedSizeBinary",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startFixedSizeBinary",value:function(t){t.startObject(1)}},{key:"addByteWidth",value:function(t,e){t.addFieldInt32(0,e,0)}},{key:"endFixedSizeBinary",value:function(t){return t.endObject()}},{key:"createFixedSizeBinary",value:function(e,n){return t.startFixedSizeBinary(e),t.addByteWidth(e,n),t.endFixedSizeBinary(e)}}]),t}();t.FixedSizeBinary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}}],[{key:"getRootAsBool",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startBool",value:function(t){t.startObject(0)}},{key:"endBool",value:function(t){return t.endObject()}},{key:"createBool",value:function(e){return t.startBool(e),t.endBool(e)}}]),t}();t.Bool=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"precision",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}},{key:"scale",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}}],[{key:"getRootAsDecimal",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startDecimal",value:function(t){t.startObject(2)}},{key:"addPrecision",value:function(t,e){t.addFieldInt32(0,e,0)}},{key:"addScale",value:function(t,e){t.addFieldInt32(1,e,0)}},{key:"endDecimal",value:function(t){return t.endObject()}},{key:"createDecimal",value:function(e,n,r){return t.startDecimal(e),t.addPrecision(e,n),t.addScale(e,r),t.endDecimal(e)}}]),t}();t.Decimal=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"unit",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.DateUnit.MILLISECOND}}],[{key:"getRootAsDate",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startDate",value:function(t){t.startObject(1)}},{key:"addUnit",value:function(e,n){e.addFieldInt16(0,n,t.apache.arrow.flatbuf.DateUnit.MILLISECOND)}},{key:"endDate",value:function(t){return t.endObject()}},{key:"createDate",value:function(t,n){return e.startDate(t),e.addUnit(t,n),e.endDate(t)}}]),e}();e.Date=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"unit",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.TimeUnit.MILLISECOND}},{key:"bitWidth",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}}],[{key:"getRootAsTime",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startTime",value:function(t){t.startObject(2)}},{key:"addUnit",value:function(e,n){e.addFieldInt16(0,n,t.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}},{key:"addBitWidth",value:function(t,e){t.addFieldInt32(1,e,32)}},{key:"endTime",value:function(t){return t.endObject()}},{key:"createTime",value:function(t,n,r){return e.startTime(t),e.addUnit(t,n),e.addBitWidth(t,r),e.endTime(t)}}]),e}();e.Time=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"unit",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.TimeUnit.SECOND}},{key:"timezone",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}}],[{key:"getRootAsTimestamp",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startTimestamp",value:function(t){t.startObject(2)}},{key:"addUnit",value:function(e,n){e.addFieldInt16(0,n,t.apache.arrow.flatbuf.TimeUnit.SECOND)}},{key:"addTimezone",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"endTimestamp",value:function(t){return t.endObject()}},{key:"createTimestamp",value:function(t,n,r){return e.startTimestamp(t),e.addUnit(t,n),e.addTimezone(t,r),e.endTimestamp(t)}}]),e}();e.Timestamp=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"unit",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}}],[{key:"getRootAsInterval",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startInterval",value:function(t){t.startObject(1)}},{key:"addUnit",value:function(e,n){e.addFieldInt16(0,n,t.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}},{key:"endInterval",value:function(t){return t.endObject()}},{key:"createInterval",value:function(t,n){return e.startInterval(t),e.addUnit(t,n),e.endInterval(t)}}]),e}();e.Interval=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"unit",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.TimeUnit.MILLISECOND}}],[{key:"getRootAsDuration",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startDuration",value:function(t){t.startObject(1)}},{key:"addUnit",value:function(e,n){e.addFieldInt16(0,n,t.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}},{key:"endDuration",value:function(t){return t.endObject()}},{key:"createDuration",value:function(t,n){return e.startDuration(t),e.addUnit(t,n),e.endDuration(t)}}]),e}();e.Duration=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"key",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"value",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}}],[{key:"getRootAsKeyValue",value:function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startKeyValue",value:function(t){t.startObject(2)}},{key:"addKey",value:function(t,e){t.addFieldOffset(0,e,0)}},{key:"addValue",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"endKeyValue",value:function(t){return t.endObject()}},{key:"createKeyValue",value:function(e,n,r){return t.startKeyValue(e),t.addKey(e,n),t.addValue(e,r),t.endKeyValue(e)}}]),t}();t.KeyValue=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"id",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}},{key:"indexType",value:function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}},{key:"isOrdered",value:function(){var t=this.bb.__offset(this.bb_pos,8);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}}],[{key:"getRootAsDictionaryEncoding",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startDictionaryEncoding",value:function(t){t.startObject(3)}},{key:"addId",value:function(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}},{key:"addIndexType",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"addIsOrdered",value:function(t,e){t.addFieldInt8(2,+e,0)}},{key:"endDictionaryEncoding",value:function(t){return t.endObject()}},{key:"createDictionaryEncoding",value:function(t,n,r,i){return e.startDictionaryEncoding(t),e.addId(t,n),e.addIndexType(t,r),e.addIsOrdered(t,i),e.endDictionaryEncoding(t)}}]),e}();e.DictionaryEncoding=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"nullable",value:function(){var t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"typeType",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):t.apache.arrow.flatbuf.Type.NONE}},{key:"type",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}},{key:"dictionary",value:function(e){var n=this.bb.__offset(this.bb_pos,12);return n?(e||new t.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}},{key:"children",value:function(e,n){var r=this.bb.__offset(this.bb_pos,14);return r?(n||new t.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}},{key:"childrenLength",value:function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"customMetadata",value:function(e,n){var r=this.bb.__offset(this.bb_pos,16);return r?(n||new t.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}},{key:"customMetadataLength",value:function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}}],[{key:"getRootAsField",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startField",value:function(t){t.startObject(7)}},{key:"addName",value:function(t,e){t.addFieldOffset(0,e,0)}},{key:"addNullable",value:function(t,e){t.addFieldInt8(1,+e,0)}},{key:"addTypeType",value:function(e,n){e.addFieldInt8(2,n,t.apache.arrow.flatbuf.Type.NONE)}},{key:"addType",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"addDictionary",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"addChildren",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"createChildrenVector",value:function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}},{key:"startChildrenVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addCustomMetadata",value:function(t,e){t.addFieldOffset(6,e,0)}},{key:"createCustomMetadataVector",value:function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}},{key:"startCustomMetadataVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endField",value:function(t){return t.endObject()}},{key:"createField",value:function(t,n,r,i,o,a,u,s){return e.startField(t),e.addName(t,n),e.addNullable(t,r),e.addTypeType(t,i),e.addType(t,o),e.addDictionary(t,a),e.addChildren(t,u),e.addCustomMetadata(t,s),e.endField(t)}}]),e}();e.Field=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"offset",value:function(){return this.bb.readInt64(this.bb_pos)}},{key:"length",value:function(){return this.bb.readInt64(this.bb_pos+8)}}],[{key:"createBuffer",value:function(t,e,n){return t.prep(8,16),t.writeInt64(n),t.writeInt64(e),t.offset()}}]),t}();t.Buffer=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"endianness",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.Endianness.Little}},{key:"fields",value:function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}},{key:"fieldsLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"customMetadata",value:function(e,n){var r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}},{key:"customMetadataLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}}],[{key:"getRootAsSchema",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startSchema",value:function(t){t.startObject(3)}},{key:"addEndianness",value:function(e,n){e.addFieldInt16(0,n,t.apache.arrow.flatbuf.Endianness.Little)}},{key:"addFields",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"createFieldsVector",value:function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}},{key:"startFieldsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addCustomMetadata",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createCustomMetadataVector",value:function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}},{key:"startCustomMetadataVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endSchema",value:function(t){return t.endObject()}},{key:"finishSchemaBuffer",value:function(t,e){t.finish(e)}},{key:"createSchema",value:function(t,n,r,i){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.endSchema(t)}}]),e}();e.Schema=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Fe||(Fe={})),function(t){!function(t){!function(t){!function(t){t.Schema=Fe.apache.arrow.flatbuf.Schema}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Ye||(Ye={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.NONE=0]="NONE",t[t.Schema=1]="Schema",t[t.DictionaryBatch=2]="DictionaryBatch",t[t.RecordBatch=3]="RecordBatch",t[t.Tensor=4]="Tensor",t[t.SparseTensor=5]="SparseTensor"}(t.MessageHeader||(t.MessageHeader={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Ye||(Ye={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"length",value:function(){return this.bb.readInt64(this.bb_pos)}},{key:"nullCount",value:function(){return this.bb.readInt64(this.bb_pos+8)}}],[{key:"createFieldNode",value:function(t,e,n){return t.prep(8,16),t.writeInt64(n),t.writeInt64(e),t.offset()}}]),t}();t.FieldNode=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Ye||(Ye={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"length",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}},{key:"nodes",value:function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+r)+16*e,this.bb):null}},{key:"nodesLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"buffers",value:function(t,e){var n=this.bb.__offset(this.bb_pos,8);return n?(e||new Fe.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+n)+16*t,this.bb):null}},{key:"buffersLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}}],[{key:"getRootAsRecordBatch",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startRecordBatch",value:function(t){t.startObject(3)}},{key:"addLength",value:function(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}},{key:"addNodes",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"startNodesVector",value:function(t,e){t.startVector(16,e,8)}},{key:"addBuffers",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"startBuffersVector",value:function(t,e){t.startVector(16,e,8)}},{key:"endRecordBatch",value:function(t){return t.endObject()}},{key:"createRecordBatch",value:function(t,n,r,i){return e.startRecordBatch(t),e.addLength(t,n),e.addNodes(t,r),e.addBuffers(t,i),e.endRecordBatch(t)}}]),e}();e.RecordBatch=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Ye||(Ye={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"id",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}},{key:"data",value:function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}},{key:"isDelta",value:function(){var t=this.bb.__offset(this.bb_pos,8);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}}],[{key:"getRootAsDictionaryBatch",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startDictionaryBatch",value:function(t){t.startObject(3)}},{key:"addId",value:function(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}},{key:"addData",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"addIsDelta",value:function(t,e){t.addFieldInt8(2,+e,0)}},{key:"endDictionaryBatch",value:function(t){return t.endObject()}},{key:"createDictionaryBatch",value:function(t,n,r,i){return e.startDictionaryBatch(t),e.addId(t,n),e.addData(t,r),e.addIsDelta(t,i),e.endDictionaryBatch(t)}}]),e}();e.DictionaryBatch=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Ye||(Ye={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"version",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Fe.apache.arrow.flatbuf.MetadataVersion.V1}},{key:"headerType",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.apache.arrow.flatbuf.MessageHeader.NONE}},{key:"header",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}},{key:"bodyLength",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}},{key:"customMetadata",value:function(t,e){var n=this.bb.__offset(this.bb_pos,12);return n?(e||new Fe.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}},{key:"customMetadataLength",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}}],[{key:"getRootAsMessage",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startMessage",value:function(t){t.startObject(5)}},{key:"addVersion",value:function(t,e){t.addFieldInt16(0,e,Fe.apache.arrow.flatbuf.MetadataVersion.V1)}},{key:"addHeaderType",value:function(e,n){e.addFieldInt8(1,n,t.apache.arrow.flatbuf.MessageHeader.NONE)}},{key:"addHeader",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"addBodyLength",value:function(t,e){t.addFieldInt64(3,e,t.createLong(0,0))}},{key:"addCustomMetadata",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"createCustomMetadataVector",value:function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}},{key:"startCustomMetadataVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endMessage",value:function(t){return t.endObject()}},{key:"finishMessageBuffer",value:function(t,e){t.finish(e)}},{key:"createMessage",value:function(t,n,r,i,o,a){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,a),e.endMessage(t)}}]),e}();e.Message=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Ye||(Ye={}));Fe.apache.arrow.flatbuf.Type;var Ke,Ge,$e=Fe.apache.arrow.flatbuf.DateUnit,Ze=Fe.apache.arrow.flatbuf.TimeUnit,Xe=Fe.apache.arrow.flatbuf.Precision,Qe=Fe.apache.arrow.flatbuf.UnionMode,Je=Fe.apache.arrow.flatbuf.IntervalUnit,tn=Ye.apache.arrow.flatbuf.MessageHeader,en=Fe.apache.arrow.flatbuf.MetadataVersion;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(Ke||(Ke={})),function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"}(Ge||(Ge={}));var nn=D.mark(ln);function rn(t,e,n,r){return 0!==(n&1<>r}function an(t,e,n){return n?!!(t[e>>3]|=1<>3]&=~(1<0||n.byteLength>3):sn(ln(n,t,e,null,rn)).subarray(0,r)),i}return n}function sn(t){var e,n=[],r=0,i=0,o=0,a=M(t);try{for(a.s();!(e=a.n()).done;){e.value&&(o|=1<0)&&(n[r++]=o);var u=new Uint8Array(n.length+7&-8);return u.set(n),u}function ln(t,e,n,r,i){var o,a,u,s,l;return D.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:o=e%8,a=e>>3,u=0,s=n;case 3:if(!(s>0)){c.next=11;break}l=t[a++];case 5:return c.next=7,i(r,u++,l,o);case 7:if(--s>0&&++o<8){c.next=5;break}case 8:o=0,c.next=3;break;case 11:case"end":return c.stop()}}),nn)}function cn(t,e,n){if(n-e<=0)return 0;if(n-e<8){var r,i=0,o=M(ln(t,e,n-e,t,on));try{for(o.s();!(r=o.n()).done;){i+=r.value}}catch(s){o.e(s)}finally{o.f()}return i}var a=n>>3<<3,u=e+(e%8===0?0:8-e%8);return cn(t,e,u)+cn(t,a,n)+fn(t,u>>3,a-u>>3)}function fn(t,e,n){for(var r=0,i=0|e,o=new DataView(t.buffer,t.byteOffset,t.byteLength),a=void 0===n?t.byteLength:i+n;a-i>=4;)r+=hn(o.getUint32(i)),i+=4;for(;a-i>=2;)r+=hn(o.getUint16(i)),i+=2;for(;a-i>=1;)r+=hn(o.getUint8(i)),i+=1;return r}function hn(t){var e=0|t;return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24}function pn(t){return function(t){if(Array.isArray(t))return N(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||I(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.")}()}var dn=function(){function t(){L(this,t)}return j(t,[{key:"visitMany",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1&&void 0!==arguments[1])||arguments[1];return yn(this,t,e)}},{key:"visitNull",value:function(t){return null}},{key:"visitBool",value:function(t){return null}},{key:"visitInt",value:function(t){return null}},{key:"visitFloat",value:function(t){return null}},{key:"visitUtf8",value:function(t){return null}},{key:"visitBinary",value:function(t){return null}},{key:"visitFixedSizeBinary",value:function(t){return null}},{key:"visitDate",value:function(t){return null}},{key:"visitTimestamp",value:function(t){return null}},{key:"visitTime",value:function(t){return null}},{key:"visitDecimal",value:function(t){return null}},{key:"visitList",value:function(t){return null}},{key:"visitStruct",value:function(t){return null}},{key:"visitUnion",value:function(t){return null}},{key:"visitDictionary",value:function(t){return null}},{key:"visitInterval",value:function(t){return null}},{key:"visitFixedSizeList",value:function(t){return null}},{key:"visitMap",value:function(t){return null}}]),t}();function yn(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=null,i=Ke.NONE;switch(e instanceof cr||e instanceof We?i=vn(e.type):e instanceof Nn?i=vn(e):"number"!==typeof(i=e)&&(i=Ke[e]),i){case Ke.Null:r=t.visitNull;break;case Ke.Bool:r=t.visitBool;break;case Ke.Int:r=t.visitInt;break;case Ke.Int8:r=t.visitInt8||t.visitInt;break;case Ke.Int16:r=t.visitInt16||t.visitInt;break;case Ke.Int32:r=t.visitInt32||t.visitInt;break;case Ke.Int64:r=t.visitInt64||t.visitInt;break;case Ke.Uint8:r=t.visitUint8||t.visitInt;break;case Ke.Uint16:r=t.visitUint16||t.visitInt;break;case Ke.Uint32:r=t.visitUint32||t.visitInt;break;case Ke.Uint64:r=t.visitUint64||t.visitInt;break;case Ke.Float:r=t.visitFloat;break;case Ke.Float16:r=t.visitFloat16||t.visitFloat;break;case Ke.Float32:r=t.visitFloat32||t.visitFloat;break;case Ke.Float64:r=t.visitFloat64||t.visitFloat;break;case Ke.Utf8:r=t.visitUtf8;break;case Ke.Binary:r=t.visitBinary;break;case Ke.FixedSizeBinary:r=t.visitFixedSizeBinary;break;case Ke.Date:r=t.visitDate;break;case Ke.DateDay:r=t.visitDateDay||t.visitDate;break;case Ke.DateMillisecond:r=t.visitDateMillisecond||t.visitDate;break;case Ke.Timestamp:r=t.visitTimestamp;break;case Ke.TimestampSecond:r=t.visitTimestampSecond||t.visitTimestamp;break;case Ke.TimestampMillisecond:r=t.visitTimestampMillisecond||t.visitTimestamp;break;case Ke.TimestampMicrosecond:r=t.visitTimestampMicrosecond||t.visitTimestamp;break;case Ke.TimestampNanosecond:r=t.visitTimestampNanosecond||t.visitTimestamp;break;case Ke.Time:r=t.visitTime;break;case Ke.TimeSecond:r=t.visitTimeSecond||t.visitTime;break;case Ke.TimeMillisecond:r=t.visitTimeMillisecond||t.visitTime;break;case Ke.TimeMicrosecond:r=t.visitTimeMicrosecond||t.visitTime;break;case Ke.TimeNanosecond:r=t.visitTimeNanosecond||t.visitTime;break;case Ke.Decimal:r=t.visitDecimal;break;case Ke.List:r=t.visitList;break;case Ke.Struct:r=t.visitStruct;break;case Ke.Union:r=t.visitUnion;break;case Ke.DenseUnion:r=t.visitDenseUnion||t.visitUnion;break;case Ke.SparseUnion:r=t.visitSparseUnion||t.visitUnion;break;case Ke.Dictionary:r=t.visitDictionary;break;case Ke.Interval:r=t.visitInterval;break;case Ke.IntervalDayTime:r=t.visitIntervalDayTime||t.visitInterval;break;case Ke.IntervalYearMonth:r=t.visitIntervalYearMonth||t.visitInterval;break;case Ke.FixedSizeList:r=t.visitFixedSizeList;break;case Ke.Map:r=t.visitMap}if("function"===typeof r)return r;if(!n)return function(){return null};throw new Error("Unrecognized type '".concat(Ke[i],"'"))}function vn(t){switch(t.typeId){case Ke.Null:return Ke.Null;case Ke.Int:var e=t.bitWidth,n=t.isSigned;switch(e){case 8:return n?Ke.Int8:Ke.Uint8;case 16:return n?Ke.Int16:Ke.Uint16;case 32:return n?Ke.Int32:Ke.Uint32;case 64:return n?Ke.Int64:Ke.Uint64}return Ke.Int;case Ke.Float:switch(t.precision){case Xe.HALF:return Ke.Float16;case Xe.SINGLE:return Ke.Float32;case Xe.DOUBLE:return Ke.Float64}return Ke.Float;case Ke.Binary:return Ke.Binary;case Ke.Utf8:return Ke.Utf8;case Ke.Bool:return Ke.Bool;case Ke.Decimal:return Ke.Decimal;case Ke.Time:switch(t.unit){case Ze.SECOND:return Ke.TimeSecond;case Ze.MILLISECOND:return Ke.TimeMillisecond;case Ze.MICROSECOND:return Ke.TimeMicrosecond;case Ze.NANOSECOND:return Ke.TimeNanosecond}return Ke.Time;case Ke.Timestamp:switch(t.unit){case Ze.SECOND:return Ke.TimestampSecond;case Ze.MILLISECOND:return Ke.TimestampMillisecond;case Ze.MICROSECOND:return Ke.TimestampMicrosecond;case Ze.NANOSECOND:return Ke.TimestampNanosecond}return Ke.Timestamp;case Ke.Date:switch(t.unit){case $e.DAY:return Ke.DateDay;case $e.MILLISECOND:return Ke.DateMillisecond}return Ke.Date;case Ke.Interval:switch(t.unit){case Je.DAY_TIME:return Ke.IntervalDayTime;case Je.YEAR_MONTH:return Ke.IntervalYearMonth}return Ke.Interval;case Ke.Map:return Ke.Map;case Ke.List:return Ke.List;case Ke.Struct:return Ke.Struct;case Ke.Union:switch(t.mode){case Qe.Dense:return Ke.DenseUnion;case Qe.Sparse:return Ke.SparseUnion}return Ke.Union;case Ke.FixedSizeBinary:return Ke.FixedSizeBinary;case Ke.FixedSizeList:return Ke.FixedSizeList;case Ke.Dictionary:return Ke.Dictionary}throw new Error("Unrecognized type '".concat(Ke[t.typeId],"'"))}dn.prototype.visitInt8=null,dn.prototype.visitInt16=null,dn.prototype.visitInt32=null,dn.prototype.visitInt64=null,dn.prototype.visitUint8=null,dn.prototype.visitUint16=null,dn.prototype.visitUint32=null,dn.prototype.visitUint64=null,dn.prototype.visitFloat16=null,dn.prototype.visitFloat32=null,dn.prototype.visitFloat64=null,dn.prototype.visitDateDay=null,dn.prototype.visitDateMillisecond=null,dn.prototype.visitTimestampSecond=null,dn.prototype.visitTimestampMillisecond=null,dn.prototype.visitTimestampMicrosecond=null,dn.prototype.visitTimestampNanosecond=null,dn.prototype.visitTimeSecond=null,dn.prototype.visitTimeMillisecond=null,dn.prototype.visitTimeMicrosecond=null,dn.prototype.visitTimeNanosecond=null,dn.prototype.visitDenseUnion=null,dn.prototype.visitSparseUnion=null,dn.prototype.visitIntervalDayTime=null,dn.prototype.visitIntervalYearMonth=null;var mn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"compareSchemas",value:function(t,e){return t===e||e instanceof t.constructor&&An.compareFields(t.fields,e.fields)}},{key:"compareFields",value:function(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((function(t,n){return An.compareField(t,e[n])}))}},{key:"compareField",value:function(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&An.visit(t.type,e.type)}}]),n}(dn);function bn(t,e){return e instanceof t.constructor}function gn(t,e){return t===e||bn(t,e)}function wn(t,e){return t===e||bn(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function xn(t,e){return t===e||bn(t,e)&&t.precision===e.precision}function kn(t,e){return t===e||bn(t,e)&&t.unit===e.unit}function _n(t,e){return t===e||bn(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function Sn(t,e){return t===e||bn(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function Tn(t,e){return t===e||bn(t,e)&&t.mode===e.mode&&t.typeIds.every((function(t,n){return t===e.typeIds[n]}))&&An.compareFields(t.children,e.children)}function On(t,e){return t===e||bn(t,e)&&t.unit===e.unit}mn.prototype.visitNull=gn,mn.prototype.visitBool=gn,mn.prototype.visitInt=wn,mn.prototype.visitInt8=wn,mn.prototype.visitInt16=wn,mn.prototype.visitInt32=wn,mn.prototype.visitInt64=wn,mn.prototype.visitUint8=wn,mn.prototype.visitUint16=wn,mn.prototype.visitUint32=wn,mn.prototype.visitUint64=wn,mn.prototype.visitFloat=xn,mn.prototype.visitFloat16=xn,mn.prototype.visitFloat32=xn,mn.prototype.visitFloat64=xn,mn.prototype.visitUtf8=gn,mn.prototype.visitBinary=gn,mn.prototype.visitFixedSizeBinary=function(t,e){return t===e||bn(t,e)&&t.byteWidth===e.byteWidth},mn.prototype.visitDate=kn,mn.prototype.visitDateDay=kn,mn.prototype.visitDateMillisecond=kn,mn.prototype.visitTimestamp=_n,mn.prototype.visitTimestampSecond=_n,mn.prototype.visitTimestampMillisecond=_n,mn.prototype.visitTimestampMicrosecond=_n,mn.prototype.visitTimestampNanosecond=_n,mn.prototype.visitTime=Sn,mn.prototype.visitTimeSecond=Sn,mn.prototype.visitTimeMillisecond=Sn,mn.prototype.visitTimeMicrosecond=Sn,mn.prototype.visitTimeNanosecond=Sn,mn.prototype.visitDecimal=gn,mn.prototype.visitList=function(t,e){return t===e||bn(t,e)&&t.children.length===e.children.length&&An.compareFields(t.children,e.children)},mn.prototype.visitStruct=function(t,e){return t===e||bn(t,e)&&t.children.length===e.children.length&&An.compareFields(t.children,e.children)},mn.prototype.visitUnion=Tn,mn.prototype.visitDenseUnion=Tn,mn.prototype.visitSparseUnion=Tn,mn.prototype.visitDictionary=function(t,e){return t===e||bn(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&An.visit(t.indices,e.indices)&&An.visit(t.dictionary,e.dictionary)},mn.prototype.visitInterval=On,mn.prototype.visitIntervalDayTime=On,mn.prototype.visitIntervalYearMonth=On,mn.prototype.visitFixedSizeList=function(t,e){return t===e||bn(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&An.compareFields(t.children,e.children)},mn.prototype.visitMap=function(t,e){return t===e||bn(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&An.compareFields(t.children,e.children)};var En,An=new mn,Nn=function(){function t(){L(this,t)}return j(t,[{key:"compareTo",value:function(t){return An.visit(this,t)}},{key:"typeId",get:function(){return Ke.NONE}}],[{key:"isNull",value:function(t){return t&&t.typeId===Ke.Null}},{key:"isInt",value:function(t){return t&&t.typeId===Ke.Int}},{key:"isFloat",value:function(t){return t&&t.typeId===Ke.Float}},{key:"isBinary",value:function(t){return t&&t.typeId===Ke.Binary}},{key:"isUtf8",value:function(t){return t&&t.typeId===Ke.Utf8}},{key:"isBool",value:function(t){return t&&t.typeId===Ke.Bool}},{key:"isDecimal",value:function(t){return t&&t.typeId===Ke.Decimal}},{key:"isDate",value:function(t){return t&&t.typeId===Ke.Date}},{key:"isTime",value:function(t){return t&&t.typeId===Ke.Time}},{key:"isTimestamp",value:function(t){return t&&t.typeId===Ke.Timestamp}},{key:"isInterval",value:function(t){return t&&t.typeId===Ke.Interval}},{key:"isList",value:function(t){return t&&t.typeId===Ke.List}},{key:"isStruct",value:function(t){return t&&t.typeId===Ke.Struct}},{key:"isUnion",value:function(t){return t&&t.typeId===Ke.Union}},{key:"isFixedSizeBinary",value:function(t){return t&&t.typeId===Ke.FixedSizeBinary}},{key:"isFixedSizeList",value:function(t){return t&&t.typeId===Ke.FixedSizeList}},{key:"isMap",value:function(t){return t&&t.typeId===Ke.Map}},{key:"isDictionary",value:function(t){return t&&t.typeId===Ke.Dictionary}}]),t}();Nn[Symbol.toStringTag]=((En=Nn.prototype).children=null,En.ArrayType=Array,En[Symbol.toStringTag]="DataType");var In=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"toString",value:function(){return"Null"}},{key:"typeId",get:function(){return Ke.Null}}]),n}(Nn);In[Symbol.toStringTag]=function(t){return t[Symbol.toStringTag]="Null"}(In.prototype);var Mn=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this)).isSigned=t,i.bitWidth=r,i}return j(n,[{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}},{key:"typeId",get:function(){return Ke.Int}},{key:"ArrayType",get:function(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:case 64:return this.isSigned?Int32Array:Uint32Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}}]),n}(Nn);Mn[Symbol.toStringTag]=function(t){return t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"}(Mn.prototype);var Cn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,!0,8)}return n}(Mn),Bn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,!0,16)}return n}(Mn),Ln=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,!0,32)}return n}(Mn),Pn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,!0,64)}return n}(Mn),jn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,!1,8)}return n}(Mn),Dn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,!1,16)}return n}(Mn),zn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,!1,32)}return n}(Mn),Rn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,!1,64)}return n}(Mn);Object.defineProperty(Cn.prototype,"ArrayType",{value:Int8Array}),Object.defineProperty(Bn.prototype,"ArrayType",{value:Int16Array}),Object.defineProperty(Ln.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(Pn.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(jn.prototype,"ArrayType",{value:Uint8Array}),Object.defineProperty(Dn.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty(zn.prototype,"ArrayType",{value:Uint32Array}),Object.defineProperty(Rn.prototype,"ArrayType",{value:Uint32Array});var Fn=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).precision=t,r}return j(n,[{key:"toString",value:function(){return"Float".concat(this.precision<<5||16)}},{key:"typeId",get:function(){return Ke.Float}},{key:"ArrayType",get:function(){switch(this.precision){case Xe.HALF:return Uint16Array;case Xe.SINGLE:return Float32Array;case Xe.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}}]),n}(Nn);Fn[Symbol.toStringTag]=function(t){return t.precision=null,t[Symbol.toStringTag]="Float"}(Fn.prototype);var Un=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,Xe.HALF)}return n}(Fn),qn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,Xe.SINGLE)}return n}(Fn),Vn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,Xe.DOUBLE)}return n}(Fn);Object.defineProperty(Un.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty(qn.prototype,"ArrayType",{value:Float32Array}),Object.defineProperty(Vn.prototype,"ArrayType",{value:Float64Array});var Hn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this)}return j(n,[{key:"toString",value:function(){return"Binary"}},{key:"typeId",get:function(){return Ke.Binary}}]),n}(Nn);Hn[Symbol.toStringTag]=function(t){return t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"}(Hn.prototype);var Yn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this)}return j(n,[{key:"toString",value:function(){return"Utf8"}},{key:"typeId",get:function(){return Ke.Utf8}}]),n}(Nn);Yn[Symbol.toStringTag]=function(t){return t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"}(Yn.prototype);var Wn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this)}return j(n,[{key:"toString",value:function(){return"Bool"}},{key:"typeId",get:function(){return Ke.Bool}}]),n}(Nn);Wn[Symbol.toStringTag]=function(t){return t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"}(Wn.prototype);var Kn=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this)).scale=t,i.precision=r,i}return j(n,[{key:"toString",value:function(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}},{key:"typeId",get:function(){return Ke.Decimal}}]),n}(Nn);Kn[Symbol.toStringTag]=function(t){return t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"}(Kn.prototype);var Gn=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).unit=t,r}return j(n,[{key:"toString",value:function(){return"Date".concat(32*(this.unit+1),"<").concat($e[this.unit],">")}},{key:"typeId",get:function(){return Ke.Date}}]),n}(Nn);Gn[Symbol.toStringTag]=function(t){return t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Date"}(Gn.prototype);var $n=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,$e.DAY)}return n}(Gn),Zn=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.call(this,$e.MILLISECOND)}return n}(Gn),Xn=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this)).unit=t,i.bitWidth=r,i}return j(n,[{key:"toString",value:function(){return"Time".concat(this.bitWidth,"<").concat(Ze[this.unit],">")}},{key:"typeId",get:function(){return Ke.Time}}]),n}(Nn);Xn[Symbol.toStringTag]=function(t){return t.unit=null,t.bitWidth=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Time"}(Xn.prototype);var Qn=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this)).unit=t,i.timezone=r,i}return j(n,[{key:"toString",value:function(){return"Timestamp<".concat(Ze[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}},{key:"typeId",get:function(){return Ke.Timestamp}}]),n}(Nn);Qn[Symbol.toStringTag]=function(t){return t.unit=null,t.timezone=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Timestamp"}(Qn.prototype);var Jn=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).unit=t,r}return j(n,[{key:"toString",value:function(){return"Interval<".concat(Je[this.unit],">")}},{key:"typeId",get:function(){return Ke.Interval}}]),n}(Nn);Jn[Symbol.toStringTag]=function(t){return t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"}(Jn.prototype);var tr=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).children=[t],r}return j(n,[{key:"toString",value:function(){return"List<".concat(this.valueType,">")}},{key:"typeId",get:function(){return Ke.List}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:"ArrayType",get:function(){return this.valueType.ArrayType}}]),n}(Nn);tr[Symbol.toStringTag]=function(t){return t.children=null,t[Symbol.toStringTag]="List"}(tr.prototype);var er=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).children=t,r}return j(n,[{key:"toString",value:function(){return"Struct<{".concat(this.children.map((function(t){return"".concat(t.name,":").concat(t.type)})).join(", "),"}>")}},{key:"typeId",get:function(){return Ke.Struct}}]),n}(Nn);er[Symbol.toStringTag]=function(t){return t.children=null,t[Symbol.toStringTag]="Struct"}(er.prototype);var nr=function(t){ot(n,t);var e=ft(n);function n(t,r,i){var o;return L(this,n),(o=e.call(this)).mode=t,o.children=i,o.typeIds=r=Int32Array.from(r),o.typeIdToChildIndex=r.reduce((function(t,e,n){return(t[e]=n)&&t||t}),Object.create(null)),o}return j(n,[{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map((function(t){return"".concat(t.type)})).join(" | "),">")}},{key:"typeId",get:function(){return Ke.Union}}]),n}(Nn);nr[Symbol.toStringTag]=function(t){return t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"}(nr.prototype);var rr=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).byteWidth=t,r}return j(n,[{key:"toString",value:function(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}},{key:"typeId",get:function(){return Ke.FixedSizeBinary}}]),n}(Nn);rr[Symbol.toStringTag]=function(t){return t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"}(rr.prototype);var ir=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this)).listSize=t,i.children=[r],i}return j(n,[{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}},{key:"typeId",get:function(){return Ke.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:"ArrayType",get:function(){return this.valueType.ArrayType}}]),n}(Nn);ir[Symbol.toStringTag]=function(t){return t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"}(ir.prototype);var or=function(t){ot(n,t);var e=ft(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return L(this,n),(r=e.call(this)).children=[t],r.keysSorted=i,r}return j(n,[{key:"toString",value:function(){return"Map<{".concat(this.children[0].type.children.map((function(t){return"".concat(t.name,":").concat(t.type)})).join(", "),"}>")}},{key:"typeId",get:function(){return Ke.Map}},{key:"keyType",get:function(){return this.children[0].type.children[0].type}},{key:"valueType",get:function(){return this.children[0].type.children[1].type}}]),n}(Nn);or[Symbol.toStringTag]=function(t){return t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"}(or.prototype);var ar,ur=(ar=-1,function(){return++ar}),sr=function(t){ot(n,t);var e=ft(n);function n(t,r,i,o){var a;return L(this,n),(a=e.call(this)).indices=r,a.dictionary=t,a.isOrdered=o||!1,a.id=null==i?ur():"number"===typeof i?i:i.low,a}return j(n,[{key:"toString",value:function(){return"Dictionary<".concat(this.indices,", ").concat(this.dictionary,">")}},{key:"typeId",get:function(){return Ke.Dictionary}},{key:"children",get:function(){return this.dictionary.children}},{key:"valueType",get:function(){return this.dictionary}},{key:"ArrayType",get:function(){return this.dictionary.ArrayType}}]),n}(Nn);function lr(t){var e=t;switch(t.typeId){case Ke.Decimal:return 4;case Ke.Timestamp:return 2;case Ke.Date:case Ke.Interval:return 1+e.unit;case Ke.Int:case Ke.Time:return+(e.bitWidth>32)+1;case Ke.FixedSizeList:return e.listSize;case Ke.FixedSizeBinary:return e.byteWidth;default:return 1}}sr[Symbol.toStringTag]=function(t){return t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"}(sr.prototype);var cr=function(){function t(e,n,r,i,o,a,u){var s;L(this,t),this.type=e,this.dictionary=u,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1)),this.childData=(a||[]).map((function(e){return e instanceof t?e:e.data})),o instanceof t?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=lr(e),o&&((s=o[0])&&(this.valueOffsets=s),(s=o[1])&&(this.values=s),(s=o[2])&&(this.nullBitmap=s),(s=o[3])&&(this.typeIds=s)))}return j(t,[{key:"clone",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.offset,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.length,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._nullCount,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.childData;return new t(e,n,r,i,o,a,this.dictionary)}},{key:"slice",value:function(t,e){var n=this.stride,r=this.typeId,i=this.childData,o=+(0===this._nullCount)-1,a=16===r?n:1,u=this._sliceBuffers(t,e,n,r);return this.clone(this.type,this.offset+t,e,o,u,!i.length||this.valueOffsets?i:this._sliceChildren(i,a*t,a*e))}},{key:"_changeLengthAndBackfillNullBitmap",value:function(t){if(this.typeId===Ke.Null)return this.clone(this.type,0,t,0);var e=this.length,n=this.nullCount,r=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);r[e>>3]=(1<0&&r.set(un(this.offset,e,this.nullBitmap),0);var i=this.buffers;return i[Ge.VALIDITY]=r,this.clone(this.type,0,t,n+(t-e),i)}},{key:"_sliceBuffers",value:function(t,e,n,r){var i,o=this.buffers;return(i=o[Ge.TYPE])&&(o[Ge.TYPE]=i.subarray(t,t+e)),(i=o[Ge.OFFSET])&&(o[Ge.OFFSET]=i.subarray(t,t+e+1))||(i=o[Ge.DATA])&&(o[Ge.DATA]=6===r?i:i.subarray(n*t,n*(t+e))),o}},{key:"_sliceChildren",value:function(t,e,n){return t.map((function(t){return t.slice(e,n)}))}},{key:"typeId",get:function(){return this.type.typeId}},{key:"ArrayType",get:function(){return this.type.ArrayType}},{key:"buffers",get:function(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}},{key:"byteLength",get:function(){var t=0,e=this.valueOffsets,n=this.values,r=this.nullBitmap,i=this.typeIds;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),this.childData.reduce((function(t,e){return t+e.byteLength}),t)}},{key:"nullCount",get:function(){var t,e=this._nullCount;return e<=-1&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-cn(t,this.offset,this.offset+this.length)),e}}],[{key:"new",value:function(e,n,r,i,o,a,u){switch(o instanceof t?o=o.buffers:o||(o=[]),e.typeId){case Ke.Null:return t.Null(e,n,r);case Ke.Int:return t.Int(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.Dictionary:return t.Dictionary(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[],u);case Ke.Float:return t.Float(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.Bool:return t.Bool(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.Decimal:return t.Decimal(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.Date:return t.Date(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.Time:return t.Time(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.Timestamp:return t.Timestamp(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.Interval:return t.Interval(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.FixedSizeBinary:return t.FixedSizeBinary(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.DATA]||[]);case Ke.Binary:return t.Binary(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.OFFSET]||[],o[Ge.DATA]||[]);case Ke.Utf8:return t.Utf8(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.OFFSET]||[],o[Ge.DATA]||[]);case Ke.List:return t.List(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.OFFSET]||[],(a||[])[0]);case Ke.FixedSizeList:return t.FixedSizeList(e,n,r,i||0,o[Ge.VALIDITY],(a||[])[0]);case Ke.Struct:return t.Struct(e,n,r,i||0,o[Ge.VALIDITY],a||[]);case Ke.Map:return t.Map(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.OFFSET]||[],(a||[])[0]);case Ke.Union:return t.Union(e,n,r,i||0,o[Ge.VALIDITY],o[Ge.TYPE]||[],o[Ge.OFFSET]||a,a)}throw new Error("Unrecognized typeId ".concat(e.typeId))}},{key:"Null",value:function(e,n,r){return new t(e,n,r,0)}},{key:"Int",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"Dictionary",value:function(e,n,r,i,o,a,u){return new t(e,n,r,i,[void 0,Vt(e.indices.ArrayType,a),Gt(o)],[],u)}},{key:"Float",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"Bool",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"Decimal",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"Date",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"Time",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"Timestamp",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"Interval",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"FixedSizeBinary",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,Vt(e.ArrayType,a),Gt(o)])}},{key:"Binary",value:function(e,n,r,i,o,a,u){return new t(e,n,r,i,[Wt(a),Gt(u),Gt(o)])}},{key:"Utf8",value:function(e,n,r,i,o,a,u){return new t(e,n,r,i,[Wt(a),Gt(u),Gt(o)])}},{key:"List",value:function(e,n,r,i,o,a,u){return new t(e,n,r,i,[Wt(a),void 0,Gt(o)],[u])}},{key:"FixedSizeList",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,void 0,Gt(o)],[a])}},{key:"Struct",value:function(e,n,r,i,o,a){return new t(e,n,r,i,[void 0,void 0,Gt(o)],a)}},{key:"Map",value:function(e,n,r,i,o,a,u){return new t(e,n,r,i,[Wt(a),void 0,Gt(o)],[u])}},{key:"Union",value:function(e,n,r,i,o,a,u,s){var l=[void 0,void 0,Gt(o),Vt(e.ArrayType,a)];return e.mode===Qe.Sparse?new t(e,n,r,i,l,u):(l[Ge.OFFSET]=Wt(u),new t(e,n,r,i,l,s))}}]),t}();cr.prototype.childData=Object.freeze([]);function fr(t){if(null===t)return"null";if(void 0===t)return"undefined";switch(typeof t){case"number":case"bigint":return"".concat(t);case"string":return'"'.concat(t,'"')}return"function"===typeof t[Symbol.toPrimitive]?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?"[".concat(t,"]"):JSON.stringify(t)}function hr(t){if(!t||t.length<=0)return function(t){return!0};var e="",n=t.filter((function(t){return t===t}));return n.length>0&&(e="\n switch (x) {".concat(n.map((function(t){return"\n case ".concat(function(t){if("bigint"!==typeof t)return fr(t);if(bt)return"".concat(fr(t),"n");return'"'.concat(fr(t),'"')}(t),":")})).join(""),"\n return false;\n }")),t.length!==n.length&&(e="if (x !== x) return false;\n".concat(e)),new Function("x","".concat(e,"\nreturn true;"))}var pr=function(t,e){return(t*e+63&-64||64)/e},dr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.length>=e?t.subarray(0,e):Ut(new t.constructor(e),t,0)},yr=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;L(this,t),this.buffer=e,this.stride=n,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e.constructor,this._resize(this.length=e.length/n|0)}return j(t,[{key:"set",value:function(t,e){return this}},{key:"append",value:function(t){return this.set(this.length,t)}},{key:"reserve",value:function(t){if(t>0){this.length+=t;var e=this.stride,n=this.length*e,r=this.buffer.length;n>=r&&this._resize(pr(0===r?1*n:2*n,this.BYTES_PER_ELEMENT))}return this}},{key:"flush",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length;t=pr(t*this.stride,this.BYTES_PER_ELEMENT);var e=dr(this.buffer,t);return this.clear(),e}},{key:"clear",value:function(){return this.length=0,this._resize(0),this}},{key:"_resize",value:function(t){return this.buffer=Ut(new this.ArrayType(t),this.buffer)}},{key:"byteLength",get:function(){return this.length*this.stride*this.BYTES_PER_ELEMENT|0}},{key:"reservedLength",get:function(){return this.buffer.length/this.stride}},{key:"reservedByteLength",get:function(){return this.buffer.byteLength}}]),t}();yr.prototype.offset=0;var vr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"last",value:function(){return this.get(this.length-1)}},{key:"get",value:function(t){return this.buffer[t]}},{key:"set",value:function(t,e){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=e,this}}]),n}(yr),mr=function(t){ot(n,t);var e=ft(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array(0);return L(this,n),(t=e.call(this,r,1/8)).numValid=0,t}return j(n,[{key:"get",value:function(t){return this.buffer[t>>3]>>t%8&1}},{key:"set",value:function(t,e){var n=this.reserve(t-this.length+1).buffer,r=t>>3,i=t%8,o=n[r]>>i&1;return e?0===o&&(n[r]|=1<0&&void 0!==arguments[0]?arguments[0]:new Int32Array(1);return L(this,n),e.call(this,t,1)}return j(n,[{key:"append",value:function(t){return this.set(this.length-1,t)}},{key:"set",value:function(t,e){var n=this.length-1,r=this.reserve(t-n+1).buffer;return n0&&void 0!==arguments[0]?arguments[0]:this.length-1;return t>this.length&&this.set(t-1,0),Re(at(n.prototype),"flush",this).call(this,t+1)}}]),n}(vr),gr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"set",value:function(t,e){switch(this.reserve(t-this.length+1),typeof e){case"bigint":this.buffer64[t]=e;break;case"number":this.buffer[t*this.stride]=e;break;default:this.buffer.set(e,t*this.stride)}return this}},{key:"_resize",value:function(t){var e=Re(at(n.prototype),"_resize",this).call(this,t),r=e.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return bt&&(this.buffer64=new this.ArrayType64(e.buffer,e.byteOffset,r)),e}},{key:"ArrayType64",get:function(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?wt:kt)}}]),n}(yr),wr=function(){function t(e){var n=e.type,r=e.nullValues;L(this,t),this.length=0,this.finished=!1,this.type=n,this.children=[],this.nullValues=r,this.stride=lr(n),this._nulls=new mr,r&&r.length>0&&(this._isValid=hr(r))}return j(t,[{key:"toVector",value:function(){return We.new(this.flush())}},{key:"append",value:function(t){return this.set(this.length,t)}},{key:"isValid",value:function(t){return this._isValid(t)}},{key:"set",value:function(t,e){return this.setValid(t,this.isValid(e))&&this.setValue(t,e),this}},{key:"setValue",value:function(t,e){this._setValue(this,t,e)}},{key:"setValid",value:function(t,e){return this.length=this._nulls.set(t,+e).length,e}},{key:"addChild",value:function(t){arguments.length>1&&void 0!==arguments[1]||"".concat(this.numChildren);throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}},{key:"getChildAt",value:function(t){return this.children[t]||null}},{key:"flush",value:function(){var t=[],e=this._values,n=this._offsets,r=this._typeIds,i=this.length,o=this.nullCount;r?(t[Ge.TYPE]=r.flush(i),n&&(t[Ge.OFFSET]=n.flush(i))):n?(e&&(t[Ge.DATA]=e.flush(n.last())),t[Ge.OFFSET]=n.flush(i)):e&&(t[Ge.DATA]=e.flush(i)),o>0&&(t[Ge.VALIDITY]=this._nulls.flush(i));var a=cr.new(this.type,0,i,o,t,this.children.map((function(t){return t.flush()})));return this.clear(),a}},{key:"finish",value:function(){return this.finished=!0,this.children.forEach((function(t){return t.finish()})),this}},{key:"clear",value:function(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach((function(t){return t.clear()})),this}},{key:"ArrayType",get:function(){return this.type.ArrayType}},{key:"nullCount",get:function(){return this._nulls.numInvalid}},{key:"numChildren",get:function(){return this.children.length}},{key:"byteLength",get:function(){var t=0;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),this._typeIds&&(t+=this._typeIds.byteLength),this.children.reduce((function(t,e){return t+e.byteLength}),t)}},{key:"reservedLength",get:function(){return this._nulls.reservedLength}},{key:"reservedByteLength",get:function(){var t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((function(t,e){return t+e.reservedByteLength}),t)}},{key:"valueOffsets",get:function(){return this._offsets?this._offsets.buffer:null}},{key:"values",get:function(){return this._values?this._values.buffer:null}},{key:"nullBitmap",get:function(){return this._nulls?this._nulls.buffer:null}},{key:"typeIds",get:function(){return this._typeIds?this._typeIds.buffer:null}}],[{key:"new",value:function(t){}},{key:"throughNode",value:function(t){throw new Error('"throughNode" not available in this environment')}},{key:"throughDOM",value:function(t){throw new Error('"throughDOM" not available in this environment')}},{key:"throughIterable",value:function(t){return function(t){var e=t.queueingStrategy,n=void 0===e?"count":e,r=t.highWaterMark,i=void 0===r?"bytes"!==n?1e3:Math.pow(2,14):r,o="bytes"!==n?"length":"byteLength";return D.mark((function e(n){var r,a,u,s,l;return D.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0,a=wr.new(t),u=M(n),e.prev=3,u.s();case 5:if((s=u.n()).done){e.next=14;break}if(l=s.value,!(a.append(l)[o]>=i)){e.next=12;break}if(e.t0=++r,!e.t0){e.next=12;break}return e.next=12,a.toVector();case 12:e.next=5;break;case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(3),u.e(e.t1);case 19:return e.prev=19,u.f(),e.finish(19);case 22:if(!(a.finish().length>0||0===r)){e.next=25;break}return e.next=25,a.toVector();case 25:case"end":return e.stop()}}),e,null,[[3,16,19,22]])}))}(t)}},{key:"throughAsyncIterable",value:function(t){return function(t){var e=t.queueingStrategy,n=void 0===e?"count":e,r=t.highWaterMark,i=void 0===r?"bytes"!==n?1e3:Math.pow(2,14):r,o="bytes"!==n?"length":"byteLength";return function(){var e=q(D.mark((function e(n){var r,a,u,s,l,c,f,h,p;return D.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0,a=wr.new(t),u=!0,s=!1,e.prev=4,c=V(n);case 6:return e.next=8,F(c.next());case 8:return f=e.sent,u=f.done,e.next=12,F(f.value);case 12:if(h=e.sent,u){e.next=23;break}if(p=h,!(a.append(p)[o]>=i)){e.next=20;break}if(e.t0=++r,!e.t0){e.next=20;break}return e.next=20,a.toVector();case 20:u=!0,e.next=6;break;case 23:e.next=29;break;case 25:e.prev=25,e.t1=e.catch(4),s=!0,l=e.t1;case 29:if(e.prev=29,e.prev=30,u||null==c.return){e.next=34;break}return e.next=34,F(c.return());case 34:if(e.prev=34,!s){e.next=37;break}throw l;case 37:return e.finish(34);case 38:return e.finish(29);case 39:if(!(a.finish().length>0||0===r)){e.next=42;break}return e.next=42,a.toVector();case 42:case"end":return e.stop()}}),e,null,[[4,25,29,39],[30,,34,38]])})));return function(t){return e.apply(this,arguments)}}()}(t)}}]),t}();wr.prototype.length=1,wr.prototype.stride=1,wr.prototype.children=null,wr.prototype.finished=!1,wr.prototype.nullValues=null,wr.prototype._isValid=function(){return!0};var xr=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._values=new vr(new r.ArrayType(0),r.stride),r}return j(n,[{key:"setValue",value:function(t,e){var r=this._values;return r.reserve(t-r.length+1),Re(at(n.prototype),"setValue",this).call(this,t,e)}}]),n}(wr),kr=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._pendingLength=0,r._offsets=new br,r}return j(n,[{key:"setValue",value:function(t,e){var n=this._pending||(this._pending=new Map),r=n.get(t);r&&(this._pendingLength-=r.length),this._pendingLength+=e.length,n.set(t,e)}},{key:"setValid",value:function(t,e){return!!Re(at(n.prototype),"setValid",this).call(this,t,e)||((this._pending||(this._pending=new Map)).set(t,void 0),!1)}},{key:"clear",value:function(){return this._pendingLength=0,this._pending=void 0,Re(at(n.prototype),"clear",this).call(this)}},{key:"flush",value:function(){return this._flush(),Re(at(n.prototype),"flush",this).call(this)}},{key:"finish",value:function(){return this._flush(),Re(at(n.prototype),"finish",this).call(this)}},{key:"_flush",value:function(){var t=this._pending,e=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,e),this}}]),n}(wr);var _r=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._values=new mr,r}return j(n,[{key:"setValue",value:function(t,e){this._values.set(t,+e)}}]),n}(wr),Sr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"setValue",value:function(t,e){}},{key:"setValid",value:function(t,e){return this.length=Math.max(t+1,this.length),e}}]),n}(wr),Tr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(xr),Or=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(Tr),Er=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(Tr),Ar=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(xr),Nr=function(t){ot(n,t);var e=ft(n);function n(t){var r,i=t.type,o=t.nullValues,a=t.dictionaryHashFunction;return L(this,n),(r=e.call(this,{type:new sr(i.dictionary,i.indices,i.id,i.isOrdered)}))._nulls=null,r._dictionaryOffset=0,r._keysToIndices=Object.create(null),r.indices=wr.new({type:r.type.indices,nullValues:o}),r.dictionary=wr.new({type:r.type.dictionary,nullValues:null}),"function"===typeof a&&(r.valueToKey=a),r}return j(n,[{key:"isValid",value:function(t){return this.indices.isValid(t)}},{key:"setValid",value:function(t,e){var n=this.indices;return e=n.setValid(t,e),this.length=n.length,e}},{key:"setValue",value:function(t,e){var n=this._keysToIndices,r=this.valueToKey(e),i=n[r];return void 0===i&&(n[r]=i=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,i)}},{key:"flush",value:function(){var t=this.type,e=this._dictionary,n=this.dictionary.toVector(),r=this.indices.flush().clone(t);return r.dictionary=e?e.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=r.dictionary,this.clear(),r}},{key:"finish",value:function(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),Re(at(n.prototype),"finish",this).call(this)}},{key:"clear",value:function(){return this.indices.clear(),this.dictionary.clear(),Re(at(n.prototype),"clear",this).call(this)}},{key:"valueToKey",value:function(t){return"string"===typeof t?t:"".concat(t)}},{key:"values",get:function(){return this.indices.values}},{key:"nullCount",get:function(){return this.indices.nullCount}},{key:"nullBitmap",get:function(){return this.indices.nullBitmap}},{key:"byteLength",get:function(){return this.indices.byteLength+this.dictionary.byteLength}},{key:"reservedLength",get:function(){return this.indices.reservedLength+this.dictionary.reservedLength}},{key:"reservedByteLength",get:function(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}}]),n}(wr),Ir=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(xr),Mr=new Float64Array(1),Cr=new Uint32Array(Mr.buffer);function Br(t){var e=(31744&t)>>10,n=(1023&t)/1024,r=Math.pow(-1,(32768&t)>>15);switch(e){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*Math.pow(2,e-15)*(1+n)}function Lr(t){if(t!==t)return 32256;Mr[0]=t;var e=(2147483648&Cr[1])>>16&65535,n=2146435072&Cr[1],r=0;return n>=1089470464?Cr[0]>0?n=31744:(n=(2080374784&n)>>16,r=(1048575&Cr[1])>>10):n<=1056964608?(r=1048576+((r=1048576+(1048575&Cr[1]))<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=512+(1048575&Cr[1])>>10),e|n|65535&r}var Pr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(xr),jr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"setValue",value:function(t,e){this._values.set(t,Lr(e))}}]),n}(Pr),Dr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"setValue",value:function(t,e){this._values.set(t,e)}}]),n}(Pr),zr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"setValue",value:function(t,e){this._values.set(t,e)}}]),n}(Pr);function Rr(t,e,n){return(Rr=ut()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&it(i,n.prototype),i}).apply(null,arguments)}var Fr,Ur,qr=Symbol.for("isArrowBigNum");function Vr(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r>>=0),s+=(n>>>0)+e*Math.pow(l,32);return s}function Gr(t){var e="",n=new Uint32Array(2),r=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),i=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,a=r.length-1;do{for(n[0]=r[o=0];o0&&void 0!==arguments[0]?arguments[0]:"default";switch(t){case"number":return Kr(this);case"string":return Fr(this);case"default":return Ur(this)}return Fr(this)},Object.setPrototypeOf(Hr.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Yr.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(Wr.prototype,Object.create(Uint32Array.prototype)),Object.assign(Hr.prototype,Vr.prototype,{constructor:Hr,signed:!0,TypedArray:Int32Array,BigIntArray:wt}),Object.assign(Yr.prototype,Vr.prototype,{constructor:Yr,signed:!1,TypedArray:Uint32Array,BigIntArray:kt}),Object.assign(Wr.prototype,Vr.prototype,{constructor:Wr,signed:!0,TypedArray:Uint32Array,BigIntArray:kt}),bt?(Ur=function(t){return 8===t.byteLength?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:Gr(t)},Fr=function(t){return 8===t.byteLength?"".concat(new t.BigIntArray(t.buffer,t.byteOffset,1)[0]):Gr(t)}):Ur=Fr=Gr;var $r,Zr=function(){function t(e,n){return L(this,t),t.new(e,n)}return j(t,null,[{key:"new",value:function(t,e){switch(e){case!0:return new Hr(t);case!1:return new Yr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case wt:return new Hr(t)}return 16===t.byteLength?new Wr(t):new Yr(t)}},{key:"signed",value:function(t){return new Hr(t)}},{key:"unsigned",value:function(t){return new Yr(t)}},{key:"decimal",value:function(t){return new Wr(t)}}]),t}(),Xr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"setValue",value:function(t,e){this._values.set(t,e)}}]),n}(xr),Qr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(Xr),Jr=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(Xr),ti=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(Xr),ei=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),t.nullValues&&(t.nullValues=t.nullValues.map(ai)),(r=e.call(this,t))._values=new gr(new Int32Array(0),2),r}return j(n,[{key:"isValid",value:function(t){return Re(at(n.prototype),"isValid",this).call(this,ai(t))}},{key:"values64",get:function(){return this._values.buffer64}}]),n}(Xr),ni=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(Xr),ri=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(Xr),ii=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(Xr),oi=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),t.nullValues&&(t.nullValues=t.nullValues.map(ai)),(r=e.call(this,t))._values=new gr(new Uint32Array(0),2),r}return j(n,[{key:"isValid",value:function(t){return Re(at(n.prototype),"isValid",this).call(this,ai(t))}},{key:"values64",get:function(){return this._values.buffer64}}]),n}(Xr),ai=($r={BigIntArray:wt},function(t){return ArrayBuffer.isView(t)&&($r.buffer=t.buffer,$r.byteOffset=t.byteOffset,$r.byteLength=t.byteLength,t=Ur($r),$r.buffer=null),t}),ui=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(xr),si=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(ui),li=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(ui),ci=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(ui),fi=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(ui),hi=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(xr),pi=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(hi),di=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(hi),yi=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(hi),vi=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(hi),mi=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(xr),bi=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(mi),gi=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(mi),wi=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._values=new yr(new Uint8Array(0)),r}return j(n,[{key:"setValue",value:function(t,e){return Re(at(n.prototype),"setValue",this).call(this,t,Gt(e))}},{key:"_flushPending",value:function(t,e){var n,r,i=this._offsets,o=this._values.reserve(e).buffer,a=0,u=0,s=0,l=M(t);try{for(l.s();!(r=l.n()).done;){var c=z(r.value,2);a=c[0],void 0===(n=c[1])?i.set(a,0):(u=n.length,o.set(n,s),i.set(a,u),s+=u)}}catch(f){l.e(f)}finally{l.f()}}},{key:"byteLength",get:function(){var t=this._pendingLength+4*this.length;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}}]),n}(kr),xi=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._values=new yr(new Uint8Array(0)),r}return j(n,[{key:"setValue",value:function(t,e){return Re(at(n.prototype),"setValue",this).call(this,t,rt(e))}},{key:"_flushPending",value:function(t,e){}},{key:"byteLength",get:function(){var t=this._pendingLength+4*this.length;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}}]),n}(kr);xi.prototype._flushPending=wi.prototype._flushPending;var ki=function(){function t(){L(this,t)}return j(t,[{key:"get",value:function(t){return this._values[t]}},{key:"clear",value:function(){return this._values=null,this}},{key:"bind",value:function(t){return t instanceof We?t:(this._values=t,this)}},{key:"length",get:function(){return this._values.length}}]),t}(),_i=Symbol.for("parent"),Si=Symbol.for("rowIndex"),Ti=Symbol.for("keyToIdx"),Oi=Symbol.for("idxToVal"),Ei=Symbol.for("nodejs.util.inspect.custom"),Ai=function(){function t(e,n){L(this,t),this[_i]=e,this.size=n}return j(t,[{key:"entries",value:function(){return this[Symbol.iterator]()}},{key:"has",value:function(t){return void 0!==this.get(t)}},{key:"get",value:function(t){var e=void 0;if(null!==t&&void 0!==t){var n=this[Ti]||(this[Ti]=new Map),r=n.get(t);if(void 0!==r){var i=this[Oi]||(this[Oi]=new Array(this.size));void 0!==(e=i[r])||(i[r]=e=this.getValue(r))}else if((r=this.getIndex(t))>-1){n.set(t,r);var o=this[Oi]||(this[Oi]=new Array(this.size));void 0!==(e=o[r])||(o[r]=e=this.getValue(r))}}return e}},{key:"set",value:function(t,e){if(null!==t&&void 0!==t){var n=this[Ti]||(this[Ti]=new Map),r=n.get(t);if(void 0===r&&n.set(t,r=this.getIndex(t)),r>-1)(this[Oi]||(this[Oi]=new Array(this.size)))[r]=this.setValue(r,e)}return this}},{key:"clear",value:function(){throw new Error("Clearing ".concat(this[Symbol.toStringTag]," not supported."))}},{key:"delete",value:function(t){throw new Error("Deleting ".concat(this[Symbol.toStringTag]," values not supported."))}},{key:Symbol.iterator,value:D.mark((function t(){var e,n,r,i,o,a,u,s,l;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.keys(),n=this.values(),r=this[Ti]||(this[Ti]=new Map),i=this[Oi]||(this[Oi]=new Array(this.size)),u=0;case 5:if((s=e.next()).done||(l=n.next()).done){t.next=15;break}return o=s.value,a=l.value,i[u]=a,r.has(o)||r.set(o,u),t.next=12,[o,a];case 12:++u,t.next=5;break;case 15:case"end":return t.stop()}}),t,this)}))},{key:"forEach",value:function(t,e){for(var n,r,i,o,a=this.keys(),u=this.values(),s=void 0===e?t:function(n,r,i){return t.call(e,n,r,i)},l=this[Ti]||(this[Ti]=new Map),c=this[Oi]||(this[Oi]=new Array(this.size)),f=0;!(i=a.next()).done&&!(o=u.next()).done;++f)n=i.value,r=o.value,c[f]=r,l.has(n)||l.set(n,f),s(r,n,this)}},{key:"toArray",value:function(){return pn(this.values())}},{key:"toJSON",value:function(){var t={};return this.forEach((function(e,n){return t[n]=e})),t}},{key:"inspect",value:function(){return this.toString()}},{key:Ei,value:function(){return this.toString()}},{key:"toString",value:function(){var t=[];return this.forEach((function(e,n){n=fr(n),e=fr(e),t.push("".concat(n,": ").concat(e))})),"{ ".concat(t.join(", ")," }")}}]),t}();Ai[Symbol.toStringTag]=function(t){var e;return Object.defineProperties(t,(je(e={size:{writable:!0,enumerable:!1,configurable:!1,value:0}},_i,{writable:!0,enumerable:!1,configurable:!1,value:null}),je(e,Si,{writable:!0,enumerable:!1,configurable:!1,value:-1}),e)),t[Symbol.toStringTag]="Row"}(Ai.prototype);var Ni=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),ct(r=e.call(this,t,t.length),Bi(lt(r)))}return j(n,[{key:"keys",value:function(){return this[_i].getChildAt(0)[Symbol.iterator]()}},{key:"values",value:function(){return this[_i].getChildAt(1)[Symbol.iterator]()}},{key:"getKey",value:function(t){return this[_i].getChildAt(0).get(t)}},{key:"getIndex",value:function(t){return this[_i].getChildAt(0).indexOf(t)}},{key:"getValue",value:function(t){return this[_i].getChildAt(1).get(t)}},{key:"setValue",value:function(t,e){this[_i].getChildAt(1).set(t,e)}}]),n}(Ai),Ii=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),ct(r=e.call(this,t,t.type.children.length),Ci(lt(r)))}return j(n,[{key:"keys",value:D.mark((function t(){var e,n,r;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=M(this[_i].type.children),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=9;break}return r=n.value,t.next=7,r.name;case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"values",value:D.mark((function t(){var e,n,r;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=M(this[_i].type.children),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=9;break}return r=n.value,t.next=7,this[r.name];case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"getKey",value:function(t){return this[_i].type.children[t].name}},{key:"getIndex",value:function(t){return this[_i].type.children.findIndex((function(e){return e.name===t}))}},{key:"getValue",value:function(t){return this[_i].getChildAt(t).get(this[Si])}},{key:"setValue",value:function(t,e){return this[_i].getChildAt(t).set(this[Si],e)}}]),n}(Ai);Object.setPrototypeOf(Ai.prototype,Map.prototype);var Mi,Ci=function(){var t={enumerable:!0,configurable:!1,get:null,set:null};return function(e){var n,r=-1,i=e[Ti]||(e[Ti]=new Map),o=function(t){return function(){return this.get(t)}},a=function(t){return function(e){return this.set(t,e)}},u=M(e.keys());try{for(u.s();!(n=u.n()).done;){var s=n.value;i.set(s,++r),t.get=o(s),t.set=a(s),e.hasOwnProperty(s)||(t.enumerable=!0,Object.defineProperty(e,s,t)),e.hasOwnProperty(r)||(t.enumerable=!1,Object.defineProperty(e,r,t))}}catch(l){u.e(l)}finally{u.f()}return t.get=t.set=null,e}}(),Bi=function(){if("undefined"===typeof Proxy)return Ci;var t=Ai.prototype.has,e=Ai.prototype.get,n=Ai.prototype.set,r=Ai.prototype.getKey,i={isExtensible:function(){return!1},deleteProperty:function(){return!1},preventExtensions:function(){return!0},ownKeys:function(t){return pn(t.keys()).map((function(t){return"".concat(t)}))},has:function(t,e){switch(e){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case _i:case Si:case Oi:case Ti:case Ei:return!0}return"number"!==typeof e||t.has(e)||(e=t.getKey(e)),t.has(e)},get:function(n,i,o){switch(i){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case _i:case Si:case Oi:case Ti:case Ei:return Reflect.get(n,i,o)}return"number"!==typeof i||t.call(o,i)||(i=r.call(o,i)),e.call(o,i)},set:function(e,i,o,a){switch(i){case _i:case Si:case Oi:case Ti:return Reflect.set(e,i,o,a);case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:return!1}return"number"!==typeof i||t.call(a,i)||(i=r.call(a,i)),!!t.call(a,i)&&!!n.call(a,i,o)}};return function(t){return new Proxy(t,i)}}();function Li(t,e,n){var r=t.length,i=e>-1?e:r+e%r;return n?n(t,i):i}function Pi(t,e,n,r){var i=t.length,o=void 0===i?0:i,a="number"!==typeof e?0:e,u="number"!==typeof n?o:n;return a<0&&(a=(a%o+o)%o),u<0&&(u=(u%o+o)%o),uo&&(u=o),r?r(t,a,u):[a,u]}var ji=bt?mt(0):0,Di=function(t){return t!==t};function zi(t){var e=typeof t;if("object"!==e||null===t)return Di(t)?Di:"bigint"!==e?function(e){return e===t}:function(e){return ji+e===t};if(t instanceof Date){var n=t.valueOf();return function(t){return t instanceof Date&&t.valueOf()===n}}return ArrayBuffer.isView(t)?function(e){return!!e&&Se(t,e)}:t instanceof Map?function(t){var e=-1,n=[];return t.forEach((function(t){return n[++e]=zi(t)})),Ri(n)}(t):Array.isArray(t)?function(t){for(var e=[],n=-1,r=t.length;++n1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qi(i);return L(this,n),(r=e.call(this))._nullCount=-1,r._type=t,r._chunks=i,r._chunkOffsets=o,r._length=o[o.length-1],r._numChildren=(r._type.children||[]).length,r}return j(n,[{key:Symbol.iterator,value:D.mark((function t(){var e,n,r;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=M(this._chunks),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=8;break}return r=n.value,t.delegateYield(r,"t0",6);case 6:t.next=3;break;case 8:t.next=13;break;case 10:t.prev=10,t.t1=t.catch(1),e.e(t.t1);case 13:return t.prev=13,e.f(),t.finish(13);case 16:case"end":return t.stop()}}),t,this,[[1,10,13,16]])}))},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new n(this._type,t)}},{key:"concat",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r=this._numChildren)return null;var e,r,i,o=this._children||(this._children=[]);return(e=o[t])?e:(r=(this._type.children||[])[t])&&(i=this._chunks.map((function(e){return e.getChildAt(t)})).filter((function(t){return null!=t}))).length>0?o[t]=new n(r.type,i):null}},{key:"search",value:function(t,e){var n=t,r=this._chunkOffsets,i=r.length-1;if(n<0)return null;if(n>=r[i])return null;if(i<=1)return e?e(this,0,n):[0,n];var o=0,a=0,u=0;do{if(o+1===i)return e?e(this,o,n-a):[o,n-a];n>=r[u=o+(i-o)/2|0]?o=u:i=u}while(n=(a=r[o]));return null}},{key:"isValid",value:function(t){return!!this.search(t,this.isValidInternal)}},{key:"get",value:function(t){return this.search(t,this.getInternal)}},{key:"set",value:function(t,e){this.search(t,(function(t,n,r){return t.chunks[n].set(r,e)}))}},{key:"indexOf",value:function(t,e){var n=this;return e&&"number"===typeof e?this.search(e,(function(e,r,i){return n.indexOfInternal(e,r,i,t)})):this.indexOfInternal(this,0,Math.max(0,e||0),t)}},{key:"toArray",value:function(){var t=this.chunks,e=t.length,n=this._type.ArrayType;if(e<=0)return new n(0);if(e<=1)return t[0].toArray();for(var r=0,i=new Array(e),o=-1;++o=n)break;if(!(e>=c+l))if(c>=e&&c+l<=n)r.push(s);else{var f=Math.max(0,e-c),h=Math.min(n-c,l);r.push(s.slice(f,h))}}return t.clone(r)}},{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._length}},{key:"chunks",get:function(){return this._chunks}},{key:"typeId",get:function(){return this._type.typeId}},{key:"VectorName",get:function(){return"Chunked<".concat(this._type,">")}},{key:"data",get:function(){return this._chunks[0]?this._chunks[0].data:null}},{key:"ArrayType",get:function(){return this._type.ArrayType}},{key:"numChildren",get:function(){return this._numChildren}},{key:"stride",get:function(){return this._chunks[0]?this._chunks[0].stride:1}},{key:"byteLength",get:function(){return this._chunks.reduce((function(t,e){return t+e.byteLength}),0)}},{key:"nullCount",get:function(){var t=this._nullCount;return t<0&&(this._nullCount=t=this._chunks.reduce((function(t,e){return t+e.nullCount}),0)),t}},{key:"indices",get:function(){if(Nn.isDictionary(this._type)){if(!this._indices){var t=this._chunks;this._indices=1===t.length?t[0].indices:n.concat.apply(n,pn(t.map((function(t){return t.indices}))))}return this._indices}return null}},{key:"dictionary",get:function(){return Nn.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}}],[{key:"flatten",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return L(this,n),i=Ui.flatten.apply(Ui,pn(i)),(r=e.call(this,t.type,i,o))._field=t,1!==i.length||lt(r)instanceof Wi?r:ct(r,new Wi(t,i[0],r._chunkOffsets))}return j(n,[{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new n(this._field,t)}},{key:"getChildAt",value:function(t){if(t<0||t>=this.numChildren)return null;var e,r,i,o=this._children||(this._children=[]);return(e=o[t])?e:(r=(this.type.children||[])[t])&&(i=this._chunks.map((function(e){return e.getChildAt(t)})).filter((function(t){return null!=t}))).length>0?o[t]=new n(r,i):null}},{key:"field",get:function(){return this._field}},{key:"name",get:function(){return this._field.name}},{key:"nullable",get:function(){return this._field.nullable}},{key:"metadata",get:function(){return this._field.metadata}}],[{key:"new",value:function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o0}))&&(t=t.clone({nullable:!0}));return new n(t,a)}}]),n}(Ui),Wi=function(t){ot(n,t);var e=ft(n);function n(t,r,i){var o;return L(this,n),(o=e.call(this,t,[r],i))._chunk=r,o}return j(n,[{key:"search",value:function(t,e){return e?e(this,0,t):[0,t]}},{key:"isValid",value:function(t){return this._chunk.isValid(t)}},{key:"get",value:function(t){return this._chunk.get(t)}},{key:"set",value:function(t,e){this._chunk.set(t,e)}},{key:"indexOf",value:function(t,e){return this._chunk.indexOf(t,e)}}]),n}(Yi),Ki=Array.isArray,Gi=function(t,e){return Ji(t,e,[],0)},$i=function(t){var e=z(eo(t,[[],[]]),2),n=e[0];return e[1].map((function(t,e){return t instanceof Yi?Yi.new(t.field.clone(n[e]),t):t instanceof We?Yi.new(n[e],t):Yi.new(n[e],[])}))},Zi=function(t){return eo(t,[[],[]])},Xi=function(t,e){return function t(e,n,r,i){var o,a=i,u=-1,s=n.length;for(;++u0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;L(this,t),this.fields=e||[],this.metadata=n||new Map,r||(r=oo(e)),this.dictionaries=r}return j(t,[{key:"toString",value:function(){return"Schema<{ ".concat(this.fields.map((function(t,e){return"".concat(e,": ").concat(t)})).join(", ")," }>")}},{key:"compareTo",value:function(t){return An.compareSchemas(this,t)}},{key:"select",value:function(){for(var e=arguments.length,n=new Array(e),r=0;r2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;L(this,t),this.name=e,this.type=n,this.nullable=r,this.metadata=i||new Map}return j(t,[{key:"toString",value:function(){return"".concat(this.name,": ").concat(this.type)}},{key:"compareTo",value:function(t){return An.compareField(this,t)}},{key:"clone",value:function(){for(var e,n,r,i,o,a,u,s,l,c,f=arguments.length,h=new Array(f),p=0;p1&&void 0!==arguments[1]?arguments[1]:new Map,n=-1,r=t.length;++n0&&oo(o.children,e)}return e}no.prototype.fields=null,no.prototype.metadata=null,no.prototype.dictionaries=null,ro.prototype.type=null,ro.prototype.name=null,ro.prototype.nullable=null,ro.prototype.metadata=null;var ao=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._run=new ki,r._offsets=new br,r}return j(n,[{key:"addChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new tr(new ro(e,t.type,!0)),this.numChildren-1}},{key:"clear",value:function(){return this._run.clear(),Re(at(n.prototype),"clear",this).call(this)}},{key:"_flushPending",value:function(t){var e,n,r=this._run,i=this._offsets,o=this._setValue,a=0,u=M(t);try{for(u.s();!(n=u.n()).done;){var s=z(n.value,2);a=s[0],void 0===(e=s[1])?i.set(a,0):(i.set(a,e.length),o(this,a,r.bind(e)))}}catch(l){u.e(l)}finally{u.f()}}}]),n}(kr),uo=function(t){ot(n,t);var e=ft(n);function n(){var t;return L(this,n),(t=e.apply(this,arguments))._run=new ki,t}return j(n,[{key:"setValue",value:function(t,e){Re(at(n.prototype),"setValue",this).call(this,t,this._run.bind(e))}},{key:"addChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");var n=this.children.push(t);return this.type=new ir(this.type.listSize,new ro(e,t.type,!0)),n}},{key:"clear",value:function(){return this._run.clear(),Re(at(n.prototype),"clear",this).call(this)}}]),n}(wr),so=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"set",value:function(t,e){return Re(at(n.prototype),"set",this).call(this,t,e)}},{key:"setValue",value:function(t,e){e=e instanceof Map?e:new Map(Object.entries(e));var n=this._pending||(this._pending=new Map),r=n.get(t);r&&(this._pendingLength-=r.size),this._pendingLength+=e.size,n.set(t,e)}},{key:"addChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.numChildren);if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new or(new ro(e,t.type,!0),this.type.keysSorted),this.numChildren-1}},{key:"_flushPending",value:function(t){var e=this,n=this._offsets,r=this._setValue;t.forEach((function(t,i){void 0===t?n.set(i,0):(n.set(i,t.size),r(e,i,t))}))}}]),n}(kr),lo=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"addChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.numChildren),n=this.children.push(t);return this.type=new er([].concat(pn(this.type.children),[new ro(e,t.type,!0)])),n}}]),n}(wr),co=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._typeIds=new vr(new Int8Array(0),1),"function"===typeof t.valueToChildTypeId&&(r._valueToChildTypeId=t.valueToChildTypeId),r}return j(n,[{key:"append",value:function(t,e){return this.set(this.length,t,e)}},{key:"set",value:function(t,e,n){return void 0===n&&(n=this._valueToChildTypeId(this,e,t)),this.setValid(t,this.isValid(e))&&this.setValue(t,e,n),this}},{key:"setValue",value:function(t,e,r){this._typeIds.set(t,r),Re(at(n.prototype),"setValue",this).call(this,t,e)}},{key:"addChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.children.length),n=this.children.push(t),r=this.type,i=r.children,o=r.mode,a=r.typeIds,u=[].concat(pn(i),[new ro(e,t.type)]);return this.type=new nr(o,[].concat(pn(a),[n]),u),n}},{key:"_valueToChildTypeId",value:function(t,e,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},{key:"typeIdToChildIndex",get:function(){return this.type.typeIdToChildIndex}}]),n}(wr),fo=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(co),ho=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._offsets=new vr(new Int32Array(0)),r}return j(n,[{key:"setValue",value:function(t,e,r){var i=this.type.typeIdToChildIndex[r];return this._offsets.set(t,this.getChildAt(i).length),Re(at(n.prototype),"setValue",this).call(this,t,e,r)}}]),n}(co),po=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(dn),yo=function(t,e,n){t[e]=n%4294967296|0,t[e+1]=n/4294967296|0},vo=function(t,e,n,r){var i=e[n],o=e[n+1];null!=i&&null!=o&&t.set(r.subarray(0,o-i),i)},mo=function(t,e,n){!function(t,e,n){t[e]=n/864e5|0}(t.values,e,n.valueOf())},bo=function(t,e,n){var r=t.values;yo(r,2*e,n.valueOf())},go=function(t,e,n){var r=t.stride;t.values[r*e]=n},wo=function(t,e,n){var r=t.stride;t.values[r*e]=Lr(n)},xo=function(t,e,n){switch(typeof n){case"bigint":t.values64[e]=n;break;case"number":t.values[e*t.stride]=n;break;default:var r=n,i=t.stride,o=Vt(t.ArrayType,r);t.values.set(o.subarray(0,i),i*e)}},ko=function(t,e,n){var r=t.values;return yo(r,2*e,n/1e3)},_o=function(t,e,n){var r=t.values;return yo(r,2*e,n)},So=function(t,e,n){return function(t,e,n){t[e]=1e3*n%4294967296|0,t[e+1]=1e3*n/4294967296|0}(t.values,2*e,n)},To=function(t,e,n){return function(t,e,n){t[e]=1e6*n%4294967296|0,t[e+1]=1e6*n/4294967296|0}(t.values,2*e,n)},Oo=function(t,e,n){t.values[t.stride*e]=n},Eo=function(t,e,n){t.values[t.stride*e]=n},Ao=function(t,e,n){t.values.set(n.subarray(0,2),2*e)},No=function(t,e,n){t.values.set(n.subarray(0,2),2*e)},Io=function(t,e,n){var r=t.typeIdToChildIndex[t.typeIds[e]],i=t.getChildAt(r);i&&i.set(t.valueOffsets[e],n)},Mo=function(t,e,n){var r=t.typeIdToChildIndex[t.typeIds[e]],i=t.getChildAt(r);i&&i.set(e,n)},Co=function(t,e,n){t.values.set(n.subarray(0,2),2*e)},Bo=function(t,e,n){t.values[e]=12*n[0]+n[1]%12};po.prototype.visitBool=function(t,e,n){var r=t.offset,i=t.values,o=r+e;n?i[o>>3]|=1<>3]&=~(1<0){var i=e.children||[],o={nullValues:e.nullValues},a=Array.isArray(i)?function(t,e){return i[e]||o}:function(t){var e=t.name;return i[e]||o};n.children.forEach((function(e,n){var i=e.type,o=a(e,n);r.children.push(t(ze(ze({},o),{},{type:i})))}))}return r},Object.keys(Ke).map((function(t){return Ke[t]})).filter((function(t){return"number"===typeof t&&t!==Ke.NONE})).forEach((function(t){jo.visit(t).prototype._setValue=Po.getVisitFn(t)})),xi.prototype._setValue=Po.visitBinary,function(t){!function(e){!function(e){!function(e){var n=function(){function e(){L(this,e),this.bb=null,this.bb_pos=0}return j(e,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"version",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Fe.apache.arrow.flatbuf.MetadataVersion.V1}},{key:"schema",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new Fe.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"dictionaries",value:function(e,n){var r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+r)+24*e,this.bb):null}},{key:"dictionariesLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"recordBatches",value:function(e,n){var r=this.bb.__offset(this.bb_pos,10);return r?(n||new t.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+r)+24*e,this.bb):null}},{key:"recordBatchesLength",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}}],[{key:"getRootAsFooter",value:function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startFooter",value:function(t){t.startObject(4)}},{key:"addVersion",value:function(t,e){t.addFieldInt16(0,e,Fe.apache.arrow.flatbuf.MetadataVersion.V1)}},{key:"addSchema",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"addDictionaries",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"startDictionariesVector",value:function(t,e){t.startVector(24,e,8)}},{key:"addRecordBatches",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"startRecordBatchesVector",value:function(t,e){t.startVector(24,e,8)}},{key:"endFooter",value:function(t){return t.endObject()}},{key:"finishFooterBuffer",value:function(t,e){t.finish(e)}},{key:"createFooter",value:function(t,n,r,i,o){return e.startFooter(t),e.addVersion(t,n),e.addSchema(t,r),e.addDictionaries(t,i),e.addRecordBatches(t,o),e.endFooter(t)}}]),e}();e.Footer=n}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Lo||(Lo={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){L(this,t),this.bb=null,this.bb_pos=0}return j(t,[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"offset",value:function(){return this.bb.readInt64(this.bb_pos)}},{key:"metaDataLength",value:function(){return this.bb.readInt32(this.bb_pos+8)}},{key:"bodyLength",value:function(){return this.bb.readInt64(this.bb_pos+16)}}],[{key:"createBlock",value:function(t,e,n,r){return t.prep(8,24),t.writeInt64(r),t.pad(4),t.writeInt32(n),t.writeInt64(e),t.offset()}}]),t}();t.Block=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Lo||(Lo={}));var Do=Y.Long,zo=Y.Builder,Ro=Y.ByteBuffer,Fo=Lo.apache.arrow.flatbuf.Block,Uo=Lo.apache.arrow.flatbuf.Footer,qo=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en.V4,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;L(this,t),this.schema=e,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}return j(t,[{key:"recordBatches",value:D.mark((function t(){var e,n,r;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=-1,r=this.numRecordBatches;case 1:if(!(++n=0&&t=0&&t=0&&t=0&&t0)return Re(at(n.prototype),"write",this).call(this,t)}},{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t?nt(this.toUint8Array(!0)):this.toUint8Array(!1).then(nt)}},{key:"toUint8Array",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?qt(this._values)[0]:B(D.mark((function e(){var n,r,i,o,a,u,s,l,c;return D.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],r=0,i=!0,o=!1,e.prev=3,u=V(t);case 5:return e.next=7,u.next();case 7:return s=e.sent,i=s.done,e.next=11,s.value;case 11:if(l=e.sent,i){e.next=19;break}c=l,n.push(c),r+=c.byteLength;case 16:i=!0,e.next=5;break;case 19:e.next=25;break;case 21:e.prev=21,e.t0=e.catch(3),o=!0,a=e.t0;case 25:if(e.prev=25,e.prev=26,i||null==u.return){e.next=30;break}return e.next=30,u.return();case 30:if(e.prev=30,!o){e.next=33;break}throw a;case 33:return e.finish(30);case 34:return e.finish(25);case 35:return e.abrupt("return",qt(n,r)[0]);case 36:case"end":return e.stop()}}),e,null,[[3,21,25,35],[26,,30,34]])})))()}}]),n}(yt),Wo=function(){function t(e){L(this,t),e&&(this.source=new Go(Oe.fromIterable(e)))}return j(t,[{key:Symbol.iterator,value:function(){return this}},{key:"next",value:function(t){return this.source.next(t)}},{key:"throw",value:function(t){return this.source.throw(t)}},{key:"return",value:function(t){return this.source.return(t)}},{key:"peek",value:function(t){return this.source.peek(t)}},{key:"read",value:function(t){return this.source.read(t)}}]),t}(),Ko=function(){function t(e){L(this,t),e instanceof t?this.source=e.source:e instanceof Yo?this.source=new $o(Oe.fromAsyncIterable(e)):Dt(e)?this.source=new $o(Oe.fromNodeStream(e)):Pt(e)?this.source=new $o(Oe.fromDOMStream(e)):Bt(e)?this.source=new $o(Oe.fromDOMStream(e.body)):At(e)?this.source=new $o(Oe.fromIterable(e)):(Et(e)||Nt(e))&&(this.source=new $o(Oe.fromAsyncIterable(e)))}return j(t,[{key:Symbol.asyncIterator,value:function(){return this}},{key:"next",value:function(t){return this.source.next(t)}},{key:"throw",value:function(t){return this.source.throw(t)}},{key:"return",value:function(t){return this.source.return(t)}},{key:"cancel",value:function(t){return this.source.cancel(t)}},{key:"peek",value:function(t){return this.source.peek(t)}},{key:"read",value:function(t){return this.source.read(t)}},{key:"closed",get:function(){return this.source.closed}}]),t}(),Go=function(){function t(e){L(this,t),this.source=e}return j(t,[{key:"cancel",value:function(t){this.return(t)}},{key:"peek",value:function(t){return this.next(t,"peek").value}},{key:"read",value:function(t){return this.next(t,"read").value}},{key:"next",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"read";return this.source.next({cmd:e,size:t})}},{key:"throw",value:function(t){return Object.create(this.source.throw&&this.source.throw(t)||ht)}},{key:"return",value:function(t){return Object.create(this.source.return&&this.source.return(t)||ht)}}]),t}(),$o=function(){function t(e){var n=this;L(this,t),this.source=e,this._closedPromise=new Promise((function(t){return n._closedPromiseResolve=t}))}return j(t,[{key:"cancel",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.return(e);case 2:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"read",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.next(e,"read");case 2:return t.abrupt("return",t.sent.value);case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"peek",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.next(e,"peek");case 2:return t.abrupt("return",t.sent.value);case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"next",value:function(){var t=B(D.mark((function t(e){var n,r=arguments;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:"read",t.next=3,this.source.next({cmd:n,size:e});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"throw",value:function(){var t=B(D.mark((function t(e){var n;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t1=this.source.throw,!t.t1){t.next=5;break}return t.next=4,this.source.throw(e);case 4:t.t1=t.sent;case 5:if(t.t0=t.t1,t.t0){t.next=8;break}t.t0=ht;case 8:return n=t.t0,this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,t.abrupt("return",Object.create(n));case 12:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"return",value:function(){var t=B(D.mark((function t(e){var n;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t1=this.source.return,!t.t1){t.next=5;break}return t.next=4,this.source.return(e);case 4:t.t1=t.sent;case 5:if(t.t0=t.t1,t.t0){t.next=8;break}t.t0=ht;case 8:return n=t.t0,this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,t.abrupt("return",Object.create(n));case 12:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"closed",get:function(){return this._closedPromise}}]),t}(),Zo=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this)).position=0,i.buffer=Gt(t),i.size="undefined"===typeof r?i.buffer.byteLength:r,i}return j(n,[{key:"readInt32",value:function(t){var e=this.readAt(t,4),n=e.buffer,r=e.byteOffset;return new DataView(n,r).getInt32(0,!0)}},{key:"seek",value:function(t){return this.position=Math.min(t,this.size),t>>16,65535&this.buffer[1],this.buffer[0]>>>16,65535&this.buffer[0]]),n=new Uint32Array([t.buffer[1]>>>16,65535&t.buffer[1],t.buffer[0]>>>16,65535&t.buffer[0]]),r=e[3]*n[3];this.buffer[0]=65535&r;var i=r>>>16;return i+=r=e[2]*n[3],i+=r=e[3]*n[2]>>>0,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}},{key:"_plus",value:function(t){var e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}},{key:"lessThan",value:function(t){return this.buffer[1]1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return n.fromString("string"===typeof t?t:t.toString(),e)}},{key:"fromNumber",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return n.fromString(t.toString(),e)}},{key:"fromString",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2),r=t.length,i=new n(e),o=0;o1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return n.fromString("string"===typeof t?t:t.toString(),e)}},{key:"fromNumber",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return n.fromString(t.toString(),e)}},{key:"fromString",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2),r=t.startsWith("-"),i=t.length,o=new n(e),a=r?1:0;a>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}},{key:"hex",value:function(){return"".concat(Qo(this.buffer[3])," ").concat(Qo(this.buffer[2])," ").concat(Qo(this.buffer[1])," ").concat(Qo(this.buffer[0]))}}],[{key:"multiply",value:function(e,n){return new t(new Uint32Array(e.buffer)).times(n)}},{key:"add",value:function(e,n){return new t(new Uint32Array(e.buffer)).plus(n)}},{key:"from",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4);return t.fromString("string"===typeof e?e:e.toString(),n)}},{key:"fromNumber",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4);return t.fromString(e.toString(),n)}},{key:"fromString",value:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4),r=e.startsWith("-"),i=e.length,o=new t(n),a=r?1:0;a1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length;return cr.Null(t,0,n)}},{key:"visitBool",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Bool(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitInt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Int(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitFloat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Float(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitUtf8",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Utf8(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}},{key:"visitBinary",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Binary(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}},{key:"visitFixedSizeBinary",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.FixedSizeBinary(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitDate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Date(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitTimestamp",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Timestamp(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitTime",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Time(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitDecimal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Decimal(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.List(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.visit(t.children[0]))}},{key:"visitStruct",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Struct(t,0,n,r,this.readNullBitmap(t,r),this.visitMany(t.children))}},{key:"visitUnion",value:function(t){return t.mode===Qe.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}},{key:"visitDenseUnion",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Union(t,0,n,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.readOffsets(t),this.visitMany(t.children))}},{key:"visitSparseUnion",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Union(t,0,n,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.visitMany(t.children))}},{key:"visitDictionary",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Dictionary(t,0,n,r,this.readNullBitmap(t,r),this.readData(t.indices),this.readDictionary(t))}},{key:"visitInterval",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Interval(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}},{key:"visitFixedSizeList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.FixedSizeList(t,0,n,r,this.readNullBitmap(t,r),this.visit(t.children[0]))}},{key:"visitMap",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode(),n=e.length,r=e.nullCount;return cr.Map(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.visit(t.children[0]))}},{key:"nextFieldNode",value:function(){return this.nodes[++this.nodesIndex]}},{key:"nextBufferRange",value:function(){return this.buffers[++this.buffersIndex]}},{key:"readNullBitmap",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.nextBufferRange();return e>0&&this.readData(t,n)||new Uint8Array(0)}},{key:"readOffsets",value:function(t,e){return this.readData(t,e)}},{key:"readTypeIds",value:function(t,e){return this.readData(t,e)}},{key:"readData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange(),n=e.length,r=e.offset;return this.bytes.subarray(r,r+n)}},{key:"readDictionary",value:function(t){return this.dictionaries.get(t.id)}}]),n}(dn),oa=function(t){ot(n,t);var e=ft(n);function n(t,r,i,o){var a;return L(this,n),(a=e.call(this,new Uint8Array(0),r,i,o)).sources=t,a}return j(n,[{key:"readNullBitmap",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.nextBufferRange(),r=n.offset;return e<=0?new Uint8Array(0):sn(this.sources[r])}},{key:"readOffsets",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange(),n=e.offset;return Vt(Uint8Array,Vt(Int32Array,this.sources[n]))}},{key:"readTypeIds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange(),n=e.offset;return Vt(Uint8Array,Vt(t.ArrayType,this.sources[n]))}},{key:"readData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange(),n=e.offset,r=this.sources;return Nn.isTimestamp(t)||(Nn.isInt(t)||Nn.isTime(t))&&64===t.bitWidth||Nn.isDate(t)&&t.unit===$e.MILLISECOND?Vt(Uint8Array,na.convertArray(r[n])):Nn.isDecimal(t)?Vt(Uint8Array,ra.convertArray(r[n])):Nn.isBinary(t)||Nn.isFixedSizeBinary(t)?aa(r[n]):Nn.isBool(t)?sn(r[n]):Nn.isUtf8(t)?rt(r[n].join("")):Vt(Uint8Array,Vt(t.ArrayType,r[n].map((function(t){return+t}))))}}]),n}(ia);function aa(t){for(var e=t.join(""),n=new Uint8Array(e.length/2),r=0;r>1]=parseInt(e.substr(r,2),16);return n}var ua=Y.Long,sa=Fe.apache.arrow.flatbuf.Null,la=Fe.apache.arrow.flatbuf.Int,ca=Fe.apache.arrow.flatbuf.FloatingPoint,fa=Fe.apache.arrow.flatbuf.Binary,ha=Fe.apache.arrow.flatbuf.Bool,pa=Fe.apache.arrow.flatbuf.Utf8,da=Fe.apache.arrow.flatbuf.Decimal,ya=Fe.apache.arrow.flatbuf.Date,va=Fe.apache.arrow.flatbuf.Time,ma=Fe.apache.arrow.flatbuf.Timestamp,ba=Fe.apache.arrow.flatbuf.Interval,ga=Fe.apache.arrow.flatbuf.List,wa=Fe.apache.arrow.flatbuf.Struct_,xa=Fe.apache.arrow.flatbuf.Union,ka=Fe.apache.arrow.flatbuf.DictionaryEncoding,_a=Fe.apache.arrow.flatbuf.FixedSizeBinary,Sa=Fe.apache.arrow.flatbuf.FixedSizeList,Ta=Fe.apache.arrow.flatbuf.Map,Oa=new(function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"visit",value:function(t,e){return null==t||null==e?void 0:Re(at(n.prototype),"visit",this).call(this,t,e)}},{key:"visitNull",value:function(t,e){return sa.startNull(e),sa.endNull(e)}},{key:"visitInt",value:function(t,e){return la.startInt(e),la.addBitWidth(e,t.bitWidth),la.addIsSigned(e,t.isSigned),la.endInt(e)}},{key:"visitFloat",value:function(t,e){return ca.startFloatingPoint(e),ca.addPrecision(e,t.precision),ca.endFloatingPoint(e)}},{key:"visitBinary",value:function(t,e){return fa.startBinary(e),fa.endBinary(e)}},{key:"visitBool",value:function(t,e){return ha.startBool(e),ha.endBool(e)}},{key:"visitUtf8",value:function(t,e){return pa.startUtf8(e),pa.endUtf8(e)}},{key:"visitDecimal",value:function(t,e){return da.startDecimal(e),da.addScale(e,t.scale),da.addPrecision(e,t.precision),da.endDecimal(e)}},{key:"visitDate",value:function(t,e){return ya.startDate(e),ya.addUnit(e,t.unit),ya.endDate(e)}},{key:"visitTime",value:function(t,e){return va.startTime(e),va.addUnit(e,t.unit),va.addBitWidth(e,t.bitWidth),va.endTime(e)}},{key:"visitTimestamp",value:function(t,e){var n=t.timezone&&e.createString(t.timezone)||void 0;return ma.startTimestamp(e),ma.addUnit(e,t.unit),void 0!==n&&ma.addTimezone(e,n),ma.endTimestamp(e)}},{key:"visitInterval",value:function(t,e){return ba.startInterval(e),ba.addUnit(e,t.unit),ba.endInterval(e)}},{key:"visitList",value:function(t,e){return ga.startList(e),ga.endList(e)}},{key:"visitStruct",value:function(t,e){return wa.startStruct_(e),wa.endStruct_(e)}},{key:"visitUnion",value:function(t,e){xa.startTypeIdsVector(e,t.typeIds.length);var n=xa.createTypeIdsVector(e,t.typeIds);return xa.startUnion(e),xa.addMode(e,t.mode),xa.addTypeIds(e,n),xa.endUnion(e)}},{key:"visitDictionary",value:function(t,e){var n=this.visit(t.indices,e);return ka.startDictionaryEncoding(e),ka.addId(e,new ua(t.id,0)),ka.addIsOrdered(e,t.isOrdered),void 0!==n&&ka.addIndexType(e,n),ka.endDictionaryEncoding(e)}},{key:"visitFixedSizeBinary",value:function(t,e){return _a.startFixedSizeBinary(e),_a.addByteWidth(e,t.byteWidth),_a.endFixedSizeBinary(e)}},{key:"visitFixedSizeList",value:function(t,e){return Sa.startFixedSizeList(e),Sa.addListSize(e,t.listSize),Sa.endFixedSizeList(e)}},{key:"visitMap",value:function(t,e){return Ta.startMap(e),Ta.addKeysSorted(e,t.keysSorted),Ta.endMap(e)}}]),n}(dn));function Ea(t){return new Ka(t.count,function t(e){return(e||[]).reduce((function(e,n){return[].concat(pn(e),[new Za(n.count,(r=n.VALIDITY,(r||[]).reduce((function(t,e){return t+ +(0===e)}),0)))],pn(t(n.children)));var r}),[])}(t.columns),function t(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=-1,i=(e||[]).length;++r1&&void 0!==arguments[1]?arguments[1]:0;if(e instanceof no)return new t(0,en.V4,tn.Schema,e);if(e instanceof Ka)return new t(n,en.V4,tn.RecordBatch,e);if(e instanceof Ga)return new t(n,en.V4,tn.DictionaryBatch,e);throw new Error("Unrecognized Message header: ".concat(e))}}]),t}(),Ka=function(){function t(e,n,r){L(this,t),this._nodes=n,this._buffers=r,this._length="number"===typeof e?e:e.low}return j(t,[{key:"nodes",get:function(){return this._nodes}},{key:"length",get:function(){return this._length}},{key:"buffers",get:function(){return this._buffers}}]),t}(),Ga=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];L(this,t),this._data=e,this._isDelta=r,this._id="number"===typeof n?n:n.low}return j(t,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"isDelta",get:function(){return this._isDelta}},{key:"length",get:function(){return this.data.length}},{key:"nodes",get:function(){return this.data.nodes}},{key:"buffers",get:function(){return this.data.buffers}}]),t}(),$a=function t(e,n){L(this,t),this.offset="number"===typeof e?e:e.low,this.length="number"===typeof n?n:n.low},Za=function t(e,n){L(this,t),this.length="number"===typeof e?e:e.low,this.nullCount="number"===typeof n?n:n.low};function Xa(t){for(var e,n=[],r=-1,i=-1,o=t.nodesLength();++r0?Da.createCustomMetadataVector(t,pn(e.metadata).map((function(e){var n=z(e,2),r=n[0],i=n[1],o=t.createString("".concat(r)),a=t.createString("".concat(i));return Ua.startKeyValue(t),Ua.addKey(t,o),Ua.addValue(t,a),Ua.endKeyValue(t)}))):-1;e.name&&(n=t.createString(e.name));Da.startField(t),Da.addType(t,r),Da.addTypeType(t,a),Da.addChildren(t,s),Da.addNullable(t,!!e.nullable),-1!==n&&Da.addName(t,n);-1!==i&&Da.addDictionary(t,i);-1!==l&&Da.addCustomMetadata(t,l);return Da.endField(t)},ro.decode=function(t,e){var n,r,i,o,a,u;e&&(u=t.dictionary())?e.has(n=u.id().low)?(o=(o=u.indexType())?nu(o):new Ln,a=new sr(e.get(n),o,n,u.isOrdered()),r=new ro(t.name(),a,t.nullable(),eu(t))):(o=(o=u.indexType())?nu(o):new Ln,e.set(n,i=ru(t,tu(t,e))),a=new sr(i,o,n,u.isOrdered()),r=new ro(t.name(),a,t.nullable(),eu(t))):(i=ru(t,tu(t,e)),r=new ro(t.name(),i,t.nullable(),eu(t)));return r||null},ro.fromJSON=function(t,e){var n,r,i,o,a,u;return e&&(o=t.dictionary)?e.has(n=o.id)?(r=(r=o.indexType)?Ma(r):new Ln,u=new sr(e.get(n),r,n,o.isOrdered),i=new ro(t.name,u,t.nullable,Ia(t.customMetadata))):(r=(r=o.indexType)?Ma(r):new Ln,e.set(n,a=Ca(t,Na(t,e))),u=new sr(a,r,n,o.isOrdered),i=new ro(t.name,u,t.nullable,Ia(t.customMetadata))):(a=Ca(t,Na(t,e)),i=new ro(t.name,a,t.nullable,Ia(t.customMetadata))),i||null},no.encode=function(t,e){var n=e.fields.map((function(e){return ro.encode(t,e)}));za.startFieldsVector(t,n.length);var r=za.createFieldsVector(t,n),i=e.metadata&&e.metadata.size>0?za.createCustomMetadataVector(t,pn(e.metadata).map((function(e){var n=z(e,2),r=n[0],i=n[1],o=t.createString("".concat(r)),a=t.createString("".concat(i));return Ua.startKeyValue(t),Ua.addKey(t,o),Ua.addValue(t,a),Ua.endKeyValue(t)}))):-1;za.startSchema(t),za.addFields(t,r),za.addEndianness(t,iu?Va.Little:Va.Big),-1!==i&&za.addCustomMetadata(t,i);return za.endSchema(t)},no.decode=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map,n=Ja(t,e);return new no(n,eu(t),e)},no.fromJSON=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map;return new no(Aa(t,e),Ia(t.customMetadata),e)},Ka.encode=function(t,e){var n=e.nodes||[],r=e.buffers||[];Ha.startNodesVector(t,n.length),n.slice().reverse().forEach((function(e){return Za.encode(t,e)}));var i=t.endVector();Ha.startBuffersVector(t,r.length),r.slice().reverse().forEach((function(e){return $a.encode(t,e)}));var o=t.endVector();return Ha.startRecordBatch(t),Ha.addLength(t,new Ba(e.length,0)),Ha.addNodes(t,i),Ha.addBuffers(t,o),Ha.endRecordBatch(t)},Ka.decode=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en.V4;return new Ka(t.length(),Xa(t),Qa(t,e))},Ka.fromJSON=Ea,Ga.encode=function(t,e){var n=Ka.encode(t,e.data);return Ya.startDictionaryBatch(t),Ya.addId(t,new Ba(e.id,0)),Ya.addIsDelta(t,e.isDelta),Ya.addData(t,n),Ya.endDictionaryBatch(t)},Ga.decode=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en.V4;return new Ga(Ka.decode(t.data(),e),t.id(),t.isDelta())},Ga.fromJSON=function(t){return new Ga(Ea(t.data),t.id,t.isDelta)},Za.encode=function(t,e){return qa.createFieldNode(t,new Ba(e.length,0),new Ba(e.nullCount,0))},Za.decode=function(t){return new Za(t.length(),t.nullCount())},$a.encode=function(t,e){return Ra.createBuffer(t,new Ba(e.offset,0),new Ba(e.length,0))},$a.decode=function(t){return new $a(t.offset(),t.length())};for(var iu=function(){var t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]}(),ou=Y.ByteBuffer,au=function(t){return"Expected ".concat(tn[t]," Message in stream, but was null or length 0.")},uu=function(t){return"Header pointer of flatbuffer-encoded ".concat(tn[t]," Message is null or length 0.")},su=function(t,e){return"Expected to read ".concat(t," metadata bytes, but only read ").concat(e,".")},lu=function(t,e){return"Expected to read ".concat(t," bytes for message body, but only read ").concat(e,".")},cu=function(){function t(e){L(this,t),this.source=e instanceof Wo?e:new Wo(e)}return j(t,[{key:Symbol.iterator,value:function(){return this}},{key:"next",value:function(){var t;return(t=this.readMetadataLength()).done||-1===t.value&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?ht:t}},{key:"throw",value:function(t){return this.source.throw(t)}},{key:"return",value:function(t){return this.source.return(t)}},{key:"readMessage",value:function(t){var e;if((e=this.next()).done)return null;if(null!=t&&e.value.headerType!==t)throw new Error(au(t));return e.value}},{key:"readMessageBody",value:function(t){if(t<=0)return new Uint8Array(0);var e=Gt(this.source.read(t));if(e.byteLength0&&void 0!==arguments[0]&&arguments[0],e=tn.Schema,n=this.readMessage(e),r=n&&n.header();if(t&&!r)throw new Error(uu(e));return r}},{key:"readMetadataLength",value:function(){var t=this.source.read(pu),e=t&&new ou(t),n=e&&e.readInt32(0)||0;return{done:0===n,value:n}}},{key:"readMetadata",value:function(t){var e=this.source.read(t);if(!e)return ht;if(e.byteLength0&&void 0!==o[0]&&o[0],n=tn.Schema,t.next=4,this.readMessage(n);case 4:if(r=t.sent,i=r&&r.header(),!e||i){t.next=8;break}throw new Error(uu(n));case 8:return t.abrupt("return",i);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"readMetadataLength",value:function(){var t=B(D.mark((function t(){var e,n,r;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.source.read(pu);case 2:return e=t.sent,n=e&&new ou(e),r=n&&n.readInt32(0)||0,t.abrupt("return",{done:0===r,value:r});case 6:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"readMetadata",value:function(){var t=B(D.mark((function t(e){var n;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.source.read(e);case 2:if(n=t.sent){t.next=5;break}return t.abrupt("return",ht);case 5:if(!(n.byteLength1&&void 0!==arguments[1]?arguments[1]:0,n=-1,r=du.length;++n2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");Nn.isNull(t.type)||xu.call(this,i<=0?new Uint8Array(0):un(e.offset,r,e.nullBitmap)),this.nodes.push(new Za(r,i))}return Re(at(n.prototype),"visit",this).call(this,t)}},{key:"visitNull",value:function(t){return this}},{key:"visitDictionary",value:function(t){return this.visit(t.indices)}},{key:"nodes",get:function(){return this._nodes}},{key:"buffers",get:function(){return this._buffers}},{key:"byteLength",get:function(){return this._byteLength}},{key:"bufferRegions",get:function(){return this._bufferRegions}}],[{key:"assemble",value:function(){for(var t=new n,e=arguments.length,r=new Array(e),i=0;i=t.length?xu.call(this,new Uint8Array(0)):(e=t.values)instanceof Uint8Array?xu.call(this,un(t.offset,t.length,e)):xu.call(this,sn(t))},wu.prototype.visitInt=ku,wu.prototype.visitFloat=ku,wu.prototype.visitUtf8=_u,wu.prototype.visitBinary=_u,wu.prototype.visitFixedSizeBinary=ku,wu.prototype.visitDate=ku,wu.prototype.visitTimestamp=ku,wu.prototype.visitTime=ku,wu.prototype.visitDecimal=ku,wu.prototype.visitList=Su,wu.prototype.visitStruct=Tu,wu.prototype.visitUnion=function(t){var e=t.type,n=t.length,r=t.typeIds,i=t.valueOffsets;if(xu.call(this,r),e.mode===Qe.Sparse)return Tu.call(this,t);if(e.mode===Qe.Dense){if(t.offset<=0)return xu.call(this,i),Tu.call(this,t);for(var o,a,u=r.reduce((function(t,e){return Math.max(t,e)}),r[0]),s=new Int32Array(u+1),l=new Int32Array(u+1).fill(-1),c=new Int32Array(n),f=_e(-i[0],n,i),h=-1;++h0&&void 0!==arguments[0]&&arguments[0];return this._sink.toString(t)}},{key:"toUint8Array",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._sink.toUint8Array(t)}},{key:"writeAll",value:function(t){var e=this;return Et(t)?t.then((function(t){return e.writeAll(t)})):Nt(t)?Iu(this,t):Nu(this,t)}},{key:Symbol.asyncIterator,value:function(){return this._sink[Symbol.asyncIterator]()}},{key:"toDOMStream",value:function(t){return this._sink.toDOMStream(t)}},{key:"toNodeStream",value:function(t){return this._sink.toNodeStream(t)}},{key:"close",value:function(){return this.reset()._sink.close()}},{key:"abort",value:function(t){return this.reset()._sink.abort(t)}},{key:"finish",value:function(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}},{key:"reset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._sink,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t===this._sink||t instanceof Yo?this._sink=t:(this._sink=new Yo,t&&Lt(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&jt(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,e&&e.compareTo(this._schema)||(null===e?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}},{key:"write",value:function(t){var e=null;if(!this._sink)throw new Error("RecordBatchWriter is closed");if(null===t||void 0===t)return this.finish()&&void 0;if(t instanceof xl&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof kl&&!(e=t.schema))return this.finish()&&void 0;if(e&&!e.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof kl?t instanceof _l||this._writeRecordBatch(t):t instanceof xl?this.writeAll(t.chunks):At(t)&&this.writeAll(t)}},{key:"_writeMessage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=e-1,r=Wa.encode(t),i=r.byteLength,o=this._writeLegacyIpcFormat?4:8,a=i+o+n&~n,u=a-i-o;return t.headerType===tn.RecordBatch?this._recordBatchBlocks.push(new Ho(a,t.bodyLength,this._position)):t.headerType===tn.DictionaryBatch&&this._dictionaryBlocks.push(new Ho(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),i>0&&this._write(r),this._writePadding(u)}},{key:"_write",value:function(t){if(this._started){var e=Gt(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}},{key:"_writeSchema",value:function(t){return this._writeMessage(Wa.from(t))}},{key:"_writeFooter",value:function(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}},{key:"_writeMagic",value:function(){return this._write(du)}},{key:"_writePadding",value:function(t){return t>0?this._write(new Uint8Array(t)):this}},{key:"_writeRecordBatch",value:function(t){var e=wu.assemble(t),n=e.byteLength,r=e.nodes,i=e.bufferRegions,o=e.buffers,a=new Ka(t.length,r,i),u=Wa.from(a,n);return this._writeDictionaries(t)._writeMessage(u)._writeBodyBuffers(o)}},{key:"_writeDictionaryBatch",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));var r=wu.assemble(t),i=r.byteLength,o=r.nodes,a=r.bufferRegions,u=r.buffers,s=new Ka(t.length,o,a),l=new Ga(s,e,n),c=Wa.from(l,i);return this._writeMessage(c)._writeBodyBuffers(u)}},{key:"_writeBodyBuffers",value:function(t){for(var e,n,r,i=-1,o=t.length;++i0&&(this._write(e),(r=(n+7&-8)-n)>0&&this._writePadding(r));return this}},{key:"_writeDictionaries",value:function(t){var e,n=M(t.dictionaries);try{for(n.s();!(e=n.n()).done;){var r=z(e.value,2),i=r[0],o=r[1],a=this._dictionaryDeltaOffsets.get(i)||0;if(0===a||(o=o.slice(a)).length>0){var u,s=M("chunks"in o?o.chunks:[o]);try{for(s.s();!(u=s.n()).done;){var l=u.value;this._writeDictionaryBatch(l,i,a>0),a+=l.length}}catch(c){s.e(c)}finally{s.f()}}}}catch(c){n.e(c)}finally{n.f()}return this}},{key:"closed",get:function(){return this._sink.closed}}],[{key:"throughNode",value:function(t){throw new Error('"throughNode" not available in this environment')}},{key:"throughDOM",value:function(t,e){throw new Error('"throughDOM" not available in this environment')}}]),n}(dt),Eu=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,null,[{key:"writeAll",value:function(t,e){var r=new n(e);return Et(t)?t.then((function(t){return r.writeAll(t)})):Nt(t)?Iu(r,t):Nu(r,t)}}]),n}(Ou),Au=function(t){ot(n,t);var e=ft(n);function n(){var t;return L(this,n),(t=e.call(this))._autoDestroy=!0,t}return j(n,[{key:"_writeSchema",value:function(t){return this._writeMagic()._writePadding(2)}},{key:"_writeFooter",value:function(t){var e=qo.encode(new qo(t,en.V4,this._recordBatchBlocks,this._dictionaryBlocks));return Re(at(n.prototype),"_writeFooter",this).call(this,t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}],[{key:"writeAll",value:function(t){var e=new n;return Et(t)?t.then((function(t){return e.writeAll(t)})):Nt(t)?Iu(e,t):Nu(e,t)}}]),n}(Ou);function Nu(t,e){var n=e;e instanceof xl&&(n=e.chunks,t.reset(void 0,e.schema));var r,i=M(n);try{for(i.s();!(r=i.n()).done;){var o=r.value;t.write(o)}}catch(a){i.e(a)}finally{i.f()}return t.finish()}function Iu(t,e){return Mu.apply(this,arguments)}function Mu(){return(Mu=B(D.mark((function t(e,n){var r,i,o,a,u,s,l;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!0,i=!1,t.prev=2,a=V(n);case 4:return t.next=6,a.next();case 6:return u=t.sent,r=u.done,t.next=10,u.value;case 10:if(s=t.sent,r){t.next=17;break}l=s,e.write(l);case 14:r=!0,t.next=4;break;case 17:t.next=23;break;case 19:t.prev=19,t.t0=t.catch(2),i=!0,o=t.t0;case 23:if(t.prev=23,t.prev=24,r||null==a.return){t.next=28;break}return t.next=28,a.return();case 28:if(t.prev=28,!i){t.next=31;break}throw o;case 31:return t.finish(28);case 32:return t.finish(23);case 33:return t.abrupt("return",e.finish());case 34:case"end":return t.stop()}}),t,null,[[2,19,23,33],[24,,28,32]])})))).apply(this,arguments)}var Cu=new Uint8Array(0),Bu=function(t){return[Cu,Cu,new Uint8Array(t),Cu]};function Lu(t,e){for(var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.reduce((function(t,e){return Math.max(t,e.length)}),0),o=-1,a=e.length,u=pn(t.fields),s=[],l=(i+63&-64)>>3;++o0;){for(u=Number.POSITIVE_INFINITY,s=-1;++s0&&(i[a++]=[u,c.slice()]))}return[t=new no(r,t.metadata),i.map((function(e){return Rr(kl,[t].concat(pn(e)))}))]}(t,e.map((function(t){return t instanceof Ui?t.chunks.map((function(t){return t.data})):[t.data]})))}function Du(t,e,n,r,i){for(var o,a,u=0,s=-1,l=r.length,c=(e+63&-64)>>3;++s=e?u===e?n[s]=o:(n[s]=o.slice(0,e),o=o.slice(e,u-e),i.numBatches=Math.max(i.numBatches,r[s].unshift(o))):((a=t[s]).nullable||(t[s]=a.clone({nullable:!0})),n[s]=o?o._changeLengthAndBackfillNullBitmap(e):cr.new(a.type,0,e,e,Bu(c)));return n}function zu(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var Ru=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this))._children=r,i.numChildren=t.childData.length,i._bindDataAccessors(i.data=t),i}return j(n,[{key:"clone",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._children;return We.new(t,e)}},{key:"concat",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0){var e=this.offset+t;return 0!==(this.nullBitmap[e>>3]&1<=this.numChildren?null:(this._children||(this._children=[]))[t]||(this._children[t]=We.new(this.data.childData[t]))}},{key:"toJSON",value:function(){return pn(this)}},{key:"_sliceInternal",value:function(t,e,n){return t.clone(t.data.slice(e,n-e),null)}},{key:"_bindDataAccessors",value:function(t){}},{key:"type",get:function(){return this.data.type}},{key:"typeId",get:function(){return this.data.typeId}},{key:"length",get:function(){return this.data.length}},{key:"offset",get:function(){return this.data.offset}},{key:"stride",get:function(){return this.data.stride}},{key:"nullCount",get:function(){return this.data.nullCount}},{key:"byteLength",get:function(){return this.data.byteLength}},{key:"VectorName",get:function(){return"".concat(Ke[this.typeId],"Vector")}},{key:"ArrayType",get:function(){return this.type.ArrayType}},{key:"values",get:function(){return this.data.values}},{key:"typeIds",get:function(){return this.data.typeIds}},{key:"nullBitmap",get:function(){return this.data.nullBitmap}},{key:"valueOffsets",get:function(){return this.data.valueOffsets}},{key:Symbol.toStringTag,get:function(){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}}]),n}(We);Ru.prototype[Symbol.isConcatSpreadable]=!0;var Fu=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"asUtf8",value:function(){return We.new(this.data.clone(new Yn))}}]),n}(Ru),Uu=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,null,[{key:"from",value:function(t){return wl((function(){return new Wn}),t)}}]),n}(Ru),qu=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,null,[{key:"from",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n>>0)},Fs=function(t){return new Date(t)},Us=function(t,e,n){var r=e[n],i=e[n+1];return null!=r&&null!=i?t.subarray(r,i):null},qs=function(t,e){return function(t,e){return Fs(function(t,e){return 864e5*t[e]}(t,e))}(t.values,e)},Vs=function(t,e){return function(t,e){return Fs(Rs(t,e))}(t.values,2*e)},Hs=function(t,e){var n=t.stride;return t.values[n*e]},Ys=function(t,e){var n=t.stride;return Br(t.values[n*e])},Ws=function(t,e){var n=t.stride,r=t.values,i=t.type;return Zr.new(r.subarray(n*e,n*(e+1)),i.isSigned)},Ks=function(t,e){var n=t.values;return 1e3*Rs(n,2*e)},Gs=function(t,e){var n=t.values;return Rs(n,2*e)},$s=function(t,e){return function(t,e){return t[e+1]/1e3*4294967296+(t[e]>>>0)/1e3}(t.values,2*e)},Zs=function(t,e){return function(t,e){return t[e+1]/1e6*4294967296+(t[e]>>>0)/1e6}(t.values,2*e)},Xs=function(t,e){return t.values[t.stride*e]},Qs=function(t,e){return t.values[t.stride*e]},Js=function(t,e){var n=t.values;return Zr.signed(n.subarray(2*e,2*(e+1)))},tl=function(t,e){var n=t.values;return Zr.signed(n.subarray(2*e,2*(e+1)))},el=function(t,e){var n=t.typeIdToChildIndex[t.typeIds[e]],r=t.getChildAt(n);return r?r.get(t.valueOffsets[e]):null},nl=function(t,e){var n=t.typeIdToChildIndex[t.typeIds[e]],r=t.getChildAt(n);return r?r.get(e):null},rl=function(t,e){return t.values.subarray(2*e,2*(e+1))},il=function(t,e){var n=t.values[e],r=new Int32Array(2);return r[0]=n/12|0,r[1]=n%12|0,r};zs.prototype.visitNull=function(t,e){return null},zs.prototype.visitBool=function(t,e){var n=t.offset+e;return 0!==(t.values[n>>3]&1<0?0:-1},al.prototype.visitBool=ul,al.prototype.visitInt=ul,al.prototype.visitInt8=ul,al.prototype.visitInt16=ul,al.prototype.visitInt32=ul,al.prototype.visitInt64=ul,al.prototype.visitUint8=ul,al.prototype.visitUint16=ul,al.prototype.visitUint32=ul,al.prototype.visitUint64=ul,al.prototype.visitFloat=ul,al.prototype.visitFloat16=ul,al.prototype.visitFloat32=ul,al.prototype.visitFloat64=ul,al.prototype.visitUtf8=ul,al.prototype.visitBinary=ul,al.prototype.visitFixedSizeBinary=ul,al.prototype.visitDate=ul,al.prototype.visitDateDay=ul,al.prototype.visitDateMillisecond=ul,al.prototype.visitTimestamp=ul,al.prototype.visitTimestampSecond=ul,al.prototype.visitTimestampMillisecond=ul,al.prototype.visitTimestampMicrosecond=ul,al.prototype.visitTimestampNanosecond=ul,al.prototype.visitTime=ul,al.prototype.visitTimeSecond=ul,al.prototype.visitTimeMillisecond=ul,al.prototype.visitTimeMicrosecond=ul,al.prototype.visitTimeNanosecond=ul,al.prototype.visitDecimal=ul,al.prototype.visitList=ul,al.prototype.visitStruct=ul,al.prototype.visitUnion=ul,al.prototype.visitDenseUnion=sl,al.prototype.visitSparseUnion=sl,al.prototype.visitDictionary=ul,al.prototype.visitInterval=ul,al.prototype.visitIntervalDayTime=ul,al.prototype.visitIntervalYearMonth=ul,al.prototype.visitFixedSizeList=ul,al.prototype.visitMap=ul;var ll=new al,cl=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return n}(dn);function fl(t){if(t.nullCount>0)return function(t){var e=ol.getVisitFn(t);return ln(t.nullBitmap,t.offset,t.length,t,(function(t,n,r,i){return 0!==(r&1<0)?t.values.subarray(0,r)[Symbol.iterator]():D.mark((function e(n){var i;return D.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=-1;case 1:if(!(++i1?e-1:0),r=1;r0&&(this.get=(e=this.get,function(t){return this.isValid(t)?e.call(this,t):null}),this.set=function(t){return function(e,n){an(this.nullBitmap,this.offset+e,!(null===n||void 0===n))&&t.call(this,e,n)}}(this.set));var e},Object.keys(Ke).map((function(t){return Ke[t]})).filter((function(t){return"number"===typeof t})).filter((function(t){return t!==Ke.NONE})).forEach((function(t){var e,n=gl.visit(t);n.prototype.get=(e=ol.getVisitFn(t),function(t){return e(this,t)}),n.prototype.set=Ds(Po.getVisitFn(t)),n.prototype.indexOf=Ds(ll.getVisitFn(t)),n.prototype.toArray=js(yl.getVisitFn(t)),n.prototype.getByteWidth=function(t){return function(){return t(this.type)}}(bl.getVisitFn(t)),n.prototype[Symbol.iterator]=js(hl.getVisitFn(t))}));var xl=function(t){ot(n,t);var e=ft(n);function n(){var t;L(this,n);for(var r=null,i=arguments.length,o=new Array(i),a=0;a0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new n(this._schema,t)}},{key:"getColumn",value:function(t){return this.getColumnAt(this.getColumnIndex(t))}},{key:"getColumnAt",value:function(t){return this.getChildAt(t)}},{key:"getColumnIndex",value:function(t){return this._schema.fields.findIndex((function(e){return e.name===t}))}},{key:"getChildAt",value:function(t){if(t<0||t>=this.numChildren)return null;var e,n,r=this._schema.fields,i=this._children||(this._children=[]);if(n=i[t])return n;if(e=r[t]){var o=this._chunks.map((function(e){return e.getChildAt(t)})).filter((function(t){return null!=t}));if(o.length>0)return i[t]=new Yi(e,o)}return null}},{key:"serialize",value:function(){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=t?Eu:Au;return e.writeAll(this).toUint8Array(!0)}},{key:"count",value:function(){return this._length}},{key:"select",value:function(){for(var t=this._schema.fields.reduce((function(t,e,n){return t.set(e.name,n)}),new Map),e=arguments.length,n=new Array(e),r=0;r-1}))))}},{key:"selectAt",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i3&&void 0!==arguments[3]?arguments[3]:u[r];return void 0===o?e.getColumnAt(r):t.getColumnAt(o)}))),pn(a.map((function(e){return t.getColumnAt(e)})))).filter(Boolean);return Rr(n,pn(ju(s,l)))}},{key:"schema",get:function(){return this._schema}},{key:"length",get:function(){return this._length}},{key:"chunks",get:function(){return this._chunks}},{key:"numCols",get:function(){return this._numChildren}}],[{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new no([]);return new n(t,[])}},{key:"from",value:function(t){if(!t)return n.empty();if("object"===typeof t){var e=At(t.values)?function(t){if(t.type instanceof er)return xl.fromStruct(xs.from(t));return null}(t):Nt(t.values)?function(t){if(t.type instanceof er)return xs.from(t).then((function(t){return xl.fromStruct(t)}));return null}(t):null;if(null!==e)return e}var r=Ol.from(t);return Et(r)?B(D.mark((function t(){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=n,t.next=3,r;case 3:return t.t1=t.sent,t.next=6,t.t0.from.call(t.t0,t.t1);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))():r.isSync()&&(r=r.open())?r.schema?new n(r.schema,pn(r)):n.empty():function(){var t=B(D.mark((function t(e){var r,i,o,a,u,s,l,c,f,h;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:if(r=t.sent,i=r.schema,o=[],!i){t.next=40;break}a=!0,u=!1,t.prev=8,l=V(r);case 10:return t.next=12,l.next();case 12:return c=t.sent,a=c.done,t.next=16,c.value;case 16:if(f=t.sent,a){t.next=23;break}h=f,o.push(h);case 20:a=!0,t.next=10;break;case 23:t.next=29;break;case 25:t.prev=25,t.t0=t.catch(8),u=!0,s=t.t0;case 29:if(t.prev=29,t.prev=30,a||null==l.return){t.next=34;break}return t.next=34,l.return();case 34:if(t.prev=34,!u){t.next=37;break}throw s;case 37:return t.finish(34);case 38:return t.finish(29);case 39:return t.abrupt("return",new n(i,o));case 40:return t.abrupt("return",n.empty());case 41:case"end":return t.stop()}}),t,null,[[8,25,29,39],[30,,34,38]])})));return function(e){return t.apply(this,arguments)}}()(r.open())}},{key:"fromAsync",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.from(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"fromStruct",value:function(t){return n.new(t.data.childData,t.type.children)}},{key:"new",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:this._children;return new n(this._schema,t,e)}},{key:"concat",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r-1}))))}},{key:"selectAt",value:function(){for(var t,e=this,r=arguments.length,i=new Array(r),o=0;o0&&this.dictionaries.set(e.id,n),this}}],[{key:"collect",value:function(t){return(new n).visit(t.data,new er(t.schema.fields)).dictionaries}}]),n}(dn),Tl=D.mark(zl),Ol=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this))._impl=t,r}return j(n,[{key:"isSync",value:function(){return this._impl.isSync()}},{key:"isAsync",value:function(){return this._impl.isAsync()}},{key:"isFile",value:function(){return this._impl.isFile()}},{key:"isStream",value:function(){return this._impl.isStream()}},{key:"next",value:function(){return this._impl.next()}},{key:"throw",value:function(t){return this._impl.throw(t)}},{key:"return",value:function(t){return this._impl.return(t)}},{key:"cancel",value:function(){return this._impl.cancel()}},{key:"reset",value:function(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}},{key:"open",value:function(t){var e=this,n=this._impl.open(t);return Et(n)?n.then((function(){return e})):this}},{key:"readRecordBatch",value:function(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}},{key:Symbol.iterator,value:function(){return this._impl[Symbol.iterator]()}},{key:Symbol.asyncIterator,value:function(){return this._impl[Symbol.asyncIterator]()}},{key:"toDOMStream",value:function(){var t=this;return Oe.toDOMStream(this.isSync()?je({},Symbol.iterator,(function(){return t})):je({},Symbol.asyncIterator,(function(){return t})))}},{key:"toNodeStream",value:function(){var t=this;return Oe.toNodeStream(this.isSync()?je({},Symbol.iterator,(function(){return t})):je({},Symbol.asyncIterator,(function(){return t})),{objectMode:!0})}},{key:"closed",get:function(){return this._impl.closed}},{key:"schema",get:function(){return this._impl.schema}},{key:"autoDestroy",get:function(){return this._impl.autoDestroy}},{key:"dictionaries",get:function(){return this._impl.dictionaries}},{key:"numDictionaries",get:function(){return this._impl.numDictionaries}},{key:"numRecordBatches",get:function(){return this._impl.numRecordBatches}},{key:"footer",get:function(){return this._impl.isFile()?this._impl.footer:null}}],[{key:"throughNode",value:function(t){throw new Error('"throughNode" not available in this environment')}},{key:"throughDOM",value:function(t,e){throw new Error('"throughDOM" not available in this environment')}},{key:"from",value:function(t){return t instanceof n?t:It(t)?function(t){return new El(new jl(t))}(t):Ct(t)?function(t){return ql.apply(this,arguments)}(t):Et(t)?B(D.mark((function e(){return D.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=n,e.next=3,t;case 3:return e.t1=e.sent,e.next=6,e.t0.from.call(e.t0,e.t1);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))():Bt(t)||Pt(t)||Dt(t)||Nt(t)?function(t){return Ul.apply(this,arguments)}(new Ko(t)):function(t){var e=t.peek(mu+7&-8);return e&&e.byteLength>=4?vu(e)?new Nl(new Ll(t.read())):new El(new Cl(t)):new El(new Cl(D.mark((function t(){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))()))}(new Wo(t))}},{key:"readAll",value:function(t){return t instanceof n?t.isSync()?zl(t):Rl(t):It(t)||ArrayBuffer.isView(t)||At(t)||Mt(t)?zl(t):Rl(t)}}]),n}(dt),El=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._impl=t,r}return j(n,[{key:Symbol.iterator,value:function(){return this._impl[Symbol.iterator]()}},{key:Symbol.asyncIterator,value:function(){var t=this;return q(D.mark((function e(){return D.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(H(V(t[Symbol.iterator]()),F),"t0",1);case 1:case"end":return e.stop()}}),e)})))()}}]),n}(Ol),Al=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._impl=t,r}return j(n,[{key:Symbol.iterator,value:function(){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}},{key:Symbol.asyncIterator,value:function(){return this._impl[Symbol.asyncIterator]()}}]),n}(Ol),Nl=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._impl=t,r}return n}(El),Il=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this,t))._impl=t,r}return n}(Al),Ml=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;L(this,t),this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}return j(t,[{key:"isSync",value:function(){return!1}},{key:"isAsync",value:function(){return!1}},{key:"isFile",value:function(){return!1}},{key:"isStream",value:function(){return!1}},{key:"reset",value:function(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}},{key:"_loadRecordBatch",value:function(t,e){return new kl(this.schema,t.length,this._loadVectors(t,e,this.schema.fields))}},{key:"_loadDictionaryBatch",value:function(t,e){var n=t.id,r=t.isDelta,i=t.data,o=this.dictionaries,a=this.schema,u=o.get(n);if(r||!u){var s=a.dictionaries.get(n);return u&&r?u.concat(We.new(this._loadVectors(i,e,[s])[0])):We.new(this._loadVectors(i,e,[s])[0])}return u}},{key:"_loadVectors",value:function(t,e,n){return new ia(e,t.nodes,t.buffers,this.dictionaries).visitMany(n)}},{key:"numDictionaries",get:function(){return this._dictionaryIndex}},{key:"numRecordBatches",get:function(){return this._recordBatchIndex}}]),t}(),Cl=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this,r))._reader=It(t)?new hu(i._handle=t):new cu(i._handle=t),i}return j(n,[{key:"isSync",value:function(){return!0}},{key:"isStream",value:function(){return!0}},{key:Symbol.iterator,value:function(){return this}},{key:"cancel",value:function(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}},{key:"open",value:function(t){return this.closed||(this.autoDestroy=Dl(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}},{key:"throw",value:function(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):ht}},{key:"return",value:function(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):ht}},{key:"next",value:function(){if(this.closed)return ht;for(var t,e=this._reader;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else{if(t.isRecordBatch()){this._recordBatchIndex++;var n=t.header(),r=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,r)}}if(t.isDictionaryBatch()){this._dictionaryIndex++;var i=t.header(),o=e.readMessageBody(t.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new _l(this.schema)}):this.return()}},{key:"_readNextMessageAndValidate",value:function(t){return this._reader.readMessage(t)}}]),n}(Ml),Bl=function(t){ot(n,t);var e=ft(n);function n(t,r){var i;return L(this,n),(i=e.call(this,r))._reader=new fu(i._handle=t),i}return j(n,[{key:"isAsync",value:function(){return!0}},{key:"isStream",value:function(){return!0}},{key:Symbol.asyncIterator,value:function(){return this}},{key:"cancel",value:function(){var t=B(D.mark((function t(){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.closed||!(this.closed=!0)){t.next=5;break}return t.next=3,this.reset()._reader.return();case 3:this._reader=null,this.dictionaries=null;case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"open",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.closed){t.next=10;break}if(this.autoDestroy=Dl(this,e),t.t0=this.schema,t.t0){t.next=7;break}return t.next=6,this._reader.readSchema();case 6:t.t0=this.schema=t.sent;case 7:if(t.t0){t.next=10;break}return t.next=10,this.cancel();case 10:return t.abrupt("return",this);case 11:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"throw",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.closed||!this.autoDestroy||!(this.closed=!0)){t.next=4;break}return t.next=3,this.reset()._reader.throw(e);case 3:return t.abrupt("return",t.sent);case 4:return t.abrupt("return",ht);case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"return",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.closed||!this.autoDestroy||!(this.closed=!0)){t.next=4;break}return t.next=3,this.reset()._reader.return(e);case 3:return t.abrupt("return",t.sent);case 4:return t.abrupt("return",ht);case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"next",value:function(){var t=B(D.mark((function t(){var e,n,r,i,o,a,u,s;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.closed){t.next=2;break}return t.abrupt("return",ht);case 2:n=this._reader;case 3:return t.next=5,this._readNextMessageAndValidate();case 5:if(!(e=t.sent)){t.next=31;break}if(!e.isSchema()){t.next=11;break}return t.next=9,this.reset(e.header());case 9:t.next=29;break;case 11:if(!e.isRecordBatch()){t.next=21;break}return this._recordBatchIndex++,r=e.header(),t.next=16,n.readMessageBody(e.bodyLength);case 16:return i=t.sent,o=this._loadRecordBatch(r,i),t.abrupt("return",{done:!1,value:o});case 21:if(!e.isDictionaryBatch()){t.next=29;break}return this._dictionaryIndex++,a=e.header(),t.next=26,n.readMessageBody(e.bodyLength);case 26:u=t.sent,s=this._loadDictionaryBatch(a,u),this.dictionaries.set(a.id,s);case 29:t.next=3;break;case 31:if(!this.schema||0!==this._recordBatchIndex){t.next=34;break}return this._recordBatchIndex++,t.abrupt("return",{done:!1,value:new _l(this.schema)});case 34:return t.next=36,this.return();case 36:return t.abrupt("return",t.sent);case 37:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_readNextMessageAndValidate",value:function(){var t=B(D.mark((function t(e){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._reader.readMessage(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}]),n}(Ml),Ll=function(t){ot(n,t);var e=ft(n);function n(t,r){return L(this,n),e.call(this,t instanceof Zo?t:new Zo(t),r)}return j(n,[{key:"isSync",value:function(){return!0}},{key:"isFile",value:function(){return!0}},{key:"open",value:function(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;var e,r=M(this._footer.dictionaryBatches());try{for(r.s();!(e=r.n()).done;){e.value&&this._readDictionaryBatch(this._dictionaryIndex++)}}catch(i){r.e(i)}finally{r.f()}}return Re(at(n.prototype),"open",this).call(this,t)}},{key:"readRecordBatch",value:function(t){if(this.closed)return null;this._footer||this.open();var e=this._footer&&this._footer.getRecordBatch(t);if(e&&this._handle.seek(e.offset)){var n=this._reader.readMessage(tn.RecordBatch);if(n&&n.isRecordBatch()){var r=n.header(),i=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(r,i)}}return null}},{key:"_readDictionaryBatch",value:function(t){var e=this._footer&&this._footer.getDictionaryBatch(t);if(e&&this._handle.seek(e.offset)){var n=this._reader.readMessage(tn.DictionaryBatch);if(n&&n.isDictionaryBatch()){var r=n.header(),i=this._reader.readMessageBody(n.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}}}},{key:"_readFooter",value:function(){var t=this._handle,e=t.size-bu,n=t.readInt32(e),r=t.readAt(e-n,n);return qo.decode(r)}},{key:"_readNextMessageAndValidate",value:function(t){if(this._footer||this.open(),this._footer&&this._recordBatchIndex1?r-1:0),o=1;o=4)){t.next=18;break}if(vu(n)){t.next=8;break}t.t1=new Al(new Bl(e)),t.next=15;break;case 8:return t.t2=Nl,t.t3=Ll,t.next=12,e.read();case 12:t.t4=t.sent,t.t5=new t.t3(t.t4),t.t1=new t.t2(t.t5);case 15:t.t0=t.t1,t.next=19;break;case 18:t.t0=new Al(new Bl(q(D.mark((function t(){return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))()));case 19:return t.abrupt("return",t.t0);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ql(){return(ql=B(D.mark((function t(e){var n,r,i;return D.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.stat();case 2:if(n=t.sent,r=n.size,i=new Xo(e,r),!(r>=gu)){t.next=12;break}return t.t0=vu,t.next=9,i.readAt(0,mu+7&-8);case 9:if(t.t1=t.sent,!(0,t.t0)(t.t1)){t.next=12;break}return t.abrupt("return",new Il(new Pl(i)));case 12:return t.abrupt("return",new Al(new Bl(i)));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Vl=function(){function t(e){var n,r,i=this;L(this,t),this._numChunks=0,this._finished=!1,this._bufferedSize=0;var o=e.readableStrategy,a=e.writableStrategy,u=e.queueingStrategy,s=void 0===u?"count":u,l=zu(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=wr.new(l),this._getSize="bytes"!==s?Hl:Yl;var c=ze({},o).highWaterMark,f=void 0===c?"bytes"===s?Math.pow(2,14):1e3:c,h=ze({},a).highWaterMark,p=void 0===h?"bytes"===s?Math.pow(2,14):1e3:h;this.readable=new ReadableStream((je(n={},"cancel",(function(){i._builder.clear()})),je(n,"pull",(function(t){i._maybeFlush(i._builder,i._controller=t)})),je(n,"start",(function(t){i._maybeFlush(i._builder,i._controller=t)})),n),{highWaterMark:f,size:"bytes"!==s?Hl:Yl}),this.writable=new WritableStream((je(r={},"abort",(function(){i._builder.clear()})),je(r,"write",(function(){i._maybeFlush(i._builder,i._controller)})),je(r,"close",(function(){i._maybeFlush(i._builder.finish(),i._controller)})),r),{highWaterMark:p,size:function(t){return i._writeValueAndReturnChunkSize(t)}})}return j(t,[{key:"_writeValueAndReturnChunkSize",value:function(t){var e=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-e}},{key:"_maybeFlush",value:function(t,e){null!==e&&(this._bufferedSize>=e.desiredSize&&++this._numChunks&&this._enqueue(e,t.toVector()),t.finished&&((t.length>0||0===this._numChunks)&&++this._numChunks&&this._enqueue(e,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(e,null)))}},{key:"_enqueue",value:function(t,e){this._bufferedSize=0,this._controller=null,null===e?t.close():t.enqueue(e)}}]),t}(),Hl=function(t){return t.length},Yl=function(t){return t.byteLength};var Wl=function(){function t(){L(this,t)}return j(t,[{key:"eq",value:function(e){return e instanceof t||(e=new Kl(e)),new tc(this,e)}},{key:"le",value:function(e){return e instanceof t||(e=new Kl(e)),new ec(this,e)}},{key:"ge",value:function(e){return e instanceof t||(e=new Kl(e)),new nc(this,e)}},{key:"lt",value:function(t){return new rc(this.ge(t))}},{key:"gt",value:function(t){return new rc(this.le(t))}},{key:"ne",value:function(t){return new rc(this.eq(t))}}]),t}(),Kl=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).v=t,r}return n}(Wl),Gl=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).name=t,r}return j(n,[{key:"bind",value:function(t){if(!this.colidx){this.colidx=-1;for(var e=t.schema.fields,n=-1;++n=n.v;return function(){return r}}},{key:"_bindColCol",value:function(t,e,n){var r=e.bind(t),i=n.bind(t);return function(t,e){return r(t,e)>=i(t,e)}}},{key:"_bindColLit",value:function(t,e,n){var r=e.bind(t);return function(t,e){return r(t,e)>=n.v}}},{key:"_bindLitCol",value:function(t,e,n){var r=n.bind(t);return function(t,n){return e.v>=r(t,n)}}}]),n}(Zl),rc=function(t){ot(n,t);var e=ft(n);function n(t){var r;return L(this,n),(r=e.call(this)).child=t,r}return j(n,[{key:"bind",value:function(t){var e=this.child.bind(t);return function(t,n){return!e(t,n)}}}]),n}($l);xl.prototype.countBy=function(t){return new ic(this.chunks).countBy(t)},xl.prototype.scan=function(t,e){return new ic(this.chunks).scan(t,e)},xl.prototype.scanReverse=function(t,e){return new ic(this.chunks).scanReverse(t,e)},xl.prototype.filter=function(t){return new ic(this.chunks).filter(t)};var ic=function(t){ot(n,t);var e=ft(n);function n(){return L(this,n),e.apply(this,arguments)}return j(n,[{key:"filter",value:function(t){return new ac(this.chunks,t)}},{key:"scan",value:function(t,e){for(var n=this.chunks,r=n.length,i=-1;++i=0;){var i=n[r];e&&e(i);for(var o=i.length;--o>=0;)t(o,i)}}},{key:"countBy",value:function(t){var e=this.chunks,n=e.length,r="string"===typeof t?new Gl(t):t;r.bind(e[n-1]);var i=r.vector;if(!Nn.isDictionary(i.type))throw new Error("countBy currently only supports dictionary-encoded columns");for(var o=Math.ceil(Math.log(i.length)/Math.log(256)),a=new(4==o?Uint32Array:o>=2?Uint16Array:Uint8Array)(i.dictionary.length),u=-1;++u=0;)for(var i=n[r],o=this._predicate.bind(i),a=!1,u=i.length;--u>=0;)o(u,i)&&(e&&!a&&(e(i),a=!0),t(u,i))}},{key:"count",value:function(){for(var t=0,e=this._chunks,n=e.length,r=-1;++r=2?Uint16Array:Uint8Array)(i.dictionary.length),u=-1;++u=i.headerRows&&e=i.headerColumns;if(n){var a=["blank"];return e>0&&a.push("level"+t),{type:"blank",classNames:a.join(" "),content:""}}if(o)return{type:"columns",classNames:(a=["col_heading","level"+t,"col"+(s=e-i.headerColumns)]).join(" "),content:i.getContent(i.columnsTable,s,t)};if(r){a=["row_heading","level"+e,"row"+(u=t-i.headerRows)];return{type:"index",id:"T_"+i.uuid+"level"+e+"_row"+u,classNames:a.join(" "),content:i.getContent(i.indexTable,u,e)}}a=["data","row"+(u=t-i.headerRows),"col"+(s=e-i.headerColumns)];var u,s,l=i.styler?i.getContent(i.styler.displayValuesTable,u,s):i.getContent(i.dataTable,u,s);return{type:"data",id:"T_"+i.uuid+"row"+u+"_col"+s,classNames:a.join(" "),content:l}},this.getContent=function(t,e,n){var r=t.getColumnAt(n);if(null===r)return"";switch(i.getColumnTypeId(t,n)){case Ke.Timestamp:return i.nanosToDate(r.get(e));default:return r.get(e)}},this.dataTable=xl.from(t),this.indexTable=xl.from(e),this.columnsTable=xl.from(n),this.styler=r?{caption:r.caption,displayValuesTable:xl.from(r.displayValues),styles:r.styles,uuid:r.uuid}:void 0}return Object.defineProperty(t.prototype,"rows",{get:function(){return this.indexTable.length+this.columnsTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataRows",{get:function(){return this.dataTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"table",{get:function(){return this.dataTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.indexTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!0,configurable:!0}),t.prototype.serialize=function(){return{data:this.dataTable.serialize(),index:this.indexTable.serialize(),columns:this.columnsTable.serialize()}},t.prototype.getColumnTypeId=function(t,e){return t.schema.fields[e].type.typeId},t.prototype.nanosToDate=function(t){return new Date(t/1e6)},t}(),lc=function(){return(lc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0?t.argsDataframeToObject(e.dfs):{};n=lc(lc({},n),r);var i={disabled:Boolean(e.disabled),args:n},o=new CustomEvent(t.RENDER_EVENT,{detail:i});t.events.dispatchEvent(o)},t.argsDataframeToObject=function(e){var n=e.map((function(e){var n=e.key,r=e.value;return[n,t.toArrowTable(r)]}));return Object.fromEntries(n)},t.toArrowTable=function(t){var e=t.data,n=e.data,r=e.index,i=e.columns,o=e.styler;return new sc(n,r,i,o)},t.sendBackMsg=function(t,e){window.parent.postMessage(lc({isStreamlitMessage:!0,type:t},e),"*")},t}();var fc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}fc(e,t),e.prototype.componentDidMount=function(){cc.setFrameHeight()},e.prototype.componentDidUpdate=function(){cc.setFrameHeight()}}(h.a.PureComponent);function hc(t){var e=function(e){function n(n){var r=e.call(this,n)||this;return r.componentDidMount=function(){cc.events.addEventListener(cc.RENDER_EVENT,r.onRenderEvent),cc.setComponentReady()},r.componentDidUpdate=function(){null!=r.state.componentError&&cc.setFrameHeight()},r.componentWillUnmount=function(){cc.events.removeEventListener(cc.RENDER_EVENT,r.onRenderEvent)},r.onRenderEvent=function(t){var e=t;r.setState({renderData:e.detail})},r.render=function(){return null!=r.state.componentError?h.a.createElement("div",null,h.a.createElement("h1",null,"Component Error"),h.a.createElement("span",null,r.state.componentError.message)):null==r.state.renderData?null:h.a.createElement(t,{width:window.innerWidth,disabled:r.state.renderData.disabled,args:r.state.renderData.args})},r.state={renderData:void 0,componentError:void 0},r}return fc(n,e),n.getDerivedStateFromError=function(t){return{componentError:t}},n}(h.a.PureComponent);return c()(e,t)}},function(t,e,n){var r=n(46),i=n(47),o=n(48),a=n(49),u=n(50);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e1)return e.map((function(e){return t(e)}));var r=e[0];if("string"!==typeof r.blotName&&"string"!==typeof r.attrName)throw new i("Invalid definition");if("abstract"===r.blotName)throw new i("Cannot register abstract class");if(l[r.blotName||r.attrName]=r,"string"===typeof r.keyName)a[r.keyName]=r;else if(null!=r.className&&(u[r.className]=r),null!=r.tagName){Array.isArray(r.tagName)?r.tagName=r.tagName.map((function(t){return t.toUpperCase()})):r.tagName=r.tagName.toUpperCase();var o=Array.isArray(r.tagName)?r.tagName:[r.tagName];o.forEach((function(t){null!=s[t]&&null!=r.className||(s[t]=r)}))}return r}},function(t,e,n){var r=n(51),i=n(11),o=n(3),a=n(20),u=String.fromCharCode(0),s=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};s.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"===typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},s.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},s.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"===typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},s.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=o(!0,{},t),"object"===typeof n){if("number"===typeof t.delete&&"number"===typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"===typeof n.delete&&null!=t.insert&&(e-=1,"object"!==typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(i(t.attributes,n.attributes)){if("string"===typeof t.insert&&"string"===typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"===typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"===typeof t.retain&&"number"===typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"===typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},s.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},s.prototype.filter=function(t){return this.ops.filter(t)},s.prototype.forEach=function(t){this.ops.forEach(t)},s.prototype.map=function(t){return this.ops.map(t)},s.prototype.partition=function(t){var e=[],n=[];return this.forEach((function(r){(t(r)?e:n).push(r)})),[e,n]},s.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},s.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+a.length(e):e.delete?t-e.delete:t}),0)},s.prototype.length=function(){return this.reduce((function(t,e){return t+a.length(e)}),0)},s.prototype.slice=function(t,e){t=t||0,"number"!==typeof e&&(e=1/0);for(var n=[],r=a.iterator(this.ops),i=0;i0&&n.next(o.retain-u)}for(var l=new s(r);e.hasNext()||n.hasNext();)if("insert"===n.peekType())l.push(n.next());else if("delete"===e.peekType())l.push(e.next());else{var c=Math.min(e.peekLength(),n.peekLength()),f=e.next(c),h=n.next(c);if("number"===typeof h.retain){var p={};"number"===typeof f.retain?p.retain=c:p.insert=f.insert;var d=a.attributes.compose(f.attributes,h.attributes,"number"===typeof f.retain);if(d&&(p.attributes=d),l.push(p),!n.hasNext()&&i(l.ops[l.ops.length-1],p)){var y=new s(e.rest());return l.concat(y).chop()}}else"number"===typeof h.delete&&"number"===typeof f.retain&&l.push(h)}return l.chop()},s.prototype.concat=function(t){var e=new s(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},s.prototype.diff=function(t,e){if(this.ops===t.ops)return new s;var n=[this,t].map((function(e){return e.map((function(n){if(null!=n.insert)return"string"===typeof n.insert?n.insert:u;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")})).join("")})),o=new s,l=r(n[0],n[1],e),c=a.iterator(this.ops),f=a.iterator(t.ops);return l.forEach((function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),o.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),o.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var u=c.next(n),s=f.next(n);i(u.insert,s.insert)?o.retain(n,a.attributes.diff(u.attributes,s.attributes)):o.push(s).delete(n)}e-=n}})),o.chop()},s.prototype.eachLine=function(t,e){e=e||"\n";for(var n=a.iterator(this.ops),r=new s,i=0;n.hasNext();){if("insert"!==n.peekType())return;var o=n.peek(),u=a.length(o)-n.peekLength(),l="string"===typeof o.insert?o.insert.indexOf(e,u)-u:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(!1===t(r,n.next(1).attributes||{},i))return;i+=1,r=new s}}r.length()>0&&t(r,{},i)},s.prototype.transform=function(t,e){if(e=!!e,"number"===typeof t)return this.transformPosition(t,e);for(var n=a.iterator(this.ops),r=a.iterator(t.ops),i=new s;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())i.push(r.next());else{var o=Math.min(n.peekLength(),r.peekLength()),u=n.next(o),l=r.next(o);if(u.delete)continue;l.delete?i.push(l):i.retain(o,a.attributes.transform(u.attributes,l.attributes,e))}else i.retain(a.length(n.next()));return i.chop()},s.prototype.transformPosition=function(t,e){e=!!e;for(var n=a.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var i=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(r0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}(u.default.Block);function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"===typeof t.formats&&(e=(0,o.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:m(t.parent,e))}v.blotName="block",v.tagName="P",v.defaultChild="break",v.allowedChildren=[l.default,u.default.Embed,c.default],e.bubbleFormats=m,e.BlockEmbed=y,e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(b(this,t),this.options=x(e,r),this.container=this.options.container,null==this.container)return g.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var i=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new s.default,this.scroll=c.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new u.default(this.scroll),this.selection=new h.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(s.default.events.EDITOR_CHANGE,(function(t){t===s.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())})),this.emitter.on(s.default.events.SCROLL_UPDATE,(function(t,e){var r=n.selection.lastRange,i=r&&0===r.length?r.index:void 0;k.call(n,(function(){return n.editor.update(null,e,i)}),t)}));var o=this.clipboard.convert("
"+i+"


");this.setContents(o),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),d.default.level(t)}},{key:"find",value:function(t){return t.__quill||c.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&g.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!==typeof t){var i=t.attrName||t.blotName;"string"===typeof i?this.register("formats/"+i,t,e):Object.keys(t).forEach((function(r){n.register(r,t[r],e)}))}else null==this.imports[t]||r||g.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?c.default.register(e):t.startsWith("modules")&&"function"===typeof e.register&&e.register()}}]),o(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"===typeof t){var n=t;(t=document.createElement("div")).classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,o=_(t,e,n),a=i(o,4);return t=a[0],e=a[1],n=a[3],k.call(this,(function(){return r.editor.deleteText(t,e)}),n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;return k.call(this,(function(){var r=n.getSelection(!0),i=new a.default;if(null==r)return i;if(c.default.query(t,c.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,m({},t,e));else{if(0===r.length)return n.selection.format(t,e),i;i=n.editor.formatText(r.index,r.length,m({},t,e))}return n.setSelection(r,s.default.sources.SILENT),i}),r)}},{key:"formatLine",value:function(t,e,n,r,o){var a,u=this,s=_(t,e,n,r,o),l=i(s,4);return t=l[0],e=l[1],a=l[2],o=l[3],k.call(this,(function(){return u.editor.formatLine(t,e,a)}),o,t,0)}},{key:"formatText",value:function(t,e,n,r,o){var a,u=this,s=_(t,e,n,r,o),l=i(s,4);return t=l[0],e=l[1],a=l[2],o=l[3],k.call(this,(function(){return u.editor.formatText(t,e,a)}),o,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"===typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=_(t,e),r=i(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"===typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!==typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=_(t,e),r=i(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return k.call(this,(function(){return i.editor.insertEmbed(e,n,r)}),o,e)}},{key:"insertText",value:function(t,e,n,r,o){var a,u=this,s=_(t,0,n,r,o),l=i(s,4);return t=l[0],a=l[2],o=l[3],k.call(this,(function(){return u.editor.insertText(t,e,a)}),o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,o=_(t,e,n),a=i(o,4);return t=a[0],e=a[1],n=a[3],k.call(this,(function(){return r.editor.removeFormat(t,e)}),n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API;return k.call(this,(function(){t=new a.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),i=e.editor.applyDelta(t),o=i.ops[i.ops.length-1];return null!=o&&"string"===typeof o.insert&&"\n"===o.insert[o.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),i.delete(1)),r.compose(i)}),n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=_(e,n,r),a=i(o,4);e=a[0],n=a[1],r=a[3],this.selection.setRange(new f.Range(e,n),r),r!==s.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API,n=(new a.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API;return k.call(this,(function(){return t=new a.default(t),e.editor.applyDelta(t,n)}),n,!0)}}]),t}();function x(t,e){if((e=(0,p.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e)).theme&&e.theme!==w.DEFAULTS.theme){if(e.theme=w.import("themes/"+e.theme),null==e.theme)throw new Error("Invalid theme "+e.theme+". Did you register it?")}else e.theme=y.default;var n=(0,p.default)(!0,{},e.theme.DEFAULTS);[n,e].forEach((function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach((function(e){!0===t.modules[e]&&(t.modules[e]={})}))}));var r=Object.keys(n.modules).concat(Object.keys(e.modules)).reduce((function(t,e){var n=w.import("modules/"+e);return null==n?g.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=n.DEFAULTS||{},t}),{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,p.default)(!0,{},w.DEFAULTS,{modules:r},n,e),["bounds","container","scrollingContainer"].forEach((function(t){"string"===typeof e[t]&&(e[t]=document.querySelector(e[t]))})),e.modules=Object.keys(e.modules).reduce((function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t}),{}),e}function k(t,e,n,r){if(this.options.strict&&!this.isEnabled()&&e===s.default.sources.USER)return new a.default;var i=null==n?null:this.getSelection(),o=this.editor.delta,u=t();if(null!=i&&(!0===n&&(n=i.index),null==r?i=S(i,u,e):0!==r&&(i=S(i,n,r,e)),this.setSelection(i,s.default.sources.SILENT)),u.length()>0){var l,c,f=[s.default.events.TEXT_CHANGE,u,o,e];(l=this.emitter).emit.apply(l,[s.default.events.EDITOR_CHANGE].concat(f)),e!==s.default.sources.SILENT&&(c=this.emitter).emit.apply(c,f)}return u}function _(t,e,n,i,o){var a={};return"number"===typeof t.index&&"number"===typeof t.length?"number"!==typeof e?(o=i,i=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!==typeof e&&(o=i,i=n,n=e,e=0),"object"===("undefined"===typeof n?"undefined":r(n))?(a=n,o=i):"string"===typeof n&&(null!=i?a[n]=i:o=n),[t,e,a,o=o||s.default.sources.API]}function S(t,e,n,r){if(null==t)return null;var o=void 0,u=void 0;if(e instanceof a.default){var l=[t.index,t.index+t.length].map((function(t){return e.transformPosition(t,r!==s.default.sources.USER)})),c=i(l,2);o=c[0],u=c[1]}else{var h=[t.index,t.index+t.length].map((function(t){return t=0?t+n:Math.max(e,t+n)})),p=i(h,2);o=p[0],u=p[1]}return new f.Range(o,u-o)}w.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},w.events=s.default.events,w.sources=s.default.sources,w.version="1.3.7",w.imports={delta:a.default,parchment:c.default,"core/module":l.default,"core/theme":y.default},e.expandConfig=x,e.overload=_,e.default=w},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),i=e.order.indexOf(n);return r>=0||i>=0?r-i:t===n?0:t1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.quill=e,this.options=n};i.DEFAULTS={},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=["error","warn","log","info"],i="warn";function o(t){if(r.indexOf(t)<=r.indexOf(i)){for(var e,n=arguments.length,o=Array(n>1?n-1:0),a=1;a=0;l--)if(f[l]!=h[l])return!1;for(l=f.length-1;l>=0;l--)if(c=f[l],!a(t[c],e[c],n))return!1;return typeof t===typeof e}(t,e,n))};function u(t){return null===t||void 0===t}function s(t){return!(!t||"object"!==typeof t||"number"!==typeof t.length)&&"function"===typeof t.copy&&"function"===typeof t.slice&&!(t.length>0&&"number"!==typeof t[0])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|i:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,(function(t){return t.name}))},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"===typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n=t+n)){var a=this.newlineIndex(t,!0)+1,s=o-a+1,l=this.isolate(a,s),c=l.next;l.format(r,i),c instanceof e&&c.formatAt(0,t-a+n-s,r,i)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var i=this.descendant(c.default,t),o=r(i,2),a=o[0],u=o[1];a.insertAt(u,e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var n=this.domNode.textContent.slice(t).indexOf("\n");return n>-1?t+n:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(u.default.create("text","\n")),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach((function(t){var e=u.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof u.default.Embed?e.remove():e.unwrap()}))}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(s.default);v.blotName="code-block",v.tagName="PRE",v.TAB=" ",e.Code=y,e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n=o&&!p.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,p);var d=e.scroll.line(t),y=i(d,2),m=y[0],b=y[1],g=(0,v.default)({},(0,f.bubbleFormats)(m));if(m instanceof h.default){var w=m.descendant(s.default.Leaf,b),x=i(w,1)[0];g=(0,v.default)(g,(0,f.bubbleFormats)(x))}c=u.default.attributes.diff(g,c)||{}}else if("object"===r(a.insert)){var k=Object.keys(a.insert)[0];if(null==k)return t;e.scroll.insertAt(t,k,a.insert[k])}o+=l}return Object.keys(c).forEach((function(n){e.scroll.formatAt(t,l,n,c[n])})),t+l}),0),t.reduce((function(t,n){return"number"===typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)}),0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new a.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach((function(i){if(null==n.scroll.whitelist||n.scroll.whitelist[i]){var o=n.scroll.lines(t,Math.max(e,1)),a=e;o.forEach((function(e){var o=e.length();if(e instanceof l.default){var u=t-e.offset(n.scroll),s=e.newlineIndex(u+a)-u+1;e.formatAt(u,s,i,r[i])}else e.format(i,r[i]);a-=o}))}})),this.scroll.optimize(),this.update((new a.default).retain(t).retain(e,(0,d.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach((function(i){n.scroll.formatAt(t,e,i,r[i])})),this.update((new a.default).retain(t).retain(e,(0,d.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce((function(t,e){return t.concat(e.delta())}),new a.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach((function(t){var e=i(t,1)[0];e instanceof h.default?n.push(e):e instanceof s.default.Leaf&&r.push(e)})):(n=this.scroll.lines(t,e),r=this.scroll.descendants(s.default.Leaf,t,e));var o=[n,r].map((function(t){if(0===t.length)return{};for(var e=(0,f.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=w((0,f.bubbleFormats)(n),e)}return e}));return v.default.apply(v.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter((function(t){return"string"===typeof t.insert})).map((function(t){return t.insert})).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new a.default).retain(t).insert(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach((function(i){n.scroll.formatAt(t,e.length,i,r[i])})),this.update((new a.default).retain(t).insert(e,(0,d.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===h.default.blotName&&!(t.children.length>1)&&t.children.head instanceof p.default}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),o=i(r,2),u=o[0],s=o[1],c=0,f=new a.default;null!=u&&(c=u instanceof l.default?u.newlineIndex(s)-s+1:u.length()-s,f=u.delta().slice(s,s+c-1).insert("\n"));var h=this.getContents(t,e+c).diff((new a.default).insert(n).concat(f)),p=(new a.default).retain(t).concat(h);return this.applyDelta(p)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(b)&&s.default.find(e[0].target)){var i=s.default.find(e[0].target),o=(0,f.bubbleFormats)(i),u=i.offset(this.scroll),l=e[0].oldValue.replace(c.default.CONTENTS,""),h=(new a.default).insert(l),p=(new a.default).insert(i.value()),d=(new a.default).retain(u).concat(h.diff(p,n));t=d.reduce((function(t,e){return e.insert?t.insert(e.insert,o):t.push(e)}),new a.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,y.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();function w(t,e){return Object.keys(e).reduce((function(n,r){return null==t[r]||(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]]),n}),{})}e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Range=void 0;var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;f(this,t),this.index=e,this.length=n},d=function(){function t(e,n){var r=this;f(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=o.default.create("cursor",this),this.lastRange=this.savedRange=new p(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(function(){r.mouseDown||setTimeout(r.update.bind(r,s.default.sources.USER),1)})),this.emitter.on(s.default.events.EDITOR_CHANGE,(function(t,e){t===s.default.events.TEXT_CHANGE&&e.length()>0&&r.update(s.default.sources.SILENT)})),this.emitter.on(s.default.events.SCROLL_BEFORE_UPDATE,(function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(s.default.events.SCROLL_UPDATE,(function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(e){}}))}})),this.emitter.on(s.default.events.SCROLL_OPTIMIZE,(function(t,e){if(e.range){var n=e.range,i=n.startNode,o=n.startOffset,a=n.endNode,u=n.endOffset;r.setNativeRange(i,o,a,u)}})),this.update(s.default.sources.SILENT)}return i(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",(function(){t.composing=!0})),this.root.addEventListener("compositionend",(function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout((function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,(function(){t.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(function(){t.mouseDown=!1,t.update(s.default.sources.USER)}))}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!o.default.query(t,o.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=o.default.find(n.start.node,!1);if(null==r)return;if(r instanceof o.default.Leaf){var i=r.split(n.start.offset);r.parent.insertBefore(this.cursor,i)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var i=void 0,o=this.scroll.leaf(t),a=r(o,2),u=a[0],s=a[1];if(null==u)return null;var l=u.position(s,!0),c=r(l,2);i=c[0],s=c[1];var f=document.createRange();if(e>0){f.setStart(i,s);var h=this.scroll.leaf(t+e),p=r(h,2);if(u=p[0],s=p[1],null==u)return null;var d=u.position(s,!0),y=r(d,2);return i=y[0],s=y[1],f.setEnd(i,s),f.getBoundingClientRect()}var v="left",m=void 0;return i instanceof Text?(s0&&(v="right")),{bottom:m.top+m.height,height:m.height,left:m[v],right:m[v],top:m.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return h.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var i=n.map((function(t){var n=r(t,2),i=n[0],a=n[1],u=o.default.find(i,!0),s=u.offset(e.scroll);return 0===a?s:u instanceof o.default.Container?s+u.length():s+u.index(i,a)})),a=Math.min(Math.max.apply(Math,c(i)),this.scroll.length()-1),u=Math.min.apply(Math,[a].concat(c(i)));return new p(u,a-u)}},{key:"normalizeNative",value:function(t){if(!y(this.root,t.startContainer)||!t.collapsed&&!y(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach((function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;n=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n})),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],i=[],o=this.scroll.length();return n.forEach((function(t,n){t=Math.min(o-1,t);var a,u=e.scroll.leaf(t),s=r(u,2),l=s[0],c=s[1],f=l.position(c,0!==n),h=r(f,2);a=h[0],c=h[1],i.push(a,c)})),i.length<2&&(i=i.concat(i)),i}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var i=this.scroll.length()-1,o=this.scroll.line(Math.min(e.index,i)),a=r(o,1)[0],u=a;if(e.length>0){var s=this.scroll.line(Math.min(e.index+e.length,i));u=r(s,1)[0]}if(null!=a&&null!=u){var l=t.getBoundingClientRect();n.topl.bottom&&(t.scrollTop+=n.bottom-l.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(h.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var o=document.getSelection();if(null!=o)if(null!=t){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||i||t!==a.startContainer||e!==a.startOffset||n!==a.endContainer||r!==a.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var u=document.createRange();u.setStart(t,e),u.setEnd(n,r),o.removeAllRanges(),o.addRange(u)}}else o.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;if("string"===typeof e&&(n=e,e=!1),h.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,c(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.default.sources.USER,e=this.lastRange,n=this.getRange(),i=r(n,2),o=i[0],l=i[1];if(this.lastRange=o,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,u.default)(e,this.lastRange)){var c;!this.composing&&null!=l&&l.native.collapsed&&l.start.node!==this.cursor.textNode&&this.cursor.restore();var f,h=[s.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(e),t];(c=this.emitter).emit.apply(c,[s.default.events.EDITOR_CHANGE].concat(h)),t!==s.default.sources.SILENT&&(f=this.emitter).emit.apply(f,h)}}}]),t}();function y(t,e){try{e.parentNode}catch(n){return!1}return e instanceof Text&&(e=e.parentNode),t.contains(e)}e.Range=p,e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){var t;return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t},e.scope=o.Scope.INLINE_BLOT,e}(i.default);e.default=a},function(t,e,n){var r=n(11),i=n(3),o={attributes:{compose:function(t,e,n){"object"!==typeof t&&(t={}),"object"!==typeof e&&(e={});var r=i(!0,{},e);for(var o in n||(r=Object.keys(r).reduce((function(t,e){return null!=r[e]&&(t[e]=r[e]),t}),{})),t)void 0!==t[o]&&void 0===e[o]&&(r[o]=t[o]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!==typeof t&&(t={}),"object"!==typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce((function(n,i){return r(t[i],e[i])||(n[i]=void 0===e[i]?null:e[i]),n}),{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!==typeof t)return e;if("object"===typeof e){if(!n)return e;var r=Object.keys(e).reduce((function(n,r){return void 0===t[r]&&(n[r]=e[r]),n}),{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new a(t)},length:function(t){return"number"===typeof t.delete?t.delete:"number"===typeof t.retain?t.retain:"string"===typeof t.insert?t.insert.length:1}};function a(t){this.ops=t,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=o.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"===typeof e.delete)return{delete:t};var i={};return e.attributes&&(i.attributes=e.attributes),"number"===typeof e.retain?i.retain=t:"string"===typeof e.insert?i.insert=e.insert.substr(n,t):i.insert=e.insert,i}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){return this.ops[this.index]?"number"===typeof this.ops[this.index].delete?"delete":"number"===typeof this.ops[this.index].retain?"retain":"insert":"retain"},a.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)}return[]},t.exports=o},function(t,n){var r=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var n,r,i;try{n=Map}catch(s){n=function(){}}try{r=Set}catch(s){r=function(){}}try{i=Promise}catch(s){i=function(){}}function o(a,s,l,c,f){"object"===typeof s&&(l=s.depth,c=s.prototype,f=s.includeNonEnumerable,s=s.circular);var h=[],p=[],d="undefined"!=typeof e;return"undefined"==typeof s&&(s=!0),"undefined"==typeof l&&(l=1/0),function a(l,y){if(null===l)return null;if(0===y)return l;var v,m;if("object"!=typeof l)return l;if(t(l,n))v=new n;else if(t(l,r))v=new r;else if(t(l,i))v=new i((function(t,e){l.then((function(e){t(a(e,y-1))}),(function(t){e(a(t,y-1))}))}));else if(o.__isArray(l))v=[];else if(o.__isRegExp(l))v=new RegExp(l.source,u(l)),l.lastIndex&&(v.lastIndex=l.lastIndex);else if(o.__isDate(l))v=new Date(l.getTime());else{if(d&&e.isBuffer(l))return v=e.allocUnsafe?e.allocUnsafe(l.length):new e(l.length),l.copy(v),v;t(l,Error)?v=Object.create(l):"undefined"==typeof c?(m=Object.getPrototypeOf(l),v=Object.create(m)):(v=Object.create(c),m=c)}if(s){var b=h.indexOf(l);if(-1!=b)return p[b];h.push(l),p.push(v)}for(var g in t(l,n)&&l.forEach((function(t,e){var n=a(e,y-1),r=a(t,y-1);v.set(n,r)})),t(l,r)&&l.forEach((function(t){var e=a(t,y-1);v.add(e)})),l){var w;m&&(w=Object.getOwnPropertyDescriptor(m,g)),w&&null==w.set||(v[g]=a(l[g],y-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(l);for(g=0;g0){if(u instanceof s.BlockEmbed||p instanceof s.BlockEmbed)return void this.optimize();if(u instanceof f.default){var d=u.newlineIndex(u.length(),!0);if(d>-1&&(u=u.split(d+1))===p)return void this.optimize()}else if(p instanceof f.default){var y=p.newlineIndex(0);y>-1&&p.split(y+1)}var v=p.children.head instanceof c.default?null:p.children.head;u.moveChildren(p,v),u.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,i){(null==this.whitelist||this.whitelist[r])&&(o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,i),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==a.default.query(n,a.default.Scope.BLOCK)){var i=a.default.create(this.statics.defaultChild);this.appendChild(i),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),i.insertAt(0,n,r)}else{var u=a.default.create(n,r);this.appendChild(u)}else o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===a.default.Scope.INLINE_BLOT){var r=a.default.create(this.statics.defaultChild);r.appendChild(t),t=r}o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(d,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,n=function t(e,n,r){var i=[],o=r;return e.children.forEachAt(n,r,(function(e,n,r){d(e)?i.push(e):e instanceof a.default.Container&&(i=i.concat(t(e,n,o))),o-=r})),i};return n(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(u.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=u.default.sources.USER;"string"===typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(u.default.events.SCROLL_BEFORE_UPDATE,n,t),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(u.default.events.SCROLL_UPDATE,n,t)}}}]),e}(a.default.Scroll);y.blotName="scroll",y.className="ql-editor",y.tagName="DIV",y.defaultChild="block",y.allowedChildren=[l.default,s.BlockEmbed,h.default],e.default=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=E(t);if(null==r||null==r.key)return m.warn("Attempted to add invalid keyboard binding",r);"function"===typeof e&&(e={handler:e}),"function"===typeof n&&(n={handler:n}),r=(0,s.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",(function(n){if(!n.defaultPrevented){var o=n.which||n.keyCode,a=(t.bindings[o]||[]).filter((function(t){return e.match(n,t)}));if(0!==a.length){var s=t.quill.getSelection();if(null!=s&&t.quill.hasFocus()){var l=t.quill.getLine(s.index),c=i(l,2),h=c[0],p=c[1],d=t.quill.getLeaf(s.index),y=i(d,2),v=y[0],m=y[1],b=0===s.length?[v,m]:t.quill.getLeaf(s.index+s.length),g=i(b,2),w=g[0],x=g[1],k=v instanceof f.default.Text?v.value().slice(0,m):"",_=w instanceof f.default.Text?w.value().slice(x):"",S={collapsed:0===s.length,empty:0===s.length&&h.length()<=1,format:t.quill.getFormat(s),offset:p,prefix:k,suffix:_};a.some((function(e){if(null!=e.collapsed&&e.collapsed!==S.collapsed)return!1;if(null!=e.empty&&e.empty!==S.empty)return!1;if(null!=e.offset&&e.offset!==S.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((function(t){return null==S.format[t]})))return!1}else if("object"===r(e.format)&&!Object.keys(e.format).every((function(t){return!0===e.format[t]?null!=S.format[t]:!1===e.format[t]?null==S.format[t]:(0,u.default)(e.format[t],S.format[t])})))return!1;return!(null!=e.prefix&&!e.prefix.test(S.prefix))&&!(null!=e.suffix&&!e.suffix.test(S.suffix))&&!0!==e.handler.call(t,s,S)}))&&n.preventDefault()}}}}))}}]),e}(d.default);function w(t,e){var n,r=t===g.keys.LEFT?"prefix":"suffix";return v(n={key:t,shiftKey:e,altKey:null},r,/^$/),v(n,"handler",(function(n){var r=n.index;t===g.keys.RIGHT&&(r+=n.length+1);var o=this.quill.getLeaf(r);return!(i(o,1)[0]instanceof f.default.Embed)||(t===g.keys.LEFT?e?this.quill.setSelection(n.index-1,n.length+1,h.default.sources.USER):this.quill.setSelection(n.index-1,h.default.sources.USER):e?this.quill.setSelection(n.index,n.length+1,h.default.sources.USER):this.quill.setSelection(n.index+n.length+1,h.default.sources.USER),!1)})),n}function x(t,e){if(!(0===t.index||this.quill.getLength()<=1)){var n=this.quill.getLine(t.index),r=i(n,1)[0],o={};if(0===e.offset){var a=this.quill.getLine(t.index-1),u=i(a,1)[0];if(null!=u&&u.length()>1){var s=r.formats(),l=this.quill.getFormat(t.index-1,1);o=c.default.attributes.diff(s,l)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,h.default.sources.USER),Object.keys(o).length>0&&this.quill.formatLine(t.index-f,f,o,h.default.sources.USER),this.quill.focus()}}function k(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},o=0,a=this.quill.getLine(t.index),u=i(a,1)[0];if(e.offset>=u.length()-1){var s=this.quill.getLine(t.index+1),l=i(s,1)[0];if(l){var f=u.formats(),p=this.quill.getFormat(t.index,1);r=c.default.attributes.diff(f,p)||{},o=l.length()}}this.quill.deleteText(t.index,n,h.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+o-1,n,r,h.default.sources.USER)}}function _(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),i=e[e.length-1].formats();n=c.default.attributes.diff(i,r)||{}}this.quill.deleteText(t,h.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,h.default.sources.USER),this.quill.setSelection(t.index,h.default.sources.SILENT),this.quill.focus()}function S(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce((function(t,n){return f.default.query(n,f.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t}),{});this.quill.insertText(t.index,"\n",r,h.default.sources.USER),this.quill.setSelection(t.index+1,h.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach((function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],h.default.sources.USER))}))}function T(t){return{key:g.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=f.default.query("code-block"),r=e.index,o=e.length,a=this.quill.scroll.descendant(n,r),u=i(a,2),s=u[0],l=u[1];if(null!=s){var c=this.quill.getIndex(s),p=s.newlineIndex(l,!0)+1,d=s.newlineIndex(c+l+o),y=s.domNode.textContent.slice(p,d).split("\n");l=0,y.forEach((function(e,i){t?(s.insertAt(p+l,n.TAB),l+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(s.deleteAt(p+l,n.TAB.length),l-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),l+=e.length+1})),this.quill.update(h.default.sources.USER),this.quill.setSelection(r,o,h.default.sources.SILENT)}}}}function O(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],h.default.sources.USER)}}}function E(t){if("string"===typeof t||"number"===typeof t)return E({key:t});if("object"===("undefined"===typeof t?"undefined":r(t))&&(t=(0,a.default)(t,!1)),"string"===typeof t.key)if(null!=g.keys[t.key.toUpperCase()])t.key=g.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[b]=t.shortKey,delete t.shortKey),t}g.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},g.DEFAULTS={bindings:{bold:O("bold"),italic:O("italic"),underline:O("underline"),indent:{key:g.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",h.default.sources.USER)}},outdent:{key:g.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",h.default.sources.USER)}},"outdent backspace":{key:g.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",h.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,h.default.sources.USER)}},"indent code-block":T(!0),"outdent code-block":T(!1),"remove tab":{key:g.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,h.default.sources.USER)}},tab:{key:g.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new l.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,h.default.sources.SILENT)}},"list empty enter":{key:g.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,h.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,h.default.sources.USER)}},"checklist enter":{key:g.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=i(e,2),r=n[0],o=n[1],a=(0,s.default)({},r.formats(),{list:"checked"}),u=(new l.default).retain(t.index).insert("\n",a).retain(r.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(u,h.default.sources.USER),this.quill.setSelection(t.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:g.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=i(n,2),o=r[0],a=r[1],u=(new l.default).retain(t.index).insert("\n",e.format).retain(o.length()-a-1).retain(1,{header:null});this.quill.updateContents(u,h.default.sources.USER),this.quill.setSelection(t.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),o=i(r,2),a=o[0],u=o[1];if(u>n)return!0;var s=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(t.index," ",h.default.sources.USER),this.quill.history.cutoff();var c=(new l.default).retain(t.index-u).delete(n+1).retain(a.length()-2-u).retain(1,{list:s});this.quill.updateContents(c,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,h.default.sources.SILENT)}},"code exit":{key:g.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=i(e,2),r=n[0],o=n[1],a=(new l.default).retain(t.index+r.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,h.default.sources.USER)}},"embed left":w(g.keys.LEFT,!1),"embed left shift":w(g.keys.LEFT,!0),"embed right":w(g.keys.RIGHT,!1),"embed right shift":w(g.keys.RIGHT,!0)}},e.default=g,e.SHORTKEY=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},o=function(){function t(t,e){for(var n=0;n-1}l.blotName="link",l.tagName="A",l.SANITIZED_URL="about:blank",l.PROTOCOL_WHITELIST=["http","https","mailto","tel"],e.default=l,e.sanitize=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"===typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"===typeof Event?"undefined":r(Event))){var i=document.createEvent("Event");i.initEvent("change",!0,!0),this.select.dispatchEvent(i)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=m(n(0)),i=m(n(5)),o=n(4),a=m(o),u=m(n(16)),s=m(n(25)),l=m(n(24)),c=m(n(35)),f=m(n(6)),h=m(n(22)),p=m(n(7)),d=m(n(55)),y=m(n(42)),v=m(n(23));function m(t){return t&&t.__esModule?t:{default:t}}i.default.register({"blots/block":a.default,"blots/block/embed":o.BlockEmbed,"blots/break":u.default,"blots/container":s.default,"blots/cursor":l.default,"blots/embed":c.default,"blots/inline":f.default,"blots/scroll":h.default,"blots/text":p.default,"modules/clipboard":d.default,"modules/history":y.default,"modules/keyboard":v.default}),r.default.register(a.default,u.default,l.default,f.default,h.default,p.default),e.default=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"===typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"===typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,i){var o=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&i)o.wrap(n,i);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);o.wrap(a),a.format(n,i)}},t.prototype.insertAt=function(t,e,n){var i=null==n?r.create("text",e):r.create(e,n),o=this.split(t);this.parent.insertBefore(i,o)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"===typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"===typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),i=n(32),o=n(33),a=n(1),u=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=i.default.keys(this.domNode),u=o.default.keys(this.domNode);e.concat(n).concat(u).forEach((function(e){var n=a.query(e,a.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)}))},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach((function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)}))},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach((function(t){e.attributes[t].remove(e.domNode)})),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce((function(e,n){return e[n]=t.attributes[n].value(t.domNode),e}),{})},t}();e.default=u},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function i(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((function(t){return 0===t.indexOf(e+"-")}))}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map((function(t){return t.split("-").slice(0,-1).join("-")}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){i(t,this.keyName).forEach((function(e){t.classList.remove(e)})),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(i(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=o},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function i(t){var e=t.split("-"),n=e.slice(1).map((function(t){return t[0].toUpperCase()+t.slice(1)})).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map((function(t){return t.split(":")[0].trim()}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[i(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[i(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[i(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var i=this.stack.undo.pop();n=n.compose(i.undo),t=i.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})),this.stack.redo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}))}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(a(n(9)).default);function s(t){var e=t.reduce((function(t,e){return t+=e.delete||0}),0),n=t.length()-e;return function(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"===typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some((function(t){return null!=i.default.query(t,i.default.Scope.BLOCK)})))}(t)&&(n-=1),n}u.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=u,e.getLastChangeIndex=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,a.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,a.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":t=function(t){var e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0":(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/":t}(t);case"formula":if(!t)break;var n=this.quill.getSelection(!0);if(null!=n){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,a.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(r+1," ",a.default.sources.USER),this.quill.setSelection(r+2,a.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}(h.default);function S(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach((function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)}))}e.BaseTooltip=_,e.default=k},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(ta?n(r,t-a,Math.min(e,a+s-t)):n(r,0,Math.min(s,t+e-a)),a+=s}},t.prototype.map=function(t){return this.reduce((function(e,n){return e.push(t(n)),e}),[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(17),o=n(1),a={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},u=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver((function(t){n.update(t)})),n.observer.observe(n.domNode,a),n.attach(),n}return r(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach((function(t){t.remove()})):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,i){this.update(),t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var a=[].slice.call(this.observer.takeRecords());a.length>0;)e.push(a.pop());for(var u=function t(e,n){void 0===n&&(n=!0),null!=e&&e!==r&&null!=e.domNode.parentNode&&(null==e.domNode[o.DATA_KEY].mutations&&(e.domNode[o.DATA_KEY].mutations=[]),n&&t(e.parent))},s=function t(e){null!=e.domNode[o.DATA_KEY]&&null!=e.domNode[o.DATA_KEY].mutations&&(e instanceof i.default&&e.children.forEach(t),e.optimize(n))},l=e,c=0;l.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((function(t){var e=o.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(u(o.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,(function(t){var e=o.find(t,!1);u(e,!1),e instanceof i.default&&e.children.forEach((function(t){u(t,!1)}))}))):"attributes"===t.type&&u(e.prev)),u(e))})),this.children.forEach(s),a=(l=[].slice.call(this.observer.takeRecords())).slice();a.length>0;)e.push(a.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map((function(t){var e=o.find(t.target,!0);return null==e?null:null==e.domNode[o.DATA_KEY].mutations?(e.domNode[o.DATA_KEY].mutations=[t],e):(e.domNode[o.DATA_KEY].mutations.push(t),null)})).forEach((function(t){null!=t&&t!==r&&null!=t.domNode[o.DATA_KEY]&&t.update(t.domNode[o.DATA_KEY].mutations||[],n)})),null!=this.domNode[o.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=o.Scope.BLOCK_BLOT,e.tagName="DIV",e}(i.default);e.default=u},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),o=n(1),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach((function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)})),this.unwrap())},e.prototype.formatAt=function(e,n,r,i){null!=this.formats()[r]||o.query(r,o.Scope.ATTRIBUTE)?this.isolate(e,n).format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var i=this.next;i instanceof e&&i.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(r,i.formats())&&(i.moveChildren(this),i.remove())},e.blotName="inline",e.scope=o.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),o=n(1),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(n){var r=o.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=o.query(n,o.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,i){null!=o.query(r,o.Scope.BLOCK)?this.format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=o.query(n,o.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var i=this.split(e),a=o.create(n,r);i.parent.insertBefore(a,i)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=o.Scope.BLOCK_BLOT,e.tagName="P",e}(i.default);e.default=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,i){0===e&&n===this.length()?this.format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(19).default);e.default=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(19),o=n(1),a=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return r(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=o.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some((function(t){return"characterData"===t.type&&t.target===n.domNode}))&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=o.Scope.INLINE_BLOT,e}(i.default);e.default=a},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)===!e?e:i.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!==typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!==typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,i=arguments[1],o=0;oe.length?t:e,s=t.length>e.length?e:t,l=u.indexOf(s);if(-1!=l)return a=[[1,u.substring(0,l)],[0,s],[1,u.substring(l+s.length)]],t.length>e.length&&(a[0][0]=a[2][0]=-1),a;if(1==s.length)return[[-1,t],[1,e]];var c=function(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length=t.length?[r,a,u,s,f]:null}var u,s,l,c,f,h=a(n,r,Math.ceil(n.length/4)),p=a(n,r,Math.ceil(n.length/2));if(!h&&!p)return null;u=p?h&&h[4].length>p[4].length?h:p:h,t.length>e.length?(s=u[0],l=u[1],c=u[2],f=u[3]):(c=u[0],f=u[1],s=u[2],l=u[3]);var d=u[4];return[s,l,c,f,d]}(t,e);if(c){var f=c[0],h=c[1],p=c[2],d=c[3],y=c[4],v=n(f,p),m=n(h,d);return v.concat([[0,y]],m)}return function(t,e){for(var n=t.length,i=e.length,o=Math.ceil((n+i)/2),a=o,u=2*o,s=new Array(u),l=new Array(u),c=0;cn)d+=2;else if(w>i)p+=2;else if(h&&(_=a+f-b)>=0&&_=x)return r(t,e,T,w)}}for(var k=-m+y;k<=m-v;k+=2){for(var _=a+k,S=(x=k==-m||k!=m&&l[_-1]n)v+=2;else if(S>i)y+=2;else if(!h&&(g=a+f-k)>=0&&g=(x=n-x))return r(t,e,T,w)}}}return[[-1,t],[1,e]]}(t,e)}(t=t.substring(0,t.length-s),e=e.substring(0,e.length-s));return l&&f.unshift([0,l]),c&&f.push([0,c]),function t(e){e.push([0,""]);for(var n,r=0,a=0,u=0,s="",l="";r1?(0!==a&&0!==u&&(0!==(n=i(l,s))&&(r-a-u>0&&0==e[r-a-u-1][0]?e[r-a-u-1][1]+=l.substring(0,n):(e.splice(0,0,[0,l.substring(0,n)]),r++),l=l.substring(n),s=s.substring(n)),0!==(n=o(l,s))&&(e[r][1]=l.substring(l.length-n)+e[r][1],l=l.substring(0,l.length-n),s=s.substring(0,s.length-n))),0===a?e.splice(r-u,a+u,[1,l]):0===u?e.splice(r-a,a+u,[-1,s]):e.splice(r-a-u,a+u,[-1,s],[1,l]),r=r-a-u+(a?1:0)+(u?1:0)+1):0!==r&&0==e[r-1][0]?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,u=0,a=0,s="",l=""}""===e[e.length-1][1]&&e.pop();var c=!1;for(r=1;r0&&r.splice(i+2,0,[a[0],s]),u(r,i,3)}return t}(f,a)),f=function(t){for(var e=!1,n=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},r=2;r=55296&&i.charCodeAt(i.length-1)<=56319&&-1===t[r-1][0]&&n(t[r-1][1])&&1===t[r][0]&&n(t[r][1])&&(e=!0,t[r-1][1]=t[r-2][1].slice(-1)+t[r-1][1],t[r][1]=t[r-2][1].slice(-1)+t[r][1],t[r-2][1]=t[r-2][1].slice(0,-1));var i;if(!e)return t;var o=[];for(r=0;r0&&o.push(t[r]);return o}(f)}function r(t,e,r,i){var o=t.substring(0,r),a=e.substring(0,i),u=t.substring(r),s=e.substring(i),l=n(o,a),c=n(u,s);return l.concat(c)}function i(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,o=0;n=0&&r>=e-1;r--)if(r+1=700)&&(n.bold=!0),Object.keys(n).length>0&&(e=E(e,n)),parseFloat(r.textIndent||0)>0&&(e=(new u.default).insert("\t").concat(e)),e}],["li",function(t,e){var n=s.default.query(t);if(null==n||"list-item"!==n.blotName||!N(e,"\n"))return e;for(var r=-1,i=t.parentNode;!i.classList.contains("ql-clipboard");)"list"===(s.default.query(i)||{}).blotName&&(r+=1),i=i.parentNode;return r<=0?e:e.compose((new u.default).retain(e.length()-1).retain(1,{indent:r}))}],["b",M.bind(M,"bold")],["i",M.bind(M,"italic")],["style",function(){return new u.default}]],S=[h.AlignAttribute,v.DirectionAttribute].reduce((function(t,e){return t[e.keyName]=e,t}),{}),T=[h.AlignStyle,p.BackgroundStyle,y.ColorStyle,v.DirectionStyle,m.FontStyle,b.SizeStyle].reduce((function(t,e){return t[e.keyName]=e,t}),{}),O=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],_.concat(r.options.matchers).forEach((function(t){var e=i(t,2),o=e[0],a=e[1];(n.matchVisual||a!==P)&&r.addMatcher(o,a)})),r}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),o(e,[{key:"addMatcher",value:function(t,e){this.matchers.push([t,e])}},{key:"convert",value:function(t){if("string"===typeof t)return this.container.innerHTML=t.replace(/\>\r?\n +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[d.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new u.default).insert(n,w({},d.default.blotName,e[d.default.blotName]))}var r=this.prepareMatching(),o=i(r,2),a=o[0],s=o[1],l=function t(e,n,r){return e.nodeType===e.TEXT_NODE?r.reduce((function(t,n){return n(e,t)}),new u.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],(function(i,o){var a=t(o,n,r);return o.nodeType===e.ELEMENT_NODE&&(a=n.reduce((function(t,e){return e(o,t)}),a),a=(o[k]||[]).reduce((function(t,e){return e(o,t)}),a)),i.concat(a)}),new u.default):new u.default}(this.container,a,s);return N(l,"\n")&&null==l.ops[l.ops.length-1].attributes&&(l=l.compose((new u.default).retain(l.length()-1).delete(1))),x.log("convert",this.container.innerHTML,l),this.container.innerHTML="",l}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"===typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,l.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new u.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),l.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new u.default).retain(n.index),i=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(l.default.sources.SILENT),setTimeout((function(){r=r.concat(e.convert()).delete(n.length),e.quill.updateContents(r,l.default.sources.USER),e.quill.setSelection(r.length()-n.length,l.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=i,e.quill.focus()}),1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach((function(r){var o=i(r,2),a=o[0],u=o[1];switch(a){case Node.TEXT_NODE:n.push(u);break;case Node.ELEMENT_NODE:e.push(u);break;default:[].forEach.call(t.container.querySelectorAll(a),(function(t){t[k]=t[k]||[],t[k].push(u)}))}})),[e,n]}}]),e}(f.default);function E(t,e,n){return"object"===("undefined"===typeof e?"undefined":r(e))?Object.keys(e).reduce((function(t,n){return E(t,n,e[n])}),t):t.reduce((function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,a.default)({},w({},e,n),r.attributes))}),new u.default)}function A(t){return t.nodeType!==Node.ELEMENT_NODE?{}:t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function N(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length-1}function M(t,e,n){return E(n,t,!0)}function C(t,e){var n=s.default.Attributor.Attribute.keys(t),r=s.default.Attributor.Class.keys(t),i=s.default.Attributor.Style.keys(t),o={};return n.concat(r).concat(i).forEach((function(e){var n=s.default.query(e,s.default.Scope.ATTRIBUTE);null!=n&&(o[n.attrName]=n.value(t),o[n.attrName])||(null==(n=S[e])||n.attrName!==e&&n.keyName!==e||(o[n.attrName]=n.value(t)||void 0),null==(n=T[e])||n.attrName!==e&&n.keyName!==e||(n=T[e],o[n.attrName]=n.value(t)||void 0))})),Object.keys(o).length>0&&(e=E(e,o)),e}function B(t,e){var n=s.default.query(t);if(null==n)return e;if(n.prototype instanceof s.default.Embed){var r={},i=n.value(t);null!=i&&(r[n.blotName]=i,e=(new u.default).insert(r,n.formats(t)))}else"function"===typeof n.formats&&(e=E(e,n.blotName,n.formats(t)));return e}function L(t,e){return N(e,"\n")||(I(t)||e.length()>0&&t.nextSibling&&I(t.nextSibling))&&e.insert("\n"),e}function P(t,e){if(I(t)&&null!=t.nextElementSibling&&!N(e,"\n\n")){var n=t.offsetHeight+parseFloat(A(t).marginTop)+parseFloat(A(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function j(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!A(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return(e=e.replace(/[^\u00a0]/g,"")).length<1&&t?" ":e};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&I(t.parentNode)||null!=t.previousSibling&&I(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&I(t.parentNode)||null!=t.nextSibling&&I(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}O.DEFAULTS={matchers:[],matchVisual:!0},e.default=O,e.matchAttributor=C,e.matchBlot=B,e.matchNewline=L,e.matchSpacing=P,e.matchText=j},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;nr.right&&(o=r.right-i.right,this.root.style.left=e+o+"px"),i.leftr.bottom){var a=i.bottom-i.top,u=t.bottom-t.top+a;this.root.style.top=n-u+"px",this.root.classList.add("ql-flip")}return o}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},o=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=P(n(29)),i=n(36),o=n(38),a=n(64),u=P(n(65)),s=P(n(66)),l=n(67),c=P(l),f=n(37),h=n(26),p=n(39),d=n(40),y=P(n(56)),v=P(n(68)),m=P(n(27)),b=P(n(69)),g=P(n(70)),w=P(n(71)),x=P(n(72)),k=P(n(73)),_=n(13),S=P(_),T=P(n(74)),O=P(n(75)),E=P(n(57)),A=P(n(41)),N=P(n(28)),I=P(n(59)),M=P(n(60)),C=P(n(61)),B=P(n(108)),L=P(n(62));function P(t){return t&&t.__esModule?t:{default:t}}r.default.register({"attributors/attribute/direction":o.DirectionAttribute,"attributors/class/align":i.AlignClass,"attributors/class/background":f.BackgroundClass,"attributors/class/color":h.ColorClass,"attributors/class/direction":o.DirectionClass,"attributors/class/font":p.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":i.AlignStyle,"attributors/style/background":f.BackgroundStyle,"attributors/style/color":h.ColorStyle,"attributors/style/direction":o.DirectionStyle,"attributors/style/font":p.FontStyle,"attributors/style/size":d.SizeStyle},!0),r.default.register({"formats/align":i.AlignClass,"formats/direction":o.DirectionClass,"formats/indent":a.IndentClass,"formats/background":f.BackgroundStyle,"formats/color":h.ColorStyle,"formats/font":p.FontClass,"formats/size":d.SizeClass,"formats/blockquote":u.default,"formats/code-block":S.default,"formats/header":s.default,"formats/list":c.default,"formats/bold":y.default,"formats/code":_.Code,"formats/italic":v.default,"formats/link":m.default,"formats/script":b.default,"formats/strike":g.default,"formats/underline":w.default,"formats/image":x.default,"formats/video":k.default,"formats/list/item":l.ListItem,"modules/formula":T.default,"modules/syntax":O.default,"modules/toolbar":E.default,"themes/bubble":B.default,"themes/snow":L.default,"ui/icons":A.default,"ui/picker":N.default,"ui/icon-picker":M.default,"ui/color-picker":I.default,"ui/tooltip":C.default},!0),e.default=r.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var r,i=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return t={},e=this.statics.blotName,n=this.statics.formats(this.domNode),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var t,e,n}},{key:"insertBefore",value:function(t,n){if(t instanceof h)i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=o.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}(u.default);p.blotName="list",p.scope=o.default.Scope.BLOCK_BLOT,p.tagName=["OL","UL"],p.defaultChild="list-item",p.allowedChildren=[h],e.ListItem=h,e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(56);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}var u=function(t){function e(){return o(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(((r=i)&&r.__esModule?r:{default:r}).default);u.blotName="italic",u.tagName=["EM","I"],e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"===typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,s.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(u.default.Embed);h.blotName="image",h.tagName="IMG",e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}},{key:"sanitize",value:function(t){return s.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(a.BlockEmbed);h.blotName="video",h.className="ql-video",h.tagName="IFRAME",e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var r=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}(u(n(13)).default);f.className="ql-syntax";var h=new i.default.Attributor.Class("token","hljs",{scope:i.default.Scope.INLINE}),p=function(t){function e(t,n){s(this,e);var r=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!==typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var i=null;return r.quill.on(o.default.events.SCROLL_OPTIMIZE,(function(){clearTimeout(i),i=setTimeout((function(){r.highlight(),i=null}),r.options.interval)})),r.highlight(),r}return c(e,t),r(e,null,[{key:"register",value:function(){o.default.register(h,!0),o.default.register(f,!0)}}]),r(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(o.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(f).forEach((function(e){e.highlight(t.options.highlight)})),this.quill.update(o.default.sources.SILENT),null!=e&&this.quill.setSelection(e,o.default.sources.SILENT)}}}]),e}(a.default);p.DEFAULTS={highlight:null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value},interval:1e3},e.CodeBlock=f,e.CodeToken=h,e.default=p},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},i=function(){function t(t,e){for(var n=0;n0&&i===a.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var o=r.quill.getLines(e.index,e.length);if(1===o.length)r.position(r.quill.getBounds(e));else{var u=o[o.length-1],s=r.quill.getIndex(u),c=Math.min(u.length()-1,e.index+e.length-s),f=r.quill.getBounds(new l.Range(s,c));r.position(f)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()})),r}return d(e,t),i(e,[{key:"listen",value:function(){var t=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",(function(){t.root.classList.remove("ql-editing")})),this.quill.on(a.default.events.SCROLL_OPTIMIZE,(function(){setTimeout((function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}}),1)}))}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),i=this.root.querySelector(".ql-tooltip-arrow");if(i.style.marginLeft="",0===n)return n;i.style.marginLeft=-1*n-i.offsetWidth/2+"px"}}]),e}(u.BaseTooltip);m.TEMPLATE=['','
','','',"
"].join(""),e.BubbleTooltip=m,e.default=v},function(t,e,n){t.exports=n(63)}]).default},t.exports=n()}).call(this,n(110).Buffer)},function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(t,e){for(var n,u,s=a(t),l=1;lc))return!1;var h=s.get(t),p=s.get(e);if(h&&p)return h==e&&p==t;var d=-1,y=!0,v=2&n?new r:void 0;for(s.set(t,e),s.set(e,t);++d-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){"use strict";var r=n(39),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function s(t){return r.isMemo(t)?a:u[t.$$typeof]||i}u[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[r.Memo]=a;var l=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,d=Object.prototype;t.exports=function t(e,n,r){if("string"!==typeof n){if(d){var i=p(n);i&&i!==d&&t(e,i,r)}var a=c(n);f&&(a=a.concat(f(n)));for(var u=s(e),y=s(n),v=0;v1)throw new Error("The Quill editing area can only be composed of a single React element.");if(u.default.Children.count(t.children)&&"textarea"===(null===(e=u.default.Children.only(t.children))||void 0===e?void 0:e.type))throw new Error("Quill does not support editing on a