@antv/layout 1.1.0 → 1.2.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.
Files changed (144) hide show
  1. package/README.md +4 -2
  2. package/dist/11.index.min.js +2 -0
  3. package/dist/11.index.min.js.map +1 -0
  4. package/dist/435.index.min.js +3 -0
  5. package/dist/435.index.min.js.LICENSE.txt +5 -0
  6. package/dist/435.index.min.js.map +1 -0
  7. package/dist/index.min.js +2 -1
  8. package/dist/index.min.js.LICENSE.txt +5 -0
  9. package/dist/index.min.js.map +1 -1
  10. package/lib/circular.js +258 -0
  11. package/lib/circular.js.map +1 -0
  12. package/lib/concentric.js +221 -0
  13. package/lib/concentric.js.map +1 -0
  14. package/lib/d3Force/forceInBox.d.ts +5 -5
  15. package/lib/d3Force/forceInBox.js +331 -0
  16. package/lib/d3Force/forceInBox.js.map +1 -0
  17. package/lib/d3Force/index.js +339 -0
  18. package/lib/d3Force/index.js.map +1 -0
  19. package/lib/dagre/acyclic.js +62 -0
  20. package/lib/dagre/acyclic.js.map +1 -0
  21. package/lib/dagre/add-border-segments.js +37 -0
  22. package/lib/dagre/add-border-segments.js.map +1 -0
  23. package/lib/dagre/coordinate-system.js +65 -0
  24. package/lib/dagre/coordinate-system.js.map +1 -0
  25. package/lib/dagre/data/list.js +50 -0
  26. package/lib/dagre/data/list.js.map +1 -0
  27. package/lib/dagre/greedy-fas.js +147 -0
  28. package/lib/dagre/greedy-fas.js.map +1 -0
  29. package/lib/dagre/layout.js +468 -0
  30. package/lib/dagre/layout.js.map +1 -0
  31. package/lib/dagre/nesting-graph.js +153 -0
  32. package/lib/dagre/nesting-graph.js.map +1 -0
  33. package/lib/dagre/normalize.js +98 -0
  34. package/lib/dagre/normalize.js.map +1 -0
  35. package/lib/dagre/order/add-subgraph-constraints.js +41 -0
  36. package/lib/dagre/order/add-subgraph-constraints.js.map +1 -0
  37. package/lib/dagre/order/barycenter.js +23 -0
  38. package/lib/dagre/order/barycenter.js.map +1 -0
  39. package/lib/dagre/order/build-layer-graph.js +96 -0
  40. package/lib/dagre/order/build-layer-graph.js.map +1 -0
  41. package/lib/dagre/order/cross-count.js +63 -0
  42. package/lib/dagre/order/cross-count.js.map +1 -0
  43. package/lib/dagre/order/index.js +91 -0
  44. package/lib/dagre/order/index.js.map +1 -0
  45. package/lib/dagre/order/init-data-order.js +28 -0
  46. package/lib/dagre/order/init-data-order.js.map +1 -0
  47. package/lib/dagre/order/init-order.js +50 -0
  48. package/lib/dagre/order/init-order.js.map +1 -0
  49. package/lib/dagre/order/resolve-conflicts.js +121 -0
  50. package/lib/dagre/order/resolve-conflicts.js.map +1 -0
  51. package/lib/dagre/order/sort-subgraph.js +84 -0
  52. package/lib/dagre/order/sort-subgraph.js.map +1 -0
  53. package/lib/dagre/order/sort.js +74 -0
  54. package/lib/dagre/order/sort.js.map +1 -0
  55. package/lib/dagre/parent-dummy-chains.js +80 -0
  56. package/lib/dagre/parent-dummy-chains.js.map +1 -0
  57. package/lib/dagre/position/bk.js +398 -0
  58. package/lib/dagre/position/bk.js.map +1 -0
  59. package/lib/dagre/position/index.js +54 -0
  60. package/lib/dagre/position/index.js.map +1 -0
  61. package/lib/dagre/rank/feasible-tree.d.ts +2 -2
  62. package/lib/dagre/rank/feasible-tree.js +164 -0
  63. package/lib/dagre/rank/feasible-tree.js.map +1 -0
  64. package/lib/dagre/rank/index.js +48 -0
  65. package/lib/dagre/rank/index.js.map +1 -0
  66. package/lib/dagre/rank/network-simplex.js +232 -0
  67. package/lib/dagre/rank/network-simplex.js.map +1 -0
  68. package/lib/dagre/rank/util.js +138 -0
  69. package/lib/dagre/rank/util.js.map +1 -0
  70. package/lib/dagre/util.js +289 -0
  71. package/lib/dagre/util.js.map +1 -0
  72. package/lib/dagre.d.ts +1 -2
  73. package/lib/dagre.js +543 -0
  74. package/lib/dagre.js.map +1 -0
  75. package/lib/force/forceNBody.d.ts +1 -1
  76. package/lib/force/forceNBody.js +103 -0
  77. package/lib/force/forceNBody.js.map +1 -0
  78. package/lib/force/index.d.ts +1 -1
  79. package/lib/force/index.js +797 -0
  80. package/lib/force/index.js.map +1 -0
  81. package/lib/force/types.d.ts +1 -0
  82. package/lib/force/types.js +2 -0
  83. package/lib/force/types.js.map +1 -0
  84. package/lib/forceAtlas2/body.js +91 -0
  85. package/lib/forceAtlas2/body.js.map +1 -0
  86. package/lib/forceAtlas2/index.js +562 -0
  87. package/lib/forceAtlas2/index.js.map +1 -0
  88. package/lib/forceAtlas2/quad.js +98 -0
  89. package/lib/forceAtlas2/quad.js.map +1 -0
  90. package/lib/forceAtlas2/quadTree.js +105 -0
  91. package/lib/forceAtlas2/quadTree.js.map +1 -0
  92. package/lib/fruchterman.js +376 -0
  93. package/lib/fruchterman.js.map +1 -0
  94. package/lib/grid.js +308 -0
  95. package/lib/grid.js.map +1 -0
  96. package/lib/index.js +16 -0
  97. package/lib/index.js.map +1 -0
  98. package/lib/mds.js +137 -0
  99. package/lib/mds.js.map +1 -0
  100. package/lib/radial/index.js +355 -0
  101. package/lib/radial/index.js.map +1 -0
  102. package/lib/radial/mds.js +29 -0
  103. package/lib/radial/mds.js.map +1 -0
  104. package/lib/radial/radial-nonoverlap-force.js +100 -0
  105. package/lib/radial/radial-nonoverlap-force.js.map +1 -0
  106. package/lib/random.js +98 -0
  107. package/lib/random.js.map +1 -0
  108. package/lib/registry.d.ts +0 -1
  109. package/lib/registry.js +25 -0
  110. package/lib/registry.js.map +1 -0
  111. package/lib/supervisor.js +95 -0
  112. package/lib/supervisor.js.map +1 -0
  113. package/lib/types.d.ts +6 -1
  114. package/lib/types.js +4 -0
  115. package/lib/types.js.map +1 -0
  116. package/lib/util/array.js +2 -0
  117. package/lib/util/array.js.map +1 -0
  118. package/lib/util/common.d.ts +12 -0
  119. package/lib/util/common.js +32 -0
  120. package/lib/util/common.js.map +1 -0
  121. package/lib/util/function.js +124 -0
  122. package/lib/util/function.js.map +1 -0
  123. package/lib/util/gpu.js +214 -0
  124. package/lib/util/gpu.js.map +1 -0
  125. package/lib/util/index.js +7 -0
  126. package/lib/util/index.js.map +1 -0
  127. package/lib/util/math.js +228 -0
  128. package/lib/util/math.js.map +1 -0
  129. package/lib/util/number.js +5 -0
  130. package/lib/util/number.js.map +1 -0
  131. package/lib/util/object.js +42 -0
  132. package/lib/util/object.js.map +1 -0
  133. package/lib/util/string.js +15 -0
  134. package/lib/util/string.js.map +1 -0
  135. package/lib/worker.d.ts +1 -3
  136. package/lib/worker.js +45 -0
  137. package/lib/worker.js.map +1 -0
  138. package/package.json +7 -8
  139. package/dist/1cc71e9bd9f41f57364d.worker.js +0 -2
  140. package/dist/1cc71e9bd9f41f57364d.worker.js.map +0 -1
  141. package/esm/1cc71e9bd9f41f57364d.worker.js +0 -2
  142. package/esm/1cc71e9bd9f41f57364d.worker.js.map +0 -1
  143. package/esm/index.esm.js +0 -2
  144. package/esm/index.esm.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ /*! For license information please see 435.index.min.js.LICENSE.txt */
2
+ (this.webpackChunkLayout=this.webpackChunkLayout||[]).push([[435],{3275:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(){function t(){this._events={}}return t.prototype.on=function(t,e,r){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!r}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var s=this._events[t]||[],o=this._events["*"]||[],i=function(n){for(var s=n.length,o=0;o<s;o++)if(n[o]){var i=n[o],h=i.callback;i.once&&(n.splice(o,1),0===n.length&&delete e._events[t],s--,o--),h.apply(e,r)}};i(s),i(o)},t.prototype.off=function(t,e){if(t)if(e){for(var r=this._events[t]||[],n=r.length,s=0;s<n;s++)r[s].callback===e&&(r.splice(s,1),n--,s--);0===r.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}()},2971:(t,e,r)=>{"use strict";r.d(e,{k:()=>o});var n=r(3275),s=r(7940);class o extends n.Z{nodeMap=new Map;edgeMap=new Map;inEdgesMap=new Map;outEdgesMap=new Map;bothEdgesMap=new Map;treeIndices=new Map;changes=[];batchCount=0;onChanged=()=>{};constructor(t){super(),t&&(t.nodes&&this.addNodes(t.nodes),t.edges&&this.addEdges(t.edges),t.tree&&this.addTree(t.tree),t.onChanged&&(this.onChanged=t.onChanged))}batch=t=>{this.batchCount+=1,t(),this.batchCount-=1,this.batchCount||this.commit()};commit(){const t=this.changes;this.changes=[];const e={graph:this,changes:t};this.emit("changed",e),this.onChanged(e)}reduceChanges(t){let e=[];return t.forEach((t=>{switch(t.type){case"NodeRemoved":{let r=!1;e=e.filter((e=>{if("NodeAdded"===e.type){const n=e.value.id===t.value.id;return n&&(r=!0),!n}return"NodeDataUpdated"===e.type?e.id!==t.value.id:"TreeStructureChanged"!==e.type||e.nodeId!==t.value.id})),r||e.push(t);break}case"EdgeRemoved":{let r=!1;e=e.filter((e=>{if("EdgeAdded"===e.type){const n=e.value.id===t.value.id;return n&&(r=!0),!n}return"EdgeDataUpdated"!==e.type&&"EdgeUpdated"!==e.type||e.id!==t.value.id})),r||e.push(t);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const r=e.find((e=>e.type===t.type&&e.id===t.id&&e.propertyName===t.propertyName));r?r.newValue=t.newValue:e.push(t);break}case"TreeStructureDetached":e=e.filter((e=>"TreeStructureAttached"===e.type?e.treeKey!==t.treeKey:"TreeStructureChanged"!==e.type||e.treeKey!==t.treeKey)),e.push(t);break;case"TreeStructureChanged":{const r=e.find((e=>"TreeStructureChanged"===e.type&&e.treeKey===t.treeKey&&e.nodeId===t.nodeId));r?r.newParentId=t.newParentId:e.push(t);break}default:e.push(t)}})),e}checkNodeExistence(t){this.getNode(t)}hasNode(t){return this.nodeMap.has(t)}areNeighbors(t,e){return this.getNeighbors(e).some((e=>e.id===t))}getNode(t){const e=this.nodeMap.get(t);if(!e)throw new Error("Node not found for id: "+t);return e}getRelatedEdges(t,e){if(this.checkNodeExistence(t),"in"===e){const e=this.inEdgesMap.get(t);return Array.from(e)}if("out"===e){const e=this.outEdgesMap.get(t);return Array.from(e)}{const e=this.bothEdgesMap.get(t);return Array.from(e)}}getDegree(t,e){return this.getRelatedEdges(t,e).length}getSuccessors(t){const e=this.getRelatedEdges(t,"out").map((t=>this.getNode(t.target)));return Array.from(new Set(e))}getPredecessors(t){const e=this.getRelatedEdges(t,"in").map((t=>this.getNode(t.source)));return Array.from(new Set(e))}getNeighbors(t){const e=this.getPredecessors(t),r=this.getSuccessors(t);return Array.from(new Set([...e,...r]))}doAddNode(t){if(this.hasNode(t.id))throw new Error("Node already exists: "+t.id);this.nodeMap.set(t.id,t),this.inEdgesMap.set(t.id,new Set),this.outEdgesMap.set(t.id,new Set),this.bothEdgesMap.set(t.id,new Set),this.treeIndices.forEach((e=>{e.childrenMap.set(t.id,new Set)})),this.changes.push({type:"NodeAdded",value:t})}addNodes(t){this.batch((()=>{for(const e of t)this.doAddNode(e)}))}addNode(t){this.addNodes([t])}doRemoveNode(t){const e=this.getNode(t),r=this.bothEdgesMap.get(t);r?.forEach((t=>this.doRemoveEdge(t.id))),this.nodeMap.delete(t),this.treeIndices.forEach((e=>{e.childrenMap.get(t)?.forEach((t=>{e.parentMap.delete(t.id)})),e.parentMap.delete(t),e.childrenMap.delete(t)})),this.changes.push({type:"NodeRemoved",value:e})}removeNodes(t){this.batch((()=>{t.forEach((t=>this.doRemoveNode(t)))}))}removeNode(t){this.removeNodes([t])}updateNodeDataProperty(t,e,r){const n=this.getNode(t);this.batch((()=>{const s=n.data[e],o=r;n.data[e]=o,this.changes.push({type:"NodeDataUpdated",id:t,propertyName:e,oldValue:s,newValue:o})}))}mergeNodeData(t,e){this.batch((()=>{Object.entries(e).forEach((([e,r])=>{this.updateNodeDataProperty(t,e,r)}))}))}updateNodeData(...t){const e=t[0],r=this.getNode(e);if("string"==typeof t[1])return void this.updateNodeDataProperty(e,t[1],t[2]);let n;if("function"==typeof t[1]){const e=t[1];n=e(r.data)}else"object"==typeof t[1]&&(n=t[1]);this.batch((()=>{const t=r.data,s=n;r.data=n,this.changes.push({type:"NodeDataUpdated",id:e,oldValue:t,newValue:s})}))}checkEdgeExistence(t){if(!this.hasEdge(t))throw new Error("Edge not found for id: "+t)}hasEdge(t){return this.edgeMap.has(t)}getEdge(t){return this.checkEdgeExistence(t),this.edgeMap.get(t)}getEdgeDetail(t){const e=this.getEdge(t);return{edge:e,source:this.getNode(e.source),target:this.getNode(e.target)}}doAddEdge(t){if(this.hasEdge(t.id))throw new Error("Edge already exists: "+t.id);this.checkNodeExistence(t.source),this.checkNodeExistence(t.target),this.edgeMap.set(t.id,t);const e=this.inEdgesMap.get(t.target),r=this.outEdgesMap.get(t.source),n=this.bothEdgesMap.get(t.source),s=this.bothEdgesMap.get(t.target);e.add(t),r.add(t),n.add(t),s.add(t),this.changes.push({type:"EdgeAdded",value:t})}addEdges(t){this.batch((()=>{for(const e of t)this.doAddEdge(e)}))}addEdge(t){this.addEdges([t])}doRemoveEdge(t){const e=this.getEdge(t),r=this.outEdgesMap.get(e.source),n=this.inEdgesMap.get(e.target),s=this.bothEdgesMap.get(e.source),o=this.bothEdgesMap.get(e.target);r.delete(e),n.delete(e),s.delete(e),o.delete(e),this.edgeMap.delete(t),this.changes.push({type:"EdgeRemoved",value:e})}removeEdges(t){this.batch((()=>{t.forEach((t=>this.doRemoveEdge(t)))}))}removeEdge(t){this.removeEdges([t])}updateEdgeSource(t,e){const r=this.getEdge(t);this.checkNodeExistence(e);const n=r.source,s=e;this.outEdgesMap.get(n).delete(r),this.bothEdgesMap.get(n).delete(r),this.outEdgesMap.get(s).add(r),this.bothEdgesMap.get(s).add(r),r.source=e,this.batch((()=>{this.changes.push({type:"EdgeUpdated",id:t,propertyName:"source",oldValue:n,newValue:s})}))}updateEdgeTarget(t,e){const r=this.getEdge(t);this.checkNodeExistence(e);const n=r.target,s=e;this.inEdgesMap.get(n).delete(r),this.bothEdgesMap.get(n).delete(r),this.inEdgesMap.get(s).add(r),this.bothEdgesMap.get(s).add(r),r.target=e,this.batch((()=>{this.changes.push({type:"EdgeUpdated",id:t,propertyName:"target",oldValue:n,newValue:s})}))}updateEdgeDataProperty(t,e,r){const n=this.getEdge(t);this.batch((()=>{const s=n.data[e],o=r;n.data[e]=o,this.changes.push({type:"EdgeDataUpdated",id:t,propertyName:e,oldValue:s,newValue:o})}))}updateEdgeData(...t){const e=t[0],r=this.getEdge(e);if("string"==typeof t[1])return void this.updateEdgeDataProperty(e,t[1],t[2]);let n;if("function"==typeof t[1]){const e=t[1];n=e(r.data)}else"object"==typeof t[1]&&(n=t[1]);this.batch((()=>{const t=r.data,s=n;r.data=n,this.changes.push({type:"EdgeDataUpdated",id:e,oldValue:t,newValue:s})}))}mergeEdgeData(t,e){this.batch((()=>{Object.entries(e).forEach((([e,r])=>{this.updateEdgeDataProperty(t,e,r)}))}))}checkTreeExistence(t){if(!this.hasTreeStructure(t))throw new Error("Tree structure not found for treeKey: "+t)}hasTreeStructure(t){return this.treeIndices.has(t)}attachTreeStructure(t){this.treeIndices.has(t)||(this.treeIndices.set(t,{parentMap:new Map,childrenMap:new Map}),this.batch((()=>{this.changes.push({type:"TreeStructureAttached",treeKey:t})})))}detachTreeStructure(t){this.checkTreeExistence(t),this.treeIndices.delete(t),this.batch((()=>{this.changes.push({type:"TreeStructureDetached",treeKey:t})}))}addTree(t,e){this.batch((()=>{this.attachTreeStructure(e);const r=[],n=Array.isArray(t)?t:[t];for(;n.length;){const t=n.shift();r.push(t),t.children&&n.push(...t.children)}this.addNodes(r),r.forEach((t=>{t.children?.forEach((r=>{this.setParent(r.id,t.id,e)}))}))}))}getRoots(t){return this.checkTreeExistence(t),this.getAllNodes().filter((e=>!this.getParent(e.id,t)))}getChildren(t,e){this.checkNodeExistence(t),this.checkTreeExistence(e);const r=this.treeIndices.get(e).childrenMap.get(t);return Array.from(r||[])}getParent(t,e){return this.checkNodeExistence(t),this.checkTreeExistence(e),this.treeIndices.get(e).parentMap.get(t)||null}getAncestors(t,e){const r=[];let n,s=this.getNode(t);for(;n=this.getParent(s.id,e);)r.push(n),s=n;return r}setParent(t,e,r){this.checkTreeExistence(r);const n=this.treeIndices.get(r),s=this.getNode(t),o=n.parentMap.get(t),i=this.getNode(e);n.parentMap.set(t,i),o&&n.childrenMap.get(o.id)?.delete(s);let h=n.childrenMap.get(i.id);h||(h=new Set,n.childrenMap.set(i.id,h)),h.add(s),this.batch((()=>{this.changes.push({type:"TreeStructureChanged",treeKey:r,nodeId:t,oldParentId:o?.id,newParentId:i.id})}))}dfsTree(t,e,r){return(0,s.I)(this.getNode(t),new Set,e,(t=>this.getChildren(t,r)))}bfsTree(t,e,r){return(0,s.O)([this.getNode(t)],new Set,e,(t=>this.getChildren(t,r)))}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(t,e,r="out"){const n={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];return(0,s.O)([this.getNode(t)],new Set,e,n)}dfs(t,e,r="out"){const n={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];return(0,s.I)(this.getNode(t),new Set,e,n)}clone(){const t=this.getAllNodes().map((t=>({...t,data:{...t.data}}))),e=this.getAllEdges().map((t=>({...t,data:{...t.data}}))),r=new o({nodes:t,edges:e});return this.treeIndices.forEach((({parentMap:t,childrenMap:e},n)=>{const s=new Map;t.forEach(((t,e)=>{s.set(e,r.getNode(t.id))}));const o=new Map;e.forEach(((t,e)=>{o.set(e,new Set(Array.from(t).map((t=>r.getNode(t.id)))))})),r.treeIndices.set(n,{parentMap:s,childrenMap:o})})),r}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}}},7940:(t,e,r)=>{"use strict";function n(t,e,r,n){for(;t.length;){const s=t.shift();if(r(s))return!0;e.add(s.id),n(s.id).forEach((r=>{e.has(r.id)||(e.add(r.id),t.push(r))}))}return!1}function s(t,e,r,n){if(r(t))return!0;e.add(t.id);for(const o of n(t.id))if(!e.has(o.id)&&s(o,e,r,n))return!0;return!1}r.d(e,{O:()=>n,I:()=>s})},9283:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(1551),s=function(t){if("object"!=typeof t||null===t)return t;var e;if((0,n.Z)(t)){e=[];for(var r=0,o=t.length;r<o;r++)"object"==typeof t[r]&&null!=t[r]?e[r]=s(t[r]):e[r]=t[r]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=s(t[i]):e[i]=t[i];return e};const o=s},1551:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(9340);const s=function(t){return Array.isArray?Array.isArray(t):(0,n.Z)(t,"Array")}},7481:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"function"==typeof t}},4428:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return null==t}},7749:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(9340);const s=function(t){return(0,n.Z)(t,"Number")}},9634:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}},6485:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(9340);const s=function(t){return(0,n.Z)(t,"String")}},9340:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n={}.toString;const s=function(t,e){return n.call(t)==="[object "+e+"]"}},2786:(t,e,r)=>{"use strict";r.d(e,{Jj:()=>l});const n=Symbol("Comlink.proxy"),s=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),i=Symbol("Comlink.finalizer"),h=Symbol("Comlink.thrown"),u=t=>"object"==typeof t&&null!==t||"function"==typeof t,a=new Map([["proxy",{canHandle:t=>u(t)&&t[n],serialize(t){const{port1:e,port2:r}=new MessageChannel;return l(t,e),[r,[r]]},deserialize:t=>(t.start(),w(t,[],undefined))}],["throw",{canHandle:t=>u(t)&&h in t,serialize({value:t}){let e;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);throw t.value}}]]);function l(t,e=globalThis,r=["*"]){e.addEventListener("message",(function s(o){if(!o||!o.data)return;if(!function(t,e){for(const r of t){if(e===r||"*"===r)return!0;if(r instanceof RegExp&&r.test(e))return!0}return!1}(r,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);const{id:u,type:a,path:f}=Object.assign({path:[]},o.data),d=(o.data.argumentList||[]).map(b);let g;try{const e=f.slice(0,-1).reduce(((t,e)=>t[e]),t),r=f.reduce(((t,e)=>t[e]),t);switch(a){case"GET":g=r;break;case"SET":e[f.slice(-1)[0]]=b(o.data.value),g=!0;break;case"APPLY":g=r.apply(e,d);break;case"CONSTRUCT":g=function(t){return Object.assign(t,{[n]:!0})}(new r(...d));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;l(t,r),g=function(t,e){return y.set(t,e),t}(e,[e])}break;case"RELEASE":g=void 0;break;default:return}}catch(t){g={value:t,[h]:0}}Promise.resolve(g).catch((t=>({value:t,[h]:0}))).then((r=>{const[n,o]=v(r);e.postMessage(Object.assign(Object.assign({},n),{id:u}),o),"RELEASE"===a&&(e.removeEventListener("message",s),c(e),i in t&&"function"==typeof t[i]&&t[i]())})).catch((t=>{const[r,n]=v({value:new TypeError("Unserializable return value"),[h]:0});e.postMessage(Object.assign(Object.assign({},r),{id:u}),n)}))})),e.start&&e.start()}function c(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function f(t){if(t)throw new Error("Proxy has been released and is not useable")}function d(t){return x(t,{type:"RELEASE"}).then((()=>{c(t)}))}const g=new WeakMap,p="FinalizationRegistry"in globalThis&&new FinalizationRegistry((t=>{const e=(g.get(t)||0)-1;g.set(t,e),0===e&&d(t)}));function w(t,e=[],r=function(){}){let n=!1;const i=new Proxy(r,{get(r,s){if(f(n),s===o)return()=>{!function(t){p&&p.unregister(t)}(i),d(t),n=!0};if("then"===s){if(0===e.length)return{then:()=>i};const r=x(t,{type:"GET",path:e.map((t=>t.toString()))}).then(b);return r.then.bind(r)}return w(t,[...e,s])},set(r,s,o){f(n);const[i,h]=v(o);return x(t,{type:"SET",path:[...e,s].map((t=>t.toString())),value:i},h).then(b)},apply(r,o,i){f(n);const h=e[e.length-1];if(h===s)return x(t,{type:"ENDPOINT"}).then(b);if("bind"===h)return w(t,e.slice(0,-1));const[u,a]=m(i);return x(t,{type:"APPLY",path:e.map((t=>t.toString())),argumentList:u},a).then(b)},construct(r,s){f(n);const[o,i]=m(s);return x(t,{type:"CONSTRUCT",path:e.map((t=>t.toString())),argumentList:o},i).then(b)}});return function(t,e){const r=(g.get(e)||0)+1;g.set(e,r),p&&p.register(t,e,t)}(i,t),i}function m(t){const e=t.map(v);return[e.map((t=>t[0])),(r=e.map((t=>t[1])),Array.prototype.concat.apply([],r))];var r}const y=new WeakMap;function v(t){for(const[e,r]of a)if(r.canHandle(t)){const[n,s]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},s]}return[{type:"RAW",value:t},y.get(t)||[]]}function b(t){switch(t.type){case"HANDLER":return a.get(t.name).deserialize(t.value);case"RAW":return t.value}}function x(t,e,r){return new Promise((n=>{const s=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(r){r.data&&r.data.id&&r.data.id===s&&(t.removeEventListener("message",e),n(r.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:s},e),r)}))}},4019:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n={value:()=>{}};function s(){for(var t,e=0,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new o(n)}function o(t){this._=t}function i(t,e){for(var r,n=0,s=t.length;n<s;++n)if((r=t[n]).name===e)return r.value}function h(t,e,r){for(var s=0,o=t.length;s<o;++s)if(t[s].name===e){t[s]=n,t=t.slice(0,s).concat(t.slice(s+1));break}return null!=r&&t.push({name:e,value:r}),t}o.prototype=s.prototype={constructor:o,on:function(t,e){var r,n,s=this._,o=(n=s,(t+"").trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),u=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u<a;)if(r=(t=o[u]).type)s[r]=h(s[r],t.name,e);else if(null==e)for(r in s)s[r]=h(s[r],t.name,null);return this}for(;++u<a;)if((r=(t=o[u]).type)&&(r=i(s[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new o(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,s=new Array(r),o=0;o<r;++o)s[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,r=(n=this._[t]).length;o<r;++o)n[o].value.apply(e,s)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],s=0,o=n.length;s<o;++s)n[s].value.apply(e,r)}};const u=s},6091:(t,e,r)=>{"use strict";function n(t,e){var r,n=1;function s(){var s,o,i=r.length,h=0,u=0;for(s=0;s<i;++s)h+=(o=r[s]).x,u+=o.y;for(h=(h/i-t)*n,u=(u/i-e)*n,s=0;s<i;++s)(o=r[s]).x-=h,o.y-=u}return null==t&&(t=0),null==e&&(e=0),s.initialize=function(t){r=t},s.x=function(e){return arguments.length?(t=+e,s):t},s.y=function(t){return arguments.length?(e=+t,s):e},s.strength=function(t){return arguments.length?(n=+t,s):n},s}r.d(e,{Z:()=>n})},3197:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n=r(869),s=r(3784),o=r(6397);function i(t){return t.x+t.vx}function h(t){return t.y+t.vy}function u(t){var e,r,u,a=1,l=1;function c(){for(var t,s,c,d,g,p,w,m=e.length,y=0;y<l;++y)for(s=(0,n.Z)(e,i,h).visitAfter(f),t=0;t<m;++t)c=e[t],p=r[c.index],w=p*p,d=c.x+c.vx,g=c.y+c.vy,s.visit(v);function v(t,e,r,n,s){var i=t.data,h=t.r,l=p+h;if(!i)return e>d+l||n<d-l||r>g+l||s<g-l;if(i.index>c.index){var f=d-i.x-i.vx,m=g-i.y-i.vy,y=f*f+m*m;y<l*l&&(0===f&&(y+=(f=(0,o.Z)(u))*f),0===m&&(y+=(m=(0,o.Z)(u))*m),y=(l-(y=Math.sqrt(y)))/y*a,c.vx+=(f*=y)*(l=(h*=h)/(w+h)),c.vy+=(m*=y)*l,i.vx-=f*(l=1-l),i.vy-=m*l)}}}function f(t){if(t.data)return t.r=r[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function d(){if(e){var n,s,o=e.length;for(r=new Array(o),n=0;n<o;++n)s=e[n],r[s.index]=+t(s,n,e)}}return"function"!=typeof t&&(t=(0,s.Z)(null==t?1:+t)),c.initialize=function(t,r){e=t,u=r,d()},c.iterations=function(t){return arguments.length?(l=+t,c):l},c.strength=function(t){return arguments.length?(a=+t,c):a},c.radius=function(e){return arguments.length?(t="function"==typeof e?e:(0,s.Z)(+e),d(),c):t},c}},3784:(t,e,r)=>{"use strict";function n(t){return function(){return t}}r.d(e,{Z:()=>n})},6397:(t,e,r)=>{"use strict";function n(t){return 1e-6*(t()-.5)}r.d(e,{Z:()=>n})},7209:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const n=1664525,s=1013904223,o=4294967296;function i(){let t=1;return()=>(t=(n*t+s)%o)/o}},8312:(t,e,r)=>{"use strict";r.d(e,{Z:()=>h});var n=r(3784),s=r(6397);function o(t){return t.index}function i(t,e){var r=t.get(e);if(!r)throw new Error("node not found: "+e);return r}function h(t){var e,r,h,u,a,l,c=o,f=function(t){return 1/Math.min(u[t.source.index],u[t.target.index])},d=(0,n.Z)(30),g=1;function p(n){for(var o=0,i=t.length;o<g;++o)for(var h,u,c,f,d,p,w,m=0;m<i;++m)u=(h=t[m]).source,f=(c=h.target).x+c.vx-u.x-u.vx||(0,s.Z)(l),d=c.y+c.vy-u.y-u.vy||(0,s.Z)(l),f*=p=((p=Math.sqrt(f*f+d*d))-r[m])/p*n*e[m],d*=p,c.vx-=f*(w=a[m]),c.vy-=d*w,u.vx+=f*(w=1-w),u.vy+=d*w}function w(){if(h){var n,s,o=h.length,l=t.length,f=new Map(h.map(((t,e)=>[c(t,e,h),t])));for(n=0,u=new Array(o);n<l;++n)(s=t[n]).index=n,"object"!=typeof s.source&&(s.source=i(f,s.source)),"object"!=typeof s.target&&(s.target=i(f,s.target)),u[s.source.index]=(u[s.source.index]||0)+1,u[s.target.index]=(u[s.target.index]||0)+1;for(n=0,a=new Array(l);n<l;++n)s=t[n],a[n]=u[s.source.index]/(u[s.source.index]+u[s.target.index]);e=new Array(l),m(),r=new Array(l),y()}}function m(){if(h)for(var r=0,n=t.length;r<n;++r)e[r]=+f(t[r],r,t)}function y(){if(h)for(var e=0,n=t.length;e<n;++e)r[e]=+d(t[e],e,t)}return null==t&&(t=[]),p.initialize=function(t,e){h=t,l=e,w()},p.links=function(e){return arguments.length?(t=e,w(),p):t},p.id=function(t){return arguments.length?(c=t,p):c},p.iterations=function(t){return arguments.length?(g=+t,p):g},p.strength=function(t){return arguments.length?(f="function"==typeof t?t:(0,n.Z)(+t),m(),p):f},p.distance=function(t){return arguments.length?(d="function"==typeof t?t:(0,n.Z)(+t),y(),p):d},p}},5259:(t,e,r)=>{"use strict";r.d(e,{Z:()=>h});var n=r(869),s=r(3784),o=r(6397),i=r(1346);function h(){var t,e,r,h,u,a=(0,s.Z)(-30),l=1,c=1/0,f=.81;function d(r){var s,o=t.length,u=(0,n.Z)(t,i.x,i.y).visitAfter(p);for(h=r,s=0;s<o;++s)e=t[s],u.visit(w)}function g(){if(t){var e,r,n=t.length;for(u=new Array(n),e=0;e<n;++e)r=t[e],u[r.index]=+a(r,e,t)}}function p(t){var e,r,n,s,o,i=0,h=0;if(t.length){for(n=s=o=0;o<4;++o)(e=t[o])&&(r=Math.abs(e.value))&&(i+=e.value,h+=r,n+=r*e.x,s+=r*e.y);t.x=n/h,t.y=s/h}else{(e=t).x=e.data.x,e.y=e.data.y;do{i+=u[e.data.index]}while(e=e.next)}t.value=i}function w(t,n,s,i){if(!t.value)return!0;var a=t.x-e.x,d=t.y-e.y,g=i-n,p=a*a+d*d;if(g*g/f<p)return p<c&&(0===a&&(p+=(a=(0,o.Z)(r))*a),0===d&&(p+=(d=(0,o.Z)(r))*d),p<l&&(p=Math.sqrt(l*p)),e.vx+=a*t.value*h/p,e.vy+=d*t.value*h/p),!0;if(!(t.length||p>=c)){(t.data!==e||t.next)&&(0===a&&(p+=(a=(0,o.Z)(r))*a),0===d&&(p+=(d=(0,o.Z)(r))*d),p<l&&(p=Math.sqrt(l*p)));do{t.data!==e&&(g=u[t.data.index]*h/p,e.vx+=a*g,e.vy+=d*g)}while(t=t.next)}}return d.initialize=function(e,n){t=e,r=n,g()},d.strength=function(t){return arguments.length?(a="function"==typeof t?t:(0,s.Z)(+t),g(),d):a},d.distanceMin=function(t){return arguments.length?(l=t*t,d):Math.sqrt(l)},d.distanceMax=function(t){return arguments.length?(c=t*t,d):Math.sqrt(c)},d.theta=function(t){return arguments.length?(f=t*t,d):Math.sqrt(f)},d}},1346:(t,e,r)=>{"use strict";r.d(e,{x:()=>i,y:()=>h,Z:()=>l});var n=r(4019),s=r(6360),o=r(7209);function i(t){return t.x}function h(t){return t.y}var u=10,a=Math.PI*(3-Math.sqrt(5));function l(t){var e,r=1,i=.001,h=1-Math.pow(i,1/300),l=0,c=.6,f=new Map,d=(0,s.HT)(w),g=(0,n.Z)("tick","end"),p=(0,o.Z)();function w(){m(),g.call("tick",e),r<i&&(d.stop(),g.call("end",e))}function m(n){var s,o,i=t.length;void 0===n&&(n=1);for(var u=0;u<n;++u)for(r+=(l-r)*h,f.forEach((function(t){t(r)})),s=0;s<i;++s)null==(o=t[s]).fx?o.x+=o.vx*=c:(o.x=o.fx,o.vx=0),null==o.fy?o.y+=o.vy*=c:(o.y=o.fy,o.vy=0);return e}function y(){for(var e,r=0,n=t.length;r<n;++r){if((e=t[r]).index=r,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var s=u*Math.sqrt(.5+r),o=r*a;e.x=s*Math.cos(o),e.y=s*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function v(e){return e.initialize&&e.initialize(t,p),e}return null==t&&(t=[]),y(),e={tick:m,restart:function(){return d.restart(w),e},stop:function(){return d.stop(),e},nodes:function(r){return arguments.length?(t=r,y(),f.forEach(v),e):t},alpha:function(t){return arguments.length?(r=+t,e):r},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(h=+t,e):+h},alphaTarget:function(t){return arguments.length?(l=+t,e):l},velocityDecay:function(t){return arguments.length?(c=1-t,e):1-c},randomSource:function(t){return arguments.length?(p=t,f.forEach(v),e):p},force:function(t,r){return arguments.length>1?(null==r?f.delete(t):f.set(t,v(r)),e):f.get(t)},find:function(e,r,n){var s,o,i,h,u,a=0,l=t.length;for(null==n?n=1/0:n*=n,a=0;a<l;++a)(i=(s=e-(h=t[a]).x)*s+(o=r-h.y)*o)<n&&(u=h,n=i);return u},on:function(t,r){return arguments.length>1?(g.on(t,r),e):g.on(t)}}}},8551:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(3784);function s(t){var e,r,s,o=(0,n.Z)(.1);function i(t){for(var n,o=0,i=e.length;o<i;++o)(n=e[o]).vx+=(s[o]-n.x)*r[o]*t}function h(){if(e){var n,i=e.length;for(r=new Array(i),s=new Array(i),n=0;n<i;++n)r[n]=isNaN(s[n]=+t(e[n],n,e))?0:+o(e[n],n,e)}}return"function"!=typeof t&&(t=(0,n.Z)(null==t?0:+t)),i.initialize=function(t){e=t,h()},i.strength=function(t){return arguments.length?(o="function"==typeof t?t:(0,n.Z)(+t),h(),i):o},i.x=function(e){return arguments.length?(t="function"==typeof e?e:(0,n.Z)(+e),h(),i):t},i}},8025:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(3784);function s(t){var e,r,s,o=(0,n.Z)(.1);function i(t){for(var n,o=0,i=e.length;o<i;++o)(n=e[o]).vy+=(s[o]-n.y)*r[o]*t}function h(){if(e){var n,i=e.length;for(r=new Array(i),s=new Array(i),n=0;n<i;++n)r[n]=isNaN(s[n]=+t(e[n],n,e))?0:+o(e[n],n,e)}}return"function"!=typeof t&&(t=(0,n.Z)(null==t?0:+t)),i.initialize=function(t){e=t,h()},i.strength=function(t){return arguments.length?(o="function"==typeof t?t:(0,n.Z)(+t),h(),i):o},i.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,n.Z)(+e),h(),i):t},i}},5477:(t,e,r)=>{"use strict";function n(t){const e=+this._x.call(null,t),r=+this._y.call(null,t),n=+this._z.call(null,t);return s(this.cover(e,r,n),e,r,n,t)}function s(t,e,r,n,s){if(isNaN(e)||isNaN(r)||isNaN(n))return t;var o,i,h,u,a,l,c,f,d,g,p,w,m=t._root,y={data:s},v=t._x0,b=t._y0,x=t._z0,M=t._x1,E=t._y1,_=t._z1;if(!m)return t._root=y,t;for(;m.length;)if((f=e>=(i=(v+M)/2))?v=i:M=i,(d=r>=(h=(b+E)/2))?b=h:E=h,(g=n>=(u=(x+_)/2))?x=u:_=u,o=m,!(m=m[p=g<<2|d<<1|f]))return o[p]=y,t;if(a=+t._x.call(null,m.data),l=+t._y.call(null,m.data),c=+t._z.call(null,m.data),e===a&&r===l&&n===c)return y.next=m,o?o[p]=y:t._root=y,t;do{o=o?o[p]=new Array(8):t._root=new Array(8),(f=e>=(i=(v+M)/2))?v=i:M=i,(d=r>=(h=(b+E)/2))?b=h:E=h,(g=n>=(u=(x+_)/2))?x=u:_=u}while((p=g<<2|d<<1|f)==(w=(c>=u)<<2|(l>=h)<<1|a>=i));return o[w]=m,o[p]=y,t}function o(t){Array.isArray(t)||(t=Array.from(t));const e=t.length,r=new Float64Array(e),n=new Float64Array(e),o=new Float64Array(e);let i=1/0,h=1/0,u=1/0,a=-1/0,l=-1/0,c=-1/0;for(let s,f,d,g,p=0;p<e;++p)isNaN(f=+this._x.call(null,s=t[p]))||isNaN(d=+this._y.call(null,s))||isNaN(g=+this._z.call(null,s))||(r[p]=f,n[p]=d,o[p]=g,f<i&&(i=f),f>a&&(a=f),d<h&&(h=d),d>l&&(l=d),g<u&&(u=g),g>c&&(c=g));if(i>a||h>l||u>c)return this;this.cover(i,h,u).cover(a,l,c);for(let i=0;i<e;++i)s(this,r[i],n[i],o[i],t[i]);return this}r.d(e,{Z:()=>n,H:()=>o})},9077:(t,e,r)=>{"use strict";function n(t,e,r){if(isNaN(t=+t)||isNaN(e=+e)||isNaN(r=+r))return this;var n=this._x0,s=this._y0,o=this._z0,i=this._x1,h=this._y1,u=this._z1;if(isNaN(n))i=(n=Math.floor(t))+1,h=(s=Math.floor(e))+1,u=(o=Math.floor(r))+1;else{for(var a,l,c=i-n||1,f=this._root;n>t||t>=i||s>e||e>=h||o>r||r>=u;)switch(l=(r<o)<<2|(e<s)<<1|t<n,(a=new Array(8))[l]=f,f=a,c*=2,l){case 0:i=n+c,h=s+c,u=o+c;break;case 1:n=i-c,h=s+c,u=o+c;break;case 2:i=n+c,s=h-c,u=o+c;break;case 3:n=i-c,s=h-c,u=o+c;break;case 4:i=n+c,h=s+c,o=u-c;break;case 5:n=i-c,h=s+c,o=u-c;break;case 6:i=n+c,s=h-c,o=u-c;break;case 7:n=i-c,s=h-c,o=u-c}this._root&&this._root.length&&(this._root=f)}return this._x0=n,this._y0=s,this._z0=o,this._x1=i,this._y1=h,this._z1=u,this}r.d(e,{Z:()=>n})},1971:(t,e,r)=>{"use strict";function n(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}r.d(e,{Z:()=>n})},7724:(t,e,r)=>{"use strict";function n(t){return arguments.length?this.cover(+t[0][0],+t[0][1],+t[0][2]).cover(+t[1][0],+t[1][1],+t[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}r.d(e,{Z:()=>n})},5007:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(2438);function s(t,e,r,s){var o,i,h,u,a,l,c,f,d,g=this._x0,p=this._y0,w=this._z0,m=this._x1,y=this._y1,v=this._z1,b=[],x=this._root;for(x&&b.push(new n.Z(x,g,p,w,m,y,v)),null==s?s=1/0:(g=t-s,p=e-s,w=r-s,m=t+s,y=e+s,v=r+s,s*=s);f=b.pop();)if(!(!(x=f.node)||(i=f.x0)>m||(h=f.y0)>y||(u=f.z0)>v||(a=f.x1)<g||(l=f.y1)<p||(c=f.z1)<w))if(x.length){var M=(i+a)/2,E=(h+l)/2,_=(u+c)/2;b.push(new n.Z(x[7],M,E,_,a,l,c),new n.Z(x[6],i,E,_,M,l,c),new n.Z(x[5],M,h,_,a,E,c),new n.Z(x[4],i,h,_,M,E,c),new n.Z(x[3],M,E,u,a,l,_),new n.Z(x[2],i,E,u,M,l,_),new n.Z(x[1],M,h,u,a,E,_),new n.Z(x[0],i,h,u,M,E,_)),(d=(r>=_)<<2|(e>=E)<<1|t>=M)&&(f=b[b.length-1],b[b.length-1]=b[b.length-1-d],b[b.length-1-d]=f)}else{var N=t-+this._x.call(null,x.data),Z=e-+this._y.call(null,x.data),S=r-+this._z.call(null,x.data),A=N*N+Z*Z+S*S;if(A<s){var k=Math.sqrt(s=A);g=t-k,p=e-k,w=r-k,m=t+k,y=e+k,v=r+k,o=x.data}}return o}},2438:(t,e,r)=>{"use strict";function n(t,e,r,n,s,o,i){this.node=t,this.x0=e,this.y0=r,this.z0=n,this.x1=s,this.y1=o,this.z1=i}r.d(e,{Z:()=>n})},9904:(t,e,r)=>{"use strict";r.d(e,{Z:()=>w});var n=r(5477),s=r(9077),o=r(1971),i=r(7724),h=r(5007),u=r(4089),a=r(2667),l=r(676),c=r(758),f=r(6100),d=r(7616),g=r(8356),p=r(7801);function w(t,e,r,n){var s=new m(null==e?d.P:e,null==r?g.q:r,null==n?p.i:n,NaN,NaN,NaN,NaN,NaN,NaN);return null==t?s:s.addAll(t)}function m(t,e,r,n,s,o,i,h,u){this._x=t,this._y=e,this._z=r,this._x0=n,this._y0=s,this._z0=o,this._x1=i,this._y1=h,this._z1=u,this._root=void 0}function y(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var v=w.prototype=m.prototype;v.copy=function(){var t,e,r=new m(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root;if(!n)return r;if(!n.length)return r._root=y(n),r;for(t=[{source:n,target:r._root=new Array(8)}];n=t.pop();)for(var s=0;s<8;++s)(e=n.source[s])&&(e.length?t.push({source:e,target:n.target[s]=new Array(8)}):n.target[s]=y(e));return r},v.add=n.Z,v.addAll=n.H,v.cover=s.Z,v.data=o.Z,v.extent=i.Z,v.find=h.Z,v.remove=u.Z,v.removeAll=u.x,v.root=a.Z,v.size=l.Z,v.visit=c.Z,v.visitAfter=f.Z,v.x=d.Z,v.y=g.Z,v.z=p.Z},4089:(t,e,r)=>{"use strict";function n(t){if(isNaN(o=+this._x.call(null,t))||isNaN(i=+this._y.call(null,t))||isNaN(h=+this._z.call(null,t)))return this;var e,r,n,s,o,i,h,u,a,l,c,f,d,g,p,w=this._root,m=this._x0,y=this._y0,v=this._z0,b=this._x1,x=this._y1,M=this._z1;if(!w)return this;if(w.length)for(;;){if((c=o>=(u=(m+b)/2))?m=u:b=u,(f=i>=(a=(y+x)/2))?y=a:x=a,(d=h>=(l=(v+M)/2))?v=l:M=l,e=w,!(w=w[g=d<<2|f<<1|c]))return this;if(!w.length)break;(e[g+1&7]||e[g+2&7]||e[g+3&7]||e[g+4&7]||e[g+5&7]||e[g+6&7]||e[g+7&7])&&(r=e,p=g)}for(;w.data!==t;)if(n=w,!(w=w.next))return this;return(s=w.next)&&delete w.next,n?(s?n.next=s:delete n.next,this):e?(s?e[g]=s:delete e[g],(w=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&w===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!w.length&&(r?r[p]=w:this._root=w),this):(this._root=s,this)}function s(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this}r.d(e,{Z:()=>n,x:()=>s})},2667:(t,e,r)=>{"use strict";function n(){return this._root}r.d(e,{Z:()=>n})},676:(t,e,r)=>{"use strict";function n(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}r.d(e,{Z:()=>n})},758:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(2438);function s(t){var e,r,s,o,i,h,u,a,l=[],c=this._root;for(c&&l.push(new n.Z(c,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=l.pop();)if(!t(c=e.node,s=e.x0,o=e.y0,i=e.z0,h=e.x1,u=e.y1,a=e.z1)&&c.length){var f=(s+h)/2,d=(o+u)/2,g=(i+a)/2;(r=c[7])&&l.push(new n.Z(r,f,d,g,h,u,a)),(r=c[6])&&l.push(new n.Z(r,s,d,g,f,u,a)),(r=c[5])&&l.push(new n.Z(r,f,o,g,h,d,a)),(r=c[4])&&l.push(new n.Z(r,s,o,g,f,d,a)),(r=c[3])&&l.push(new n.Z(r,f,d,i,h,u,g)),(r=c[2])&&l.push(new n.Z(r,s,d,i,f,u,g)),(r=c[1])&&l.push(new n.Z(r,f,o,i,h,d,g)),(r=c[0])&&l.push(new n.Z(r,s,o,i,f,d,g))}return this}},6100:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(2438);function s(t){var e,r=[],s=[];for(this._root&&r.push(new n.Z(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=r.pop();){var o=e.node;if(o.length){var i,h=e.x0,u=e.y0,a=e.z0,l=e.x1,c=e.y1,f=e.z1,d=(h+l)/2,g=(u+c)/2,p=(a+f)/2;(i=o[0])&&r.push(new n.Z(i,h,u,a,d,g,p)),(i=o[1])&&r.push(new n.Z(i,d,u,a,l,g,p)),(i=o[2])&&r.push(new n.Z(i,h,g,a,d,c,p)),(i=o[3])&&r.push(new n.Z(i,d,g,a,l,c,p)),(i=o[4])&&r.push(new n.Z(i,h,u,p,d,g,f)),(i=o[5])&&r.push(new n.Z(i,d,u,p,l,g,f)),(i=o[6])&&r.push(new n.Z(i,h,g,p,d,c,f)),(i=o[7])&&r.push(new n.Z(i,d,g,p,l,c,f))}s.push(e)}for(;e=s.pop();)t(e.node,e.x0,e.y0,e.z0,e.x1,e.y1,e.z1);return this}},7616:(t,e,r)=>{"use strict";function n(t){return t[0]}function s(t){return arguments.length?(this._x=t,this):this._x}r.d(e,{P:()=>n,Z:()=>s})},8356:(t,e,r)=>{"use strict";function n(t){return t[1]}function s(t){return arguments.length?(this._y=t,this):this._y}r.d(e,{q:()=>n,Z:()=>s})},7801:(t,e,r)=>{"use strict";function n(t){return t[2]}function s(t){return arguments.length?(this._z=t,this):this._z}r.d(e,{i:()=>n,Z:()=>s})},80:(t,e,r)=>{"use strict";function n(t){const e=+this._x.call(null,t),r=+this._y.call(null,t);return s(this.cover(e,r),e,r,t)}function s(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var s,o,i,h,u,a,l,c,f,d=t._root,g={data:n},p=t._x0,w=t._y0,m=t._x1,y=t._y1;if(!d)return t._root=g,t;for(;d.length;)if((a=e>=(o=(p+m)/2))?p=o:m=o,(l=r>=(i=(w+y)/2))?w=i:y=i,s=d,!(d=d[c=l<<1|a]))return s[c]=g,t;if(h=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===h&&r===u)return g.next=d,s?s[c]=g:t._root=g,t;do{s=s?s[c]=new Array(4):t._root=new Array(4),(a=e>=(o=(p+m)/2))?p=o:m=o,(l=r>=(i=(w+y)/2))?w=i:y=i}while((c=l<<1|a)==(f=(u>=i)<<1|h>=o));return s[f]=d,s[c]=g,t}function o(t){var e,r,n,o,i=t.length,h=new Array(i),u=new Array(i),a=1/0,l=1/0,c=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(n=+this._x.call(null,e=t[r]))||isNaN(o=+this._y.call(null,e))||(h[r]=n,u[r]=o,n<a&&(a=n),n>c&&(c=n),o<l&&(l=o),o>f&&(f=o));if(a>c||l>f)return this;for(this.cover(a,l).cover(c,f),r=0;r<i;++r)s(this,h[r],u[r],t[r]);return this}r.d(e,{Z:()=>n,H:()=>o})},262:(t,e,r)=>{"use strict";function n(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,s=this._x1,o=this._y1;if(isNaN(r))s=(r=Math.floor(t))+1,o=(n=Math.floor(e))+1;else{for(var i,h,u=s-r||1,a=this._root;r>t||t>=s||n>e||e>=o;)switch(h=(e<n)<<1|t<r,(i=new Array(4))[h]=a,a=i,u*=2,h){case 0:s=r+u,o=n+u;break;case 1:r=s-u,o=n+u;break;case 2:s=r+u,n=o-u;break;case 3:r=s-u,n=o-u}this._root&&this._root.length&&(this._root=a)}return this._x0=r,this._y0=n,this._x1=s,this._y1=o,this}r.d(e,{Z:()=>n})},6251:(t,e,r)=>{"use strict";function n(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}r.d(e,{Z:()=>n})},1960:(t,e,r)=>{"use strict";function n(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}r.d(e,{Z:()=>n})},8752:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(6629);function s(t,e,r){var s,o,i,h,u,a,l,c=this._x0,f=this._y0,d=this._x1,g=this._y1,p=[],w=this._root;for(w&&p.push(new n.Z(w,c,f,d,g)),null==r?r=1/0:(c=t-r,f=e-r,d=t+r,g=e+r,r*=r);a=p.pop();)if(!(!(w=a.node)||(o=a.x0)>d||(i=a.y0)>g||(h=a.x1)<c||(u=a.y1)<f))if(w.length){var m=(o+h)/2,y=(i+u)/2;p.push(new n.Z(w[3],m,y,h,u),new n.Z(w[2],o,y,m,u),new n.Z(w[1],m,i,h,y),new n.Z(w[0],o,i,m,y)),(l=(e>=y)<<1|t>=m)&&(a=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=a)}else{var v=t-+this._x.call(null,w.data),b=e-+this._y.call(null,w.data),x=v*v+b*b;if(x<r){var M=Math.sqrt(r=x);c=t-M,f=e-M,d=t+M,g=e+M,s=w.data}}return s}},6629:(t,e,r)=>{"use strict";function n(t,e,r,n,s){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=s}r.d(e,{Z:()=>n})},869:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var n=r(80),s=r(262),o=r(6251),i=r(1960),h=r(8752),u=r(4534),a=r(4976),l=r(6449),c=r(9116),f=r(4142),d=r(6226),g=r(5753);function p(t,e,r){var n=new w(null==e?d.P:e,null==r?g.q:r,NaN,NaN,NaN,NaN);return null==t?n:n.addAll(t)}function w(t,e,r,n,s,o){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=s,this._y1=o,this._root=void 0}function m(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var y=p.prototype=w.prototype;y.copy=function(){var t,e,r=new w(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=m(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var s=0;s<4;++s)(e=n.source[s])&&(e.length?t.push({source:e,target:n.target[s]=new Array(4)}):n.target[s]=m(e));return r},y.add=n.Z,y.addAll=n.H,y.cover=s.Z,y.data=o.Z,y.extent=i.Z,y.find=h.Z,y.remove=u.Z,y.removeAll=u.x,y.root=a.Z,y.size=l.Z,y.visit=c.Z,y.visitAfter=f.Z,y.x=d.Z,y.y=g.Z},4534:(t,e,r)=>{"use strict";function n(t){if(isNaN(o=+this._x.call(null,t))||isNaN(i=+this._y.call(null,t)))return this;var e,r,n,s,o,i,h,u,a,l,c,f,d=this._root,g=this._x0,p=this._y0,w=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((a=o>=(h=(g+w)/2))?g=h:w=h,(l=i>=(u=(p+m)/2))?p=u:m=u,e=d,!(d=d[c=l<<1|a]))return this;if(!d.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(r=e,f=c)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(s=d.next)&&delete d.next,n?(s?n.next=s:delete n.next,this):e?(s?e[c]=s:delete e[c],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=s,this)}function s(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this}r.d(e,{Z:()=>n,x:()=>s})},4976:(t,e,r)=>{"use strict";function n(){return this._root}r.d(e,{Z:()=>n})},6449:(t,e,r)=>{"use strict";function n(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}r.d(e,{Z:()=>n})},9116:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(6629);function s(t){var e,r,s,o,i,h,u=[],a=this._root;for(a&&u.push(new n.Z(a,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(a=e.node,s=e.x0,o=e.y0,i=e.x1,h=e.y1)&&a.length){var l=(s+i)/2,c=(o+h)/2;(r=a[3])&&u.push(new n.Z(r,l,c,i,h)),(r=a[2])&&u.push(new n.Z(r,s,c,l,h)),(r=a[1])&&u.push(new n.Z(r,l,o,i,c)),(r=a[0])&&u.push(new n.Z(r,s,o,l,c))}return this}},4142:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(6629);function s(t){var e,r=[],s=[];for(this._root&&r.push(new n.Z(this._root,this._x0,this._y0,this._x1,this._y1));e=r.pop();){var o=e.node;if(o.length){var i,h=e.x0,u=e.y0,a=e.x1,l=e.y1,c=(h+a)/2,f=(u+l)/2;(i=o[0])&&r.push(new n.Z(i,h,u,c,f)),(i=o[1])&&r.push(new n.Z(i,c,u,a,f)),(i=o[2])&&r.push(new n.Z(i,h,f,c,l)),(i=o[3])&&r.push(new n.Z(i,c,f,a,l))}s.push(e)}for(;e=s.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}},6226:(t,e,r)=>{"use strict";function n(t){return t[0]}function s(t){return arguments.length?(this._x=t,this):this._x}r.d(e,{P:()=>n,Z:()=>s})},5753:(t,e,r)=>{"use strict";function n(t){return t[1]}function s(t){return arguments.length?(this._y=t,this):this._y}r.d(e,{q:()=>n,Z:()=>s})},6360:(t,e,r)=>{"use strict";r.d(e,{HT:()=>m});var n,s,o=0,i=0,h=0,u=1e3,a=0,l=0,c=0,f="object"==typeof performance&&performance.now?performance:Date,d="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function g(){return l||(d(p),l=f.now()+c)}function p(){l=0}function w(){this._call=this._time=this._next=null}function m(t,e,r){var n=new w;return n.restart(t,e,r),n}function y(){l=(a=f.now())+c,o=i=0;try{!function(){g(),++o;for(var t,e=n;e;)(t=l-e._time)>=0&&e._call.call(void 0,t),e=e._next;--o}()}finally{o=0,function(){for(var t,e,r=n,o=1/0;r;)r._call?(o>r._time&&(o=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:n=e);s=t,b(o)}(),l=0}}function v(){var t=f.now(),e=t-a;e>u&&(c-=e,a=t)}function b(t){o||(i&&(i=clearTimeout(i)),t-l>24?(t<1/0&&(i=setTimeout(y,t-f.now()-c)),h&&(h=clearInterval(h))):(h||(a=f.now(),h=setInterval(v,u)),o=1,d(y)))}w.prototype=m.prototype={constructor:w,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?g():+r)+(null==e?0:+e),this._next||s===this||(s?s._next=this:n=this,s=this),this._call=t,this._time=r,b()},stop:function(){this._call&&(this._call=null,this._time=1/0,b())}}},2751:(t,e,r)=>{"use strict";r.d(e,{N:()=>s});const n=Object.prototype.toString;function s(t){const e=n.call(t);return e.endsWith("Array]")&&!e.includes("Big")}},9278:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(2751);function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,n.N)(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,s=void 0===r?0:r,o=e.toIndex,i=void 0===o?t.length:o;if(s<0||s>=t.length||!Number.isInteger(s))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=s||i>t.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var h=t[s],u=s+1;u<i;u++)t[u]>h&&(h=t[u]);return h}},4208:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(2751);function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,n.N)(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,s=void 0===r?0:r,o=e.toIndex,i=void 0===o?t.length:o;if(s<0||s>=t.length||!Number.isInteger(s))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=s||i>t.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var h=t[s],u=s+1;u<i;u++)t[u]<h&&(h=t[u]);return h}},1922:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(2751),s=r(9278),o=r(4208);function i(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,n.N)(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==r.output){if(!(0,n.N)(r.output))throw new TypeError("output option must be an array if specified");e=r.output}else e=new Array(t.length);var i=(0,o.Z)(t),h=(0,s.Z)(t);if(i===h)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var u=r.min,a=void 0===u?r.autoMinMax?i:0:u,l=r.max,c=void 0===l?r.autoMinMax?h:1:l;if(a>=c)throw new RangeError("min option must be smaller than max option");for(var f=(c-a)/(h-i),d=0;d<t.length;d++)e[d]=(t[d]-i)*f+a;return e}},1801:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(2406),s=r(8807),o=r(1829);class i{constructor(t,e={}){if((t=s.Z.checkMatrix(t)).isEmpty())throw new Error("Matrix must be non-empty");let r=t.rows,i=t.columns;const{computeLeftSingularVectors:h=!0,computeRightSingularVectors:u=!0,autoTranspose:a=!1}=e;let l,c=Boolean(h),f=Boolean(u),d=!1;if(r<i)if(a){l=t.transpose(),r=l.rows,i=l.columns,d=!0;let e=c;c=f,f=e}else l=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else l=t.clone();let g=Math.min(r,i),p=Math.min(r+1,i),w=new Float64Array(p),m=new n.Z(r,g),y=new n.Z(i,i),v=new Float64Array(i),b=new Float64Array(r),x=new Float64Array(p);for(let t=0;t<p;t++)x[t]=t;let M=Math.min(r-1,i),E=Math.max(0,Math.min(i-2,r)),_=Math.max(M,E);for(let t=0;t<_;t++){if(t<M){w[t]=0;for(let e=t;e<r;e++)w[t]=(0,o.G)(w[t],l.get(e,t));if(0!==w[t]){l.get(t,t)<0&&(w[t]=-w[t]);for(let e=t;e<r;e++)l.set(e,t,l.get(e,t)/w[t]);l.set(t,t,l.get(t,t)+1)}w[t]=-w[t]}for(let e=t+1;e<i;e++){if(t<M&&0!==w[t]){let n=0;for(let s=t;s<r;s++)n+=l.get(s,t)*l.get(s,e);n=-n/l.get(t,t);for(let s=t;s<r;s++)l.set(s,e,l.get(s,e)+n*l.get(s,t))}v[e]=l.get(t,e)}if(c&&t<M)for(let e=t;e<r;e++)m.set(e,t,l.get(e,t));if(t<E){v[t]=0;for(let e=t+1;e<i;e++)v[t]=(0,o.G)(v[t],v[e]);if(0!==v[t]){v[t+1]<0&&(v[t]=0-v[t]);for(let e=t+1;e<i;e++)v[e]/=v[t];v[t+1]+=1}if(v[t]=-v[t],t+1<r&&0!==v[t]){for(let e=t+1;e<r;e++)b[e]=0;for(let e=t+1;e<r;e++)for(let r=t+1;r<i;r++)b[e]+=v[r]*l.get(e,r);for(let e=t+1;e<i;e++){let n=-v[e]/v[t+1];for(let s=t+1;s<r;s++)l.set(s,e,l.get(s,e)+n*b[s])}}if(f)for(let e=t+1;e<i;e++)y.set(e,t,v[e])}}let N=Math.min(i,r+1);if(M<i&&(w[M]=l.get(M,M)),r<N&&(w[N-1]=0),E+1<N&&(v[E]=l.get(E,N-1)),v[N-1]=0,c){for(let t=M;t<g;t++){for(let e=0;e<r;e++)m.set(e,t,0);m.set(t,t,1)}for(let t=M-1;t>=0;t--)if(0!==w[t]){for(let e=t+1;e<g;e++){let n=0;for(let s=t;s<r;s++)n+=m.get(s,t)*m.get(s,e);n=-n/m.get(t,t);for(let s=t;s<r;s++)m.set(s,e,m.get(s,e)+n*m.get(s,t))}for(let e=t;e<r;e++)m.set(e,t,-m.get(e,t));m.set(t,t,1+m.get(t,t));for(let e=0;e<t-1;e++)m.set(e,t,0)}else{for(let e=0;e<r;e++)m.set(e,t,0);m.set(t,t,1)}}if(f)for(let t=i-1;t>=0;t--){if(t<E&&0!==v[t])for(let e=t+1;e<i;e++){let r=0;for(let n=t+1;n<i;n++)r+=y.get(n,t)*y.get(n,e);r=-r/y.get(t+1,t);for(let n=t+1;n<i;n++)y.set(n,e,y.get(n,e)+r*y.get(n,t))}for(let e=0;e<i;e++)y.set(e,t,0);y.set(t,t,1)}let Z=N-1,S=0,A=Number.EPSILON;for(;N>0;){let t,e;for(t=N-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(w[t]+Math.abs(w[t+1]));if(Math.abs(v[t])<=e||Number.isNaN(v[t])){v[t]=0;break}}if(t===N-2)e=4;else{let r;for(r=N-1;r>=t&&r!==t;r--){let e=(r!==N?Math.abs(v[r]):0)+(r!==t+1?Math.abs(v[r-1]):0);if(Math.abs(w[r])<=A*e){w[r]=0;break}}r===t?e=3:r===N-1?e=1:(e=2,t=r)}switch(t++,e){case 1:{let e=v[N-2];v[N-2]=0;for(let r=N-2;r>=t;r--){let n=(0,o.G)(w[r],e),s=w[r]/n,h=e/n;if(w[r]=n,r!==t&&(e=-h*v[r-1],v[r-1]=s*v[r-1]),f)for(let t=0;t<i;t++)n=s*y.get(t,r)+h*y.get(t,N-1),y.set(t,N-1,-h*y.get(t,r)+s*y.get(t,N-1)),y.set(t,r,n)}break}case 2:{let e=v[t-1];v[t-1]=0;for(let n=t;n<N;n++){let s=(0,o.G)(w[n],e),i=w[n]/s,h=e/s;if(w[n]=s,e=-h*v[n],v[n]=i*v[n],c)for(let e=0;e<r;e++)s=i*m.get(e,n)+h*m.get(e,t-1),m.set(e,t-1,-h*m.get(e,n)+i*m.get(e,t-1)),m.set(e,n,s)}break}case 3:{const e=Math.max(Math.abs(w[N-1]),Math.abs(w[N-2]),Math.abs(v[N-2]),Math.abs(w[t]),Math.abs(v[t])),n=w[N-1]/e,s=w[N-2]/e,h=v[N-2]/e,u=w[t]/e,a=v[t]/e,l=((s+n)*(s-n)+h*h)/2,d=n*h*(n*h);let g=0;0===l&&0===d||(g=l<0?0-Math.sqrt(l*l+d):Math.sqrt(l*l+d),g=d/(l+g));let p=(u+n)*(u-n)+g,b=u*a;for(let e=t;e<N-1;e++){let n=(0,o.G)(p,b);0===n&&(n=Number.MIN_VALUE);let s=p/n,h=b/n;if(e!==t&&(v[e-1]=n),p=s*w[e]+h*v[e],v[e]=s*v[e]-h*w[e],b=h*w[e+1],w[e+1]=s*w[e+1],f)for(let t=0;t<i;t++)n=s*y.get(t,e)+h*y.get(t,e+1),y.set(t,e+1,-h*y.get(t,e)+s*y.get(t,e+1)),y.set(t,e,n);if(n=(0,o.G)(p,b),0===n&&(n=Number.MIN_VALUE),s=p/n,h=b/n,w[e]=n,p=s*v[e]+h*w[e+1],w[e+1]=-h*v[e]+s*w[e+1],b=h*v[e+1],v[e+1]=s*v[e+1],c&&e<r-1)for(let t=0;t<r;t++)n=s*m.get(t,e)+h*m.get(t,e+1),m.set(t,e+1,-h*m.get(t,e)+s*m.get(t,e+1)),m.set(t,e,n)}v[N-2]=p,S+=1;break}case 4:if(w[t]<=0&&(w[t]=w[t]<0?-w[t]:0,f))for(let e=0;e<=Z;e++)y.set(e,t,-y.get(e,t));for(;t<Z&&!(w[t]>=w[t+1]);){let e=w[t];if(w[t]=w[t+1],w[t+1]=e,f&&t<i-1)for(let r=0;r<i;r++)e=y.get(r,t+1),y.set(r,t+1,y.get(r,t)),y.set(r,t,e);if(c&&t<r-1)for(let n=0;n<r;n++)e=m.get(n,t+1),m.set(n,t+1,m.get(n,t)),m.set(n,t,e);t++}S=0,N--}}if(d){let t=y;y=m,m=t}this.m=r,this.n=i,this.s=w,this.U=m,this.V=y}solve(t){let e=t,r=this.threshold,s=this.s.length,o=n.Z.zeros(s,s);for(let t=0;t<s;t++)Math.abs(this.s[t])<=r?o.set(t,t,0):o.set(t,t,1/this.s[t]);let i=this.U,h=this.rightSingularVectors,u=h.mmul(o),a=h.rows,l=i.rows,c=n.Z.zeros(a,l);for(let t=0;t<a;t++)for(let e=0;e<l;e++){let r=0;for(let n=0;n<s;n++)r+=u.get(t,n)*i.get(e,n);c.set(t,e,r)}return c.mmul(e)}solveForDiagonal(t){return this.solve(n.Z.diag(t))}inverse(){let t=this.V,e=this.threshold,r=t.rows,s=t.columns,o=new n.Z(r,this.s.length);for(let n=0;n<r;n++)for(let r=0;r<s;r++)Math.abs(this.s[r])>e&&o.set(n,r,t.get(n,r)/this.s[r]);let i=this.U,h=i.rows,u=i.columns,a=new n.Z(r,h);for(let t=0;t<r;t++)for(let e=0;e<h;e++){let r=0;for(let n=0;n<u;n++)r+=o.get(t,n)*i.get(e,n);a.set(t,e,r)}return a}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,r=this.s;for(let n=0,s=r.length;n<s;n++)r[n]>t&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return n.Z.diag(this.s)}}},1829:(t,e,r)=>{"use strict";function n(t,e){let r=0;return Math.abs(t)>Math.abs(e)?(r=e/t,Math.abs(t)*Math.sqrt(1+r*r)):0!==e?(r=t/e,Math.abs(e)*Math.sqrt(1+r*r)):0}r.d(e,{G:()=>n})},4643:(t,e,r)=>{"use strict";r.d(e,{V:()=>o,M:()=>i});const n=" ".repeat(2),s=" ".repeat(4);function o(){return i(this)}function i(t,e={}){const{maxRows:r=15,maxColumns:o=10,maxNumSize:i=8,padMinus:u="auto"}=e;return`${t.constructor.name} {\n${n}[\n${s}${function(t,e,r,n,o){const{rows:i,columns:u}=t,a=Math.min(i,e),l=Math.min(u,r),c=[];if("auto"===o){o=!1;t:for(let e=0;e<a;e++)for(let r=0;r<l;r++)if(t.get(e,r)<0){o=!0;break t}}for(let e=0;e<a;e++){let r=[];for(let s=0;s<l;s++)r.push(h(t.get(e,s),n,o));c.push(`${r.join(" ")}`)}return l!==u&&(c[c.length-1]+=` ... ${u-r} more columns`),a!==i&&c.push(`... ${i-e} more rows`),c.join(`\n${s}`)}(t,r,o,i,u)}\n${n}]\n${n}rows: ${t.rows}\n${n}columns: ${t.columns}\n}`}function h(t,e,r){return(t>=0&&r?` ${u(t,e-1)}`:u(t,e)).padEnd(e)}function u(t,e){let r=t.toString();if(r.length<=e)return r;let n=t.toFixed(e);if(n.length>e&&(n=t.toFixed(Math.max(0,e-(n.length-e)))),n.length<=e&&!n.startsWith("0.000")&&!n.startsWith("-0.000"))return n;let s=t.toExponential(e);return s.length>e&&(s=t.toExponential(Math.max(0,e-(s.length-e)))),s.slice(0)}},5874:(t,e,r)=>{"use strict";function n(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t.get(e,r));return this},t.add=function(t,r){return new e(t).add(r)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t.get(e,r));return this},t.sub=function(t,r){return new e(t).sub(r)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t.get(e,r));return this},t.mul=function(t,r){return new e(t).mul(r)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t.get(e,r));return this},t.div=function(t,r){return new e(t).div(r)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)%t.get(e,r));return this},t.mod=function(t,r){return new e(t).mod(r)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)&t.get(e,r));return this},t.and=function(t,r){return new e(t).and(r)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)|t.get(e,r));return this},t.or=function(t,r){return new e(t).or(r)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)^t.get(e,r));return this},t.xor=function(t,r){return new e(t).xor(r)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)<<t.get(e,r));return this},t.leftShift=function(t,r){return new e(t).leftShift(r)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)>>t.get(e,r));return this},t.signPropagatingRightShift=function(t,r){return new e(t).signPropagatingRightShift(r)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)>>>t.get(e,r));return this},t.rightShift=function(t,r){return new e(t).rightShift(r)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,r){return new e(t).pow(r)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,Math.pow(this.get(e,r),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,Math.pow(this.get(e,r),t.get(e,r)));return this}}r.d(e,{z:()=>n})},2406:(t,e,r)=>{"use strict";r.d(e,{X:()=>a,Z:()=>c});var n=r(2751),s=r(1922),o=r(4643),i=r(5874),h=r(5836),u=r(9191);class a{static from1DArray(t,e,r){if(t*e!==r.length)throw new RangeError("data length does not match given dimensions");let n=new c(t,e);for(let s=0;s<t;s++)for(let t=0;t<e;t++)n.set(s,t,r[s*e+t]);return n}static rowVector(t){let e=new c(1,t.length);for(let r=0;r<t.length;r++)e.set(0,r,t[r]);return e}static columnVector(t){let e=new c(t.length,1);for(let r=0;r<t.length;r++)e.set(r,0,t[r]);return e}static zeros(t,e){return new c(t,e)}static ones(t,e){return new c(t,e).fill(1)}static rand(t,e,r={}){if("object"!=typeof r)throw new TypeError("options must be an object");const{random:n=Math.random}=r;let s=new c(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++)s.set(r,t,n());return s}static randInt(t,e,r={}){if("object"!=typeof r)throw new TypeError("options must be an object");const{min:n=0,max:s=1e3,random:o=Math.random}=r;if(!Number.isInteger(n))throw new TypeError("min must be an integer");if(!Number.isInteger(s))throw new TypeError("max must be an integer");if(n>=s)throw new RangeError("min must be smaller than max");let i=s-n,h=new c(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++){let e=n+Math.round(o()*i);h.set(r,t,e)}return h}static eye(t,e,r){void 0===e&&(e=t),void 0===r&&(r=1);let n=Math.min(t,e),s=this.zeros(t,e);for(let t=0;t<n;t++)s.set(t,t,r);return s}static diag(t,e,r){let n=t.length;void 0===e&&(e=n),void 0===r&&(r=e);let s=Math.min(n,e,r),o=this.zeros(e,r);for(let e=0;e<s;e++)o.set(e,e,t[e]);return o}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let r=t.rows,n=t.columns,s=new c(r,n);for(let o=0;o<r;o++)for(let r=0;r<n;r++)s.set(o,r,Math.min(t.get(o,r),e.get(o,r)));return s}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let r=t.rows,n=t.columns,s=new this(r,n);for(let o=0;o<r;o++)for(let r=0;r<n;r++)s.set(o,r,Math.max(t.get(o,r),e.get(o,r)));return s}static checkMatrix(t){return a.isMatrix(t)?t:new c(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t.call(this,e,r);return this}to1DArray(){let t=[];for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t.push(this.get(e,r));return t}to2DArray(){let t=[];for(let e=0;e<this.rows;e++){t.push([]);for(let r=0;r<this.columns;r++)t[e].push(this.get(e,r))}return t}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let t=0;t<this.rows;t++)for(let e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,r=-1,n=!0,s=!1;for(;t<this.rows&&n;){for(e=0,s=!1;e<this.columns&&!1===s;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>r?(s=!0,r=e):(n=!1,s=!0);t++}return n}isReducedEchelonForm(){let t=0,e=0,r=-1,n=!0,s=!1;for(;t<this.rows&&n;){for(e=0,s=!1;e<this.columns&&!1===s;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>r?(s=!0,r=e):(n=!1,s=!0);for(let r=e+1;r<this.rows;r++)0!==this.get(t,r)&&(n=!1);t++}return n}echelonForm(){let t=this.clone(),e=0,r=0;for(;e<t.rows&&r<t.columns;){let n=e;for(let s=e;s<t.rows;s++)t.get(s,r)>t.get(n,r)&&(n=s);if(0===t.get(n,r))r++;else{t.swapRows(e,n);let s=t.get(e,r);for(let n=r;n<t.columns;n++)t.set(e,n,t.get(e,n)/s);for(let n=e+1;n<t.rows;n++){let s=t.get(n,r)/t.get(e,r);t.set(n,r,0);for(let o=r+1;o<t.columns;o++)t.set(n,o,t.get(n,o)-t.get(e,o)*s)}e++,r++}}return t}reducedEchelonForm(){let t=this.echelonForm(),e=t.columns,r=t.rows,n=r-1;for(;n>=0;)if(0===t.maxRow(n))n--;else{let s=0,o=!1;for(;s<r&&!1===o;)1===t.get(n,s)?o=!0:s++;for(let r=0;r<n;r++){let o=t.get(r,s);for(let i=s;i<e;i++){let e=t.get(r,i)-o*t.get(n,i);t.set(r,i,e)}}n--}return t}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:r=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(r)||r<=0)throw new TypeError("columns must be a positive integer");let n=new c(this.rows*e,this.columns*r);for(let t=0;t<e;t++)for(let e=0;e<r;e++)n.setSubMatrix(this,this.rows*t,this.columns*e);return n}fill(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,t);return this}neg(){return this.mulS(-1)}getRow(t){(0,u.zb)(this,t);let e=[];for(let r=0;r<this.columns;r++)e.push(this.get(t,r));return e}getRowVector(t){return c.rowVector(this.getRow(t))}setRow(t,e){(0,u.zb)(this,t),e=(0,u.on)(this,e);for(let r=0;r<this.columns;r++)this.set(t,r,e[r]);return this}swapRows(t,e){(0,u.zb)(this,t),(0,u.zb)(this,e);for(let r=0;r<this.columns;r++){let n=this.get(t,r);this.set(t,r,this.get(e,r)),this.set(e,r,n)}return this}getColumn(t){(0,u.bp)(this,t);let e=[];for(let r=0;r<this.rows;r++)e.push(this.get(r,t));return e}getColumnVector(t){return c.columnVector(this.getColumn(t))}setColumn(t,e){(0,u.bp)(this,t),e=(0,u.Um)(this,e);for(let r=0;r<this.rows;r++)this.set(r,t,e[r]);return this}swapColumns(t,e){(0,u.bp)(this,t),(0,u.bp)(this,e);for(let r=0;r<this.rows;r++){let n=this.get(r,t);this.set(r,t,this.get(r,e)),this.set(r,e,n)}return this}addRowVector(t){t=(0,u.on)(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t[r]);return this}subRowVector(t){t=(0,u.on)(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t[r]);return this}mulRowVector(t){t=(0,u.on)(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t[r]);return this}divRowVector(t){t=(0,u.on)(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t[r]);return this}addColumnVector(t){t=(0,u.Um)(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t[e]);return this}subColumnVector(t){t=(0,u.Um)(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t[e]);return this}mulColumnVector(t){t=(0,u.Um)(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t[e]);return this}divColumnVector(t){t=(0,u.Um)(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t[e]);return this}mulRow(t,e){(0,u.zb)(this,t);for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e);return this}mulColumn(t,e){(0,u.bp)(this,t);for(let r=0;r<this.rows;r++)this.set(r,t,this.get(r,t)*e);return this}max(t){if(this.isEmpty())return NaN;switch(t){case"row":{const t=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.get(e,r)>t[e]&&(t[e]=this.get(e,r));return t}case"column":{const t=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.get(e,r)>t[r]&&(t[r]=this.get(e,r));return t}case void 0:{let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.get(e,r)>t&&(t=this.get(e,r));return t}default:throw new Error(`invalid option: ${t}`)}}maxIndex(){(0,u.cT)(this);let t=this.get(0,0),e=[0,0];for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>t&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}min(t){if(this.isEmpty())return NaN;switch(t){case"row":{const t=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.get(e,r)<t[e]&&(t[e]=this.get(e,r));return t}case"column":{const t=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.get(e,r)<t[r]&&(t[r]=this.get(e,r));return t}case void 0:{let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.get(e,r)<t&&(t=this.get(e,r));return t}default:throw new Error(`invalid option: ${t}`)}}minIndex(){(0,u.cT)(this);let t=this.get(0,0),e=[0,0];for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<t&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}maxRow(t){if((0,u.zb)(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r));return e}maxRowIndex(t){(0,u.zb)(this,t),(0,u.cT)(this);let e=this.get(t,0),r=[t,0];for(let n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n),r[1]=n);return r}minRow(t){if((0,u.zb)(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r));return e}minRowIndex(t){(0,u.zb)(this,t),(0,u.cT)(this);let e=this.get(t,0),r=[t,0];for(let n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n),r[1]=n);return r}maxColumn(t){if((0,u.bp)(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t));return e}maxColumnIndex(t){(0,u.bp)(this,t),(0,u.cT)(this);let e=this.get(0,t),r=[0,t];for(let n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t),r[0]=n);return r}minColumn(t){if((0,u.bp)(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t));return e}minColumnIndex(t){(0,u.bp)(this,t),(0,u.cT)(this);let e=this.get(0,t),r=[0,t];for(let n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t),r[0]=n);return r}diag(){let t=Math.min(this.rows,this.columns),e=[];for(let r=0;r<t;r++)e.push(this.get(r,r));return e}norm(t="frobenius"){let e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e+=this.get(t,r)*this.get(t,r);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){let t=0;for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t+=this.get(e,r),this.set(e,r,t);return this}dot(t){a.isMatrix(t)&&(t=t.to1DArray());let e=this.to1DArray();if(e.length!==t.length)throw new RangeError("vectors do not have the same size");let r=0;for(let n=0;n<e.length;n++)r+=e[n]*t[n];return r}mmul(t){t=c.checkMatrix(t);let e=this.rows,r=this.columns,n=t.columns,s=new c(e,n),o=new Float64Array(r);for(let i=0;i<n;i++){for(let e=0;e<r;e++)o[e]=t.get(e,i);for(let t=0;t<e;t++){let e=0;for(let n=0;n<r;n++)e+=this.get(t,n)*o[n];s.set(t,i,e)}}return s}strassen2x2(t){t=c.checkMatrix(t);let e=new c(2,2);const r=this.get(0,0),n=t.get(0,0),s=this.get(0,1),o=t.get(0,1),i=this.get(1,0),h=t.get(1,0),u=this.get(1,1),a=t.get(1,1),l=(r+u)*(n+a),f=(i+u)*n,d=r*(o-a),g=u*(h-n),p=(r+s)*a,w=l+g-p+(s-u)*(h+a),m=d+p,y=f+g,v=l-f+d+(i-r)*(n+o);return e.set(0,0,w),e.set(0,1,m),e.set(1,0,y),e.set(1,1,v),e}strassen3x3(t){t=c.checkMatrix(t);let e=new c(3,3);const r=this.get(0,0),n=this.get(0,1),s=this.get(0,2),o=this.get(1,0),i=this.get(1,1),h=this.get(1,2),u=this.get(2,0),a=this.get(2,1),l=this.get(2,2),f=t.get(0,0),d=t.get(0,1),g=t.get(0,2),p=t.get(1,0),w=t.get(1,1),m=t.get(1,2),y=t.get(2,0),v=t.get(2,1),b=t.get(2,2),x=(r-o)*(-d+w),M=(-r+o+i)*(f-d+w),E=(o+i)*(-f+d),_=r*f,N=(-r+u+a)*(f-g+m),Z=(-r+u)*(g-m),S=(u+a)*(-f+g),A=(-s+a+l)*(w+y-v),k=(s-l)*(w-v),T=s*y,R=(a+l)*(-y+v),z=(-s+i+h)*(m+y-b),I=(s-h)*(m-b),C=(i+h)*(-y+b),P=_+T+n*p,j=(r+n+s-o-i-a-l)*w+M+E+_+A+T+R,q=_+N+S+(r+n+s-i-h-u-a)*m+T+z+C,O=x+i*(-f+d+p-w-m-y+b)+M+_+T+z+I,V=x+M+E+_+h*v,D=T+z+I+C+o*g,F=_+N+Z+a*(-f+g+p-w-m-y+v)+A+k+T,U=A+k+T+R+u*d,$=_+N+Z+S+l*b;return e.set(0,0,P),e.set(0,1,j),e.set(0,2,q),e.set(1,0,O),e.set(1,1,V),e.set(1,2,D),e.set(2,0,F),e.set(2,1,U),e.set(2,2,$),e}mmulStrassen(t){t=c.checkMatrix(t);let e=this.clone(),r=e.rows,n=e.columns,s=t.rows,o=t.columns;function i(t,e,r){let n=t.rows,s=t.columns;if(n===e&&s===r)return t;{let n=a.zeros(e,r);return n=n.setSubMatrix(t,0,0),n}}n!==s&&console.warn(`Multiplying ${r} x ${n} and ${s} x ${o} matrix: dimensions do not match.`);let h=Math.max(r,s),u=Math.max(n,o);return e=i(e,h,u),function t(e,r,n,s){if(n<=512||s<=512)return e.mmul(r);n%2==1&&s%2==1?(e=i(e,n+1,s+1),r=i(r,n+1,s+1)):n%2==1?(e=i(e,n+1,s),r=i(r,n+1,s)):s%2==1&&(e=i(e,n,s+1),r=i(r,n,s+1));let o=parseInt(e.rows/2,10),h=parseInt(e.columns/2,10),u=e.subMatrix(0,o-1,0,h-1),l=r.subMatrix(0,o-1,0,h-1),c=e.subMatrix(0,o-1,h,e.columns-1),f=r.subMatrix(0,o-1,h,r.columns-1),d=e.subMatrix(o,e.rows-1,0,h-1),g=r.subMatrix(o,r.rows-1,0,h-1),p=e.subMatrix(o,e.rows-1,h,e.columns-1),w=r.subMatrix(o,r.rows-1,h,r.columns-1),m=t(a.add(u,p),a.add(l,w),o,h),y=t(a.add(d,p),l,o,h),v=t(u,a.sub(f,w),o,h),b=t(p,a.sub(g,l),o,h),x=t(a.add(u,c),w,o,h),M=t(a.sub(d,u),a.add(l,f),o,h),E=t(a.sub(c,p),a.add(g,w),o,h),_=a.add(m,b);_.sub(x),_.add(E);let N=a.add(v,x),Z=a.add(y,b),S=a.sub(m,y);S.add(v),S.add(M);let A=a.zeros(2*_.rows,2*_.columns);return A=A.setSubMatrix(_,0,0),A=A.setSubMatrix(N,_.rows,0),A=A.setSubMatrix(Z,0,_.columns),A=A.setSubMatrix(S,_.rows,_.columns),A.subMatrix(0,n-1,0,s-1)}(e,t=i(t,h,u),h,u)}scaleRows(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:r=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(e>=r)throw new RangeError("min must be smaller than max");let n=new c(this.rows,this.columns);for(let t=0;t<this.rows;t++){const o=this.getRow(t);o.length>0&&(0,s.Z)(o,{min:e,max:r,output:o}),n.setRow(t,o)}return n}scaleColumns(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:r=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(e>=r)throw new RangeError("min must be smaller than max");let n=new c(this.rows,this.columns);for(let t=0;t<this.columns;t++){const o=this.getColumn(t);o.length&&(0,s.Z)(o,{min:e,max:r,output:o}),n.setColumn(t,o)}return n}flipRows(){const t=Math.ceil(this.columns/2);for(let e=0;e<this.rows;e++)for(let r=0;r<t;r++){let t=this.get(e,r),n=this.get(e,this.columns-1-r);this.set(e,r,n),this.set(e,this.columns-1-r,t)}return this}flipColumns(){const t=Math.ceil(this.rows/2);for(let e=0;e<this.columns;e++)for(let r=0;r<t;r++){let t=this.get(r,e),n=this.get(this.rows-1-r,e);this.set(r,e,n),this.set(this.rows-1-r,e,t)}return this}kroneckerProduct(t){t=c.checkMatrix(t);let e=this.rows,r=this.columns,n=t.rows,s=t.columns,o=new c(e*n,r*s);for(let i=0;i<e;i++)for(let e=0;e<r;e++)for(let r=0;r<n;r++)for(let h=0;h<s;h++)o.set(n*i+r,s*e+h,this.get(i,e)*t.get(r,h));return o}kroneckerSum(t){if(t=c.checkMatrix(t),!this.isSquare()||!t.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let e=this.rows,r=t.rows,n=this.kroneckerProduct(c.eye(r,r)),s=c.eye(e,e).kroneckerProduct(t);return n.add(s)}transpose(){let t=new c(this.columns,this.rows);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t.set(r,e,this.get(e,r));return t}sortRows(t=l){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=l){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,r,n){(0,u.J5)(this,t,e,r,n);let s=new c(e-t+1,n-r+1);for(let o=t;o<=e;o++)for(let e=r;e<=n;e++)s.set(o-t,e-r,this.get(o,e));return s}subMatrixRow(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.columns-1),e>r||e<0||e>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");let n=new c(t.length,r-e+1);for(let s=0;s<t.length;s++)for(let o=e;o<=r;o++){if(t[s]<0||t[s]>=this.rows)throw new RangeError(`Row index out of range: ${t[s]}`);n.set(s,o-e,this.get(t[s],o))}return n}subMatrixColumn(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.rows-1),e>r||e<0||e>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");let n=new c(r-e+1,t.length);for(let s=0;s<t.length;s++)for(let o=e;o<=r;o++){if(t[s]<0||t[s]>=this.columns)throw new RangeError(`Column index out of range: ${t[s]}`);n.set(o-e,s,this.get(o,t[s]))}return n}setSubMatrix(t,e,r){if((t=c.checkMatrix(t)).isEmpty())return this;let n=e+t.rows-1,s=r+t.columns-1;(0,u.J5)(this,e,n,r,s);for(let n=0;n<t.rows;n++)for(let s=0;s<t.columns;s++)this.set(e+n,r+s,t.get(n,s));return this}selection(t,e){(0,u.ZR)(this,t),(0,u.g)(this,e);let r=new c(t.length,e.length);for(let n=0;n<t.length;n++){let s=t[n];for(let t=0;t<e.length;t++){let o=e[t];r.set(n,t,this.get(s,o))}}return r}trace(){let t=Math.min(this.rows,this.columns),e=0;for(let r=0;r<t;r++)e+=this.get(r,r);return e}clone(){let t=new c(this.rows,this.columns);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t.set(e,r,this.get(e,r));return t}sum(t){switch(t){case"row":return(0,h.bQ)(this);case"column":return(0,h.Dm)(this);case void 0:return(0,h.xo)(this);default:throw new Error(`invalid option: ${t}`)}}product(t){switch(t){case"row":return(0,h.Pw)(this);case"column":return(0,h.PI)(this);case void 0:return(0,h.tT)(this);default:throw new Error(`invalid option: ${t}`)}}mean(t){const e=this.sum(t);switch(t){case"row":for(let t=0;t<this.rows;t++)e[t]/=this.columns;return e;case"column":for(let t=0;t<this.columns;t++)e[t]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error(`invalid option: ${t}`)}}variance(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{unbiased:r=!0,mean:s=this.mean(t)}=e;if("boolean"!=typeof r)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!(0,n.N)(s))throw new TypeError("mean must be an array");return(0,h.we)(this,r,s);case"column":if(!(0,n.N)(s))throw new TypeError("mean must be an array");return(0,h._G)(this,r,s);case void 0:if("number"!=typeof s)throw new TypeError("mean must be a number");return(0,h.C)(this,r,s);default:throw new Error(`invalid option: ${t}`)}}standardDeviation(t,e){"object"==typeof t&&(e=t,t=void 0);const r=this.variance(t,e);if(void 0===t)return Math.sqrt(r);for(let t=0;t<r.length;t++)r[t]=Math.sqrt(r[t]);return r}center(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{center:r=this.mean(t)}=e;switch(t){case"row":if(!(0,n.N)(r))throw new TypeError("center must be an array");return(0,h.rU)(this,r),this;case"column":if(!(0,n.N)(r))throw new TypeError("center must be an array");return(0,h._f)(this,r),this;case void 0:if("number"!=typeof r)throw new TypeError("center must be a number");return(0,h.mm)(this,r),this;default:throw new Error(`invalid option: ${t}`)}}scale(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");let r=e.scale;switch(t){case"row":if(void 0===r)r=(0,h.kn)(this);else if(!(0,n.N)(r))throw new TypeError("scale must be an array");return(0,h.DU)(this,r),this;case"column":if(void 0===r)r=(0,h.Pr)(this);else if(!(0,n.N)(r))throw new TypeError("scale must be an array");return(0,h.Mj)(this,r),this;case void 0:if(void 0===r)r=(0,h.Y2)(this);else if("number"!=typeof r)throw new TypeError("scale must be a number");return(0,h.td)(this,r),this;default:throw new Error(`invalid option: ${t}`)}}toString(t){return(0,o.M)(this,t)}}function l(t,e){return t-e}a.prototype.klass="Matrix","undefined"!=typeof Symbol&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.V),a.random=a.rand,a.randomInt=a.randInt,a.diagonal=a.diag,a.prototype.diagonal=a.prototype.diag,a.identity=a.eye,a.prototype.negate=a.prototype.neg,a.prototype.tensorProduct=a.prototype.kroneckerProduct;class c extends a{constructor(t,e){if(super(),c.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>=0){if(this.data=[],!(Number.isInteger(e)&&e>=0))throw new TypeError("nColumns must be a positive integer");for(let r=0;r<t;r++)this.data.push(new Float64Array(e))}else{if(!(0,n.N)(t))throw new TypeError("First argument must be a positive number or an array");{const r=t;if("number"!=typeof(e=(t=r.length)?r[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let n=0;n<t;n++){if(r[n].length!==e)throw new RangeError("Inconsistent array dimensions");if(!r[n].every((t=>"number"==typeof t)))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(r[n]))}}}this.rows=t,this.columns=e}set(t,e,r){return this.data[t][e]=r,this}get(t,e){return this.data[t][e]}removeRow(t){return(0,u.zb)(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),(0,u.zb)(this,t,!0),e=Float64Array.from((0,u.on)(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){(0,u.bp)(this,t);for(let e=0;e<this.rows;e++){const r=new Float64Array(this.columns-1);for(let n=0;n<t;n++)r[n]=this.data[e][n];for(let n=t+1;n<this.columns;n++)r[n-1]=this.data[e][n];this.data[e]=r}return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),(0,u.bp)(this,t,!0),e=(0,u.Um)(this,e);for(let r=0;r<this.rows;r++){const n=new Float64Array(this.columns+1);let s=0;for(;s<t;s++)n[s]=this.data[r][s];for(n[s++]=e[r];s<this.columns+1;s++)n[s]=this.data[r][s-1];this.data[r]=n}return this.columns+=1,this}}(0,i.z)(a,c)},5836:(t,e,r)=>{"use strict";r.d(e,{bQ:()=>s,Dm:()=>o,xo:()=>i,Pw:()=>h,PI:()=>u,tT:()=>a,we:()=>l,_G:()=>c,C:()=>f,rU:()=>d,_f:()=>g,mm:()=>p,kn:()=>w,DU:()=>m,Pr:()=>y,Mj:()=>v,Y2:()=>b,td:()=>x});var n=r(9191);function s(t){let e=(0,n.B4)(t.rows);for(let r=0;r<t.rows;++r)for(let n=0;n<t.columns;++n)e[r]+=t.get(r,n);return e}function o(t){let e=(0,n.B4)(t.columns);for(let r=0;r<t.rows;++r)for(let n=0;n<t.columns;++n)e[n]+=t.get(r,n);return e}function i(t){let e=0;for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)e+=t.get(r,n);return e}function h(t){let e=(0,n.B4)(t.rows,1);for(let r=0;r<t.rows;++r)for(let n=0;n<t.columns;++n)e[r]*=t.get(r,n);return e}function u(t){let e=(0,n.B4)(t.columns,1);for(let r=0;r<t.rows;++r)for(let n=0;n<t.columns;++n)e[n]*=t.get(r,n);return e}function a(t){let e=1;for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)e*=t.get(r,n);return e}function l(t,e,r){const n=t.rows,s=t.columns,o=[];for(let i=0;i<n;i++){let n=0,h=0,u=0;for(let e=0;e<s;e++)u=t.get(i,e)-r[i],n+=u,h+=u*u;e?o.push((h-n*n/s)/(s-1)):o.push((h-n*n/s)/s)}return o}function c(t,e,r){const n=t.rows,s=t.columns,o=[];for(let i=0;i<s;i++){let s=0,h=0,u=0;for(let e=0;e<n;e++)u=t.get(e,i)-r[i],s+=u,h+=u*u;e?o.push((h-s*s/n)/(n-1)):o.push((h-s*s/n)/n)}return o}function f(t,e,r){const n=t.rows,s=t.columns,o=n*s;let i=0,h=0,u=0;for(let e=0;e<n;e++)for(let n=0;n<s;n++)u=t.get(e,n)-r,i+=u,h+=u*u;return e?(h-i*i/o)/(o-1):(h-i*i/o)/o}function d(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)-e[r])}function g(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)-e[n])}function p(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)-e)}function w(t){const e=[];for(let r=0;r<t.rows;r++){let n=0;for(let e=0;e<t.columns;e++)n+=Math.pow(t.get(r,e),2)/(t.columns-1);e.push(Math.sqrt(n))}return e}function m(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)/e[r])}function y(t){const e=[];for(let r=0;r<t.columns;r++){let n=0;for(let e=0;e<t.rows;e++)n+=Math.pow(t.get(e,r),2)/(t.rows-1);e.push(Math.sqrt(n))}return e}function v(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)/e[n])}function b(t){const e=t.size-1;let r=0;for(let n=0;n<t.columns;n++)for(let s=0;s<t.rows;s++)r+=Math.pow(t.get(s,n),2)/e;return Math.sqrt(r)}function x(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)/e)}},9191:(t,e,r)=>{"use strict";r.d(e,{zb:()=>s,bp:()=>o,on:()=>i,Um:()=>h,ZR:()=>u,g:()=>a,J5:()=>l,B4:()=>c,cT:()=>d});var n=r(2751);function s(t,e,r){let n=r?t.rows:t.rows-1;if(e<0||e>n)throw new RangeError("Row index out of range")}function o(t,e,r){let n=r?t.columns:t.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function i(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function h(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function u(t,e){if(!(0,n.N)(e))throw new TypeError("row indices must be an array");for(let r=0;r<e.length;r++)if(e[r]<0||e[r]>=t.rows)throw new RangeError("row indices are out of range")}function a(t,e){if(!(0,n.N)(e))throw new TypeError("column indices must be an array");for(let r=0;r<e.length;r++)if(e[r]<0||e[r]>=t.columns)throw new RangeError("column indices are out of range")}function l(t,e,r,n,s){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(f("startRow",e),f("endRow",r),f("startColumn",n),f("endColumn",s),e>r||n>s||e<0||e>=t.rows||r<0||r>=t.rows||n<0||n>=t.columns||s<0||s>=t.columns)throw new RangeError("Submatrix indices are out of range")}function c(t,e=0){let r=[];for(let n=0;n<t;n++)r.push(e);return r}function f(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function d(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}},8807:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(2406);class s extends n.X{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,r){return this.data[t][e]=r,this}get(t,e){return this.data[t][e]}}},8802:(t,e,r)=>{"use strict";r.d(e,{ZT:()=>s,pi:()=>o,_T:()=>i,mG:()=>h,Jh:()=>u,CR:()=>a,ev:()=>l});var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)};function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var s in e=arguments[r])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},o.apply(this,arguments)};function i(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}function h(t,e,r,n){return new(r||(r=Promise))((function(s,o){function i(t){try{u(n.next(t))}catch(t){o(t)}}function h(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,h)}u((n=n.apply(t,e||[])).next())}))}function u(t,e){var r,n,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:h(0),throw:h(1),return:h(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function h(h){return function(u){return function(h){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,h[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&h[0]?n.return:h[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,h[1])).done)return s;switch(n=0,s&&(h=[2&h[0],s.value]),h[0]){case 0:case 1:s=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,n=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==h[0]&&2!==h[0])){i=0;continue}if(3===h[0]&&(!s||h[1]>s[0]&&h[1]<s[3])){i.label=h[1];break}if(6===h[0]&&i.label<s[1]){i.label=s[1],s=h;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(h);break}s[2]&&i.ops.pop(),i.trys.pop();continue}h=e.call(t,i)}catch(t){h=[6,t],n=0}finally{r=s=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([h,u])}}}function a(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,s,o=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i}function l(t,e,r){if(r||2===arguments.length)for(var n,s=0,o=e.length;s<o;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}Object.create,Object.create}}]);
3
+ //# sourceMappingURL=435.index.min.js.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */