@loaders.gl/pcd 3.1.0-alpha.3 → 4.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/pcd",
3
- "version": "3.1.0-alpha.3",
3
+ "version": "4.0.0-alpha.4",
4
4
  "description": "Framework-independent loader for the PCD format",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -29,12 +29,12 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "pre-build": "npm run build-worker && npm run build-bundle",
32
- "build-bundle": "webpack --display=minimal --config ../../scripts/webpack/bundle.js",
33
- "build-worker": "webpack --entry ./src/workers/pcd-worker.ts --output ./dist/pcd-worker.js --config ../../scripts/webpack/worker.js"
32
+ "build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/bundle.js",
33
+ "build-worker": "esbuild src/workers/pcd-worker.ts --bundle --outfile=dist/pcd-worker.js"
34
34
  },
35
35
  "dependencies": {
36
- "@loaders.gl/loader-utils": "3.1.0-alpha.3",
37
- "@loaders.gl/schema": "3.1.0-alpha.3"
36
+ "@loaders.gl/loader-utils": "4.0.0-alpha.4",
37
+ "@loaders.gl/schema": "4.0.0-alpha.4"
38
38
  },
39
- "gitHead": "68e1c443d1b63aa2515436a7411ed0a029b42c15"
39
+ "gitHead": "53026061b3c8871f7e96d3a5826125cc6613bddc"
40
40
  }
package/dist/dist.min.js DELETED
@@ -1,2 +0,0 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){const i=n(2);globalThis.loaders=globalThis.loaders||{},t.exports=Object.assign(globalThis.loaders,i)},,function(t,e,n){"use strict";function i(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let t=0;t<l;t+=3){const l=a[t],u=a[t+1],c=a[t+2];e=l<e?l:e,n=u<n?u:n,i=c<i?c:i,r=l>r?l:r,o=u>o?u:o,s=c>s?c:s}return[[e,n,i],[r,o,s]]}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.r(e),n.d(e,"PCDWorkerLoader",(function(){return O})),n.d(e,"PCDLoader",(function(){return z})),n.d(e,"_typecheckPCDLoader",(function(){return M}));class o{constructor(t,e,n=!1,i=new Map){r(this,"name",void 0),r(this,"type",void 0),r(this,"nullable",void 0),r(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new o(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?", metadata: "+this.metadata:""}`}}let s,a,l,u,c,d,p,f,h;function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(s||(s={}));class y{static isNull(t){return t&&t.typeId===s.Null}static isInt(t){return t&&t.typeId===s.Int}static isFloat(t){return t&&t.typeId===s.Float}static isBinary(t){return t&&t.typeId===s.Binary}static isUtf8(t){return t&&t.typeId===s.Utf8}static isBool(t){return t&&t.typeId===s.Bool}static isDecimal(t){return t&&t.typeId===s.Decimal}static isDate(t){return t&&t.typeId===s.Date}static isTime(t){return t&&t.typeId===s.Time}static isTimestamp(t){return t&&t.typeId===s.Timestamp}static isInterval(t){return t&&t.typeId===s.Interval}static isList(t){return t&&t.typeId===s.List}static isStruct(t){return t&&t.typeId===s.Struct}static isUnion(t){return t&&t.typeId===s.Union}static isFixedSizeBinary(t){return t&&t.typeId===s.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===s.FixedSizeList}static isMap(t){return t&&t.typeId===s.Map}static isDictionary(t){return t&&t.typeId===s.Dictionary}get typeId(){return s.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;a=Symbol.toStringTag;class g extends y{constructor(t,e){super(),m(this,"isSigned",void 0),m(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return s.Int}get[a](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class b extends g{constructor(){super(!1,8)}}const S=32;l=Symbol.toStringTag;class I extends y{constructor(t){super(),m(this,"precision",void 0),this.precision=t}get typeId(){return s.Float}get[l](){return"Float"}toString(){return"Float"+this.precision}}class T extends I{constructor(){super(S)}}Symbol.toStringTag;Symbol.toStringTag;u=Symbol.toStringTag;c=Symbol.toStringTag;d=Symbol.toStringTag;p=Symbol.toStringTag;f=Symbol.toStringTag;class w extends y{constructor(t,e){super(),m(this,"listSize",void 0),m(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return s.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[f](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}h=Symbol.toStringTag;function v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class x{constructor(t,e){v(this,"fields",void 0),v(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const n of t)e[n.name]&&console.warn("Schema: duplicated field name",n.name,n),e[n.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){const e=Object.create(null);for(const n of t)e[n]=!0;const n=this.fields.filter(t=>e[t.name]);return new x(n,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new x(e,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof x){const i=t;e=i.fields,n=F(F(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const t of this.fields)i[t.name]=t;for(const t of e)i[t.name]=t;const r=Object.values(i);return new x(r,n)}}function F(t,e){return new Map([...t||new Map,...e||new Map])}function D(t){const e=(new TextDecoder).decode(t),n=function(t){const e=t.search(/[\r\n]DATA\s(\S*)\s/i),n=/[\r\n]DATA\s(\S*)\s/i.exec(t.substr(e-1)),i={};i.data=n&&n[1],null!==n&&(i.headerLen=(n&&n[0].length)+e);i.str=t.substr(0,i.headerLen),i.str=i.str.replace(/\#.*/gi,""),i.version=/VERSION (.*)/i.exec(i.str),i.fields=/FIELDS (.*)/i.exec(i.str),i.size=/SIZE (.*)/i.exec(i.str),i.type=/TYPE (.*)/i.exec(i.str),i.count=/COUNT (.*)/i.exec(i.str),i.width=/WIDTH (.*)/i.exec(i.str),i.height=/HEIGHT (.*)/i.exec(i.str),i.viewpoint=/VIEWPOINT (.*)/i.exec(i.str),i.points=/POINTS (.*)/i.exec(i.str),null!==i.version&&(i.version=parseFloat(i.version[1]));null!==i.fields&&(i.fields=i.fields[1].split(" "));null!==i.type&&(i.type=i.type[1].split(" "));null!==i.width&&(i.width=parseInt(i.width[1],10));null!==i.height&&(i.height=parseInt(i.height[1],10));null!==i.viewpoint&&(i.viewpoint=i.viewpoint[1]);null!==i.points&&(i.points=parseInt(i.points[1],10));null===i.points&&"number"==typeof i.width&&"number"==typeof i.height&&(i.points=i.width*i.height);null!==i.size&&(i.size=i.size[1].split(" ").map(t=>parseInt(t,10)));if(null!==i.count)i.count=i.count[1].split(" ").map(t=>parseInt(t,10));else if(i.count=[],null!==i.fields)for(let t=0;t<i.fields.length;t++)i.count.push(1);i.offset={};let r=0;if(null!==i.fields&&null!==i.size)for(let t=0;t<i.fields.length;t++)"ascii"===i.data?i.offset[i.fields[t]]=t:(i.offset[i.fields[t]]=r,r+=i.size[t]);return i.rowSize=r,i}(e);let r={};switch(n.data){case"ascii":r=function(t,e){const n=[],i=[],r=[],o=t.offset,s=e.substr(t.headerLen).split("\n");for(let t=0;t<s.length;t++)if(""!==s[t]){const e=s[t].split(" ");if(void 0!==o.x&&(n.push(parseFloat(e[o.x])),n.push(parseFloat(e[o.y])),n.push(parseFloat(e[o.z]))),void 0!==o.rgb){const t=parseFloat(e[o.rgb]),n=new Float32Array([t]),i=new DataView(n.buffer,0);r.push(i.getUint8(0)),r.push(i.getUint8(1)),r.push(i.getUint8(2))}void 0!==o.normal_x&&(i.push(parseFloat(e[o.normal_x])),i.push(parseFloat(e[o.normal_y])),i.push(parseFloat(e[o.normal_z])))}return{position:n,normal:i,color:r}}(n,e);break;case"binary":r=function(t,e){const n=[],i=[],r=[],o=new DataView(e,t.headerLen),s=t.offset;for(let e=0,a=0;e<t.points;e++,a+=t.rowSize)void 0!==s.x&&(n.push(o.getFloat32(a+s.x,!0)),n.push(o.getFloat32(a+s.y,!0)),n.push(o.getFloat32(a+s.z,!0))),void 0!==s.rgb&&(r.push(o.getUint8(a+s.rgb+0)),r.push(o.getUint8(a+s.rgb+1)),r.push(o.getUint8(a+s.rgb+2))),void 0!==s.normal_x&&(i.push(o.getFloat32(a+s.normal_x,!0)),i.push(o.getFloat32(a+s.normal_y,!0)),i.push(o.getFloat32(a+s.normal_z,!0)));return{position:n,normal:i,color:r}}(n,t);break;case"binary_compressed":default:throw new Error(`PCD: ${n.data} files are not supported`)}r=function(t){const e={POSITION:{value:new Float32Array(t.position),size:3}};t.normal&&t.normal.length>0&&(e.NORMAL={value:new Float32Array(t.normal),size:3});t.color&&t.color.length>0&&(e.COLOR_0={value:new Uint8Array(t.color),size:3});return e}(r);const s=function(t,e){if("number"==typeof t.width&&"number"==typeof t.height){return{vertexCount:t.width*t.height,boundingBox:i(e)}}return t}(n,r);return{loaderData:{header:n},header:s,schema:function(t,e){const n=t.offset,i=[];return void 0!==n.x&&i.push(new o("POSITION",new w(3,new o("xyz",new T)),!1)),void 0!==n.normal_x&&i.push(new o("NORMAL",new w(3,new o("xyz",new T)),!1)),void 0!==n.rgb&&i.push(new o("COLOR_0",new w(3,new o("rgb",new b)),!1)),new x(i,e)}(n,new Map([["mode","0"],["boundingBox",JSON.stringify(s.boundingBox)]])),mode:0,indices:null,attributes:r}}const O={name:"PCD (Point Cloud Data)",id:"pcd",module:"pcd",version:"3.1.0-alpha.3",worker:!0,extensions:["pcd"],mimeTypes:["text/plain"],options:{pcd:{}}},z={...O,parse:async t=>D(t),parseSync:D},M=z}])}));
2
- //# sourceMappingURL=dist.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./src/bundle.ts","webpack:///../schema/src/category/mesh/mesh-utils.ts","webpack:///../schema/src/lib/schema/impl/field.ts","webpack:///../schema/src/lib/schema/impl/enum.ts","webpack:///../schema/src/lib/schema/impl/type.ts","webpack:///../schema/src/lib/schema/impl/schema.ts","webpack:///../schema/src/lib/utils/assert.ts","webpack:///./src/lib/parse-pcd.ts","webpack:///./src/lib/get-pcd-schema.ts","webpack:///./src/pcd-loader.ts","webpack:///./src/index.ts"],"names":["root","factory","exports","module","define","amd","a","i","window","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","moduleExports","require","globalThis","loaders","assign","getMeshBoundingBox","attributes","minX","Infinity","minY","minZ","maxX","maxY","maxZ","positions","POSITION","len","length","x","y","z","Field","constructor","type","nullable","metadata","Map","this","typeId","clone","compareTo","other","toString","Type","DataType","Null","Int","Float","Binary","Utf8","Bool","Decimal","Date","Time","Timestamp","Interval","List","Struct","Union","FixedSizeBinary","FixedSizeList","Dictionary","NONE","isSigned","bitWidth","super","Uint8","Precision","precision","Float32","listSize","child","children","valueType","Schema","fields","condition","message","Error","assert","Array","isArray","usedNames","field","console","warn","checkNames","select","columnNames","nameMap","selectedFields","filter","selectAt","columnIndices","map","index","Boolean","schemaOrFields","otherSchema","mergeMaps","fieldMap","mergedFields","values","m1","m2","parsePCD","data","textData","TextDecoder","decode","pcdHeader","result1","search","result2","exec","substr","headerLen","str","replace","version","size","count","width","height","viewpoint","points","parseFloat","split","parseInt","push","offset","sizeSum","rowSize","parsePCDHeader","position","normal","color","lines","line","undefined","rgb","floatValue","binaryColor","Float32Array","dataview","DataView","buffer","getUint8","normal_x","normal_y","normal_z","parsePCDASCII","row","getFloat32","parsePCDBinary","normalizedAttributes","NORMAL","COLOR_0","Uint8Array","getMeshAttributes","header","vertexCount","boundingBox","getMeshHeader","loaderData","schema","PCDheader","getPCDSchema","JSON","stringify","indices","PCDLoader","id","worker","extensions","mimeTypes","options","pcd","PCDWorkerLoader","parse","async","parsePCDSync","arrayBuffer","parseSync","_typecheckPCDLoader"],"mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KAAKD,GAAuB,iBAAZJ,QAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,IAPxE,CASGC,QAAQ,WACX,O,YCTE,IAAIC,EAA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MAKa2J,EAAY,CACvB1L,KAAM,yBACN2L,GAAI,MACJ1M,OAAQ,MACRqJ,QATc,gBAUdsD,QAAQ,EACRC,WAAY,CAAC,OACbC,UAAW,CAAC,cACZC,QAAS,CACPC,IAAK,KCTIN,EAAY,IACpBO,EACHC,MAAOC,SAAuBC,EAAaC,GAC3CC,UAAWF,GAGAG,EAAwCb","file":"dist.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n","// Mesh category utilities\n// TODO - move to mesh category module, or to math.gl/geometry module\nimport {TypedArray} from '../../types';\nimport {MeshAttributes} from './mesh-types';\n\ntype TypedArrays = {[key: string]: TypedArray};\n\n/**\n * Holds an axis aligned bounding box\n * TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)\n */\ntype BoundingBox = [[number, number, number], [number, number, number]];\n\n/**\n * Get number of vertices in mesh\n * @param attributes\n */\nexport function getMeshSize(attributes: TypedArrays): number {\n let size = 0;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n if (ArrayBuffer.isView(attribute)) {\n // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT\n size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;\n }\n }\n return size;\n}\n\n/**\n * Get the (axis aligned) bounding box of a mesh\n * @param attributes\n * @returns array of two vectors representing the axis aligned bounding box\n */\n// eslint-disable-next-line complexity\nexport function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {\n let minX = Infinity;\n let minY = Infinity;\n let minZ = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let maxZ = -Infinity;\n\n const positions = attributes.POSITION ? attributes.POSITION.value : [];\n const len = positions && positions.length;\n\n for (let i = 0; i < len; i += 3) {\n const x = positions[i];\n const y = positions[i + 1];\n const z = positions[i + 2];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n minZ = z < minZ ? z : minZ;\n\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n maxZ = z > maxZ ? z : maxZ;\n }\n return [\n [minX, minY, minZ],\n [maxX, maxY, maxZ]\n ];\n}\n","import {DataType} from './type';\n\n/**\n * ArrowJS `Field` API-compatible class for row-based tables\n * https://loaders.gl/arrowjs/docs/api-reference/field\n * A field holds name, nullable, and metadata information about a table \"column\"\n * A Schema is essentially a list of fields\n */\nexport default class Field {\n name: string;\n type: DataType;\n nullable: boolean;\n metadata: Map<string, string>;\n\n constructor(\n name: string,\n type: DataType,\n nullable = false,\n metadata: Map<string, string> = new Map()\n ) {\n this.name = name;\n this.type = type;\n this.nullable = nullable;\n this.metadata = metadata;\n }\n\n get typeId(): number {\n return this.type && this.type.typeId;\n }\n\n clone(): Field {\n return new Field(this.name, this.type, this.nullable, this.metadata);\n }\n\n compareTo(other: this): boolean {\n return (\n this.name === other.name &&\n this.type === other.type &&\n this.nullable === other.nullable &&\n this.metadata === other.metadata\n );\n }\n\n toString(): string {\n return `${this.type}${this.nullable ? ', nullable' : ''}${\n this.metadata ? `, metadata: ${this.metadata}` : ''\n }`;\n }\n}\n","// This code is adapted from ArrowJS https://github.com/apache/arrow\n// under Apache license http://www.apache.org/licenses/LICENSE-2.0\n\n/**\n * Main data type enumeration.\n *\n * Data types in this library are all *logical*. They can be expressed as\n * either a primitive physical type (bytes or bits of some fixed size), a\n * nested type consisting of other data types, or another data type (e.g. a\n * timestamp encoded as an int64).\n *\n * **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow\n * IPC payload.\n *\n * The rest of the values are specified here so TypeScript can narrow the type\n * signatures further beyond the base Arrow Types. The Arrow DataTypes include\n * metadata like `bitWidth` that impact the type signatures of the values we\n * accept and return.\n *\n * For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an\n * `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`\n * reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the\n * underlying `Int32Array`.\n *\n * Library consumers benefit by knowing the narrowest type, since we can ensure\n * the types across all public methods are propagated, and never bail to `any`.\n * These values are _never_ used at runtime, and they will _never_ be written\n * to the flatbuffers metadata of serialized Arrow IPC payloads.\n */\nexport enum Type {\n /** The default placeholder type */\n NONE = 0,\n /** A NULL type having no physical storage */\n Null = 1,\n /** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */\n Int = 2,\n /** 2, 4, or 8-byte floating point value */\n Float = 3,\n /** Variable-length bytes (no guarantee of UTF8-ness) */\n Binary = 4,\n /** UTF8 variable-length string as List<Char> */\n Utf8 = 5,\n /** Boolean as 1 bit, LSB bit-packed ordering */\n Bool = 6,\n /** Precision-and-scale-based decimal type. Storage type depends on the parameters. */\n Decimal = 7,\n /** int32_t days or int64_t milliseconds since the UNIX epoch */\n Date = 8,\n /** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */\n Time = 9,\n /** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */\n Timestamp = 10,\n /** YEAR_MONTH or DAY_TIME interval in SQL style */\n Interval = 11,\n /** A list of some logical data type */\n List = 12,\n /** Struct of logical types */\n Struct = 13,\n /** Union of logical types */\n Union = 14,\n /** Fixed-size binary. Each value occupies the same number of bytes */\n FixedSizeBinary = 15,\n /** Fixed-size list. Each value occupies the same number of bytes */\n FixedSizeList = 16,\n /** Map of named logical types */\n Map = 17,\n\n /** Dictionary aka Category type */\n Dictionary = -1,\n Int8 = -2,\n Int16 = -3,\n Int32 = -4,\n Int64 = -5,\n Uint8 = -6,\n Uint16 = -7,\n Uint32 = -8,\n Uint64 = -9,\n Float16 = -10,\n Float32 = -11,\n Float64 = -12,\n DateDay = -13,\n DateMillisecond = -14,\n TimestampSecond = -15,\n TimestampMillisecond = -16,\n TimestampMicrosecond = -17,\n TimestampNanosecond = -18,\n TimeSecond = -19,\n TimeMillisecond = -20,\n TimeMicrosecond = -21,\n TimeNanosecond = -22,\n DenseUnion = -23,\n SparseUnion = -24,\n IntervalDayTime = -25,\n IntervalYearMonth = -26\n}\n","// This code is adapted from ArrowJS https://github.com/apache/arrow\n// under Apache license http://www.apache.org/licenses/LICENSE-2.0\n\nimport {Type} from './enum';\n\nimport Field from './field';\n\nexport {Type} from './enum';\n\nexport type TypedIntArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Int32Array\n | Uint32Array\n | Uint8ClampedArray;\n\nexport type TypedFloatArray = Float32Array | Float64Array;\n\nexport type TypedArray = TypedIntArray | TypedFloatArray;\n\nexport type AnyArrayType = Array<any> | TypedIntArray | TypedFloatArray;\n\nexport class DataType {\n static isNull(x: any): boolean {\n return x && x.typeId === Type.Null;\n }\n static isInt(x: any): boolean {\n return x && x.typeId === Type.Int;\n }\n static isFloat(x: any): boolean {\n return x && x.typeId === Type.Float;\n }\n static isBinary(x: any): boolean {\n return x && x.typeId === Type.Binary;\n }\n static isUtf8(x: any): boolean {\n return x && x.typeId === Type.Utf8;\n }\n static isBool(x: any): boolean {\n return x && x.typeId === Type.Bool;\n }\n static isDecimal(x: any): boolean {\n return x && x.typeId === Type.Decimal;\n }\n static isDate(x: any): boolean {\n return x && x.typeId === Type.Date;\n }\n static isTime(x: any): boolean {\n return x && x.typeId === Type.Time;\n }\n static isTimestamp(x: any): boolean {\n return x && x.typeId === Type.Timestamp;\n }\n static isInterval(x: any): boolean {\n return x && x.typeId === Type.Interval;\n }\n static isList(x: any): boolean {\n return x && x.typeId === Type.List;\n }\n static isStruct(x: any): boolean {\n return x && x.typeId === Type.Struct;\n }\n static isUnion(x: any): boolean {\n return x && x.typeId === Type.Union;\n }\n static isFixedSizeBinary(x: any): boolean {\n return x && x.typeId === Type.FixedSizeBinary;\n }\n static isFixedSizeList(x: any): boolean {\n return x && x.typeId === Type.FixedSizeList;\n }\n static isMap(x: any): boolean {\n return x && x.typeId === Type.Map;\n }\n static isDictionary(x: any): boolean {\n return x && x.typeId === Type.Dictionary;\n }\n\n get typeId(): Type {\n return Type.NONE;\n }\n\n // get ArrayType(): AnyArrayType {\n // return Int8Array;\n // }\n\n // get ArrayType() { return Array; }\n compareTo(other: DataType): boolean {\n // TODO\n return this === other; // comparer.visit(this, other);\n }\n}\n\n// NULL\n\nexport class Null extends DataType {\n get typeId(): Type {\n return Type.Null;\n }\n get [Symbol.toStringTag](): string {\n return 'Null';\n }\n toString(): string {\n return 'Null';\n }\n}\n\n// BOOLEANS\n\nexport class Bool extends DataType {\n get typeId(): Type {\n return Type.Bool;\n }\n // get ArrayType() {\n // return Uint8Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Bool';\n }\n toString(): string {\n return 'Bool';\n }\n}\n\n// INTS\n\nexport class Int extends DataType {\n readonly isSigned: boolean;\n readonly bitWidth: number;\n constructor(isSigned, bitWidth) {\n super();\n this.isSigned = isSigned;\n this.bitWidth = bitWidth;\n }\n get typeId(): Type {\n return Type.Int;\n }\n // get ArrayType() {\n // switch (this.bitWidth) {\n // case 8:\n // return this.isSigned ? Int8Array : Uint8Array;\n // case 16:\n // return this.isSigned ? Int16Array : Uint16Array;\n // case 32:\n // return this.isSigned ? Int32Array : Uint32Array;\n // case 64:\n // return this.isSigned ? Int32Array : Uint32Array;\n // default:\n // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);\n // }\n // }\n get [Symbol.toStringTag](): string {\n return 'Int';\n }\n toString(): string {\n return `${this.isSigned ? 'I' : 'Ui'}nt${this.bitWidth}`;\n }\n}\n\nexport class Int8 extends Int {\n constructor() {\n super(true, 8);\n }\n}\nexport class Int16 extends Int {\n constructor() {\n super(true, 16);\n }\n}\nexport class Int32 extends Int {\n constructor() {\n super(true, 32);\n }\n}\nexport class Int64 extends Int {\n constructor() {\n super(true, 64);\n }\n}\nexport class Uint8 extends Int {\n constructor() {\n super(false, 8);\n }\n}\nexport class Uint16 extends Int {\n constructor() {\n super(false, 16);\n }\n}\nexport class Uint32 extends Int {\n constructor() {\n super(false, 32);\n }\n}\nexport class Uint64 extends Int {\n constructor() {\n super(false, 64);\n }\n}\n\n// FLOATS\n\nconst Precision = {\n HALF: 16,\n SINGLE: 32,\n DOUBLE: 64\n};\n\nexport class Float extends DataType {\n readonly precision: number;\n constructor(precision) {\n super();\n this.precision = precision;\n }\n get typeId(): Type {\n return Type.Float;\n }\n // get ArrayType() {\n // switch (this.precision) {\n // case Precision.HALF:\n // return Uint16Array;\n // case Precision.SINGLE:\n // return Float32Array;\n // case Precision.DOUBLE:\n // return Float64Array;\n // default:\n // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);\n // }\n // }\n get [Symbol.toStringTag](): string {\n return 'Float';\n }\n toString(): string {\n return `Float${this.precision}`;\n }\n}\n\nexport class Float16 extends Float {\n constructor() {\n super(Precision.HALF);\n }\n}\nexport class Float32 extends Float {\n constructor() {\n super(Precision.SINGLE);\n }\n}\nexport class Float64 extends Float {\n constructor() {\n super(Precision.DOUBLE);\n }\n}\n\nexport class Binary extends DataType {\n constructor() {\n super();\n }\n get typeId() {\n return Type.Binary;\n }\n toString() {\n return 'Binary';\n }\n get [Symbol.toStringTag]() {\n return 'Binary';\n }\n}\n\n// STRINGS\n\nexport class Utf8 extends DataType {\n get typeId(): Type {\n return Type.Utf8;\n }\n // get ArrayType() {\n // return Uint8Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Utf8';\n }\n toString(): string {\n return 'Utf8';\n }\n}\n\n// DATES, TIMES AND INTERVALS\n\nconst DateUnit = {\n DAY: 0,\n MILLISECOND: 1\n};\n\nexport class Date extends DataType {\n readonly unit: number;\n constructor(unit) {\n super();\n this.unit = unit;\n }\n get typeId(): Type {\n return Type.Date;\n }\n // get ArrayType() {\n // return Int32Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Date';\n }\n toString(): string {\n return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`;\n }\n}\n\nexport class DateDay extends Date {\n constructor() {\n super(DateUnit.DAY);\n }\n}\nexport class DateMillisecond extends Date {\n constructor() {\n super(DateUnit.MILLISECOND);\n }\n}\n\nconst TimeUnit = {\n SECOND: 1,\n MILLISECOND: 1e3,\n MICROSECOND: 1e6,\n NANOSECOND: 1e9\n};\n\nexport class Time extends DataType {\n readonly unit: number;\n readonly bitWidth: number;\n\n constructor(unit, bitWidth) {\n super();\n this.unit = unit;\n this.bitWidth = bitWidth;\n }\n get typeId(): Type {\n return Type.Time;\n }\n toString(): string {\n return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`;\n }\n get [Symbol.toStringTag](): string {\n return 'Time';\n }\n // get ArrayType() {\n // return Int32Array;\n // }\n}\n\nexport class TimeSecond extends Time {\n constructor() {\n super(TimeUnit.SECOND, 32);\n }\n}\nexport class TimeMillisecond extends Time {\n constructor() {\n super(TimeUnit.MILLISECOND, 32);\n }\n}\n// export class TimeMicrosecond extends Time { constructor() { super(TimeUnit.MICROSECOND, 64); } }\n// export class TimeNanosecond extends Time { constructor() { super(TimeUnit.NANOSECOND, 64); } }\n\nexport class Timestamp extends DataType {\n readonly unit: any;\n readonly timezone: any;\n\n constructor(unit: any, timezone = null) {\n super();\n this.unit = unit;\n this.timezone = timezone;\n }\n get typeId(): Type {\n return Type.Timestamp;\n }\n // get ArrayType() {\n // return Int32Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Timestamp';\n }\n toString(): string {\n return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ''}>`;\n }\n}\n\nexport class TimestampSecond extends Timestamp {\n constructor(timezone = null) {\n super(TimeUnit.SECOND, timezone);\n }\n}\nexport class TimestampMillisecond extends Timestamp {\n constructor(timezone = null) {\n super(TimeUnit.MILLISECOND, timezone);\n }\n}\nexport class TimestampMicrosecond extends Timestamp {\n constructor(timezone = null) {\n super(TimeUnit.MICROSECOND, timezone);\n }\n}\nexport class TimestampNanosecond extends Timestamp {\n constructor(timezone = null) {\n super(TimeUnit.NANOSECOND, timezone);\n }\n}\n\nconst IntervalUnit = {\n DAY_TIME: 0,\n YEAR_MONTH: 1\n};\n\nexport class Interval extends DataType {\n readonly unit: number;\n constructor(unit: number) {\n super();\n this.unit = unit;\n }\n get typeId(): Type {\n return Type.Interval;\n }\n // get ArrayType() {\n // return Int32Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Interval';\n }\n toString(): string {\n return `Interval<${IntervalUnit[this.unit]}>`;\n }\n}\n\nexport class IntervalDayTime extends Interval {\n constructor() {\n super(IntervalUnit.DAY_TIME);\n }\n}\nexport class IntervalYearMonth extends Interval {\n constructor() {\n super(IntervalUnit.YEAR_MONTH);\n }\n}\n\nexport class FixedSizeList extends DataType {\n readonly listSize: number;\n readonly children: Field[];\n\n constructor(listSize: number, child: Field) {\n super();\n this.listSize = listSize;\n this.children = [child];\n }\n get typeId(): Type {\n return Type.FixedSizeList;\n }\n get valueType() {\n return this.children[0].type;\n }\n get valueField() {\n return this.children[0];\n }\n // get ArrayType() {\n // return this.valueType.ArrayType;\n // }\n get [Symbol.toStringTag](): string {\n return 'FixedSizeList';\n }\n toString(): string {\n return `FixedSizeList[${this.listSize}]<${this.valueType}>`;\n }\n}\n\nexport class Struct extends DataType {\n public readonly children: Field[];\n\n constructor(children: Field[]) {\n super();\n this.children = children;\n }\n\n public get typeId() {\n return Type.Struct;\n }\n public toString() {\n return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(', ')}}>`;\n }\n get [Symbol.toStringTag](): string {\n return 'Struct';\n }\n}\n","import {assert} from '../../utils/assert';\nimport Field from './field';\n\nexport type SchemaMetadata = Map<string, any>;\n\n/**\n * ArrowJS `Schema` API-compatible class for row-based tables (returned from `DataTable`)\n * https://loaders.gl/arrowjs/docs/api-reference/schema\n */\nexport default class Schema {\n fields: Field[];\n // TODO - Arrow just allows Map<string, string>\n metadata: SchemaMetadata;\n\n constructor(fields: Field[], metadata?: SchemaMetadata) {\n assert(Array.isArray(fields));\n checkNames(fields);\n // For kepler fields, create arrow compatible `Fields` that have kepler fields as `metadata`\n this.fields = fields;\n this.metadata = metadata || new Map();\n }\n\n // TODO - arrow only seems to compare fields, not metadata\n compareTo(other: Schema): boolean {\n if (this.metadata !== other.metadata) {\n return false;\n }\n if (this.fields.length !== other.fields.length) {\n return false;\n }\n for (let i = 0; i < this.fields.length; ++i) {\n if (!this.fields[i].compareTo(other.fields[i])) {\n return false;\n }\n }\n return true;\n }\n\n select(...columnNames: string[]): Schema {\n // Ensure column names reference valid fields\n const nameMap = Object.create(null);\n for (const name of columnNames) {\n nameMap[name] = true;\n }\n const selectedFields = this.fields.filter((field) => nameMap[field.name]);\n return new Schema(selectedFields, this.metadata);\n }\n\n selectAt(...columnIndices: number[]): Schema {\n // Ensure column indices reference valid fields\n const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean);\n return new Schema(selectedFields, this.metadata);\n }\n\n assign(schemaOrFields: Schema | Field[]): Schema {\n let fields: Field[];\n let metadata: SchemaMetadata = this.metadata;\n\n if (schemaOrFields instanceof Schema) {\n const otherSchema = schemaOrFields;\n fields = otherSchema.fields;\n metadata = mergeMaps(mergeMaps(new Map(), this.metadata), otherSchema.metadata);\n } else {\n fields = schemaOrFields;\n }\n\n // Create a merged list of fields, overwrite fields in place, new fields at end\n const fieldMap: {[key: string]: Field} = Object.create(null);\n\n for (const field of this.fields) {\n fieldMap[field.name] = field;\n }\n\n for (const field of fields) {\n fieldMap[field.name] = field;\n }\n\n const mergedFields = Object.values(fieldMap);\n\n return new Schema(mergedFields, metadata);\n }\n}\n\n// Warn if any duplicated field names\nfunction checkNames(fields) {\n const usedNames = {};\n for (const field of fields) {\n if (usedNames[field.name]) {\n // eslint-disable-next-line\n console.warn('Schema: duplicated field name', field.name, field);\n }\n usedNames[field.name] = true;\n }\n}\n\nfunction mergeMaps<T>(m1: T, m2: T): T {\n // @ts-ignore\n return new Map([...(m1 || new Map()), ...(m2 || new Map())]);\n}\n","// Replacement for the external assert method to reduce bundle size\n// Note: We don't use the second \"message\" argument in calling code,\n// so no need to support it here\nexport function assert(condition: boolean, message?: string) {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}\n","// PCD Loader, adapted from THREE.js (MIT license)\n// Description: A loader for PCD ascii and binary files.\n// Limitations: Compressed binary files are not supported.\n//\n// Attributions per original THREE.js source file:\n// @author Filipe Caixeta / http://filipecaixeta.com.br\n// @author Mugen87 / https://github.com/Mugen87\n\nimport {getMeshBoundingBox} from '@loaders.gl/schema';\nimport type {MeshAttribute, MeshAttributes} from '@loaders.gl/schema';\nimport type {PCDHeader} from './pcd-types';\nimport {getPCDSchema} from './get-pcd-schema';\n\ntype NormalizedAttributes = {\n POSITION: {\n value: Float32Array;\n size: number;\n };\n NORMAL?: {\n value: Float32Array;\n size: number;\n };\n COLOR_0?: {\n value: Uint8Array;\n size: number;\n };\n};\n\ntype HeaderAttributes = {\n [attributeName: string]: number[];\n};\n\nconst LITTLE_ENDIAN: boolean = true;\n\n/**\n *\n * @param data\n * @returns\n */\nexport default function parsePCD(data: ArrayBufferLike) {\n // parse header (always ascii format)\n const textData = new TextDecoder().decode(data);\n const pcdHeader = parsePCDHeader(textData);\n\n let attributes: any = {};\n\n // parse data\n switch (pcdHeader.data) {\n case 'ascii':\n attributes = parsePCDASCII(pcdHeader, textData);\n break;\n\n case 'binary':\n attributes = parsePCDBinary(pcdHeader, data);\n break;\n\n case 'binary_compressed':\n default:\n throw new Error(`PCD: ${pcdHeader.data} files are not supported`);\n }\n\n attributes = getMeshAttributes(attributes);\n\n const header = getMeshHeader(pcdHeader, attributes);\n\n const metadata = new Map([\n ['mode', '0'],\n ['boundingBox', JSON.stringify(header.boundingBox)]\n ]);\n\n const schema = getPCDSchema(pcdHeader, metadata);\n\n return {\n loaderData: {\n header: pcdHeader\n },\n header,\n schema,\n mode: 0, // POINTS\n indices: null,\n attributes\n };\n}\n\n// Create a header that contains common data for PointCloud category loaders\nfunction getMeshHeader(pcdHeader: PCDHeader, attributes: NormalizedAttributes): Partial<PCDHeader> {\n if (typeof pcdHeader.width === 'number' && typeof pcdHeader.height === 'number') {\n const pointCount = pcdHeader.width * pcdHeader.height; // Supports \"organized\" point sets\n return {\n vertexCount: pointCount,\n boundingBox: getMeshBoundingBox(attributes)\n };\n }\n return pcdHeader;\n}\n\n/**\n * @param attributes\n * @returns Normalized attributes\n */\nfunction getMeshAttributes(attributes: HeaderAttributes): {[attributeName: string]: MeshAttribute} {\n const normalizedAttributes: MeshAttributes = {\n POSITION: {\n // Binary PCD is only 32 bit\n value: new Float32Array(attributes.position),\n size: 3\n }\n };\n\n if (attributes.normal && attributes.normal.length > 0) {\n normalizedAttributes.NORMAL = {\n value: new Float32Array(attributes.normal),\n size: 3\n };\n }\n\n if (attributes.color && attributes.color.length > 0) {\n // TODO - RGBA\n normalizedAttributes.COLOR_0 = {\n value: new Uint8Array(attributes.color),\n size: 3\n };\n }\n\n return normalizedAttributes;\n}\n\n/**\n * Incoming data parsing\n * @param data\n * @returns Header\n */\n/* eslint-disable complexity, max-statements */\nfunction parsePCDHeader(data: string): PCDHeader {\n const result1 = data.search(/[\\r\\n]DATA\\s(\\S*)\\s/i);\n const result2 = /[\\r\\n]DATA\\s(\\S*)\\s/i.exec(data.substr(result1 - 1));\n\n const pcdHeader: any = {};\n pcdHeader.data = result2 && result2[1];\n if (result2 !== null) {\n pcdHeader.headerLen = (result2 && result2[0].length) + result1;\n }\n pcdHeader.str = data.substr(0, pcdHeader.headerLen);\n\n // remove comments\n\n pcdHeader.str = pcdHeader.str.replace(/\\#.*/gi, '');\n\n // parse\n\n pcdHeader.version = /VERSION (.*)/i.exec(pcdHeader.str);\n pcdHeader.fields = /FIELDS (.*)/i.exec(pcdHeader.str);\n pcdHeader.size = /SIZE (.*)/i.exec(pcdHeader.str);\n pcdHeader.type = /TYPE (.*)/i.exec(pcdHeader.str);\n pcdHeader.count = /COUNT (.*)/i.exec(pcdHeader.str);\n pcdHeader.width = /WIDTH (.*)/i.exec(pcdHeader.str);\n pcdHeader.height = /HEIGHT (.*)/i.exec(pcdHeader.str);\n pcdHeader.viewpoint = /VIEWPOINT (.*)/i.exec(pcdHeader.str);\n pcdHeader.points = /POINTS (.*)/i.exec(pcdHeader.str);\n\n // evaluate\n\n if (pcdHeader.version !== null) {\n pcdHeader.version = parseFloat(pcdHeader.version[1]);\n }\n\n if (pcdHeader.fields !== null) {\n pcdHeader.fields = pcdHeader.fields[1].split(' ');\n }\n\n if (pcdHeader.type !== null) {\n pcdHeader.type = pcdHeader.type[1].split(' ');\n }\n\n if (pcdHeader.width !== null) {\n pcdHeader.width = parseInt(pcdHeader.width[1], 10);\n }\n\n if (pcdHeader.height !== null) {\n pcdHeader.height = parseInt(pcdHeader.height[1], 10);\n }\n\n if (pcdHeader.viewpoint !== null) {\n pcdHeader.viewpoint = pcdHeader.viewpoint[1];\n }\n\n if (pcdHeader.points !== null) {\n pcdHeader.points = parseInt(pcdHeader.points[1], 10);\n }\n\n if (\n pcdHeader.points === null &&\n typeof pcdHeader.width === 'number' &&\n typeof pcdHeader.height === 'number'\n ) {\n pcdHeader.points = pcdHeader.width * pcdHeader.height;\n }\n\n if (pcdHeader.size !== null) {\n pcdHeader.size = pcdHeader.size[1].split(' ').map((x) => parseInt(x, 10));\n }\n\n if (pcdHeader.count !== null) {\n pcdHeader.count = pcdHeader.count[1].split(' ').map((x) => parseInt(x, 10));\n } else {\n pcdHeader.count = [];\n if (pcdHeader.fields !== null) {\n for (let i = 0; i < pcdHeader.fields.length; i++) {\n pcdHeader.count.push(1);\n }\n }\n }\n\n pcdHeader.offset = {};\n\n let sizeSum = 0;\n if (pcdHeader.fields !== null && pcdHeader.size !== null) {\n for (let i = 0; i < pcdHeader.fields.length; i++) {\n if (pcdHeader.data === 'ascii') {\n pcdHeader.offset[pcdHeader.fields[i]] = i;\n } else {\n pcdHeader.offset[pcdHeader.fields[i]] = sizeSum;\n sizeSum += pcdHeader.size[i];\n }\n }\n }\n\n // for binary only\n pcdHeader.rowSize = sizeSum;\n\n return pcdHeader;\n}\n\n/**\n * @param pcdHeader\n * @param textData\n * @returns [attributes]\n */\n/* eslint-enable complexity, max-statements */\nfunction parsePCDASCII(pcdHeader: PCDHeader, textData: string): HeaderAttributes {\n const position: number[] = [];\n const normal: number[] = [];\n const color: number[] = [];\n\n const offset = pcdHeader.offset;\n const pcdData = textData.substr(pcdHeader.headerLen);\n const lines = pcdData.split('\\n');\n\n for (let i = 0; i < lines.length; i++) {\n if (lines[i] !== '') {\n const line = lines[i].split(' ');\n\n if (offset.x !== undefined) {\n position.push(parseFloat(line[offset.x]));\n position.push(parseFloat(line[offset.y]));\n position.push(parseFloat(line[offset.z]));\n }\n\n if (offset.rgb !== undefined) {\n const floatValue = parseFloat(line[offset.rgb]);\n const binaryColor = new Float32Array([floatValue]);\n const dataview = new DataView(binaryColor.buffer, 0);\n color.push(dataview.getUint8(0));\n color.push(dataview.getUint8(1));\n color.push(dataview.getUint8(2));\n // TODO - handle alpha channel / RGBA?\n }\n\n if (offset.normal_x !== undefined) {\n normal.push(parseFloat(line[offset.normal_x]));\n normal.push(parseFloat(line[offset.normal_y]));\n normal.push(parseFloat(line[offset.normal_z]));\n }\n }\n }\n\n return {position, normal, color};\n}\n\n/**\n * @param pcdHeader\n * @param data\n * @returns [attributes]\n */\nfunction parsePCDBinary(pcdHeader: PCDHeader, data: ArrayBufferLike): HeaderAttributes {\n const position: number[] = [];\n const normal: number[] = [];\n const color: number[] = [];\n\n const dataview = new DataView(data, pcdHeader.headerLen);\n const offset = pcdHeader.offset;\n\n for (let i = 0, row = 0; i < pcdHeader.points; i++, row += pcdHeader.rowSize) {\n if (offset.x !== undefined) {\n position.push(dataview.getFloat32(row + offset.x, LITTLE_ENDIAN));\n position.push(dataview.getFloat32(row + offset.y, LITTLE_ENDIAN));\n position.push(dataview.getFloat32(row + offset.z, LITTLE_ENDIAN));\n }\n\n if (offset.rgb !== undefined) {\n color.push(dataview.getUint8(row + offset.rgb + 0));\n color.push(dataview.getUint8(row + offset.rgb + 1));\n color.push(dataview.getUint8(row + offset.rgb + 2));\n }\n\n if (offset.normal_x !== undefined) {\n normal.push(dataview.getFloat32(row + offset.normal_x, LITTLE_ENDIAN));\n normal.push(dataview.getFloat32(row + offset.normal_y, LITTLE_ENDIAN));\n normal.push(dataview.getFloat32(row + offset.normal_z, LITTLE_ENDIAN));\n }\n }\n\n return {position, normal, color};\n}\n","import {Schema, Field, Float32, Uint8, FixedSizeList} from '@loaders.gl/schema';\nimport type {PCDHeader} from './pcd-types';\n\ntype SchemaMetadata = Map<string, any>;\n\n/**\n * Gets schema from PCD header\n * @param PCDheader\n * @param metadata\n * @returns Schema\n */\nexport function getPCDSchema(PCDheader: PCDHeader, metadata: SchemaMetadata): Schema {\n const offset = PCDheader.offset;\n\n const fields: Field[] = [];\n\n if (offset.x !== undefined) {\n fields.push(\n new Field('POSITION', new FixedSizeList(3, new Field('xyz', new Float32())), false)\n );\n }\n\n if (offset.normal_x !== undefined) {\n fields.push(new Field('NORMAL', new FixedSizeList(3, new Field('xyz', new Float32())), false));\n }\n\n if (offset.rgb !== undefined) {\n fields.push(new Field('COLOR_0', new FixedSizeList(3, new Field('rgb', new Uint8())), false));\n }\n\n return new Schema(fields, metadata);\n}\n","import type {Loader} from '@loaders.gl/loader-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Worker loader for PCD - Point Cloud Data\n */\nexport const PCDLoader = {\n name: 'PCD (Point Cloud Data)',\n id: 'pcd',\n module: 'pcd',\n version: VERSION,\n worker: true,\n extensions: ['pcd'],\n mimeTypes: ['text/plain'],\n options: {\n pcd: {}\n }\n};\n\nexport const _typecheckPCDLoader: Loader = PCDLoader;\n","import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport parsePCDSync from './lib/parse-pcd';\nimport {PCDLoader as PCDWorkerLoader} from './pcd-loader';\n\nexport {PCDWorkerLoader};\n\n/**\n * Loader for PCD - Point Cloud Data\n */\nexport const PCDLoader = {\n ...PCDWorkerLoader,\n parse: async (arrayBuffer) => parsePCDSync(arrayBuffer),\n parseSync: parsePCDSync\n};\n\nexport const _typecheckPCDLoader: LoaderWithParser = PCDLoader;\n"],"sourceRoot":""}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/inherits.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/defineProperty.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/createClass.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/regenerator/index.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/typeof.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack:////home/user/apps/loaders.gl/node_modules/regenerator-runtime/runtime.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/iterableToArray.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack:////home/user/apps/loaders.gl/node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack:///../worker-utils/src/lib/worker-utils/get-transfer-list.ts","webpack:///../worker-utils/src/lib/worker-farm/worker-body.ts","webpack:///../loader-utils/src/lib/worker-loader-utils/create-loader-worker.ts","webpack:///../schema/src/category/mesh/mesh-utils.ts","webpack:///../schema/src/lib/schema/impl/enum.ts","webpack:///../schema/src/lib/schema/impl/field.ts","webpack:///../schema/src/lib/schema/impl/type.ts","webpack:///../schema/src/lib/schema/impl/schema.ts","webpack:///../schema/src/lib/utils/assert.ts","webpack:///./src/lib/parse-pcd.ts","webpack:///./src/lib/get-pcd-schema.ts","webpack:///./src/pcd-loader.ts","webpack:///./src/index.ts","webpack:///./src/workers/pcd-worker.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","instance","Constructor","TypeError","setPrototypeOf","subClass","superClass","constructor","writable","configurable","obj","_defineProperties","target","props","length","descriptor","protoProps","staticProps","self","ReferenceError","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","error","done","Promise","then","fn","this","args","arguments","apply","err","undefined","_typeof","iterator","_getPrototypeOf","getPrototypeOf","__proto__","arrayWithoutHoles","iterableToArray","unsupportedIterableToArray","nonIterableSpread","arr","len","arr2","Array","assertThisInitialized","runtime","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","define","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","state","method","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","invoke","result","__await","unwrapped","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","iter","toString","keys","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","_setPrototypeOf","arrayLikeToArray","isArray","from","minLen","test","isTransferable","ArrayBuffer","MessagePort","ImageBitmap","OffscreenCanvas","onMessageWrapperMap","Map","WorkerBody","onMessage","onmessage","message","isKnownMessage","data","payload","onMessageWrapper","addEventListener","removeEventListener","source","transferList","getTransferList","recursive","transfers","transfersSet","Set","add","buffer","isView","postMessage","startsWith","requestId","parseOnMainThread","arrayBuffer","options","id","input","parseData","a","loader","parseSync","parse","parser","parseTextSync","textDecoder","TextDecoder","decode","worker","getMeshBoundingBox","attributes","minX","Infinity","minY","minZ","maxX","maxY","maxZ","positions","POSITION","x","y","z","Type","Field","nullable","metadata","typeId","other","DataType","NONE","Null","Int","Float","Binary","Utf8","Bool","Decimal","Date","Time","Timestamp","Interval","List","Struct","Union","FixedSizeBinary","FixedSizeList","Dictionary","isSigned","bitWidth","Uint8","Precision","precision","Float32","listSize","child","children","valueType","Schema","fields","condition","assert","usedNames","field","console","warn","checkNames","compareTo","nameMap","columnNames","selectedFields","filter","columnIndices","map","index","Boolean","schemaOrFields","otherSchema","mergeMaps","fieldMap","m1","m2","parsePCD","textData","pcdHeader","result1","search","result2","exec","substr","headerLen","str","replace","version","size","count","width","height","viewpoint","points","parseFloat","split","parseInt","offset","sizeSum","rowSize","parsePCDHeader","position","normal","color","lines","line","rgb","floatValue","binaryColor","Float32Array","dataview","DataView","getUint8","normal_x","normal_y","normal_z","parsePCDASCII","row","getFloat32","parsePCDBinary","header","vertexCount","boundingBox","getMeshHeader","normalizedAttributes","NORMAL","COLOR_0","Uint8Array","getMeshAttributes","loaderData","schema","PCDheader","getPCDSchema","JSON","stringify","indices","PCDLoader","extensions","mimeTypes","pcd","PCDWorkerLoader","parsePCDSync"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAA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AatD,EALX,IAAInH,IAAI,CACvB,CAAC,OAAQ,KACT,CAAC,cAAe0K,KAAKC,UAAUd,EAAOE,iBAWtCnV,KAAM,EACNgW,QAAS,KACTnI,cE5EJ,IAKaoI,GAAY,CACvB7W,KAAM,yBACN2N,GAAI,MACJnO,OAAQ,MACRoU,QATc,gBAUdrF,QAAQ,EACRuI,WAAY,CAAC,OACbC,UAAW,CAAC,cACZrJ,QAAS,CACPsJ,IAAK,K,qkBCTF,IAEA,GVA4BjJ,GUFtB8I,GAAY,SACpBI,IADiB,IAEpBhJ,OAAK,iBAAE,WAAOR,GAAP,SAAAK,EAAA,+EAAuBoJ,EAAazJ,IAApC,2CAAF,8CACLO,UAAWkJ,IVDsBnJ,GWRhB8I,GXUG,oBAATnU,OAIXuJ,EAAWE,UAAX,+BAAuB,WAAOrF,EAAMyF,GAAb,uBAAAuB,EAAA,2DACbhH,EADa,OAEd,YAFc,uCAMR8G,EAAuBrB,EAAvBqB,MANQ,EAMerB,EAAhBmB,eANC,MAMS,GANT,WAQMG,EAAU,CAC7BE,UACAN,YAAaG,EACbF,UACA7H,QAAS,CACPoI,MAAOT,KAbI,OAQT1F,EARS,OAgBfmE,EAAWoB,YAAY,OAAQ,CAACvF,WAhBjB,kDAkBTsE,EAAU,gBAAiBlG,MAAQ,KAAMkG,QAAU,GACzDH,EAAWoB,YAAY,QAAS,CAACjK,MAAOgJ,IAnBzB,8FAAvB","file":"pcd-worker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 19);\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","module.exports = require(\"regenerator-runtime\");\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\n\nvar iterableToArray = require(\"./iterableToArray.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _typeof = require(\"@babel/runtime/helpers/typeof\")[\"default\"];\n\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","// NOTE - there is a copy of this function is both in core and loader-utils\n// core does not need all the utils in loader-utils, just this one.\n\n/**\n * Returns an array of Transferrable objects that can be used with postMessage\n * https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage\n * @param object data to be sent via postMessage\n * @param recursive - not for application use\n * @param transfers - not for application use\n * @returns a transfer list that can be passed to postMessage\n */\nexport function getTransferList(\n object: any,\n recursive: boolean = true,\n transfers?: Set<any>\n): Transferable[] {\n // Make sure that items in the transfer list is unique\n const transfersSet = transfers || new Set();\n\n if (!object) {\n // ignore\n } else if (isTransferable(object)) {\n transfersSet.add(object);\n } else if (isTransferable(object.buffer)) {\n // Typed array\n transfersSet.add(object.buffer);\n } else if (ArrayBuffer.isView(object)) {\n // object is a TypeArray viewing into a SharedArrayBuffer (not transferable)\n // Do not iterate through the content in this case\n } else if (recursive && typeof object === 'object') {\n for (const key in object) {\n // Avoid perf hit - only go one level deep\n getTransferList(object[key], recursive, transfersSet);\n }\n }\n\n // If transfers is defined, is internal recursive call\n // Otherwise it's called by the user\n return transfers === undefined ? Array.from(transfersSet) : [];\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Transferable\nfunction isTransferable(object) {\n if (!object) {\n return false;\n }\n if (object instanceof ArrayBuffer) {\n return true;\n }\n if (typeof MessagePort !== 'undefined' && object instanceof MessagePort) {\n return true;\n }\n if (typeof ImageBitmap !== 'undefined' && object instanceof ImageBitmap) {\n return true;\n }\n // @ts-ignore\n if (typeof OffscreenCanvas !== 'undefined' && object instanceof OffscreenCanvas) {\n return true;\n }\n return false;\n}\n","import type {WorkerMessageData, WorkerMessageType, WorkerMessagePayload} from '../../types';\nimport {getTransferList} from '../worker-utils/get-transfer-list';\n\nconst onMessageWrapperMap = new Map();\n\n/**\n * Type safe wrapper for worker code\n */\nexport default class WorkerBody {\n /*\n * (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n */\n static set onmessage(onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any) {\n // eslint-disable-next-line no-restricted-globals\n self.onmessage = (message) => {\n if (!isKnownMessage(message)) {\n return;\n }\n\n // Confusingly the message itself also has a 'type' field which is always set to 'message'\n const {type, payload} = message.data;\n onMessage(type, payload);\n };\n }\n\n static addEventListener(\n onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n ) {\n let onMessageWrapper = onMessageWrapperMap.get(onMessage);\n\n if (!onMessageWrapper) {\n onMessageWrapper = (message) => {\n if (!isKnownMessage(message)) {\n return;\n }\n\n // Confusingly the message itself also has a 'type' field which is always set to 'message'\n const {type, payload} = message.data;\n onMessage(type, payload);\n };\n }\n\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('message', onMessageWrapper);\n }\n\n static removeEventListener(\n onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n ) {\n const onMessageWrapper = onMessageWrapperMap.get(onMessage);\n onMessageWrapperMap.delete(onMessage);\n // eslint-disable-next-line no-restricted-globals\n self.removeEventListener('message', onMessageWrapper);\n }\n\n /**\n * Send a message from a worker to creating thread (main thread)\n * @param type\n * @param payload\n */\n static postMessage(type: WorkerMessageType, payload: WorkerMessagePayload): void {\n if (self) {\n const data: WorkerMessageData = {source: 'loaders.gl', type, payload};\n const transferList = getTransferList(payload);\n // eslint-disable-next-line no-restricted-globals\n // @ts-ignore\n self.postMessage(data, transferList);\n }\n }\n}\n\n// Filter out noise messages sent to workers\nfunction isKnownMessage(message) {\n const {type, data} = message;\n return (\n type === 'message' &&\n data &&\n typeof data.source === 'string' &&\n data.source.startsWith('loaders.gl')\n );\n}\n","/* eslint-disable no-restricted-globals */\nimport type {LoaderWithParser} from '../../types';\nimport {WorkerBody} from '@loaders.gl/worker-utils';\n// import {validateLoaderVersion} from './validate-loader-version';\n\nlet requestId = 0;\n\n/**\n * Set up a WebWorkerGlobalScope to talk with the main thread\n * @param loader\n */\nexport function createLoaderWorker(loader: LoaderWithParser) {\n // Check that we are actually in a worker thread\n if (typeof self === 'undefined') {\n return;\n }\n\n WorkerBody.onmessage = async (type, payload) => {\n switch (type) {\n case 'process':\n try {\n // validateLoaderVersion(loader, data.source.split('@')[1]);\n\n const {input, options = {}} = payload;\n\n const result = await parseData({\n loader,\n arrayBuffer: input,\n options,\n context: {\n parse: parseOnMainThread\n }\n });\n WorkerBody.postMessage('done', {result});\n } catch (error) {\n const message = error instanceof Error ? error.message : '';\n WorkerBody.postMessage('error', {error: message});\n }\n break;\n default:\n }\n };\n}\n\nfunction parseOnMainThread(arrayBuffer: ArrayBuffer, options: {[key: string]: any}): Promise<void> {\n return new Promise((resolve, reject) => {\n const id = requestId++;\n\n /**\n */\n const onMessage = (type, payload) => {\n if (payload.id !== id) {\n // not ours\n return;\n }\n\n switch (type) {\n case 'done':\n WorkerBody.removeEventListener(onMessage);\n resolve(payload.result);\n break;\n\n case 'error':\n WorkerBody.removeEventListener(onMessage);\n reject(payload.error);\n break;\n\n default:\n // ignore\n }\n };\n\n WorkerBody.addEventListener(onMessage);\n\n // Ask the main thread to decode data\n const payload = {id, input: arrayBuffer, options};\n WorkerBody.postMessage('process', payload);\n });\n}\n\n// TODO - Support byteOffset and byteLength (enabling parsing of embedded binaries without copies)\n// TODO - Why not support async loader.parse* funcs here?\n// TODO - Why not reuse a common function instead of reimplementing loader.parse* selection logic? Keeping loader small?\n// TODO - Lack of appropriate parser functions can be detected when we create worker, no need to wait until parse\nasync function parseData({loader, arrayBuffer, options, context}) {\n let data;\n let parser;\n if (loader.parseSync || loader.parse) {\n data = arrayBuffer;\n parser = loader.parseSync || loader.parse;\n } else if (loader.parseTextSync) {\n const textDecoder = new TextDecoder();\n data = textDecoder.decode(arrayBuffer);\n parser = loader.parseTextSync;\n } else {\n throw new Error(`Could not load data with ${loader.name} loader`);\n }\n\n // TODO - proper merge in of loader options...\n options = {\n ...options,\n modules: (loader && loader.options && loader.options.modules) || {},\n worker: false\n };\n\n return await parser(data, {...options}, context, loader);\n}\n","// Mesh category utilities\n// TODO - move to mesh category module, or to math.gl/geometry module\nimport {TypedArray} from '../../types';\nimport {MeshAttributes} from './mesh-types';\n\ntype TypedArrays = {[key: string]: TypedArray};\n\n/**\n * Holds an axis aligned bounding box\n * TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)\n */\ntype BoundingBox = [[number, number, number], [number, number, number]];\n\n/**\n * Get number of vertices in mesh\n * @param attributes\n */\nexport function getMeshSize(attributes: TypedArrays): number {\n let size = 0;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n if (ArrayBuffer.isView(attribute)) {\n // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT\n size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;\n }\n }\n return size;\n}\n\n/**\n * Get the (axis aligned) bounding box of a mesh\n * @param attributes\n * @returns array of two vectors representing the axis aligned bounding box\n */\n// eslint-disable-next-line complexity\nexport function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {\n let minX = Infinity;\n let minY = Infinity;\n let minZ = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let maxZ = -Infinity;\n\n const positions = attributes.POSITION ? attributes.POSITION.value : [];\n const len = positions && positions.length;\n\n for (let i = 0; i < len; i += 3) {\n const x = positions[i];\n const y = positions[i + 1];\n const z = positions[i + 2];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n minZ = z < minZ ? z : minZ;\n\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n maxZ = z > maxZ ? z : maxZ;\n }\n return [\n [minX, minY, minZ],\n [maxX, maxY, maxZ]\n ];\n}\n","// This code is adapted from ArrowJS https://github.com/apache/arrow\n// under Apache license http://www.apache.org/licenses/LICENSE-2.0\n\n/**\n * Main data type enumeration.\n *\n * Data types in this library are all *logical*. They can be expressed as\n * either a primitive physical type (bytes or bits of some fixed size), a\n * nested type consisting of other data types, or another data type (e.g. a\n * timestamp encoded as an int64).\n *\n * **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow\n * IPC payload.\n *\n * The rest of the values are specified here so TypeScript can narrow the type\n * signatures further beyond the base Arrow Types. The Arrow DataTypes include\n * metadata like `bitWidth` that impact the type signatures of the values we\n * accept and return.\n *\n * For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an\n * `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`\n * reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the\n * underlying `Int32Array`.\n *\n * Library consumers benefit by knowing the narrowest type, since we can ensure\n * the types across all public methods are propagated, and never bail to `any`.\n * These values are _never_ used at runtime, and they will _never_ be written\n * to the flatbuffers metadata of serialized Arrow IPC payloads.\n */\nexport enum Type {\n /** The default placeholder type */\n NONE = 0,\n /** A NULL type having no physical storage */\n Null = 1,\n /** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */\n Int = 2,\n /** 2, 4, or 8-byte floating point value */\n Float = 3,\n /** Variable-length bytes (no guarantee of UTF8-ness) */\n Binary = 4,\n /** UTF8 variable-length string as List<Char> */\n Utf8 = 5,\n /** Boolean as 1 bit, LSB bit-packed ordering */\n Bool = 6,\n /** Precision-and-scale-based decimal type. Storage type depends on the parameters. */\n Decimal = 7,\n /** int32_t days or int64_t milliseconds since the UNIX epoch */\n Date = 8,\n /** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */\n Time = 9,\n /** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */\n Timestamp = 10,\n /** YEAR_MONTH or DAY_TIME interval in SQL style */\n Interval = 11,\n /** A list of some logical data type */\n List = 12,\n /** Struct of logical types */\n Struct = 13,\n /** Union of logical types */\n Union = 14,\n /** Fixed-size binary. Each value occupies the same number of bytes */\n FixedSizeBinary = 15,\n /** Fixed-size list. Each value occupies the same number of bytes */\n FixedSizeList = 16,\n /** Map of named logical types */\n Map = 17,\n\n /** Dictionary aka Category type */\n Dictionary = -1,\n Int8 = -2,\n Int16 = -3,\n Int32 = -4,\n Int64 = -5,\n Uint8 = -6,\n Uint16 = -7,\n Uint32 = -8,\n Uint64 = -9,\n Float16 = -10,\n Float32 = -11,\n Float64 = -12,\n DateDay = -13,\n DateMillisecond = -14,\n TimestampSecond = -15,\n TimestampMillisecond = -16,\n TimestampMicrosecond = -17,\n TimestampNanosecond = -18,\n TimeSecond = -19,\n TimeMillisecond = -20,\n TimeMicrosecond = -21,\n TimeNanosecond = -22,\n DenseUnion = -23,\n SparseUnion = -24,\n IntervalDayTime = -25,\n IntervalYearMonth = -26\n}\n","import {DataType} from './type';\n\n/**\n * ArrowJS `Field` API-compatible class for row-based tables\n * https://loaders.gl/arrowjs/docs/api-reference/field\n * A field holds name, nullable, and metadata information about a table \"column\"\n * A Schema is essentially a list of fields\n */\nexport default class Field {\n name: string;\n type: DataType;\n nullable: boolean;\n metadata: Map<string, string>;\n\n constructor(\n name: string,\n type: DataType,\n nullable = false,\n metadata: Map<string, string> = new Map()\n ) {\n this.name = name;\n this.type = type;\n this.nullable = nullable;\n this.metadata = metadata;\n }\n\n get typeId(): number {\n return this.type && this.type.typeId;\n }\n\n clone(): Field {\n return new Field(this.name, this.type, this.nullable, this.metadata);\n }\n\n compareTo(other: this): boolean {\n return (\n this.name === other.name &&\n this.type === other.type &&\n this.nullable === other.nullable &&\n this.metadata === other.metadata\n );\n }\n\n toString(): string {\n return `${this.type}${this.nullable ? ', nullable' : ''}${\n this.metadata ? `, metadata: ${this.metadata}` : ''\n }`;\n }\n}\n","// This code is adapted from ArrowJS https://github.com/apache/arrow\n// under Apache license http://www.apache.org/licenses/LICENSE-2.0\n\nimport {Type} from './enum';\n\nimport Field from './field';\n\nexport {Type} from './enum';\n\nexport type TypedIntArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Int32Array\n | Uint32Array\n | Uint8ClampedArray;\n\nexport type TypedFloatArray = Float32Array | Float64Array;\n\nexport type TypedArray = TypedIntArray | TypedFloatArray;\n\nexport type AnyArrayType = Array<any> | TypedIntArray | TypedFloatArray;\n\nexport class DataType {\n static isNull(x: any): boolean {\n return x && x.typeId === Type.Null;\n }\n static isInt(x: any): boolean {\n return x && x.typeId === Type.Int;\n }\n static isFloat(x: any): boolean {\n return x && x.typeId === Type.Float;\n }\n static isBinary(x: any): boolean {\n return x && x.typeId === Type.Binary;\n }\n static isUtf8(x: any): boolean {\n return x && x.typeId === Type.Utf8;\n }\n static isBool(x: any): boolean {\n return x && x.typeId === Type.Bool;\n }\n static isDecimal(x: any): boolean {\n return x && x.typeId === Type.Decimal;\n }\n static isDate(x: any): boolean {\n return x && x.typeId === Type.Date;\n }\n static isTime(x: any): boolean {\n return x && x.typeId === Type.Time;\n }\n static isTimestamp(x: any): boolean {\n return x && x.typeId === Type.Timestamp;\n }\n static isInterval(x: any): boolean {\n return x && x.typeId === Type.Interval;\n }\n static isList(x: any): boolean {\n return x && x.typeId === Type.List;\n }\n static isStruct(x: any): boolean {\n return x && x.typeId === Type.Struct;\n }\n static isUnion(x: any): boolean {\n return x && x.typeId === Type.Union;\n }\n static isFixedSizeBinary(x: any): boolean {\n return x && x.typeId === Type.FixedSizeBinary;\n }\n static isFixedSizeList(x: any): boolean {\n return x && x.typeId === Type.FixedSizeList;\n }\n static isMap(x: any): boolean {\n return x && x.typeId === Type.Map;\n }\n static isDictionary(x: any): boolean {\n return x && x.typeId === Type.Dictionary;\n }\n\n get typeId(): Type {\n return Type.NONE;\n }\n\n // get ArrayType(): AnyArrayType {\n // return Int8Array;\n // }\n\n // get ArrayType() { return Array; }\n compareTo(other: DataType): boolean {\n // TODO\n return this === other; // comparer.visit(this, other);\n }\n}\n\n// NULL\n\nexport class Null extends DataType {\n get typeId(): Type {\n return Type.Null;\n }\n get [Symbol.toStringTag](): string {\n return 'Null';\n }\n toString(): string {\n return 'Null';\n }\n}\n\n// BOOLEANS\n\nexport class Bool extends DataType {\n get typeId(): Type {\n return Type.Bool;\n }\n // get ArrayType() {\n // return Uint8Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Bool';\n }\n toString(): string {\n return 'Bool';\n }\n}\n\n// INTS\n\nexport class Int extends DataType {\n readonly isSigned: boolean;\n readonly bitWidth: number;\n constructor(isSigned, bitWidth) {\n super();\n this.isSigned = isSigned;\n this.bitWidth = bitWidth;\n }\n get typeId(): Type {\n return Type.Int;\n }\n // get ArrayType() {\n // switch (this.bitWidth) {\n // case 8:\n // return this.isSigned ? Int8Array : Uint8Array;\n // case 16:\n // return this.isSigned ? Int16Array : Uint16Array;\n // case 32:\n // return this.isSigned ? Int32Array : Uint32Array;\n // case 64:\n // return this.isSigned ? Int32Array : Uint32Array;\n // default:\n // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);\n // }\n // }\n get [Symbol.toStringTag](): string {\n return 'Int';\n }\n toString(): string {\n return `${this.isSigned ? 'I' : 'Ui'}nt${this.bitWidth}`;\n }\n}\n\nexport class Int8 extends Int {\n constructor() {\n super(true, 8);\n }\n}\nexport class Int16 extends Int {\n constructor() {\n super(true, 16);\n }\n}\nexport class Int32 extends Int {\n constructor() {\n super(true, 32);\n }\n}\nexport class Int64 extends Int {\n constructor() {\n super(true, 64);\n }\n}\nexport class Uint8 extends Int {\n constructor() {\n super(false, 8);\n }\n}\nexport class Uint16 extends Int {\n constructor() {\n super(false, 16);\n }\n}\nexport class Uint32 extends Int {\n constructor() {\n super(false, 32);\n }\n}\nexport class Uint64 extends Int {\n constructor() {\n super(false, 64);\n }\n}\n\n// FLOATS\n\nconst Precision = {\n HALF: 16,\n SINGLE: 32,\n DOUBLE: 64\n};\n\nexport class Float extends DataType {\n readonly precision: number;\n constructor(precision) {\n super();\n this.precision = precision;\n }\n get typeId(): Type {\n return Type.Float;\n }\n // get ArrayType() {\n // switch (this.precision) {\n // case Precision.HALF:\n // return Uint16Array;\n // case Precision.SINGLE:\n // return Float32Array;\n // case Precision.DOUBLE:\n // return Float64Array;\n // default:\n // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);\n // }\n // }\n get [Symbol.toStringTag](): string {\n return 'Float';\n }\n toString(): string {\n return `Float${this.precision}`;\n }\n}\n\nexport class Float16 extends Float {\n constructor() {\n super(Precision.HALF);\n }\n}\nexport class Float32 extends Float {\n constructor() {\n super(Precision.SINGLE);\n }\n}\nexport class Float64 extends Float {\n constructor() {\n super(Precision.DOUBLE);\n }\n}\n\nexport class Binary extends DataType {\n constructor() {\n super();\n }\n get typeId() {\n return Type.Binary;\n }\n toString() {\n return 'Binary';\n }\n get [Symbol.toStringTag]() {\n return 'Binary';\n }\n}\n\n// STRINGS\n\nexport class Utf8 extends DataType {\n get typeId(): Type {\n return Type.Utf8;\n }\n // get ArrayType() {\n // return Uint8Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Utf8';\n }\n toString(): string {\n return 'Utf8';\n }\n}\n\n// DATES, TIMES AND INTERVALS\n\nconst DateUnit = {\n DAY: 0,\n MILLISECOND: 1\n};\n\nexport class Date extends DataType {\n readonly unit: number;\n constructor(unit) {\n super();\n this.unit = unit;\n }\n get typeId(): Type {\n return Type.Date;\n }\n // get ArrayType() {\n // return Int32Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Date';\n }\n toString(): string {\n return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`;\n }\n}\n\nexport class DateDay extends Date {\n constructor() {\n super(DateUnit.DAY);\n }\n}\nexport class DateMillisecond extends Date {\n constructor() {\n super(DateUnit.MILLISECOND);\n }\n}\n\nconst TimeUnit = {\n SECOND: 1,\n MILLISECOND: 1e3,\n MICROSECOND: 1e6,\n NANOSECOND: 1e9\n};\n\nexport class Time extends DataType {\n readonly unit: number;\n readonly bitWidth: number;\n\n constructor(unit, bitWidth) {\n super();\n this.unit = unit;\n this.bitWidth = bitWidth;\n }\n get typeId(): Type {\n return Type.Time;\n }\n toString(): string {\n return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`;\n }\n get [Symbol.toStringTag](): string {\n return 'Time';\n }\n // get ArrayType() {\n // return Int32Array;\n // }\n}\n\nexport class TimeSecond extends Time {\n constructor() {\n super(TimeUnit.SECOND, 32);\n }\n}\nexport class TimeMillisecond extends Time {\n constructor() {\n super(TimeUnit.MILLISECOND, 32);\n }\n}\n// export class TimeMicrosecond extends Time { constructor() { super(TimeUnit.MICROSECOND, 64); } }\n// export class TimeNanosecond extends Time { constructor() { super(TimeUnit.NANOSECOND, 64); } }\n\nexport class Timestamp extends DataType {\n readonly unit: any;\n readonly timezone: any;\n\n constructor(unit: any, timezone = null) {\n super();\n this.unit = unit;\n this.timezone = timezone;\n }\n get typeId(): Type {\n return Type.Timestamp;\n }\n // get ArrayType() {\n // return Int32Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Timestamp';\n }\n toString(): string {\n return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ''}>`;\n }\n}\n\nexport class TimestampSecond extends Timestamp {\n constructor(timezone = null) {\n super(TimeUnit.SECOND, timezone);\n }\n}\nexport class TimestampMillisecond extends Timestamp {\n constructor(timezone = null) {\n super(TimeUnit.MILLISECOND, timezone);\n }\n}\nexport class TimestampMicrosecond extends Timestamp {\n constructor(timezone = null) {\n super(TimeUnit.MICROSECOND, timezone);\n }\n}\nexport class TimestampNanosecond extends Timestamp {\n constructor(timezone = null) {\n super(TimeUnit.NANOSECOND, timezone);\n }\n}\n\nconst IntervalUnit = {\n DAY_TIME: 0,\n YEAR_MONTH: 1\n};\n\nexport class Interval extends DataType {\n readonly unit: number;\n constructor(unit: number) {\n super();\n this.unit = unit;\n }\n get typeId(): Type {\n return Type.Interval;\n }\n // get ArrayType() {\n // return Int32Array;\n // }\n get [Symbol.toStringTag](): string {\n return 'Interval';\n }\n toString(): string {\n return `Interval<${IntervalUnit[this.unit]}>`;\n }\n}\n\nexport class IntervalDayTime extends Interval {\n constructor() {\n super(IntervalUnit.DAY_TIME);\n }\n}\nexport class IntervalYearMonth extends Interval {\n constructor() {\n super(IntervalUnit.YEAR_MONTH);\n }\n}\n\nexport class FixedSizeList extends DataType {\n readonly listSize: number;\n readonly children: Field[];\n\n constructor(listSize: number, child: Field) {\n super();\n this.listSize = listSize;\n this.children = [child];\n }\n get typeId(): Type {\n return Type.FixedSizeList;\n }\n get valueType() {\n return this.children[0].type;\n }\n get valueField() {\n return this.children[0];\n }\n // get ArrayType() {\n // return this.valueType.ArrayType;\n // }\n get [Symbol.toStringTag](): string {\n return 'FixedSizeList';\n }\n toString(): string {\n return `FixedSizeList[${this.listSize}]<${this.valueType}>`;\n }\n}\n\nexport class Struct extends DataType {\n public readonly children: Field[];\n\n constructor(children: Field[]) {\n super();\n this.children = children;\n }\n\n public get typeId() {\n return Type.Struct;\n }\n public toString() {\n return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(', ')}}>`;\n }\n get [Symbol.toStringTag](): string {\n return 'Struct';\n }\n}\n","import {assert} from '../../utils/assert';\nimport Field from './field';\n\nexport type SchemaMetadata = Map<string, any>;\n\n/**\n * ArrowJS `Schema` API-compatible class for row-based tables (returned from `DataTable`)\n * https://loaders.gl/arrowjs/docs/api-reference/schema\n */\nexport default class Schema {\n fields: Field[];\n // TODO - Arrow just allows Map<string, string>\n metadata: SchemaMetadata;\n\n constructor(fields: Field[], metadata?: SchemaMetadata) {\n assert(Array.isArray(fields));\n checkNames(fields);\n // For kepler fields, create arrow compatible `Fields` that have kepler fields as `metadata`\n this.fields = fields;\n this.metadata = metadata || new Map();\n }\n\n // TODO - arrow only seems to compare fields, not metadata\n compareTo(other: Schema): boolean {\n if (this.metadata !== other.metadata) {\n return false;\n }\n if (this.fields.length !== other.fields.length) {\n return false;\n }\n for (let i = 0; i < this.fields.length; ++i) {\n if (!this.fields[i].compareTo(other.fields[i])) {\n return false;\n }\n }\n return true;\n }\n\n select(...columnNames: string[]): Schema {\n // Ensure column names reference valid fields\n const nameMap = Object.create(null);\n for (const name of columnNames) {\n nameMap[name] = true;\n }\n const selectedFields = this.fields.filter((field) => nameMap[field.name]);\n return new Schema(selectedFields, this.metadata);\n }\n\n selectAt(...columnIndices: number[]): Schema {\n // Ensure column indices reference valid fields\n const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean);\n return new Schema(selectedFields, this.metadata);\n }\n\n assign(schemaOrFields: Schema | Field[]): Schema {\n let fields: Field[];\n let metadata: SchemaMetadata = this.metadata;\n\n if (schemaOrFields instanceof Schema) {\n const otherSchema = schemaOrFields;\n fields = otherSchema.fields;\n metadata = mergeMaps(mergeMaps(new Map(), this.metadata), otherSchema.metadata);\n } else {\n fields = schemaOrFields;\n }\n\n // Create a merged list of fields, overwrite fields in place, new fields at end\n const fieldMap: {[key: string]: Field} = Object.create(null);\n\n for (const field of this.fields) {\n fieldMap[field.name] = field;\n }\n\n for (const field of fields) {\n fieldMap[field.name] = field;\n }\n\n const mergedFields = Object.values(fieldMap);\n\n return new Schema(mergedFields, metadata);\n }\n}\n\n// Warn if any duplicated field names\nfunction checkNames(fields) {\n const usedNames = {};\n for (const field of fields) {\n if (usedNames[field.name]) {\n // eslint-disable-next-line\n console.warn('Schema: duplicated field name', field.name, field);\n }\n usedNames[field.name] = true;\n }\n}\n\nfunction mergeMaps<T>(m1: T, m2: T): T {\n // @ts-ignore\n return new Map([...(m1 || new Map()), ...(m2 || new Map())]);\n}\n","// Replacement for the external assert method to reduce bundle size\n// Note: We don't use the second \"message\" argument in calling code,\n// so no need to support it here\nexport function assert(condition: boolean, message?: string) {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}\n","// PCD Loader, adapted from THREE.js (MIT license)\n// Description: A loader for PCD ascii and binary files.\n// Limitations: Compressed binary files are not supported.\n//\n// Attributions per original THREE.js source file:\n// @author Filipe Caixeta / http://filipecaixeta.com.br\n// @author Mugen87 / https://github.com/Mugen87\n\nimport {getMeshBoundingBox} from '@loaders.gl/schema';\nimport type {MeshAttribute, MeshAttributes} from '@loaders.gl/schema';\nimport type {PCDHeader} from './pcd-types';\nimport {getPCDSchema} from './get-pcd-schema';\n\ntype NormalizedAttributes = {\n POSITION: {\n value: Float32Array;\n size: number;\n };\n NORMAL?: {\n value: Float32Array;\n size: number;\n };\n COLOR_0?: {\n value: Uint8Array;\n size: number;\n };\n};\n\ntype HeaderAttributes = {\n [attributeName: string]: number[];\n};\n\nconst LITTLE_ENDIAN: boolean = true;\n\n/**\n *\n * @param data\n * @returns\n */\nexport default function parsePCD(data: ArrayBufferLike) {\n // parse header (always ascii format)\n const textData = new TextDecoder().decode(data);\n const pcdHeader = parsePCDHeader(textData);\n\n let attributes: any = {};\n\n // parse data\n switch (pcdHeader.data) {\n case 'ascii':\n attributes = parsePCDASCII(pcdHeader, textData);\n break;\n\n case 'binary':\n attributes = parsePCDBinary(pcdHeader, data);\n break;\n\n case 'binary_compressed':\n default:\n throw new Error(`PCD: ${pcdHeader.data} files are not supported`);\n }\n\n attributes = getMeshAttributes(attributes);\n\n const header = getMeshHeader(pcdHeader, attributes);\n\n const metadata = new Map([\n ['mode', '0'],\n ['boundingBox', JSON.stringify(header.boundingBox)]\n ]);\n\n const schema = getPCDSchema(pcdHeader, metadata);\n\n return {\n loaderData: {\n header: pcdHeader\n },\n header,\n schema,\n mode: 0, // POINTS\n indices: null,\n attributes\n };\n}\n\n// Create a header that contains common data for PointCloud category loaders\nfunction getMeshHeader(pcdHeader: PCDHeader, attributes: NormalizedAttributes): Partial<PCDHeader> {\n if (typeof pcdHeader.width === 'number' && typeof pcdHeader.height === 'number') {\n const pointCount = pcdHeader.width * pcdHeader.height; // Supports \"organized\" point sets\n return {\n vertexCount: pointCount,\n boundingBox: getMeshBoundingBox(attributes)\n };\n }\n return pcdHeader;\n}\n\n/**\n * @param attributes\n * @returns Normalized attributes\n */\nfunction getMeshAttributes(attributes: HeaderAttributes): {[attributeName: string]: MeshAttribute} {\n const normalizedAttributes: MeshAttributes = {\n POSITION: {\n // Binary PCD is only 32 bit\n value: new Float32Array(attributes.position),\n size: 3\n }\n };\n\n if (attributes.normal && attributes.normal.length > 0) {\n normalizedAttributes.NORMAL = {\n value: new Float32Array(attributes.normal),\n size: 3\n };\n }\n\n if (attributes.color && attributes.color.length > 0) {\n // TODO - RGBA\n normalizedAttributes.COLOR_0 = {\n value: new Uint8Array(attributes.color),\n size: 3\n };\n }\n\n return normalizedAttributes;\n}\n\n/**\n * Incoming data parsing\n * @param data\n * @returns Header\n */\n/* eslint-disable complexity, max-statements */\nfunction parsePCDHeader(data: string): PCDHeader {\n const result1 = data.search(/[\\r\\n]DATA\\s(\\S*)\\s/i);\n const result2 = /[\\r\\n]DATA\\s(\\S*)\\s/i.exec(data.substr(result1 - 1));\n\n const pcdHeader: any = {};\n pcdHeader.data = result2 && result2[1];\n if (result2 !== null) {\n pcdHeader.headerLen = (result2 && result2[0].length) + result1;\n }\n pcdHeader.str = data.substr(0, pcdHeader.headerLen);\n\n // remove comments\n\n pcdHeader.str = pcdHeader.str.replace(/\\#.*/gi, '');\n\n // parse\n\n pcdHeader.version = /VERSION (.*)/i.exec(pcdHeader.str);\n pcdHeader.fields = /FIELDS (.*)/i.exec(pcdHeader.str);\n pcdHeader.size = /SIZE (.*)/i.exec(pcdHeader.str);\n pcdHeader.type = /TYPE (.*)/i.exec(pcdHeader.str);\n pcdHeader.count = /COUNT (.*)/i.exec(pcdHeader.str);\n pcdHeader.width = /WIDTH (.*)/i.exec(pcdHeader.str);\n pcdHeader.height = /HEIGHT (.*)/i.exec(pcdHeader.str);\n pcdHeader.viewpoint = /VIEWPOINT (.*)/i.exec(pcdHeader.str);\n pcdHeader.points = /POINTS (.*)/i.exec(pcdHeader.str);\n\n // evaluate\n\n if (pcdHeader.version !== null) {\n pcdHeader.version = parseFloat(pcdHeader.version[1]);\n }\n\n if (pcdHeader.fields !== null) {\n pcdHeader.fields = pcdHeader.fields[1].split(' ');\n }\n\n if (pcdHeader.type !== null) {\n pcdHeader.type = pcdHeader.type[1].split(' ');\n }\n\n if (pcdHeader.width !== null) {\n pcdHeader.width = parseInt(pcdHeader.width[1], 10);\n }\n\n if (pcdHeader.height !== null) {\n pcdHeader.height = parseInt(pcdHeader.height[1], 10);\n }\n\n if (pcdHeader.viewpoint !== null) {\n pcdHeader.viewpoint = pcdHeader.viewpoint[1];\n }\n\n if (pcdHeader.points !== null) {\n pcdHeader.points = parseInt(pcdHeader.points[1], 10);\n }\n\n if (\n pcdHeader.points === null &&\n typeof pcdHeader.width === 'number' &&\n typeof pcdHeader.height === 'number'\n ) {\n pcdHeader.points = pcdHeader.width * pcdHeader.height;\n }\n\n if (pcdHeader.size !== null) {\n pcdHeader.size = pcdHeader.size[1].split(' ').map((x) => parseInt(x, 10));\n }\n\n if (pcdHeader.count !== null) {\n pcdHeader.count = pcdHeader.count[1].split(' ').map((x) => parseInt(x, 10));\n } else {\n pcdHeader.count = [];\n if (pcdHeader.fields !== null) {\n for (let i = 0; i < pcdHeader.fields.length; i++) {\n pcdHeader.count.push(1);\n }\n }\n }\n\n pcdHeader.offset = {};\n\n let sizeSum = 0;\n if (pcdHeader.fields !== null && pcdHeader.size !== null) {\n for (let i = 0; i < pcdHeader.fields.length; i++) {\n if (pcdHeader.data === 'ascii') {\n pcdHeader.offset[pcdHeader.fields[i]] = i;\n } else {\n pcdHeader.offset[pcdHeader.fields[i]] = sizeSum;\n sizeSum += pcdHeader.size[i];\n }\n }\n }\n\n // for binary only\n pcdHeader.rowSize = sizeSum;\n\n return pcdHeader;\n}\n\n/**\n * @param pcdHeader\n * @param textData\n * @returns [attributes]\n */\n/* eslint-enable complexity, max-statements */\nfunction parsePCDASCII(pcdHeader: PCDHeader, textData: string): HeaderAttributes {\n const position: number[] = [];\n const normal: number[] = [];\n const color: number[] = [];\n\n const offset = pcdHeader.offset;\n const pcdData = textData.substr(pcdHeader.headerLen);\n const lines = pcdData.split('\\n');\n\n for (let i = 0; i < lines.length; i++) {\n if (lines[i] !== '') {\n const line = lines[i].split(' ');\n\n if (offset.x !== undefined) {\n position.push(parseFloat(line[offset.x]));\n position.push(parseFloat(line[offset.y]));\n position.push(parseFloat(line[offset.z]));\n }\n\n if (offset.rgb !== undefined) {\n const floatValue = parseFloat(line[offset.rgb]);\n const binaryColor = new Float32Array([floatValue]);\n const dataview = new DataView(binaryColor.buffer, 0);\n color.push(dataview.getUint8(0));\n color.push(dataview.getUint8(1));\n color.push(dataview.getUint8(2));\n // TODO - handle alpha channel / RGBA?\n }\n\n if (offset.normal_x !== undefined) {\n normal.push(parseFloat(line[offset.normal_x]));\n normal.push(parseFloat(line[offset.normal_y]));\n normal.push(parseFloat(line[offset.normal_z]));\n }\n }\n }\n\n return {position, normal, color};\n}\n\n/**\n * @param pcdHeader\n * @param data\n * @returns [attributes]\n */\nfunction parsePCDBinary(pcdHeader: PCDHeader, data: ArrayBufferLike): HeaderAttributes {\n const position: number[] = [];\n const normal: number[] = [];\n const color: number[] = [];\n\n const dataview = new DataView(data, pcdHeader.headerLen);\n const offset = pcdHeader.offset;\n\n for (let i = 0, row = 0; i < pcdHeader.points; i++, row += pcdHeader.rowSize) {\n if (offset.x !== undefined) {\n position.push(dataview.getFloat32(row + offset.x, LITTLE_ENDIAN));\n position.push(dataview.getFloat32(row + offset.y, LITTLE_ENDIAN));\n position.push(dataview.getFloat32(row + offset.z, LITTLE_ENDIAN));\n }\n\n if (offset.rgb !== undefined) {\n color.push(dataview.getUint8(row + offset.rgb + 0));\n color.push(dataview.getUint8(row + offset.rgb + 1));\n color.push(dataview.getUint8(row + offset.rgb + 2));\n }\n\n if (offset.normal_x !== undefined) {\n normal.push(dataview.getFloat32(row + offset.normal_x, LITTLE_ENDIAN));\n normal.push(dataview.getFloat32(row + offset.normal_y, LITTLE_ENDIAN));\n normal.push(dataview.getFloat32(row + offset.normal_z, LITTLE_ENDIAN));\n }\n }\n\n return {position, normal, color};\n}\n","import {Schema, Field, Float32, Uint8, FixedSizeList} from '@loaders.gl/schema';\nimport type {PCDHeader} from './pcd-types';\n\ntype SchemaMetadata = Map<string, any>;\n\n/**\n * Gets schema from PCD header\n * @param PCDheader\n * @param metadata\n * @returns Schema\n */\nexport function getPCDSchema(PCDheader: PCDHeader, metadata: SchemaMetadata): Schema {\n const offset = PCDheader.offset;\n\n const fields: Field[] = [];\n\n if (offset.x !== undefined) {\n fields.push(\n new Field('POSITION', new FixedSizeList(3, new Field('xyz', new Float32())), false)\n );\n }\n\n if (offset.normal_x !== undefined) {\n fields.push(new Field('NORMAL', new FixedSizeList(3, new Field('xyz', new Float32())), false));\n }\n\n if (offset.rgb !== undefined) {\n fields.push(new Field('COLOR_0', new FixedSizeList(3, new Field('rgb', new Uint8())), false));\n }\n\n return new Schema(fields, metadata);\n}\n","import type {Loader} from '@loaders.gl/loader-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Worker loader for PCD - Point Cloud Data\n */\nexport const PCDLoader = {\n name: 'PCD (Point Cloud Data)',\n id: 'pcd',\n module: 'pcd',\n version: VERSION,\n worker: true,\n extensions: ['pcd'],\n mimeTypes: ['text/plain'],\n options: {\n pcd: {}\n }\n};\n\nexport const _typecheckPCDLoader: Loader = PCDLoader;\n","import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport parsePCDSync from './lib/parse-pcd';\nimport {PCDLoader as PCDWorkerLoader} from './pcd-loader';\n\nexport {PCDWorkerLoader};\n\n/**\n * Loader for PCD - Point Cloud Data\n */\nexport const PCDLoader = {\n ...PCDWorkerLoader,\n parse: async (arrayBuffer) => parsePCDSync(arrayBuffer),\n parseSync: parsePCDSync\n};\n\nexport const _typecheckPCDLoader: LoaderWithParser = PCDLoader;\n","import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport {PCDLoader} from '../index';\n\ncreateLoaderWorker(PCDLoader);\n"],"sourceRoot":""}