@ni/nimble-components 34.5.0 → 34.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-components-bundle.js +2549 -2290
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +369 -340
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table/components/group-row/index.js +1 -1
- package/dist/esm/table/components/group-row/index.js.map +1 -1
- package/dist/esm/table/components/row/index.js +1 -1
- package/dist/esm/table/components/row/index.js.map +1 -1
- package/dist/esm/table/index.js +1 -1
- package/dist/esm/table/index.js.map +1 -1
- package/package.json +7 -6
|
@@ -179,7 +179,7 @@ function ot(t){const e=[],n=[]
|
|
|
179
179
|
return t.forEach((t=>(t[it]?e:n).push(t))),{prepend:e,append:n}}let st=(t,e)=>{const{prepend:n,append:i}=ot(e)
|
|
180
180
|
t.adoptedStyleSheets=[...n,...t.adoptedStyleSheets,...i]},rt=(t,e)=>{t.adoptedStyleSheets=t.adoptedStyleSheets.filter((t=>-1===e.indexOf(t)))}
|
|
181
181
|
if(b.supportsAdoptedStyleSheets)try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),st=(t,e)=>{const{prepend:n,append:i}=ot(e)
|
|
182
|
-
t.adoptedStyleSheets.splice(0,0,...n),t.adoptedStyleSheets.push(...i)},rt=(t,e)=>{for(const n of e){const e=t.adoptedStyleSheets.indexOf(n);-1!==e&&t.adoptedStyleSheets.splice(e,1)}}}catch(
|
|
182
|
+
t.adoptedStyleSheets.splice(0,0,...n),t.adoptedStyleSheets.push(...i)},rt=(t,e)=>{for(const n of e){const e=t.adoptedStyleSheets.indexOf(n);-1!==e&&t.adoptedStyleSheets.splice(e,1)}}}catch(oK){}class at extends tt{get styleSheets(){if(void 0===this._styleSheets){const t=this.styles,e=this.styleSheetCache
|
|
183
183
|
this._styleSheets=et(t).map((t=>{if(t instanceof CSSStyleSheet)return t
|
|
184
184
|
let n=e.get(t)
|
|
185
185
|
return void 0===n&&(n=new CSSStyleSheet,n.replaceSync(t),e.set(t,n)),n}))}return this._styleSheets}constructor(t,e){super(),this.styles=t,this.styleSheetCache=e,this._styleSheets=void 0,this.behaviors=nt(t)}addStylesTo(t){st(t,this.styleSheets),super.addStylesTo(t)}removeStylesFrom(t){rt(t,this.styleSheets),super.removeStylesFrom(t)}}let lt=0
|
|
@@ -807,18 +807,19 @@ this.designTokensInitialized||(this.designTokensInitialized=!0,null!==this.desig
|
|
|
807
807
|
for(const t of n)t.callback(t),t.willDefine&&null!==t.definition&&t.definition.define()
|
|
808
808
|
return this}}class Di{constructor(t,e,n,i,o,s){this.container=t,this.name=e,this.type=n,this.shadowRootMode=i,this.callback=o,this.willDefine=s,this.definition=null}definePresentation(t){Ue.define(this.name,t,this.container)}defineElement(t){this.definition=new bt(this.type,Object.assign(Object.assign({},t),{name:this.name}))}tagFor(t){return Ei.tagFor(t)}}
|
|
809
809
|
/*!
|
|
810
|
-
* tabbable 6.
|
|
810
|
+
* tabbable 6.3.0
|
|
811
811
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
812
812
|
*/var Oi="undefined"==typeof Element,Ti=Oi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ri=!Oi&&Element.prototype.getRootNode?function(t){var e
|
|
813
|
-
return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},Fi=function
|
|
814
|
-
void 0===
|
|
815
|
-
var
|
|
816
|
-
return""===
|
|
813
|
+
return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},Fi=function(t,e){var n
|
|
814
|
+
void 0===e&&(e=!0)
|
|
815
|
+
var i=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert")
|
|
816
|
+
return""===i||"true"===i||e&&t&&Fi(t.parentNode)},Ni=function(t){var e=t.getBoundingClientRect(),n=e.width,i=e.height
|
|
817
817
|
return 0===n&&0===i},Bi=function(t,e){var n=e.displayCheck,i=e.getShadowRoot
|
|
818
|
+
if("full-native"===n&&"checkVisibility"in t)return!t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0})
|
|
818
819
|
if("hidden"===getComputedStyle(t).visibility)return!0
|
|
819
820
|
var o=Ti.call(t,"details>summary:first-of-type")?t.parentElement:t
|
|
820
821
|
if(Ti.call(o,"details:not([open]) *"))return!0
|
|
821
|
-
if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ni(t)}else{if("function"==typeof i){for(var s=t;t;){var r=t.parentElement,a=Ri(t)
|
|
822
|
+
if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ni(t)}else{if("function"==typeof i){for(var s=t;t;){var r=t.parentElement,a=Ri(t)
|
|
822
823
|
if(r&&!r.shadowRoot&&!0===i(r))return Ni(t)
|
|
823
824
|
t=t.assignedSlot?t.assignedSlot:r||a===t.ownerDocument?r:a.host}t=s}if(function(t){var e,n,i,o,s=t&&Ri(t),r=null===(e=s)||void 0===e?void 0:e.host,a=!1
|
|
824
825
|
if(s&&s!==t)for(a=!!(null!==(n=r)&&void 0!==n&&null!==(i=n.ownerDocument)&&void 0!==i&&i.contains(r)||null!=t&&null!==(o=t.ownerDocument)&&void 0!==o&&o.contains(t));!a&&r;){var l,c,d
|
|
@@ -5640,9 +5641,12 @@ if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e
|
|
|
5640
5641
|
e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=Pb.from(this.content)
|
|
5641
5642
|
return!t&&this.match&&(e=e.append(this.match.fillBefore(Pb.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Dy.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Ny{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1
|
|
5642
5643
|
let i,o=e.topNode,s=Ry(null,e.preserveWhitespace,0)|(n?4:0)
|
|
5643
|
-
i=o?new Fy(o.type,o.attrs,Ub.none,!0,e.topMatch||o.type.contentMatch,s):new Fy(n?null:t.schema.topNodeType,null,Ub.none,!0,null,s),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,i=this.top,o=2&i.options?"full":this.localPreserveWS||(1&i.options)>0
|
|
5644
|
-
if("full"===o||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(o)
|
|
5645
|
-
else if(
|
|
5644
|
+
i=o?new Fy(o.type,o.attrs,Ub.none,!0,e.topMatch||o.type.contentMatch,s):new Fy(n?null:t.schema.topNodeType,null,Ub.none,!0,null,s),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,i=this.top,o=2&i.options?"full":this.localPreserveWS||(1&i.options)>0,{schema:s}=this.parser
|
|
5645
|
+
if("full"===o||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n")
|
|
5646
|
+
else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let t=n.split(/\r?\n|\r/)
|
|
5647
|
+
for(let n=0;n<t.length;n++)n&&this.insertNode(s.linebreakReplacement.create(),e,!0),t[n]&&this.insertNode(s.text(t[n]),e,!/\S/.test(t[n]))
|
|
5648
|
+
n=""}else n=n.replace(/\r?\n|\r/g," ")
|
|
5649
|
+
else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=i.content[i.content.length-1],o=t.previousSibling;(!e||o&&"BR"==o.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(s.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let i=this.localPreserveWS,o=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0)
|
|
5646
5650
|
let s,r=t.nodeName.toLowerCase()
|
|
5647
5651
|
Ty.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null
|
|
5648
5652
|
t&&Ty.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t)
|
|
@@ -6081,10 +6085,10 @@ let o,s=t.steps[i];(s instanceof sw||s instanceof rw)&&(t.mapping.maps[i].forEac
|
|
|
6081
6085
|
return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return Ub.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection
|
|
6082
6086
|
return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ub.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let i=this.doc.type.schema
|
|
6083
6087
|
if(null==e)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection()
|
|
6084
|
-
{if(null==n&&(n=e)
|
|
6088
|
+
{if(null==n&&(n=e),!t)return this.deleteRange(e,n)
|
|
6085
6089
|
let o=this.storedMarks
|
|
6086
6090
|
if(!o){let t=this.doc.resolve(e)
|
|
6087
|
-
o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,i.text(t,o)),this.selection.empty||this.setSelection(Rw.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1
|
|
6091
|
+
o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,i.text(t,o)),this.selection.empty||this.selection.to!=e+t.length||this.setSelection(Rw.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1
|
|
6088
6092
|
return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Gw(t,e){return e&&t?t.bind(e):t}class Zw{constructor(t,e,n){this.name=t,this.init=Gw(e.init,n),this.apply=Gw(e.apply,n)}}const Kw=[new Zw("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Zw("selection",{init:(t,e)=>t.selection||Rw.atStart(e.doc),apply:t=>t.selection}),new Zw("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,i)=>i.selection.$cursor?t.storedMarks:null}),new Zw("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})]
|
|
6089
6093
|
let Yw=class{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Kw.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")")
|
|
6090
6094
|
this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new Zw(t.key,t.spec.state,t))}))}}
|
|
@@ -6905,7 +6909,7 @@ Sx&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),Ax&&!b&&m.start()!=g.
|
|
|
6905
6909
|
let y,w=f.start,x=f.endA,C=e=>{let n=e||t.state.tr.replace(w,x,h.doc.slice(f.start-h.from,f.endB-h.from))
|
|
6906
6910
|
if(h.sel){let e=dS(t,n.doc,h.sel)
|
|
6907
6911
|
e&&!(Sx&&t.composing&&e.empty&&(f.start!=f.endB||t.input.lastChromeDelete<Date.now()-100)&&(e.head==w||e.head==n.mapping.map(x)-1)||wx&&e.empty&&e.head==w)&&n.setSelection(e)}return s&&n.setMeta("composition",s),n.scrollIntoView()}
|
|
6908
|
-
if(b)
|
|
6912
|
+
if(b)if(m.pos==g.pos){wx&&xx<=11&&0==m.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>_C(t)),20))
|
|
6909
6913
|
let e=C(t.state.tr.delete(w,x)),n=u.resolve(f.start).marksAcross(u.resolve(f.endA))
|
|
6910
6914
|
n&&e.ensureMarks(n),t.dispatch(e)}else if(f.endA==f.endB&&(y=function(t,e){let n,i,o,s=t.firstChild.marks,r=e.firstChild.marks,a=s,l=r
|
|
6911
6915
|
for(let t=0;t<r.length;t++)a=r[t].removeFromSet(a)
|
|
@@ -6916,7 +6920,8 @@ i=l[0],n="remove",o=t=>t.mark(i.removeFromSet(t.marks))}let c=[]
|
|
|
6916
6920
|
for(let t=0;t<e.childCount;t++)c.push(o(e.child(t)))
|
|
6917
6921
|
if(Pb.from(c).eq(t))return{mark:i,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),v.parent.content.cut(v.parentOffset,f.endA-v.start())))){let e=C(t.state.tr)
|
|
6918
6922
|
"add"==y.type?e.addMark(w,x,y.mark):e.removeMark(w,x,y.mark),t.dispatch(e)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let e=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>C(t.state.tr.insertText(e,w,x))
|
|
6919
|
-
t.someProp("handleTextInput",(i=>i(t,w,x,e,n)))||t.dispatch(n())}
|
|
6923
|
+
t.someProp("handleTextInput",(i=>i(t,w,x,e,n)))||t.dispatch(n())}else t.dispatch(C())
|
|
6924
|
+
else t.dispatch(C())}function dS(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:OC(t,e.resolve(n.anchor),e.resolve(n.head))}function hS(t,e,n){let i=t.depth,o=e?t.end():t.pos
|
|
6920
6925
|
for(;i>0&&(e||t.indexAfter(i)==t.node(i).childCount);)i--,o++,e=!1
|
|
6921
6926
|
if(n){let e=t.node(i).maybeChild(t.indexAfter(i))
|
|
6922
6927
|
for(;e&&!e.isLeaf;)e=e.firstChild,o++}return o}function uS(t){if(2!=t.length)return!1
|
|
@@ -13853,7 +13858,7 @@ return s(y(b(i,l),r,a),t,c)}),n,i)},v.translateBy=function(t,e,n,i){v.transform(
|
|
|
13853
13858
|
return s(qH.translate(a[0],a[1]).scale(r.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),i,r)},k.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=Dz(this.that).datum()
|
|
13854
13859
|
u.call(t,this.that,new HH(t,{sourceEvent:this.sourceEvent,target:v,transform:this.that.__zoom,dispatch:u}),e)}},v.wheelDelta=function(t){return arguments.length?(r="function"==typeof t?t:VH(+t),v):r},v.filter=function(t){return arguments.length?(i="function"==typeof t?t:VH(!!t),v):i},v.touchable=function(t){return arguments.length?(a="function"==typeof t?t:VH(!!t),v):a},v.extent=function(t){return arguments.length?(o="function"==typeof t?t:VH([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):o},v.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],v):[l[0],l[1]]},v.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],v):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},v.constrain=function(t){return arguments.length?(s=t,v):s},v.duration=function(t){return arguments.length?(d=+t,v):d},v.interpolate=function(t){return arguments.length?(h=t,v):h},v.on=function(){var t=u.on.apply(u,arguments)
|
|
13855
13860
|
return t===u?v:t},v.clickDistance=function(t){return arguments.length?(m=(t=+t)*t,v):Math.sqrt(m)},v.tapDistance=function(t){return arguments.length?(g=+t,v):g},v}UH.prototype
|
|
13856
|
-
const tU=new TextDecoder("utf-8"),eU=
|
|
13861
|
+
const tU=new TextDecoder("utf-8"),eU=tU.decode.bind(tU),nU=new TextEncoder,iU=t=>nU.encode(t),oU=t=>"function"==typeof t,sU=t=>null!=t&&Object(t)===t,rU=t=>sU(t)&&oU(t.then),aU=t=>sU(t)&&oU(t[Symbol.iterator]),lU=t=>sU(t)&&oU(t[Symbol.asyncIterator]),cU=t=>sU(t)&&sU(t.schema),dU=t=>sU(t)&&"done"in t&&"value"in t,hU=t=>sU(t)&&oU(t.stat)&&(t=>"number"==typeof t)(t.fd),uU=t=>sU(t)&&fU(t.body),pU=t=>"_getDOMStream"in t&&"_getNodeStream"in t,fU=t=>sU(t)&&oU(t.cancel)&&oU(t.getReader)&&!pU(t),mU=t=>sU(t)&&oU(t.read)&&oU(t.pipe)&&(t=>"boolean"==typeof t)(t.readable)&&!pU(t),gU=t=>sU(t)&&oU(t.clear)&&oU(t.bytes)&&oU(t.position)&&oU(t.setPosition)&&oU(t.capacity)&&oU(t.getBufferIdentifier)&&oU(t.createLong),vU="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:ArrayBuffer
|
|
13857
13862
|
function bU(t,e,n=0,i=e.byteLength){const o=t.byteLength,s=new Uint8Array(t.buffer,t.byteOffset,o),r=new Uint8Array(e.buffer,e.byteOffset,Math.min(i,o))
|
|
13858
13863
|
return s.set(r,n),t}function yU(t,e){const n=function(t){const e=t[0]?[t[0]]:[]
|
|
13859
13864
|
let n,i,o,s
|
|
@@ -13954,9 +13959,10 @@ if(null===i)throw new TypeError("FlatBuffers: Argument for createObjectOffsetLis
|
|
|
13954
13959
|
e.push(this.createObjectOffset(i))}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}}
|
|
13955
13960
|
var jU,WU
|
|
13956
13961
|
!function(t){t[t.BUFFER=0]="BUFFER"}(jU||(jU={})),function(t){t[t.LZ4_FRAME=0]="LZ4_FRAME",t[t.ZSTD=1]="ZSTD"}(WU||(WU={}))
|
|
13957
|
-
class
|
|
13962
|
+
let GU=class t{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBodyCompression(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}codec(){const t=this.bb.__offset(this.bb_pos,4)
|
|
13958
13963
|
return t?this.bb.readInt8(this.bb_pos+t):WU.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6)
|
|
13959
|
-
return t?this.bb.readInt8(this.bb_pos+t):jU.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,WU.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,jU.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(
|
|
13964
|
+
return t?this.bb.readInt8(this.bb_pos+t):jU.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,WU.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,jU.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(e,n,i){return t.startBodyCompression(e),t.addCodec(e,n),t.addMethod(e,i),t.endBodyCompression(e)}}
|
|
13965
|
+
class ZU{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,e,n){return t.prep(8,16),t.writeInt64(BigInt(null!=n?n:0)),t.writeInt64(BigInt(null!=e?e:0)),t.offset()}}let KU=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,e,n){return t.prep(8,16),t.writeInt64(BigInt(null!=n?n:0)),t.writeInt64(BigInt(null!=e?e:0)),t.offset()}},YU=class t{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}length(){const t=this.bb.__offset(this.bb_pos,4)
|
|
13960
13966
|
return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,e){const n=this.bb.__offset(this.bb_pos,6)
|
|
13961
13967
|
return n?(e||new KU).__init(this.bb.__vector(this.bb_pos+n)+16*t,this.bb):null}nodesLength(){const t=this.bb.__offset(this.bb_pos,6)
|
|
13962
13968
|
return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){const n=this.bb.__offset(this.bb_pos,8)
|
|
@@ -14516,136 +14522,7 @@ const o=e.endVector()
|
|
|
14516
14522
|
return HG.startFooter(e),HG.addSchema(e,n),HG.addVersion(e,OU.V5),HG.addRecordBatches(e,i),HG.addDictionaries(e,o),HG.finishFooterBuffer(e,HG.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=OU.V5,n,i){this.schema=t,this.version=e,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,e=-1,n=this.numRecordBatches;++e<n;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,n=this.numDictionaries;++e<n;)(t=this.getDictionaryBatch(e))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}}class YG extends KG{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,e){super(t,e.version()),this._footer=e}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const e=this._footer.recordBatches(t)
|
|
14517
14523
|
if(e)return XG.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t)
|
|
14518
14524
|
if(e)return XG.decode(e)}return null}}class XG{static decode(t){return new XG(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:n}=e,i=BigInt(e.offset),o=BigInt(e.bodyLength)
|
|
14519
|
-
return VG.createBlock(t,i,n,o)}constructor(t,e,n){this.metaDataLength=t,this.offset=Eq(n),this.bodyLength=Eq(e)}}
|
|
14520
|
-
class QG{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class tZ{tee(){return this._getDOMStream().tee()}pipe(t,e){return this._getNodeStream().pipe(t,e)}pipeTo(t,e){return this._getDOMStream().pipeTo(t,e)}pipeThrough(t,e){return this._getDOMStream().pipeThrough(t,e)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class eZ extends tZ{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise((t=>this._closedPromiseResolve=t))}get closed(){return this._closedPromise}cancel(t){return e(this,void 0,void 0,(function*(){yield this.return(t)}))}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this
|
|
14521
|
-
for(;t.length>0;)t.shift().resolve(JG)
|
|
14522
|
-
this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return $U.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return $U.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return e(this,void 0,void 0,(function*(){return yield this.abort(t),JG}))}return(t){return e(this,void 0,void 0,(function*(){return yield this.close(),JG}))}read(t){return e(this,void 0,void 0,(function*(){return(yield this.next(t,"read")).value}))}peek(t){return e(this,void 0,void 0,(function*(){return(yield this.next(t,"peek")).value}))}next(...t){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(((t,e)=>{this.resolvers.push({resolve:t,reject:e})})):Promise.resolve(JG)}_ensureOpen(){if(this._closedPromiseResolve)return!0
|
|
14523
|
-
throw new Error("AsyncQueue is closed")}}class nZ extends eZ{write(t){if((t=kU(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?eU(this.toUint8Array(!0)):this.toUint8Array(!1).then(eU)}toUint8Array(t=!1){return t?yU(this._values)[0]:(()=>e(this,void 0,void 0,(function*(){var t,e,n,i
|
|
14524
|
-
const o=[]
|
|
14525
|
-
let s=0
|
|
14526
|
-
try{for(var a,l=!0,c=r(this);!(t=(a=yield c.next()).done);l=!0){i=a.value,l=!1
|
|
14527
|
-
const t=i
|
|
14528
|
-
o.push(t),s+=t.byteLength}}catch(t){e={error:t}}finally{try{l||t||!(n=c.return)||(yield n.call(c))}finally{if(e)throw e.error}}return yU(o,s)[0]})))()}}class iZ{constructor(t){t&&(this.source=new sZ($U.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class oZ{constructor(t){t instanceof oZ?this.source=t.source:t instanceof nZ?this.source=new rZ($U.fromAsyncIterable(t)):mU(t)?this.source=new rZ($U.fromNodeStream(t)):fU(t)?this.source=new rZ($U.fromDOMStream(t)):uU(t)?this.source=new rZ($U.fromDOMStream(t.body)):aU(t)?this.source=new rZ($U.fromIterable(t)):(rU(t)||lU(t))&&(this.source=new rZ($U.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class sZ{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||JG)}return(t){return Object.create(this.source.return&&this.source.return(t)||JG)}}class rZ{constructor(t){this.source=t,this._closedPromise=new Promise((t=>this._closedPromiseResolve=t))}cancel(t){return e(this,void 0,void 0,(function*(){yield this.return(t)}))}get closed(){return this._closedPromise}read(t){return e(this,void 0,void 0,(function*(){return(yield this.next(t,"read")).value}))}peek(t){return e(this,void 0,void 0,(function*(){return(yield this.next(t,"peek")).value}))}next(t){return e(this,arguments,void 0,(function*(t,e="read"){return yield this.source.next({cmd:e,size:t})}))}throw(t){return e(this,void 0,void 0,(function*(){const e=this.source.throw&&(yield this.source.throw(t))||JG
|
|
14529
|
-
return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}))}return(t){return e(this,void 0,void 0,(function*(){const e=this.source.return&&(yield this.source.return(t))||JG
|
|
14530
|
-
return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}))}}class aZ extends iZ{constructor(t,e){super(),this.position=0,this.buffer=kU(t),this.size=void 0===e?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:n}=this.readAt(t,4)
|
|
14531
|
-
return new DataView(e,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:e,size:n,position:i}=this
|
|
14532
|
-
return e&&i<n?("number"!=typeof t&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),e.subarray(i,this.position)):null}readAt(t,e){const n=this.buffer,i=Math.min(this.size,t+e)
|
|
14533
|
-
return n?n.subarray(t,i):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}}class lZ extends oZ{constructor(t,n){super(),this.position=0,this._handle=t,"number"==typeof n?this.size=n:this._pending=(()=>e(this,void 0,void 0,(function*(){this.size=(yield t.stat()).size,delete this._pending})))()}readInt32(t){return e(this,void 0,void 0,(function*(){const{buffer:e,byteOffset:n}=yield this.readAt(t,4)
|
|
14534
|
-
return new DataView(e,n).getInt32(0,!0)}))}seek(t){return e(this,void 0,void 0,(function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size}))}read(t){return e(this,void 0,void 0,(function*(){this._pending&&(yield this._pending)
|
|
14535
|
-
const{_handle:e,size:n,position:i}=this
|
|
14536
|
-
if(e&&i<n){"number"!=typeof t&&(t=Number.POSITIVE_INFINITY)
|
|
14537
|
-
let o=i,s=0,r=0
|
|
14538
|
-
const a=Math.min(n,o+Math.min(n-o,t)),l=new Uint8Array(Math.max(0,(this.position=a)-o))
|
|
14539
|
-
for(;(o+=r)<a&&(s+=r)<l.byteLength;)({bytesRead:r}=yield e.read(l,s,l.byteLength-s,o))
|
|
14540
|
-
return l}return null}))}readAt(t,n){return e(this,void 0,void 0,(function*(){this._pending&&(yield this._pending)
|
|
14541
|
-
const{_handle:e,size:i}=this
|
|
14542
|
-
if(e&&t+n<i){const o=Math.min(i,t+n),s=new Uint8Array(o-t)
|
|
14543
|
-
return(yield e.read(s,0,n,t)).buffer}return new Uint8Array(n)}))}close(){return e(this,void 0,void 0,(function*(){const t=this._handle
|
|
14544
|
-
this._handle=null,t&&(yield t.close())}))}throw(t){return e(this,void 0,void 0,(function*(){return yield this.close(),{done:!0,value:t}}))}return(t){return e(this,void 0,void 0,(function*(){return yield this.close(),{done:!0,value:t}}))}}function cZ(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}const dZ=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8]
|
|
14545
|
-
class hZ{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>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]])
|
|
14546
|
-
let i=e[3]*n[3]
|
|
14547
|
-
this.buffer[0]=65535&i
|
|
14548
|
-
let o=i>>>16
|
|
14549
|
-
return i=e[2]*n[3],o+=i,i=e[3]*n[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>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}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0
|
|
14550
|
-
this.buffer[1]+=t.buffer[1],e<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${cZ(this.buffer[1])} ${cZ(this.buffer[0])}`}}class uZ extends hZ{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return uZ.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return uZ.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.length,i=new uZ(e)
|
|
14551
|
-
for(let e=0;e<n;){const o=8<n-e?8:n-e,s=new uZ(new Uint32Array([Number.parseInt(t.slice(e,e+o),10),0])),r=new uZ(new Uint32Array([dZ[o],0]))
|
|
14552
|
-
i.times(r),i.plus(s),e+=o}return i}static convertArray(t){const e=new Uint32Array(2*t.length)
|
|
14553
|
-
for(let n=-1,i=t.length;++n<i;)uZ.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2))
|
|
14554
|
-
return e}static multiply(t,e){return new uZ(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new uZ(new Uint32Array(t.buffer)).plus(e)}}class pZ extends hZ{negate(){return this.buffer[0]=1+~this.buffer[0],this.buffer[1]=~this.buffer[1],0==this.buffer[0]&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){const e=this.buffer[1]|0,n=t.buffer[1]|0
|
|
14555
|
-
return e<n||e===n&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return pZ.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return pZ.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.startsWith("-"),i=t.length,o=new pZ(e)
|
|
14556
|
-
for(let e=n?1:0;e<i;){const n=8<i-e?8:i-e,s=new pZ(new Uint32Array([Number.parseInt(t.slice(e,e+n),10),0])),r=new pZ(new Uint32Array([dZ[n],0]))
|
|
14557
|
-
o.times(r),o.plus(s),e+=n}return n?o.negate():o}static convertArray(t){const e=new Uint32Array(2*t.length)
|
|
14558
|
-
for(let n=-1,i=t.length;++n<i;)pZ.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2))
|
|
14559
|
-
return e}static multiply(t,e){return new pZ(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new pZ(new Uint32Array(t.buffer)).plus(e)}}class fZ{constructor(t){this.buffer=t}high(){return new pZ(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new pZ(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=1+~this.buffer[0],this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],0==this.buffer[0]&&++this.buffer[1],0==this.buffer[1]&&++this.buffer[2],0==this.buffer[2]&&++this.buffer[3],this}times(t){const e=new uZ(new Uint32Array([this.buffer[3],0])),n=new uZ(new Uint32Array([this.buffer[2],0])),i=new uZ(new Uint32Array([this.buffer[1],0])),o=new uZ(new Uint32Array([this.buffer[0],0])),s=new uZ(new Uint32Array([t.buffer[3],0])),r=new uZ(new Uint32Array([t.buffer[2],0])),a=new uZ(new Uint32Array([t.buffer[1],0])),l=new uZ(new Uint32Array([t.buffer[0],0]))
|
|
14560
|
-
let c=uZ.multiply(o,l)
|
|
14561
|
-
this.buffer[0]=c.low()
|
|
14562
|
-
const d=new uZ(new Uint32Array([c.high(),0]))
|
|
14563
|
-
c=uZ.multiply(i,l),d.plus(c),c=uZ.multiply(o,a),d.plus(c),this.buffer[1]=d.low(),this.buffer[3]=d.lessThan(c)?1:0,this.buffer[2]=d.high()
|
|
14564
|
-
return new uZ(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(uZ.multiply(n,l)).plus(uZ.multiply(i,a)).plus(uZ.multiply(o,r)),this.buffer[3]+=uZ.multiply(e,l).plus(uZ.multiply(n,a)).plus(uZ.multiply(i,r)).plus(uZ.multiply(o,s)).low(),this}plus(t){const e=new Uint32Array(4)
|
|
14565
|
-
return e[3]=this.buffer[3]+t.buffer[3]>>>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]<this.buffer[0]>>>0&&++e[1],e[1]<this.buffer[1]>>>0&&++e[2],e[2]<this.buffer[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}hex(){return`${cZ(this.buffer[3])} ${cZ(this.buffer[2])} ${cZ(this.buffer[1])} ${cZ(this.buffer[0])}`}static multiply(t,e){return new fZ(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new fZ(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return fZ.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return fZ.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,o=new fZ(e)
|
|
14566
|
-
for(let e=n?1:0;e<i;){const n=8<i-e?8:i-e,s=new fZ(new Uint32Array([Number.parseInt(t.slice(e,e+n),10),0,0,0])),r=new fZ(new Uint32Array([dZ[n],0,0,0]))
|
|
14567
|
-
o.times(r),o.plus(s),e+=n}return n?o.negate():o}static convertArray(t){const e=new Uint32Array(4*t.length)
|
|
14568
|
-
for(let n=-1,i=t.length;++n<i;)fZ.from(t[n],new Uint32Array(e.buffer,e.byteOffset+16*n,4))
|
|
14569
|
-
return e}}class mZ extends Nj{constructor(t,e,n,i,o=OU.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=n,this.dictionaries=i,this.metadataVersion=o}visit(t){return super.visit(t instanceof qG?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return bG({type:t,length:e})}visitBool(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<OU.V5&&this.readNullBitmap(t,n),t.mode===TU.Sparse?this.visitSparseUnion(t,{length:e,nullCount:n}):this.visitDenseUnion(t,{length:e,nullCount:n})}visitDenseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e,n=this.nextBufferRange()){return e>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class gZ extends mZ{constructor(t,e,n,i,o){super(new Uint8Array(0),e,n,i,o),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):hG(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return wU(Uint8Array,wU(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return wU(Uint8Array,wU(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:n}=this
|
|
14570
|
-
if(dj.isTimestamp(t))return wU(Uint8Array,pZ.convertArray(n[e]))
|
|
14571
|
-
if((dj.isInt(t)||dj.isTime(t))&&64===t.bitWidth||dj.isDuration(t))return wU(Uint8Array,pZ.convertArray(n[e]))
|
|
14572
|
-
if(dj.isDate(t)&&t.unit===FU.MILLISECOND)return wU(Uint8Array,pZ.convertArray(n[e]))
|
|
14573
|
-
if(dj.isDecimal(t))return wU(Uint8Array,fZ.convertArray(n[e]))
|
|
14574
|
-
if(dj.isBinary(t)||dj.isLargeBinary(t)||dj.isFixedSizeBinary(t))return function(t){const e=t.join(""),n=new Uint8Array(e.length/2)
|
|
14575
|
-
for(let t=0;t<e.length;t+=2)n[t>>1]=Number.parseInt(e.slice(t,t+2),16)
|
|
14576
|
-
return n}(n[e])
|
|
14577
|
-
if(dj.isBool(t))return hG(n[e])
|
|
14578
|
-
if(dj.isUtf8(t)||dj.isLargeUtf8(t))return iU(n[e].join(""))
|
|
14579
|
-
if(dj.isInterval(t))switch(t.unit){case BU.DAY_TIME:return function(t){var e,n
|
|
14580
|
-
const i=t.length,o=new Int32Array(2*i)
|
|
14581
|
-
for(let s=0,r=0;s<i;s++){const i=t[s]
|
|
14582
|
-
o[r++]=null!==(e=i.days)&&void 0!==e?e:0,o[r++]=null!==(n=i.milliseconds)&&void 0!==n?n:0}return o}(n[e])
|
|
14583
|
-
case BU.MONTH_DAY_NANO:return function(t){var e,n
|
|
14584
|
-
const i=t.length,o=new Int32Array(4*i)
|
|
14585
|
-
for(let s=0,r=0;s<i;s++){const i=t[s]
|
|
14586
|
-
o[r++]=null!==(e=i.months)&&void 0!==e?e:0,o[r++]=null!==(n=i.days)&&void 0!==n?n:0
|
|
14587
|
-
const a=i.nanoseconds
|
|
14588
|
-
a?(o[r++]=Number(BigInt(a)&BigInt(4294967295)),o[r++]=Number(BigInt(a)>>BigInt(32))):r+=2}return o}(n[e])}return wU(Uint8Array,wU(t.ArrayType,n[e].map((t=>+t))))}}class vZ extends Nj{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every(((t,n)=>this.compareFields(t,e[n])))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function bZ(t,e){return e instanceof t.constructor}function yZ(t,e){return t===e||bZ(t,e)}function wZ(t,e){return t===e||bZ(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function xZ(t,e){return t===e||bZ(t,e)&&t.precision===e.precision}function CZ(t,e){return t===e||bZ(t,e)&&t.unit===e.unit}function kZ(t,e){return t===e||bZ(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function SZ(t,e){return t===e||bZ(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function _Z(t,e){return t===e||bZ(t,e)&&t.mode===e.mode&&t.typeIds.every(((t,n)=>t===e.typeIds[n]))&&$Z.compareManyFields(t.children,e.children)}function IZ(t,e){return t===e||bZ(t,e)&&t.unit===e.unit}function MZ(t,e){return t===e||bZ(t,e)&&t.unit===e.unit}vZ.prototype.visitNull=yZ,vZ.prototype.visitBool=yZ,vZ.prototype.visitInt=wZ,vZ.prototype.visitInt8=wZ,vZ.prototype.visitInt16=wZ,vZ.prototype.visitInt32=wZ,vZ.prototype.visitInt64=wZ,vZ.prototype.visitUint8=wZ,vZ.prototype.visitUint16=wZ,vZ.prototype.visitUint32=wZ,vZ.prototype.visitUint64=wZ,vZ.prototype.visitFloat=xZ,vZ.prototype.visitFloat16=xZ,vZ.prototype.visitFloat32=xZ,vZ.prototype.visitFloat64=xZ,vZ.prototype.visitUtf8=yZ,vZ.prototype.visitLargeUtf8=yZ,vZ.prototype.visitBinary=yZ,vZ.prototype.visitLargeBinary=yZ,vZ.prototype.visitFixedSizeBinary=function(t,e){return t===e||bZ(t,e)&&t.byteWidth===e.byteWidth},vZ.prototype.visitDate=CZ,vZ.prototype.visitDateDay=CZ,vZ.prototype.visitDateMillisecond=CZ,vZ.prototype.visitTimestamp=kZ,vZ.prototype.visitTimestampSecond=kZ,vZ.prototype.visitTimestampMillisecond=kZ,vZ.prototype.visitTimestampMicrosecond=kZ,vZ.prototype.visitTimestampNanosecond=kZ,vZ.prototype.visitTime=SZ,vZ.prototype.visitTimeSecond=SZ,vZ.prototype.visitTimeMillisecond=SZ,vZ.prototype.visitTimeMicrosecond=SZ,vZ.prototype.visitTimeNanosecond=SZ,vZ.prototype.visitDecimal=yZ,vZ.prototype.visitList=function(t,e){return t===e||bZ(t,e)&&t.children.length===e.children.length&&$Z.compareManyFields(t.children,e.children)},vZ.prototype.visitStruct=function(t,e){return t===e||bZ(t,e)&&t.children.length===e.children.length&&$Z.compareManyFields(t.children,e.children)},vZ.prototype.visitUnion=_Z,vZ.prototype.visitDenseUnion=_Z,vZ.prototype.visitSparseUnion=_Z,vZ.prototype.visitDictionary=function(t,e){return t===e||bZ(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&$Z.visit(t.indices,e.indices)&&$Z.visit(t.dictionary,e.dictionary)},vZ.prototype.visitInterval=IZ,vZ.prototype.visitIntervalDayTime=IZ,vZ.prototype.visitIntervalYearMonth=IZ,vZ.prototype.visitIntervalMonthDayNano=IZ,vZ.prototype.visitDuration=MZ,vZ.prototype.visitDurationSecond=MZ,vZ.prototype.visitDurationMillisecond=MZ,vZ.prototype.visitDurationMicrosecond=MZ,vZ.prototype.visitDurationNanosecond=MZ,vZ.prototype.visitFixedSizeList=function(t,e){return t===e||bZ(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&$Z.compareManyFields(t.children,e.children)},vZ.prototype.visitMap=function(t,e){return t===e||bZ(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&$Z.compareManyFields(t.children,e.children)}
|
|
14589
|
-
const $Z=new vZ
|
|
14590
|
-
function EZ(t,e){return $Z.compareSchemas(t,e)}function AZ(t,e){return function(t,e){const n=[...t.fields],i=[],o={numBatches:e.reduce(((t,e)=>Math.max(t,e.length)),0)}
|
|
14591
|
-
let s=0,r=0,a=-1
|
|
14592
|
-
const l=e.length
|
|
14593
|
-
let c,d=[]
|
|
14594
|
-
for(;o.numBatches-- >0;){for(r=Number.POSITIVE_INFINITY,a=-1;++a<l;)d[a]=c=e[a].shift(),r=Math.min(r,c?c.length:r)
|
|
14595
|
-
Number.isFinite(r)&&(d=DZ(n,r,d,e,o),r>0&&(i[s++]=bG({type:new Mj(n),length:r,nullCount:0,children:d.slice()})))}return[t=t.assign(n),i.map((e=>new FZ(t,e)))]}(t,e.map((t=>t.data.concat())))}function DZ(t,e,n,i,o){var s
|
|
14596
|
-
const r=(e+63&-64)>>3
|
|
14597
|
-
for(let a=-1,l=i.length;++a<l;){const l=n[a],c=null==l?void 0:l.length
|
|
14598
|
-
if(c>=e)c===e?n[a]=l:(n[a]=l.slice(0,e),o.numBatches=Math.max(o.numBatches,i[a].unshift(l.slice(e,c-e))))
|
|
14599
|
-
else{const i=t[a]
|
|
14600
|
-
t[a]=i.clone({nullable:!0}),n[a]=null!==(s=null==l?void 0:l._changeLengthAndBackfillNullBitmap(e))&&void 0!==s?s:bG({type:i.type,length:e,nullCount:e,nullBitmap:new Uint8Array(r)})}}return n}var OZ,TZ
|
|
14601
|
-
class RZ{constructor(...t){var e,n
|
|
14602
|
-
if(0===t.length)return this.batches=[],this.schema=new UG([]),this._offsets=[0],this
|
|
14603
|
-
let i,o
|
|
14604
|
-
t[0]instanceof UG&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop())
|
|
14605
|
-
const s=t=>{if(t){if(t instanceof FZ)return[t]
|
|
14606
|
-
if(t instanceof RZ)return t.batches
|
|
14607
|
-
if(t instanceof mG){if(t.type instanceof Mj)return[new FZ(new UG(t.type.children),t)]}else{if(Array.isArray(t))return t.flatMap((t=>s(t)))
|
|
14608
|
-
if("function"==typeof t[Symbol.iterator])return[...t].flatMap((t=>s(t)))
|
|
14609
|
-
if("object"==typeof t){const e=Object.keys(t),n=e.map((e=>new PG([t[e]]))),o=null!=i?i:new UG(e.map(((t,e)=>new qG(String(t),n[e].type,n[e].nullable)))),[,s]=AZ(o,n)
|
|
14610
|
-
return 0===s.length?[new FZ(t)]:s}}}return[]},r=t.flatMap((t=>s(t)))
|
|
14611
|
-
if(i=null!==(n=null!=i?i:null===(e=r[0])||void 0===e?void 0:e.schema)&&void 0!==n?n:new UG([]),!(i instanceof UG))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.")
|
|
14612
|
-
for(const t of r){if(!(t instanceof FZ))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.")
|
|
14613
|
-
if(!EZ(i,t.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=r,this._offsets=null!=o?o:xG(this.data)}get data(){return this.batches.map((({data:t})=>t))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce(((t,e)=>t+e.length),0)}get nullCount(){return-1===this._nullCount&&(this._nullCount=wG(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(iG(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?FG.visit(new PG(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(",\n ")}\n]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap((({data:t})=>t)))
|
|
14614
|
-
return new RZ(e,n.map((t=>new FZ(e,t))))}slice(t,e){const n=this.schema;[t,e]=nG({length:this.numRows},t,e)
|
|
14615
|
-
const i=CG(this.data,this._offsets,t,e)
|
|
14616
|
-
return new RZ(n,i.map((t=>new FZ(n,t))))}getChild(t){return this.getChildAt(this.schema.fields.findIndex((e=>e.name===t)))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){const e=this.data.map((e=>e.children[t]))
|
|
14617
|
-
if(0===e.length){const{type:n}=this.schema.fields[t],i=bG({type:n,length:0,nullCount:0})
|
|
14618
|
-
e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new PG(e)}return null}setChild(t,e){var n
|
|
14619
|
-
return this.setChildAt(null===(n=this.schema.fields)||void 0===n?void 0:n.findIndex((e=>e.name===t)),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches]
|
|
14620
|
-
if(t>-1&&t<this.numCols){e||(e=new PG([bG({type:new hj,length:this.numRows})]))
|
|
14621
|
-
const o=n.fields.slice(),s=o[t].clone({type:e.type}),r=this.schema.fields.map(((t,e)=>this.getChildAt(e)));[o[t],r[t]]=[s,e],[n,i]=AZ(n,r)}return new RZ(n,i)}select(t){const e=this.schema.fields.reduce(((t,e,n)=>t.set(e.name,n)),new Map)
|
|
14622
|
-
return this.selectAt(t.map((t=>e.get(t))).filter((t=>t>-1)))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map((e=>e.selectAt(t)))
|
|
14623
|
-
return new RZ(e,n)}assign(t){const e=this.schema.fields,[n,i]=t.schema.fields.reduce(((t,n,i)=>{const[o,s]=t,r=e.findIndex((t=>t.name===n.name))
|
|
14624
|
-
return~r?s[r]=i:o.push(i),t}),[[],[]]),o=this.schema.assign(t.schema),s=[...e.map(((t,e)=>[e,i[e]])).map((([e,n])=>void 0===n?this.getChildAt(e):t.getChildAt(n))),...n.map((e=>t.getChildAt(e)))].filter(Boolean)
|
|
14625
|
-
return new RZ(...AZ(o,s))}}OZ=Symbol.toStringTag,RZ[OZ]=(t=>(t.schema=null,t.batches=[],t._offsets=new Uint32Array([0]),t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t.isValid=_G(SG),t.get=_G(GW.getVisitFn(Iq.Struct)),t.set=IG(mW.getVisitFn(Iq.Struct)),t.indexOf=MG(DG.getVisitFn(Iq.Struct)),"Table"))(RZ.prototype)
|
|
14626
|
-
let FZ=class t{constructor(...t){switch(t.length){case 2:if([this.schema]=t,!(this.schema instanceof UG))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.")
|
|
14627
|
-
if([,this.data=bG({nullCount:0,type:new Mj(this.schema.fields),children:this.schema.fields.map((t=>bG({type:t.type,nullCount:0})))})]=t,!(this.data instanceof mG))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=NZ(this.schema,this.data.children)
|
|
14628
|
-
break
|
|
14629
|
-
case 1:{const[e]=t,{fields:n,children:i,length:o}=Object.keys(e).reduce(((t,n,i)=>(t.children[i]=e[n],t.length=Math.max(t.length,e[n].length),t.fields[i]=qG.new({name:n,type:e[n].type,nullable:!0}),t)),{length:0,fields:new Array,children:new Array}),s=new UG(n),r=bG({type:new Mj(n),length:o,children:i,nullCount:0});[this.schema,this.data]=NZ(s,r.children,o)
|
|
14630
|
-
break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=BZ(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return GW.visit(this.data,t)}at(t){return this.get(iG(t,this.numRows))}set(t,e){return mW.visit(this.data,t,e)}indexOf(t,e){return DG.visit(this.data,t,e)}[Symbol.iterator](){return FG.visit(new PG([this.data]))}toArray(){return[...this]}concat(...t){return new RZ(this.schema,[this,...t])}slice(e,n){const[i]=new PG([this.data]).slice(e,n).data
|
|
14631
|
-
return new t(this.schema,i)}getChild(t){var e
|
|
14632
|
-
return this.getChildAt(null===(e=this.schema.fields)||void 0===e?void 0:e.findIndex((e=>e.name===t)))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new PG([this.data.children[t]]):null}setChild(t,e){var n
|
|
14633
|
-
return this.setChildAt(null===(n=this.schema.fields)||void 0===n?void 0:n.findIndex((e=>e.name===t)),e)}setChildAt(e,n){let i=this.schema,o=this.data
|
|
14634
|
-
if(e>-1&&e<this.numCols){n||(n=new PG([bG({type:new hj,length:this.numRows})]))
|
|
14635
|
-
const t=i.fields.slice(),s=o.children.slice(),r=t[e].clone({type:n.type});[t[e],s[e]]=[r,n.data[0]],i=new UG(t,new Map(this.schema.metadata)),o=bG({type:new Mj(t),children:s})}return new t(i,o)}select(e){const n=this.schema.select(e),i=new Mj(n.fields),o=[]
|
|
14636
|
-
for(const t of e){const e=this.schema.fields.findIndex((e=>e.name===t))
|
|
14637
|
-
~e&&(o[e]=this.data.children[e])}return new t(n,bG({type:i,length:this.numRows,children:o}))}selectAt(e){const n=this.schema.selectAt(e),i=e.map((t=>this.data.children[t])).filter(Boolean),o=bG({type:new Mj(n.fields),length:this.numRows,children:i})
|
|
14638
|
-
return new t(n,o)}}
|
|
14639
|
-
function NZ(t,e,n=e.reduce(((t,e)=>Math.max(t,e.length)),0)){var i
|
|
14640
|
-
const o=[...t.fields],s=[...e],r=(n+63&-64)>>3
|
|
14641
|
-
for(const[a,l]of t.fields.entries()){const t=e[a]
|
|
14642
|
-
t&&t.length===n||(o[a]=l.clone({nullable:!0}),s[a]=null!==(i=null==t?void 0:t._changeLengthAndBackfillNullBitmap(n))&&void 0!==i?i:bG({type:l.type,length:n,nullCount:n,nullBitmap:new Uint8Array(r)}))}return[t.assign(o),bG({type:new Mj(o),length:n,children:s})]}function BZ(t,e,n=new Map){var i,o
|
|
14643
|
-
if((null!==(i=null==t?void 0:t.length)&&void 0!==i?i:0)>0&&(null==t?void 0:t.length)===(null==e?void 0:e.length))for(let i=-1,s=t.length;++i<s;){const{type:s}=t[i],r=e[i]
|
|
14644
|
-
for(const t of[r,...(null===(o=null==r?void 0:r.dictionary)||void 0===o?void 0:o.data)||[]])BZ(s.children,null==t?void 0:t.children,n)
|
|
14645
|
-
if(dj.isDictionary(s)){const{id:t}=s
|
|
14646
|
-
if(n.has(t)){if(n.get(t)!==r.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}else(null==r?void 0:r.dictionary)&&n.set(t,r.dictionary)}}return n}TZ=Symbol.toStringTag,FZ[TZ]=(t=>(t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(FZ.prototype)
|
|
14647
|
-
class LZ extends FZ{constructor(t){const e=t.fields.map((t=>bG({type:t.type})))
|
|
14648
|
-
super(t,bG({type:new Mj(t.fields),nullCount:0,children:e}))}}let PZ=class t{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){const t=this.bb.__offset(this.bb_pos,4)
|
|
14525
|
+
return VG.createBlock(t,i,n,o)}constructor(t,e,n){this.metaDataLength=t,this.offset=Eq(n),this.bodyLength=Eq(e)}}let JG=class t{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){const t=this.bb.__offset(this.bb_pos,4)
|
|
14649
14526
|
return t?this.bb.readInt16(this.bb_pos+t):OU.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6)
|
|
14650
14527
|
return t?this.bb.readUint8(this.bb_pos+t):_q.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8)
|
|
14651
14528
|
return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10)
|
|
@@ -14654,14 +14531,14 @@ return n?(e||new nq).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4
|
|
|
14654
14531
|
return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,OU.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,_q.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4)
|
|
14655
14532
|
for(let n=e.length-1;n>=0;n--)t.addOffset(e[n])
|
|
14656
14533
|
return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(e,n,i,o,s,r){return t.startMessage(e),t.addVersion(e,n),t.addHeaderType(e,i),t.addHeader(e,o),t.addBodyLength(e,s),t.addCustomMetadata(e,r),t.endMessage(e)}}
|
|
14657
|
-
const
|
|
14534
|
+
const QG=new class extends Nj{visit(t,e){return null==t||null==e?void 0:super.visit(t,e)}visitNull(t,e){return gq.startNull(e),gq.endNull(e)}visitInt(t,e){return tq.startInt(e),tq.addBitWidth(e,t.bitWidth),tq.addIsSigned(e,t.isSigned),tq.endInt(e)}visitFloat(t,e){return dq.startFloatingPoint(e),dq.addPrecision(e,t.precision),dq.endFloatingPoint(e)}visitBinary(t,e){return iq.startBinary(e),iq.endBinary(e)}visitLargeBinary(t,e){return uq.startLargeBinary(e),uq.endLargeBinary(e)}visitBool(t,e){return oq.startBool(e),oq.endBool(e)}visitUtf8(t,e){return xq.startUtf8(e),xq.endUtf8(e)}visitLargeUtf8(t,e){return pq.startLargeUtf8(e),pq.endLargeUtf8(e)}visitDecimal(t,e){return rq.startDecimal(e),rq.addScale(e,t.scale),rq.addPrecision(e,t.precision),rq.addBitWidth(e,t.bitWidth),rq.endDecimal(e)}visitDate(t,e){return sq.startDate(e),sq.addUnit(e,t.unit),sq.endDate(e)}visitTime(t,e){return bq.startTime(e),bq.addUnit(e,t.unit),bq.addBitWidth(e,t.bitWidth),bq.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0
|
|
14658
14535
|
return yq.startTimestamp(e),yq.addUnit(e,t.unit),void 0!==n&&yq.addTimezone(e,n),yq.endTimestamp(e)}visitInterval(t,e){return hq.startInterval(e),hq.addUnit(e,t.unit),hq.endInterval(e)}visitDuration(t,e){return aq.startDuration(e),aq.addUnit(e,t.unit),aq.endDuration(e)}visitList(t,e){return fq.startList(e),fq.endList(e)}visitStruct(t,e){return vq.startStruct_(e),vq.endStruct_(e)}visitUnion(t,e){wq.startTypeIdsVector(e,t.typeIds.length)
|
|
14659
14536
|
const n=wq.createTypeIdsVector(e,t.typeIds)
|
|
14660
14537
|
return wq.startUnion(e),wq.addMode(e,t.mode),wq.addTypeIds(e,n),wq.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e)
|
|
14661
14538
|
return eq.startDictionaryEncoding(e),eq.addId(e,BigInt(t.id)),eq.addIsOrdered(e,t.isOrdered),void 0!==n&&eq.addIndexType(e,n),eq.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return lq.startFixedSizeBinary(e),lq.addByteWidth(e,t.byteWidth),lq.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return cq.startFixedSizeList(e),cq.addListSize(e,t.listSize),cq.endFixedSizeList(e)}visitMap(t,e){return mq.startMap(e),mq.addKeysSorted(e,t.keysSorted),mq.endMap(e)}}
|
|
14662
|
-
function
|
|
14663
|
-
var n}),[])}function
|
|
14664
|
-
i.VALIDITY&&e.push(new
|
|
14539
|
+
function tZ(t){return new dZ(t.count,nZ(t.columns),iZ(t.columns),null)}function eZ(t,e){return(t.children||[]).filter(Boolean).map((t=>qG.fromJSON(t,e)))}function nZ(t){return(t||[]).reduce(((t,e)=>{return[...t,new pZ(e.count,(n=e.VALIDITY,(n||[]).reduce(((t,e)=>t+ +(0===e)),0))),...nZ(e.children)]
|
|
14540
|
+
var n}),[])}function iZ(t,e=[]){for(let n=-1,i=(t||[]).length;++n<i;){const i=t[n]
|
|
14541
|
+
i.VALIDITY&&e.push(new uZ(e.length,i.VALIDITY.length)),i.TYPE_ID&&e.push(new uZ(e.length,i.TYPE_ID.length)),i.OFFSET&&e.push(new uZ(e.length,i.OFFSET.length)),i.DATA&&e.push(new uZ(e.length,i.DATA.length)),e=iZ(i.children,e)}return e}function oZ(t=[]){return new Map(t.map((({key:t,value:e})=>[t,e])))}function sZ(t){return new uj(t.isSigned,t.bitWidth)}function rZ(t,e){const n=t.type.name
|
|
14665
14542
|
switch(n){case"NONE":case"null":return new hj
|
|
14666
14543
|
case"binary":return new mj
|
|
14667
14544
|
case"largebinary":return new gj
|
|
@@ -14681,24 +14558,25 @@ return new _j(NU[e.unit])}case"union":{const n=t.type,[i,...o]=(n.mode+"").toLow
|
|
|
14681
14558
|
return new $j(TU[s],n.typeIds||[],e||[])}case"fixedsizebinary":{const e=t.type
|
|
14682
14559
|
return new Ej(e.byteWidth)}case"fixedsizelist":{const n=t.type
|
|
14683
14560
|
return new Aj(n.listSize,(e||[])[0])}case"map":{const n=t.type
|
|
14684
|
-
return new Dj((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var
|
|
14685
|
-
class
|
|
14561
|
+
return new Dj((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var aZ=qU,lZ=UU
|
|
14562
|
+
class cZ{static fromJSON(t,e){const n=new cZ(0,OU.V5,e)
|
|
14686
14563
|
return n._createHeader=function(t,e){return()=>{switch(e){case _q.Schema:return UG.fromJSON(t)
|
|
14687
|
-
case _q.RecordBatch:return
|
|
14688
|
-
case _q.DictionaryBatch:return
|
|
14689
|
-
const e=
|
|
14564
|
+
case _q.RecordBatch:return dZ.fromJSON(t)
|
|
14565
|
+
case _q.DictionaryBatch:return hZ.fromJSON(t)}throw new Error(`Unrecognized Message type: { name: ${_q[e]}, type: ${e} }`)}}(t,e),n}static decode(t){t=new lZ(kU(t))
|
|
14566
|
+
const e=JG.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),o=e.headerType(),s=new cZ(n,i,o)
|
|
14690
14567
|
return s._createHeader=function(t,e){return()=>{switch(e){case _q.Schema:return UG.decode(t.header(new Sq),new Map,t.version())
|
|
14691
|
-
case _q.RecordBatch:return
|
|
14692
|
-
case _q.DictionaryBatch:return
|
|
14568
|
+
case _q.RecordBatch:return dZ.decode(t.header(new YU),t.version())
|
|
14569
|
+
case _q.DictionaryBatch:return hZ.decode(t.header(new XU),t.version())}throw new Error(`Unrecognized Message type: { name: ${_q[e]}, type: ${e} }`)}}(e,o),s}static encode(t){const e=new aZ
|
|
14693
14570
|
let n=-1
|
|
14694
|
-
return t.isSchema()?n=UG.encode(e,t.header()):t.isRecordBatch()?n=
|
|
14695
|
-
if(t instanceof
|
|
14696
|
-
if(t instanceof
|
|
14697
|
-
throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===_q.Schema}isRecordBatch(){return this.headerType===_q.RecordBatch}isDictionaryBatch(){return this.headerType===_q.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Eq(t)}}class
|
|
14571
|
+
return t.isSchema()?n=UG.encode(e,t.header()):t.isRecordBatch()?n=dZ.encode(e,t.header()):t.isDictionaryBatch()&&(n=hZ.encode(e,t.header())),JG.startMessage(e),JG.addVersion(e,OU.V5),JG.addHeader(e,n),JG.addHeaderType(e,t.headerType),JG.addBodyLength(e,BigInt(t.bodyLength)),JG.finishMessageBuffer(e,JG.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof UG)return new cZ(0,OU.V5,_q.Schema,t)
|
|
14572
|
+
if(t instanceof dZ)return new cZ(e,OU.V5,_q.RecordBatch,t)
|
|
14573
|
+
if(t instanceof hZ)return new cZ(e,OU.V5,_q.DictionaryBatch,t)
|
|
14574
|
+
throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===_q.Schema}isRecordBatch(){return this.headerType===_q.RecordBatch}isDictionaryBatch(){return this.headerType===_q.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),this._compression=null==i?void 0:i.compression,i&&(this._createHeader=()=>i),this._bodyLength=Eq(t)}}let dZ=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}constructor(t,e,n,i){this._nodes=e,this._buffers=n,this._length=Eq(t),this._compression=i}}
|
|
14575
|
+
class hZ{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,n=!1){this._data=t,this._isDelta=n,this._id=Eq(e)}}class uZ{constructor(t,e){this.offset=Eq(t),this.length=Eq(e)}}class pZ{constructor(t,e){this.length=Eq(t),this.nullCount=Eq(e)}}class fZ{constructor(t,e=jU.BUFFER){this.type=t,this.method=e}}function mZ(t,e){const n=[]
|
|
14698
14576
|
for(let i,o=-1,s=-1,r=t.childrenLength();++o<r;)(i=t.children(o))&&(n[++s]=qG.decode(i,e))
|
|
14699
|
-
return n}function
|
|
14577
|
+
return n}function gZ(t){const e=new Map
|
|
14700
14578
|
if(t)for(let n,i,o=-1,s=Math.trunc(t.customMetadataLength());++o<s;)(n=t.customMetadata(o))&&null!=(i=n.key())&&e.set(i,n.value())
|
|
14701
|
-
return e}function
|
|
14579
|
+
return e}function vZ(t){return new uj(t.isSigned(),t.bitWidth())}function bZ(t,e){const n=t.typeType()
|
|
14702
14580
|
switch(n){case Cq.NONE:case Cq.Null:return new hj
|
|
14703
14581
|
case Cq.Binary:return new mj
|
|
14704
14582
|
case Cq.LargeBinary:return new gj
|
|
@@ -14718,93 +14596,244 @@ return new _j(e.unit())}case Cq.Union:{const n=t.type(new wq)
|
|
|
14718
14596
|
return new $j(n.mode(),n.typeIdsArray()||[],e||[])}case Cq.FixedSizeBinary:{const e=t.type(new lq)
|
|
14719
14597
|
return new Ej(e.byteWidth())}case Cq.FixedSizeList:{const n=t.type(new cq)
|
|
14720
14598
|
return new Aj(n.listSize(),(e||[])[0])}case Cq.Map:{const n=t.type(new mq)
|
|
14721
|
-
return new Dj((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${Cq[n]}" (${n})`)}qG.encode=function(t,e){let n=-1,i=-1,o=-1
|
|
14599
|
+
return new Dj((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${Cq[n]}" (${n})`)}function yZ(t){return t?new fZ(t.codec(),t.method()):null}function wZ(t,e){return GU.startBodyCompression(t),GU.addCodec(t,e.type),GU.addMethod(t,e.method),GU.endBodyCompression(t)}qG.encode=function(t,e){let n=-1,i=-1,o=-1
|
|
14722
14600
|
const s=e.type
|
|
14723
14601
|
let r=e.typeId
|
|
14724
|
-
dj.isDictionary(s)?(r=s.dictionary.typeId,o=
|
|
14602
|
+
dj.isDictionary(s)?(r=s.dictionary.typeId,o=QG.visit(s,t),i=QG.visit(s.dictionary,t)):i=QG.visit(s,t)
|
|
14725
14603
|
const a=(s.children||[]).map((e=>qG.encode(t,e))),l=kq.createChildrenVector(t,a),c=e.metadata&&e.metadata.size>0?kq.createCustomMetadataVector(t,[...e.metadata].map((([e,n])=>{const i=t.createString(`${e}`),o=t.createString(`${n}`)
|
|
14726
14604
|
return nq.startKeyValue(t),nq.addKey(t,i),nq.addValue(t,o),nq.endKeyValue(t)}))):-1
|
|
14727
14605
|
e.name&&(n=t.createString(e.name))
|
|
14728
14606
|
kq.startField(t),kq.addType(t,i),kq.addTypeType(t,r),kq.addChildren(t,l),kq.addNullable(t,!!e.nullable),-1!==n&&kq.addName(t,n);-1!==o&&kq.addDictionary(t,o);-1!==c&&kq.addCustomMetadata(t,c)
|
|
14729
14607
|
return kq.endField(t)},qG.decode=function(t,e){let n,i,o,s,r,a
|
|
14730
|
-
e&&(a=t.dictionary())?e.has(n=Eq(a.id()))?(s=(s=a.indexType())?
|
|
14608
|
+
e&&(a=t.dictionary())?e.has(n=Eq(a.id()))?(s=(s=a.indexType())?vZ(s):new pj,r=new Rj(e.get(n),s,n,a.isOrdered()),i=new qG(t.name(),r,t.nullable(),gZ(t))):(s=(s=a.indexType())?vZ(s):new pj,e.set(n,o=bZ(t,mZ(t,e))),r=new Rj(o,s,n,a.isOrdered()),i=new qG(t.name(),r,t.nullable(),gZ(t))):(o=bZ(t,mZ(t,e)),i=new qG(t.name(),o,t.nullable(),gZ(t)))
|
|
14731
14609
|
return i||null},qG.fromJSON=function(t,e){let n,i,o,s,r,a
|
|
14732
|
-
return e&&(s=t.dictionary)?e.has(n=s.id)?(i=(i=s.indexType)?
|
|
14610
|
+
return e&&(s=t.dictionary)?e.has(n=s.id)?(i=(i=s.indexType)?sZ(i):new pj,a=new Rj(e.get(n),i,n,s.isOrdered),o=new qG(t.name,a,t.nullable,oZ(t.metadata))):(i=(i=s.indexType)?sZ(i):new pj,e.set(n,r=rZ(t,eZ(t,e))),a=new Rj(r,i,n,s.isOrdered),o=new qG(t.name,a,t.nullable,oZ(t.metadata))):(r=rZ(t,eZ(t,e)),o=new qG(t.name,r,t.nullable,oZ(t.metadata))),o||null},UG.encode=function(t,e){const n=e.fields.map((e=>qG.encode(t,e)))
|
|
14733
14611
|
Sq.startFieldsVector(t,n.length)
|
|
14734
14612
|
const i=Sq.createFieldsVector(t,n),o=e.metadata&&e.metadata.size>0?Sq.createCustomMetadataVector(t,[...e.metadata].map((([e,n])=>{const i=t.createString(`${e}`),o=t.createString(`${n}`)
|
|
14735
14613
|
return nq.startKeyValue(t),nq.addKey(t,i),nq.addValue(t,o),nq.endKeyValue(t)}))):-1
|
|
14736
|
-
Sq.startSchema(t),Sq.addFields(t,i),Sq.addEndianness(t,
|
|
14614
|
+
Sq.startSchema(t),Sq.addFields(t,i),Sq.addEndianness(t,xZ?JU.Little:JU.Big),-1!==o&&Sq.addCustomMetadata(t,o)
|
|
14737
14615
|
return Sq.endSchema(t)},UG.decode=function(t,e=new Map,n=OU.V5){const i=function(t,e){const n=[]
|
|
14738
14616
|
for(let i,o=-1,s=-1,r=t.fieldsLength();++o<r;)(i=t.fields(o))&&(n[++s]=qG.decode(i,e))
|
|
14739
14617
|
return n}(t,e)
|
|
14740
|
-
return new UG(i,
|
|
14618
|
+
return new UG(i,gZ(t),e,n)},UG.fromJSON=function(t,e=new Map){return new UG(function(t,e){return(t.fields||[]).filter(Boolean).map((t=>qG.fromJSON(t,e)))}(t,e),oZ(t.metadata),e)},dZ.encode=function(t,e){const n=e.nodes||[],i=e.buffers||[]
|
|
14741
14619
|
YU.startNodesVector(t,n.length)
|
|
14742
|
-
for(const e of n.slice().reverse())
|
|
14620
|
+
for(const e of n.slice().reverse())pZ.encode(t,e)
|
|
14743
14621
|
const o=t.endVector()
|
|
14744
14622
|
YU.startBuffersVector(t,i.length)
|
|
14745
|
-
for(const e of i.slice().reverse())
|
|
14623
|
+
for(const e of i.slice().reverse())uZ.encode(t,e)
|
|
14746
14624
|
const s=t.endVector()
|
|
14747
|
-
|
|
14748
|
-
|
|
14749
|
-
|
|
14625
|
+
let r=null
|
|
14626
|
+
null!==e.compression&&(r=wZ(t,e.compression))
|
|
14627
|
+
YU.startRecordBatch(t),YU.addLength(t,BigInt(e.length)),YU.addNodes(t,o),YU.addBuffers(t,s),null!==e.compression&&r&&YU.addCompression(t,r)
|
|
14628
|
+
return YU.endRecordBatch(t)},dZ.decode=function(t,e=OU.V5){return new dZ(t.length(),function(t){const e=[]
|
|
14629
|
+
for(let n,i=-1,o=-1,s=t.nodesLength();++i<s;)(n=t.nodes(i))&&(e[++o]=pZ.decode(n))
|
|
14750
14630
|
return e}(t),function(t,e){const n=[]
|
|
14751
|
-
for(let i,o=-1,s=-1,r=t.buffersLength();++o<r;)(i=t.buffers(o))&&(e<OU.V4&&(i.bb_pos+=8*(o+1)),n[++s]=
|
|
14752
|
-
return n}(t,e))},
|
|
14753
|
-
return XU.startDictionaryBatch(t),XU.addId(t,BigInt(e.id)),XU.addIsDelta(t,e.isDelta),XU.addData(t,n),XU.endDictionaryBatch(t)},
|
|
14754
|
-
const
|
|
14755
|
-
return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]})(),
|
|
14756
|
-
class
|
|
14757
|
-
|
|
14631
|
+
for(let i,o=-1,s=-1,r=t.buffersLength();++o<r;)(i=t.buffers(o))&&(e<OU.V4&&(i.bb_pos+=8*(o+1)),n[++s]=uZ.decode(i))
|
|
14632
|
+
return n}(t,e),yZ(t.compression()))},dZ.fromJSON=tZ,hZ.encode=function(t,e){const n=dZ.encode(t,e.data)
|
|
14633
|
+
return XU.startDictionaryBatch(t),XU.addId(t,BigInt(e.id)),XU.addIsDelta(t,e.isDelta),XU.addData(t,n),XU.endDictionaryBatch(t)},hZ.decode=function(t,e=OU.V5){return new hZ(dZ.decode(t.data(),e),t.id(),t.isDelta())},hZ.fromJSON=function(t){return new hZ(tZ(t.data),t.id,t.isDelta)},pZ.encode=function(t,e){return KU.createFieldNode(t,BigInt(e.length),BigInt(e.nullCount))},pZ.decode=function(t){return new pZ(t.length(),t.nullCount())},uZ.encode=function(t,e){return ZU.createBuffer(t,BigInt(e.offset),BigInt(e.length))},uZ.decode=function(t){return new uZ(t.offset(),t.length())},fZ.encode=wZ,fZ.decode=yZ
|
|
14634
|
+
const xZ=(()=>{const t=new ArrayBuffer(2)
|
|
14635
|
+
return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]})(),CZ=Object.freeze({done:!0,value:void 0})
|
|
14636
|
+
class kZ{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class SZ{tee(){return this._getDOMStream().tee()}pipe(t,e){return this._getNodeStream().pipe(t,e)}pipeTo(t,e){return this._getDOMStream().pipeTo(t,e)}pipeThrough(t,e){return this._getDOMStream().pipeThrough(t,e)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class _Z extends SZ{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise((t=>this._closedPromiseResolve=t))}get closed(){return this._closedPromise}cancel(t){return e(this,void 0,void 0,(function*(){yield this.return(t)}))}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this
|
|
14637
|
+
for(;t.length>0;)t.shift().resolve(CZ)
|
|
14638
|
+
this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return $U.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return $U.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return e(this,void 0,void 0,(function*(){return yield this.abort(t),CZ}))}return(t){return e(this,void 0,void 0,(function*(){return yield this.close(),CZ}))}read(t){return e(this,void 0,void 0,(function*(){return(yield this.next(t,"read")).value}))}peek(t){return e(this,void 0,void 0,(function*(){return(yield this.next(t,"peek")).value}))}next(...t){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(((t,e)=>{this.resolvers.push({resolve:t,reject:e})})):Promise.resolve(CZ)}_ensureOpen(){if(this._closedPromiseResolve)return!0
|
|
14639
|
+
throw new Error("AsyncQueue is closed")}}class IZ extends _Z{write(t){if((t=kU(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?eU(this.toUint8Array(!0)):this.toUint8Array(!1).then(eU)}toUint8Array(t=!1){return t?yU(this._values)[0]:(()=>e(this,void 0,void 0,(function*(){var t,e,n,i
|
|
14640
|
+
const o=[]
|
|
14641
|
+
let s=0
|
|
14642
|
+
try{for(var a,l=!0,c=r(this);!(t=(a=yield c.next()).done);l=!0){i=a.value,l=!1
|
|
14643
|
+
const t=i
|
|
14644
|
+
o.push(t),s+=t.byteLength}}catch(t){e={error:t}}finally{try{l||t||!(n=c.return)||(yield n.call(c))}finally{if(e)throw e.error}}return yU(o,s)[0]})))()}}class MZ{constructor(t){t&&(this.source=new EZ($U.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class $Z{constructor(t){t instanceof $Z?this.source=t.source:t instanceof IZ?this.source=new AZ($U.fromAsyncIterable(t)):mU(t)?this.source=new AZ($U.fromNodeStream(t)):fU(t)?this.source=new AZ($U.fromDOMStream(t)):uU(t)?this.source=new AZ($U.fromDOMStream(t.body)):aU(t)?this.source=new AZ($U.fromIterable(t)):(rU(t)||lU(t))&&(this.source=new AZ($U.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class EZ{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||CZ)}return(t){return Object.create(this.source.return&&this.source.return(t)||CZ)}}class AZ{constructor(t){this.source=t,this._closedPromise=new Promise((t=>this._closedPromiseResolve=t))}cancel(t){return e(this,void 0,void 0,(function*(){yield this.return(t)}))}get closed(){return this._closedPromise}read(t){return e(this,void 0,void 0,(function*(){return(yield this.next(t,"read")).value}))}peek(t){return e(this,void 0,void 0,(function*(){return(yield this.next(t,"peek")).value}))}next(t){return e(this,arguments,void 0,(function*(t,e="read"){return yield this.source.next({cmd:e,size:t})}))}throw(t){return e(this,void 0,void 0,(function*(){const e=this.source.throw&&(yield this.source.throw(t))||CZ
|
|
14645
|
+
return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}))}return(t){return e(this,void 0,void 0,(function*(){const e=this.source.return&&(yield this.source.return(t))||CZ
|
|
14646
|
+
return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}))}}class DZ extends MZ{constructor(t,e){super(),this.position=0,this.buffer=kU(t),this.size=void 0===e?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:n}=this.readAt(t,4)
|
|
14647
|
+
return new DataView(e,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:e,size:n,position:i}=this
|
|
14648
|
+
return e&&i<n?("number"!=typeof t&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),e.subarray(i,this.position)):null}readAt(t,e){const n=this.buffer,i=Math.min(this.size,t+e)
|
|
14649
|
+
return n?n.subarray(t,i):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}}class OZ extends $Z{constructor(t,n){super(),this.position=0,this._handle=t,"number"==typeof n?this.size=n:this._pending=(()=>e(this,void 0,void 0,(function*(){this.size=(yield t.stat()).size,delete this._pending})))()}readInt32(t){return e(this,void 0,void 0,(function*(){const{buffer:e,byteOffset:n}=yield this.readAt(t,4)
|
|
14650
|
+
return new DataView(e,n).getInt32(0,!0)}))}seek(t){return e(this,void 0,void 0,(function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size}))}read(t){return e(this,void 0,void 0,(function*(){this._pending&&(yield this._pending)
|
|
14651
|
+
const{_handle:e,size:n,position:i}=this
|
|
14652
|
+
if(e&&i<n){"number"!=typeof t&&(t=Number.POSITIVE_INFINITY)
|
|
14653
|
+
let o=i,s=0,r=0
|
|
14654
|
+
const a=Math.min(n,o+Math.min(n-o,t)),l=new Uint8Array(Math.max(0,(this.position=a)-o))
|
|
14655
|
+
for(;(o+=r)<a&&(s+=r)<l.byteLength;)({bytesRead:r}=yield e.read(l,s,l.byteLength-s,o))
|
|
14656
|
+
return l}return null}))}readAt(t,n){return e(this,void 0,void 0,(function*(){this._pending&&(yield this._pending)
|
|
14657
|
+
const{_handle:e,size:i}=this
|
|
14658
|
+
if(e&&t+n<i){const o=Math.min(i,t+n),s=new Uint8Array(o-t)
|
|
14659
|
+
return(yield e.read(s,0,n,t)).buffer}return new Uint8Array(n)}))}close(){return e(this,void 0,void 0,(function*(){const t=this._handle
|
|
14660
|
+
this._handle=null,t&&(yield t.close())}))}throw(t){return e(this,void 0,void 0,(function*(){return yield this.close(),{done:!0,value:t}}))}return(t){return e(this,void 0,void 0,(function*(){return yield this.close(),{done:!0,value:t}}))}}function TZ(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}const RZ=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8]
|
|
14661
|
+
class FZ{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>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]])
|
|
14662
|
+
let i=e[3]*n[3]
|
|
14663
|
+
this.buffer[0]=65535&i
|
|
14664
|
+
let o=i>>>16
|
|
14665
|
+
return i=e[2]*n[3],o+=i,i=e[3]*n[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>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}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0
|
|
14666
|
+
this.buffer[1]+=t.buffer[1],e<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${TZ(this.buffer[1])} ${TZ(this.buffer[0])}`}}class NZ extends FZ{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return NZ.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return NZ.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.length,i=new NZ(e)
|
|
14667
|
+
for(let e=0;e<n;){const o=8<n-e?8:n-e,s=new NZ(new Uint32Array([Number.parseInt(t.slice(e,e+o),10),0])),r=new NZ(new Uint32Array([RZ[o],0]))
|
|
14668
|
+
i.times(r),i.plus(s),e+=o}return i}static convertArray(t){const e=new Uint32Array(2*t.length)
|
|
14669
|
+
for(let n=-1,i=t.length;++n<i;)NZ.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2))
|
|
14670
|
+
return e}static multiply(t,e){return new NZ(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new NZ(new Uint32Array(t.buffer)).plus(e)}}class BZ extends FZ{negate(){return this.buffer[0]=1+~this.buffer[0],this.buffer[1]=~this.buffer[1],0==this.buffer[0]&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){const e=this.buffer[1]|0,n=t.buffer[1]|0
|
|
14671
|
+
return e<n||e===n&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return BZ.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return BZ.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.startsWith("-"),i=t.length,o=new BZ(e)
|
|
14672
|
+
for(let e=n?1:0;e<i;){const n=8<i-e?8:i-e,s=new BZ(new Uint32Array([Number.parseInt(t.slice(e,e+n),10),0])),r=new BZ(new Uint32Array([RZ[n],0]))
|
|
14673
|
+
o.times(r),o.plus(s),e+=n}return n?o.negate():o}static convertArray(t){const e=new Uint32Array(2*t.length)
|
|
14674
|
+
for(let n=-1,i=t.length;++n<i;)BZ.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2))
|
|
14675
|
+
return e}static multiply(t,e){return new BZ(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new BZ(new Uint32Array(t.buffer)).plus(e)}}class LZ{constructor(t){this.buffer=t}high(){return new BZ(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new BZ(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=1+~this.buffer[0],this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],0==this.buffer[0]&&++this.buffer[1],0==this.buffer[1]&&++this.buffer[2],0==this.buffer[2]&&++this.buffer[3],this}times(t){const e=new NZ(new Uint32Array([this.buffer[3],0])),n=new NZ(new Uint32Array([this.buffer[2],0])),i=new NZ(new Uint32Array([this.buffer[1],0])),o=new NZ(new Uint32Array([this.buffer[0],0])),s=new NZ(new Uint32Array([t.buffer[3],0])),r=new NZ(new Uint32Array([t.buffer[2],0])),a=new NZ(new Uint32Array([t.buffer[1],0])),l=new NZ(new Uint32Array([t.buffer[0],0]))
|
|
14676
|
+
let c=NZ.multiply(o,l)
|
|
14677
|
+
this.buffer[0]=c.low()
|
|
14678
|
+
const d=new NZ(new Uint32Array([c.high(),0]))
|
|
14679
|
+
c=NZ.multiply(i,l),d.plus(c),c=NZ.multiply(o,a),d.plus(c),this.buffer[1]=d.low(),this.buffer[3]=d.lessThan(c)?1:0,this.buffer[2]=d.high()
|
|
14680
|
+
return new NZ(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(NZ.multiply(n,l)).plus(NZ.multiply(i,a)).plus(NZ.multiply(o,r)),this.buffer[3]+=NZ.multiply(e,l).plus(NZ.multiply(n,a)).plus(NZ.multiply(i,r)).plus(NZ.multiply(o,s)).low(),this}plus(t){const e=new Uint32Array(4)
|
|
14681
|
+
return e[3]=this.buffer[3]+t.buffer[3]>>>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]<this.buffer[0]>>>0&&++e[1],e[1]<this.buffer[1]>>>0&&++e[2],e[2]<this.buffer[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}hex(){return`${TZ(this.buffer[3])} ${TZ(this.buffer[2])} ${TZ(this.buffer[1])} ${TZ(this.buffer[0])}`}static multiply(t,e){return new LZ(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new LZ(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return LZ.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return LZ.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,o=new LZ(e)
|
|
14682
|
+
for(let e=n?1:0;e<i;){const n=8<i-e?8:i-e,s=new LZ(new Uint32Array([Number.parseInt(t.slice(e,e+n),10),0,0,0])),r=new LZ(new Uint32Array([RZ[n],0,0,0]))
|
|
14683
|
+
o.times(r),o.plus(s),e+=n}return n?o.negate():o}static convertArray(t){const e=new Uint32Array(4*t.length)
|
|
14684
|
+
for(let n=-1,i=t.length;++n<i;)LZ.from(t[n],new Uint32Array(e.buffer,e.byteOffset+16*n,4))
|
|
14685
|
+
return e}}class PZ extends Nj{constructor(t,e,n,i,o=OU.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=n,this.dictionaries=i,this.metadataVersion=o}visit(t){return super.visit(t instanceof qG?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return bG({type:t,length:e})}visitBool(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<OU.V5&&this.readNullBitmap(t,n),t.mode===TU.Sparse?this.visitSparseUnion(t,{length:e,nullCount:n}):this.visitDenseUnion(t,{length:e,nullCount:n})}visitDenseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:n}=this.nextFieldNode()){return bG({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e,n=this.nextBufferRange()){return e>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class zZ extends PZ{constructor(t,e,n,i,o){super(new Uint8Array(0),e,n,i,o),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):hG(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return wU(Uint8Array,wU(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return wU(Uint8Array,wU(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:n}=this
|
|
14686
|
+
if(dj.isTimestamp(t))return wU(Uint8Array,BZ.convertArray(n[e]))
|
|
14687
|
+
if((dj.isInt(t)||dj.isTime(t))&&64===t.bitWidth||dj.isDuration(t))return wU(Uint8Array,BZ.convertArray(n[e]))
|
|
14688
|
+
if(dj.isDate(t)&&t.unit===FU.MILLISECOND)return wU(Uint8Array,BZ.convertArray(n[e]))
|
|
14689
|
+
if(dj.isDecimal(t))return wU(Uint8Array,LZ.convertArray(n[e]))
|
|
14690
|
+
if(dj.isBinary(t)||dj.isLargeBinary(t)||dj.isFixedSizeBinary(t))return function(t){const e=t.join(""),n=new Uint8Array(e.length/2)
|
|
14691
|
+
for(let t=0;t<e.length;t+=2)n[t>>1]=Number.parseInt(e.slice(t,t+2),16)
|
|
14692
|
+
return n}(n[e])
|
|
14693
|
+
if(dj.isBool(t))return hG(n[e])
|
|
14694
|
+
if(dj.isUtf8(t)||dj.isLargeUtf8(t))return iU(n[e].join(""))
|
|
14695
|
+
if(dj.isInterval(t))switch(t.unit){case BU.DAY_TIME:return function(t){var e,n
|
|
14696
|
+
const i=t.length,o=new Int32Array(2*i)
|
|
14697
|
+
for(let s=0,r=0;s<i;s++){const i=t[s]
|
|
14698
|
+
o[r++]=null!==(e=i.days)&&void 0!==e?e:0,o[r++]=null!==(n=i.milliseconds)&&void 0!==n?n:0}return o}(n[e])
|
|
14699
|
+
case BU.MONTH_DAY_NANO:return function(t){var e,n
|
|
14700
|
+
const i=t.length,o=new Int32Array(4*i)
|
|
14701
|
+
for(let s=0,r=0;s<i;s++){const i=t[s]
|
|
14702
|
+
o[r++]=null!==(e=i.months)&&void 0!==e?e:0,o[r++]=null!==(n=i.days)&&void 0!==n?n:0
|
|
14703
|
+
const a=i.nanoseconds
|
|
14704
|
+
a?(o[r++]=Number(BigInt(a)&BigInt(4294967295)),o[r++]=Number(BigInt(a)>>BigInt(32))):r+=2}return o}(n[e])}return wU(Uint8Array,wU(t.ArrayType,n[e].map((t=>+t))))}}class VZ extends PZ{constructor(t,e,n,i,o){super(new Uint8Array(0),e,n,i,o),this.bodyChunks=t}readData(t,e=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}class HZ extends Nj{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every(((t,n)=>this.compareFields(t,e[n])))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function UZ(t,e){return e instanceof t.constructor}function qZ(t,e){return t===e||UZ(t,e)}function jZ(t,e){return t===e||UZ(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function WZ(t,e){return t===e||UZ(t,e)&&t.precision===e.precision}function GZ(t,e){return t===e||UZ(t,e)&&t.unit===e.unit}function ZZ(t,e){return t===e||UZ(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function KZ(t,e){return t===e||UZ(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function YZ(t,e){return t===e||UZ(t,e)&&t.mode===e.mode&&t.typeIds.every(((t,n)=>t===e.typeIds[n]))&&QZ.compareManyFields(t.children,e.children)}function XZ(t,e){return t===e||UZ(t,e)&&t.unit===e.unit}function JZ(t,e){return t===e||UZ(t,e)&&t.unit===e.unit}HZ.prototype.visitNull=qZ,HZ.prototype.visitBool=qZ,HZ.prototype.visitInt=jZ,HZ.prototype.visitInt8=jZ,HZ.prototype.visitInt16=jZ,HZ.prototype.visitInt32=jZ,HZ.prototype.visitInt64=jZ,HZ.prototype.visitUint8=jZ,HZ.prototype.visitUint16=jZ,HZ.prototype.visitUint32=jZ,HZ.prototype.visitUint64=jZ,HZ.prototype.visitFloat=WZ,HZ.prototype.visitFloat16=WZ,HZ.prototype.visitFloat32=WZ,HZ.prototype.visitFloat64=WZ,HZ.prototype.visitUtf8=qZ,HZ.prototype.visitLargeUtf8=qZ,HZ.prototype.visitBinary=qZ,HZ.prototype.visitLargeBinary=qZ,HZ.prototype.visitFixedSizeBinary=function(t,e){return t===e||UZ(t,e)&&t.byteWidth===e.byteWidth},HZ.prototype.visitDate=GZ,HZ.prototype.visitDateDay=GZ,HZ.prototype.visitDateMillisecond=GZ,HZ.prototype.visitTimestamp=ZZ,HZ.prototype.visitTimestampSecond=ZZ,HZ.prototype.visitTimestampMillisecond=ZZ,HZ.prototype.visitTimestampMicrosecond=ZZ,HZ.prototype.visitTimestampNanosecond=ZZ,HZ.prototype.visitTime=KZ,HZ.prototype.visitTimeSecond=KZ,HZ.prototype.visitTimeMillisecond=KZ,HZ.prototype.visitTimeMicrosecond=KZ,HZ.prototype.visitTimeNanosecond=KZ,HZ.prototype.visitDecimal=qZ,HZ.prototype.visitList=function(t,e){return t===e||UZ(t,e)&&t.children.length===e.children.length&&QZ.compareManyFields(t.children,e.children)},HZ.prototype.visitStruct=function(t,e){return t===e||UZ(t,e)&&t.children.length===e.children.length&&QZ.compareManyFields(t.children,e.children)},HZ.prototype.visitUnion=YZ,HZ.prototype.visitDenseUnion=YZ,HZ.prototype.visitSparseUnion=YZ,HZ.prototype.visitDictionary=function(t,e){return t===e||UZ(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&QZ.visit(t.indices,e.indices)&&QZ.visit(t.dictionary,e.dictionary)},HZ.prototype.visitInterval=XZ,HZ.prototype.visitIntervalDayTime=XZ,HZ.prototype.visitIntervalYearMonth=XZ,HZ.prototype.visitIntervalMonthDayNano=XZ,HZ.prototype.visitDuration=JZ,HZ.prototype.visitDurationSecond=JZ,HZ.prototype.visitDurationMillisecond=JZ,HZ.prototype.visitDurationMicrosecond=JZ,HZ.prototype.visitDurationNanosecond=JZ,HZ.prototype.visitFixedSizeList=function(t,e){return t===e||UZ(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&QZ.compareManyFields(t.children,e.children)},HZ.prototype.visitMap=function(t,e){return t===e||UZ(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&QZ.compareManyFields(t.children,e.children)}
|
|
14705
|
+
const QZ=new HZ
|
|
14706
|
+
function tK(t,e){return QZ.compareSchemas(t,e)}function eK(t,e){return function(t,e){const n=[...t.fields],i=[],o={numBatches:e.reduce(((t,e)=>Math.max(t,e.length)),0)}
|
|
14707
|
+
let s=0,r=0,a=-1
|
|
14708
|
+
const l=e.length
|
|
14709
|
+
let c,d=[]
|
|
14710
|
+
for(;o.numBatches-- >0;){for(r=Number.POSITIVE_INFINITY,a=-1;++a<l;)d[a]=c=e[a].shift(),r=Math.min(r,c?c.length:r)
|
|
14711
|
+
Number.isFinite(r)&&(d=nK(n,r,d,e,o),r>0&&(i[s++]=bG({type:new Mj(n),length:r,nullCount:0,children:d.slice()})))}return[t=t.assign(n),i.map((e=>new rK(t,e)))]}(t,e.map((t=>t.data.concat())))}function nK(t,e,n,i,o){var s
|
|
14712
|
+
const r=(e+63&-64)>>3
|
|
14713
|
+
for(let a=-1,l=i.length;++a<l;){const l=n[a],c=null==l?void 0:l.length
|
|
14714
|
+
if(c>=e)c===e?n[a]=l:(n[a]=l.slice(0,e),o.numBatches=Math.max(o.numBatches,i[a].unshift(l.slice(e,c-e))))
|
|
14715
|
+
else{const i=t[a]
|
|
14716
|
+
t[a]=i.clone({nullable:!0}),n[a]=null!==(s=null==l?void 0:l._changeLengthAndBackfillNullBitmap(e))&&void 0!==s?s:bG({type:i.type,length:e,nullCount:e,nullBitmap:new Uint8Array(r)})}}return n}var iK,oK
|
|
14717
|
+
class sK{constructor(...t){var e,n
|
|
14718
|
+
if(0===t.length)return this.batches=[],this.schema=new UG([]),this._offsets=[0],this
|
|
14719
|
+
let i,o
|
|
14720
|
+
t[0]instanceof UG&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop())
|
|
14721
|
+
const s=t=>{if(t){if(t instanceof rK)return[t]
|
|
14722
|
+
if(t instanceof sK)return t.batches
|
|
14723
|
+
if(t instanceof mG){if(t.type instanceof Mj)return[new rK(new UG(t.type.children),t)]}else{if(Array.isArray(t))return t.flatMap((t=>s(t)))
|
|
14724
|
+
if("function"==typeof t[Symbol.iterator])return[...t].flatMap((t=>s(t)))
|
|
14725
|
+
if("object"==typeof t){const e=Object.keys(t),n=e.map((e=>new PG([t[e]]))),o=null!=i?i:new UG(e.map(((t,e)=>new qG(String(t),n[e].type,n[e].nullable)))),[,s]=eK(o,n)
|
|
14726
|
+
return 0===s.length?[new rK(t)]:s}}}return[]},r=t.flatMap((t=>s(t)))
|
|
14727
|
+
if(i=null!==(n=null!=i?i:null===(e=r[0])||void 0===e?void 0:e.schema)&&void 0!==n?n:new UG([]),!(i instanceof UG))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.")
|
|
14728
|
+
for(const t of r){if(!(t instanceof rK))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.")
|
|
14729
|
+
if(!tK(i,t.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=r,this._offsets=null!=o?o:xG(this.data)}get data(){return this.batches.map((({data:t})=>t))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce(((t,e)=>t+e.length),0)}get nullCount(){return-1===this._nullCount&&(this._nullCount=wG(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(iG(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?FG.visit(new PG(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(",\n ")}\n]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap((({data:t})=>t)))
|
|
14730
|
+
return new sK(e,n.map((t=>new rK(e,t))))}slice(t,e){const n=this.schema;[t,e]=nG({length:this.numRows},t,e)
|
|
14731
|
+
const i=CG(this.data,this._offsets,t,e)
|
|
14732
|
+
return new sK(n,i.map((t=>new rK(n,t))))}getChild(t){return this.getChildAt(this.schema.fields.findIndex((e=>e.name===t)))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){const e=this.data.map((e=>e.children[t]))
|
|
14733
|
+
if(0===e.length){const{type:n}=this.schema.fields[t],i=bG({type:n,length:0,nullCount:0})
|
|
14734
|
+
e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new PG(e)}return null}setChild(t,e){var n
|
|
14735
|
+
return this.setChildAt(null===(n=this.schema.fields)||void 0===n?void 0:n.findIndex((e=>e.name===t)),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches]
|
|
14736
|
+
if(t>-1&&t<this.numCols){e||(e=new PG([bG({type:new hj,length:this.numRows})]))
|
|
14737
|
+
const o=n.fields.slice(),s=o[t].clone({type:e.type}),r=this.schema.fields.map(((t,e)=>this.getChildAt(e)));[o[t],r[t]]=[s,e],[n,i]=eK(n,r)}return new sK(n,i)}select(t){const e=this.schema.fields.reduce(((t,e,n)=>t.set(e.name,n)),new Map)
|
|
14738
|
+
return this.selectAt(t.map((t=>e.get(t))).filter((t=>t>-1)))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map((e=>e.selectAt(t)))
|
|
14739
|
+
return new sK(e,n)}assign(t){const e=this.schema.fields,[n,i]=t.schema.fields.reduce(((t,n,i)=>{const[o,s]=t,r=e.findIndex((t=>t.name===n.name))
|
|
14740
|
+
return~r?s[r]=i:o.push(i),t}),[[],[]]),o=this.schema.assign(t.schema),s=[...e.map(((t,e)=>[e,i[e]])).map((([e,n])=>void 0===n?this.getChildAt(e):t.getChildAt(n))),...n.map((e=>t.getChildAt(e)))].filter(Boolean)
|
|
14741
|
+
return new sK(...eK(o,s))}}iK=Symbol.toStringTag,sK[iK]=(t=>(t.schema=null,t.batches=[],t._offsets=new Uint32Array([0]),t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t.isValid=_G(SG),t.get=_G(GW.getVisitFn(Iq.Struct)),t.set=IG(mW.getVisitFn(Iq.Struct)),t.indexOf=MG(DG.getVisitFn(Iq.Struct)),"Table"))(sK.prototype)
|
|
14742
|
+
class rK{constructor(...t){switch(t.length){case 2:if([this.schema]=t,!(this.schema instanceof UG))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.")
|
|
14743
|
+
if([,this.data=bG({nullCount:0,type:new Mj(this.schema.fields),children:this.schema.fields.map((t=>bG({type:t.type,nullCount:0})))})]=t,!(this.data instanceof mG))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=aK(this.schema,this.data.children)
|
|
14744
|
+
break
|
|
14745
|
+
case 1:{const[e]=t,{fields:n,children:i,length:o}=Object.keys(e).reduce(((t,n,i)=>(t.children[i]=e[n],t.length=Math.max(t.length,e[n].length),t.fields[i]=qG.new({name:n,type:e[n].type,nullable:!0}),t)),{length:0,fields:new Array,children:new Array}),s=new UG(n),r=bG({type:new Mj(n),length:o,children:i,nullCount:0});[this.schema,this.data]=aK(s,r.children,o)
|
|
14746
|
+
break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=lK(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return GW.visit(this.data,t)}at(t){return this.get(iG(t,this.numRows))}set(t,e){return mW.visit(this.data,t,e)}indexOf(t,e){return DG.visit(this.data,t,e)}[Symbol.iterator](){return FG.visit(new PG([this.data]))}toArray(){return[...this]}concat(...t){return new sK(this.schema,[this,...t])}slice(t,e){const[n]=new PG([this.data]).slice(t,e).data
|
|
14747
|
+
return new rK(this.schema,n)}getChild(t){var e
|
|
14748
|
+
return this.getChildAt(null===(e=this.schema.fields)||void 0===e?void 0:e.findIndex((e=>e.name===t)))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new PG([this.data.children[t]]):null}setChild(t,e){var n
|
|
14749
|
+
return this.setChildAt(null===(n=this.schema.fields)||void 0===n?void 0:n.findIndex((e=>e.name===t)),e)}setChildAt(t,e){let n=this.schema,i=this.data
|
|
14750
|
+
if(t>-1&&t<this.numCols){e||(e=new PG([bG({type:new hj,length:this.numRows})]))
|
|
14751
|
+
const o=n.fields.slice(),s=i.children.slice(),r=o[t].clone({type:e.type});[o[t],s[t]]=[r,e.data[0]],n=new UG(o,new Map(this.schema.metadata)),i=bG({type:new Mj(o),children:s})}return new rK(n,i)}select(t){const e=this.schema.select(t),n=new Mj(e.fields),i=[]
|
|
14752
|
+
for(const e of t){const t=this.schema.fields.findIndex((t=>t.name===e))
|
|
14753
|
+
~t&&(i[t]=this.data.children[t])}return new rK(e,bG({type:n,length:this.numRows,children:i}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map((t=>this.data.children[t])).filter(Boolean),i=bG({type:new Mj(e.fields),length:this.numRows,children:n})
|
|
14754
|
+
return new rK(e,i)}}function aK(t,e,n=e.reduce(((t,e)=>Math.max(t,e.length)),0)){var i
|
|
14755
|
+
const o=[...t.fields],s=[...e],r=(n+63&-64)>>3
|
|
14756
|
+
for(const[a,l]of t.fields.entries()){const t=e[a]
|
|
14757
|
+
t&&t.length===n||(o[a]=l.clone({nullable:!0}),s[a]=null!==(i=null==t?void 0:t._changeLengthAndBackfillNullBitmap(n))&&void 0!==i?i:bG({type:l.type,length:n,nullCount:n,nullBitmap:new Uint8Array(r)}))}return[t.assign(o),bG({type:new Mj(o),length:n,children:s})]}function lK(t,e,n=new Map){var i,o
|
|
14758
|
+
if((null!==(i=null==t?void 0:t.length)&&void 0!==i?i:0)>0&&(null==t?void 0:t.length)===(null==e?void 0:e.length))for(let i=-1,s=t.length;++i<s;){const{type:s}=t[i],r=e[i]
|
|
14759
|
+
for(const t of[r,...(null===(o=null==r?void 0:r.dictionary)||void 0===o?void 0:o.data)||[]])lK(s.children,null==t?void 0:t.children,n)
|
|
14760
|
+
if(dj.isDictionary(s)){const{id:t}=s
|
|
14761
|
+
if(n.has(t)){if(n.get(t)!==r.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}else(null==r?void 0:r.dictionary)&&n.set(t,r.dictionary)}}return n}oK=Symbol.toStringTag,rK[oK]=(t=>(t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(rK.prototype)
|
|
14762
|
+
class cK extends rK{constructor(t){const e=t.fields.map((t=>bG({type:t.type})))
|
|
14763
|
+
super(t,bG({type:new Mj(t.fields),nullCount:0,children:e}))}}const dK=t=>`Expected ${_q[t]} Message in stream, but was null or length 0.`,hK=t=>`Header pointer of flatbuffer-encoded ${_q[t]} Message is null or length 0.`,uK=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,pK=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`
|
|
14764
|
+
class fK{constructor(t){this.source=t instanceof MZ?t:new MZ(t)}[Symbol.iterator](){return this}next(){let t
|
|
14765
|
+
return(t=this.readMetadataLength()).done||-1===t.value&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?CZ:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e
|
|
14758
14766
|
if((e=this.next()).done)return null
|
|
14759
|
-
if(null!=t&&e.value.headerType!==t)throw new Error(
|
|
14767
|
+
if(null!=t&&e.value.headerType!==t)throw new Error(dK(t))
|
|
14760
14768
|
return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0)
|
|
14761
14769
|
const e=kU(this.source.read(t))
|
|
14762
|
-
if(e.byteLength<t)throw new Error(
|
|
14770
|
+
if(e.byteLength<t)throw new Error(pK(t,e.byteLength))
|
|
14763
14771
|
return e.byteOffset%8==0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=_q.Schema,n=this.readMessage(e),i=null==n?void 0:n.header()
|
|
14764
|
-
if(t&&!i)throw new Error(
|
|
14765
|
-
return i}readMetadataLength(){const t=this.source.read(
|
|
14772
|
+
if(t&&!i)throw new Error(hK(e))
|
|
14773
|
+
return i}readMetadataLength(){const t=this.source.read(vK),e=t&&new UU(t),n=(null==e?void 0:e.readInt32(0))||0
|
|
14766
14774
|
return{done:0===n,value:n}}readMetadata(t){const e=this.source.read(t)
|
|
14767
|
-
if(!e)return
|
|
14768
|
-
if(e.byteLength<t)throw new Error(
|
|
14769
|
-
return{done:!1,value:
|
|
14770
|
-
return(t=yield this.readMetadataLength()).done||-1===t.value&&(t=yield this.readMetadataLength()).done||(t=yield this.readMetadata(t.value)).done?
|
|
14775
|
+
if(!e)return CZ
|
|
14776
|
+
if(e.byteLength<t)throw new Error(uK(t,e.byteLength))
|
|
14777
|
+
return{done:!1,value:cZ.decode(e)}}}class mK{constructor(t,e){this.source=t instanceof $Z?t:hU(t)?new OZ(t,e):new $Z(t)}[Symbol.asyncIterator](){return this}next(){return e(this,void 0,void 0,(function*(){let t
|
|
14778
|
+
return(t=yield this.readMetadataLength()).done||-1===t.value&&(t=yield this.readMetadataLength()).done||(t=yield this.readMetadata(t.value)).done?CZ:t}))}throw(t){return e(this,void 0,void 0,(function*(){return yield this.source.throw(t)}))}return(t){return e(this,void 0,void 0,(function*(){return yield this.source.return(t)}))}readMessage(t){return e(this,void 0,void 0,(function*(){let e
|
|
14771
14779
|
if((e=yield this.next()).done)return null
|
|
14772
|
-
if(null!=t&&e.value.headerType!==t)throw new Error(
|
|
14780
|
+
if(null!=t&&e.value.headerType!==t)throw new Error(dK(t))
|
|
14773
14781
|
return e.value}))}readMessageBody(t){return e(this,void 0,void 0,(function*(){if(t<=0)return new Uint8Array(0)
|
|
14774
14782
|
const e=kU(yield this.source.read(t))
|
|
14775
|
-
if(e.byteLength<t)throw new Error(
|
|
14783
|
+
if(e.byteLength<t)throw new Error(pK(t,e.byteLength))
|
|
14776
14784
|
return e.byteOffset%8==0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}))}readSchema(){return e(this,arguments,void 0,(function*(t=!1){const e=_q.Schema,n=yield this.readMessage(e),i=null==n?void 0:n.header()
|
|
14777
|
-
if(t&&!i)throw new Error(
|
|
14778
|
-
return i}))}readMetadataLength(){return e(this,void 0,void 0,(function*(){const t=yield this.source.read(
|
|
14785
|
+
if(t&&!i)throw new Error(hK(e))
|
|
14786
|
+
return i}))}readMetadataLength(){return e(this,void 0,void 0,(function*(){const t=yield this.source.read(vK),e=t&&new UU(t),n=(null==e?void 0:e.readInt32(0))||0
|
|
14779
14787
|
return{done:0===n,value:n}}))}readMetadata(t){return e(this,void 0,void 0,(function*(){const e=yield this.source.read(t)
|
|
14780
|
-
if(!e)return
|
|
14781
|
-
if(e.byteLength<t)throw new Error(
|
|
14782
|
-
return{done:!1,value:
|
|
14788
|
+
if(!e)return CZ
|
|
14789
|
+
if(e.byteLength<t)throw new Error(uK(t,e.byteLength))
|
|
14790
|
+
return{done:!1,value:cZ.decode(e)}}))}}class gK extends fK{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof kZ?t:new kZ(t)}next(){const{_json:t}=this
|
|
14783
14791
|
if(!this._schema){this._schema=!0
|
|
14784
|
-
return{done:!1,value:
|
|
14792
|
+
return{done:!1,value:cZ.fromJSON(t.schema,_q.Schema)}}if(this._dictionaryIndex<t.dictionaries.length){const e=t.dictionaries[this._dictionaryIndex++]
|
|
14785
14793
|
this._body=e.data.columns
|
|
14786
|
-
return{done:!1,value:
|
|
14794
|
+
return{done:!1,value:cZ.fromJSON(e,_q.DictionaryBatch)}}if(this._batchIndex<t.batches.length){const e=t.batches[this._batchIndex++]
|
|
14787
14795
|
this._body=e.columns
|
|
14788
|
-
return{done:!1,value:
|
|
14796
|
+
return{done:!1,value:cZ.fromJSON(e,_q.RecordBatch)}}return this._body=[],CZ}readMessageBody(t){return function t(e){return(e||[]).reduce(((e,n)=>[...e,...n.VALIDITY&&[n.VALIDITY]||[],...n.TYPE_ID&&[n.TYPE_ID]||[],...n.OFFSET&&[n.OFFSET]||[],...n.DATA&&[n.DATA]||[],...t(n.children)]),[])}(this._body)}readMessage(t){let e
|
|
14789
14797
|
if((e=this.next()).done)return null
|
|
14790
|
-
if(null!=t&&e.value.headerType!==t)throw new Error(
|
|
14798
|
+
if(null!=t&&e.value.headerType!==t)throw new Error(dK(t))
|
|
14791
14799
|
return e.value}readSchema(){const t=_q.Schema,e=this.readMessage(t),n=null==e?void 0:e.header()
|
|
14792
|
-
if(!e||!n)throw new Error(
|
|
14793
|
-
return n}}const
|
|
14794
|
-
for(let t=0;t<6;t+=1)
|
|
14795
|
-
function
|
|
14796
|
-
return!0}const
|
|
14797
|
-
|
|
14798
|
-
return
|
|
14799
|
-
return
|
|
14800
|
-
|
|
14801
|
-
|
|
14800
|
+
if(!e||!n)throw new Error(hK(t))
|
|
14801
|
+
return n}}const vK=4,bK="ARROW1",yK=new Uint8Array(6)
|
|
14802
|
+
for(let t=0;t<6;t+=1)yK[t]=bK.codePointAt(t)
|
|
14803
|
+
function wK(t,e=0){for(let n=-1,i=yK.length;++n<i;)if(yK[n]!==t[e+n])return!1
|
|
14804
|
+
return!0}const xK=yK.length,CK=xK+vK,kK=2*xK+vK
|
|
14805
|
+
const SK={[WU.LZ4_FRAME]:new class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(t){const e=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(e)
|
|
14806
|
+
return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)&&this._hasValidVersion(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.LZ4_FRAME_MAGIC.every(((e,n)=>t[n]===e))}_hasValidVersion(t){return 1===(192&t[4])>>6}},[WU.ZSTD]:new class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(t){const e=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(e)
|
|
14807
|
+
return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.ZSTD_MAGIC.every(((e,n)=>t[n]===e))}}}
|
|
14808
|
+
const _K=new class{constructor(){this.registry={}}set(t,e){if((null==e?void 0:e.encode)&&"function"==typeof e.encode&&!SK[t].isValidCodecEncode(e))throw new Error(`Encoder for ${WU[t]} is not valid.`)
|
|
14809
|
+
this.registry[t]=e}get(t){var e
|
|
14810
|
+
return(null===(e=this.registry)||void 0===e?void 0:e[t])||null}}
|
|
14811
|
+
class IK extends SZ{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){const e=this._impl.open(t)
|
|
14812
|
+
return rU(e)?e.then((()=>this)):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return $U.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return $U.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof IK?t:cU(t)?function(t){return new MK(new NK(t))}(t):hU(t)?function(t){return e(this,void 0,void 0,(function*(){const{size:e}=yield t.stat(),n=new OZ(t,e)
|
|
14813
|
+
return e>=kK&&wK(yield n.readAt(0,xK+7&-8))?new AK(new FK(n)):new $K(new TK(n))}))}(t):rU(t)?(()=>e(this,void 0,void 0,(function*(){return yield IK.from(yield t)})))():uU(t)||fU(t)||mU(t)||lU(t)?function(t){return e(this,void 0,void 0,(function*(){const e=yield t.peek(xK+7&-8)
|
|
14814
|
+
return e&&e.byteLength>=4?wK(e)?new EK(new RK(yield t.read())):new $K(new TK(t)):new $K(new TK(function(){return o(this,arguments,(function*(){}))}()))}))}(new $Z(t)):function(t){const e=t.peek(xK+7&-8)
|
|
14815
|
+
return e&&e.byteLength>=4?wK(e)?new EK(new RK(t.read())):new MK(new OK(t)):new MK(new OK(function*(){}()))}(new MZ(t))}static readAll(t){return t instanceof IK?t.isSync()?LK(t):PK(t):cU(t)||ArrayBuffer.isView(t)||aU(t)||dU(t)?LK(t):PK(t)}}class MK extends IK{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return o(this,arguments,(function*(){yield i(yield*s(r(this[Symbol.iterator]())))}))}}class $K extends IK{constructor(t){super(t),this._impl=t}readAll(){return e(this,void 0,void 0,(function*(){var t,e,n,i
|
|
14802
14816
|
const o=new Array
|
|
14803
14817
|
try{for(var s,a=!0,l=r(this);!(t=(s=yield l.next()).done);a=!0){i=s.value,a=!1
|
|
14804
14818
|
const t=i
|
|
14805
|
-
o.push(t)}}catch(t){e={error:t}}finally{try{a||t||!(n=l.return)||(yield n.call(l))}finally{if(e)throw e.error}}return o}))}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class
|
|
14806
|
-
|
|
14807
|
-
|
|
14819
|
+
o.push(t)}}catch(t){e={error:t}}finally{try{a||t||!(n=l.return)||(yield n.call(l))}finally{if(e)throw e.error}}return o}))}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class EK extends MK{constructor(t){super(t),this._impl=t}}class AK extends $K{constructor(t){super(t),this._impl=t}}class DK{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){let n
|
|
14820
|
+
if(null!=t.compression){const i=_K.get(t.compression.type)
|
|
14821
|
+
if(!(null==i?void 0:i.decode)||"function"!=typeof i.decode)throw new Error("Record batch is compressed but codec not found")
|
|
14822
|
+
{const{decommpressedBody:o,buffers:s}=this._decompressBuffers(t,e,i)
|
|
14823
|
+
n=this._loadCompressedVectors(t,o,this.schema.fields),t=new dZ(t.length,t.nodes,s,null)}}else n=this._loadVectors(t,e,this.schema.fields)
|
|
14824
|
+
const i=bG({type:new Mj(this.schema.fields),length:t.length,children:n})
|
|
14825
|
+
return new rK(this.schema,i)}_loadDictionaryBatch(t,e){const{id:n,isDelta:i}=t,{dictionaries:o,schema:s}=this,r=o.get(n),a=s.dictionaries.get(n)
|
|
14826
|
+
let l
|
|
14827
|
+
if(null!=t.data.compression){const o=_K.get(t.data.compression.type)
|
|
14828
|
+
if(!(null==o?void 0:o.decode)||"function"!=typeof o.decode)throw new Error("Dictionary batch is compressed but codec not found")
|
|
14829
|
+
{const{decommpressedBody:s,buffers:r}=this._decompressBuffers(t.data,e,o)
|
|
14830
|
+
l=this._loadCompressedVectors(t.data,s,[a]),t=new hZ(new dZ(t.data.length,t.data.nodes,r,null),n,i)}}else l=this._loadVectors(t.data,e,[a])
|
|
14831
|
+
return(r&&i?r.concat(new PG(l)):new PG(l)).memoize()}_loadVectors(t,e,n){return new PZ(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}_loadCompressedVectors(t,e,n){return new VZ(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}_decompressBuffers(t,e,n){const i=[],o=[]
|
|
14832
|
+
let s=0
|
|
14833
|
+
for(const{offset:r,length:a}of t.buffers){if(0===a){i.push(new Uint8Array(0)),o.push(new uZ(s,0))
|
|
14834
|
+
continue}const t=new UU(e.subarray(r,r+a)),l=Eq(t.readInt64(0)),c=t.bytes().subarray(8),d=-1===l?c:n.decode(c)
|
|
14835
|
+
i.push(d)
|
|
14836
|
+
s+=(s+7&-8)-s,o.push(new uZ(s,d.length)),s+=d.length}return{decommpressedBody:i,buffers:o}}}class OK extends DK{constructor(t,e){super(e),this._reader=cU(t)?new gK(this._handle=t):new fK(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=BK(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):CZ}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):CZ}next(){if(this.closed)return CZ
|
|
14808
14837
|
let t
|
|
14809
14838
|
const{_reader:e}=this
|
|
14810
14839
|
for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header())
|
|
@@ -14812,7 +14841,7 @@ else{if(t.isRecordBatch()){this._recordBatchIndex++
|
|
|
14812
14841
|
const n=t.header(),i=e.readMessageBody(t.bodyLength)
|
|
14813
14842
|
return{done:!1,value:this._loadRecordBatch(n,i)}}if(t.isDictionaryBatch()){this._dictionaryIndex++
|
|
14814
14843
|
const n=t.header(),i=e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i)
|
|
14815
|
-
this.dictionaries.set(n.id,o)}}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new
|
|
14844
|
+
this.dictionaries.set(n.id,o)}}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new cK(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class TK extends DK{constructor(t,e){super(e),this._reader=new mK(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return e(this,void 0,void 0,(function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}))}open(t){return e(this,void 0,void 0,(function*(){return this.closed||(this.autoDestroy=BK(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this}))}throw(t){return e(this,void 0,void 0,(function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):CZ}))}return(t){return e(this,void 0,void 0,(function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):CZ}))}next(){return e(this,void 0,void 0,(function*(){if(this.closed)return CZ
|
|
14816
14845
|
let t
|
|
14817
14846
|
const{_reader:e}=this
|
|
14818
14847
|
for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header())
|
|
@@ -14820,7 +14849,7 @@ else{if(t.isRecordBatch()){this._recordBatchIndex++
|
|
|
14820
14849
|
const n=t.header(),i=yield e.readMessageBody(t.bodyLength)
|
|
14821
14850
|
return{done:!1,value:this._loadRecordBatch(n,i)}}if(t.isDictionaryBatch()){this._dictionaryIndex++
|
|
14822
14851
|
const n=t.header(),i=yield e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i)
|
|
14823
|
-
this.dictionaries.set(n.id,o)}}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new
|
|
14852
|
+
this.dictionaries.set(n.id,o)}}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new cK(this.schema)}):yield this.return()}))}_readNextMessageAndValidate(t){return e(this,void 0,void 0,(function*(){return yield this._reader.readMessage(t)}))}}class RK extends OK{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof DZ?t:new DZ(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema
|
|
14824
14853
|
for(const t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e
|
|
14825
14854
|
if(this.closed)return null
|
|
14826
14855
|
this._footer||this.open()
|
|
@@ -14831,11 +14860,11 @@ return this._loadRecordBatch(e,n)}}return null}_readDictionaryBatch(t){var e
|
|
|
14831
14860
|
const n=null===(e=this._footer)||void 0===e?void 0:e.getDictionaryBatch(t)
|
|
14832
14861
|
if(n&&this._handle.seek(n.offset)){const t=this._reader.readMessage(_q.DictionaryBatch)
|
|
14833
14862
|
if(null==t?void 0:t.isDictionaryBatch()){const e=t.header(),n=this._reader.readMessageBody(t.bodyLength),i=this._loadDictionaryBatch(e,n)
|
|
14834
|
-
this.dictionaries.set(e.id,i)}}}_readFooter(){const{_handle:t}=this,e=t.size-
|
|
14863
|
+
this.dictionaries.set(e.id,i)}}}_readFooter(){const{_handle:t}=this,e=t.size-CK,n=t.readInt32(e),i=t.readAt(e-n,n)
|
|
14835
14864
|
return KG.decode(i)}_readNextMessageAndValidate(t){var e
|
|
14836
14865
|
if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const n=null===(e=this._footer)||void 0===e?void 0:e.getRecordBatch(this._recordBatchIndex)
|
|
14837
|
-
if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}}class
|
|
14838
|
-
super(t instanceof
|
|
14866
|
+
if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}}class FK extends TK{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...e){const n="number"!=typeof e[0]?e.shift():void 0,i=e[0]instanceof Map?e.shift():void 0
|
|
14867
|
+
super(t instanceof OZ?t:new OZ(t,n),i)}isFile(){return!0}isAsync(){return!0}open(t){const n=Object.create(null,{open:{get:()=>super.open}})
|
|
14839
14868
|
return e(this,void 0,void 0,(function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema
|
|
14840
14869
|
for(const t of this._footer.dictionaryBatches())t&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield n.open.call(this,t)}))}readRecordBatch(t){return e(this,void 0,void 0,(function*(){var e
|
|
14841
14870
|
if(this.closed)return null
|
|
@@ -14849,11 +14878,11 @@ if(n&&(yield this._handle.seek(n.offset))){const t=yield this._reader.readMessag
|
|
|
14849
14878
|
if(null==t?void 0:t.isDictionaryBatch()){const e=t.header(),n=yield this._reader.readMessageBody(t.bodyLength),i=this._loadDictionaryBatch(e,n)
|
|
14850
14879
|
this.dictionaries.set(e.id,i)}}}))}_readFooter(){return e(this,void 0,void 0,(function*(){const{_handle:t}=this
|
|
14851
14880
|
t._pending&&(yield t._pending)
|
|
14852
|
-
const e=t.size-
|
|
14881
|
+
const e=t.size-CK,n=yield t.readInt32(e),i=yield t.readAt(e-n,n)
|
|
14853
14882
|
return KG.decode(i)}))}_readNextMessageAndValidate(t){return e(this,void 0,void 0,(function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const e=this._footer.getRecordBatch(this._recordBatchIndex)
|
|
14854
|
-
if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null}))}}class
|
|
14855
|
-
try{if(!e.open({autoDestroy:!1}).closed)do{yield e}while(!e.reset().open().closed)}finally{e.cancel()}}function
|
|
14856
|
-
try{if(!(yield i(e.open({autoDestroy:!1}))).closed)do{yield yield i(e)}while(!(yield i(e.reset().open())).closed)}finally{yield i(e.cancel())}}))}const
|
|
14883
|
+
if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null}))}}class NK extends OK{constructor(t,e){super(t,e)}_loadVectors(t,e,n){return new zZ(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}function BK(t,e){return e&&"boolean"==typeof e.autoDestroy?e.autoDestroy:t.autoDestroy}function*LK(t){const e=IK.from(t)
|
|
14884
|
+
try{if(!e.open({autoDestroy:!1}).closed)do{yield e}while(!e.reset().open().closed)}finally{e.cancel()}}function PK(t){return o(this,arguments,(function*(){const e=yield i(IK.from(t))
|
|
14885
|
+
try{if(!(yield i(e.open({autoDestroy:!1}))).closed)do{yield yield i(e)}while(!(yield i(e.reset().open())).closed)}finally{yield i(e.cancel())}}))}const zK=Q`
|
|
14857
14886
|
<div class="wafer-map-container">
|
|
14858
14887
|
<svg class="svg-root">
|
|
14859
14888
|
<g ${Ut("zoomContainer")} transform=${t=>t.transform.toString()}>
|
|
@@ -14884,7 +14913,7 @@ try{if(!(yield i(e.open({autoDestroy:!1}))).closed)do{yield yield i(e)}while(!(y
|
|
|
14884
14913
|
/>
|
|
14885
14914
|
</svg>
|
|
14886
14915
|
</div>
|
|
14887
|
-
`,
|
|
14916
|
+
`,VK=Mt`
|
|
14888
14917
|
${qo("inline-block")}
|
|
14889
14918
|
|
|
14890
14919
|
:host {
|
|
@@ -14974,67 +15003,67 @@ try{if(!(yield i(e.open({autoDestroy:!1}))).closed)do{yield yield i(e)}while(!(y
|
|
|
14974
15003
|
outline-width: 0px;
|
|
14975
15004
|
}
|
|
14976
15005
|
`
|
|
14977
|
-
function
|
|
15006
|
+
function HK(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function UK(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qK(t){let e,n,i
|
|
14978
15007
|
function o(t,i,o=0,s=t.length){if(o<s){if(0!==e(i,i))return s
|
|
14979
15008
|
do{const e=o+s>>>1
|
|
14980
|
-
n(t[e],i)<0?o=e+1:s=e}while(o<s)}return o}return 2!==t.length?(e=
|
|
15009
|
+
n(t[e],i)<0?o=e+1:s=e}while(o<s)}return o}return 2!==t.length?(e=HK,n=(e,n)=>HK(t(e),n),i=(e,n)=>t(e)-n):(e=t===HK||t===UK?t:jK,n=t,i=t),{left:o,center:function(t,e,n=0,s=t.length){const r=o(t,e,n,s-1)
|
|
14981
15010
|
return r>n&&i(t[r-1],e)>-i(t[r],e)?r-1:r},right:function(t,i,o=0,s=t.length){if(o<s){if(0!==e(i,i))return s
|
|
14982
15011
|
do{const e=o+s>>>1
|
|
14983
|
-
n(t[e],i)<=0?o=e+1:s=e}while(o<s)}return o}}}function
|
|
14984
|
-
|
|
14985
|
-
class
|
|
15012
|
+
n(t[e],i)<=0?o=e+1:s=e}while(o<s)}return o}}}function jK(){return 0}function WK(t){return null===t?NaN:+t}const GK=qK(HK).right
|
|
15013
|
+
qK(WK).center
|
|
15014
|
+
class ZK extends Map{constructor(t,e=YK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(KK(this,t))}has(t){return super.has(KK(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const i=e(n)
|
|
14986
15015
|
return t.has(i)?t.get(i):(t.set(i,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const i=e(n)
|
|
14987
15016
|
t.has(i)&&(n=t.get(i),t.delete(i))
|
|
14988
|
-
return n}(this,t))}}function
|
|
14989
|
-
return t.has(i)?t.get(i):n}function
|
|
14990
|
-
function
|
|
15017
|
+
return n}(this,t))}}function KK({_intern:t,_key:e},n){const i=e(n)
|
|
15018
|
+
return t.has(i)?t.get(i):n}function YK(t){return null!==t&&"object"==typeof t?t.valueOf():t}const XK=Math.sqrt(50),JK=Math.sqrt(10),QK=Math.sqrt(2)
|
|
15019
|
+
function tY(t,e,n){const i=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(i)),s=i/Math.pow(10,o),r=s>=XK?10:s>=JK?5:s>=QK?2:1
|
|
14991
15020
|
let a,l,c
|
|
14992
|
-
return o<0?(c=Math.pow(10,-o)/r,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,o)*r,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?
|
|
15021
|
+
return o<0?(c=Math.pow(10,-o)/r,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,o)*r,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?tY(t,e,2*n):[a,l,c]}function eY(t,e,n){return tY(t=+t,e=+e,n=+n)[2]}function nY(t,e,n=WK){if((i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return+n(t[0],0,t)
|
|
14993
15022
|
if(e>=1)return+n(t[i-1],i-1,t)
|
|
14994
15023
|
var i,o=(i-1)*e,s=Math.floor(o),r=+n(t[s],s,t)
|
|
14995
|
-
return r+(+n(t[s+1],s+1,t)-r)*(o-s)}}function
|
|
15024
|
+
return r+(+n(t[s+1],s+1,t)-r)*(o-s)}}function iY(t,e,n){t=+t,e=+e,n=(o=arguments.length)<2?(e=t,t=0,1):o<3?1:+n
|
|
14996
15025
|
for(var i=-1,o=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(o);++i<o;)s[i]=t+i*n
|
|
14997
|
-
return s}function
|
|
15026
|
+
return s}function oY(t,e){switch(arguments.length){case 0:break
|
|
14998
15027
|
case 1:this.range(t)
|
|
14999
15028
|
break
|
|
15000
|
-
default:this.range(e).domain(t)}return this}const
|
|
15001
|
-
function
|
|
15029
|
+
default:this.range(e).domain(t)}return this}const sY=Symbol("implicit")
|
|
15030
|
+
function rY(){var t=new ZK,e=[],n=[],i=sY
|
|
15002
15031
|
function o(o){let s=t.get(o)
|
|
15003
|
-
if(void 0===s){if(i!==
|
|
15032
|
+
if(void 0===s){if(i!==sY)return i
|
|
15004
15033
|
t.set(o,s=e.push(o)-1)}return n[s%n.length]}return o.domain=function(n){if(!arguments.length)return e.slice()
|
|
15005
|
-
e=[],t=new
|
|
15034
|
+
e=[],t=new ZK
|
|
15006
15035
|
for(const i of n)t.has(i)||t.set(i,e.push(i)-1)
|
|
15007
|
-
return o},o.range=function(t){return arguments.length?(n=Array.from(t),o):n.slice()},o.unknown=function(t){return arguments.length?(i=t,o):i},o.copy=function(){return
|
|
15036
|
+
return o},o.range=function(t){return arguments.length?(n=Array.from(t),o):n.slice()},o.unknown=function(t){return arguments.length?(i=t,o):i},o.copy=function(){return rY(e,n).unknown(i)},oY.apply(o,arguments),o}function aY(){var t,e,n=rY().unknown(void 0),i=n.domain,o=n.range,s=0,r=1,a=!1,l=0,c=0,d=.5
|
|
15008
15037
|
function h(){var n=i().length,h=r<s,u=h?r:s,p=h?s:r
|
|
15009
15038
|
t=(p-u)/Math.max(1,n-l+2*c),a&&(t=Math.floor(t)),u+=(p-u-t*(n-l))*d,e=t*(1-l),a&&(u=Math.round(u),e=Math.round(e))
|
|
15010
|
-
var f=
|
|
15011
|
-
return o(h?f.reverse():f)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([s,r]=t,s=+s,r=+r,h()):[s,r]},n.rangeRound=function(t){return[s,r]=t,s=+s,r=+r,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(d=Math.max(0,Math.min(1,t)),h()):d},n.copy=function(){return
|
|
15012
|
-
function
|
|
15013
|
-
var n}function
|
|
15014
|
-
return o<i?(i=
|
|
15015
|
-
for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++r<i;)o[r]=
|
|
15016
|
-
return function(e){var n=
|
|
15017
|
-
return s[n](o[n](e))}}function
|
|
15039
|
+
var f=iY(n).map((function(e){return u+t*e}))
|
|
15040
|
+
return o(h?f.reverse():f)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([s,r]=t,s=+s,r=+r,h()):[s,r]},n.rangeRound=function(t){return[s,r]=t,s=+s,r=+r,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(d=Math.max(0,Math.min(1,t)),h()):d},n.copy=function(){return aY(i(),[s,r]).round(a).paddingInner(l).paddingOuter(c).align(d)},oY.apply(h(),arguments)}function lY(t){return+t}var cY=[0,1]
|
|
15041
|
+
function dY(t){return t}function hY(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n})
|
|
15042
|
+
var n}function uY(t,e,n){var i=t[0],o=t[1],s=e[0],r=e[1]
|
|
15043
|
+
return o<i?(i=hY(o,i),s=n(r,s)):(i=hY(i,o),s=n(s,r)),function(t){return s(i(t))}}function pY(t,e,n){var i=Math.min(t.length,e.length)-1,o=new Array(i),s=new Array(i),r=-1
|
|
15044
|
+
for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++r<i;)o[r]=hY(t[r],t[r+1]),s[r]=n(e[r],e[r+1])
|
|
15045
|
+
return function(e){var n=GK(t,e,1,i)-1
|
|
15046
|
+
return s[n](o[n](e))}}function fY(){var t,e,n,i,o,s,r=cY,a=cY,l=MV,c=dY
|
|
15018
15047
|
function d(){var t,e,n,l=Math.min(r.length,a.length)
|
|
15019
|
-
return c!==
|
|
15048
|
+
return c!==dY&&(t=r[0],e=r[l-1],t>e&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?pY:uY,o=s=null,h}function h(e){return null==e||isNaN(e=+e)?n:(o||(o=i(r.map(t),a,l)))(t(c(e)))}return h.invert=function(n){return c(e((s||(s=i(a,r.map(t),CV)))(n)))},h.domain=function(t){return arguments.length?(r=Array.from(t,lY),d()):r.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),d()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=$V,d()},h.clamp=function(t){return arguments.length?(c=!!t||dY,d()):c!==dY},h.interpolate=function(t){return arguments.length?(l=t,d()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,d()}}function mY(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null
|
|
15020
15049
|
var n,i=t.slice(0,n)
|
|
15021
|
-
return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function
|
|
15022
|
-
function
|
|
15050
|
+
return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function gY(t){return(t=mY(Math.abs(t)))?t[1]:NaN}var vY,bY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i
|
|
15051
|
+
function yY(t){if(!(e=bY.exec(t)))throw new Error("invalid format: "+t)
|
|
15023
15052
|
var e
|
|
15024
|
-
return new
|
|
15053
|
+
return new wY({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function wY(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function xY(t,e){var n=mY(t,e)
|
|
15025
15054
|
if(!n)return t+""
|
|
15026
15055
|
var i=n[0],o=n[1]
|
|
15027
|
-
return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}
|
|
15028
|
-
var
|
|
15056
|
+
return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}yY.prototype=wY.prototype,wY.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}
|
|
15057
|
+
var CY={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>xY(100*t,e),r:xY,s:function(t,e){var n=mY(t,e)
|
|
15029
15058
|
if(!n)return t+""
|
|
15030
|
-
var i=n[0],o=n[1],s=o-(
|
|
15031
|
-
return s===r?i:s>r?i+new Array(s-r+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+
|
|
15032
|
-
function
|
|
15033
|
-
function
|
|
15034
|
-
return s.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",r=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?
|
|
15035
|
-
function h(t){var e=(t=
|
|
15036
|
-
"n"===b?(m=!0,b="g"):
|
|
15037
|
-
var y="$"===u?o:"#"===u&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===u?s:/[%p]/.test(b)?l:"",x=
|
|
15059
|
+
var i=n[0],o=n[1],s=o-(vY=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,r=i.length
|
|
15060
|
+
return s===r?i:s>r?i+new Array(s-r+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+mY(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)}
|
|
15061
|
+
function kY(t){return t}var SY,_Y,IY,MY=Array.prototype.map,$Y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"]
|
|
15062
|
+
function EY(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?kY:(e=MY.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var o=t.length,s=[],r=0,a=e[0],l=0;o>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(o-=a,o+a)),!((l+=a+1)>i));)a=e[r=(r+1)%e.length]
|
|
15063
|
+
return s.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",r=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?kY:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(MY.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",d=void 0===t.nan?"NaN":t.nan+""
|
|
15064
|
+
function h(t){var e=(t=yY(t)).fill,n=t.align,h=t.sign,u=t.symbol,p=t.zero,f=t.width,m=t.comma,g=t.precision,v=t.trim,b=t.type
|
|
15065
|
+
"n"===b?(m=!0,b="g"):CY[b]||(void 0===g&&(g=12),v=!0,b="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=")
|
|
15066
|
+
var y="$"===u?o:"#"===u&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===u?s:/[%p]/.test(b)?l:"",x=CY[b],C=/[defgprs%]/.test(b)
|
|
15038
15067
|
function k(t){var o,s,l,u=y,k=w
|
|
15039
15068
|
if("c"===b)k=x(t)+k,t=""
|
|
15040
15069
|
else{var S=(t=+t)<0||1/t<0
|
|
@@ -15043,7 +15072,7 @@ break
|
|
|
15043
15072
|
case"0":0===o&&(o=i),e=i
|
|
15044
15073
|
break
|
|
15045
15074
|
default:if(!+t[i])break t
|
|
15046
|
-
o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==h&&(S=!1),u=(S?"("===h?h:c:"-"===h||"("===h?"":h)+u,k=("s"===b
|
|
15075
|
+
o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==h&&(S=!1),u=(S?"("===h?h:c:"-"===h||"("===h?"":h)+u,k=("s"===b?$Y[8+vY/3]:"")+k+(S&&"("===h?")":""),C)for(o=-1,s=t.length;++o<s;)if(48>(l=t.charCodeAt(o))||l>57){k=(46===l?r+t.slice(o+1):t.slice(o))+k,t=t.slice(0,o)
|
|
15047
15076
|
break}}m&&!p&&(t=i(t,1/0))
|
|
15048
15077
|
var _=u.length+t.length+k.length,I=_<f?new Array(f-_+1).join(e):""
|
|
15049
15078
|
switch(m&&p&&(t=i(I+t,I.length?f-k.length:1/0),I=""),n){case"<":t=u+t+k+I
|
|
@@ -15052,19 +15081,19 @@ case"=":t=u+I+t+k
|
|
|
15052
15081
|
break
|
|
15053
15082
|
case"^":t=I.slice(0,_=I.length>>1)+u+t+k+I.slice(_)
|
|
15054
15083
|
break
|
|
15055
|
-
default:t=I+u+t+k}return a(t)}return g=void 0===g?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:h,formatPrefix:function(t,e){var n=h(((t=
|
|
15056
|
-
return function(t){return n(o*t)+s}}}}function
|
|
15057
|
-
const i=(e=+e)<(t=+t),o=i?
|
|
15084
|
+
default:t=I+u+t+k}return a(t)}return g=void 0===g?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:h,formatPrefix:function(t,e){var n=h(((t=yY(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(gY(e)/3))),o=Math.pow(10,-i),s=$Y[8+i/3]
|
|
15085
|
+
return function(t){return n(o*t)+s}}}}function AY(t,e,n,i){var o,s=function(t,e,n){n=+n
|
|
15086
|
+
const i=(e=+e)<(t=+t),o=i?eY(e,t,n):eY(t,e,n)
|
|
15058
15087
|
return(i?-1:1)*(o<0?1/-o:o)}(t,e,n)
|
|
15059
|
-
switch((i=
|
|
15060
|
-
return null!=i.precision||isNaN(o=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(
|
|
15061
|
-
case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,
|
|
15088
|
+
switch((i=yY(null==i?",f":i)).type){case"s":var r=Math.max(Math.abs(t),Math.abs(e))
|
|
15089
|
+
return null!=i.precision||isNaN(o=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(gY(e)/3)))-gY(Math.abs(t)))}(s,r))||(i.precision=o),IY(i,r)
|
|
15090
|
+
case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,gY(e)-gY(t))+1}(s,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=o-("e"===i.type))
|
|
15062
15091
|
break
|
|
15063
|
-
case"f":case"%":null!=i.precision||isNaN(o=function(t){return Math.max(0,-
|
|
15092
|
+
case"f":case"%":null!=i.precision||isNaN(o=function(t){return Math.max(0,-gY(Math.abs(t)))}(s))||(i.precision=o-2*("%"===i.type))}return _Y(i)}function DY(t){var e=t.domain
|
|
15064
15093
|
return t.ticks=function(t){var n=e()
|
|
15065
15094
|
return function(t,e,n){if(!((n=+n)>0))return[]
|
|
15066
15095
|
if((t=+t)==(e=+e))return[t]
|
|
15067
|
-
const i=e<t,[o,s,r]=i?
|
|
15096
|
+
const i=e<t,[o,s,r]=i?tY(e,t,n):tY(t,e,n)
|
|
15068
15097
|
if(!(s>=o))return[]
|
|
15069
15098
|
const a=s-o+1,l=new Array(a)
|
|
15070
15099
|
if(i)if(r<0)for(let t=0;t<a;++t)l[t]=(s-t)/-r
|
|
@@ -15072,23 +15101,23 @@ else for(let t=0;t<a;++t)l[t]=(s-t)*r
|
|
|
15072
15101
|
else if(r<0)for(let t=0;t<a;++t)l[t]=(o+t)/-r
|
|
15073
15102
|
else for(let t=0;t<a;++t)l[t]=(o+t)*r
|
|
15074
15103
|
return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e()
|
|
15075
|
-
return
|
|
15104
|
+
return AY(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10)
|
|
15076
15105
|
var i,o,s=e(),r=0,a=s.length-1,l=s[r],c=s[a],d=10
|
|
15077
|
-
for(c<l&&(o=l,l=c,c=o,o=r,r=a,a=o);d-- >0;){if((o=
|
|
15106
|
+
for(c<l&&(o=l,l=c,c=o,o=r,r=a,a=o);d-- >0;){if((o=eY(l,c,n))===i)return s[r]=l,s[a]=c,e(s)
|
|
15078
15107
|
if(o>0)l=Math.floor(l/o)*o,c=Math.ceil(c/o)*o
|
|
15079
15108
|
else{if(!(o<0))break
|
|
15080
|
-
l=Math.ceil(l*o)/o,c=Math.floor(c*o)/o}i=o}return t},t}function
|
|
15081
|
-
return t.copy=function(){return e=t,
|
|
15082
|
-
var e},
|
|
15109
|
+
l=Math.ceil(l*o)/o,c=Math.floor(c*o)/o}i=o}return t},t}function OY(){var t=fY()(dY,dY)
|
|
15110
|
+
return t.copy=function(){return e=t,OY().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())
|
|
15111
|
+
var e},oY.apply(t,arguments),DY(t)}function TY(){var t,e=[],n=[],i=[]
|
|
15083
15112
|
function o(){var t=0,o=Math.max(1,n.length)
|
|
15084
|
-
for(i=new Array(o-1);++t<o;)i[t-1]=
|
|
15085
|
-
return s}function s(e){return null==e||isNaN(e=+e)?t:n[
|
|
15113
|
+
for(i=new Array(o-1);++t<o;)i[t-1]=nY(e,t/o)
|
|
15114
|
+
return s}function s(e){return null==e||isNaN(e=+e)?t:n[GK(i,e)]}return s.invertExtent=function(t){var o=n.indexOf(t)
|
|
15086
15115
|
return o<0?[NaN,NaN]:[o>0?i[o-1]:e[0],o<i.length?i[o]:e[e.length-1]]},s.domain=function(t){if(!arguments.length)return e.slice()
|
|
15087
15116
|
e=[]
|
|
15088
15117
|
for(let n of t)null==n||isNaN(n=+n)||e.push(n)
|
|
15089
|
-
return e.sort(
|
|
15090
|
-
const
|
|
15091
|
-
let
|
|
15118
|
+
return e.sort(HK),o()},s.range=function(t){return arguments.length?(n=Array.from(t),o()):n.slice()},s.unknown=function(e){return arguments.length?(t=e,s):t},s.quantiles=function(){return i.slice()},s.copy=function(){return TY().domain(e).range(n).unknown(t)},oY.apply(s,arguments)}SY=EY({thousands:",",grouping:[3],currency:["$",""]}),_Y=SY.format,IY=SY.formatPrefix
|
|
15119
|
+
const RY="bottom-left",FY="bottom-right",NY="top-left",BY="top",LY="show",PY="hide",zY="linear",VY="ordinal"
|
|
15120
|
+
let HY=class{get containerDimensions(){return this._containerDimensions}get dieDimensions(){return this._dieDimensions}get radius(){return this._radius}get margin(){return this._margin}get horizontalScale(){return this._horizontalScale}get verticalScale(){return this._verticalScale}get invertedHorizontalScale(){return this._invertedHorizontalScale}get invertedVerticalScale(){return this._invertedVerticalScale}constructor(t){this.wafermap=t,this.defaultPadding=0,this.baseMarginPercentage=.04}updateContainerDimensions(){const t={width:this.wafermap.canvasWidth,height:this.wafermap.canvasHeight},e=Math.min(t.width,t.height),n={top:(t.height-e)/2,right:(t.width-e)/2,bottom:(t.height-e)/2,left:(t.width-e)/2},i={top:e*this.baseMarginPercentage,right:e*this.baseMarginPercentage,bottom:e*this.baseMarginPercentage,left:e*this.baseMarginPercentage}
|
|
15092
15121
|
this._margin=this.calculateMarginAddition(i,n),this._containerDimensions=this.calculateContainerDimensions(t,this._margin)
|
|
15093
15122
|
const o=Math.min(this._containerDimensions.width,this._containerDimensions.height)
|
|
15094
15123
|
this._radius=o/2,this.updateScales()}updateScales(){const t=Math.min(this._containerDimensions.width,this._containerDimensions.height),e=this.gridDimensionsValidAndDefined()?this.calculateGridDimensionsFromBoundingBox():this.calculateGridDimensionsFromDies(this.wafermap.dies),n=this.wafermap.originLocation
|
|
@@ -15098,22 +15127,22 @@ this._dieDimensions={width:isNaN(i)?0:i,height:isNaN(o)?0:o}}gridDimensionsValid
|
|
|
15098
15127
|
return"number"==typeof this.wafermap.gridMaxY&&"number"==typeof this.wafermap.gridMinY&&"number"==typeof this.wafermap.gridMaxX&&"number"==typeof this.wafermap.gridMinX&&(t.origin.x=this.wafermap.gridMinX,t.origin.y=this.wafermap.gridMinY,t.rows=this.wafermap.gridMaxY-this.wafermap.gridMinY+1,t.cols=this.wafermap.gridMaxX-this.wafermap.gridMinX+1),t}calculateGridDimensionsFromDies(t){if(0===t.length||void 0===t[0])return{origin:{x:0,y:0},rows:0,cols:0}
|
|
15099
15128
|
const e={x:t[0].x,y:t[0].y},n={x:t[0].x,y:t[0].y}
|
|
15100
15129
|
for(const i of t)i.x<e.x&&(e.x=i.x),i.y<e.y&&(e.y=i.y),i.x>n.x&&(n.x=i.x),i.y>n.y&&(n.y=i.y)
|
|
15101
|
-
return{origin:e,rows:n.y-e.y+1,cols:n.x-e.x+1}}calculateContainerDimensions(t,e){return{width:t.width-e.left-e.right,height:t.height-e.top-e.bottom}}createHorizontalScale(t,e,n){const i=
|
|
15102
|
-
return t
|
|
15103
|
-
return t
|
|
15104
|
-
return t
|
|
15105
|
-
return t
|
|
15106
|
-
class
|
|
15130
|
+
return{origin:e,rows:n.y-e.y+1,cols:n.x-e.x+1}}calculateContainerDimensions(t,e){return{width:t.width-e.left-e.right,height:t.height-e.top-e.bottom}}createHorizontalScale(t,e,n){const i=aY().domain(iY(e.origin.x,e.origin.x+e.cols)).paddingInner(0).paddingOuter(0).align(0).round(!1)
|
|
15131
|
+
return t===RY||t===NY?i.range([0,n]):i.range([n,0])}createInvertedHorizontalScale(t,e,n){const i=TY().domain([0,n])
|
|
15132
|
+
return t===RY||t===NY?i.range(iY(e.origin.x,e.origin.x+e.cols)):i.range(iY(e.origin.x,e.origin.x+e.cols).reverse())}createVerticalScale(t,e,n){const i=aY().domain(iY(e.origin.y,e.origin.y+e.rows)).paddingInner(this.defaultPadding).paddingOuter(0).align(0).round(!1)
|
|
15133
|
+
return t===RY||t===FY?i.range([n,0]):i.range([0,n])}createInvertedVerticalScale(t,e,n){const i=TY().domain([0,n])
|
|
15134
|
+
return t===RY||t===FY?i.range(iY(e.origin.y,e.origin.y+e.rows).reverse()):i.range(iY(e.origin.y,e.origin.y+e.rows))}calculateMarginAddition(t,e){return{top:t.top+e.top,right:t.right+e.right,bottom:t.bottom+e.bottom,left:t.left+e.left}}}
|
|
15135
|
+
class UY{get labelsFontSize(){return this._labelsFontSize}get diesRenderInfo(){return this._diesRenderInfo}constructor(t){this.wafermap=t,this.fontSizeFactor=.8,this.nonHighlightedOpacity=.3,this.emptyDieColor="rgba(218,223,236,1)",this.nanDieColor="rgba(122,122,122,1)"}updateLabelsFontSize(){this._labelsFontSize=this.calculateLabelsFontSize(this.wafermap.dataManager.dieDimensions,this.wafermap.maxCharacters),this.updateDiesRenderInfo()}updateDiesRenderInfo(){this.d3ColorScale=this.createD3ColorScale(this.wafermap.colorScale,this.wafermap.colorScaleMode)
|
|
15107
15136
|
const t=t=>null!==t
|
|
15108
15137
|
void 0===this.wafermap.diesTable&&(this._diesRenderInfo=this.wafermap.dies.map((t=>this.computeDieRenderInfo(t))).filter(t))}computeDieRenderInfo(t){const e=this.wafermap.dataManager.margin,n=this.wafermap.dataManager.horizontalScale(t.x),i=this.wafermap.dataManager.verticalScale(t.y)
|
|
15109
|
-
return void 0===n||void 0===i?null:{x:n+e.right,y:i+e.top,fillStyle:this.calculateFillStyle(t.value,this.wafermap.colorScaleMode,this.wafermap.highlightedTags,t.tags),text:this.buildLabel(t.value,this.wafermap.maxCharacters,this.wafermap.dieLabelsHidden,this.wafermap.dieLabelsSuffix)}}calculateLabelsFontSize(t,e){return Math.min(t.height,t.width/(.5*Math.max(2,e))*this.fontSizeFactor)}createD3ColorScale(t,e){return this.isColorScaleLinear(e)?
|
|
15138
|
+
return void 0===n||void 0===i?null:{x:n+e.right,y:i+e.top,fillStyle:this.calculateFillStyle(t.value,this.wafermap.colorScaleMode,this.wafermap.highlightedTags,t.tags),text:this.buildLabel(t.value,this.wafermap.maxCharacters,this.wafermap.dieLabelsHidden,this.wafermap.dieLabelsSuffix)}}calculateLabelsFontSize(t,e){return Math.min(t.height,t.width/(.5*Math.max(2,e))*this.fontSizeFactor)}createD3ColorScale(t,e){return this.isColorScaleLinear(e)?OY().domain(t.values.map((t=>+t))).range(t.colors):rY().domain(t.values).range(t.colors)}dieHasData(t){return null!=t&&""!==t}buildLabel(t,e,n,i){if(n||!this.dieHasData(t))return""
|
|
15110
15139
|
const o=`${t}${i}`
|
|
15111
15140
|
return o.length>=e?`${o.substring(0,e)}…`:o}calculateOpacity(t,e){if(!e||0===e.length)return 1
|
|
15112
15141
|
const n=new Set(e)
|
|
15113
|
-
return t?.some((t=>n.has(t)))?1:this.nonHighlightedOpacity}isColorScaleLinear(t){return t===
|
|
15142
|
+
return t?.some((t=>n.has(t)))?1:this.nonHighlightedOpacity}isColorScaleLinear(t){return t===zY}isColorScaleOrdinal(t){return t===VY}calculateFillStyle(t,e,n,i){let o=this.emptyDieColor
|
|
15114
15143
|
if(this.dieHasData(t)&&(isNaN(+t)?o=this.nanDieColor:this.isColorScaleLinear(e)?o=this.d3ColorScale(+t):this.isColorScaleOrdinal(e)&&(o=this.d3ColorScale(t))),void 0===o)return this.emptyDieColor
|
|
15115
15144
|
let s=Ca(o)
|
|
15116
|
-
return null===s?this.emptyDieColor:(s=new fa(s.r,s.g,s.b,this.calculateOpacity(i,n)),s.toStringWebRGBA())}}class
|
|
15145
|
+
return null===s?this.emptyDieColor:(s=new fa(s.r,s.g,s.b,this.calculateOpacity(i,n)),s.toStringWebRGBA())}}class qY{get containerDimensions(){return this.computations.containerDimensions}get dieDimensions(){return this.computations.dieDimensions}get radius(){return this.computations.radius}get margin(){return this.computations.margin}get horizontalScale(){return this.computations.horizontalScale}get invertedHorizontalScale(){return this.computations.invertedHorizontalScale}get verticalScale(){return this.computations.verticalScale}get invertedVerticalScale(){return this.computations.invertedVerticalScale}get labelsFontSize(){return this.prerendering.labelsFontSize}get diesRenderInfo(){return this.prerendering.diesRenderInfo}get data(){return this.dataMap}constructor(t){this.wafermap=t,this.computations=new HY(t),this.prerendering=new UY(t)}updateContainerDimensions(){this.computations.updateContainerDimensions(),this.updateDataMap(),this.updateLabelsFontSize()}updateScales(){this.computations.updateScales(),this.updateDataMap(),this.updateLabelsFontSize()}updateLabelsFontSize(){this.prerendering.updateLabelsFontSize()}updateDiesRenderInfo(){this.prerendering.updateDiesRenderInfo()}getWaferMapDie(t){return this.dataMap.get(`${t.x}_${t.y}`)}updateDataMap(){this.dataMap=new Map(this.wafermap.dies.map((t=>[`${t.x}_${t.y}`,t])))}}class jY{constructor(t){this.wafermap=t,this.minDieDim=50}updateSortedDiesAndDrawWafer(){this.dies=this.wafermap.dataManager.diesRenderInfo.sort(((t,e)=>t.fillStyle>e.fillStyle?1:e.fillStyle>t.fillStyle?-1:0)),this.drawWafer()}drawWafer(){this.wafermap.canvasContext.save(),this.clearCanvas(),this.scaleCanvas(),this.renderDies(),this.renderText(),this.wafermap.canvasContext.restore(),this.renderHover()}renderHover(){void 0!==this.wafermap.dataManager.dieDimensions&&void 0!==this.wafermap.transform&&(this.wafermap.hoverWidth=this.wafermap.dataManager.dieDimensions.width*this.wafermap.transform.k,this.wafermap.hoverHeight=this.wafermap.dataManager.dieDimensions.height*this.wafermap.transform.k,this.wafermap.hoverOpacity=void 0===this.wafermap.hoverDie?PY:LY,this.wafermap.hoverTransform=this.calculateHoverTransform())}calculateHoverTransform(){if(void 0!==this.wafermap.hoverDie){const t=this.wafermap.dataManager.horizontalScale(this.wafermap.hoverDie.x)
|
|
15117
15146
|
if(void 0===t)return""
|
|
15118
15147
|
const e=this.wafermap.dataManager.verticalScale(this.wafermap.hoverDie.y)
|
|
15119
15148
|
if(void 0===e)return""
|
|
@@ -15126,93 +15155,93 @@ if(t*e*(this.wafermap.transform.k||1)>=this.minDieDim){const n=this.wafermap.dat
|
|
|
15126
15155
|
i.font=`${n.toString()}px sans-serif`,i.fillStyle="#ffffff",i.textAlign="center",i.lineCap="butt"
|
|
15127
15156
|
const o=i.measureText("M"),s=this.wafermap.transform.invert([0,0]),r=this.wafermap.transform.invert([this.wafermap.canvas.width,this.wafermap.canvas.height])
|
|
15128
15157
|
s[0]-=t,s[1]-=e
|
|
15129
|
-
for(const n of this.dies)this.isDieVisible(n,s,r)&&i.fillText(n.text,n.x+t/2,n.y+e/2+o.width/2,t-t/100*20)}}clearCanvas(){this.wafermap.canvasContext.clearRect(0,0,this.wafermap.canvas.width,this.wafermap.canvas.height)}scaleCanvas(){this.wafermap.canvasContext.translate(this.wafermap.transform.x,this.wafermap.transform.y),this.wafermap.canvasContext.scale(this.wafermap.transform.k,this.wafermap.transform.k)}isDieVisible(t,e,n){return t.x>=e[0]&&t.x<n[0]&&t.y>=e[1]&&t.y<n[1]}}const
|
|
15130
|
-
class
|
|
15158
|
+
for(const n of this.dies)this.isDieVisible(n,s,r)&&i.fillText(n.text,n.x+t/2,n.y+e/2+o.width/2,t-t/100*20)}}clearCanvas(){this.wafermap.canvasContext.clearRect(0,0,this.wafermap.canvas.width,this.wafermap.canvas.height)}scaleCanvas(){this.wafermap.canvasContext.translate(this.wafermap.transform.x,this.wafermap.transform.y),this.wafermap.canvasContext.scale(this.wafermap.transform.k,this.wafermap.transform.k)}isDieVisible(t,e,n){return t.x>=e[0]&&t.x<n[0]&&t.y>=e[1]&&t.y<n[1]}}const WY=["highlightedTags","canvasWidth","canvasHeight","originLocation","gridMinX","gridMaxX","gridMinY","gridMaxY","dies","maxCharacters","colorScale","colorScaleMode","dieLabelsHidden","dieLabelsSuffix","transform","hoverDie"]
|
|
15159
|
+
class GY extends sA{constructor(t){super(WY),this.wafermap=t,this.updateQueued=!1}get requiresEventsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")||this.isTracked("transform")}get requiresWorkerWaferSetup(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresContainerDimensionsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresComponentResizeUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresScalesUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresInputDataUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresLabelsFontSizeUpdate(){return this.isTracked("maxCharacters")}get requiresDiesRenderInfoUpdate(){return this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresColorAndTextUpdate(){return this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresDrawnWaferUpdate(){return this.isTracked("transform")}get requiresRenderHoverUpdate(){return this.isTracked("hoverDie")}queueUpdate(){this.wafermap.$fastController.isConnected&&!this.updateQueued&&(this.updateQueued=!0,void 0===this.wafermap.currentTask?b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1})):(async()=>{await this.wafermap.currentTask,b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1,this.wafermap.currentTask=void 0}))})())}}class ZY{constructor(t){this.wafermap=t,this.invalidGridDimensions=!1,this.invalidDiesTableSchema=!1}getValidity(){return{invalidGridDimensions:this.invalidGridDimensions,invalidDiesTableSchema:this.invalidDiesTableSchema}}isValid(){return Object.values(this.getValidity()).every((t=>!1===t))}validateGridDimensions(){return this.invalidGridDimensions=!1,void 0===this.wafermap.gridMinX&&void 0===this.wafermap.gridMaxX&&void 0===this.wafermap.gridMinY&&void 0===this.wafermap.gridMaxY?this.invalidGridDimensions=!1:("number"!=typeof this.wafermap.gridMinX||"number"!=typeof this.wafermap.gridMaxX||"number"!=typeof this.wafermap.gridMinY||"number"!=typeof this.wafermap.gridMaxY||this.wafermap.gridMaxX<this.wafermap.gridMinX||this.wafermap.gridMaxY<this.wafermap.gridMinY)&&(this.invalidGridDimensions=!0),!this.invalidGridDimensions}validateDiesTableSchema(){if(this.invalidDiesTableSchema=!1,void 0===this.wafermap.diesTable)this.invalidDiesTableSchema=!1
|
|
15131
15160
|
else{const t=this.wafermap.diesTable.schema.fields,e=t.find((t=>"colIndex"===t.name)),n=t.find((t=>"rowIndex"===t.name)),i=t.find((t=>"value"===t.name))
|
|
15132
15161
|
e&&n&&i&&dj.isInt(e.type)&&32===e.type.bitWidth&&dj.isInt(n.type)&&32===n.type.bitWidth&&dj.isFloat(i.type)&&i.type.precision===RU.DOUBLE||(this.invalidDiesTableSchema=!0)}return!this.invalidDiesTableSchema}}
|
|
15133
15162
|
/**
|
|
15134
15163
|
* @license
|
|
15135
15164
|
* Copyright 2019 Google LLC
|
|
15136
15165
|
* SPDX-License-Identifier: Apache-2.0
|
|
15137
|
-
*/const
|
|
15138
|
-
return
|
|
15166
|
+
*/const KY=Symbol("Comlink.proxy"),YY=Symbol("Comlink.endpoint"),XY=Symbol("Comlink.releaseProxy"),JY=Symbol("Comlink.finalizer"),QY=Symbol("Comlink.thrown"),tX=t=>"object"==typeof t&&null!==t||"function"==typeof t,eX=new Map([["proxy",{canHandle:t=>tX(t)&&t[KY],serialize(t){const{port1:e,port2:n}=new MessageChannel
|
|
15167
|
+
return nX(t,e),[n,[n]]},deserialize:t=>(t.start(),oX(t))}],["throw",{canHandle:t=>tX(t)&&QY in t,serialize({value:t}){let e
|
|
15139
15168
|
return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value)
|
|
15140
15169
|
throw t.value}}]])
|
|
15141
|
-
function
|
|
15170
|
+
function nX(t,e=globalThis,n=["*"]){e.addEventListener("message",(function i(o){if(!o||!o.data)return
|
|
15142
15171
|
if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0
|
|
15143
15172
|
if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`)
|
|
15144
|
-
const{id:s,type:r,path:a}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(
|
|
15173
|
+
const{id:s,type:r,path:a}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(fX)
|
|
15145
15174
|
let c
|
|
15146
15175
|
try{const e=a.slice(0,-1).reduce(((t,e)=>t[e]),t),n=a.reduce(((t,e)=>t[e]),t)
|
|
15147
15176
|
switch(r){case"GET":c=n
|
|
15148
15177
|
break
|
|
15149
|
-
case"SET":e[a.slice(-1)[0]]=
|
|
15178
|
+
case"SET":e[a.slice(-1)[0]]=fX(o.data.value),c=!0
|
|
15150
15179
|
break
|
|
15151
15180
|
case"APPLY":c=n.apply(e,l)
|
|
15152
15181
|
break
|
|
15153
|
-
case"CONSTRUCT":c=function(t){return Object.assign(t,{[
|
|
15182
|
+
case"CONSTRUCT":c=function(t){return Object.assign(t,{[KY]:!0})}(new n(...l))
|
|
15154
15183
|
break
|
|
15155
15184
|
case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel
|
|
15156
|
-
|
|
15185
|
+
nX(t,n),c=uX(e,[e])}break
|
|
15157
15186
|
case"RELEASE":c=void 0
|
|
15158
15187
|
break
|
|
15159
|
-
default:return}}catch(t){c={value:t,[
|
|
15160
|
-
e.postMessage(Object.assign(Object.assign({},o),{id:s}),a),"RELEASE"===r&&(e.removeEventListener("message",i),
|
|
15161
|
-
e.postMessage(Object.assign(Object.assign({},n),{id:s}),i)}))})),e.start&&e.start()}function
|
|
15188
|
+
default:return}}catch(t){c={value:t,[QY]:0}}Promise.resolve(c).catch((t=>({value:t,[QY]:0}))).then((n=>{const[o,a]=pX(n)
|
|
15189
|
+
e.postMessage(Object.assign(Object.assign({},o),{id:s}),a),"RELEASE"===r&&(e.removeEventListener("message",i),iX(e),JY in t&&"function"==typeof t[JY]&&t[JY]())})).catch((t=>{const[n,i]=pX({value:new TypeError("Unserializable return value"),[QY]:0})
|
|
15190
|
+
e.postMessage(Object.assign(Object.assign({},n),{id:s}),i)}))})),e.start&&e.start()}function iX(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function oX(t,e){const n=new Map
|
|
15162
15191
|
return t.addEventListener("message",(function(t){const{data:e}=t
|
|
15163
15192
|
if(!e||!e.id)return
|
|
15164
15193
|
const i=n.get(e.id)
|
|
15165
|
-
if(i)try{i(e)}finally{n.delete(e.id)}})),
|
|
15166
|
-
|
|
15167
|
-
function
|
|
15168
|
-
const s=new Proxy(i,{get(i,r){if(
|
|
15194
|
+
if(i)try{i(e)}finally{n.delete(e.id)}})),cX(t,n,[],e)}function sX(t){if(t)throw new Error("Proxy has been released and is not useable")}function rX(t){return mX(t,new Map,{type:"RELEASE"}).then((()=>{iX(t)}))}const aX=new WeakMap,lX="FinalizationRegistry"in globalThis&&new FinalizationRegistry((t=>{const e=(aX.get(t)||0)-1
|
|
15195
|
+
aX.set(t,e),0===e&&rX(t)}))
|
|
15196
|
+
function cX(t,e,n=[],i=function(){}){let o=!1
|
|
15197
|
+
const s=new Proxy(i,{get(i,r){if(sX(o),r===XY)return()=>{!function(t){lX&&lX.unregister(t)}(s),rX(t),e.clear(),o=!0}
|
|
15169
15198
|
if("then"===r){if(0===n.length)return{then:()=>s}
|
|
15170
|
-
const i=
|
|
15171
|
-
return i.then.bind(i)}return
|
|
15172
|
-
const[a,l]=
|
|
15173
|
-
return
|
|
15199
|
+
const i=mX(t,e,{type:"GET",path:n.map((t=>t.toString()))}).then(fX)
|
|
15200
|
+
return i.then.bind(i)}return cX(t,e,[...n,r])},set(i,s,r){sX(o)
|
|
15201
|
+
const[a,l]=pX(r)
|
|
15202
|
+
return mX(t,e,{type:"SET",path:[...n,s].map((t=>t.toString())),value:a},l).then(fX)},apply(i,s,r){sX(o)
|
|
15174
15203
|
const a=n[n.length-1]
|
|
15175
|
-
if(a===
|
|
15176
|
-
if("bind"===a)return
|
|
15177
|
-
const[l,c]=
|
|
15178
|
-
return
|
|
15179
|
-
const[r,a]=
|
|
15180
|
-
return
|
|
15181
|
-
return function(t,e){const n=(
|
|
15182
|
-
|
|
15204
|
+
if(a===YY)return mX(t,e,{type:"ENDPOINT"}).then(fX)
|
|
15205
|
+
if("bind"===a)return cX(t,e,n.slice(0,-1))
|
|
15206
|
+
const[l,c]=dX(r)
|
|
15207
|
+
return mX(t,e,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:l},c).then(fX)},construct(i,s){sX(o)
|
|
15208
|
+
const[r,a]=dX(s)
|
|
15209
|
+
return mX(t,e,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:r},a).then(fX)}})
|
|
15210
|
+
return function(t,e){const n=(aX.get(e)||0)+1
|
|
15211
|
+
aX.set(e,n),lX&&lX.register(t,e,t)}(s,t),s}function dX(t){const e=t.map(pX)
|
|
15183
15212
|
return[e.map((t=>t[0])),(n=e.map((t=>t[1])),Array.prototype.concat.apply([],n))]
|
|
15184
|
-
var n}const
|
|
15185
|
-
function
|
|
15186
|
-
return[{type:"HANDLER",name:e,value:i},o]}return[{type:"RAW",value:t},
|
|
15187
|
-
case"RAW":return t.value}}function
|
|
15188
|
-
e.set(s,o),t.start&&t.start(),t.postMessage(Object.assign({id:s},n),i)}))}let
|
|
15189
|
-
class hX{constructor(t){this.wafermap=t,this.minDieDim=100}async setupWafer(t){if(void 0===this.matrixRenderer){const{matrixRenderer:t}=await(async()=>{if(void 0===dX){const t=new Blob(['var MatrixRenderer = (function (exports) {\n \'use strict\';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol("Comlink.proxy");\n const createEndpoint = Symbol("Comlink.endpoint");\n const releaseProxy = Symbol("Comlink.releaseProxy");\n const finalizer = Symbol("Comlink.finalizer");\n const throwMarker = Symbol("Comlink.thrown");\n const isObject = (val) => (typeof val === "object" && val !== null) || typeof val === "function";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n ["proxy", proxyTransferHandler],\n ["throw", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === "*") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = ["*"]) {\n ep.addEventListener("message", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin \'${ev.origin}\' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case "GET" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case "SET" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case "APPLY" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case "CONSTRUCT" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case "ENDPOINT" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case "RELEASE" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === "RELEASE" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener("message", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === "function") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError("Unserializable return value"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === "MessagePort";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener("message", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error("Proxy has been released and is not useable");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: "RELEASE" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = "FinalizationRegistry" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === "then") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: "GET" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: "SET" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: "ENDPOINT" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === "bind") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "APPLY" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "CONSTRUCT" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: "HANDLER" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: "RAW" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case "HANDLER" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case "RAW" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join("-");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink\'s `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.colorIndices = Int32Array.from([]);\n this.colors = [];\n this.colorValues = Float64Array.from([]);\n this.outsideRangeDieColor = \'rgba(218,223,236,1)\';\n this.fontSizeFactor = 0.8;\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n gridMinX: 0,\n gridMaxX: 0,\n gridMinY: 0,\n gridMaxY: 0,\n labelsFontSize: 0,\n colorScale: [],\n dieLabelsSuffix: \'\',\n maxCharacters: 0\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n setMatrixData(columnIndices, rowIndices, valuesBuffer) {\n const scaledColumnIndex = [];\n const columnPositions = [];\n const scaledRowIndices = [];\n const values = [];\n const colorIndices = [];\n let prevXIndex;\n let dieCount = 0;\n for (let i = 0; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n const yIndex = rowIndices[i];\n if (this.isDieInGrid(xIndex, yIndex)) {\n if (xIndex !== prevXIndex) {\n scaledColumnIndex.push(this.calculateHorizontalScaledIndices(xIndex));\n columnPositions.push(dieCount);\n prevXIndex = xIndex;\n }\n scaledRowIndices.push(this.calculateVerticalScaledIndices(yIndex));\n const value = valuesBuffer[i];\n values.push(value);\n colorIndices.push(this.findColorIndex(value));\n dieCount += 1;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n this.scaledRowIndices = Float64Array.from(scaledRowIndices);\n this.values = Float64Array.from(values);\n this.colorIndices = Int32Array.from(colorIndices);\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n this.colors = renderConfig.colorScale.map(marker => marker.color);\n this.colorValues = Float64Array.from(renderConfig.colorScale.map(marker => marker.value));\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext(\'2d\');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = this.colors[this.colorIndices[columnStartIndex]]\n ?? this.outsideRangeDieColor;\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n drawText() {\n this.context.font = `${this.renderConfig.labelsFontSize.toString()}px sans-serif`;\n this.context.fillStyle = \'#ffffff\';\n this.context.textAlign = \'center\';\n this.context.lineCap = \'butt\';\n const approximateTextHeight = this.context.measureText(\'M\');\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n let label = `${this.values[columnStartIndex] || \'NaN\'}${this.renderConfig.dieLabelsSuffix}`;\n if (label.length >= this.renderConfig.maxCharacters) {\n label = `${label.substring(0, this.renderConfig.maxCharacters)}…`;\n }\n this.context.fillText(label, scaledX + this.renderConfig.dieDimensions.width / 2, scaledY\n + this.renderConfig.dieDimensions.height / 2\n + approximateTextHeight.width / 2, this.renderConfig.dieDimensions.width * this.fontSizeFactor);\n }\n }\n }\n isDieInGrid(x, y) {\n return (x >= this.renderConfig.gridMinX\n && x <= this.renderConfig.gridMaxX\n && y >= this.renderConfig.gridMinY\n && y <= this.renderConfig.gridMaxY);\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n findColorIndex(value) {\n let index = -1;\n if (this.colorValues.length === 0 || this.colorValues[0] >= value) {\n return index;\n }\n for (let i = 0; i < this.colorValues.length; i++) {\n if (value <= this.colorValues[i]) {\n index = i;\n break;\n }\n }\n return index;\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n'],{type:"text/javascript"})
|
|
15190
|
-
|
|
15213
|
+
var n}const hX=new WeakMap
|
|
15214
|
+
function uX(t,e){return hX.set(t,e),t}function pX(t){for(const[e,n]of eX)if(n.canHandle(t)){const[i,o]=n.serialize(t)
|
|
15215
|
+
return[{type:"HANDLER",name:e,value:i},o]}return[{type:"RAW",value:t},hX.get(t)||[]]}function fX(t){switch(t.type){case"HANDLER":return eX.get(t.name).deserialize(t.value)
|
|
15216
|
+
case"RAW":return t.value}}function mX(t,e,n,i){return new Promise((o=>{const s=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-")
|
|
15217
|
+
e.set(s,o),t.start&&t.start(),t.postMessage(Object.assign({id:s},n),i)}))}let gX
|
|
15218
|
+
class vX{constructor(t){this.wafermap=t,this.minDieDim=100}async setupWafer(t){if(void 0===this.matrixRenderer){const{matrixRenderer:t}=await(async()=>{if(void 0===gX){const t=new Blob(['var MatrixRenderer = (function (exports) {\n \'use strict\';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol("Comlink.proxy");\n const createEndpoint = Symbol("Comlink.endpoint");\n const releaseProxy = Symbol("Comlink.releaseProxy");\n const finalizer = Symbol("Comlink.finalizer");\n const throwMarker = Symbol("Comlink.thrown");\n const isObject = (val) => (typeof val === "object" && val !== null) || typeof val === "function";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n ["proxy", proxyTransferHandler],\n ["throw", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === "*") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = ["*"]) {\n ep.addEventListener("message", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin \'${ev.origin}\' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case "GET" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case "SET" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case "APPLY" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case "CONSTRUCT" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case "ENDPOINT" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case "RELEASE" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === "RELEASE" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener("message", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === "function") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError("Unserializable return value"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === "MessagePort";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener("message", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error("Proxy has been released and is not useable");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: "RELEASE" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = "FinalizationRegistry" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === "then") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: "GET" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: "SET" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: "ENDPOINT" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === "bind") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "APPLY" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "CONSTRUCT" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: "HANDLER" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: "RAW" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case "HANDLER" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case "RAW" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join("-");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink\'s `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.colorIndices = Int32Array.from([]);\n this.colors = [];\n this.colorValues = Float64Array.from([]);\n this.outsideRangeDieColor = \'rgba(218,223,236,1)\';\n this.fontSizeFactor = 0.8;\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n gridMinX: 0,\n gridMaxX: 0,\n gridMinY: 0,\n gridMaxY: 0,\n labelsFontSize: 0,\n colorScale: [],\n dieLabelsSuffix: \'\',\n maxCharacters: 0\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n setMatrixData(columnIndices, rowIndices, valuesBuffer) {\n const scaledColumnIndex = [];\n const columnPositions = [];\n const scaledRowIndices = [];\n const values = [];\n const colorIndices = [];\n let prevXIndex;\n let dieCount = 0;\n for (let i = 0; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n const yIndex = rowIndices[i];\n if (this.isDieInGrid(xIndex, yIndex)) {\n if (xIndex !== prevXIndex) {\n scaledColumnIndex.push(this.calculateHorizontalScaledIndices(xIndex));\n columnPositions.push(dieCount);\n prevXIndex = xIndex;\n }\n scaledRowIndices.push(this.calculateVerticalScaledIndices(yIndex));\n const value = valuesBuffer[i];\n values.push(value);\n colorIndices.push(this.findColorIndex(value));\n dieCount += 1;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n this.scaledRowIndices = Float64Array.from(scaledRowIndices);\n this.values = Float64Array.from(values);\n this.colorIndices = Int32Array.from(colorIndices);\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n this.colors = renderConfig.colorScale.map(marker => marker.color);\n this.colorValues = Float64Array.from(renderConfig.colorScale.map(marker => marker.value));\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext(\'2d\');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = this.colors[this.colorIndices[columnStartIndex]]\n ?? this.outsideRangeDieColor;\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n drawText() {\n this.context.font = `${this.renderConfig.labelsFontSize.toString()}px sans-serif`;\n this.context.fillStyle = \'#ffffff\';\n this.context.textAlign = \'center\';\n this.context.lineCap = \'butt\';\n const approximateTextHeight = this.context.measureText(\'M\');\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n let label = `${this.values[columnStartIndex] || \'NaN\'}${this.renderConfig.dieLabelsSuffix}`;\n if (label.length >= this.renderConfig.maxCharacters) {\n label = `${label.substring(0, this.renderConfig.maxCharacters)}…`;\n }\n this.context.fillText(label, scaledX + this.renderConfig.dieDimensions.width / 2, scaledY\n + this.renderConfig.dieDimensions.height / 2\n + approximateTextHeight.width / 2, this.renderConfig.dieDimensions.width * this.fontSizeFactor);\n }\n }\n }\n isDieInGrid(x, y) {\n return (x >= this.renderConfig.gridMinX\n && x <= this.renderConfig.gridMaxX\n && y >= this.renderConfig.gridMinY\n && y <= this.renderConfig.gridMaxY);\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n findColorIndex(value) {\n let index = -1;\n if (this.colorValues.length === 0 || this.colorValues[0] >= value) {\n return index;\n }\n for (let i = 0; i < this.colorValues.length; i++) {\n if (value <= this.colorValues[i]) {\n index = i;\n break;\n }\n }\n return index;\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n'],{type:"text/javascript"})
|
|
15219
|
+
gX=URL.createObjectURL(t)}const t=new Worker(gX),e=oX(t)
|
|
15191
15220
|
return{matrixRenderer:await new e,terminate:()=>t.terminate()}})()
|
|
15192
15221
|
this.matrixRenderer=t
|
|
15193
15222
|
const e=this.wafermap.workerCanvas.transferControlToOffscreen()
|
|
15194
|
-
await this.matrixRenderer.setCanvas(
|
|
15195
|
-
await this.matrixRenderer.setTransformConfig({transform:t.transform,topLeftCanvasCorner:{x:e[0]-t.dieDimensions.width,y:e[1]-t.dieDimensions.height},bottomRightCanvasCorner:{x:n[0],y:n[1]}}),await this.matrixRenderer.drawWafer(),!t.dieLabelsHidden&&t.dieDimensions&&t.dieDimensions.width*t.dieDimensions.height*(t.transform.k||1)>=this.minDieDim&&await this.matrixRenderer.drawText()}renderHover(){void 0!==this.wafermap.computations.dieDimensions&&void 0!==this.wafermap.transform&&(this.wafermap.hoverWidth=this.wafermap.computations.dieDimensions.width*this.wafermap.transform.k,this.wafermap.hoverHeight=this.wafermap.computations.dieDimensions.height*this.wafermap.transform.k,this.wafermap.hoverOpacity=void 0===this.wafermap.hoverDie?
|
|
15223
|
+
await this.matrixRenderer.setCanvas(uX(e,[e]))}await this.matrixRenderer.setCanvasDimensions(t.canvasDimensions),await this.matrixRenderer.setRenderConfig(t.renderConfig),await this.matrixRenderer.setMatrixData(t.columnIndices,t.rowIndices,t.values)}async drawWafer(t){const e=t.transform.invert([0,0]),n=t.transform.invert([t.canvasDimensions.width,t.canvasDimensions.height])
|
|
15224
|
+
await this.matrixRenderer.setTransformConfig({transform:t.transform,topLeftCanvasCorner:{x:e[0]-t.dieDimensions.width,y:e[1]-t.dieDimensions.height},bottomRightCanvasCorner:{x:n[0],y:n[1]}}),await this.matrixRenderer.drawWafer(),!t.dieLabelsHidden&&t.dieDimensions&&t.dieDimensions.width*t.dieDimensions.height*(t.transform.k||1)>=this.minDieDim&&await this.matrixRenderer.drawText()}renderHover(){void 0!==this.wafermap.computations.dieDimensions&&void 0!==this.wafermap.transform&&(this.wafermap.hoverWidth=this.wafermap.computations.dieDimensions.width*this.wafermap.transform.k,this.wafermap.hoverHeight=this.wafermap.computations.dieDimensions.height*this.wafermap.transform.k,this.wafermap.hoverOpacity=void 0===this.wafermap.hoverDie?PY:LY,this.wafermap.hoverTransform=this.calculateHoverTransform())}calculateHoverTransform(){if(void 0!==this.wafermap.hoverDie){const t=this.wafermap.computations.horizontalScale(this.wafermap.hoverDie.x)
|
|
15196
15225
|
if(void 0===t)return""
|
|
15197
15226
|
const e=this.wafermap.computations.verticalScale(this.wafermap.hoverDie.y)
|
|
15198
15227
|
if(void 0===e)return""
|
|
15199
15228
|
const n=this.wafermap.transform.apply([t+this.wafermap.computations.margin.left,e+this.wafermap.computations.margin.top])
|
|
15200
|
-
return`translate(${n[0]}, ${n[1]})`}return""}}let
|
|
15229
|
+
return`translate(${n[0]}, ${n[1]})`}return""}}let bX=class{constructor(t){this.wafermap=t,this.onMouseMove=t=>{if(this.wafermap.isExperimentalUpdate())return
|
|
15201
15230
|
const e={x:t.offsetX,y:t.offsetY}
|
|
15202
15231
|
if(!this.hoversOverDie(e))return void(this.wafermap.hoverDie=void 0)
|
|
15203
15232
|
const n=this.wafermap.transform.invert([e.x,e.y]),i=this.calculateDieCoordinates({x:n[0],y:n[1]})
|
|
15204
|
-
this.wafermap.hoverDie=void 0!==i?this.wafermap.dataManager.getWaferMapDie(i):void 0},this.onMouseOut=t=>{this.wafermap.hoverDie=void 0}}connect(){this.wafermap.addEventListener("mousemove",this.onMouseMove),this.wafermap.addEventListener("mouseout",this.onMouseOut)}disconnect(){this.wafermap.removeEventListener("mousemove",this.onMouseMove),this.wafermap.removeEventListener("mouseout",this.onMouseOut)}calculateDieCoordinates(t){if(!this.wafermap.isExperimentalUpdate()){const e=this.wafermap.originLocation,n=e
|
|
15233
|
+
this.wafermap.hoverDie=void 0!==i?this.wafermap.dataManager.getWaferMapDie(i):void 0},this.onMouseOut=t=>{this.wafermap.hoverDie=void 0}}connect(){this.wafermap.addEventListener("mousemove",this.onMouseMove),this.wafermap.addEventListener("mouseout",this.onMouseOut)}disconnect(){this.wafermap.removeEventListener("mousemove",this.onMouseMove),this.wafermap.removeEventListener("mouseout",this.onMouseOut)}calculateDieCoordinates(t){if(!this.wafermap.isExperimentalUpdate()){const e=this.wafermap.originLocation,n=e===RY||e===NY?Math.floor:Math.ceil,i=e===RY||e===FY?Math.floor:Math.ceil
|
|
15205
15234
|
return{x:n(this.wafermap.dataManager.invertedHorizontalScale(t.x-this.wafermap.dataManager.margin.left)),y:i(this.wafermap.dataManager.invertedVerticalScale(t.y-this.wafermap.dataManager.margin.top))}}}hoversOverDie(t){const e=this.wafermap.canvasContext.getImageData(t.x,t.y,1,1).data
|
|
15206
15235
|
let n=0
|
|
15207
15236
|
for(const t of e)n+=t
|
|
15208
15237
|
return n>0}}
|
|
15209
|
-
class
|
|
15238
|
+
class yX{constructor(t){this.wafermap=t,this.onMouseMove=t=>{if(!this.wafermap.isExperimentalUpdate())return
|
|
15210
15239
|
const e=this.wafermap.transform.invert([t.offsetX,t.offsetY]),n=this.calculateDieCoordinates({x:e[0],y:e[1]})
|
|
15211
15240
|
if(void 0===n||!this.isDieInGrid(n.x,n.y))return void(this.wafermap.hoverDie=void 0)
|
|
15212
15241
|
const i=this.wafermap.diesTable.getChild("colIndex").toArray(),o=this.wafermap.diesTable.getChild("rowIndex").toArray()
|
|
15213
15242
|
for(let t=0;t<i.length;t++)if(i[t]===n.x&&o[t]===n.y)return void(this.wafermap.hoverDie={index:t,x:n.x,y:n.y})
|
|
15214
|
-
this.wafermap.hoverDie=void 0},this.onMouseOut=t=>{this.wafermap.hoverDie=void 0}}connect(){this.wafermap.addEventListener("mousemove",this.onMouseMove),this.wafermap.addEventListener("mouseout",this.onMouseOut)}disconnect(){this.wafermap.removeEventListener("mousemove",this.onMouseMove),this.wafermap.removeEventListener("mouseout",this.onMouseOut)}calculateDieCoordinates(t){if(this.wafermap.isExperimentalUpdate()){const e=this.wafermap.originLocation,n=e
|
|
15215
|
-
return{x:n(this.wafermap.computations.horizontalScale.invert(t.x-this.wafermap.computations.margin.left)),y:i(this.wafermap.computations.verticalScale.invert(t.y-this.wafermap.computations.margin.top))}}}isDieInGrid(t,e){return t>=this.wafermap.computations.gridMinX&&t<=this.wafermap.computations.gridMaxX&&e>=this.wafermap.computations.gridMinY&&e<=this.wafermap.computations.gridMaxY}}class
|
|
15243
|
+
this.wafermap.hoverDie=void 0},this.onMouseOut=t=>{this.wafermap.hoverDie=void 0}}connect(){this.wafermap.addEventListener("mousemove",this.onMouseMove),this.wafermap.addEventListener("mouseout",this.onMouseOut)}disconnect(){this.wafermap.removeEventListener("mousemove",this.onMouseMove),this.wafermap.removeEventListener("mouseout",this.onMouseOut)}calculateDieCoordinates(t){if(this.wafermap.isExperimentalUpdate()){const e=this.wafermap.originLocation,n=e===RY||e===NY?Math.floor:Math.ceil,i=e===RY||e===FY?Math.ceil:Math.floor
|
|
15244
|
+
return{x:n(this.wafermap.computations.horizontalScale.invert(t.x-this.wafermap.computations.margin.left)),y:i(this.wafermap.computations.verticalScale.invert(t.y-this.wafermap.computations.margin.top))}}}isDieInGrid(t,e){return t>=this.wafermap.computations.gridMinX&&t<=this.wafermap.computations.gridMaxX&&e>=this.wafermap.computations.gridMinY&&e<=this.wafermap.computations.gridMaxY}}class wX{constructor(t){this.wafermap=t,this.scaleExtent=[1,100],this.minExtentPoint=[0,0],this.onWheelMove=t=>{t.preventDefault()},this.wafermapNotifier=x.getNotifier(this.wafermap),this.wafermapNotifier.subscribe(this,"canvasWidth"),this.wafermapNotifier.subscribe(this,"canvasHeight")}connect(){this.createZoomBehavior(),this.wafermap.addEventListener("wheel",this.onWheelMove,{passive:!1})}disconnect(){QH().on("zoom",null)(Dz(this.wafermap)),this.wafermap.removeEventListener("wheel",this.onWheelMove)}handleChange(t,e){t!==this.wafermap||"canvasWidth"!==e&&"canvasHeight"!==e||this.createZoomBehavior()}createZoomBehavior(){QH().scaleExtent(this.scaleExtent).translateExtent([this.minExtentPoint,[this.wafermap.canvasWidth,this.wafermap.canvasHeight]]).on("zoom",(t=>{this.wafermap.transform=t.transform}))(Dz(this.wafermap))}}class xX{get horizontalScale(){return this._horizontalScale}get verticalScale(){return this._verticalScale}get containerDimensions(){return this._containerDimensions}get dieDimensions(){return this._dieDimensions}get margin(){return this._margin}get verticalCoefficient(){return this._verticalCoefficient}get horizontalCoefficient(){return this._horizontalCoefficient}get horizontalConstant(){return this._horizontalConstant}get verticalConstant(){return this._verticalConstant}get gridMinX(){return this._gridMinX}get gridMaxX(){return this._gridMaxX}get gridMinY(){return this._gridMinY}get gridMaxY(){return this._gridMaxY}get labelsFontSize(){return this._labelsFontSize}get colorScale(){return this._colorScale}constructor(t){this.wafermap=t,this.baseMarginPercentage=.04,this.fontSizeFactor=.8,this.colorScaleResolution=10}componentResizeUpdate(){const t={width:this.wafermap.canvasWidth,height:this.wafermap.canvasHeight},e=Math.min(t.width,t.height),n={top:(t.height-e)/2,right:(t.width-e)/2,bottom:(t.height-e)/2,left:(t.width-e)/2},i={top:e*this.baseMarginPercentage,right:e*this.baseMarginPercentage,bottom:e*this.baseMarginPercentage,left:e*this.baseMarginPercentage}
|
|
15216
15245
|
this._margin=this.calculateMarginAddition(i,n),this._containerDimensions=this.calculateContainerDimensions(t,this.margin),this.inputDataUpdate()}inputDataUpdate(){if(void 0===this._containerDimensions)return void this.componentResizeUpdate()
|
|
15217
15246
|
const t=Math.min(this._containerDimensions.width,this._containerDimensions.height)
|
|
15218
15247
|
this.gridDimensionsValidAndDefined()?this.setGridDimensionsFromBoundingBox():this.setGridDimensionsFromDies()
|
|
@@ -15220,20 +15249,20 @@ const e=this.wafermap.originLocation
|
|
|
15220
15249
|
this._horizontalScale=this.createHorizontalScale(e,t),this._verticalScale=this.createVerticalScale(e,t),this._horizontalCoefficient=this._horizontalScale(1)-this._horizontalScale(0),this._verticalCoefficient=this._verticalScale(1)-this._verticalScale(0),this._horizontalConstant=this._horizontalScale(0),this._verticalConstant=this._verticalScale(0),this._dieDimensions={width:Math.abs(this._horizontalScale(0)-this._horizontalScale(1)),height:Math.abs(this._verticalScale(0)-this._verticalScale(1))},this.colorAndTextUpdate()}colorAndTextUpdate(){void 0!==this._dieDimensions?(this._labelsFontSize=this.calculateLabelsFontSize(this._dieDimensions,this.wafermap.maxCharacters),this._colorScale=this.calculateColorScale()):this.inputDataUpdate()}gridDimensionsValidAndDefined(){return!this.wafermap.validity.invalidGridDimensions&&"number"==typeof this.wafermap.gridMinX&&"number"==typeof this.wafermap.gridMinY&&"number"==typeof this.wafermap.gridMaxX&&"number"==typeof this.wafermap.gridMinX}setGridDimensionsFromBoundingBox(){this._gridMinX=this.wafermap.gridMinX,this._gridMinY=this.wafermap.gridMinY,this._gridMaxX=this.wafermap.gridMaxX,this._gridMaxY=this.wafermap.gridMaxY}setGridDimensionsFromDies(){if(void 0===this.wafermap.diesTable)return
|
|
15221
15250
|
const t=this.wafermap.diesTable.getChild("colIndex").toArray(),e=this.wafermap.diesTable.getChild("rowIndex").toArray(),n={x:t[0],y:e[0]},i={x:t[0],y:e[0]}
|
|
15222
15251
|
for(let o=0;o<t.length;o++)t[o]<n.x&&(n.x=t[o]),t[o]>i.x&&(i.x=t[o]),e[o]<n.y&&(n.y=e[o]),e[o]>i.y&&(i.y=e[o])
|
|
15223
|
-
this._gridMinX=n.x,this._gridMinY=n.y,this._gridMaxX=i.x,this._gridMaxY=i.y}calculateContainerDimensions(t,e){return{width:t.width-e.left-e.right,height:t.height-e.top-e.bottom}}createHorizontalScale(t,e){const n=
|
|
15224
|
-
return t
|
|
15225
|
-
return t
|
|
15252
|
+
this._gridMinX=n.x,this._gridMinY=n.y,this._gridMaxX=i.x,this._gridMaxY=i.y}calculateContainerDimensions(t,e){return{width:t.width-e.left-e.right,height:t.height-e.top-e.bottom}}createHorizontalScale(t,e){const n=OY()
|
|
15253
|
+
return t===RY||t===NY?n.domain([this._gridMinX,this._gridMaxX+1]).range([0,e]):n.domain([this._gridMinX-1,this._gridMaxX]).range([e,0])}createVerticalScale(t,e){const n=OY()
|
|
15254
|
+
return t===RY||t===FY?n.domain([this._gridMinY-1,this._gridMaxY]).range([e,0]):n.domain([this._gridMinY,this._gridMaxY+1]).range([0,e])}calculateMarginAddition(t,e){return{top:t.top+e.top,right:t.right+e.right,bottom:t.bottom+e.bottom,left:t.left+e.left}}calculateColorScale(){if(this.wafermap.colorScaleMode===zY){const t=this.wafermap.colorScale.values.map((t=>+t)),e=OY().domain(t).range(this.wafermap.colorScale.colors)
|
|
15226
15255
|
let n=t[0],i=t[0]
|
|
15227
15256
|
t.forEach((t=>{t<n&&(n=t),t>i&&(i=t)}))
|
|
15228
|
-
return
|
|
15257
|
+
return iY(n,i,(i-n)/(t.length*this.colorScaleResolution)).concat(i).map((t=>({color:e(t),value:t})))}return this.wafermap.colorScale.colors.map(((t,e)=>({color:t,value:+this.wafermap.colorScale.values[e]}))).sort(((t,e)=>t.value-e.value))}calculateLabelsFontSize(t,e){return Math.min(t.height,t.width/(.5*Math.max(2,e))*this.fontSizeFactor)}}class CX extends je{constructor(){super(...arguments),this.waferMapUpdateTracker=new GY(this.asRequiredFieldsWaferMap),this.originLocation=RY,this.gridMinX=void 0,this.gridMaxX=void 0,this.gridMinY=void 0,this.gridMaxY=void 0,this.orientation=BY,this.maxCharacters=4,this.dieLabelsHidden=!1,this.dieLabelsSuffix="",this.colorScaleMode=zY,this.computations=new xX(this.asRequiredFieldsWaferMap),this.dataManager=new qY(this.asRequiredFieldsWaferMap),this.workerRenderer=new vX(this.asRequiredFieldsWaferMap),this.renderer=new jY(this.asRequiredFieldsWaferMap),this.renderQueued=!1,this.transform=qH,this.hoverTransform="",this.hoverOpacity=PY,this.hoverWidth=0,this.hoverHeight=0,this.highlightedTags=[],this.dies=[],this.colorScale={colors:[],values:[]},this.hoverHandler=new bX(this.asRequiredFieldsWaferMap),this.experimentalHoverHandler=new yX(this.asRequiredFieldsWaferMap),this.zoomHandler=new wX(this.asRequiredFieldsWaferMap),this.resizeObserver=this.createResizeObserver(),this.waferMapValidator=new ZY(this.asRequiredFieldsWaferMap)}get validity(){return this.waferMapValidator.getValidity()}connectedCallback(){super.connectedCallback(),this.canvasContext=this.canvas.getContext("2d",{willReadFrequently:!0}),this.hoverHandler.connect(),this.experimentalHoverHandler.connect(),this.zoomHandler.connect(),this.resizeObserver.observe(this),this.waferMapUpdateTracker.trackAll()}disconnectedCallback(){super.disconnectedCallback(),this.hoverHandler.disconnect(),this.experimentalHoverHandler.disconnect(),this.zoomHandler.disconnect(),this.resizeObserver.unobserve(this)}async experimentalUpdate(){if(!this.validity.invalidDiesTableSchema){if(this.waferMapUpdateTracker.requiresEventsUpdate){this.waferMapUpdateTracker.requiresComponentResizeUpdate?this.computations.componentResizeUpdate():this.waferMapUpdateTracker.requiresInputDataUpdate?this.computations.inputDataUpdate():this.waferMapUpdateTracker.requiresColorAndTextUpdate&&this.computations.colorAndTextUpdate()
|
|
15229
15258
|
const t=this.createSnapshot()
|
|
15230
15259
|
this.waferMapUpdateTracker.requiresWorkerWaferSetup&&await this.workerRenderer.setupWafer(t),await this.workerRenderer.drawWafer(t)}this.workerRenderer.renderHover()}}update(){this.validate(),this.isExperimentalUpdate()?this.currentTask=this.experimentalUpdate():this.waferMapUpdateTracker.requiresEventsUpdate?this.waferMapUpdateTracker.requiresContainerDimensionsUpdate?(this.dataManager.updateContainerDimensions(),this.renderer.updateSortedDiesAndDrawWafer()):this.waferMapUpdateTracker.requiresScalesUpdate?(this.dataManager.updateScales(),this.renderer.updateSortedDiesAndDrawWafer()):this.waferMapUpdateTracker.requiresLabelsFontSizeUpdate?(this.dataManager.updateLabelsFontSize(),this.renderer.updateSortedDiesAndDrawWafer()):this.waferMapUpdateTracker.requiresDiesRenderInfoUpdate?(this.dataManager.updateDiesRenderInfo(),this.renderer.updateSortedDiesAndDrawWafer()):this.waferMapUpdateTracker.requiresDrawnWaferUpdate&&this.renderer.drawWafer():this.waferMapUpdateTracker.requiresRenderHoverUpdate&&this.renderer.renderHover()}isExperimentalUpdate(){return void 0!==this.diesTable}async setData(t){Array.isArray(t)?this.dies=t:this.diesTable=t,await b.nextUpdate(),void 0!==this.currentTask&&await this.currentTask}createSnapshot(){const t={width:this.canvasWidth??0,height:this.canvasHeight??0},e={dieDimensions:this.computations.dieDimensions,margin:this.computations.margin,verticalCoefficient:this.computations.verticalCoefficient,horizontalCoefficient:this.computations.horizontalCoefficient,horizontalConstant:this.computations.horizontalConstant,verticalConstant:this.computations.verticalConstant,gridMinX:this.computations.gridMinX,gridMaxX:this.computations.gridMaxX,gridMinY:this.computations.gridMinY,gridMaxY:this.computations.gridMaxY,labelsFontSize:this.computations.labelsFontSize,colorScale:this.computations.colorScale,dieLabelsSuffix:this.dieLabelsSuffix,maxCharacters:this.maxCharacters},n=this.computations.dieDimensions,i=this.transform,o=this.dieLabelsHidden
|
|
15231
15260
|
if(void 0===this.diesTable)return{canvasDimensions:t,renderConfig:e,dieDimensions:n,transform:i,dieLabelsHidden:o,columnIndices:Int32Array.from([]),rowIndices:Int32Array.from([]),values:Float64Array.from([])}
|
|
15232
15261
|
return{canvasDimensions:t,renderConfig:e,columnIndices:this.diesTable.getChild("colIndex").toArray(),rowIndices:this.diesTable.getChild("rowIndex").toArray(),values:this.diesTable.getChild("value").toArray(),dieDimensions:n,transform:i,dieLabelsHidden:o}}validate(){this.waferMapValidator.validateGridDimensions(),this.waferMapValidator.validateDiesTableSchema()}createResizeObserver(){return new ResizeObserver((t=>{const e=t[0]
|
|
15233
15262
|
if(void 0===e)return
|
|
15234
15263
|
const{height:n,width:i}=e.contentRect
|
|
15235
|
-
this.canvas.width=i,this.canvas.height=n,this.canvasWidth=i,this.canvasHeight=n}))}originLocationChanged(){this.waferMapUpdateTracker.track("originLocation"),this.waferMapUpdateTracker.queueUpdate()}gridMinXChanged(){this.waferMapUpdateTracker.track("gridMinX"),this.waferMapUpdateTracker.queueUpdate()}gridMaxXChanged(){this.waferMapUpdateTracker.track("gridMaxX"),this.waferMapUpdateTracker.queueUpdate()}gridMinYChanged(){this.waferMapUpdateTracker.track("gridMinY"),this.waferMapUpdateTracker.queueUpdate()}gridMaxYChanged(){this.waferMapUpdateTracker.track("gridMaxY"),this.waferMapUpdateTracker.queueUpdate()}maxCharactersChanged(){this.waferMapUpdateTracker.track("maxCharacters"),this.waferMapUpdateTracker.queueUpdate()}dieLabelsHiddenChanged(){this.waferMapUpdateTracker.track("dieLabelsHidden"),this.waferMapUpdateTracker.queueUpdate()}dieLabelsSuffixChanged(){this.waferMapUpdateTracker.track("dieLabelsSuffix"),this.waferMapUpdateTracker.queueUpdate()}colorScaleModeChanged(){this.waferMapUpdateTracker.track("colorScaleMode"),this.waferMapUpdateTracker.queueUpdate()}highlightedTagsChanged(){this.waferMapUpdateTracker.track("highlightedTags"),this.waferMapUpdateTracker.queueUpdate()}diesChanged(){this.waferMapUpdateTracker.track("dies"),this.waferMapUpdateTracker.queueUpdate()}diesTableChanged(){this.waferMapUpdateTracker.track("dies"),this.waferMapUpdateTracker.queueUpdate()}colorScaleChanged(){this.waferMapUpdateTracker.track("colorScale"),this.waferMapUpdateTracker.queueUpdate()}transformChanged(){this.waferMapUpdateTracker.track("transform"),this.waferMapUpdateTracker.queueUpdate()}canvasWidthChanged(){this.waferMapUpdateTracker.track("canvasWidth"),this.waferMapUpdateTracker.queueUpdate()}canvasHeightChanged(){this.waferMapUpdateTracker.track("canvasHeight"),this.waferMapUpdateTracker.queueUpdate()}hoverDieChanged(){this.$emit("die-hover",{currentDie:this.hoverDie}),this.waferMapUpdateTracker.track("hoverDie"),this.waferMapUpdateTracker.queueUpdate()}get asRequiredFieldsWaferMap(){return this}}
|
|
15236
|
-
return rU(n)?n.then((e=>t(e))):n.isAsync()?n.readAll().then((t=>new
|
|
15237
|
-
const
|
|
15238
|
-
Ei.getOrCreate().withPrefix("nimble").register(
|
|
15264
|
+
this.canvas.width=i,this.canvas.height=n,this.canvasWidth=i,this.canvasHeight=n}))}originLocationChanged(){this.waferMapUpdateTracker.track("originLocation"),this.waferMapUpdateTracker.queueUpdate()}gridMinXChanged(){this.waferMapUpdateTracker.track("gridMinX"),this.waferMapUpdateTracker.queueUpdate()}gridMaxXChanged(){this.waferMapUpdateTracker.track("gridMaxX"),this.waferMapUpdateTracker.queueUpdate()}gridMinYChanged(){this.waferMapUpdateTracker.track("gridMinY"),this.waferMapUpdateTracker.queueUpdate()}gridMaxYChanged(){this.waferMapUpdateTracker.track("gridMaxY"),this.waferMapUpdateTracker.queueUpdate()}maxCharactersChanged(){this.waferMapUpdateTracker.track("maxCharacters"),this.waferMapUpdateTracker.queueUpdate()}dieLabelsHiddenChanged(){this.waferMapUpdateTracker.track("dieLabelsHidden"),this.waferMapUpdateTracker.queueUpdate()}dieLabelsSuffixChanged(){this.waferMapUpdateTracker.track("dieLabelsSuffix"),this.waferMapUpdateTracker.queueUpdate()}colorScaleModeChanged(){this.waferMapUpdateTracker.track("colorScaleMode"),this.waferMapUpdateTracker.queueUpdate()}highlightedTagsChanged(){this.waferMapUpdateTracker.track("highlightedTags"),this.waferMapUpdateTracker.queueUpdate()}diesChanged(){this.waferMapUpdateTracker.track("dies"),this.waferMapUpdateTracker.queueUpdate()}diesTableChanged(){this.waferMapUpdateTracker.track("dies"),this.waferMapUpdateTracker.queueUpdate()}colorScaleChanged(){this.waferMapUpdateTracker.track("colorScale"),this.waferMapUpdateTracker.queueUpdate()}transformChanged(){this.waferMapUpdateTracker.track("transform"),this.waferMapUpdateTracker.queueUpdate()}canvasWidthChanged(){this.waferMapUpdateTracker.track("canvasWidth"),this.waferMapUpdateTracker.queueUpdate()}canvasHeightChanged(){this.waferMapUpdateTracker.track("canvasHeight"),this.waferMapUpdateTracker.queueUpdate()}hoverDieChanged(){this.$emit("die-hover",{currentDie:this.hoverDie}),this.waferMapUpdateTracker.track("hoverDie"),this.waferMapUpdateTracker.queueUpdate()}get asRequiredFieldsWaferMap(){return this}}CX.Arrow={tableFromIPC:function t(e){const n=IK.from(e)
|
|
15265
|
+
return rU(n)?n.then((e=>t(e))):n.isAsync()?n.readAll().then((t=>new sK(t))):new sK(n.readAll())}},t([ft({attribute:"origin-location"})],CX.prototype,"originLocation",void 0),t([ft({attribute:"grid-min-x",converter:ut})],CX.prototype,"gridMinX",void 0),t([ft({attribute:"grid-max-x",converter:ut})],CX.prototype,"gridMaxX",void 0),t([ft({attribute:"grid-min-y",converter:ut})],CX.prototype,"gridMinY",void 0),t([ft({attribute:"grid-max-y",converter:ut})],CX.prototype,"gridMaxY",void 0),t([ft],CX.prototype,"orientation",void 0),t([ft({attribute:"max-characters",converter:ut})],CX.prototype,"maxCharacters",void 0),t([ft({attribute:"die-labels-hidden",mode:"boolean"})],CX.prototype,"dieLabelsHidden",void 0),t([ft({attribute:"die-labels-suffix"})],CX.prototype,"dieLabelsSuffix",void 0),t([ft({attribute:"color-scale-mode"})],CX.prototype,"colorScaleMode",void 0),t([C],CX.prototype,"renderer",void 0),t([C],CX.prototype,"canvasWidth",void 0),t([C],CX.prototype,"canvasHeight",void 0),t([C],CX.prototype,"transform",void 0),t([C],CX.prototype,"hoverTransform",void 0),t([C],CX.prototype,"hoverOpacity",void 0),t([C],CX.prototype,"hoverWidth",void 0),t([C],CX.prototype,"hoverHeight",void 0),t([C],CX.prototype,"hoverDie",void 0),t([C],CX.prototype,"highlightedTags",void 0),t([C],CX.prototype,"dies",void 0),t([C],CX.prototype,"diesTable",void 0),t([C],CX.prototype,"colorScale",void 0)
|
|
15266
|
+
const kX=CX.compose({baseName:"wafer-map",template:zK,styles:VK})
|
|
15267
|
+
Ei.getOrCreate().withPrefix("nimble").register(kX())}()
|
|
15239
15268
|
//# sourceMappingURL=all-components-bundle.min.js.map
|